]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/gui/gtk/JubGtkUI.m
Add a minimal JubChatClient class and refactor other code to use it
[jubjub.git] / src / gui / gtk / JubGtkUI.m
index 26c2cbb978895d4f557942bb2b08ea4cd516b3b7..b70e3df923c0ea3c47fc5e3972bebf169de540bc 100644 (file)
@@ -10,7 +10,7 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 }
 
 @implementation JubGtkUI
-- initWithConnection: (XMPPConnection*)connection
+- initWithClient: (JubChatClient*)client;
 {
        self = [super init];
 
@@ -23,11 +23,8 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 
                gtk_init(argc, argv);
 
-               builder = gtk_builder_new();
-               gtk_builder_add_from_file(builder, "data/gtk/roster.ui", NULL);
-
-               rosterUI = [[JubGtkRosterUI alloc] initWithBuilder: builder
-                                                       connection: connection];
+               rosterUI = [[JubGtkRosterUI alloc]
+                   initWithClient: client];
        } @catch (id e) {
                [self release];
                @throw e;
@@ -39,22 +36,12 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 - (void)dealloc
 {
        [rosterUI release];
-       g_object_unref(G_OBJECT(builder));
 
        [super dealloc];
 }
 
 - (void)startUIThread
 {
-       GtkWidget *roster_window;
-
-       roster_window =
-           GTK_WIDGET(gtk_builder_get_object(builder, "RosterWindow"));
-
-       gtk_builder_connect_signals(builder, NULL);
-
-       gtk_widget_show(roster_window);
-
        [[OFThread threadWithBlock: ^(void){
                gtk_main();
                [OFApplication terminate];
@@ -62,9 +49,4 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
                return nil;
        }] start];
 }
-
-- (id<XMPPRosterDelegate>)rosterDelegate
-{
-       return rosterUI;
-}
 @end