[meld] Add support for glade-3 custom widget creation



commit 9add5fb9385c40b36e22680b86c1f306b13e543e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Oct 14 14:48:43 2009 +1000

    Add support for glade-3 custom widget creation

 meld/ui/catalog.xml     |   20 ++++++++++++++++++++
 meld/ui/gladesupport.py |    4 ++++
 meld/ui/gnomeglade.py   |    2 ++
 meld/ui/historyentry.py |    3 +++
 meld/ui/msgarea.py      |    4 ++++
 5 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/meld/ui/catalog.xml b/meld/ui/catalog.xml
new file mode 100644
index 0000000..9f8f254
--- /dev/null
+++ b/meld/ui/catalog.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glade-catalog name="meld.ui.gladesupport" library="gladepython" domain="glade-3" depends="gtk+">
+    <init-function>glade_python_init</init-function>
+
+    <glade-widget-classes>
+        <glade-widget-class title="DiffMap" name="DiffMap" generic-name="diffmap"/>
+        <glade-widget-class title="HistoryEntry" name="HistoryEntry" generic-name="historyentry"/>
+        <glade-widget-class title="HistoryFileEntry" name="HistoryFileEntry" generic-name="historyfileentry"/>
+        <glade-widget-class title="MsgArea" name="MsgArea" generic-name="msgarea"/>
+        <glade-widget-class title="MsgAreaController" name="MsgAreaController" generic-name="msgareacontroller"/>
+    </glade-widget-classes>
+
+    <glade-widget-group name="meld" title="Meld">
+        <glade-widget-class-ref name="DiffMap"/>
+        <glade-widget-class-ref name="HistoryEntry"/>
+        <glade-widget-class-ref name="HistoryFileEntry"/>
+        <glade-widget-class-ref name="MsgArea"/>
+        <glade-widget-class-ref name="MsgAreaController"/>
+    </glade-widget-group>
+</glade-catalog>
diff --git a/meld/ui/gladesupport.py b/meld/ui/gladesupport.py
new file mode 100644
index 0000000..b087032
--- /dev/null
+++ b/meld/ui/gladesupport.py
@@ -0,0 +1,4 @@
+
+import historyentry
+import msgarea
+import meld.diffmap
diff --git a/meld/ui/gnomeglade.py b/meld/ui/gnomeglade.py
index 459733d..44ee7c2 100644
--- a/meld/ui/gnomeglade.py
+++ b/meld/ui/gnomeglade.py
@@ -128,3 +128,5 @@ def load_pixbuf(fname, size=0):
         image = image.scale_simple(size, int(aspect*size), 2)
     return image
 
+
+import gladesupport
diff --git a/meld/ui/historyentry.py b/meld/ui/historyentry.py
index 4fd3b34..278d1d4 100644
--- a/meld/ui/historyentry.py
+++ b/meld/ui/historyentry.py
@@ -58,6 +58,7 @@ def _escape_cell_data_func(col, renderer, model, it, escape_func):
 
 
 class HistoryEntry(gtk.ComboBoxEntry):
+    __gtype_name__ = "HistoryEntry"
 
     __gproperties__ = {
         "history-id":      (str, "History ID",
@@ -226,6 +227,8 @@ def _expand_filename(filename, default_dir):
 
 
 class HistoryFileEntry(gtk.HBox, gtk.Editable):
+    __gtype_name__ = "HistoryFileEntry"
+
     __gsignals__ = {
         "browse_clicked" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []),
         "activate" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [])
diff --git a/meld/ui/msgarea.py b/meld/ui/msgarea.py
index c83c9f3..f077ee7 100644
--- a/meld/ui/msgarea.py
+++ b/meld/ui/msgarea.py
@@ -28,6 +28,8 @@ _logger = logging.getLogger("hotwire.ui.MsgArea")
 # This file is a Python translation of gedit/gedit/gedit-message-area.c
 
 class MsgArea(gtk.HBox):
+    __gtype_name__ = "MsgArea"
+
     __gsignals__ = {
         "response" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT,)),
         "close" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [])
@@ -217,6 +219,8 @@ class MsgArea(gtk.HBox):
         self.set_contents(hbox_content)
 
 class MsgAreaController(gtk.HBox):
+    __gtype_name__ = "MsgAreaController"
+
     def __init__(self):
         super(MsgAreaController, self).__init__()
 



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