[gtranslator] Move GtrNotebook to templates



commit c66f80876f7df825ada134fa26eb3e5df2a6d84a
Author: Seán de Búrca <leftmostcat gmail com>
Date:   Thu Sep 5 02:09:22 2013 -0600

    Move GtrNotebook to templates

 src/gtr-notebook.c  |    5 +++++
 src/gtr-notebook.ui |    9 +++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gtr-notebook.c b/src/gtr-notebook.c
index 26b9ae3..3990fb4 100644
--- a/src/gtr-notebook.c
+++ b/src/gtr-notebook.c
@@ -100,6 +100,7 @@ update_tabs_visibility (GtrNotebook *nb)
 static void
 gtr_notebook_init (GtrNotebook * notebook)
 {
+  gtk_widget_init_template (GTK_WIDGET (notebook));
 }
 
 static void
@@ -114,6 +115,7 @@ static void
 gtr_notebook_class_init (GtrNotebookClass * klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->finalize = gtr_notebook_finalize;
 
@@ -125,6 +127,9 @@ gtr_notebook_class_init (GtrNotebookClass * klass)
                                    tab_close_request), NULL, NULL,
                   g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                   GTR_TYPE_TAB);
+
+  gtk_widget_class_set_template_from_resource (widget_class,
+                                               "/org/gnome/gtranslator/ui/gtr-notebook.ui");
 }
 
 /***************************** Public funcs ***********************************/
diff --git a/src/gtr-notebook.ui b/src/gtr-notebook.ui
new file mode 100644
index 0000000..2fda2a0
--- /dev/null
+++ b/src/gtr-notebook.ui
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.15.3 on Mon Sep  2 16:45:01 2013 -->
+<interface domain="gtranslator">
+  <!-- interface-requires gtk+ 3.10 -->
+  <template class="GtrNotebook" parent="GtkNotebook">
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+  </template>
+</interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]