[pybliographer/gtk3: 1/25] ui: Initial port to gtk+3
- From: Germán Poó Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer/gtk3: 1/25] ui: Initial port to gtk+3
- Date: Tue, 30 Jul 2013 23:16:19 +0000 (UTC)
commit 0e3c9f93fea1eac7a1840a6631f27d1fd32011b6
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Wed Apr 24 02:55:20 2013 -0700
ui: Initial port to gtk+3
Pyblio/ConfDir/GnomeUI.py | 8 +-
Pyblio/GnomeUI/Common.py | 84 ++--
Pyblio/GnomeUI/Compat.py | 25 +-
Pyblio/GnomeUI/Config.py | 113 +++---
Pyblio/GnomeUI/Document.py | 155 ++++----
Pyblio/GnomeUI/Editor.py | 216 +++++-----
Pyblio/GnomeUI/Entry.py | 23 +-
Pyblio/GnomeUI/Fields.py | 60 ++--
Pyblio/GnomeUI/FileSelector.py | 36 +-
Pyblio/GnomeUI/Format.py | 6 +-
Pyblio/GnomeUI/Index.py | 77 ++--
Pyblio/GnomeUI/Medline.py | 5 +-
Pyblio/GnomeUI/OpenURL.py | 12 +-
Pyblio/GnomeUI/Pybliographic.py | 4 +-
Pyblio/GnomeUI/Search.py | 25 +-
Pyblio/GnomeUI/Sort.py | 15 +-
Pyblio/GnomeUI/Utils.py | 61 ++--
Pyblio/GnomeUI/__init__.py | 24 +-
Pyblio/GnomeUI/glade/pyblio.glade.in | 626 ---------------------------
Pyblio/GnomeUI/glade/pyblio.ui.in | 778 ++++++++++++++++++++++++++++++++++
scripts/pybliographic.py | 5 +-
21 files changed, 1264 insertions(+), 1094 deletions(-)
---
diff --git a/Pyblio/ConfDir/GnomeUI.py b/Pyblio/ConfDir/GnomeUI.py
index 6739aa4..8872077 100644
--- a/Pyblio/ConfDir/GnomeUI.py
+++ b/Pyblio/ConfDir/GnomeUI.py
@@ -1,7 +1,7 @@
from Pyblio import Config, Fields
from Pyblio.GnomeUI import Utils, Editor
-import gtk
+from gi.repository import Gtk
Config.define ('gnomeui/default', """ Graphical description of the
default field. """)
@@ -45,8 +45,8 @@ Config.define ('gnomeui/multiline',
-Config.set ('gnomeui/monospaced',
- gtk.gdk.Font ('-*-*-*-r-normal-*-*-*-*-*-c-*-iso8859-1'))
+#Config.set ('gnomeui/monospaced',
+# gtk.gdk.Font ('-*-*-*-r-normal-*-*-*-*-*-c-*-iso8859-1'))
@@ -58,7 +58,7 @@ Fields.URL.widget = Editor.URL
Fields.Reference.widget = Editor.Reference
Fields.Date.widget = Editor.Date
-Fields.Date.justification = gtk.JUSTIFY_RIGHT
+Fields.Date.justification = Gtk.JUSTIFY_RIGHT
for f, w in (('author', 150),
('editor', 150),
diff --git a/Pyblio/GnomeUI/Common.py b/Pyblio/GnomeUI/Common.py
index 83971b9..9397f17 100644
--- a/Pyblio/GnomeUI/Common.py
+++ b/Pyblio/GnomeUI/Common.py
@@ -25,7 +25,7 @@ Class fileschooserbutton implements a widget similar to
File Chooser Button from gtk: it calls a
File Chooser Dialog to allow entering and editing an URL.
-Class filechooserdialog subclasses gtk.FileChooserDialog and
+Class filechooserdialog subclasses Gtk.FileChooserDialog and
adds some fields to enter additional information for an URL.
@@ -36,23 +36,25 @@ Class filechooserdialog subclasses gtk.FileChooserDialog and
RESPONSE_COPY = 1
RESPONSE_VIEW = 2
-import gobject, gtk, gtk.gdk, pango, sys
+from gi.repository import GObject, Gtk, Gdk, Pango
+# import gobject, gtk, Gtk.gdk, pango, sys
+import sys
from Pyblio import Fields, Resource
def get_icon_theme (widget):
- if gtk.widget_has_screen (widget):
- return gtk.icon_theme_get_for_screen (gtk.widget_get_screen (widget))
- return gtk.icon_theme_get_default ();
+ if Gtk.widget_has_screen (widget):
+ return Gtk.icon_theme_get_for_screen (Gtk.widget_get_screen (widget))
+ return Gtk.IconTheme.get_default ();
-class filechooserbutton (gtk.Button):
+class filechooserbutton (Gtk.Button):
def __init__ (self, URL=None, action='enter/edit', parent=None):
- gtk.Button.__init__ (self)
+ GObject.GObject.__init__ (self)
- g_error = gobject.GError ()
+ g_error = GObject.GError ()
self.parent_widget = parent
self.url = URL or Fields.URL ()
self.newuri = None
@@ -61,20 +63,20 @@ class filechooserbutton (gtk.Button):
assert action in Resource.CHOOSER_ACTIONS, "Invalid file chooser action"
self.connect ("clicked", self.cb_clicked)
- self.box = gtk.HBox (False, 4)
+ self.box = Gtk.HBox (False, 4)
self.add (self.box)
- self.image = gtk.Image ()
- pixbuf = self.render_icon (gtk.STOCK_NEW,
- gtk.ICON_SIZE_MENU)
+ self.image = Gtk.Image ()
+ pixbuf = self.render_icon (Gtk.STOCK_NEW,
+ Gtk.IconSize.MENU)
self.image.set_from_pixbuf (pixbuf)
self.box.pack_start (self.image, False, False, 0)
- self.label = gtk.Label (self.url.get_url () or _('Enter/Select an URL'))
- self.label.set_ellipsize (pango.ELLIPSIZE_START)
+ self.label = Gtk.Label(label=self.url.get_url () or _('Enter/Select an URL'))
+ self.label.set_ellipsize (Pango.EllipsizeMode.START)
self.label.set_alignment (0.0, 0.5)
self.box.pack_start (self.label)
- self.sep = gtk.VSeparator ()
+ self.sep = Gtk.VSeparator ()
self.box.pack_start (self.sep, False, False, 0)
- self.icon = gtk.image_new_from_stock (gtk.STOCK_SAVE, gtk.ICON_SIZE_MENU)
+ self.icon = Gtk.Image.new_from_stock (Gtk.STOCK_SAVE, Gtk.IconSize.MENU)
self.box.pack_start (self.icon, False, False, 0)
self.title = "Enter/Edit URL"
@@ -94,7 +96,7 @@ class filechooserbutton (gtk.Button):
def cb_clicked (self, *args):
self.dialog = filechooserdialog (self.url, self.title)
- self.dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
+ self.dialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
self.dialog.set_transient_for (
self.parent_widget or self.get_toplevel ())
@@ -102,7 +104,7 @@ class filechooserbutton (gtk.Button):
print 'NEW URI:', response, self.newuri
self.dialog.destroy ()
- if response == gtk.RESPONSE_OK:
+ if response == Gtk.ResponseType.OK:
pass
elif response == RESPONSE_VIEW:
print 'RESPONSE VIEW'
@@ -118,14 +120,14 @@ class filechooserbutton (gtk.Button):
return self.newuri
-class filechooserdialog (gtk.FileChooserDialog):
+class filechooserdialog (Gtk.FileChooserDialog):
def __init__ (self, url, title):
- gtk.FileChooserDialog.__init__ (
- self, title, None, gtk.FILE_CHOOSER_ACTION_SAVE,
+ GObject.GObject.__init__ (
+ self, title, None, Gtk.FileChooserAction.SAVE,
backend="gnomevfs")
- tips = gtk.Tooltips ()
+ tips = Gtk.Tooltips ()
self.set_local_only (False)
@@ -136,55 +138,55 @@ class filechooserdialog (gtk.FileChooserDialog):
## self.set_current_folder (self.uri)
## self.set_current_name (self.uri)
- accelerator = gtk.AccelGroup ()
+ accelerator = Gtk.AccelGroup ()
self.add_accel_group (accelerator)
- b = self.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.Escape, 0, 0)
+ b = self.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_Escape, 0, 0)
- b = self.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.Return, 0, 0)
+ b = self.add_button (Gtk.STOCK_OK, Gtk.ResponseType.OK)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_Return, 0, 0)
- b = self.add_button (gtk.STOCK_COPY, RESPONSE_COPY)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.c, gtk.gdk.CONTROL_MASK, 0)
+ b = self.add_button (Gtk.STOCK_COPY, RESPONSE_COPY)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_c, Gdk.ModifierType.CONTROL_MASK, 0)
- b = self.add_button (gtk.STOCK_FIND, RESPONSE_VIEW)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.v, gtk.gdk.CONTROL_MASK, 0)
+ b = self.add_button (Gtk.STOCK_FIND, RESPONSE_VIEW)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_v, Gdk.ModifierType.CONTROL_MASK, 0)
# added widgets
- vbox = gtk.VBox ()
- hbox = gtk.HBox ()
+ vbox = Gtk.VBox ()
+ hbox = Gtk.HBox ()
vbox.pack_start (hbox)
hbox.set_spacing (6)
hbox.set_border_width (6)
- self.invalid_w = gtk.ToggleButton (_('Invalid'))
+ self.invalid_w = Gtk.ToggleButton (_('Invalid'))
hbox.pack_start (self.invalid_w, expand=False)
tips.set_tip (self.invalid_w, "Set this to indicate an invalid URL",
"An invalid url may not usually be used, "
"but be kept for historical purposes.")
self.invalid_w.set_active (self.URI.invalid or False)
- self.inexact_w = gtk.ToggleButton (_('Inexact'))
+ self.inexact_w = Gtk.ToggleButton (_('Inexact'))
hbox.pack_start (self.inexact_w, expand=False)
tips.set_tip (self.inexact_w, "Indicates an URL that is not the resource proper",
"An inexact URL usually requires manual intervention.")
self.inexact_w.set_active (self.URI.inexact or False)
- hbox.pack_start (gtk.Label (_(' Date accessed:')), False)
- self.date_w = gtk.Entry ()
+ hbox.pack_start (Gtk.Label(label=_(' Date accessed:')), False)
+ self.date_w = Gtk.Entry ()
hbox.pack_start (self.date_w)
tips.set_tip (self.date_w, "The date (and time) the resource has been accessed.",
"This information is often required"
" by bibliographical standards.")
self.date_w.set_text (self.URI.date or '')
- hbox = gtk.HBox ()
+ hbox = Gtk.HBox ()
vbox.pack_start (hbox)
hbox.set_spacing (6)
hbox.set_border_width (6)
- hbox.pack_start (gtk.Label (_('Note:')), False)
- self.note_w = gtk.Entry ()
+ hbox.pack_start (Gtk.Label(label=_('Note:')), False)
+ self.note_w = Gtk.Entry ()
hbox.pack_start (self.note_w)
tips.set_tip (self.note_w, "A note e.g. about the resource or its accessability.",
"Information that might help the user")
@@ -194,7 +196,7 @@ class filechooserdialog (gtk.FileChooserDialog):
self.show_all ()
def run (self):
- response = gtk.FileChooserDialog.run (self)
+ response = Gtk.FileChooserDialog.run (self)
uri = self.get_uri ()
invalid = self.invalid_w.get_active ()
inexact = self.inexact_w.get_active ()
diff --git a/Pyblio/GnomeUI/Compat.py b/Pyblio/GnomeUI/Compat.py
index dd1ea0d..1257567 100644
--- a/Pyblio/GnomeUI/Compat.py
+++ b/Pyblio/GnomeUI/Compat.py
@@ -27,22 +27,23 @@ Compatability module
"""
# gnome-python (2.x)
-try:
- from gnome.ui import gnome_error_dialog_parented
-except ImportError:
- from gnome.ui import error_dialog_parented as gnome_error_dialog_parented
-
-error_dialog_parented = gnome_error_dialog_parented
+#try:
+# from gnome.ui import gnome_error_dialog_parented
+#except ImportError:
+# from gnome.ui import error_dialog_parented as gnome_error_dialog_parented
+#
+#error_dialog_parented = gnome_error_dialog_parented
+error_dialog_parented = str
# gnome-python (2.x)
-try:
- import gnomevfs
-except ImportError:
- import gnome.vfs as gnomevfs
-
-get_mime_type = gnomevfs.get_mime_type
+#try:
+# import gnomevfs
+#except ImportError:
+# import gnome.vfs as gnomevfs
+#get_mime_type = gnomevfs.get_mime_type
+get_mime_type = str
# Local Variables:
diff --git a/Pyblio/GnomeUI/Config.py b/Pyblio/GnomeUI/Config.py
index 2d8628c..b21f732 100644
--- a/Pyblio/GnomeUI/Config.py
+++ b/Pyblio/GnomeUI/Config.py
@@ -22,8 +22,7 @@
# TO DO:
# List view troubles
-import gobject, gtk, gtk.glade
-import gnome.ui
+from gi.repository import GObject, Gtk
import copy, os.path, re, string
@@ -49,11 +48,11 @@ class ConfigDialog (Utils.GladeWindow):
self.dialog = self.xml.get_widget ('config1')
content = self.xml.get_widget ('dialog-vbox1')
- self.w = gtk.Notebook ()
+ self.w = Gtk.Notebook ()
content.pack_start (self.w)
-## tooltips = gtk.Tooltips ()
+## tooltips = Gtk.Tooltips ()
## tooltips.enable ()
self.warning = 0
@@ -71,7 +70,7 @@ class ConfigDialog (Utils.GladeWindow):
keys = Config.keys_in_domain (string.lower (dom))
keys.sort ()
- table = gtk.VBox (spacing=6)
+ table = Gtk.VBox (spacing=6)
table.set_border_width (12)
for item in keys:
@@ -80,12 +79,12 @@ class ConfigDialog (Utils.GladeWindow):
continue
nice = string.capitalize (string.split (item, '/') [1])
- label = gtk.Label()
+ label = Gtk.Label()
label.set_use_markup(True)
label.set_markup('<b>%s</b>' % (nice))
label.set_alignment(xalign=0.5, yalign=0)
- hbox = gtk.HBox (spacing = 12)
+ hbox = Gtk.HBox (spacing = 12)
hbox.pack_start (label,False)
desc = data.description
@@ -96,11 +95,11 @@ class ConfigDialog (Utils.GladeWindow):
# Create the edition widget...
edit = data.type.w (data.type, self, item, help_text=desc)
if edit.allow_help:
- label = gtk.Label ()
+ label = Gtk.Label ()
label.set_line_wrap (True)
label.set_text(desc)
hbox.pack_start(label, False)
- hbox = gtk.HBox (spacing = 6)
+ hbox = Gtk.HBox (spacing = 6)
hbox.set_border_width (6)
cw [item] = edit
@@ -115,12 +114,12 @@ class ConfigDialog (Utils.GladeWindow):
# items should not be spread vertically, however
if cw:
# Put the complete table in a scrolled window
- scroll = gtk.ScrolledWindow ()
- scroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ scroll = Gtk.ScrolledWindow ()
+ scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_with_viewport (table)
- self.w.append_page (scroll, gtk.Label (dom))
+ self.w.append_page (scroll, Gtk.Label(label=dom))
self.page.append (cw)
self.show()
@@ -203,7 +202,7 @@ class StringConfig (BaseConfig):
def __init__ (self, dtype, props, key=None, parent=None, help_text=''):
BaseConfig.__init__ (self, dtype, props, key, parent)
- self.w = gtk.Entry ()
+ self.w = Gtk.Entry ()
if self.key:
text = Config.get (key).data
@@ -240,8 +239,8 @@ class IntegerConfig (StringConfig):
vmin = 0
vmax = +100
- adj = gtk.Adjustment (0, vmin, vmax, 1, 10, 0)
- self.w = gtk.SpinButton (adj, 1, 0)
+ adj = Gtk.Adjustment (0, vmin, vmax, 1, 10, 0)
+ self.w = Gtk.SpinButton (adj, 1, 0)
if self.key:
value = Config.get (key).data
@@ -274,8 +273,8 @@ class BooleanConfig (BaseConfig):
def __init__ (self, dtype, props, key=None, parent=None, help_text=''):
BaseConfig.__init__ (self, dtype, props, key, parent)
self.allow_help = False
- self.w = gtk.HBox (spacing=6)
- self.button = gtk.CheckButton ()
+ self.w = Gtk.HBox (spacing=6)
+ self.button = Gtk.CheckButton ()
self.w.pack_start (self.button, False)
if self.key:
@@ -283,10 +282,10 @@ class BooleanConfig (BaseConfig):
self.button.set_active(value)
self.button.connect ('clicked', self.update, True)
- description = gtk.Label()
+ description = Gtk.Label()
description.set_use_markup(True)
description.set_line_wrap(True)
- description.set_justify(gtk.JUSTIFY_LEFT) #default?
+ description.set_justify(Gtk.Justification.LEFT) #default?
description.set_markup('%s' % (help_text))
description.set_alignment(xalign=0.5, yalign=0.5)
self.w.pack_start (description, False, True)
@@ -317,7 +316,7 @@ class ElementConfig (BaseConfig):
data = str(Config.get (key).data)
else: data = ''
- self.m = gtk.combo_box_new_text ()
+ self.m = Gtk.ComboBoxText ()
self.items = dtype.get ()
ix = 0
@@ -331,7 +330,7 @@ class ElementConfig (BaseConfig):
self.m.set_active (select)
self.m.connect ('changed', self.update, True)
- self.w = gtk.HBox(spacing = 12)
+ self.w = Gtk.HBox(spacing = 12)
self.w.pack_start(self.m, True, True, padding=12)
self.w.show_all ()
return
@@ -349,7 +348,7 @@ class TupleConfig (BaseConfig):
def __init__ (self, dtype, props, key=None, parent=None, help_text=''):
BaseConfig.__init__ (self, dtype, props, key, parent)
- self.w = gtk.VBox (spacing = 6)
+ self.w = Gtk.VBox (spacing = 6)
self.sub = []
self.resize = False
@@ -404,19 +403,19 @@ class ListConfig (BaseConfig):
def __init__ (self, dtype, props, key=None, parent=None, help_text=''):
BaseConfig.__init__ (self, dtype, props, key, parent)
- self.w = gtk.VBox (spacing = 6)
- h = gtk.HBox (spacing = 6)
- scroll = gtk.ScrolledWindow ()
- scroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ self.w = Gtk.VBox (spacing = 6)
+ h = Gtk.HBox (spacing = 6)
+ scroll = Gtk.ScrolledWindow ()
+ scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
- self.m = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
- self.v = gtk.TreeView(self.m)
+ self.m = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_PYOBJECT)
+ self.v = Gtk.TreeView(self.m)
self.v.set_reorderable (True)
self.v.set_headers_visible (False)
- rend = gtk.CellRendererText ()
- col = gtk.TreeViewColumn ('', rend, text=0)
+ rend = Gtk.CellRendererText ()
+ col = Gtk.TreeViewColumn ('', rend, text=0)
col.set_resizable(True)
- #col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
+ #col.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
col.set_min_width(200)
self.v.append_column (col)
self.s = self.v.get_selection()
@@ -424,15 +423,15 @@ class ListConfig (BaseConfig):
scroll.add (self.v)
h.pack_start (scroll, True, True)
- bbox = gtk.VButtonBox ()
+ bbox = Gtk.VButtonBox ()
- button = gtk.Button (_("Add"))
+ button = Gtk.Button (_("Add"))
bbox.pack_start (button)
button.connect ('clicked', self.add_cb)
- button = gtk.Button (_("Update"))
+ button = Gtk.Button (_("Update"))
bbox.pack_start (button)
button.connect ('clicked', self.update_cb)
- button = gtk.Button (_("Remove"))
+ button = Gtk.Button (_("Remove"))
bbox.pack_start (button)
button.connect ('clicked', self.remove_cb)
@@ -514,25 +513,25 @@ class DictConfig (BaseConfig):
def __init__ (self, dtype, props, key=None, parent=None, help_text=''):
BaseConfig.__init__ (self, dtype, props, key, parent)
- self.w = gtk.VBox (spacing = 6)
- h = gtk.HBox (spacing = 6)
- scroll = gtk.ScrolledWindow ()
- scroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
-
- self.m = gtk.ListStore(gobject.TYPE_STRING,
- gobject.TYPE_STRING,
- gobject.TYPE_PYOBJECT)
- self.v = gtk.TreeView(self.m)
-
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn('Key', rend, text=0)
+ self.w = Gtk.VBox (spacing = 6)
+ h = Gtk.HBox (spacing = 6)
+ scroll = Gtk.ScrolledWindow ()
+ scroll.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
+
+ self.m = Gtk.ListStore(GObject.TYPE_STRING,
+ GObject.TYPE_STRING,
+ GObject.TYPE_PYOBJECT)
+ self.v = Gtk.TreeView(self.m)
+
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn('Key', rend, text=0)
col.set_resizable(True)
- #col.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
+ #col.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
col.set_min_width(100)
self.v.append_column(col)
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn('Value', rend, text=1)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn('Value', rend, text=1)
self.v.append_column(col)
self.s = self.v.get_selection()
@@ -541,26 +540,26 @@ class DictConfig (BaseConfig):
scroll.add (self.v)
h.pack_start (scroll, True, True)
- bbox = gtk.VButtonBox ()
+ bbox = Gtk.VButtonBox ()
- button = gtk.Button (_("Set"))
+ button = Gtk.Button (_("Set"))
bbox.pack_start (button)
button.connect ('clicked', self.update_cb)
- button = gtk.Button (_("Remove"))
+ button = Gtk.Button (_("Remove"))
bbox.pack_start (button)
button.connect ('clicked', self.remove_cb)
h.pack_start (bbox, False, False)
self.w.pack_start (h)
- self.w.pack_start (gtk.HSeparator (), expand = False, fill = False)
+ self.w.pack_start (Gtk.HSeparator (), expand = False, fill = False)
# Bottom
- table = gtk.Table (2, 2, homogeneous = False)
+ table = Gtk.Table (2, 2, homogeneous = False)
table.set_row_spacings (6)
table.set_col_spacings (6)
- table.attach (gtk.Label (_("Key:")), 0, 1, 0, 1,
+ table.attach (Gtk.Label(label=_("Key:")), 0, 1, 0, 1,
xoptions = 0, yoptions = 0)
- table.attach (gtk.Label (_("Value:")), 0, 1, 1, 2,
+ table.attach (Gtk.Label(label=_("Value:")), 0, 1, 1, 2,
xoptions = 0, yoptions = 0)
self.keyw = dtype.key.w (dtype.key, props, parent=self)
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 2f6af90..8d99634 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -23,15 +23,15 @@
''' This module defines a Document class '''
-import gobject
+from gi.repository import GObject
-from gnome import ui
+# from gnome import ui
+from gettext import gettext as _
+# import gnome
+from gi.repository import Gtk
+# import Gtk.glade
-import gnome
-import gtk
-import gtk.glade
-
-from gtk import gdk
+from gi.repository import Gdk
from Pyblio.GnomeUI import Editor, Entry, FileSelector, Format
from Pyblio.GnomeUI import Index, OpenURL, Search, Utils
@@ -133,12 +133,12 @@ class Document (Connector.Publisher):
def __init__ (self, database):
- self.uim = gtk.UIManager ()
+ self.uim = Gtk.UIManager ()
self.recents = None
self.viewables = None
- self.actiongroup = gtk.ActionGroup ('Main')
+ self.actiongroup = Gtk.ActionGroup ('Main')
self.actiongroup.add_actions ([
# id stock label accel tooltip callback
@@ -150,50 +150,50 @@ class Document (Connector.Publisher):
('HelpMenu', None, _('_Help')),
('Recent', None, _('Recent documents')),
- ('New', gtk.STOCK_NEW, None, None, None, self.new_document),
- ('Open', gtk.STOCK_OPEN, None, None, _('Open a file'), self.ui_open_document),
+ ('New', Gtk.STOCK_NEW, None, None, None, self.new_document),
+ ('Open', Gtk.STOCK_OPEN, None, None, _('Open a file'), self.ui_open_document),
('Open_URL', None, _('Open _Location'), '<control>l', None, self.ui_open_location),
- ('Save', gtk.STOCK_SAVE, None, None, _('Save the current file'), self.save_document),
- ('Save_As', gtk.STOCK_SAVE_AS, None, None, None, self.save_document_as),
- ('Close', gtk.STOCK_CLOSE, None, None, None, self.close_document),
- ('Quit', gtk.STOCK_QUIT, None, None, None, self.exit_application),
+ ('Save', Gtk.STOCK_SAVE, None, None, _('Save the current file'), self.save_document),
+ ('Save_As', Gtk.STOCK_SAVE_AS, None, None, None, self.save_document_as),
+ ('Close', Gtk.STOCK_CLOSE, None, None, None, self.close_document),
+ ('Quit', Gtk.STOCK_QUIT, None, None, None, self.exit_application),
('Merge', None, _('Merge With...'), '<control>g', None, self.merge_database),
('Medline', None, _('Medline Query...'), '<control>m', None, self.query_database),
- ('Cut', gtk.STOCK_CUT, None, None, None, self.cut_entry),
- ('Copy', gtk.STOCK_COPY, None, None, None, self.copy_entry),
- ('Paste', gtk.STOCK_PASTE, None, None, None, self.paste_entry),
- ('Clear', gtk.STOCK_CLEAR, None, None, None, self.clear_entries),
- ('Add', gtk.STOCK_ADD, None, '<shift><control>n', _('Add a new entry'), self.add_entry),
- ('Delete', gtk.STOCK_DELETE, None, None, None, self.delete_entry),
- ('Find', gtk.STOCK_FIND, None, None, None, self.find_entries),
+ ('Cut', Gtk.STOCK_CUT, None, None, None, self.cut_entry),
+ ('Copy', Gtk.STOCK_COPY, None, None, None, self.copy_entry),
+ ('Paste', Gtk.STOCK_PASTE, None, None, None, self.paste_entry),
+ ('Clear', Gtk.STOCK_CLEAR, None, None, None, self.clear_entries),
+ ('Add', Gtk.STOCK_ADD, None, '<shift><control>n', _('Add a new entry'), self.add_entry),
+ ('Delete', Gtk.STOCK_DELETE, None, None, None, self.delete_entry),
+ ('Find', Gtk.STOCK_FIND, None, None, None, self.find_entries),
('Sort', None, _('S_ort...'), None, None, self.sort_entries),
- ('Cite', gtk.STOCK_JUMP_TO, _('Cite...'), None, _('Cite key(s)'), self.lyx_cite),
- ('Format', gtk.STOCK_EXECUTE, _('Format...'), None, None, self.format_entries),
+ ('Cite', Gtk.STOCK_JUMP_TO, _('Cite...'), None, _('Cite key(s)'), self.lyx_cite),
+ ('Format', Gtk.STOCK_EXECUTE, _('Format...'), None, None, self.format_entries),
('Fields', None, _('Fields...'), None, None, self.set_fields),
- ('Preferences', gtk.STOCK_PREFERENCES, None, None, None, self.set_preferences),
+ ('Preferences', Gtk.STOCK_PREFERENCES, None, None, None, self.set_preferences),
('Forget', None, _('Forget all changes'), None, None, self.forget_changes_cb),
- ('Contents', gtk.STOCK_HELP, None, None, None, self.on_documentation),
+ ('Contents', Gtk.STOCK_HELP, None, None, None, self.on_documentation),
('ViewResource', None, _('_Resource'), None, None, self.view_entry),
])
- if gtk.pygtk_version >= (2,6,0):
+ if True: # Gtk.pygtk_version >= (2,6,0):
self.actiongroup.add_actions ([
- ('About', gtk.STOCK_ABOUT, None, None, None, self.about),
- ('Edit', gtk.STOCK_EDIT, None, '<shift><control>o', None, self.edit_entry),
+ ('About', Gtk.STOCK_ABOUT, None, None, None, self.about),
+ ('Edit', Gtk.STOCK_EDIT, None, '<shift><control>o', None, self.edit_entry),
])
- else:
- self.actiongroup.add_actions ([
- ('About', None, _('_About'), None, None, self.about),
- ('Edit', None, _('_Edit'), '<shift><control>o', None, self.edit_entry),
- ])
+ #else:
+ # self.actiongroup.add_actions ([
+ # ('About', None, _('_About'), None, None, self.about),
+ # ('Edit', None, _('_Edit'), '<shift><control>o', None, self.edit_entry),
+ # ])
prev = self.actiongroup.get_action ('Recent')
@@ -207,44 +207,48 @@ class Document (Connector.Publisher):
self.uim.ensure_update ()
- gp = os.path.join(Utils.glade_root, 'pyblio.glade')
+ gp = os.path.join(Utils.glade_root, 'pyblio.ui')
- self.xml = gtk.glade.XML (gp, 'main', domain = 'pybliographer')
- self.xml.signal_autoconnect (self)
+ self.xml = Gtk.Builder()
+ self.xml.set_translation_domain('pybliographer')
+ self.xml.add_from_file(gp)
+ self.xml.connect_signals(self)
+ #self.xml = Gtk.glade.XML (gp, 'main', domain = 'pybliographer')
+ #self.xml.signal_autoconnect (self)
- self.w = self.xml.get_widget ('main')
- self.paned = self.xml.get_widget ('main_pane')
+ self.w = self.xml.get_object ('main')
+ self.paned = self.xml.get_object ('main_pane')
- self.w.set_menus (self.uim.get_widget ('/Menubar'))
- self.w.set_toolbar (self.uim.get_widget ('/Toolbar'))
+ #self.w.set_menus (self.uim.get_object ('/Menubar'))
+ #self.w.set_toolbar (self.uim.get_object ('/Toolbar'))
self.w.add_accel_group (self.uim.get_accel_group ())
- self.w.add_events (gdk.KEY_PRESS_MASK)
+ self.w.add_events (Gdk.EventMask.KEY_PRESS_MASK)
- self.w_save_btn = self.xml.get_widget ('_w_save_btn')
- self.w_save_mnu = self.xml.get_widget ('_w_save_mnu')
+ self.w_save_btn = self.xml.get_object ('_w_save_btn')
+ self.w_save_mnu = self.xml.get_object ('_w_save_mnu')
# We manually add a simple search area
t = self.uim.get_widget ('/Toolbar')
- h = gtk.HBox()
+ h = Gtk.HBox()
- i = gtk.Image()
- i.set_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_LARGE_TOOLBAR)
- h.pack_start(i, False, False)
+ i = Gtk.Image()
+ i.set_from_stock(Gtk.STOCK_FIND, Gtk.IconSize.LARGE_TOOLBAR)
+ h.pack_start(i, False, False, False)
# create a tooltips object
-## self.toolbartips = gtk.Tooltips()
+## self.toolbartips = Gtk.Tooltips()
- self.quick_search = gtk.Entry()
+ self.quick_search = Gtk.Entry()
self.quick_search.connect('activate', self.simple_search)
- h.pack_start(self.quick_search, False, False)
+ h.pack_start(self.quick_search, False, False, False)
## self.toolbartips.set_tip(self.quick_search, _('Quick search'))
if Config.get ('gnome/tooltips').data:
self.quick_search.set_tooltip_text (_('Quick search'))
- i = gtk.ToolItem()
+ i = Gtk.ToolItem()
i.add(h)
t.insert(i, -1)
@@ -271,7 +275,7 @@ class Document (Connector.Publisher):
self.paned.add2 (self.display.w)
# Status bar
- self.statusbar = self.xml.get_widget ('statusbar')
+ self.statusbar = self.xml.get_object ('statusbar')
# set window size
ui_width = Utils.config.get_int ('/apps/pybliographic/ui/width') or -1
@@ -350,7 +354,7 @@ class Document (Connector.Publisher):
self.uim.remove_action_group (self.recents)
self.recents_mid = []
- self.recents = gtk.ActionGroup ('Recent')
+ self.recents = Gtk.ActionGroup ('Recent')
self.uim.insert_action_group (self.recents, 1)
@@ -362,13 +366,13 @@ class Document (Connector.Publisher):
self.recents_mid.append (mid)
- action = gtk.Action (str (mid), quoted, None, None)
+ action = Gtk.Action (str (mid), quoted, None, None)
self.recents.add_action (action)
action.connect ('activate', self._history_open_cb, item)
self.uim.add_ui (mid, '/Menubar/File/Recent', str (mid),
- str (mid), gtk.UI_MANAGER_MENUITEM, False)
+ str (mid), Gtk.UIManagerItemType.MENUITEM, False)
return
@@ -462,7 +466,10 @@ class Document (Connector.Publisher):
self.actiongroup.get_action ('Save').set_property ('sensitive', self.changed)
- self.statusbar.set_default (text)
+ # FIXME: Check port to Gtk3
+ # self.statusbar.set_default (text)
+ ctx_id = self.statusbar.get_context_id('default')
+ self.statusbar.push (ctx_id, text)
return
@@ -642,7 +649,7 @@ class Document (Connector.Publisher):
# remove the old autosave object
if self.data.key is not None and self.source_id:
- gobject.source_remove (self.source_id)
+ GObject.source_remove (self.source_id)
# remove old autosave file if exists
if self.data.key:
@@ -686,7 +693,7 @@ class Document (Connector.Publisher):
# create autosave object if needed
if Config.get ('base/autosave').data:
savetimeout = Config.get ('base/autosave interval').data
- self.source_id = gobject.timeout_add (savetimeout * 60 * 1000, self.autosave, url, self.data.id)
+ self.source_id = GObject.timeout_add (savetimeout * 60 * 1000, self.autosave, url, self.data.id)
return
@@ -783,7 +790,7 @@ class Document (Connector.Publisher):
# remove the old autosave object
if self.data.key is not None and self.source_id:
- gobject.source_remove (self.source_id)
+ GObject.source_remove (self.source_id)
# remove old autosave file
if self.data.key:
@@ -825,7 +832,7 @@ class Document (Connector.Publisher):
# create the new autosave object if needed
if Config.get ('base/autosave').data:
savetimeout = Config.get ('base/autosave interval').data
- self.source_id = gobject.timeout_add (savetimeout * 60 * 1000, self.autosave, url, self.data.id)
+ self.source_id = GObject.timeout_add (savetimeout * 60 * 1000, self.autosave, url, self.data.id)
return
@@ -843,7 +850,7 @@ class Document (Connector.Publisher):
answer = self.confirm ()
# remove autosave object with closing
if answer and self.source_id:
- gobject.source_remove (self.source_id)
+ GObject.source_remove (self.source_id)
# remove old autosave file
if answer and self.data.key:
@@ -1137,7 +1144,7 @@ class Document (Connector.Publisher):
self.uim.remove_action_group (self.viewables)
self.viewables_id = []
- self.viewables = gtk.ActionGroup ('Viewables')
+ self.viewables = Gtk.ActionGroup ('Viewables')
self.uim.insert_action_group (self.viewables, 1)
viewables = Resource.get_viewables (entry)
@@ -1147,21 +1154,21 @@ class Document (Connector.Publisher):
text = u"%s %s" % (key.upper (), value)
mergeid = self.uim.new_merge_id ()
self.viewables_id.append (mergeid)
- action = gtk.Action (str(mergeid), text, None, None)
+ action = Gtk.Action (str(mergeid), text, None, None)
self.viewables.add_action (action)
action.connect ('activate', self.view_entry, (entry, key, url, value))
self.uim.add_ui (mergeid, '/Menubar/ViewMenu/ViewResource', str(mergeid),
- str(mergeid), gtk.UI_MANAGER_MENUITEM, False)
+ str(mergeid), Gtk.UIManagerItemType.MENUITEM, False)
self.uim.add_ui (mergeid, '/Popup/ViewResource', str(mergeid),
- str(mergeid), gtk.UI_MANAGER_MENUITEM, False)
+ str(mergeid), Gtk.UIManagerItemType.MENUITEM, False)
return
def key_pressed (self, app, event):
# filter out special keys
- if event.keyval == gtk.keysyms.Escape:
+ if event.keyval == Gdk.KEY_Escape:
# the Esc key restores view to "all entries"
self.limit_view (None, None)
self.quick_search.set_text('')
@@ -1202,9 +1209,9 @@ class Document (Connector.Publisher):
# Save the graphical aspect of the interface
# 1.- Window size
- alloc = self.w.get_allocation ()
- Utils.config.set_int ('/apps/pybliographic/ui/width', alloc [2])
- Utils.config.set_int ('/apps/pybliographic/ui/height', alloc [3])
+ width, height = self.w.get_size ()
+ Utils.config.set_int ('/apps/pybliographic/ui/width', width)
+ Utils.config.set_int ('/apps/pybliographic/ui/height', height)
# 2.- Proportion between list and text
height = self.paned.get_position ()
@@ -1216,13 +1223,13 @@ class Document (Connector.Publisher):
return
def on_documentation (self, *args):
- import gobject
+ from gi.repository import GObject
- timestamp = gtk.gdk.CURRENT_TIME
+ timestamp = Gdk.CURRENT_TIME
try:
- gtk.show_uri (None, "ghelp:pybliographer", timestamp)
+ Gtk.show_uri (None, "ghelp:pybliographer", timestamp)
- except gobject.GError, msg:
+ except GObject.GError, msg:
self.w.error (_("Can't display documentation:\n%s") % msg)
return
diff --git a/Pyblio/GnomeUI/Editor.py b/Pyblio/GnomeUI/Editor.py
index ccbb30a..5839e53 100644
--- a/Pyblio/GnomeUI/Editor.py
+++ b/Pyblio/GnomeUI/Editor.py
@@ -23,8 +23,12 @@
# entry editor for more than 50 chars
# added: Note taking widget
-import copy, gobject, gtk, re, string
-from gnome import ui
+from gettext import gettext as _
+
+from gi.repository import GObject, Gtk
+# import copy, gobject, gtk, re, string
+import copy, re, string
+# from gnome import ui
from Pyblio import Base, Config, Connector, Exceptions, Fields, Key, Types
from Pyblio.GnomeUI import Common, Compat, FieldsInfo, FileSelector, Mime, Utils
@@ -45,10 +49,10 @@ class BaseField(Connector.Publisher):
''' common class to each specialized field editor '''
def __init__(self, entry, field, content, j):
- self.w = gtk.VBox()
+ self.w = Gtk.VBox()
- h = gtk.HBox(spacing=5)
- self.w.pack_start(gtk.Label(field), False, False)
+ h = Gtk.HBox(spacing=5)
+ self.w.pack_start(Gtk.Label(field, True, True, 0), False, False)
field = string.lower(field)
self.field = field
@@ -57,14 +61,14 @@ class BaseField(Connector.Publisher):
self.edit = None
expand = self.create_widget(h)
- img = gtk.Image()
+ img = Gtk.Image()
if self.loss:
- img.set_from_stock(gtk.STOCK_CANCEL,
- gtk.ICON_SIZE_BUTTON)
+ img.set_from_stock(Gtk.STOCK_CANCEL,
+ Gtk.IconSize.BUTTON)
else:
- img.set_from_stock(gtk.STOCK_APPLY,
- gtk.ICON_SIZE_BUTTON)
+ img.set_from_stock(Gtk.STOCK_APPLY,
+ Gtk.IconSize.BUTTON)
h.pack_start(img, False, False)
@@ -73,17 +77,17 @@ class BaseField(Connector.Publisher):
flag = 0
if expand:
- flag = gtk.EXPAND | gtk.FILL
+ flag = Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL
content.attach(self.w, 0, 1, j, j + 1, yoptions=flag)
def key_handler (self, widget, ev):
- if ev.keyval == gtk.gdk.Return and \
- ev.state == gtk.gdk.CONTROL_MASK:
+ if ev.keyval == Gdk.Return and \
+ ev.state == Gdk.ModifierType.CONTROL_MASK:
widget.emit_stop_by_name ('key_press_event')
self.issue ('apply')
- elif ev.keyval == gtk.gdk.Tab and \
- ev.state == gtk.gdk.CONTROL_MASK:
+ elif ev.keyval == Gdk.Tab and \
+ ev.state == Gdk.ModifierType.CONTROL_MASK:
widget.emit_stop_by_name ('key_press_event')
self.issue ('next')
@@ -144,7 +148,7 @@ class Entry (TextBase):
def create_widget (self, h):
if len (self.string) < 50:
- self.edit = gtk.Entry ()
+ self.edit = Gtk.Entry ()
self.edit.set_text(self.string.decode('latin-1'))
self.edit.set_editable (True)
self.edit.show ()
@@ -154,13 +158,13 @@ class Entry (TextBase):
h.pack_start (self.edit)
return 0
- w = gtk.ScrolledWindow ()
- w.set_policy (gtk.POLICY_NEVER,
- gtk.POLICY_AUTOMATIC)
+ w = Gtk.ScrolledWindow ()
+ w.set_policy (Gtk.PolicyType.NEVER,
+ Gtk.PolicyType.AUTOMATIC)
- self.edit = gtk.TextView ()
+ self.edit = Gtk.TextView ()
self.edit.set_editable (True)
- self.edit.set_wrap_mode (gtk.WRAP_WORD)
+ self.edit.set_wrap_mode (Gtk.WrapMode.WORD)
self.buff = self.edit.get_buffer ()
self.buff.set_text(self.string.decode('latin-1'))
@@ -196,12 +200,12 @@ class Entry (TextBase):
class Text (TextBase):
def create_widget (self, h):
- w = gtk.ScrolledWindow ()
- w.set_policy (gtk.POLICY_NEVER,
- gtk.POLICY_AUTOMATIC)
- self.edit = gtk.TextView ()
+ w = Gtk.ScrolledWindow ()
+ w.set_policy (Gtk.PolicyType.NEVER,
+ Gtk.PolicyType.AUTOMATIC)
+ self.edit = Gtk.TextView ()
self.edit.set_editable (True)
- self.edit.set_wrap_mode (gtk.WRAP_WORD)
+ self.edit.set_wrap_mode (Gtk.WrapMode.WORD)
self.buff = self.edit.get_buffer ()
self.buff.set_text (self.string.decode('latin-1'))
@@ -231,11 +235,11 @@ class Text (TextBase):
class AuthorGroup (BaseField):
def create_widget (self, h):
- w = gtk.ScrolledWindow ()
- w.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ w = Gtk.ScrolledWindow ()
+ w.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
- self.edit = gtk.TextView ()
- self.edit.set_wrap_mode (gtk.WRAP_WORD)
+ self.edit = Gtk.TextView ()
+ self.edit.set_wrap_mode (Gtk.WrapMode.WORD)
self.edit.set_editable (True)
self.buff = self.edit.get_buffer ()
@@ -299,9 +303,9 @@ class AuthorGroup (BaseField):
class Date (BaseField):
def create_widget (self, h):
- hbox = gtk.HBox (False, 5)
+ hbox = Gtk.HBox (False, 5)
- self.day = gtk.Entry ()
+ self.day = Gtk.Entry ()
(width, height) = self.day.size_request ()
self.day.set_size_request (width / 4, height)
self.day.set_max_length (2)
@@ -309,25 +313,25 @@ class Date (BaseField):
if self.initial [0]:
self.day.set_text (str (self.initial [0]).decode ('latin-1'))
hbox.pack_start (self.day)
- hbox.pack_start (gtk.Label (_("Day")), False, False)
+ hbox.pack_start (Gtk.Label(label=_("Day")), False, False)
- self.month = gtk.Entry ()
+ self.month = Gtk.Entry ()
self.month.set_size_request (width / 4, height)
self.month.set_max_length (2)
if self.initial [1]:
self.month.set_text (str (self.initial [1]).decode ('latin-1'))
hbox.pack_start (self.month)
- hbox.pack_start (gtk.Label (_("Month")), False, False)
+ hbox.pack_start (Gtk.Label(label=_("Month")), False, False)
- self.year = gtk.Entry ()
+ self.year = Gtk.Entry ()
self.year.set_max_length (4)
self.year.set_size_request (width / 3, height)
if self.initial [2]:
self.year.set_text (str (self.initial [2]).decode ('latin-1'))
hbox.pack_start (self.year)
- hbox.pack_start (gtk.Label (_("Year")), False, False)
+ hbox.pack_start (Gtk.Label(label=_("Year")), False, False)
hbox.show_all ()
h.pack_start (hbox)
@@ -394,10 +398,10 @@ class Reference (BaseField):
(Mime.SYM_KEY, 0, Mime.KEY),
)
- box = gtk.HBox ()
+ box = Gtk.HBox ()
box.set_border_width (5)
- self.edit = gtk.Label ()
+ self.edit = Gtk.Label ()
self.edit.justify = False
self.edit.set_line_wrap (True)
@@ -406,9 +410,9 @@ class Reference (BaseField):
#self.edit.set_editable (True)
self.edit.set_text (self.string)
- self.edit.drag_dest_set (gtk.DEST_DEFAULT_ALL,
+ self.edit.drag_dest_set (Gtk.DestDefaults.ALL,
accept,
- gtk.gdk.ACTION_COPY)
+ Gdk.DragAction.COPY)
self.edit.connect ('drag_data_received', self.drag_received)
@@ -416,7 +420,7 @@ class Reference (BaseField):
h.pack_start (box)
# A delete button
- button = gtk.Button (_('Delete'), gtk.STOCK_DELETE)
+ button = Gtk.Button (_('Delete'), Gtk.STOCK_DELETE)
button.connect ('clicked', self._delete)
h.pack_start (button, False, False)
@@ -493,13 +497,13 @@ class URL (BaseField):
## h.pack_start (self.edit)
self.newurl = None
- self.box = gtk.HBox (spacing=6)
- self.edit = gtk.Entry ()
+ self.box = Gtk.HBox (spacing=6)
+ self.edit = Gtk.Entry ()
self.edit.set_editable (True)
self.old_url = self.string.decode ('latin-1')
self.edit.set_text (self.old_url)
self.box.pack_start (self.edit)
- self.button = gtk.Button (_('Browse...'))
+ self.button = Gtk.Button (_('Browse...'))
self.button.connect ("clicked", self.cb_clicked)
self.box.pack_start (self.button, False)
h.pack_start (self.box)
@@ -541,17 +545,17 @@ class RealEditor (Connector.Publisher):
self.fields.sort ()
- self.w = gtk.VBox ()
- table = gtk.Table (2, 2)
+ self.w = Gtk.VBox ()
+ table = Gtk.Table (2, 2)
table.set_border_width (5)
table.set_col_spacings (5)
- table.attach (gtk.Label (_("Entry type")),
+ table.attach (Gtk.Label(label=_("Entry type")),
0, 1, 0, 1, yoptions = 0)
- table.attach (gtk.Label (_("Key")),
+ table.attach (Gtk.Label(label=_("Key")),
1, 2, 0, 1, yoptions = 0)
- self.key = gtk.Entry ()
+ self.key = Gtk.Entry ()
self.key.set_editable (True)
if self.entry.key:
@@ -562,12 +566,12 @@ class RealEditor (Connector.Publisher):
# The list store will hold both the identifier and the type of
# each entry
- liststore = gtk.ListStore (gobject.TYPE_STRING,
- gobject.TYPE_PYOBJECT)
+ liststore = Gtk.ListStore (GObject.TYPE_STRING,
+ GObject.TYPE_PYOBJECT)
- self.menu = gtk.ComboBox (liststore)
+ self.menu = Gtk.ComboBox (liststore)
- cell = gtk.CellRendererText()
+ cell = Gtk.CellRendererText()
self.menu.pack_start (cell, True)
self.menu.add_attribute (cell, 'text', 0)
@@ -591,21 +595,21 @@ class RealEditor (Connector.Publisher):
table.show_all ()
self.w.pack_start (table, False, False)
- self.newfield_area = gtk.HBox (spacing = 5)
+ self.newfield_area = Gtk.HBox (spacing = 5)
self.newfield_area.set_border_width (5)
self.newfield = ui.Entry ('newfield')
self.newfield_area.pack_start (self.newfield)
- b = gtk.Button (_("Create Field"))
+ b = Gtk.Button (_("Create Field"))
b.connect ('clicked', self.create_field)
self.newfield_area.pack_start (b)
# navigation buttons
- self.backward_b = gtk.Button(_('Back'))
+ self.backward_b = Gtk.Button(_('Back'))
self.backward_b.connect ('clicked', self.back_cb)
self.newfield_area.pack_start (self.backward_b)
- self.forward_b = gtk.Button(_('Next'))
+ self.forward_b = Gtk.Button(_('Next'))
self.forward_b.connect ('clicked', self.next_cb)
self.newfield_area.pack_start (self.forward_b)
@@ -614,7 +618,7 @@ class RealEditor (Connector.Publisher):
self.newfield_area.show_all ()
# Notebook
- self.notebook = gtk.Notebook ()
+ self.notebook = Gtk.Notebook ()
self.notebook.show ()
self.notebook.connect ('switch-page', self.switch_page_cb)
@@ -673,15 +677,15 @@ class RealEditor (Connector.Publisher):
node = self.lt_nodes [self.lt_current]
key = node['key']
if self.entry.has_key(key) and self.entry[key]:
- dialog = gtk.MessageDialog(
- self.w.get_toplevel(), gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_WARNING, gtk.BUTTONS_OK_CANCEL,
+ dialog = Gtk.MessageDialog(
+ self.w.get_toplevel(), Gtk.DialogFlags.DESTROY_WITH_PARENT,
+ Gtk.MessageType.WARNING, Gtk.ButtonsType.OK_CANCEL,
"Text will be lost if you click OK.")
dialog.set_transient_for (self.dialogue.w)
rc = dialog.run()
dialog.destroy()
- if rc == gtk.RESPONSE_CANCEL:
+ if rc == Gtk.ResponseType.CANCEL:
return
self.lt_delete (self.lt_current)
@@ -732,7 +736,7 @@ class RealEditor (Connector.Publisher):
self.content = []
for i in range (len(names)):
- label = gtk.Label (names [i])
+ label = Gtk.Label(label=names [i])
if i == 0:
table = [x.name.lower() for x
in self.entry.type.mandatory
@@ -767,10 +771,10 @@ class RealEditor (Connector.Publisher):
def add_type1_widget (self, label, table, pos):
if len (table) == 0: return
- scroll = gtk.ScrolledWindow ()
- scroll.set_policy (gtk.POLICY_AUTOMATIC,
- gtk.POLICY_AUTOMATIC)
- content = gtk.Table (1, len (table))
+ scroll = Gtk.ScrolledWindow ()
+ scroll.set_policy (Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
+ content = Gtk.Table (1, len (table))
scroll.add_with_viewport (content)
j = 0
@@ -963,12 +967,12 @@ class NativeEditor(Connector.Publisher):
self.original = database.get_native(entry)
- self.w = gtk.ScrolledWindow()
- self.w.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ self.w = Gtk.ScrolledWindow()
+ self.w.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
- self.w_txt = gtk.TextView()
+ self.w_txt = Gtk.TextView()
self.w_txt.set_editable(True)
- self.w_txt.set_wrap_mode(gtk.WRAP_WORD)
+ self.w_txt.set_wrap_mode(Gtk.WrapMode.WORD)
self.w.add(self.w_txt)
@@ -1015,7 +1019,7 @@ class Editor(Connector.Publisher):
with no key.
"""
def __init__(self, database, entry, parent=None, title=None):
- self.w = gtk.Dialog()
+ self.w = Gtk.Dialog()
self.w.set_resizable(True)
if title: self.w.set_title(title)
@@ -1026,7 +1030,7 @@ class Editor(Connector.Publisher):
if parent: self.w.set_transient_for(parent)
- self.apply_b = gtk.Button(stock=gtk.STOCK_APPLY)
+ self.apply_b = Gtk.Button(stock=Gtk.STOCK_APPLY)
self.apply_b.connect('clicked', self.apply_changes)
self.apply_b.show()
@@ -1034,31 +1038,31 @@ class Editor(Connector.Publisher):
self.has_native = hasattr(database, 'get_native')
if self.has_native:
- self.native_b = gtk.Button(_("Native Editing"))
+ self.native_b = Gtk.Button(_("Native Editing"))
self.native_b.connect('clicked', self.toggle_native)
self.native_b.show()
- self.close_b = gtk.Button(stock=gtk.STOCK_CANCEL)
+ self.close_b = Gtk.Button(stock=Gtk.STOCK_CANCEL)
self.close_bid = self.close_b.connect(
'clicked', self.close_dialog)
self.close_b.show()
# Use Escape to abort, Ctrl-Return to accept
- accelerator = gtk.AccelGroup()
+ accelerator = Gtk.AccelGroup()
self.w.add_accel_group(accelerator)
self.close_b.add_accelerator(
- 'clicked', accelerator, gtk.keysyms.Escape, 0, 0)
+ 'clicked', accelerator, Gdk.KEY_Escape, 0, 0)
self.apply_b.add_accelerator(
- 'clicked', accelerator, gtk.keysyms.Return,
- gtk.gdk.CONTROL_MASK, 0)
+ 'clicked', accelerator, Gdk.KEY_Return,
+ Gdk.ModifierType.CONTROL_MASK, 0)
# for use with annotations
- self.del_b = gtk.Button(stock=gtk.STOCK_DELETE)
+ self.del_b = Gtk.Button(stock=Gtk.STOCK_DELETE)
self.del_b.connect ('clicked', self.del_cb, None)
self.del_b.set_sensitive(False)
self.w.action_area.add(self.del_b)
- self.new_b = gtk.Button(stock=gtk.STOCK_NEW)
+ self.new_b = Gtk.Button(stock=Gtk.STOCK_NEW)
self.new_b.connect('clicked', self.add_cb, None)
self.new_b.set_sensitive(False)
self.w.action_area.add(self.new_b)
@@ -1133,7 +1137,7 @@ class Editor(Connector.Publisher):
self.editor.Subscribe('apply', self.apply_changes)
self.editor.Subscribe('next', self.next_item)
- self.w.vbox.pack_start(self.editor.w)
+ self.w.vbox.pack_start(self.editor.w, True, True, 0)
# set window size
if ui_width != -1 and ui_height != -1:
@@ -1203,10 +1207,10 @@ class LT_Widget_1:
self.dialogue = dialogue
self.node = None
- self.page = gtk.ScrolledWindow ()
- self.label = gtk.Label (_('Notes'))
- self.page.set_policy (gtk.POLICY_AUTOMATIC,
- gtk.POLICY_AUTOMATIC)
+ self.page = Gtk.ScrolledWindow ()
+ self.label = Gtk.Label(label=_('Notes'))
+ self.page.set_policy (Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
self.display_list (self.entry, self.editor.lt_nodes)
self.page.set_data ('pyblio-owner', self)
@@ -1217,12 +1221,12 @@ class LT_Widget_1:
#self.enable_buttons()
def display_list (self, entry, nodes):
- content = gtk.VBox()
+ content = Gtk.VBox()
for i in range (len(nodes)):
node = nodes[i]
key = node['key']
- vbox = gtk.VBox()
- anno_label = gtk.Label()
+ vbox = Gtk.VBox()
+ anno_label = Gtk.Label()
anno_label.set_alignment (0, 0.5)
if node.get('mandatory', False):
l = '<b>%s</b> <span color="red">%s</span>' %(
@@ -1236,12 +1240,12 @@ class LT_Widget_1:
else: t = ''
l = min (len(t), 150)
- text_label = gtk.Label(t[0:l])
+ text_label = Gtk.Label(label=t[0:l])
text_label.set_line_wrap (True)
text_label.set_size_request ( 500, 45) ## XXX
text_label.set_alignment (0.1, .2)
vbox.pack_start (text_label)
- ebox = gtk.Button()
+ ebox = Gtk.Button()
ebox.add (vbox)
ebox.connect ('clicked', self.lt_select_detail, i)
content.pack_start(ebox, False, False)
@@ -1273,16 +1277,16 @@ class LT_Widget_2:
self.position = position + 1
self.dialogue = dialogue
self.node = None
- self.page = gtk.ScrolledWindow()
- self.page.set_policy (gtk.POLICY_AUTOMATIC,
- gtk.POLICY_AUTOMATIC)
- self.buff = gtk.TextBuffer()
- self.content = gtk.TextView(self.buff)
- self.label = gtk.Label()
+ self.page = Gtk.ScrolledWindow()
+ self.page.set_policy (Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
+ self.buff = Gtk.TextBuffer()
+ self.content = Gtk.TextView(self.buff)
+ self.label = Gtk.Label()
self.page.add(self.content)
self.content.grab_focus()
self.page.set_data ('pyblio-owner', self)
- self.content.set_wrap_mode (gtk.WRAP_WORD)
+ self.content.set_wrap_mode (Gtk.WrapMode.WORD)
self.buff.connect('changed', self.changed_cb)
self.hidden = True
@@ -1343,17 +1347,17 @@ class LT_Widget_2:
class LT_Dialog_1 :
def __init__ (self, parent=None):
- self.dialog = gtk.Dialog(
+ self.dialog = Gtk.Dialog(
_('New Annotation Name'), parent, 0,
- (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
- gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
+ (Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT,
+ Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT))
self.dialog.vbox.set_border_width (24)
self.dialog.vbox. pack_start (
- gtk.Label (
+ Gtk.Label(label=
_('Name of the new annotation:')),
True, True, 6)
- self.options = gtk.combo_box_new_text ()
+ self.options = Gtk.ComboBoxText ()
self.dialog.vbox.pack_start (self.options, True, True, 12)
self.fields = [ x for x in Config.get ('base/fields').data
@@ -1364,7 +1368,7 @@ class LT_Dialog_1 :
self.options.set_active (0)
self.options.connect ('changed', self.changed)
- self.dialog.set_default_response(gtk.RESPONSE_ACCEPT)
+ self.dialog.set_default_response(Gtk.ResponseType.ACCEPT)
self.value = self.fields[0]
def changed (self, *args):
@@ -1374,7 +1378,7 @@ class LT_Dialog_1 :
def run (self):
self.dialog.show_all()
r = self.dialog.run()
- if r == gtk.RESPONSE_ACCEPT:
+ if r == Gtk.ResponseType.ACCEPT:
name= self.value
else:
name = None
diff --git a/Pyblio/GnomeUI/Entry.py b/Pyblio/GnomeUI/Entry.py
index c9d75a6..967c6c6 100644
--- a/Pyblio/GnomeUI/Entry.py
+++ b/Pyblio/GnomeUI/Entry.py
@@ -19,10 +19,7 @@
#
#
-from gtk import *
-from gnome import ui
-
-import pango, gnome, gobject
+from gi.repository import Gdk, Gtk, Pango, GObject
import string
@@ -36,29 +33,29 @@ class Entry:
def __init__ (self):
''' Create the graphical widget '''
- self.text = TextView ()
+ self.text = Gtk.TextView ()
self.buff = self.text.get_buffer ()
self.tag = {}
self.tag ['title'] = \
self.buff.create_tag ('title',
- weight = pango.WEIGHT_BOLD)
+ weight = Pango.Weight.BOLD)
self.tag ['field'] = \
self.buff.create_tag ('field',
indent = -20,
- style = pango.STYLE_OBLIQUE)
+ style = Pango.Style.OBLIQUE)
self.tag ['body'] = \
self.buff.create_tag ('body',
left_margin = 20)
- self.w = ScrolledWindow ()
- self.w.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+ self.w = Gtk.ScrolledWindow ()
+ self.w.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.w.add (self.text)
self.text.set_editable (False)
self.text.set_cursor_visible (False)
- self.text.set_wrap_mode (WRAP_WORD)
+ self.text.set_wrap_mode (Gtk.WrapMode.WORD)
self.text.set_left_margin (5)
self.text.set_right_margin (5)
@@ -97,14 +94,14 @@ class Entry:
anchor = self.buff.create_child_anchor (iter)
- button = Button ('...')
+ button = Gtk.Button ('...')
button.show ()
def url_open (w, url):
try:
- gnome.url_show (url)
+ Gtk.show_uri(None, url, Gdk.CURRENT_TIME)
- except gobject.GError, msg:
+ except GObject.GError, msg:
d = MessageDialog (None,
DIALOG_MODAL |
diff --git a/Pyblio/GnomeUI/Fields.py b/Pyblio/GnomeUI/Fields.py
index b8c5ec3..dae002e 100644
--- a/Pyblio/GnomeUI/Fields.py
+++ b/Pyblio/GnomeUI/Fields.py
@@ -27,7 +27,7 @@ bibliography '''
# cleaning up
-import gobject, gtk
+from gi.repository import GObject, Gtk
import copy, os, re, string
@@ -60,7 +60,7 @@ class FieldsDialog (Utils.GladeWindow):
self.dialog = self.xml.get_widget ('fields1')
self.w = self.xml.get_widget ('notebook')
-## tooltips = gtk.Tooltips ()
+## tooltips = Gtk.Tooltips ()
## tooltips.enable ()
self.warning = 0
@@ -120,17 +120,17 @@ class FieldsDialog (Utils.GladeWindow):
def init_page_1 (self):
self.fields1 = self.xml.get_widget('f_list_1')
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn(_('Name'), rend, text = 0)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn(_('Name'), rend, text = 0)
self.fields1.append_column(col)
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn(_('Type'), rend, text = 1)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn(_('Type'), rend, text = 1)
self.fields1.append_column(col)
- self.fm = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
- gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
- self.sfm = gtk.TreeModelSort(self.fm)
- self.sfm.set_sort_column_id(2, gtk.SORT_ASCENDING)
+ self.fm = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING,
+ GObject.TYPE_STRING, GObject.TYPE_PYOBJECT)
+ self.sfm = Gtk.TreeModelSort(self.fm)
+ self.sfm.set_sort_column_id(2, Gtk.SortType.ASCENDING)
self.fields1.set_model(self.sfm)
self.s1 = self.fields1.get_selection()
self.s1.connect ('changed', self.list_1_select)
@@ -141,7 +141,7 @@ class FieldsDialog (Utils.GladeWindow):
self.name1 = self.xml.get_widget('name1')
self.menu1 = self.xml.get_widget('type1')
- menu = gtk.Menu ()
+ menu = Gtk.Menu ()
self.menu1.set_menu (menu)
self.menu_items = _typename.keys ()
for item in self.menu_items:
@@ -223,17 +223,17 @@ class FieldsDialog (Utils.GladeWindow):
# PAGE 2
self.entries2 = self.xml.get_widget('e_list_2')
- self.em = gtk.ListStore(gobject.TYPE_STRING,
- gobject.TYPE_PYOBJECT,
- gobject.TYPE_STRING )
+ self.em = Gtk.ListStore(GObject.TYPE_STRING,
+ GObject.TYPE_PYOBJECT,
+ GObject.TYPE_STRING )
self.entries = copy.copy (Config.get ('base/entries').data)
for i in self.entries.itervalues():
self.em.append ((i.name, i, i.name.lower()))
- self.sem = gtk.TreeModelSort(self.em)
- self.sem.set_sort_column_id(2, gtk.SORT_ASCENDING)
+ self.sem = Gtk.TreeModelSort(self.em)
+ self.sem.set_sort_column_id(2, Gtk.SortType.ASCENDING)
self.entries2.set_model(self.sem)
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn(_('Entry type'), rend, text = 0)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn(_('Entry type'), rend, text = 0)
self.entries2.append_column(col)
self.name2 = self.xml.get_widget('name2')
self.s2 = self.entries2.get_selection()
@@ -296,25 +296,25 @@ class FieldsDialog (Utils.GladeWindow):
self.flist3a = self.xml.get_widget ('f_list_3a')
self.flist3a.set_model (self.sfm)
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn(_('Available'), rend, text = 0)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn(_('Available'), rend, text = 0)
self.flist3a.append_column(col)
self.s3a = self.flist3a.get_selection()
self.label3 = self.xml.get_widget ('entry_type_label')
self.flist3b = self.xml.get_widget ('f_list_3b')
- rend = gtk.CellRendererToggle()
+ rend = Gtk.CellRendererToggle()
rend.connect('toggled', self.toggle_mandatory)
- col = gtk.TreeViewColumn('X', rend, active = 1)
+ col = Gtk.TreeViewColumn('X', rend, active = 1)
self.flist3b.append_column(col)
- rend = gtk.CellRendererText()
- col = gtk.TreeViewColumn(_('Associated'), rend, text = 2)
+ rend = Gtk.CellRendererText()
+ col = Gtk.TreeViewColumn(_('Associated'), rend, text = 2)
self.flist3b.append_column(col)
- self.sm = gtk.ListStore(gobject.TYPE_STRING,
- gobject.TYPE_BOOLEAN,
- gobject.TYPE_STRING,
- gobject.TYPE_PYOBJECT)
- self.ssm = gtk.TreeModelSort(self.sm)
- self.ssm.set_sort_column_id(0, gtk.SORT_ASCENDING)
+ self.sm = Gtk.ListStore(GObject.TYPE_STRING,
+ GObject.TYPE_BOOLEAN,
+ GObject.TYPE_STRING,
+ GObject.TYPE_PYOBJECT)
+ self.ssm = Gtk.TreeModelSort(self.sm)
+ self.ssm.set_sort_column_id(0, Gtk.SortType.ASCENDING)
self.flist3b.set_model(self.ssm)
self.s3b = self.flist3b.get_selection()
self.label3.set_markup (
diff --git a/Pyblio/GnomeUI/FileSelector.py b/Pyblio/GnomeUI/FileSelector.py
index 6cd7310..c4f096d 100644
--- a/Pyblio/GnomeUI/FileSelector.py
+++ b/Pyblio/GnomeUI/FileSelector.py
@@ -20,17 +20,17 @@
#
import string, os, urlparse
+import gettext
+_ = gettext.gettext
-from gnome import ui
-
-import gtk
+from gi.repository import Gtk, GObject, Gdk
from Pyblio import Open, Types, Base, Fields, Config, Autoload
from Pyblio.GnomeUI import Utils
-class URLFileSelection (gtk.FileChooserDialog):
+class URLFileSelection (Gtk.FileChooserDialog):
''' Extended file selection dialog, with an URL field and a type
selector. '''
@@ -40,19 +40,19 @@ class URLFileSelection (gtk.FileChooserDialog):
modal = True, has_auto = True, is_save = False,
directory = None, show_type=True):
- gtk.FileChooserDialog.__init__ (self)
+ GObject.GObject.__init__ (self)
- accelerator = gtk.AccelGroup ()
+ accelerator = Gtk.AccelGroup ()
self.add_accel_group (accelerator)
- b = self.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.Return, 0, 0)
+ b = self.add_button (Gtk.STOCK_OK, Gtk.ResponseType.OK)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_Return, 0, 0)
- b = self.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)
- b.add_accelerator ('clicked', accelerator, gtk.keysyms.Escape, 0, 0)
+ b = self.add_button (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
+ b.add_accelerator ('clicked', accelerator, Gdk.KEY_Escape, 0, 0)
if is_save:
- self.set_action(gtk.FILE_CHOOSER_ACTION_SAVE)
+ self.set_action(Gtk.FileChooserAction.SAVE)
self.set_local_only (False)
@@ -70,15 +70,15 @@ class URLFileSelection (gtk.FileChooserDialog):
if show_type:
# type selector
- hbox = gtk.HBox ()
+ hbox = Gtk.HBox ()
hbox.set_spacing (5)
hbox.set_border_width (5)
- hbox.pack_start (gtk.Label (_("Bibliography type:")),
- expand = False, fill = False)
+ hbox.pack_start (Gtk.Label(label=_("Bibliography type:")),
+ expand=False, fill=False, padding=False)
- self.menu = gtk.combo_box_new_text ()
+ self.menu = Gtk.ComboBoxText ()
- hbox.pack_start (self.menu)
+ hbox.pack_start (self.menu, False, False, False)
self.set_extra_widget (hbox)
@@ -115,12 +115,12 @@ class URLFileSelection (gtk.FileChooserDialog):
def run (self):
- ret = gtk.FileSelection.run (self)
+ ret = Gtk.FileChooserDialog.run (self)
file = self.get_filename ()
self.destroy ()
- if ret != gtk.RESPONSE_OK: return (None, None)
+ if ret != Gtk.ResponseType.OK: return (None, None)
URLFileSelection.defaultdir = os.path.dirname (file)
diff --git a/Pyblio/GnomeUI/Format.py b/Pyblio/GnomeUI/Format.py
index e1831a5..0f2797f 100644
--- a/Pyblio/GnomeUI/Format.py
+++ b/Pyblio/GnomeUI/Format.py
@@ -21,8 +21,8 @@
''' Defines a Dialog to format a subset of entries as a bibliography '''
-import gtk
-from gnome import ui
+from gi.repository import Gtk
+# from gnome import ui
import string, os
@@ -52,7 +52,7 @@ class FormatDialog (Connector.Publisher, Utils.GladeWindow):
Utils.GladeWindow.__init__ (self, parent)
# Fill the output format drop-down menu
- menu = gtk.Menu ()
+ menu = Gtk.Menu ()
self._w_menu.set_menu (menu)
outlist = Autoload.available ('output')
diff --git a/Pyblio/GnomeUI/Index.py b/Pyblio/GnomeUI/Index.py
index cc4b86d..e3629f5 100644
--- a/Pyblio/GnomeUI/Index.py
+++ b/Pyblio/GnomeUI/Index.py
@@ -33,8 +33,9 @@
from Pyblio import Config, Connector, Fields, Resource
from Pyblio import Types, Sort, userformat, version
-from gnome import ui
-import gobject, gtk, gtk.gdk, os.path, pango
+from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, Pango
+
+import os.path
from Pyblio.GnomeUI import FieldsInfo, Mime, Utils
@@ -62,20 +63,20 @@ class Index (Connector.Publisher):
fields = fields or Config.get ('gnome/columns').data
self.fields = map (lower, fields)
- self.model = apply (gtk.ListStore,
- (gobject.TYPE_STRING,) * len (fields) + (gobject.TYPE_OBJECT,))
+ self.model = apply (Gtk.ListStore,
+ (GObject.TYPE_STRING,) * len (fields) + (GObject.TYPE_OBJECT,))
- self.list = gtk.TreeView ()
+ self.list = Gtk.TreeView ()
self.list.set_model (self.model)
self.selinfo = self.list.get_selection ()
- self.selinfo.set_mode (gtk.SELECTION_MULTIPLE)
+ self.selinfo.set_mode (Gtk.SelectionMode.MULTIPLE)
i = 0
- self.gvpixbuf = gtk.gdk.pixbuf_new_from_file(
+ self.gvpixbuf = GdkPixbuf.Pixbuf.new_from_file(
os.path.join (version.datadir, 'pixmaps', 'pybliographic-viewer.png'))
if True:
- rend = gtk.CellRendererPixbuf ()
- col = gtk.TreeViewColumn ('P', rend, pixbuf = len(fields))
+ rend = Gtk.CellRendererPixbuf ()
+ col = Gtk.TreeViewColumn ('P', rend, pixbuf = len(fields))
col.set_fixed_width (22)
self.list.append_column (col)
i += 1
@@ -83,9 +84,9 @@ class Index (Connector.Publisher):
i, self.prefix_columns = 0, i
for f in fields:
- renderer = gtk.CellRendererText ()
- renderer.set_property ('ellipsize', pango.ELLIPSIZE_END)
- col = gtk.TreeViewColumn (f, renderer, text=i)
+ renderer = Gtk.CellRendererText ()
+ renderer.set_property ('ellipsize', Pango.EllipsizeMode.END)
+ col = Gtk.TreeViewColumn (f, renderer, text=i)
col.set_resizable (True)
col.set_clickable (True)
@@ -97,16 +98,16 @@ class Index (Connector.Publisher):
w = Utils.config.get_int (k)
if w:
- col.set_sizing (gtk.TREE_VIEW_COLUMN_FIXED)
+ col.set_sizing (Gtk.TreeViewColumnSizing.FIXED)
col.set_fixed_width (w)
col.connect ('clicked', self.click_column, i)
self.list.append_column (col)
i = i + 1
- self.w = gtk.ScrolledWindow ()
+ self.w = Gtk.ScrolledWindow ()
- self.w.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ self.w.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.w.add (self.list)
self.access = []
@@ -130,14 +131,15 @@ class Index (Connector.Publisher):
(Mime.SYM_ENTRY, 0, Mime.ENTRY),
)
- self.list.drag_dest_set (gtk.DEST_DEFAULT_ALL, accept,
- gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
- self.list.connect ("drag_data_received", self.drag_received)
+ # FIXME: Port drag-and-drop to Gtk3
+ #self.list.drag_dest_set (Gtk.DestDefaults.ALL, accept,
+ # Gdk.DragAction.COPY | Gdk.DragAction.MOVE)
+ #self.list.connect ("drag_data_received", self.drag_received)
- self.list.drag_source_set (gtk.gdk.BUTTON1_MASK | gtk.gdk.BUTTON3_MASK,
- targets, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
- self.list.connect ('drag_data_get', self.dnd_drag_data_get)
+ #self.list.drag_source_set (Gdk.ModifierType.BUTTON1_MASK | Gdk.ModifierType.BUTTON3_MASK,
+ # targets, Gdk.DragAction.COPY | Gdk.DragAction.MOVE)
+ #self.list.connect ('drag_data_get', self.dnd_drag_data_get)
# Copy/Paste configuration
@@ -151,17 +153,18 @@ class Index (Connector.Publisher):
# the clipboard, and the primary. Therefore, we should be able
# to paste into every kind of editor/application.
- self.list.selection_add_target ("PRIMARY",
- Mime.SYM_STRING,
- Mime.STRING)
+ # FIXME: Port to Gtk3
+ #self.list.selection_add_target ("PRIMARY",
+ # Mime.SYM_STRING,
+ # Mime.STRING)
- self.list.selection_add_target ("CLIPBOARD",
- Mime.SYM_STRING,
- Mime.STRING)
+ #self.list.selection_add_target ("CLIPBOARD",
+ # Mime.SYM_STRING,
+ # Mime.STRING)
- self.list.selection_add_target (Mime.SYM_APP,
- Mime.SYM_ENTRY,
- Mime.ENTRY)
+ #self.list.selection_add_target (Mime.SYM_APP,
+ # Mime.SYM_ENTRY,
+ # Mime.ENTRY)
return
@@ -267,7 +270,7 @@ class Index (Connector.Publisher):
else:
return
- if context.action == gtk.gdk.ACTION_MOVE:
+ if context.action == Gdk.DragAction.MOVE:
self.issue ('drag-moved', entries)
return
@@ -368,9 +371,11 @@ class Index (Connector.Publisher):
iter = self.model.append ()
- apply (self.model.set, [iter] + row)
+ print [iter], row
+ # apply (self.model.set, [iter] + row)
+ self.model.set([iter] + row)
- self.access.append (entry)
+ # self.access.append (entry)
entry = iterator.next ()
@@ -440,10 +445,10 @@ class Index (Connector.Publisher):
entries = []
- def retrieve (model, path, iter):
+ def retrieve (model, path, iter, entries):
entries.append (self.access [path [0]])
- self.selinfo.selected_foreach (retrieve)
+ self.selinfo.selected_foreach (retrieve, entries)
return entries
@@ -458,7 +463,7 @@ class Index (Connector.Publisher):
def button_press (self, clist, event, *arg):
''' handler for double-click and right mouse button '''
- if not (event.type == gtk.gdk.BUTTON_PRESS and
+ if not (event.type == Gdk.EventType.BUTTON_PRESS and
event.button == 3): return
self._w_popup.popup (None, None, None, event.button, event.time)
diff --git a/Pyblio/GnomeUI/Medline.py b/Pyblio/GnomeUI/Medline.py
index 1406222..fdc79b4 100644
--- a/Pyblio/GnomeUI/Medline.py
+++ b/Pyblio/GnomeUI/Medline.py
@@ -19,8 +19,7 @@
#
#
-from gnome import ui
-import gtk
+from gi.repository import Gtk
from Pyblio.GnomeUI import Utils
@@ -117,7 +116,7 @@ class MedlineUI (Utils.GladeWindow):
ret = self._w_medline.run ()
- if ret != gtk.RESPONSE_OK:
+ if ret != Gtk.ResponseType.OK:
self._w_medline.destroy ()
return None
diff --git a/Pyblio/GnomeUI/OpenURL.py b/Pyblio/GnomeUI/OpenURL.py
index d809c4a..97a0365 100644
--- a/Pyblio/GnomeUI/OpenURL.py
+++ b/Pyblio/GnomeUI/OpenURL.py
@@ -21,9 +21,9 @@
''' Defines a Dialog to open URL '''
-import gobject
-import gtk
-from gnome import ui
+from gi.repository import GObject
+from gi.repository import Gtk
+# from gnome import ui
import string, os
@@ -44,10 +44,10 @@ class OpenDialog (Connector.Publisher, Utils.GladeWindow):
Utils.GladeWindow.__init__ (self, parent)
- liststore = gtk.ListStore (gobject.TYPE_STRING)
+ liststore = Gtk.ListStore (GObject.TYPE_STRING)
menu = self._w_combobox
menu.set_model (liststore)
- cell = gtk.CellRendererText()
+ cell = Gtk.CellRendererText()
menu.pack_start(cell, True)
menu.add_attribute(cell, 'text', 0)
@@ -82,7 +82,7 @@ class OpenDialog (Connector.Publisher, Utils.GladeWindow):
def run (self):
ret = self._w_openurl.run ()
- if ret != gtk.RESPONSE_OK:
+ if ret != Gtk.ResponseType.OK:
self._w_openurl.destroy ()
return (None, None)
diff --git a/Pyblio/GnomeUI/Pybliographic.py b/Pyblio/GnomeUI/Pybliographic.py
index 82035a3..7665e8f 100644
--- a/Pyblio/GnomeUI/Pybliographic.py
+++ b/Pyblio/GnomeUI/Pybliographic.py
@@ -26,7 +26,7 @@ import copy, os, stat
from Pyblio.GnomeUI import Document, Utils
from Pyblio import Base, Config
-from gtk import *
+from gi.repository import Gtk
class Pybliographic:
''' Main class holding all the documents and performing
@@ -139,6 +139,6 @@ class Pybliographic:
doc.w.destroy ()
self.documents.remove (doc)
- main_quit ()
+ Gtk.main_quit ()
return
diff --git a/Pyblio/GnomeUI/Search.py b/Pyblio/GnomeUI/Search.py
index 0c5c5cd..0e116f9 100644
--- a/Pyblio/GnomeUI/Search.py
+++ b/Pyblio/GnomeUI/Search.py
@@ -24,8 +24,9 @@
import os
-from gnome import ui
-import gtk, gobject
+# from gnome import ui
+# import gtk, gobject
+from gi.repository import Gtk, GObject
import string, re, sys, traceback, copy
@@ -58,11 +59,11 @@ class SearchDialog (Connector.Publisher, Utils.GladeWindow):
# the tree model contains a string that explains the query,
# and a python object representing the actual query.
- self._model = gtk.TreeStore (str, gobject.TYPE_PYOBJECT)
+ self._model = Gtk.TreeStore (str, GObject.TYPE_PYOBJECT)
self._w_tree.set_model (self._model)
# the view does not display the python column, of course.
- col = gtk.TreeViewColumn ('field', gtk.CellRendererText (), text = 0)
+ col = Gtk.TreeViewColumn ('field', Gtk.CellRendererText (), text = 0)
self._w_tree.append_column (col)
self._w_tree.expand_all ()
@@ -82,7 +83,7 @@ class SearchDialog (Connector.Publisher, Utils.GladeWindow):
[' - type - ', ' - key - '])
# connect a menu to the right button
- self.menu = gtk.Menu ()
+ self.menu = Gtk.Menu ()
self.delete_button = Utils.popup_add (self.menu, _("Delete"),
self.search_delete)
self.menu.show ()
@@ -136,9 +137,9 @@ class SearchDialog (Connector.Publisher, Utils.GladeWindow):
etype, value, tb = sys.exc_info ()
traceback.print_exception (etype, value, tb)
- d = gtk.MessageDialog (self._w_search,
- gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
- gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
+ d = Gtk.MessageDialog (self._w_search,
+ Gtk.DialogFlags.DESTROY_WITH_PARENT | Gtk.DialogFlags.MODAL,
+ Gtk.MessageType.ERROR, Gtk.ButtonsType.OK,
_("internal error during evaluation"))
d.run ()
d.destroy ()
@@ -190,9 +191,9 @@ class SearchDialog (Connector.Publisher, Utils.GladeWindow):
error = 1
if error:
- d = gtk.MessageDialog (self._w_search,
- gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
- gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
+ d = Gtk.MessageDialog (self._w_search,
+ Gtk.DialogFlags.DESTROY_WITH_PARENT | Gtk.DialogFlags.MODAL,
+ Gtk.MessageType.ERROR, Gtk.ButtonsType.OK,
_("while compiling %s\nerror: %s") %
(match, err [0]))
d.run ()
@@ -244,7 +245,7 @@ class SearchDialog (Connector.Publisher, Utils.GladeWindow):
''' Called when the user right-clicks in the query tree '''
- if (event.type != gtk.gdk.BUTTON_PRESS or
+ if (event.type != Gdk.EventType.BUTTON_PRESS or
event.button != 3): return
self.menu.popup (None, None, None, event.button, event.time)
diff --git a/Pyblio/GnomeUI/Sort.py b/Pyblio/GnomeUI/Sort.py
index 40b65d1..03ef6c8 100644
--- a/Pyblio/GnomeUI/Sort.py
+++ b/Pyblio/GnomeUI/Sort.py
@@ -23,8 +23,9 @@
import os, string
-import gtk, gobject
-from gnome import ui
+from gi.repository import Gtk, GObject
+# import gtk, gobject
+# from gnome import ui
from Pyblio import Connector, Sort, Config, version
from Pyblio.GnomeUI import Utils
@@ -57,27 +58,27 @@ class SortDialog (Connector.Publisher, Utils.GladeWindow):
Utils.GladeWindow.__init__ (self, parent)
- self._model = gtk.ListStore (gtk.gdk.Pixbuf, str, gobject.TYPE_PYOBJECT, int)
+ self._model = Gtk.ListStore (GdkPixbuf.Pixbuf, str, GObject.TYPE_PYOBJECT, int)
self._w_tree.set_model (self._model)
# Only the first two rows are visibles, the others are for
# internal bookkeeping.
- col = gtk.TreeViewColumn ('Direction', gtk.CellRendererPixbuf (), pixbuf = 0)
+ col = Gtk.TreeViewColumn ('Direction', Gtk.CellRendererPixbuf (), pixbuf = 0)
self._w_tree.append_column (col)
- col = gtk.TreeViewColumn ('Field', gtk.CellRendererText (), text = 1)
+ col = Gtk.TreeViewColumn ('Field', Gtk.CellRendererText (), text = 1)
self._w_tree.append_column (col)
self._w_sort.show ()
self._icon = {0: None}
- for id, stock in ((1, gtk.STOCK_GO_UP), (-1, gtk.STOCK_GO_DOWN)):
+ for id, stock in ((1, Gtk.STOCK_GO_UP), (-1, Gtk.STOCK_GO_DOWN)):
self._icon [id] = self._w_tree.render_icon (stock_id = stock,
- size = gtk.ICON_SIZE_MENU,
+ size = Gtk.IconSize.MENU,
detail = None)
diff --git a/Pyblio/GnomeUI/Utils.py b/Pyblio/GnomeUI/Utils.py
index e293c2a..9fc7b2e 100644
--- a/Pyblio/GnomeUI/Utils.py
+++ b/Pyblio/GnomeUI/Utils.py
@@ -23,14 +23,15 @@
import os
-import gtk, pango
-import gtk.glade
+from gi.repository import Gtk, Pango, Gdk
+# import gtk, pango
+# import Gtk.glade
-from gnome import ui
+# from gnome import ui
from Pyblio import Config, version
-import gconf
+from gi.repository import GConf
class Callback:
@@ -40,16 +41,16 @@ class Callback:
def __init__ (self, question, parent = None):
self.dialog = \
- gtk.MessageDialog (parent,
- gtk.DIALOG_MODAL |
- gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_QUESTION,
- gtk.BUTTONS_YES_NO,
+ Gtk.MessageDialog (parent,
+ Gtk.DialogFlags.MODAL |
+ Gtk.DialogFlags.DESTROY_WITH_PARENT,
+ Gtk.MessageType.QUESTION,
+ Gtk.ButtonsType.YES_NO,
question)
return
def answer (self):
- res = self.dialog.run () == gtk.RESPONSE_YES
+ res = self.dialog.run () == Gtk.ResponseType.YES
self.dialog.destroy ()
return res
@@ -86,7 +87,7 @@ class GladeWindow:
def __init__ (self, parent = None, window = None):
gp = os.path.join(glade_root, self.gladeinfo ['file'])
- self.xml = gtk.glade.XML (gp, window, domain = "pybliographer")
+ self.xml = Gtk.glade.XML (gp, window, domain = "pybliographer")
self.xml.signal_autoconnect (self)
for w in self.xml.get_widget_prefix ('_w_'):
@@ -121,27 +122,29 @@ class GladeWindow:
return
-config = gconf.client_get_default ()
+config = GConf.Client.get_default ()
cursor = {
- 'clock' : gtk.gdk.Cursor (gtk.gdk.WATCH),
- 'normal': gtk.gdk.Cursor (gtk.gdk.LEFT_PTR),
+ 'clock' : Gdk.Cursor.new(Gdk.CursorType.WATCH),
+ 'normal': Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR),
}
def set_cursor (self, name):
+ # FIXME: Port to Gtk3
+ return
window = self.get_toplevel ().window
if not window: return
window.set_cursor (cursor [name])
- while gtk.events_pending ():
- gtk.main_iteration (False)
+ while Gtk.events_pending ():
+ Gtk.main_iteration (False)
return
-##_tooltips = gtk.Tooltips ()
+##_tooltips = Gtk.Tooltips ()
##def set_tip (w, text):
@@ -158,7 +161,7 @@ def set_cursor (self, name):
def popup_add (menu, item, action = None, argument = None):
''' Helper to add a new menu entry '''
- tmp = gtk.MenuItem (item)
+ tmp = Gtk.MenuItem (item)
if action:
tmp.connect ('activate', action, argument)
@@ -170,19 +173,19 @@ def popup_add (menu, item, action = None, argument = None):
def error_dialog (title, err, parent = None):
dialog = \
- gtk.MessageDialog (parent,
- gtk.DIALOG_MODAL |
- gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_ERROR,
+ Gtk.MessageDialog (parent,
+ Gtk.DialogFlags.MODAL |
+ Gtk.DialogFlags.DESTROY_WITH_PARENT,
+ Gtk.MessageType.ERROR,
message_format = title)
- b = dialog.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
+ b = dialog.add_button (Gtk.STOCK_OK, Gtk.ResponseType.OK)
b.set_property ('has_default', True)
- buff = gtk.TextBuffer ()
- title = buff.create_tag ('title', weight = pango.WEIGHT_BOLD)
+ buff = Gtk.TextBuffer ()
+ title = buff.create_tag ('title', weight = Pango.Weight.BOLD)
- text = gtk.TextView ()
+ text = Gtk.TextView ()
text.set_editable (False)
text.set_cursor_visible (False)
text.set_buffer (buff)
@@ -195,9 +198,9 @@ def error_dialog (title, err, parent = None):
buff.insert (iter, str (err))
- holder = gtk.ScrolledWindow ()
- holder.set_policy (gtk.POLICY_AUTOMATIC,
- gtk.POLICY_AUTOMATIC)
+ holder = Gtk.ScrolledWindow ()
+ holder.set_policy (Gtk.PolicyType.AUTOMATIC,
+ Gtk.PolicyType.AUTOMATIC)
holder.add (text)
dialog.vbox.pack_start (holder)
diff --git a/Pyblio/GnomeUI/__init__.py b/Pyblio/GnomeUI/__init__.py
index 01d5aba..b24f5a3 100644
--- a/Pyblio/GnomeUI/__init__.py
+++ b/Pyblio/GnomeUI/__init__.py
@@ -23,35 +23,33 @@
# are not passed to Gnome
import sys, string
+import gettext
+
+_ = gettext.gettext
files = sys.argv [2:]
sys.argv = sys.argv [:2] + ['--'] + files
# correctly identify the program
-import pygtk
-pygtk.require ('2.0')
-
-import gnome, gtk
-import gnome.ui
+from gi.repository import Gtk
from Pyblio import version
-prg = gnome.init ('pybliographer', version.version)
-prg.set_property (gnome.PARAM_APP_DATADIR, version.datadir)
+# prg = Gtk.Application (application_id='pybliographer') #, version.version)
+# Gtk.init()
+# prg.set_property (gnome.PARAM_APP_DATADIR, version.datadir)
def _vnum (t):
return string.join (map (str, t), '.')
-ui_version = _("This is Pybliographic %s [Python %s, Gtk %s, PyGTK %s]") % (
+ui_version = _("This is Pybliographic %s [Python %s, Gtk %s]") % (
version.version, _vnum (sys.version_info [:3]),
- _vnum (gtk.gtk_version), _vnum (gtk.pygtk_version))
-
+ _vnum (Gtk._version))
+
# clean up our garbage
sys.argv = sys.argv [:2] + files
del sys, files
-import gtk.glade
-
-gtk.glade.bindtextdomain ("pybliographer", version.localedir)
+# Gtk.glade.bindtextdomain ("pybliographer", version.localedir)
diff --git a/Pyblio/GnomeUI/glade/pyblio.ui.in b/Pyblio/GnomeUI/glade/pyblio.ui.in
new file mode 100644
index 0000000..1525559
--- /dev/null
+++ b/Pyblio/GnomeUI/glade/pyblio.ui.in
@@ -0,0 +1,778 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="main">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Pybliographer</property>
+ <property name="icon">@icondir@/pybliographic.png</property>
+ <signal name="key-press-event" handler="key_pressed" swapped="no"/>
+ <signal name="delete-event" handler="close_or_exit" swapped="no"/>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="menuitem1">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem1">
+ <property name="label">gtk-new</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">new1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem2">
+ <property name="label">gtk-open</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">open1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem3">
+ <property name="label">gtk-save</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">merge_with1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem4">
+ <property name="label">gtk-save-as</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">medline_query1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem41">
+ <property name="label">gtk-save</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">_w_save_mnu</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem42">
+ <property name="label">gtk-save-as</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">save_as1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem20">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem43">
+ <property name="label">gtk-save-as</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">previous_documents</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem50">
+ <property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">close1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem5">
+ <property name="label">gtk-quit</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">quit1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem2">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem6">
+ <property name="label">gtk-cut</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">cut1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem7">
+ <property name="label">gtk-copy</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">copy1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem8">
+ <property name="label">gtk-paste</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">paste1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem9">
+ <property name="label">gtk-clear</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">clear1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem11">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem91">
+ <property name="label">gtk-close</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">add1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem92">
+ <property name="label">gtk-edit</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">edit1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem93">
+ <property name="label">gtk-delete</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">delete1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem12">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem94">
+ <property name="label">gtk-find</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">find1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem95">
+ <property name="label">gtk-sort</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">sort1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem3">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem4">
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <property name="related_action">cite1</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu44">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem441">
+ <property name="label">gtk-about</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">cite2</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem442">
+ <property name="label">gtk-about</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">format1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem5">
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <property name="related_action">settings1</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu55">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem551">
+ <property name="label">gtk-about</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">fields1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem552">
+ <property name="label">gtk-preferences</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">preferences2</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem13">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem553">
+ <property name="label">gtk-preferences</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">forget_all_changes1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem6">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menu3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem61">
+ <property name="label">gtk-about</property>
+ <property name="use_action_appearance">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">documentation_open</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="imagemenuitem62">
+ <property name="label">gtk-about</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="related_action">about1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="toolbar1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">2</property>
+ <property name="toolbar_style">both</property>
+ <child>
+ <object class="GtkToolButton" id="button2">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Open File</property>
+ <property name="use_action_appearance">False</property>
+ <property name="stock_id">gtk-open</property>
+ <signal name="clicked" handler="ui_open_document" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="_w_save_btn">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Save File</property>
+ <property name="use_action_appearance">False</property>
+ <property name="stock_id">gtk-save</property>
+ <signal name="clicked" handler="save_document" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem1">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <child>
+ <object class="GtkVSeparator" id="vseparator3">
+ <property name="height_request">20</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="button4">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="stock_id">gtk-add</property>
+ <signal name="clicked" handler="add_entry" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolItem" id="toolitem2">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <child>
+ <object class="GtkVSeparator" id="vseparator1">
+ <property name="height_request">20</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="button5">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="stock_id">gtk-find</property>
+ <signal name="clicked" handler="find_entries" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="button6">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="label" translatable="yes">Cite</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-jump-to</property>
+ <signal name="clicked" handler="lyx_cite" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVPaned" id="main_pane">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkStatusbar" id="statusbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkActionGroup" id="actiongroup1">
+ <child>
+ <object class="GtkAction" id="file1">
+ <property name="name">file1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="new1">
+ <property name="name">new1</property>
+ <property name="label" translatable="yes">_New</property>
+ <signal handler="new_document" last_modification_time="Sun, 08 Jun 2003 11:32:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="open1">
+ <property name="name">open1</property>
+ <signal handler="ui_open_document" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="merge_with1">
+ <property name="stock_id">gtk-convert</property>
+ <property name="name">merge_with1</property>
+ <property name="label" translatable="yes">Merge With...</property>
+ <signal handler="merge_database" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ <accelerator key="g" modifiers="GDK_CONTROL_MASK"/>
+ </child>
+ <child>
+ <object class="GtkAction" id="medline_query1">
+ <property name="name">medline_query1</property>
+ <property name="label" translatable="yes">Medline Query...</property>
+ <signal handler="query_database" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ <accelerator key="m" modifiers="GDK_CONTROL_MASK"/>
+ </child>
+ <child>
+ <object class="GtkAction" id="_w_save_mnu">
+ <property name="name">_w_save_mnu</property>
+ <signal handler="save_document" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="save_as1">
+ <property name="name">save_as1</property>
+ <signal handler="save_document_as" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="previous_documents">
+ <property name="name">previous_documents</property>
+ <property name="label" translatable="yes">Previous Documents</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="close1">
+ <property name="name">close1</property>
+ <signal handler="close_document" last_modification_time="Mon, 09 Jun 2003 18:50:24 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="quit1">
+ <property name="name">quit1</property>
+ <signal handler="exit_application" last_modification_time="Mon, 09 Jun 2003 18:50:24 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="edit1">
+ <property name="name">edit1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="cut1">
+ <property name="name">cut1</property>
+ <signal handler="cut_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="copy1">
+ <property name="name">copy1</property>
+ <signal handler="copy_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="paste1">
+ <property name="name">paste1</property>
+ <signal handler="paste_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="clear1">
+ <property name="name">clear1</property>
+ <signal handler="clear_entries" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="add1">
+ <property name="stock_id">gtk-add</property>
+ <property name="name">add1</property>
+ <property name="label" translatable="yes">_Add...</property>
+ <signal handler="add_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="edit2">
+ <property name="name">edit2</property>
+ <property name="label" translatable="yes">_Edit...</property>
+ <signal handler="edit_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="delete1">
+ <property name="stock_id">gtk-remove</property>
+ <property name="name">delete1</property>
+ <property name="label" translatable="yes">_Delete...</property>
+ <signal handler="delete_entry" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ <accelerator key="Delete" modifiers="0"/>
+ </child>
+ <child>
+ <object class="GtkAction" id="find1">
+ <property name="name">find1</property>
+ <signal handler="find_entries" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="sort1">
+ <property name="stock_id">gtk-sort-ascending</property>
+ <property name="name">sort1</property>
+ <property name="label" translatable="yes">S_ort...</property>
+ <signal handler="sort_entries" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="cite1">
+ <property name="name">cite1</property>
+ <property name="label" translatable="yes">Cite</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="cite2">
+ <property name="stock_id">gtk-jump-to</property>
+ <property name="name">cite2</property>
+ <property name="label" translatable="yes">Cite...</property>
+ <signal handler="lyx_cite" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="format1">
+ <property name="stock_id">gtk-execute</property>
+ <property name="name">format1</property>
+ <property name="label" translatable="yes">Format...</property>
+ <signal handler="format_entries" last_modification_time="Mon, 09 Jun 2003 18:56:54 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="settings1">
+ <property name="name">settings1</property>
+ <property name="label" translatable="yes">Settings</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="fields1">
+ <property name="name">fields1</property>
+ <property name="label" translatable="yes">Fields...</property>
+ <signal handler="set_fields" last_modification_time="Mon, 09 Jun 2003 19:02:17 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="preferences2">
+ <property name="name">preferences2...</property>
+ <signal handler="set_preferences" last_modification_time="Mon, 09 Jun 2003 19:02:17 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="forget_all_changes1">
+ <property name="name">forget_all_changes1</property>
+ <property name="label" translatable="yes">Forget all changes</property>
+ <signal handler="forget_changes_cb" last_modification_time="Wed, 12 Nov 2003 14:32:19 GMT"
name="activate"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="help1">
+ <property name="name">help1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="documentation_open">
+ <property name="stock_id">gtk-help</property>
+ <property name="name">documentation_open</property>
+ <property name="label" translatable="yes">Contents</property>
+ <signal handler="on_documentation" last_modification_time="Tue, 06 Jan 2004 13:25:15 GMT"
name="activate"/>
+ </object>
+ <accelerator key="F1" modifiers="0"/>
+ </child>
+ <child>
+ <object class="GtkAction" id="about1">
+ <property name="name">about1</property>
+ <signal handler="about" last_modification_time="Mon, 09 Jun 2003 19:02:17 GMT" name="activate"/>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/scripts/pybliographic.py b/scripts/pybliographic.py
index 78a7442..340a8a7 100644
--- a/scripts/pybliographic.py
+++ b/scripts/pybliographic.py
@@ -43,7 +43,8 @@ elif pyblio_path:
else:
main.new_document ()
-import gtk
+# import gtk
+from gi.repository import Gtk
-gtk.main ()
+Gtk.main ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]