]> git.0d.be Git - empathy.git/commitdiff
set unsensitive the add button if there is no profile installed and tell
authorXavier Claessens <xclaesse@gmail.com>
Fri, 19 Oct 2007 12:48:29 +0000 (12:48 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 19 Oct 2007 12:48:29 +0000 (12:48 +0000)
2007-10-19  Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-profile-chooser.c:
* libempathy-gtk/empathy-profile-chooser.h:
* libempathy-gtk/empathy-accounts-dialog.c: set unsensitive the add
button if there is no profile installed and tell the user to install
some connection managers.

* libempathy-gtk/empathy-ui-utils.c: Fix indentation.

svn path=/trunk/; revision=381

ChangeLog
libempathy-gtk/empathy-accounts-dialog.c
libempathy-gtk/empathy-profile-chooser.c
libempathy-gtk/empathy-profile-chooser.h
libempathy-gtk/empathy-ui-utils.c

index 39bd99903ac584b402e6640bbf8e2958bedb5c3b..5b8b47b81db0bc1c667df5b772eb85f5d532acc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-10-19  Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-profile-chooser.c:
+       * libempathy-gtk/empathy-profile-chooser.h:
+       * libempathy-gtk/empathy-accounts-dialog.c: set unsensitive the add
+       button if there is no profile installed and tell the user to install
+       some connection managers.
+
+       * libempathy-gtk/empathy-ui-utils.c: Fix indentation.
+
 2007-10-19  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-chat-window.c: If EmpathyChat object does not
index cc8ba4f455c2e7b1d232e63e2e33048a5a70731a..914e6d47196dac04a79427de9e3f5896e40f687c 100644 (file)
@@ -240,6 +240,8 @@ accounts_dialog_update_account (EmpathyAccountsDialog *dialog,
        if (!account) {
                GtkTreeView  *view;
                GtkTreeModel *model;
+               GString      *string;
+               gchar        *str;
 
                gtk_widget_show (dialog->frame_no_account);
                gtk_widget_hide (dialog->vbox_details);
@@ -250,25 +252,32 @@ accounts_dialog_update_account (EmpathyAccountsDialog *dialog,
                view = GTK_TREE_VIEW (dialog->treeview);
                model = gtk_tree_view_get_model (view);
 
+               if (empathy_profile_chooser_n_profiles (dialog->combobox_profile) > 0) {
+                       string = g_string_new (_("To add a new account, you can click on the "
+                                                "'Add' button and a new entry will be created "
+                                                "for you to start configuring."));
+               } else {
+                       string = g_string_new (_("To add a new account, you first have to "
+                                                "install a backend for each protocol "
+                                                "you want to use."));
+               }
+
                if (gtk_tree_model_iter_n_children (model, NULL) > 0) {
                        gtk_label_set_markup (GTK_LABEL (dialog->label_no_account),
                                              _("<b>No Account Selected</b>"));
-                       gtk_label_set_markup (GTK_LABEL (dialog->label_no_account_blurb),
-                                             _("To add a new account, you can click on the "
-                                               "'Add' button and a new entry will be created "
-                                               "for you to start configuring.\n"
-                                               "\n"
-                                               "If you do not want to add an account, simply "
-                                               "click on the account you want to configure in "
-                                               "the list on the left."));
+                       g_string_append (string, _("\n\n"
+                                       "If you do not want to add an account, simply "
+                                       "click on the account you want to configure in "
+                                       "the list on the left."));
                } else {
                        gtk_label_set_markup (GTK_LABEL (dialog->label_no_account),
                                              _("<b>No Accounts Configured</b>"));
-                       gtk_label_set_markup (GTK_LABEL (dialog->label_no_account_blurb),
-                                             _("To add a new account, you can click on the "
-                                               "'Add' button and a new entry will be created "
-                                               "for you to start configuring."));
                }
+
+               str = g_string_free (string, FALSE);
+               gtk_label_set_markup (GTK_LABEL (dialog->label_no_account_blurb),
+                                     str);
+               g_free (str);
        } else {
                McProfile *profile;
                const gchar *config_ui;
@@ -1044,6 +1053,9 @@ empathy_accounts_dialog_show (GtkWindow *parent)
                          dialog->combobox_profile,
                          TRUE, TRUE, 0);
        gtk_widget_show (dialog->combobox_profile);
+       if (empathy_profile_chooser_n_profiles (dialog->combobox_profile) <= 0) {
+               gtk_widget_set_sensitive (dialog->button_add, FALSE);
+       }
 
        /* Set up signalling */
        dialog->mc = empathy_mission_control_new ();
index ae32aff7f3247bb477dfd23b731ce95cd64843c7..256f95ddd773cbe7bc85af5b586c0fff3fea322c 100644 (file)
@@ -55,6 +55,16 @@ empathy_profile_chooser_get_selected (GtkWidget *widget)
        return profile;
 }
 
+gint
+empathy_profile_chooser_n_profiles (GtkWidget *widget)
+{
+       GtkTreeModel *model;
+
+       model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
+
+       return gtk_tree_model_iter_n_children (model, NULL);
+}
+
 static gint
 profile_chooser_sort_profile_value (McProfile *profile)
 {
index 6a9c405a2deec42ab857e281e4939c1545b9194f..7298c12ccf0e9cf29ba8f0317a92b847c19b01e7 100644 (file)
@@ -29,6 +29,7 @@ G_BEGIN_DECLS
 
 GtkWidget * empathy_profile_chooser_new          (void);
 McProfile * empathy_profile_chooser_get_selected (GtkWidget *widget);
+gint        empathy_profile_chooser_n_profiles   (GtkWidget *widget);
 
 G_END_DECLS
 #endif /*  __EMPATHY_PROTOCOL_CHOOSER_H__ */
index eabdc0a4607763ef1c5752ce12efc5bd9aa4b1cc..16f0116dee43139e8601eea23577a9a637efabf7 100644 (file)
@@ -1259,7 +1259,7 @@ empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon)
        XChangeProperty (dpy,
                         GDK_WINDOW_XID (gdk_window),
                         gdk_x11_get_xatom_by_name_for_display (gdk_drawable_get_display (gdk_window),
-                                                               "_NET_WM_ICON_GEOMETRY"),
+                        "_NET_WM_ICON_GEOMETRY"),
                         XA_CARDINAL, 32, PropModeReplace,
                         (guchar *)&data, 4);