let it build against gtk2

This commit is contained in:
gbeauche 2005-03-19 09:35:01 +00:00
parent 8071d90849
commit b29b5e4e23

View File

@ -172,7 +172,7 @@ static GtkWidget *make_entry(GtkWidget *top, int label_id, const char *prefs_ite
return entry;
}
static char *get_file_entry_path(GtkWidget *entry)
static const gchar *get_file_entry_path(GtkWidget *entry)
{
return gtk_entry_get_text(GTK_ENTRY(entry));
}
@ -307,7 +307,11 @@ bool PrefsEditor(void)
GtkAccelGroup *accel_group = gtk_accel_group_new();
GtkItemFactory *item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_item_factory_create_items(item_factory, sizeof(menu_items) / sizeof(menu_items[0]), menu_items, NULL);
#if GTK_CHECK_VERSION(1,3,15)
gtk_window_add_accel_group(GTK_WINDOW(win), accel_group);
#else
gtk_accel_group_attach(accel_group, GTK_OBJECT(win));
#endif
GtkWidget *menu_bar = gtk_item_factory_get_widget(item_factory, "<main>");
gtk_widget_show(menu_bar);
gtk_box_pack_start(GTK_BOX(box), menu_bar, FALSE, TRUE, 0);
@ -361,7 +365,7 @@ struct file_req_assoc {
// Volume selected for addition
static void add_volume_ok(GtkWidget *button, file_req_assoc *assoc)
{
char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(assoc->req));
gchar *file = (gchar *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(assoc->req));
gtk_clist_append(GTK_CLIST(volume_list), &file);
gtk_widget_destroy(assoc->req);
delete assoc;
@ -370,9 +374,9 @@ static void add_volume_ok(GtkWidget *button, file_req_assoc *assoc)
// Volume selected for creation
static void create_volume_ok(GtkWidget *button, file_req_assoc *assoc)
{
char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(assoc->req));
gchar *file = (gchar *)gtk_file_selection_get_filename(GTK_FILE_SELECTION(assoc->req));
char *str = gtk_entry_get_text(GTK_ENTRY(assoc->entry));
const gchar *str = gtk_entry_get_text(GTK_ENTRY(assoc->entry));
int size = atoi(str);
char cmd[1024];