* added some comments and handling of the Edit/Delete buttons sensitivity
authorSilvan Marco Fin <silvan@kernelconcepts.de>
Tue, 20 Jun 2006 16:22:12 +0000 (16:22 +0000)
committerSilvan Marco Fin <silvan@kernelconcepts.de>
Tue, 20 Jun 2006 16:22:12 +0000 (16:22 +0000)
pmo-trunk-r291

src/gtk-glade/modest-ui-account-setup.c
src/gtk-glade/modest-ui-account-setup.h
src/gtk-glade/modest-ui-wizard.h

index 911490b..27225c5 100644 (file)
@@ -175,6 +175,11 @@ identity_edit_action(GtkWidget *button,
                           &selected_iter,
                           IDENTITY_NAME, &identity_name,
                           -1);
+       /* We use the available tree model from the accounts page to display a selection
+        * of transports in the identities.
+        * FIXME: atm all server accounts are displayed and incoming accounts are of no use
+        * as a transport.
+        */
        acc_liststore=GTK_LIST_STORE(gtk_tree_view_get_model (GTK_TREE_VIEW(cb_data->acc_tree_view)));
 
        identity_setup_dialog (cb_data->modest_ui, acc_liststore, identity_name);
@@ -303,9 +308,19 @@ refresh_accounts_on_add(ModestAccountMgr *modest_acc_mgr,
 static void
 refresh_accounts_on_remove(ModestAccountMgr *modest_acc_mgr,
                        void *nu1,
-                       gpointer userdata)
-{
+                       gpointer userdata) {
+
+       GladeXML *glade_xml = (GladeXML *) userdata;
+       GtkWidget *button;
+
        refresh_accounts(modest_acc_mgr, (GladeXML *) userdata);
+       /* Since we loose the selection through the delete operation, we need to
+        * change the buttons sensitivity .
+        */
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
 }
 
 static void
@@ -329,7 +344,19 @@ static void
 refresh_identities_on_remove(ModestIdentityMgr *modest_id_mgr,
                             void *nu1,
                             gpointer userdata) {
-       refresh_identities(modest_id_mgr, (GladeXML *) userdata);
+
+       GladeXML *glade_xml = (GladeXML *) userdata;
+       GtkWidget *button;
+
+       refresh_identities(modest_id_mgr, glade_xml);
+
+       /* Since we loose the selection through the delete operation, we need to
+        * change the buttons sensitivity .
+        */
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
 }
 
 static void
index 77b0a5e..cb2e80e 100644 (file)
@@ -6,8 +6,15 @@
 
 #include "modest-ui-glade.h"
 
-void account_settings (GtkWidget *,
-                       gpointer);
+/**
+ * account_settings:
+ * @GtkWidget: The widget by which this CALLBACK is called.
+ * @gpointer: user data set when the signal handler was connected. A
+ * ModestUI is needed here.
+ */
+void
+account_settings (GtkWidget *,
+                  gpointer);
 
 #endif /* __MODEST_UI_ACCOUNT_SETUP_H__ */
 
index 1086831..c9cdd54 100644 (file)
@@ -6,9 +6,21 @@
 
 #include "modest-ui-glade.h"
 
+/**
+ * wizard_account_dialog:
+ * @modest-ui: a ModestUI instance
+ *
+ * Handle the dialog window acting as account wizard. The wizard allows
+ * the creation of identities and server accounts.
+ */
 void
 wizard_account_dialog(ModestUI *modest_ui);
 
+/**
+ * new_wizard_account:
+ * @GtkWidget: The widget by which this CALLBACK is called.
+ * @gpointer: A ModestUI is needed as second argument.
+ */
 void
 new_wizard_account (GtkWidget *,
                     gpointer);