diff --git a/debug-viewer/GstDebugViewer/Common/GUI.py b/debug-viewer/GstDebugViewer/Common/GUI.py
index c9e60085ea..925f9d130f 100644
--- a/debug-viewer/GstDebugViewer/Common/GUI.py
+++ b/debug-viewer/GstDebugViewer/Common/GUI.py
@@ -19,6 +19,8 @@
"""GStreamer Development Utilities Common GUI module."""
+import os
+
import logging
import pygtk
@@ -28,6 +30,7 @@ del pygtk
import gobject
import gtk
+import GstDebugViewer
from GstDebugViewer.Common import utils
def widget_add_popup_menu (widget, menu, button = 3):
@@ -72,9 +75,10 @@ class Actions (dict):
class Widgets (dict):
- def __init__ (self, glade_tree):
+ def __init__ (self, builder):
- widgets = glade_tree.get_widget_prefix ("")
+ widgets = (obj for obj in builder.get_objects ()
+ if hasattr (obj, "name"))
dict.__init__ (self, ((w.name, w,) for w in widgets))
def __getattr__ (self, name):
@@ -92,24 +96,34 @@ class Widgets (dict):
class WidgetFactory (object):
- def __init__ (self, glade_filename):
+ def __init__ (self, directory):
- self.filename = glade_filename
+ self.directory = directory
- def make (self, widget_name, autoconnect = None):
+ def get_builder (self, filename):
- glade_tree = gtk.glade.XML (self.filename, widget_name)
+ builder_filename = os.path.join (self.directory, filename)
+
+ builder = gtk.Builder ()
+ builder.set_translation_domain (GstDebugViewer.GETTEXT_DOMAIN)
+ builder.add_from_file (builder_filename)
+
+ return builder
+
+ def make (self, filename, widget_name, autoconnect = None):
+
+ builder = self.get_builder (filename)
if autoconnect is not None:
- glade_tree.signal_autoconnect (autoconnect)
+ builder.connect_signals (autoconnect)
- return Widgets (glade_tree)
+ return Widgets (builder)
- def make_one (self, widget_name):
+ def make_one (self, filename, widget_name):
- glade_tree = gtk.glade.XML (self.filename, widget_name)
+ builder = self.get_builder (filename)
- return glade_tree.get_widget (widget_name)
+ return builder.get_object (widget_name)
class UIFactory (object):
diff --git a/debug-viewer/GstDebugViewer/GUI.py b/debug-viewer/GstDebugViewer/GUI.py
index b907f49d21..c066478e90 100644
--- a/debug-viewer/GstDebugViewer/GUI.py
+++ b/debug-viewer/GstDebugViewer/GUI.py
@@ -38,7 +38,6 @@ pygtk.require ("2.0")
import gobject
import gtk
-import gtk.glade
from GstDebugViewer import Common, Data, Main
@@ -1550,7 +1549,7 @@ class ProgressDialog (object):
def __init__ (self, window, title = ""):
- widgets = window.widget_factory.make ("progress_dialog")
+ widgets = window.widget_factory.make ("progress-dialog.ui", "progress_dialog")
dialog = widgets.progress_dialog
dialog.connect ("response", self.__handle_dialog_response)
@@ -1637,9 +1636,8 @@ class Window (object):
self.log_file = None
self.setup_model (LazyLogModel ())
- glade_filename = os.path.join (Main.Paths.data_dir, "gst-debug-viewer.glade")
- self.widget_factory = Common.GUI.WidgetFactory (glade_filename)
- self.widgets = self.widget_factory.make ("main_window")
+ self.widget_factory = Common.GUI.WidgetFactory (Main.Paths.data_dir)
+ self.widgets = self.widget_factory.make ("main-window.ui", "main_window")
ui_filename = os.path.join (Main.Paths.data_dir,
"gst-debug-viewer.ui")
@@ -2057,7 +2055,7 @@ class Window (object):
from GstDebugViewer import version
- dialog = self.widget_factory.make_one ("about_dialog")
+ dialog = self.widget_factory.make_one ("about-dialog.ui", "about_dialog")
dialog.props.version = version
dialog.run ()
dialog.destroy ()
diff --git a/debug-viewer/GstDebugViewer/__init__.py b/debug-viewer/GstDebugViewer/__init__.py
index 2bf8812737..b10cc0ecdd 100644
--- a/debug-viewer/GstDebugViewer/__init__.py
+++ b/debug-viewer/GstDebugViewer/__init__.py
@@ -23,4 +23,4 @@ version = "0.1"
__version__ = version
-from GstDebugViewer.Main import Paths, main as run
+from GstDebugViewer.Main import Paths, GETTEXT_DOMAIN, main as run
diff --git a/debug-viewer/data/gst-debug-viewer.glade b/debug-viewer/data/about-dialog.ui
similarity index 72%
rename from debug-viewer/data/gst-debug-viewer.glade
rename to debug-viewer/data/about-dialog.ui
index bcdf29ed89..9d3fe0723c 100644
--- a/debug-viewer/data/gst-debug-viewer.glade
+++ b/debug-viewer/data/about-dialog.ui
@@ -1,142 +1,14 @@
-
-
-
-
-
-
-
- GStreamer Debug Viewer
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- 640
- 480
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_NORMAL
- GDK_GRAVITY_NORTH_WEST
- True
- False
-
-
-
-
- True
- False
- 0
-
-
-
- True
- False
- 0
-
-
-
- True
- True
-
-
-
- True
- False
- 0
-
-
-
- True
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- True
- True
- True
- False
- True
- False
- False
-
-
-
-
- 0
- True
- True
- GTK_PACK_END
-
-
-
-
- True
- True
-
-
-
-
-
- True
- True
- GTK_POLICY_NEVER
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- False
- True
- False
- True
- False
- False
- False
-
-
-
-
- True
- False
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
- GTK_PACK_END
-
-
-
-
-
-
-
- 5
- True
- False
- GStreamer Debug Viewer
- Copyright © 2007 René Stadler
- View and analyze GStreamer debug files
- GNU GENERAL PUBLIC LICENSE
+
+
+
+
-
-
- True
-
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_CENTER_ON_PARENT
- True
- False
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_NORTH_WEST
- True
- False
- False
-
-
-
- True
- False
- 0
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-cancel
- True
- GTK_RELIEF_NORMAL
- True
- -6
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- 6
- True
- False
- 0
-
-
-
- 250
- True
- GTK_PROGRESS_LEFT_TO_RIGHT
- 0
- 0.10000000149
-
- PANGO_ELLIPSIZE_NONE
-
-
- 12
- False
- False
-
-
-
-
- 0
- True
- False
-
-
-
-
-
-
-
+ False
+ René Stadler <mail@renestadler.de>
+ translator-credits
+ gst-debug-viewer.png
+
+
diff --git a/debug-viewer/data/main-window.ui b/debug-viewer/data/main-window.ui
new file mode 100644
index 0000000000..ab22805249
--- /dev/null
+++ b/debug-viewer/data/main-window.ui
@@ -0,0 +1,120 @@
+
+
+
+
+
diff --git a/debug-viewer/data/progress-dialog.ui b/debug-viewer/data/progress-dialog.ui
new file mode 100644
index 0000000000..2328563eb2
--- /dev/null
+++ b/debug-viewer/data/progress-dialog.ui
@@ -0,0 +1,83 @@
+
+
+
+
+ True
+
+ GTK_WINDOW_TOPLEVEL
+ GTK_WIN_POS_CENTER_ON_PARENT
+ True
+ False
+ False
+ True
+ False
+ False
+ GDK_WINDOW_TYPE_HINT_DIALOG
+ GDK_GRAVITY_NORTH_WEST
+ True
+ False
+ False
+
+
+ True
+ False
+ 0
+
+
+ True
+ GTK_BUTTONBOX_END
+
+
+ True
+ True
+ True
+ gtk-cancel
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
+ 0
+ False
+ True
+ GTK_PACK_END
+
+
+
+
+ 6
+ True
+ False
+ 0
+
+
+ 250
+ True
+ GTK_PROGRESS_LEFT_TO_RIGHT
+ 0
+ 0.10000000149
+
+ PANGO_ELLIPSIZE_NONE
+
+
+ 12
+ False
+ False
+
+
+
+
+ 0
+ True
+ False
+
+
+
+
+
+ cancel_button
+
+
+
diff --git a/debug-viewer/setup.py b/debug-viewer/setup.py
index 869cb81fdd..21a1a8e861 100755
--- a/debug-viewer/setup.py
+++ b/debug-viewer/setup.py
@@ -328,8 +328,10 @@ setup (cmdclass = cmdclass,
"GstDebugViewer.Common",
"GstDebugViewer.Plugins"],
scripts = ["gst-debug-viewer"],
- data_files = [("share/gst-debug-viewer", ["data/gst-debug-viewer.glade",
- "data/gst-debug-viewer.ui"],),
+ data_files = [("share/gst-debug-viewer", ["data/about-dialog.ui",
+ "data/main-window.ui",
+ "data/gst-debug-viewer.ui",
+ "data/progress-dialog.ui"],),
("share/icons/hicolor/48x48/apps", ["data/gst-debug-viewer.png"],),
("share/icons/hicolor/scalable/apps", ["data/gst-debug-viewer.svg"],)],