2007-05-17 Murray Cumming <murrayc@murrayc.com>
+ * src/maemo/modest-main-window-ui.h:
+ * src/modest-ui-actions.c:
+ * src/modest-ui-actions.h:
+ Connect the Tools/SMTP Servers menu item to
+ modest_ui_actions_on_smtp_servers(), which shows the connection-specific
+ SMTP servers dialog, as in the UI specification and saves changes when it
+ is closed. This fixed projects.maemo.org bug NB#56305 .
+
+2007-05-17 Murray Cumming <murrayc@murrayc.com>
+
* src/maemo/modest-connection-specific-smtp-window.c:
(modest_connection_specific_smtp_window_init):
Use gtk_window_set_default_size() to make this window big enough, so
MODEST_CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW (window),
priv->account_manager);
+ const gchar* server_name = data ? data->hostname : NULL;
gtk_list_store_set (GTK_LIST_STORE (priv->model), &iter,
MODEL_COL_SERVER_ACCOUNT_DATA, data,
+ MODEL_COL_SERVER_NAME, server_name,
-1);
}
}
/* Setup the tree view: */
priv->treeview = GTK_TREE_VIEW (gtk_tree_view_new_with_model (priv->model));
+ /* Show the column headers,
+ * which does not seem to be the default on Maemo.
+ */
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(priv->treeview), TRUE);
+
/* name column:
* The ID model column in not shown in the view. */
GtkTreeViewColumn *view_column = gtk_tree_view_column_new ();
/* Tools */
{ "ToolsSettings", NULL, N_("mcen_me_inbox_options"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_settings) },
{ "ToolsAccounts", NULL, N_("mcen_me_inbox_accounts"), NULL, NULL, G_CALLBACK(modest_ui_actions_on_accounts) },
- { "ToolsSMTPServers", NULL, N_("mcen_me_inbox_globalsmtpservers"), NULL, NULL, NULL },
+ { "ToolsSMTPServers", NULL, N_("mcen_me_inbox_globalsmtpservers"), NULL, NULL, G_CALLBACK(modest_ui_actions_on_smtp_servers) },
{ "ToolsSendReceive", NULL, N_("mcen_me_inbox_sendandreceive") }, /* submenu */
{ "ToolsSendReceiveAll", NULL, N_("mcen_me_inbox_sendandreceive_all"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
{ "ToolsSendReceiveCancelSending", NULL, N_("mcen_me_outbox_cancelsend"), NULL, NULL, NULL },
#include <widgets/modest-details-dialog.h>
#include <widgets/modest-attachments-view.h>
#include "widgets/modest-global-settings-dialog.h"
+#include "modest-connection-specific-smtp-window.h"
#include "modest-account-mgr-helpers.h"
#include "modest-mail-operation.h"
#include "modest-text-utils.h"
void
modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win)
{
-
/* This is currently only implemented for Maemo,
* because it requires a providers preset file which is not publically available.
*/
#endif /* MODEST_PLATFORM_MAEMO */
}
+static void
+on_smtp_servers_window_hide (GtkWindow* window, gpointer user_data)
+{
+ ModestWindow *main_window = MODEST_WINDOW (user_data);
+
+ /* Save any changes. */
+ modest_connection_specific_smtp_window_save_server_accounts (
+ MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (window),
+ modest_window_get_active_account (main_window));
+ gtk_widget_destroy (GTK_WIDGET (window));
+}
+
+void
+modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win)
+{
+ /* This is currently only implemented for Maemo,
+ * because it requires an API (libconic) to detect different connection
+ * possiblities.
+ */
+#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
+
+ /* Create the window if necessary: */
+ GtkWidget *specific_window = GTK_WIDGET (modest_connection_specific_smtp_window_new ());
+ modest_connection_specific_smtp_window_fill_with_connections (
+ MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (specific_window),
+ modest_runtime_get_account_mgr(),
+ modest_window_get_active_account (win));
+
+ /* Show the window: */
+ gtk_window_set_transient_for (GTK_WINDOW (specific_window), GTK_WINDOW (win));
+ gtk_window_set_modal (GTK_WINDOW (specific_window), TRUE);
+ gtk_widget_show (specific_window);
+
+ /* Save changes when the window is hidden: */
+ g_signal_connect (specific_window, "hide",
+ G_CALLBACK (on_smtp_servers_window_hide), win);
+#endif /* MODEST_PLATFORM_MAEMO */
+}
+
void
modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win)
{
void modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win);
+void modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win);
+
void modest_ui_actions_on_add_to_contacts (GtkAction *action, ModestWindow *win);
void modest_ui_actions_on_select_contacts (GtkAction *action, ModestMsgEditWindow *win);