[gevice] data/ui/diagram.xml: add new file
- From: Alejandro Valdes Jimenez <avaldes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gevice] data/ui/diagram.xml: add new file
- Date: Mon, 25 Jul 2011 21:30:53 +0000 (UTC)
commit 349c4330d160a104023ba0710963f973806e12fa
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date: Mon Jul 25 17:24:51 2011 -0400
data/ui/diagram.xml: add new file
ChangeLog | 3 +
data/ui/Makefile.am | 2 +-
data/ui/diagram.xml | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++
data/ui/gevice.xml | 160 ---------------------------------------------
src/gevicediagram.py | 19 +++--
5 files changed, 190 insertions(+), 169 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 36a5433..3b0674b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
2011-07-25 Alejandro Valdes Jimenez <avaldes gnome org>
+ * data/ui/diagram.xml: add new file
+
+2011-07-25 Alejandro Valdes Jimenez <avaldes gnome org>
* data/ui/find.xml: add new file
2011-07-25 Alejandro Valdes Jimenez <avaldes gnome org>
diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am
index 9cf8f63..092d0ef 100644
--- a/data/ui/Makefile.am
+++ b/data/ui/Makefile.am
@@ -4,6 +4,6 @@
uidir = $(pkgdatadir)/ui
-ui_DATA = main.xml menu.xml pref.xml dbase.xml device.xml find.xml
+ui_DATA = main.xml menu.xml pref.xml dbase.xml device.xml find.xml diagram.xml
EXTRA_DIST = $(ui_DATA)
diff --git a/data/ui/diagram.xml b/data/ui/diagram.xml
new file mode 100644
index 0000000..044e780
--- /dev/null
+++ b/data/ui/diagram.xml
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 2.6 -->
+ <object class="GtkListStore" id="liststore_format">
+ <columns>
+ <!-- column-name name_format -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">png</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">jpg</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">gif</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">svg</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="liststore_program">
+ <columns>
+ <!-- column-name name_program -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">dot</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">neato</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">circo</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">twopi</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkWindow" id="window_diagram">
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes" context="yes">Generate diagram</property>
+ <property name="resizable">False</property>
+ <property name="window_position">center</property>
+ <child>
+ <object class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">15</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="yes">Program</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_program">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststore_program</property>
+ <child>
+ <object class="GtkCellRendererText" id="renderer1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="yes">Format</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_format">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststore_format</property>
+ <child>
+ <object class="GtkCellRendererText" id="renderer2"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkButton" id="button_diagram_generate">
+ <property name="label" context="yes">gtk-convert</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_diagram_cancel">
+ <property name="label" context="yes">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/data/ui/gevice.xml b/data/ui/gevice.xml
index b3e6253..6619425 100644
--- a/data/ui/gevice.xml
+++ b/data/ui/gevice.xml
@@ -246,166 +246,6 @@
</object>
</child>
</object>
- <object class="GtkWindow" id="window_find">
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes" context="yes">Find</property>
- <property name="resizable">False</property>
- <property name="window_position">center</property>
- <child>
- <object class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">15</property>
- <child>
- <object class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkRadioButton" id="radiobutton_namedevice">
- <property name="label" translatable="yes" context="yes">Device name</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobutton_ip">
- <property name="label" translatable="yes" context="yes">IP</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton_namedevice</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="radiobutton_serial">
- <property name="label" translatable="yes" context="yes">Serial</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radiobutton_namedevice</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="yes">Filter</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry_find">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkButton" id="button_find_find">
- <property name="label" context="yes">gtk-find</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_find_cancel">
- <property name="label" context="yes">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
<object class="GtkWindow" id="window_location">
<property name="can_focus">False</property>
<property name="title" translatable="yes" context="yes">New Location</property>
diff --git a/src/gevicediagram.py b/src/gevicediagram.py
index 9fb6326..9ad08d4 100644
--- a/src/gevicediagram.py
+++ b/src/gevicediagram.py
@@ -1,6 +1,7 @@
import pygtk
pygtk.require('2.0')
-import gtk.glade
+#import gtk.glade
+import gtk
import os
from pygraphviz import *
@@ -33,13 +34,15 @@ class GeviceDiagram:
self.name_link = None
def load_interface (self,gevice):
- glade_file = gtk.glade.XML (os.path.join (config.GLADEDIR, "gevice.glade"),"window_diagram",None)
- self.window_diagram = glade_file.get_widget ("window_diagram")
- self.button_diagram_cancel = glade_file.get_widget ("button_diagram_cancel")
- self.button_diagram_generate = glade_file.get_widget ("button_diagram_generate")
- self.combobox_program = glade_file.get_widget ("combobox_program")
- self.combobox_format = glade_file.get_widget ("combobox_format")
-
+ builder = gtk.Builder()
+ builder.add_from_file(os.path.join (config.UIDIR, "diagram.xml"))
+
+ self.window_diagram = builder.get_object ("window_diagram")
+ self.button_diagram_cancel = builder.get_object ("button_diagram_cancel")
+ self.button_diagram_generate = builder.get_object ("button_diagram_generate")
+ self.combobox_program = builder.get_object ("combobox_program")
+ self.combobox_format = builder.get_object ("combobox_format")
+
# set default value for diagram
self.combobox_format.set_active (0)
self.combobox_program.set_active (0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]