diff --git a/gramps/gen/config.py b/gramps/gen/config.py index 6f38c5036..3fd1a98f8 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -223,6 +223,11 @@ register('interface.statusbar', 1) register('interface.toolbar-on', True) register('interface.toolbar-text', False) register('interface.hide-lds', False) +register('interface.toolbar-clipboard', True) +register('interface.toolbar-plugin', True) +register('interface.toolbar-preference', True) +register('interface.toolbar-reports', True) +register('interface.toolbar-tools', True) register('interface.view', True) register('interface.surname-box-height', 150) register('interface.treemodel-cache-size', 1000) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index debbc73ae..ea94f1774 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -1163,6 +1163,12 @@ class GrampsPreferences(ConfigureDialog): """ self.uistate.emit('grampletbar-close-changed') + def cb_toolbar_changed(self, obj): + """ + Called when the toolbar is changed. + """ + self.uistate.emit('toolbar-changed') + def add_data_panel(self, configdialog): """ Config tab with user Appearance and format settings. @@ -1618,6 +1624,46 @@ class GrampsPreferences(ConfigureDialog): "(People, Families, Events...).\n" "Requires Gramps restart to apply.")) + row += 1 + # Show Tools Icon: + self.add_checkbox( + grid, _("Show Clipboard icon on toolbar"), + row, 'interface.toolbar-clipboard', start=1, stop=3, + tooltip=_("Show or hide the Clipboard icon on the toolbar."), + extra_callback=self.cb_toolbar_changed) + + row += 1 + # Show Tools Icon: + self.add_checkbox( + grid, _("Show Reports icon on toolbar"), + row, 'interface.toolbar-reports', start=1, stop=3, + tooltip=_("Show or hide the Reports icon on the toolbar."), + extra_callback=self.cb_toolbar_changed) + + row += 1 + # Show Tools Icon: + self.add_checkbox( + grid, _("Show Tools icon on toolbar"), + row, 'interface.toolbar-tools', start=1, stop=3, + tooltip=_("Show or hide the Tools icon on the toolbar."), + extra_callback=self.cb_toolbar_changed) + + row += 1 + # Show Plugins Icon: + self.add_checkbox( + grid, _("Show Plugins icon on toolbar"), + row, 'interface.toolbar-plugin', start=1, stop=3, + tooltip=_("Show or hide the Plugins icon on the toolbar."), + extra_callback=self.cb_toolbar_changed) + + row += 1 + # Show Preferences icon: + self.add_checkbox( + grid, _("Show Preferences icon on toolbar"), + row, 'interface.toolbar-preference', start=1, stop=3, + tooltip=_("Show or hide the Preferences icon on the toolbar."), + extra_callback=self.cb_toolbar_changed) + row += 1 # Gramplet bar close buttons: self.add_checkbox( diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 9be76ba42..a19d4dcaf 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -382,6 +382,43 @@ class WarnHandler(RotateHandler): top.run() top.destroy() +TOOL_UI = ''' + + %s + %s + %s + %s + True + + + False + + +''' + +TOOLS = { +'clipboard': ('edit-paste', + 'win.Clipboard', + _('Open the Clipboard dialog'), + _('Clip_board')), +'reports': ('gramps-reports', + 'win.Reports', + _('Open the reports dialog'), + _('Reports')), +'tools': ('gramps-tools', + 'win.Tools', + _('Open the tools dialog'), + _('Tools')), +'plugin': ('gramps-plugin-manager', + 'win.PluginStatus', + _('Open Plugin Manager'), + _('Plugins')), +'preference': ('gramps-preferences', + 'app.preferences', + _('Open Preferences'), + _('Preferences')), +} + class DisplayState(Callback): __signals__ = { @@ -393,6 +430,7 @@ class DisplayState(Callback): 'update-available' : (list, ), 'autobackup' : None, 'font-changed' : None, + 'toolbar-changed' : None, } #nav_type to message @@ -446,6 +484,7 @@ class DisplayState(Callback): # This call has been moved one level up, # but this connection is still made! # self.dbstate.connect('database-changed', self.db_changed) + self.connect('toolbar-changed', self.set_toolbar) if DEV_VERSION or VERSION_QUALIFIER: ver_btn = status.get_version_btn() @@ -457,6 +496,15 @@ class DisplayState(Callback): ver_btn.connect('clicked', self.__develop_warn, msg) ver_btn.show() + def set_toolbar(self): + ui = '\n' + for key in TOOLS.keys(): + if config.get('interface.toolbar-' + key): + ui += TOOL_UI % TOOLS[key] + ui += '' + self.uimanager.add_ui_from_string([ui]) + self.uimanager.update_menu() + def set_backup_timer(self): """ Set the backup timer. diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index c7f65110b..b5ee1b523 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -343,19 +343,6 @@ UIDEFAULT = ( - - - edit-paste - win.Clipboard - ''' - '''Open the Clipboard dialog - Clip_board - True - - - False - - @@ -379,32 +366,6 @@ UIDEFAULT = ( - - - gramps-reports - win.Reports - ''' - '''Open the reports dialog - _Reports - True - - - False - - - - - gramps-tools - win.Tools - ''' - '''Open the tools dialog - _Tools - True - - - False - - diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 218989975..5fe551964 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -210,6 +210,7 @@ class ViewManager(CLIManager): # Set autobackup self.uistate.connect('autobackup', self.autobackup) self.uistate.set_backup_timer() + self.uistate.set_toolbar() def check_for_updates(self): """ diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 7744ef72b..fa753ba66 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -383,7 +383,7 @@ class MediaView(ListView): ''' % (ADD_MSG, EDIT_MSG, DEL_MSG, MERGE_MSG), ''' - + gramps-viewmedia @@ -443,6 +443,10 @@ class MediaView(ListView): +
+ + +
''' % _('_Edit...', 'action') # to use sgettext() ] diff --git a/images/hicolor/16x16/actions/gramps-plugin-manager.png b/images/hicolor/16x16/actions/gramps-plugin-manager.png new file mode 100644 index 000000000..825378069 Binary files /dev/null and b/images/hicolor/16x16/actions/gramps-plugin-manager.png differ diff --git a/images/hicolor/16x16/actions/gramps-preferences.png b/images/hicolor/16x16/actions/gramps-preferences.png new file mode 100644 index 000000000..521a203b7 Binary files /dev/null and b/images/hicolor/16x16/actions/gramps-preferences.png differ diff --git a/images/hicolor/22x22/actions/gramps-plugin-manager.png b/images/hicolor/22x22/actions/gramps-plugin-manager.png new file mode 100644 index 000000000..1e21c9e2c Binary files /dev/null and b/images/hicolor/22x22/actions/gramps-plugin-manager.png differ diff --git a/images/hicolor/22x22/actions/gramps-preferences.png b/images/hicolor/22x22/actions/gramps-preferences.png new file mode 100644 index 000000000..613e55087 Binary files /dev/null and b/images/hicolor/22x22/actions/gramps-preferences.png differ diff --git a/images/hicolor/24x24/actions/gramps-plugin-manager.png b/images/hicolor/24x24/actions/gramps-plugin-manager.png new file mode 100644 index 000000000..bfd4cd708 Binary files /dev/null and b/images/hicolor/24x24/actions/gramps-plugin-manager.png differ diff --git a/images/hicolor/24x24/actions/gramps-preferences.png b/images/hicolor/24x24/actions/gramps-preferences.png new file mode 100644 index 000000000..b02404f1c Binary files /dev/null and b/images/hicolor/24x24/actions/gramps-preferences.png differ diff --git a/images/hicolor/48x48/actions/gramps-plugin-manager.png b/images/hicolor/48x48/actions/gramps-plugin-manager.png new file mode 100644 index 000000000..16a14af34 Binary files /dev/null and b/images/hicolor/48x48/actions/gramps-plugin-manager.png differ diff --git a/images/hicolor/48x48/actions/gramps-preferences.png b/images/hicolor/48x48/actions/gramps-preferences.png new file mode 100644 index 000000000..de843a321 Binary files /dev/null and b/images/hicolor/48x48/actions/gramps-preferences.png differ diff --git a/images/hicolor/scalable/actions/gramps-plugin-manager.svg b/images/hicolor/scalable/actions/gramps-plugin-manager.svg new file mode 100644 index 000000000..8a025e9d2 --- /dev/null +++ b/images/hicolor/scalable/actions/gramps-plugin-manager.svg @@ -0,0 +1,150 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/images/hicolor/scalable/actions/gramps-preferences.svg b/images/hicolor/scalable/actions/gramps-preferences.svg new file mode 100644 index 000000000..9d767742d --- /dev/null +++ b/images/hicolor/scalable/actions/gramps-preferences.svg @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + System Applications + + + Jakub Steiner + + + http://jimmac.musichall.cz/ + + + system + applications + group + category + admin + root + + + + + + + + + + + + + + + + + + + + + +