]> git.0d.be Git - empathy.git/commitdiff
Add a command line option to hide contact list on startup. Fixes bug #535080 (Marco...
authorXavier Claessens <xclaesse@src.gnome.org>
Wed, 4 Jun 2008 14:42:14 +0000 (14:42 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Wed, 4 Jun 2008 14:42:14 +0000 (14:42 +0000)
svn path=/trunk/; revision=1146

src/empathy-status-icon.c
src/empathy-status-icon.h
src/empathy.c

index 2ab49a63b12e66810e69226443bbc94867cef42f..c030a5887b16fe6117dc5dd308d2a513c5f9f8e9 100644 (file)
@@ -739,7 +739,7 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
 }
 
 EmpathyStatusIcon *
-empathy_status_icon_new (GtkWindow *window)
+empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
 {
        EmpathyStatusIconPriv *priv;
        EmpathyStatusIcon     *icon;
@@ -756,9 +756,13 @@ empathy_status_icon_new (GtkWindow *window)
                          G_CALLBACK (status_icon_delete_event_cb),
                          icon);
 
-       empathy_conf_get_bool (empathy_conf_get (),
-                             EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
-                             &should_hide);
+       if (!hide_contact_list) {
+               empathy_conf_get_bool (empathy_conf_get (),
+                                      EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
+                                      &should_hide);
+       } else {
+               should_hide = TRUE;
+       }
 
        if (gtk_window_is_active (priv->window) == should_hide) {
                status_icon_set_visibility (icon, !should_hide, FALSE);
index bb33b1c3b2eee0f7a0804e234afa7d85bb843017..ca21af83325766f33ce3141cd28e10a2a77e08e2 100644 (file)
@@ -46,7 +46,8 @@ struct _EmpathyStatusIconClass {
 };
 
 GType              empathy_status_icon_get_type (void) G_GNUC_CONST;
-EmpathyStatusIcon *empathy_status_icon_new      (GtkWindow *window);
+EmpathyStatusIcon *empathy_status_icon_new      (GtkWindow *window,
+                                                gboolean   hide_contact_list);
 
 G_END_DECLS
 
index d30935d24c47ab6eb4e7398e534edcb2e6ef5117..5851d41ac8cc646bd3700335922edc548172be2d 100644 (file)
@@ -358,12 +358,17 @@ main (int argc, char *argv[])
        EmpathyIdle       *idle;
        gboolean           autoconnect = TRUE;
        gboolean           no_connect = FALSE; 
+       gboolean           hide_contact_list = FALSE;
        GError            *error = NULL;
        GOptionEntry       options[] = {
                { "no-connect", 'n',
                  0, G_OPTION_ARG_NONE, &no_connect,
                  N_("Don't connect on startup"),
                  NULL },
+               { "hide-contact-list", 'h',
+                 0, G_OPTION_ARG_NONE, &hide_contact_list,
+                 N_("Don't show the contact list on startup"),
+                 NULL },
                { NULL }
        };
 
@@ -446,7 +451,7 @@ main (int argc, char *argv[])
 
        /* Setting up UI */
        window = empathy_main_window_show ();
-       icon = empathy_status_icon_new (GTK_WINDOW (window));
+       icon = empathy_status_icon_new (GTK_WINDOW (window), hide_contact_list);
 
        if (connection) {
                /* We se the callback here because we need window */