| 23 #include "pidginconversationwindow.h" |
23 #include "pidginconversationwindow.h" |
| 24 |
24 |
| 25 struct _PidginConversationWindow { |
25 struct _PidginConversationWindow { |
| 26 GtkApplicationWindow parent; |
26 GtkApplicationWindow parent; |
| 27 |
27 |
| |
28 GMenu *send_to_menu; |
| |
29 |
| 28 GtkWidget *vbox; |
30 GtkWidget *vbox; |
| 29 }; |
31 }; |
| 30 |
32 |
| 31 G_DEFINE_TYPE(PidginConversationWindow, pidgin_conversation_window, |
33 G_DEFINE_TYPE(PidginConversationWindow, pidgin_conversation_window, |
| 32 GTK_TYPE_APPLICATION_WINDOW) |
34 GTK_TYPE_APPLICATION_WINDOW) |
| 34 /****************************************************************************** |
36 /****************************************************************************** |
| 35 * GObjectImplementation |
37 * GObjectImplementation |
| 36 *****************************************************************************/ |
38 *****************************************************************************/ |
| 37 static void |
39 static void |
| 38 pidgin_conversation_window_init(PidginConversationWindow *window) { |
40 pidgin_conversation_window_init(PidginConversationWindow *window) { |
| |
41 GtkBuilder *builder = NULL; |
| |
42 GtkWidget *menubar = NULL; |
| |
43 GMenuModel *model = NULL; |
| |
44 |
| 39 gtk_widget_init_template(GTK_WIDGET(window)); |
45 gtk_widget_init_template(GTK_WIDGET(window)); |
| 40 |
46 |
| 41 gtk_window_set_application(GTK_WINDOW(window), |
47 gtk_window_set_application(GTK_WINDOW(window), |
| 42 GTK_APPLICATION(g_application_get_default())); |
48 GTK_APPLICATION(g_application_get_default())); |
| |
49 |
| |
50 /* setup our menu */ |
| |
51 builder = gtk_builder_new_from_resource("/im/pidgin/Pidgin/Conversations/menu.ui"); |
| |
52 |
| |
53 model = (GMenuModel *)gtk_builder_get_object(builder, "conversation"); |
| |
54 menubar = gtk_menu_bar_new_from_model(model); |
| |
55 gtk_box_pack_start(GTK_BOX(window->vbox), menubar, FALSE, FALSE, 0); |
| |
56 gtk_widget_show(menubar); |
| |
57 |
| |
58 window->send_to_menu = (GMenu *)gtk_builder_get_object(builder, "send-to"); |
| |
59 |
| |
60 g_object_unref(G_OBJECT(builder)); |
| 43 } |
61 } |
| 44 |
62 |
| 45 static void |
63 static void |
| 46 pidgin_conversation_window_class_init(PidginConversationWindowClass *klass) { |
64 pidgin_conversation_window_class_init(PidginConversationWindowClass *klass) { |
| 47 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
65 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |