[pybliographer] ui: Port sort dialog to GtkBuilder



commit b883b50f304c49886ecd7bf0e9c82c5b4d6bab84
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Mon Mar 26 15:47:51 2018 -0300

    ui: Port sort dialog to GtkBuilder

 Pyblio/GnomeUI/Sort.py           |   15 ++--
 Pyblio/GnomeUI/glade/Makefile.am |    2 +-
 Pyblio/GnomeUI/glade/sort.glade  |  217 --------------------------------------
 Pyblio/GnomeUI/glade/sort.ui     |  145 +++++++++++++++++++++++++
 4 files changed, 153 insertions(+), 226 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Sort.py b/Pyblio/GnomeUI/Sort.py
index 9427438..694254c 100644
--- a/Pyblio/GnomeUI/Sort.py
+++ b/Pyblio/GnomeUI/Sort.py
@@ -1,7 +1,8 @@
+# -*- coding: utf-8 -*-
 # This file is part of pybliographer
 # 
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
 #         
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -34,27 +35,25 @@ pickle = cPickle
 del cPickle
 
 
-class SortDialog (Connector.Publisher, Utils.GladeWindow):
-
+class SortDialog(Connector.Publisher, Utils.Builder):
     """ Provide a configuration dialog for sorting the main index.
     Emit a 'sort-data' signal when the user chooses new sort options.
     """
 
    # This dialog is described as a glade XML file
-    gladeinfo = { 'file': 'sort.glade',
+    gladeinfo = { 'file': 'sort.ui',
                   'root': '_w_sort',
                   'name': 'sort'
                   }
     
-    def __init__ (self, sort, parent = None):
-
+    def __init__(self, sort, parent=None):
         """ Create the dialog.
 
           - current_sort: the current sorting options
           - parent: parent window
        """
         
-        Utils.GladeWindow.__init__ (self, parent)
+        Utils.Builder.__init__(self, parent)
 
         self._model = gtk.ListStore (gtk.gdk.Pixbuf, str, gobject.TYPE_PYOBJECT, int)
         self._w_tree.set_model (self._model)
diff --git a/Pyblio/GnomeUI/glade/Makefile.am b/Pyblio/GnomeUI/glade/Makefile.am
index 0c8ccdf..4812026 100644
--- a/Pyblio/GnomeUI/glade/Makefile.am
+++ b/Pyblio/GnomeUI/glade/Makefile.am
@@ -5,7 +5,7 @@ glade_DATA =                                    \
        fields1.glade                           \
        pyblio.ui                               \
        search.glade                            \
-       sort.glade                              \
+       sort.ui                                 \
        format.glade                            \
        medline.glade                           \
        config1.glade                           \
diff --git a/Pyblio/GnomeUI/glade/sort.ui b/Pyblio/GnomeUI/glade/sort.ui
new file mode 100644
index 0000000..509cb1c
--- /dev/null
+++ b/Pyblio/GnomeUI/glade/sort.ui
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 2.24 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="_w_sort">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Select sort criteria</property>
+    <property name="default_width">200</property>
+    <property name="default_height">200</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">True</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancelbutton1">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_cancel" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="okbutton1">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_accept" swapped="no"/>
+              </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">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <child>
+              <object class="GtkViewport" id="viewport1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkVBox" id="vbox1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <child>
+                          <object class="GtkTreeView" id="_w_tree">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="headers_visible">False</property>
+                            <property name="reorderable">True</property>
+                            <signal name="row-activated" handler="on_activate" swapped="no"/>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHButtonBox" id="hbuttonbox2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">5</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <object class="GtkButton" id="button1">
+                            <property name="label" translatable="yes">Set as default</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_action_appearance">False</property>
+                            <signal name="clicked" handler="_on_set_as_default" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">cancelbutton1</action-widget>
+      <action-widget response="-5">okbutton1</action-widget>
+    </action-widgets>
+  </object>
+</interface>


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