summaryrefslogtreecommitdiff
path: root/gtk/hotlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/hotlist.c')
-rw-r--r--gtk/hotlist.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/gtk/hotlist.c b/gtk/hotlist.c
index dc95866db..d7b5b9e8f 100644
--- a/gtk/hotlist.c
+++ b/gtk/hotlist.c
@@ -90,7 +90,7 @@ static struct menu_events menu_events[] = {
};
static struct nsgtk_treeview *hotlist_window;
-static GladeXML *gladeFile;
+static GtkBuilder *gladeFile;
GtkWindow *wndHotlist;
@@ -101,19 +101,23 @@ bool nsgtk_hotlist_init(const char *glade_file_location)
GtkScrolledWindow *scrolled;
GtkDrawingArea *drawing_area;
- gladeFile = glade_xml_new(glade_file_location, NULL, NULL);
- if (gladeFile == NULL)
+ GError* error = NULL;
+ gladeFile = gtk_builder_new();
+ if (!gtk_builder_add_from_file(gladeFile, glade_file_location, &error)) {
+ g_warning("Couldn't load builder file: %s", error->message);
+ g_error_free(error);
return false;
+ }
- glade_xml_signal_autoconnect(gladeFile);
+ gtk_builder_connect_signals(gladeFile, NULL);
- wndHotlist = GTK_WINDOW(glade_xml_get_widget(gladeFile, "wndHotlist"));
+ wndHotlist = GTK_WINDOW(gtk_builder_get_object(gladeFile, "wndHotlist"));
window = wndHotlist;
- scrolled = GTK_SCROLLED_WINDOW(glade_xml_get_widget(gladeFile,
+ scrolled = GTK_SCROLLED_WINDOW(gtk_builder_get_object(gladeFile,
"hotlistScrolled"));
- drawing_area = GTK_DRAWING_AREA(glade_xml_get_widget(gladeFile,
+ drawing_area = GTK_DRAWING_AREA(gtk_builder_get_object(gladeFile,
"hotlistDrawingArea"));
@@ -145,12 +149,14 @@ bool nsgtk_hotlist_init(const char *glade_file_location)
void nsgtk_hotlist_init_menu(void)
{
struct menu_events *event = menu_events;
-
- while (event->widget != NULL)
- {
- GtkWidget *w = glade_xml_get_widget(gladeFile, event->widget);
- g_signal_connect(G_OBJECT(w), "activate", event->handler,
- hotlist_window);
+ GtkWidget *w;
+
+ while (event->widget != NULL) {
+ w = GTK_WIDGET(gtk_builder_get_object(gladeFile, event->widget));
+ if (w == NULL) {
+ LOG(("Unable to connect menu widget ""%s""", event->widget)); } else {
+ g_signal_connect(G_OBJECT(w), "activate", event->handler, hotlist_window);
+ }
event++;
}
}