[atomix/wip/gtk3-port] Wire the ui file for translations and build



commit 70aeba47ad79f91b655c41a4b60c596d871c272a
Author: Robert Roth <robert roth off gmail com>
Date:   Sat Jan 17 21:14:18 2015 +0200

    Wire the ui file for translations and build

 configure.ac         |    4 +++-
 data/Makefile.am     |    2 +-
 data/ui/Makefile.am  |    5 +++++
 data/ui/interface.ui |    8 ++++----
 po/POTFILES.in       |    4 +++-
 src/main.c           |    8 ++++++++
 6 files changed, 24 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6ae0913..8c09148 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,8 @@ src/Makefile
 data/Makefile
 data/themes/Makefile
 data/themes/default/Makefile
-data/level/Makefile])
+data/level/Makefile
+data/ui/Makefile
+])
 
 AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
index 8ab0158..c35adcf 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
-SUBDIRS = level themes
+SUBDIRS = level themes ui
 
 logodir = $(pkgdatadir)
 logo_DATA = atomix-logo.png
diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am
new file mode 100644
index 0000000..665ec0f
--- /dev/null
+++ b/data/ui/Makefile.am
@@ -0,0 +1,5 @@
+uidir = $(pkgdatadir)/ui
+
+ui_DATA = interface.ui
+
+EXTRA_DIST = $(ui_DATA)
diff --git a/data/ui/interface.ui b/data/ui/interface.ui
index 3d22772..2b3a20f 100644
--- a/data/ui/interface.ui
+++ b/data/ui/interface.ui
@@ -142,7 +142,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="hbox">
+          <object class="GtkBox" id="content_hbox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
@@ -153,7 +153,7 @@
                 <property name="label_yalign">0</property>
                 <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkAlignment" id="alignment1">
+                  <object class="GtkAlignment" id="game_alignment">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
@@ -186,7 +186,7 @@
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">in</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment2">
+                      <object class="GtkAlignment" id="stats_alignment">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
@@ -336,7 +336,7 @@
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment3">
+                      <object class="GtkAlignment" id="preview_alignment">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1795ccf..f687fc0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,4 @@
+data/atomix.desktop.in
 data/level/aceticacid.atomix.xml
 data/level/acetone.atomix.xml
 data/level/butanol.atomix.xml
@@ -17,9 +18,10 @@ data/level/propylene.atomix.xml
 data/level/pyran.atomix.xml
 data/level/transbutylen.atomix.xml
 data/level/water.atomix.xml
+[type: gettext/glade]data/ui/interface.ui
 src/board-gtk.c
 src/games-show.c
 src/level-manager.c
 src/main.c
 src/theme-manager.c
-data/atomix.desktop.in
+
diff --git a/src/main.c b/src/main.c
index d098c26..ad0be6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -675,6 +675,8 @@ static GtkWidget *create_mainwin_content (AtomixApp *app)
 static AtomixApp *create_gui (void)
 {
   AtomixApp *app;
+  gchar *ui_path;
+  GtkBuilder *builder;
   GtkAccelGroup *accel_group;
   GtkActionGroup *action_group;
   GtkWidget *vbox;
@@ -719,6 +721,12 @@ static AtomixApp *create_gui (void)
   app = g_new0 (AtomixApp, 1);
   app->level = NULL;
 
+  ui_path = g_build_filename (PKGDATADIR, "ui", "interface.ui", NULL);
+
+  builder = gtk_builder_new_from_file (ui_path);
+  g_free (ui_path);
+  g_object_unref (builder);
+
   app->mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (app->mainwin), _("Atomix"));
 


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