+ ModestEditMsgWindowPrivate *priv;
+ priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(obj);
+
+ priv->factory = NULL;
+ priv->toolbar = NULL;
+ priv->menubar = NULL;
+
+}
+
+
+
+
+/* Our menu, an array of GtkItemFactoryEntry structures that defines each menu item */
+static GtkItemFactoryEntry menu_items[] = {
+ { "/_File", NULL, NULL, 0, "<Branch>" },
+ { "/File/_New", "<control>N", NULL, 0, "<StockItem>", GTK_STOCK_NEW },
+ { "/File/_Open", "<control>O", NULL, 0, "<StockItem>", GTK_STOCK_OPEN },
+ { "/File/_Save", "<control>S", NULL, 0, "<StockItem>", GTK_STOCK_SAVE },
+ { "/File/Save _As", NULL, NULL, 0, "<Item>" },
+ { "/File/Save Draft", "<control><shift>S", NULL, 0, "<Item>" },
+
+
+ { "/File/sep1", NULL, NULL, 0, "<Separator>" },
+ { "/File/_Quit", "<CTRL>Q", NULL, 0, "<StockItem>", GTK_STOCK_QUIT },
+
+ { "/_Edit", NULL, NULL, 0, "<Branch>" },
+ { "/Edit/_Undo", "<CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_UNDO },
+ { "/Edit/_Redo", "<shift><CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_REDO },
+ { "/File/sep1", NULL, NULL, 0, "<Separator>" },
+ { "/Edit/Cut", "<control>X", NULL, 0, "<StockItem>", GTK_STOCK_CUT },
+ { "/Edit/Copy", "<CTRL>C", NULL, 0, "<StockItem>", GTK_STOCK_COPY },
+ { "/Edit/Paste", NULL, NULL, 0, "<StockItem>", GTK_STOCK_PASTE},
+ { "/Edit/sep1", NULL, NULL, 0, "<Separator>" },
+ { "/Edit/Delete", "<CTRL>Q", NULL, 0, "<Item>" },
+ { "/Edit/Select all", "<CTRL>A", NULL, 0, "<Item>" },
+ { "/Edit/Deselect all", "<Shift><CTRL>A", NULL, 0, "<Item>" },
+
+ { "/_View", NULL, NULL, 0, "<Branch>" },
+ { "/View/To-field", NULL, NULL, 0, "<Item>" },
+
+ { "/View/Cc-field:", NULL, NULL, 0, "<Item>" },
+ { "/View/Bcc-field:", NULL, NULL, 0, "<Item>" },
+
+
+ { "/_Insert", NULL, NULL, 0, "<Branch>" },
+/* { "/Actions/_Reply", NULL, NULL, 0, "<Item>" }, */
+/* { "/Actions/_Forward", NULL, NULL, 0, "<Item>" }, */
+/* { "/Actions/_Bounce", NULL, NULL, 0, "<Item>" }, */
+
+ { "/_Format", NULL, NULL, 0, "<Branch>" }
+/* { "/Options/_Accounts", NULL, on_menu_accounts,0, "<Item>" }, */
+/* { "/Options/_Contacts", NULL, NULL, 0, "<Item>" }, */
+
+
+/* { "/_Help", NULL, NULL, 0, "<Branch>" }, */
+/* { "/_Help/About", NULL, on_menu_about, 0, "<StockItem>", GTK_STOCK_ABOUT}, */
+};
+
+static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
+
+
+static GtkWidget *
+menubar_new (ModestEditMsgWindow *self)
+{
+ GtkItemFactory *item_factory;
+ GtkAccelGroup *accel_group;
+
+ /* Make an accelerator group (shortcut keys) */
+ accel_group = gtk_accel_group_new ();
+
+ /* Make an ItemFactory (that makes a menubar) */
+ item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
+ accel_group);
+
+ /* This function generates the menu items. Pass the item factory,
+ the number of items in the array, the array itself, and any
+ callback data for the the menu items. */
+ gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, self);
+
+ ///* Attach the new accelerator group to the window. */
+ gtk_window_add_accel_group (GTK_WINDOW (self), accel_group);
+
+ /* Finally, return the actual menu bar created by the item factory. */
+ return gtk_item_factory_get_widget (item_factory, "<main>");
+}
+
+
+
+
+static ModestToolbar*
+toolbar_new (ModestEditMsgWindow *self)
+{
+ int i;
+ ModestToolbar *toolbar;
+ GSList *buttons = NULL;
+ ModestEditMsgWindowPrivate *priv;
+
+ ModestToolbarButton button_ids[] = {
+ MODEST_TOOLBAR_BUTTON_MAIL_SEND
+ };
+
+ priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(self);
+
+ for (i = 0 ; i != sizeof(button_ids) / sizeof(ModestToolbarButton); ++i)
+ buttons = g_slist_append (buttons, GINT_TO_POINTER(button_ids[i]));
+
+ toolbar = modest_widget_factory_get_edit_toolbar (priv->factory, buttons);
+ g_slist_free (buttons);
+
+ return toolbar;
+}
+
+
+static void
+init_window (ModestEditMsgWindow *obj)
+{