From f89169517e2ab6a061518962cf3ffb8cbe9956f6 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Mon, 16 Jul 2018 22:38:08 +0200 Subject: [PATCH] Rework Plugins Dialog --- gajim/data/gui/plugins_window.ui | 620 +++++++++++++++---------------- gajim/data/style/gajim.css | 5 +- gajim/plugins/gui.py | 52 +-- 3 files changed, 321 insertions(+), 356 deletions(-) diff --git a/gajim/data/gui/plugins_window.ui b/gajim/data/gui/plugins_window.ui index d68a7d963..5b5ab75ac 100644 --- a/gajim/data/gui/plugins_window.ui +++ b/gajim/data/gui/plugins_window.ui @@ -1,22 +1,7 @@ - + - - - True - False - gtk-apply - - - True - False - gtk-cancel - - - True - False - gtk-preferences - + 650 500 @@ -29,89 +14,126 @@ - + True - False - vertical - 6 + True - + True - True - + False + 18 + 18 + 18 + 18 + 18 - + + 200 True - True - 250 + False + True + vertical - - 150 + + True + True + never + out + + + True + True + + + + + + + + + True + True + 0 + + + + True False - 6 - vertical - 6 + False + 1 - + True - True - never - - - True - True - - - - - - - - True - True - 0 - - - - - Install from ZIP - True - True - True - start - image1 + False + Install Plugin from File + Install from Fileā€¦ + True + document-open-symbolic False - False - 1 + True + + + True + False + Uninstall Plugin + True + list-remove-symbolic + + + + False + True + + + - False - False + False + True + 1 + + + False + True + 1 + + + + + 400 + True + False + True + vertical + 18 - + True False - 6 - vertical - 6 + False + 18 True False - &lt;empty&gt; + start + <Plugin Name> True - 0 - - - + False @@ -120,280 +142,242 @@ - + True - False - 6 + True + True + Plugin Settings + - + True False - Version: + applications-system-symbolic - - False - True - 0 - - - - - True - False - <empty> - True - 0 - - - True - True - 1 - False - True + False + end 1 - - - True - False - 6 - - - True - False - Authors: - 0 - - - False - True - 0 - - - - - True - False - <empty> - word-char - True - end - 0 - 0 - - - True - True - 1 - - - - - False - True - 2 - - - - - True - False - - - True - False - Homepage: - - - False - True - 0 - - - - - True - True - False - True - none - 0 - - - True - True - 1 - - - - - False - True - 3 - - - - - True - False - vertical - - - True - False - - - True - False - Description: - - - False - True - 0 - - - - - - - - False - True - 0 - - - - - True - True - in - - - - - - True - True - 1 - - - - - True - True - 4 - - - - - True - False - 5 - end - - - Uninstall - True - True - True - image2 - - - - False - False - 1 - - - - - Configure - True - True - True - image3 - - - - False - False - 2 - - - - - False - True - 5 - - - True - False + False + True + 0 + + + + + True + False + True + error + + + False + 6 + end + + + + + + False + False + 0 + + + + + False + 16 + + + True + False + True + word-char + 0 + + + False + True + 0 + + + + + False + False + 0 + + + + + False + True + 1 + + + + + True + False + start + <Description> + True + word-char + True + + + False + True + 2 + + + + + True + False + 6 + 12 + + + True + False + end + start + Version + + + + 0 + 0 + + + + + True + False + start + <empty> + True + word-char + True + 0 + + + 1 + 0 + + + + + True + False + end + start + Authors + + + + 0 + 1 + + + + + True + False + start + <empty> + True + word-char + True + 10 + 0 + + + 1 + 1 + + + + + True + False + end + start + Homepage + + + + 0 + 2 + + + + + True + False + start + <empty> + True + word-char + 0 + + + 1 + 2 + + + + + False + True + 3 - - - - True - False - Installed - - False + False + True + 2 - - - - - - + + + + + True + False + Installed - True - True - 0 + False - - True - False - 15 - end - - - gtk-close - True - True - True - True - - - - False - False - 0 - - - - - False - True - 1 - + + + + + + + Plug-in decription should be displayed here. This text will be erased during PluginsWindow initialization. diff --git a/gajim/data/style/gajim.css b/gajim/data/style/gajim.css index d607d1086..1f81ee7af 100644 --- a/gajim/data/style/gajim.css +++ b/gajim/data/style/gajim.css @@ -111,14 +111,17 @@ list.settings > row > box { /* Text style */ .bold16 { font-size: 16px; font-weight: bold; } +.large-header { font-size: 20px; font-weight: bold; } .status-away { color: #ff8533;} .status-dnd { color: #e62e00;} .status-online { color: #66bf10;} /* Treeview */ - treeview.space { padding: 6px; } +/* GtkLinkButton style */ +button.flat.link { padding: 0; border: 0; } + /*MessageWindow Notebook*/ .notebook-tab-label {min-width: 80px} diff --git a/gajim/plugins/gui.py b/gajim/plugins/gui.py index 9f01ffe63..5df3b3b38 100644 --- a/gajim/plugins/gui.py +++ b/gajim/plugins/gui.py @@ -37,7 +37,6 @@ from enum import IntEnum, unique from gajim import gtkgui_helpers from gajim.dialogs import WarningDialog, YesNoDialog from gajim.filechoosers import ArchiveChooserDialog -from gajim.htmltextview import HtmlTextView from gajim.common import app from gajim.common import configpaths from gajim.plugins.helpers import log_calls @@ -68,16 +67,12 @@ class PluginsWindow(object): 'plugin_version_label', 'plugin_authors_label', 'plugin_homepage_linkbutton', 'uninstall_plugin_button', 'configure_plugin_button', 'installed_plugins_treeview', - 'close_button') + 'available_text', 'available_text_label') for widget_name in widgets_to_extract: setattr(self, widget_name, builder.get_object(widget_name)) - self.plugin_description_textview = HtmlTextView() - self.plugin_description_textview.connect_tooltip() - self.plugin_description_textview.set_wrap_mode(Gtk.WrapMode.WORD) - sw = builder.get_object('scrolledwindow2') - sw.add(self.plugin_description_textview) + self.plugin_description_textview = builder.get_object('description') self.installed_plugins_model = Gtk.ListStore(object, str, bool, bool, GdkPixbuf.Pixbuf) self.installed_plugins_treeview.set_model(self.installed_plugins_model) @@ -116,7 +111,6 @@ class PluginsWindow(object): builder.connect_signals(self) self.plugins_notebook.set_current_page(0) - self.close_button.grab_focus() # Adding GUI extension point for Plugins that want to hook the Plugin Window app.plugin_manager.gui_extension_point('plugin_window', self) @@ -128,9 +122,6 @@ class PluginsWindow(object): if event.keyval == Gdk.KEY_Escape: self.window.destroy() - def on_plugins_notebook_switch_page(self, widget, page, page_num): - GLib.idle_add(self.close_button.grab_focus) - @log_calls('PluginsWindow') def installed_plugins_treeview_selection_changed(self, treeview_selection): model, iter = treeview_selection.get_selected() @@ -144,25 +135,20 @@ class PluginsWindow(object): self.plugin_name_label.set_text(plugin.name) self.plugin_version_label.set_text(plugin.version) self.plugin_authors_label.set_text(plugin.authors) - self.plugin_homepage_linkbutton.set_uri(plugin.homepage) - self.plugin_homepage_linkbutton.set_label(plugin.homepage) - label = self.plugin_homepage_linkbutton.get_children()[0] - label.set_ellipsize(Pango.EllipsizeMode.END) - self.plugin_homepage_linkbutton.set_property('sensitive', True) + markup = '%s' % (plugin.homepage, plugin.homepage) + self.plugin_homepage_linkbutton.set_markup(markup) - desc_textbuffer = self.plugin_description_textview.get_buffer() - desc_textbuffer.set_text('') - txt = plugin.description - txt.replace('', '') if plugin.available_text: - txt += '

' + _('Warning: %s') % plugin.available_text - if not txt.startswith('' + txt - txt += ' ' - self.plugin_description_textview.display_html(txt, - self.plugin_description_textview, None) + text = _('Warning: %s') % plugin.available_text + self.available_text_label.set_text(text) + self.available_text.show() + # Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=710888 + self.available_text.queue_resize() + else: + self.available_text.hide() + + self.plugin_description_textview.set_text(plugin.description) - self.plugin_description_textview.set_property('sensitive', True) self.uninstall_plugin_button.set_property( 'sensitive', configpaths.get('PLUGINS_USER') in plugin.__path__) self.configure_plugin_button.set_property( @@ -172,13 +158,9 @@ class PluginsWindow(object): self.plugin_name_label.set_text('') self.plugin_version_label.set_text('') self.plugin_authors_label.set_text('') - self.plugin_homepage_linkbutton.set_uri('') - self.plugin_homepage_linkbutton.set_label('') - self.plugin_homepage_linkbutton.set_property('sensitive', False) + self.plugin_homepage_linkbutton.set_markup('') - desc_textbuffer = self.plugin_description_textview.get_buffer() - desc_textbuffer.set_text('') - self.plugin_description_textview.set_property('sensitive', False) + self.plugin_description_textview.set_text('') self.uninstall_plugin_button.set_property('sensitive', False) self.configure_plugin_button.set_property('sensitive', False) @@ -224,10 +206,6 @@ class PluginsWindow(object): app.plugin_manager.remove_gui_extension_point('plugin_window', self) del app.interface.instances['plugins'] - @log_calls('PluginsWindow') - def on_close_button_clicked(self, widget): - self.window.destroy() - @log_calls('PluginsWindow') def on_configure_plugin_button_clicked(self, widget): selection = self.installed_plugins_treeview.get_selection()