Add single-instance detection
[tilda-gobject.git] / tilda-window.c
index e7a4f24..c5ac71a 100644 (file)
@@ -1,6 +1,9 @@
+#include <string.h>
+
 #include "tilda.h"
 #include "tilda-window.h"
 #include "tilda-window-dbus-glue.h"
+#include "tomboykeybinder.h"
 
 /**
  * Find the TildaTerminal corresponding to the currently selected
@@ -81,7 +84,7 @@ tilda_window_add_term (TildaWindow *tw)
        GtkWidget *label = gtk_label_new ("Tilda");
        gint index = gtk_notebook_prepend_page (GTK_NOTEBOOK(tw->notebook), tt->hbox, label);
        gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK(tw->notebook), tt->hbox, TRUE, TRUE, GTK_PACK_END);
-       //gtk_notebook_set_current_page (GTK_NOTEBOOK(tw->notebook), index);
+       gtk_notebook_set_current_page (GTK_NOTEBOOK(tw->notebook), index);
 
        if (gtk_notebook_get_n_pages (GTK_NOTEBOOK(tw->notebook)) > 1)
                gtk_notebook_set_show_tabs (GTK_NOTEBOOK(tw->notebook), TRUE);
@@ -273,7 +276,7 @@ tilda_window_try_to_bind_key (TildaWindow *self, const gchar *new_key)
 
        /* Unbind if we were set */
        if (self->key)
-               tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb, self);
+               tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb);
 
        ret = tomboy_keybinder_bind (new_key, tilda_window_keybinding_cb, self);
 
@@ -899,34 +902,4 @@ tilda_window_get_type (void)
        return type;
 }
 
-#if 0
-
-int main (int argc, char *argv[])
-{
-       GObject *tw;
-       gint test_number = INT_MIN;
-
-       /* Initialize the GObject type system */
-       g_type_init ();
-       gtk_init (&argc, &argv);
-
-       tw = g_object_new (TILDA_TYPE_WINDOW, "number", 10, NULL);
-       g_object_get (G_OBJECT (tw), "number", &test_number, NULL);
-       g_assert (test_number == 10);
-
-       g_object_unref (G_OBJECT (tw));
-
-       tw = g_object_new (TILDA_TYPE_WINDOW, "number", 22, NULL);
-       g_object_get (G_OBJECT (tw), "number", &test_number, NULL);
-       g_assert (test_number == 22);
-
-       gtk_main ();
-
-       g_object_unref (G_OBJECT (tw));
-
-       return 0;
-}
-
-#endif
-
 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */