Changeset 18

Show
Ignore:
Timestamp:
10/31/07 23:03:08
Author:
pvanhoof
Message:
        • Made creating the buttons for TMutMsgView a virtual method
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r17 r18  
    55        * UI preparations. Refactored the TMutMsgView type to be a GtkVBox 
    66        with a bunch of buttons and scrolled windows in it 
     7        * Made creating the buttons for TMutMsgView a virtual method 
    78 
    892007-10-29  Philip Van Hoof  <pvanhoof@gnome.org> 
  • trunk/src/tmut-msg-view.c

    r17 r18  
    6060} 
    6161 
     62 
     63static void 
     64tmut_msg_view_create_buttons_default (TMutMsgView *self) 
     65{ 
     66        TMutMsgViewPriv *priv = TMUT_MSG_VIEW_GET_PRIVATE (self); 
     67 
     68        GtkWidget *hbox; 
     69        hbox = gtk_hbox_new (FALSE, 0); 
     70        gtk_widget_show (hbox); 
     71 
     72        gtk_box_pack_start (GTK_BOX (self), hbox, FALSE, TRUE, 0); 
     73        gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (priv->reply_button),  
     74                TRUE, TRUE, 0); 
     75        gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (priv->forward_button),  
     76                TRUE, TRUE, 0); 
     77 
     78        g_signal_connect (G_OBJECT (priv->reply_button), "clicked", 
     79                G_CALLBACK (on_reply_clicked), self); 
     80        g_signal_connect (G_OBJECT (priv->forward_button), "clicked", 
     81                G_CALLBACK (on_forward_clicked), self); 
     82 
     83        return; 
     84} 
     85 
     86 
    6287static void 
    6388tmut_msg_view_set_unavailable (TnyMsgView *self) 
     
    192217{ 
    193218        TMutMsgViewPriv *priv = TMUT_MSG_VIEW_GET_PRIVATE (instance); 
    194         GtkWidget *hbox; 
    195  
    196         hbox = gtk_hbox_new (FALSE, 0); 
     219 
    197220        priv->sw = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL)); 
    198221        priv->reply_button = GTK_BUTTON (gtk_button_new_with_label ("Reply")); 
    199222        priv->forward_button = GTK_BUTTON (gtk_button_new_with_label ("Forward")); 
    200223 
    201         gtk_widget_show (hbox); 
    202224        gtk_widget_show (GTK_WIDGET (priv->sw)); 
    203225        gtk_widget_show (GTK_WIDGET (priv->reply_button)); 
     
    210232 
    211233        gtk_box_pack_start (GTK_BOX (instance), GTK_WIDGET (priv->sw), TRUE, TRUE, 0); 
    212         gtk_box_pack_start (GTK_BOX (instance), hbox, FALSE, TRUE, 0); 
    213         gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (priv->reply_button),  
    214                 TRUE, TRUE, 0); 
    215         gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (priv->forward_button),  
    216                 TRUE, TRUE, 0); 
    217  
    218         g_signal_connect (G_OBJECT (priv->reply_button), "clicked", 
    219                 G_CALLBACK (on_reply_clicked), instance); 
    220         g_signal_connect (G_OBJECT (priv->forward_button), "clicked", 
    221                 G_CALLBACK (on_forward_clicked), instance); 
     234 
     235        TMUT_MSG_VIEW_GET_CLASS (instance)->create_buttons_func ((TMutMsgView *) instance); 
    222236 
    223237        tmut_msg_view_set_view (TMUT_MSG_VIEW (instance), 
     
    270284 
    271285        object_class->finalize = tmut_msg_view_finalize; 
     286 
     287        class->create_buttons_func = tmut_msg_view_create_buttons_default; 
    272288 
    273289        g_type_class_add_private (object_class, sizeof (TMutMsgViewPriv)); 
  • trunk/src/tmut-msg-view.h

    r17 r18  
    4747{ 
    4848        GtkVBoxClass parent_class; 
     49 
     50        void (*create_buttons_func) (TMutMsgView *self); 
    4951}; 
    5052