[ocrfeeder] Set parent in PreferencesDialog
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Set parent in PreferencesDialog
- Date: Sat, 20 Dec 2014 22:40:20 +0000 (UTC)
commit 259cfdac65547cd6a68c514b3324d65bbf37b186
Author: Joaquim Rocha <me joaquimrocha com>
Date: Fri Dec 19 13:20:23 2014 +0000
Set parent in PreferencesDialog
src/ocrfeeder/studio/studioBuilder.py | 5 ++++-
src/ocrfeeder/studio/widgetPresenter.py | 10 +++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/ocrfeeder/studio/studioBuilder.py b/src/ocrfeeder/studio/studioBuilder.py
index 23c04c5..4d597ad 100644
--- a/src/ocrfeeder/studio/studioBuilder.py
+++ b/src/ocrfeeder/studio/studioBuilder.py
@@ -384,7 +384,10 @@ class Studio:
self.source_images_controler.spellCheck(locale.getdefaultlocale()[0])
def preferences(self, widget = None):
- preferences_dialog = widgetPresenter.PreferencesDialog(self.configuration_manager,
self.ocr_engines_manager.ocr_engines)
+ parent = self.main_window.window
+ preferences_dialog = widgetPresenter.PreferencesDialog(parent,
+ self.configuration_manager,
+ self.ocr_engines_manager.ocr_engines)
if preferences_dialog.run() == Gtk.ResponseType.ACCEPT:
preferences_dialog.saveToManager()
self.source_images_controler.updateFromConfiguration()
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index eeb23e6..80c6256 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -1301,9 +1301,13 @@ class QueuedEventsProgressDialog(Gtk.Dialog):
class PreferencesDialog(Gtk.Dialog):
- def __init__(self, configuration_manager, ocr_engines):
- super(PreferencesDialog, self).__init__(_('Preferences'), flags = Gtk.DialogFlags.MODAL, buttons =
(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT,
- Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT))
+ def __init__(self, parent, configuration_manager, ocr_engines):
+ super(PreferencesDialog, self).__init__(_('Preferences'), parent=parent,
+ flags = Gtk.DialogFlags.MODAL,
+ buttons = (Gtk.STOCK_CANCEL,
+ Gtk.ResponseType.REJECT,
+ Gtk.STOCK_OK,
+ Gtk.ResponseType.ACCEPT))
self.configuration_manager = configuration_manager
self.ocr_engines = ocr_engines
self.notebook = Gtk.Notebook()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]