[anjal] Add support for Account & Settings view.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Add support for Account & Settings view.
- Date: Wed, 29 Apr 2009 02:11:18 -0400 (EDT)
commit 59ebdf7386d2c8167826bd5656a3cf5f5099e540
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed Apr 29 11:37:51 2009 +0530
Add support for Account & Settings view.
---
src/mail-shell.c | 12 +++++++++++-
src/mail-view.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
src/mail-view.h | 4 +++-
3 files changed, 59 insertions(+), 4 deletions(-)
diff --git a/src/mail-shell.c b/src/mail-shell.c
index 5933789..5e24fc0 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -184,6 +184,15 @@ ms_check_mail (GtkButton *button, gpointer data)
}
static void
+settings_btn_clicked (GtkButton *button, gpointer data)
+{
+ MailShell *shell = (MailShell *) data;
+ MailView *view = shell->mail_component->mail_view;
+
+ mail_view_add_page (view, MAIL_VIEW_SETTINGS);
+}
+
+static void
ms_init_style (GtkStyle *style)
{
pcolor_sel = &style->base[GTK_STATE_SELECTED];
@@ -326,7 +335,8 @@ mail_shell_construct (MailShell *shell)
gtk_button_set_image ((GtkButton *)priv->settings, gtk_image_new_from_icon_name("preferences-system", GTK_ICON_SIZE_BUTTON));
gtk_box_pack_start ((GtkBox *)priv->option_bar, priv->settings, FALSE, FALSE, 6);
gtk_widget_show (priv->settings);
-
+ g_signal_connect (priv->settings, "clicked", G_CALLBACK (settings_btn_clicked), shell);
+
priv->quit = gtk_tool_button_new_from_stock ("gtk-close");
// gtk_tool_button_set_icon_widget ((GtkButton *)priv->quit, gtk_image_new_from_icon_name("gtk-close", GTK_ICON_SIZE_BUTTON));
gtk_box_pack_start ((GtkBox *)priv->option_bar, priv->quit, FALSE, FALSE, 0);
diff --git a/src/mail-view.c b/src/mail-view.c
index d29d141..c635e62 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -29,6 +29,8 @@
#include "mail-folder-view.h"
#include "mail-composer-view.h"
#include "mail-conv-view.h"
+#include "mail-settings-view.h"
+#include "mail-account-view.h"
#include "mail/em-folder-tree.h"
#include <e-util/e-icon-factory.h>
@@ -109,7 +111,7 @@ mv_switch (GtkNotebook *notebook,GtkNotebookPage *page, guint page_num, gpoi
mail_composer_view_activate (child, shell->folder_tree, shell->check_mail, shell->sort_by, TRUE);
else if (child->type == MAIL_VIEW_MESSAGE)
mail_conv_view_activate (child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
- else //if (child->type == MAIL_VIEW_FOLDER) /* For some reason, Im not able to get right type */
+ else if (child->type == MAIL_VIEW_FOLDER) /* For some reason, Im not able to get right type */
mail_folder_view_activate (child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, TRUE);
@@ -309,6 +311,42 @@ mail_view_add_message (MailView *mv)
return mcv;
}
+static MailViewChild *
+mail_view_add_settings (MailView *mv)
+{
+ MailSettingsView *msv = mail_settings_view_new ();
+ gint position = 0;
+
+ gtk_widget_show (msv);
+ mv->priv->current_view = msv;
+ mv->priv->children = g_list_append (mv->priv->children, msv);
+ position = gtk_notebook_append_page (mv, msv, mail_settings_view_get_tab_widget(msv));
+ g_signal_connect (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
+ gtk_notebook_set_tab_reorderable (mv, msv, TRUE);
+ gtk_notebook_set_current_page (mv, position);
+ gtk_notebook_set_tab_label_packing (mv, msv, FALSE, FALSE, 0);
+
+ return msv;
+}
+
+static MailViewChild *
+mail_view_add_account (MailView *mv)
+{
+ MailAccountView *msv = mail_account_view_new ();
+ gint position = 0;
+
+ gtk_widget_show (msv);
+ mv->priv->current_view = msv;
+ mv->priv->children = g_list_append (mv->priv->children, msv);
+ position = gtk_notebook_append_page (mv, msv, mail_account_view_get_tab_widget(msv));
+ g_signal_connect (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
+ gtk_notebook_set_tab_reorderable (mv, msv, TRUE);
+ gtk_notebook_set_current_page (mv, position);
+ gtk_notebook_set_tab_label_packing (mv, msv, FALSE, FALSE, 0);
+
+ return msv;
+}
+
MailViewChild *
mail_view_add_page (MailView *mv, guint16 type)
{
@@ -325,8 +363,13 @@ mail_view_add_page (MailView *mv, guint16 type)
break;
case MAIL_VIEW_MESSAGE:
child = mail_view_add_message (mv);
-
break;
+ case MAIL_VIEW_SETTINGS:
+ child = mail_view_add_settings (mv);
+ break;
+ case MAIL_VIEW_ACCOUNT:
+ child = mail_view_add_account (mv);
+ break;
}
gtk_widget_grab_focus(child);
child->type = type;
diff --git a/src/mail-view.h b/src/mail-view.h
index f431570..a501b10 100644
--- a/src/mail-view.h
+++ b/src/mail-view.h
@@ -35,7 +35,9 @@
enum {
MAIL_VIEW_FOLDER=1,
MAIL_VIEW_COMPOSER,
- MAIL_VIEW_MESSAGE
+ MAIL_VIEW_MESSAGE,
+ MAIL_VIEW_ACCOUNT,
+ MAIL_VIEW_SETTINGS
};
typedef struct _MailViewPrivate MailViewPrivate;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]