[ocrfeeder] Update window icon



commit 06dcbb056b19ee19e6591fa7edff673d68e06c96
Author: scx <scx mail gmail com>
Date:   Sun Jan 27 15:40:09 2019 +0100

    Update window icon

 src/ocrfeeder/studio/widgetPresenter.py | 15 +--------------
 src/ocrfeeder/util/constants.py.in      |  2 ++
 2 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index b06fcbf..864b207 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -44,7 +44,7 @@ class MainWindow(Gtk.Window):
     def __init__(self):
         Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL)
         self.set_size_request(800, 600)
-        self.set_icon_from_file(WINDOW_ICON)
+        self.set_default_icon_name(APP_ID)
         self.main_box = Gtk.VBox()
         self.main_box.show()
 
@@ -763,7 +763,6 @@ class FileDialog(Gtk.FileChooserDialog):
             for pattern in file_filter[2]:
                 filter.add_pattern(pattern)
             self.add_filter(filter)
-        self.set_icon_from_file(WINDOW_ICON)
 
 class PagesToExportDialog(Gtk.Dialog):
 
@@ -774,7 +773,6 @@ class PagesToExportDialog(Gtk.Dialog):
                                                   buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT,
                                                              Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT))
         self.__makePageSelectionArea()
-        self.set_icon_from_file(WINDOW_ICON)
 
     def __makePageSelectionArea(self):
         page_selection_frame = PlainFrame(_('Pages to export'))
@@ -798,7 +796,6 @@ class ExportDialog(Gtk.Dialog):
                                                       Gtk.STOCK_OK,
                                                       Gtk.ResponseType.ACCEPT))
         self.__makeFormatSelectionArea(format_choices)
-        self.set_icon_from_file(WINDOW_ICON)
 
     def __makeFormatSelectionArea(self, format_choices):
         page_selection_frame = PlainFrame(_('Choose the format'))
@@ -827,7 +824,6 @@ class PageSizeDialog(Gtk.Dialog):
                                                         Gtk.ResponseType.ACCEPT))
         self.__makePageSizeArea(current_page_size)
         self.paper_sizes.connect('changed', self.__changedPageSize, current_page_size)
-        self.set_icon_from_file(WINDOW_ICON)
 
     def __makePageSizeArea(self, page_size):
         page_size_frame = PlainFrame(_('Page size'))
@@ -910,7 +906,6 @@ class QuestionDialog(Gtk.MessageDialog):
                                              flags = Gtk.DialogFlags.MODAL |
                                              Gtk.DialogFlags.DESTROY_WITH_PARENT,
                                              buttons = buttons)
-        self.set_icon_from_file(WINDOW_ICON)
         self.set_markup(message)
 
 class UnpaperDialog(Gtk.Dialog):
@@ -929,7 +924,6 @@ class UnpaperDialog(Gtk.Dialog):
         self.temp_dir = temp_dir
         self.unpapered_image = None
         self.__makePreviewArea()
-        self.set_icon_from_file(WINDOW_ICON)
         self.vbox.show_all()
         self.preview.connect('clicked', self.__getPreview)
         self.set_size_request(500, -1)
@@ -1169,7 +1163,6 @@ class SimpleDialog(Gtk.MessageDialog):
                                            buttons = Gtk.ButtonsType.OK)
         self.set_title(title)
         self.set_markup(message)
-        self.set_icon_from_file(WINDOW_ICON)
 
     def run(self):
         super(SimpleDialog, self).run()
@@ -1227,7 +1220,6 @@ class QueuedEventsProgressDialog(Gtk.Dialog):
     def __init__(self, parent, items_list = []):
         super(QueuedEventsProgressDialog, self).__init__(parent = parent,
                                                        flags = Gtk.DialogFlags.MODAL)
-        self.set_icon_from_file(WINDOW_ICON)
         self.info_list = []
         self.worker = AsyncWorker()
         self.setItemsList(items_list)
@@ -1324,7 +1316,6 @@ class PreferencesDialog(Gtk.Dialog):
         self.unpaper_select.connect('clicked', self.__unpaperSelectDialog)
         self.custom_window_size.connect('toggled', self.__toggledCustomWindowSize)
         self.vbox.add(self.notebook)
-        self.set_icon_from_file(WINDOW_ICON)
         self.set_size_request(*self.PREFERENCES_DIALOG_SIZE)
         self.vbox.show_all()
 
@@ -1718,7 +1709,6 @@ class SystemEnginesDialog(Gtk.Dialog):
                                                   buttons = (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                                                              Gtk.STOCK_ADD, Gtk.ResponseType.ACCEPT))
         self.set_size_request(300, -1)
-        self.set_icon_from_file(WINDOW_ICON)
         self.list_store = Gtk.ListStore(bool, str, GObject.TYPE_PYOBJECT)
         for engine in engines:
             self.list_store.append((True, engine.name, engine))
@@ -1764,7 +1754,6 @@ class OcrManagerDialog(Gtk.Dialog):
         if first_iter:
             selection = self.tree_view.get_selection()
             selection.select_iter(first_iter)
-        self.set_icon_from_file(WINDOW_ICON)
         self.vbox.show_all()
         self.delete_engine.connect('clicked', self.__delete)
         self.new_engine.connect('clicked', self.__engine_settings)
@@ -1882,7 +1871,6 @@ class OcrSettingsDialog(Gtk.Dialog):
         self.engine_manager = engine_manager
         self.engine = engine
         self.vbox.add(self.__makeMainArea())
-        self.set_icon_from_file(WINDOW_ICON)
         self.configuration_manager = ConfigurationManager()
         self.vbox.show_all()
 
@@ -2015,7 +2003,6 @@ class CustomAboutDialog(Gtk.AboutDialog):
         self.set_artists(OCRFEEDER_STUDIO_ARTISTS)
         self.set_comments(_(OCRFEEDER_STUDIO_COMMENTS))
         self.set_translator_credits(_('translator-credits'))
-        self.set_icon_from_file(WINDOW_ICON)
 
 class ScannerChooserDialog(Gtk.Dialog):
 
diff --git a/src/ocrfeeder/util/constants.py.in b/src/ocrfeeder/util/constants.py.in
index a4b42f6..3e9210a 100644
--- a/src/ocrfeeder/util/constants.py.in
+++ b/src/ocrfeeder/util/constants.py.in
@@ -96,3 +96,5 @@ OCRFEEDER_MENUBAR_UI = os.path.join(RESOURCES_DIR, 'menubar.ui')
 
 # ISO-codes location
 ISO_CODES_PATH = '/usr/share/xml/iso-codes/'
+
+APP_ID = 'org.gnome.OCRFeeder'


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