* Change deprecated HildonApp/HildonAppView to HildonProgram/HildonWindow.
authorFlorian Boor <florian@kernelconcepts.de>
Tue, 27 Jun 2006 10:36:21 +0000 (10:36 +0000)
committerFlorian Boor <florian@kernelconcepts.de>
Tue, 27 Jun 2006 10:36:21 +0000 (10:36 +0000)
* Hacked hildon support for editor window (still not fully functional).
* Several minor changes and updates.
* Remove some files from the packages.

pmo-trunk-r347

debian/files
debian/modest.substvars
debian/rules
src/hildon/modest-ui-glade.h
src/hildon/modest-ui-main-view.c
src/hildon/modest-ui-message-editor.c
src/hildon/modest-ui.c
src/hildon/modest.glade
src/modest-editor-window.c
src/modest-editor-window.h

index e22655e..a21db8c 100644 (file)
@@ -1 +1 @@
-modest_0.0.9-1_i386.deb unknown optional
+modest_0.0.9-1_armel.deb user/unknown optional
index 2f081fa..d374a97 100644 (file)
@@ -1 +1 @@
-shlibs:Depends=gtkhtml0, hildon-libs0 (>= 0.12.18-1), libart-2.0-2 (>= 2.3.16), libatk1.0-0 (>= 1.9.0), libaudiofile0 (>= 0.2.3-4), libc6 (>= 2.3.5-1), libdbus-1-2 (>= 0.61), libdbus-glib-1-2 (>= 0.61), libexpat1 (>= 1.95.8), libfontconfig1 (>= 2.3.2-1osso7), libfreetype6 (>= 2.1.10-1osso1), libgconf2-6 (>= 2.6.4.14), libglade2-0 (>= 1:2.3.6), libglib2.0-0 (>= 2.8.6-1osso1), libgtk2.0-0 (>= 2:2.6.10-1.osso8), libmatchbox1 (>= 1.7-1), libpango1.0-0 (>= 1.8.1), libpng12-0 (>= 1.2.8rel), libx11-6 | xlibs (>> 4.1.0), libxau0, libxext6 | xlibs (>> 4.1.0), libxft2 (>= 2.1.6-1osso10), libxml2 (>= 2.6.16), libxrender1, osso-esd, zlib1g (>= 1:1.2.1)
+shlibs:Depends=gtkhtml0, hildon-libs0 (>= 0.12.18-1), libart-2.0-2 (>= 2.3.16), libatk1.0-0 (>= 1.9.0), libaudiofile0 (>= 0.2.3-4), libc6 (>= 2.3.5-1), libcamel (>= 1.4.1), libdbus-1-2 (>= 0.61), libdbus-glib-1-2 (>= 0.61), libedataserver (>= 1.4.1), libexpat1 (>= 1.95.8), libfontconfig1 (>= 2.3.2-1osso7), libfreetype6 (>= 2.1.10-1osso1), libgconf2-6 (>= 2.6.4.14), libglade2-0 (>= 1:2.3.6), libglib2.0-0 (>= 2.8.6-1osso1), libgtk2.0-0 (>= 2:2.6.10-1.osso8), libmatchbox1 (>= 1.7-1), libosso1 (>= 1.11-1), libpango1.0-0 (>= 1.8.1), libpng12-0 (>= 1.2.8rel), libx11-6 | xlibs (>> 4.1.0), libxau0, libxext6 | xlibs (>> 4.1.0), libxft2 (>= 2.1.6-1osso10), libxml2 (>= 2.6.16), libxrender1, osso-esd, zlib1g (>= 1:1.2.1)
index e4d3310..8e88ca5 100755 (executable)
@@ -89,7 +89,7 @@ binary-arch: build install
 #      dh_installinit
 #      dh_installcron
 #      dh_installinfo
-       dh_installman
+#      dh_installman
        dh_link
        dh_strip
        dh_compress
index 7c66c73..440e25b 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef __MODEST_UI_GLADE_H__
 #define __MODEST_UI_GLADE_H__
 
+#include <hildon-widgets/hildon-program.h>
+
 #include "../modest-ui.h"
 #include "../modest-account-mgr.h"
 #include "../modest-identity-mgr.h"
@@ -30,6 +32,7 @@ struct _ModestUIPrivate {
        GladeXML             *glade_xml;
 
        TnyMsgFolderIface    *current_folder;
+       HildonProgram        *program;
 };
 
 #define MODEST_UI_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
index 508e56a..7203be1 100644 (file)
@@ -7,7 +7,8 @@
 #include <config.h>
 #endif /*HAVE_CONFIG_H*/
 
-#include <hildon-widgets/hildon-app.h>
+#include <hildon-widgets/hildon-window.h>
+#include <hildon-widgets/hildon-program.h>
 
 /* TODO: put in auto* */
 #include <tny-text-buffer-stream.h>
@@ -92,23 +93,24 @@ modest_ui_main_view_destroy (GtkWidget *win, GdkEvent *event, gpointer data)
 gboolean
 modest_ui_show_main_window (ModestUI *modest_ui)
 {
-       GtkWidget       *win, *app_view;
-       gint              height, width;
+       GtkWidget       *win;
+       gint            height, width;
        ModestUIPrivate *priv;
-       GtkWidget     *folder_view, *header_view;
-       GtkWidget     *message_view;
-       GtkWidget     *account_settings_item;
-       GtkWidget     *forward_attached_menu_item;
-       GtkWidget     *delete_item;
-       GtkWidget     *open_item;
-       GtkWidget     *view_attachments_item;
-       GtkWidget     *new_account_item;
-       GtkWidget     *main_menu, *menu_item, *main_toolbar;
+       GtkWidget       *folder_view, *header_view;
+       GtkWidget       *message_view;
+       GtkWidget       *account_settings_item;
+       GtkWidget       *forward_attached_menu_item;
+       GtkWidget       *delete_item;
+       GtkWidget       *open_item;
+       GtkWidget       *view_attachments_item;
+       GtkWidget       *new_account_item;
+       GtkWidget       *main_menu, *menu_item, *main_toolbar;
        
        GtkWidget  *folder_view_holder,
                *header_view_holder,
                *mail_paned;
        gboolean show_attachments_inline;
+       HildonProgram *program;
 
        priv = MODEST_UI_GET_PRIVATE(modest_ui);
        
@@ -117,7 +119,11 @@ modest_ui_show_main_window (ModestUI *modest_ui)
        width  = modest_conf_get_int (priv->modest_conf,
                                      MODEST_CONF_MAIN_WINDOW_WIDTH,NULL);
 
-       win = glade_xml_get_widget (priv->glade_xml, "main");
+       program = HILDON_PROGRAM (hildon_program_get_instance ());
+       priv->program = program;
+       g_set_application_name (_("Modest"));
+       
+       win = glade_xml_get_widget (priv->glade_xml, "appview1");
        if (!win) {
                g_warning ("could not create main window");
                return FALSE;
@@ -236,12 +242,10 @@ modest_ui_show_main_window (ModestUI *modest_ui)
                          modest_ui);
        g_signal_connect (win, "delete-event", G_CALLBACK(modest_ui_main_view_destroy),
                          modest_ui);
-       gtk_widget_set_usize (GTK_WIDGET(win), width, height);
-       hildon_app_set_title (HILDON_APP(win), PACKAGE_STRING);
-
-       app_view = glade_xml_get_widget (priv->glade_xml, "appview1");
        
-       main_menu = hildon_appview_get_menu(HILDON_APPVIEW(app_view));
+       gtk_window_set_title (GTK_WINDOW(win), _("Main"));
+
+       main_menu = gtk_menu_new ();
        menu_item = glade_xml_get_widget (priv->glade_xml, "MessageMenuItem");
        gtk_widget_reparent(menu_item, main_menu);
        menu_item = glade_xml_get_widget (priv->glade_xml, "EditMenuItem");
@@ -257,18 +261,20 @@ modest_ui_show_main_window (ModestUI *modest_ui)
        menu_item = glade_xml_get_widget (priv->glade_xml, "CloseMenuItem");
        gtk_widget_reparent(menu_item, main_menu);
 
+       hildon_window_set_menu (win, main_menu);
+
        main_toolbar = glade_xml_get_widget (priv->glade_xml, "toolbar1");
        g_object_ref (main_toolbar);
        gtk_container_remove (glade_xml_get_widget (priv->glade_xml, 
                              "main_top_container"), main_toolbar);
-       hildon_appview_set_toolbar (HILDON_APPVIEW(app_view), GTK_TOOLBAR(main_toolbar));
-
+       hildon_window_add_toolbar (HILDON_WINDOW(win), GTK_TOOLBAR(main_toolbar));
 
        gtk_widget_show_all (win);
-
+       
        menu_item = glade_xml_get_widget (priv->glade_xml, "menubar1");
        gtk_widget_hide(menu_item);
-
+       
+       hildon_program_add_window (program, win);
 
        return TRUE;
 }
@@ -631,5 +637,4 @@ on_headers_status_update (GtkWidget *header_view, const gchar *msg, gint status_
                gtk_widget_hide   (status_box);
                gtk_statusbar_pop (status_bar, status_id);
        }
-}              
-
+}
index 9a7feab..b8e40a5 100644 (file)
@@ -7,6 +7,9 @@
 #include <config.h>
 #endif /*HAVE_CONFIG_H*/
 
+#include <hildon-widgets/hildon-window.h>
+#include <hildon-widgets/hildon-program.h>
+
 /* TODO: put in auto* */
 #include <tny-text-buffer-stream.h>
 #include <tny-msg-folder.h>
@@ -55,7 +58,7 @@ static gboolean close_edit_confirm_dialog(ModestEditorWindow *edit_win)
        GtkWidget *mdialog;
        gint res;
 
-       mdialog = gtk_message_dialog_new(GTK_WINDOW(edit_win),
+       mdialog = gtk_message_dialog_new(GTK_WINDOW(edit_win->window),
                        GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                        GTK_MESSAGE_QUESTION,
                        GTK_BUTTONS_YES_NO,
@@ -81,21 +84,21 @@ close_edit_window (GtkWidget *win, GdkEvent *event, gpointer data)
        win_data = modest_editor_window_get_data(edit_win);
        priv = MODEST_UI_GET_PRIVATE(win_data->modest_ui);
 
-       // g_message("window was %s modified", modest_editor_window_get_modified(edit_win) ? "" : "not");
-
        if (modest_editor_window_get_modified(edit_win)) {
                if (close_edit_confirm_dialog(edit_win)) {
-                       gtk_widget_hide (GTK_WIDGET(edit_win));
-                       modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(edit_win));
-                       gtk_widget_destroy(GTK_WIDGET(edit_win));
+                       gtk_widget_hide (GTK_WIDGET(edit_win->window));
+                       modest_window_mgr_unregister(priv->modest_window_mgr, HILDON_WINDOW (edit_win->window));
+                       hildon_program_remove_window (priv->program, HILDON_WINDOW (edit_win->window));
+                       g_object_unref(edit_win);
                        g_message("closing window");
                } else {
                        g_message("not closing window");
                }
        } else {
-               gtk_widget_hide (GTK_WIDGET(edit_win));
-               modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(edit_win));
-               gtk_widget_destroy(GTK_WIDGET(edit_win));
+               gtk_widget_hide (GTK_WIDGET(edit_win->window));
+               modest_window_mgr_unregister(priv->modest_window_mgr, HILDON_WINDOW (edit_win->window));
+               hildon_program_remove_window (priv->program, HILDON_WINDOW (edit_win->window));
+               g_object_unref(edit_win);
                g_message("closing window");
        }
 }
@@ -108,7 +111,7 @@ GtkContainer
        GladeXML                *glade_xml;
        EditWinData             *win_data;
 
-       glade_xml = glade_xml_new(MODEST_GLADE, "new_mail_top_container", NULL);
+       glade_xml = glade_xml_new(MODEST_GLADE, "new_mail", NULL);
        if (!glade_xml)
                return NULL;
 
@@ -119,8 +122,9 @@ GtkContainer
 
        *user_data = win_data;
 
-       top_container = glade_xml_get_widget(glade_xml, "new_mail_top_container");
+       top_container = glade_xml_get_widget(glade_xml, "new_mail");
        if (!top_container) {
+               g_warning ("Could not create window\n");
                g_object_unref(G_OBJECT(glade_xml));
                return NULL;
        }
@@ -260,17 +264,17 @@ new_editor_with_presets (ModestUI *modest_ui, const gchar *to_header,
                                                        const gchar *subject_header, const gchar *body,
                             const GList *attachments)
 {
-       GtkWidget *edit_win;
+       ModestEditorWindow *edit_win;
        GladeXML *glade_xml;
        GtkWidget *btn, *w;
        GtkTextBuffer *buf;
        EditWinData *windata;
        ModestUIPrivate *priv;
-       gint height, width;
+       GtkWidget *toolbar, *menubar, *menu, *menu_item;
 
        g_return_if_fail (modest_ui);
 
-       edit_win = modest_editor_window_new(modest_ui);
+       edit_win = MODEST_EDITOR_WINDOW (modest_editor_window_new(modest_ui));
        windata = (EditWinData *)modest_editor_window_get_data(MODEST_EDITOR_WINDOW(edit_win));
        g_return_if_fail(windata);
 
@@ -290,26 +294,19 @@ new_editor_with_presets (ModestUI *modest_ui, const gchar *to_header,
        buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
        g_signal_connect(buf, "changed", G_CALLBACK(on_editor_buffer_changed), edit_win);
 
-       g_signal_connect (edit_win, "destroy-event", G_CALLBACK(close_edit_window),
+       g_signal_connect (edit_win->window, "destroy-event", G_CALLBACK(close_edit_window),
                          edit_win);
-       g_signal_connect (edit_win, "delete-event", G_CALLBACK(close_edit_window),
+       g_signal_connect (edit_win->window, "delete-event", G_CALLBACK(close_edit_window),
                          edit_win);
 
        priv = MODEST_UI_GET_PRIVATE(modest_ui);
-       height = modest_conf_get_int (priv->modest_conf,
-                                         MODEST_CONF_EDIT_WINDOW_HEIGHT, NULL);
-       width  = modest_conf_get_int (priv->modest_conf,
-                                         MODEST_CONF_EDIT_WINDOW_WIDTH, NULL);
-
-       // g_message("new editor win@%dx%d", width, height);
-
-       gtk_widget_set_usize (GTK_WIDGET(edit_win), width, height);
+       
        if (strlen(subject_header) > 0)
-               gtk_window_set_title (GTK_WINDOW(edit_win), subject_header);
+               gtk_window_set_title (GTK_WINDOW(edit_win->window), subject_header);
        else
-               gtk_window_set_title (GTK_WINDOW(edit_win), _("Untitled"));
-
-       modest_window_mgr_register(priv->modest_window_mgr, G_OBJECT(edit_win), MODEST_EDIT_WINDOW, 0);
+               gtk_window_set_title (GTK_WINDOW(edit_win->window), _("Untitled"));
+               
+       modest_window_mgr_register(priv->modest_window_mgr, G_OBJECT(edit_win->window), MODEST_EDIT_WINDOW, 0);
 
        modest_editor_window_set_to_header(MODEST_EDITOR_WINDOW(edit_win), to_header);
        modest_editor_window_set_cc_header(MODEST_EDITOR_WINDOW(edit_win), cc_header);
@@ -320,7 +317,42 @@ new_editor_with_presets (ModestUI *modest_ui, const gchar *to_header,
 
        modest_editor_window_set_modified(MODEST_EDITOR_WINDOW(edit_win), FALSE);
 
-       gtk_widget_show(edit_win);
+       menu = gtk_menu_new();
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem5");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem13");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem22");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem27");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem29");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem34");
+       gtk_widget_reparent(menu_item, menu);
+       menu_item = glade_xml_get_widget (priv->glade_xml, "menuitem41");
+       gtk_widget_reparent(menu_item, menu);
+
+       hildon_window_set_menu (HILDON_WINDOW (edit_win->window), GTK_MENU(menu));
+
+       toolbar = glade_xml_get_widget (priv->glade_xml, "toolbar2");
+       gtk_widget_hide (toolbar);
+       g_object_ref (toolbar);
+       gtk_container_remove (GTK_CONTAINER (glade_xml_get_widget (priv->glade_xml, 
+                             "new_mail_top_container")), toolbar);
+       hildon_window_add_toolbar (HILDON_WINDOW (edit_win->window), GTK_TOOLBAR (toolbar));
+       gtk_widget_show_all (GTK_WIDGET (edit_win->window));
+
+       while (gtk_events_pending ())
+               gtk_main_iteration ();
+       
+       toolbar = glade_xml_get_widget (priv->glade_xml, "toolbar2");
+       gtk_widget_hide (toolbar);
+       
+       menubar = glade_xml_get_widget (priv->glade_xml, "menubar2");
+       gtk_widget_hide (GTK_WIDGET(menubar));
+       
+       hildon_program_add_window (priv->program, HILDON_WINDOW (edit_win->window));
 }
 
 
@@ -445,7 +477,7 @@ on_attach_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin)
        gchar *filename = NULL;
        
        dialog = gtk_file_chooser_dialog_new ("Open File",
-                                                                                 GTK_WINDOW(modest_editwin),
+                                                                                 GTK_WINDOW(modest_editwin->window),
                                                                                  GTK_FILE_CHOOSER_ACTION_OPEN,
                                                                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                                                                  GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
@@ -544,10 +576,10 @@ on_send_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin)
        g_free (body);
        g_object_unref (G_OBJECT(actions));
 
-       gtk_widget_hide (GTK_WIDGET(modest_editwin));
+       gtk_widget_hide (GTK_WIDGET(modest_editwin->window));
        modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(modest_editwin));
-       if (GTK_IS_WIDGET(modest_editwin)) {
-               gtk_widget_destroy(GTK_WIDGET(modest_editwin));
+       if (G_IS_OBJECT(modest_editwin)) {
+               g_object_unref(modest_editwin);
        } else
                g_warning("editor window has vanished!");
 }
index c11e892..1f183df 100644 (file)
@@ -109,6 +109,7 @@ modest_ui_init (ModestUI *obj)
        priv->header_view       = NULL;
        priv->message_view      = NULL;
        priv->current_folder    = NULL;
+       priv->program           = NULL;
 }
 
 
@@ -315,5 +316,3 @@ on_account_selector_selection_changed (GtkWidget *widget, gpointer user_data)
 
        free(account_name);
 }
-
-
index 8c1f876..1cc7dba 100644 (file)
@@ -8,8 +8,7 @@
   <property name="title" context="yes" translatable="yes">Modest 3"</property>
   <property name="width_request">512</property>
   <child>
-    <widget class="HildonAppView" id="appview1">
-    <property name="menu_ui"><![CDATA[<popup name="HildonApp"/>]]></property>
+    <widget class="HildonWindow" id="appview1">
 
   <child>
     <widget class="GtkVBox" id="main_top_container">
          <child>
            <widget class="GtkStatusbar" id="statusbar">
              <property name="visible">True</property>
-             <property name="has_resize_grip">True</property>
+             <property name="has_resize_grip">False</property>
            </widget>
            <packing>
              <property name="padding">0</property>
   </child>
 </widget>
 
-<widget class="GtkWindow" id="new_mail">
-  <property name="title" translatable="yes">Modest - New message</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="default_width">800</property>
-  <property name="default_height">600</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="icon">qgn_toolb_messagin.png</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-  <property name="urgency_hint">False</property>
+<widget class="HildonWindow" id="new_mail">
+  <property name="title">Untitled</property>
 
   <child>
     <widget class="GtkVBox" id="new_mail_top_container">
 
       <child>
        <widget class="GtkMenuBar" id="menubar2">
-         <property name="visible">True</property>
+         <property name="visible">False</property>
 
          <child>
            <widget class="GtkMenuItem" id="menuitem5">
       </child>
 
       <child>
-       <widget class="GtkToolbar" id="toolbar2">
-         <property name="visible">True</property>
-         <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
-         <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
-         <property name="tooltips">True</property>
-         <property name="show_arrow">True</property>
-
-         <child>
-           <widget class="GtkToolButton" id="toolb_send">
-             <property name="visible">True</property>
-             <property name="tooltip" translatable="yes">Send message</property>
-             <property name="label" translatable="yes">Send</property>
-             <property name="use_underline">True</property>
-             <property name="icon">qgn_toolb_messagin_send.png</property>
-             <property name="visible_horizontal">True</property>
-             <property name="visible_vertical">True</property>
-             <property name="is_important">False</property>
-           </widget>
-           <packing>
-             <property name="expand">False</property>
-             <property name="homogeneous">True</property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkToolButton" id="toolb_attach">
-             <property name="visible">True</property>
-             <property name="tooltip" translatable="yes">Add attachment</property>
-             <property name="label" translatable="yes">Attach</property>
-             <property name="use_underline">True</property>
-             <property name="icon">qgn_list_gene_attacpap.png</property>
-             <property name="visible_horizontal">True</property>
-             <property name="visible_vertical">True</property>
-             <property name="is_important">False</property>
-           </widget>
-           <packing>
-             <property name="expand">False</property>
-             <property name="homogeneous">True</property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkToolButton" id="toolb_recipients">
-             <property name="visible">True</property>
-             <property name="tooltip" translatable="yes">Add reipients</property>
-             <property name="label" translatable="yes">Recipients</property>
-             <property name="use_underline">True</property>
-             <property name="icon">qgn_list_gene_contacts.png</property>
-             <property name="visible_horizontal">True</property>
-             <property name="visible_vertical">True</property>
-             <property name="is_important">False</property>
-           </widget>
-           <packing>
-             <property name="expand">False</property>
-             <property name="homogeneous">True</property>
-           </packing>
-         </child>
-         
-         
-       </widget>
-       <packing>
-         <property name="padding">0</property>
-         <property name="expand">False</property>
-         <property name="fill">False</property>
-       </packing>
-      </child>
-
-      <child>
        <widget class="GtkVPaned" id="vpaned2">
          <property name="visible">True</property>
          <property name="can_focus">True</property>
          <property name="fill">True</property>
        </packing>
       </child>
+      <child>
+       <widget class="GtkToolbar" id="toolbar2">
+         <property name="visible">True</property>
+         <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+         <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
+         <property name="tooltips">True</property>
+         <property name="show_arrow">True</property>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_send">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Send message</property>
+             <property name="label" translatable="yes">Send</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_send.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_attach">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Add attachment</property>
+             <property name="label" translatable="yes">Attach</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_list_gene_attacpap.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_recipients">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Add reipients</property>
+             <property name="label" translatable="yes">Recipients</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_list_gene_contacts.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+         
+         
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+         
     </widget>
-  </child>
+  </child>  
 </widget>
 
 <widget class="GtkWindow" id="viewer">
index 7c36918..8ab01f2 100644 (file)
@@ -19,6 +19,7 @@ enum {
 
 typedef struct _ModestEditorWindowPrivate ModestEditorWindowPrivate;
 struct _ModestEditorWindowPrivate {
+       GtkWidget *window;
        gpointer user_data;
        gboolean modified;
        GList *attachments;
@@ -29,7 +30,7 @@ struct _ModestEditorWindowPrivate {
                                                   MODEST_TYPE_EDITOR_WINDOW, \
                                                   ModestEditorWindowPrivate))
 /* globals */
-static GtkWindowClass *parent_class = NULL;
+static GObjectClass *parent_class = NULL;
 
 /* uncomment the following if you have defined any signals */
 /* static guint signals[LAST_SIGNAL] = {0}; */
@@ -50,7 +51,7 @@ modest_editor_window_get_type (void)
                        1,              /* n_preallocs */
                        (GInstanceInitFunc) modest_editor_window_init,
                };
-               my_type = g_type_register_static (GTK_TYPE_WINDOW,
+               my_type = g_type_register_static (G_TYPE_OBJECT,
                                                  "ModestEditorWindow",
                                                  &my_info, 0);
        }
@@ -68,12 +69,6 @@ modest_editor_window_class_init (ModestEditorWindowClass *klass)
 
        g_type_class_add_private (gobject_class, sizeof(ModestEditorWindowPrivate));
 
-       /* signal definitions go here, e.g.: */
-/*     signals[MY_SIGNAL_1] = */
-/*             g_signal_new ("my_signal_1",....); */
-/*     signals[MY_SIGNAL_2] = */
-/*             g_signal_new ("my_signal_2",....); */
-/*     etc. */
 }
 
 static void
@@ -86,6 +81,7 @@ modest_editor_window_init (ModestEditorWindow *obj)
        priv->attachments = NULL;
        priv->identity = NULL;
        priv->transport = NULL;
+       obj->window = NULL;
 }
 
 static void
@@ -101,16 +97,18 @@ modest_editor_window_finalize (GObject *obj)
        modest_editor_window_set_attachments(MODEST_EDITOR_WINDOW(obj), NULL);
        g_free(priv->identity);
        g_free(priv->transport);
+       g_object_unref (MODEST_EDITOR_WINDOW(obj)->window);
+       MODEST_EDITOR_WINDOW(obj)->window = NULL;
        
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
 
-GtkWidget*
+GObject*
 modest_editor_window_new (ModestUI *ui)
 {
        GObject *self;
        ModestEditorWindowPrivate *priv;
-       GtkWidget *w;
+       GObject *edit_win;
        gpointer data;
 
        self = G_OBJECT(g_object_new(MODEST_TYPE_EDITOR_WINDOW, NULL));
@@ -119,18 +117,17 @@ modest_editor_window_new (ModestUI *ui)
        /* for now create a local test-window */
 
        data = NULL;
-       w = GTK_WIDGET(modest_ui_new_editor_window(ui, &data));
-       // g_message("new data = %p", data);
-       if (!w)
+       edit_win = modest_ui_new_editor_window(ui, &data);
+       
+       if (!edit_win)
                return NULL;
        if (!data)
                g_message("editor window user data is emtpy");
 
-       gtk_container_add(GTK_CONTAINER(self), w);
+       MODEST_EDITOR_WINDOW(self)->window = edit_win;
        priv->user_data = data;
-       // g_message("new priv->data = %p", priv->user_data);
        
-       return GTK_WIDGET(self);
+       return self;
 }
 
 /*
@@ -334,4 +331,4 @@ modest_editor_window_get_transport(ModestEditorWindow *edit_win)
        priv = MODEST_EDITOR_WINDOW_GET_PRIVATE(edit_win);
 
        return priv->transport;
-}      
+}
index d5c273a..84adb93 100644 (file)
@@ -24,7 +24,8 @@ typedef struct _ModestEditorWindow      ModestEditorWindow;
 typedef struct _ModestEditorWindowClass ModestEditorWindowClass;
 
 struct _ModestEditorWindow {
-        GtkWindow parent;
+        GObject parent;
+        GtkWindow *window;
        /* insert public members, if any */
 };
 
@@ -47,7 +48,7 @@ GType        modest_editor_window_get_type    (void) G_GNUC_CONST;
  *
  * Returns: a GtkWindow* to show and populate
  */
-GtkWidget *modest_editor_window_new         (ModestUI *ui);
+GObject *modest_editor_window_new         (ModestUI *ui);
 
 /**
  * modest_editor_window_get_data: