[anjal] BUGFIX: Moblin Bugzilla #4505 - Size of window expands.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] BUGFIX: Moblin Bugzilla #4505 - Size of window expands.
- Date: Fri, 17 Jul 2009 09:13:42 +0000 (UTC)
commit 2f4477cda221fc899b8e1560932a30de92b94e3c
Author: Srinivasa Ragavan <sragavan novell com>
Date: Fri Jul 17 14:42:02 2009 +0530
BUGFIX: Moblin Bugzilla #4505 - Size of window expands.
src/mail-folder-view.c | 12 +++++++++++-
src/mail-folder-view.h | 1 +
src/mail-shell.c | 11 ++++++++++-
src/mail-view.c | 25 ++++++++++++++++++++++++-
src/mail-view.h | 1 +
src/main.c | 2 +-
6 files changed, 48 insertions(+), 4 deletions(-)
---
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index 2409c73..44d2e41 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -82,6 +82,7 @@ enum {
VIEW_CLOSE,
MESSAGE_NEW,
SEARCH_SET,
+ VIEW_LOADED,
LAST_SIGNAL
};
@@ -519,6 +520,7 @@ mail_folder_view_set_folder (MailFolderView *mfv, CamelFolder *folder, const cha
g_signal_emit (mfv, signals[SEARCH_SET], 0);
/* FIXME: Set a signal emit and listen for it at note book and set the title appropriately */
+ g_signal_emit (mfv, signals[VIEW_LOADED], 0);
}
}
@@ -563,6 +565,14 @@ mail_folder_view_class_init (MailFolderViewClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ signals[VIEW_LOADED] =
+ g_signal_new ("view-loaded",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (MailFolderViewClass , view_loaded),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
mail_folder_view_parent_class = g_type_class_peek_parent (klass);
object_class->finalize = mail_folder_view_finalize;
@@ -1512,7 +1522,7 @@ mail_folder_view_construct (MailFolderView *shell)
column->editable_widget = (gpointer)0xdeadbeef;
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
- gtk_tree_view_column_set_fixed_width (column, 720);
+ /*gtk_tree_view_column_set_fixed_width (column, 720);*/
gtk_tree_view_column_set_title (column, _("Messages"));
gtk_tree_view_append_column (GTK_TREE_VIEW (shell->tree), column);
diff --git a/src/mail-folder-view.h b/src/mail-folder-view.h
index 3d2dab2..48a54b1 100644
--- a/src/mail-folder-view.h
+++ b/src/mail-folder-view.h
@@ -66,6 +66,7 @@ typedef struct _MailFolderViewClass {
void (*view_close) (MailConvView *);
void (*message_new) (MailConvView *, gpointer, gpointer);
void (*search_set) (MailFolderView *);
+ void (*view_loaded) (MailFolderView *);
} MailFolderViewClass;
MailFolderView * mail_folder_view_new (void);
diff --git a/src/mail-shell.c b/src/mail-shell.c
index 52a0b95..d704998 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -309,6 +309,13 @@ ms_show_post_druid (MailViewChild *mfv, MailShell *shell)
#define PACK_IN_TOOL(wid,icon) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0); wid = (GtkWidget *)gtk_tool_button_new (tbox, NULL); }
+static void
+handle_cmdline (MailView *mv, MailShell *shell)
+{
+ g_signal_handlers_block_by_func (mv, handle_cmdline, shell);
+ mail_shell_handle_cmdline (shell);
+}
+
void
mail_shell_construct (MailShell *shell)
{
@@ -444,11 +451,13 @@ mail_shell_construct (MailShell *shell)
gtk_container_add ((GtkContainer *)shell, priv->box);
shell->mail_component = mail_component_create ((GtkWidget *)shell, FALSE);
+
priv->side_pane = gtk_hpaned_new ();
tmp = gtk_vpaned_new ();
mail_view_set_folder_tree_widget ((MailView *)shell->mail_component->mail_view, tmp);
((MailSearch *)priv->search_entry)->view = (MailView *)shell->mail_component->mail_view;
mail_view_init_search ((MailView *)shell->mail_component->mail_view, priv->search_entry);
+ g_signal_connect ((GObject *)shell->mail_component->mail_view, "view-new", G_CALLBACK(handle_cmdline), shell);
shell->priv->folder_pane = tmp;
gtk_paned_add1 ((GtkPaned *)priv->side_pane, tmp);
@@ -534,7 +543,7 @@ mail_shell_handle_cmdline (MailShell *shell)
if (em_utils_check_user_can_send_mail(NULL)) {
GtkWidget *composer = (GtkWidget *) em_utils_compose_new_message_with_mailto ((const char *)shell->priv->args[i], NULL);
MailViewChild *child = mail_view_add_page ((MailView *)shell->mail_component->mail_view, MAIL_VIEW_COMPOSER, (gpointer)composer);
- child->flags |= MAIL_VIEW_HOLD_FOCUS;
+ //child->flags |= MAIL_VIEW_HOLD_FOCUS;
} else {
g_message ("Please configure an account before anything else");
diff --git a/src/mail-view.c b/src/mail-view.c
index 72628ca..79a51da 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -47,6 +47,13 @@ struct _MailViewPrivate {
MailSearch *search;
};
+enum {
+ VIEW_NEW,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
#undef MV_NEW_TAB
G_DEFINE_TYPE (MailView, mail_view, GTK_TYPE_NOTEBOOK)
@@ -80,6 +87,15 @@ mail_view_class_init (MailViewClass *klass)
{
GObjectClass * object_class = G_OBJECT_CLASS (klass);
+ signals[VIEW_NEW] =
+ g_signal_new ("view-new",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (MailViewClass , view_new),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
mail_view_parent_class = g_type_class_peek_parent (klass);
object_class->finalize = mail_view_finalize;
@@ -300,6 +316,13 @@ mv_search_set (MailFolderView *mfv, MailView *mv)
mail_search_set_state (mv->priv->search, mfv->search_str, mfv->search_state);
}
+static void
+mv_folder_loaded (MailFolderView *mfv, MailView *mv)
+{
+ g_signal_handlers_block_by_func(mfv, mv_folder_loaded, mv);
+ g_signal_emit (mv, signals[VIEW_NEW], 0);
+}
+
static MailViewChild *
mail_view_add_folder (MailView *mv, gpointer data, gboolean block)
{
@@ -319,7 +342,7 @@ mail_view_add_folder (MailView *mv, gpointer data, gboolean block)
g_signal_connect (mfv, "message-shown", G_CALLBACK(mv_message_shown), mv);
g_signal_connect (mfv, "message-new", G_CALLBACK(mv_message_new), mv);
g_signal_connect (mfv, "search-set", G_CALLBACK(mv_search_set), mv);
-
+ g_signal_connect (mfv, "view-loaded", G_CALLBACK (mv_folder_loaded), mv);
if (!block)
mail_folder_view_activate (mfv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, TRUE);
diff --git a/src/mail-view.h b/src/mail-view.h
index 6529b54..820709d 100644
--- a/src/mail-view.h
+++ b/src/mail-view.h
@@ -56,6 +56,7 @@ typedef struct _MailView {
typedef struct _MailViewClass {
GtkNotebookClass parent_class;
+ void (* view_new) (MailView*);
} MailViewClass;
diff --git a/src/main.c b/src/main.c
index 208de6c..c7e5dbc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -128,7 +128,7 @@ idle_cb (MailShell *shell)
if (default_app) {
check_and_set_default_mail ();
}
- mail_shell_handle_cmdline (shell);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]