Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
4691429a
by Daniel Brötzmann at 2020-01-13T09:26:36+01:00
-
6cfec8ba
by Daniel Brötzmann at 2020-01-13T09:26:41+01:00
4 changed files:
Changes:
| ... | ... | @@ -23,8 +23,6 @@ from gajim.common.app import interface |
| 23 | 23 |
from gajim.common.exceptions import GajimGeneralException
|
| 24 | 24 |
from gajim import dialogs
|
| 25 | 25 |
|
| 26 |
-import gajim.plugins.gui
|
|
| 27 |
- |
|
| 28 | 26 |
from gajim.gtk.dialogs import ShortcutsWindow
|
| 29 | 27 |
from gajim.gtk.single_message import SingleMessageWindow
|
| 30 | 28 |
from gajim.gtk.about import AboutDialog
|
| ... | ... | @@ -51,10 +49,7 @@ def on_preferences(_action, _param): |
| 51 | 49 |
|
| 52 | 50 |
|
| 53 | 51 |
def on_plugins(_action, _param):
|
| 54 |
- if 'plugins' in interface.instances:
|
|
| 55 |
- interface.instances['plugins'].window.present()
|
|
| 56 |
- else:
|
|
| 57 |
- interface.instances['plugins'] = gajim.plugins.gui.PluginsWindow()
|
|
| 52 |
+ open_window('PluginsWindow')
|
|
| 58 | 53 |
|
| 59 | 54 |
|
| 60 | 55 |
def on_accounts(_action, param):
|
| ... | ... | @@ -2,103 +2,148 @@ |
| 2 | 2 |
<!-- Generated with glade 3.22.1 -->
|
| 3 | 3 |
<interface>
|
| 4 | 4 |
<requires lib="gtk+" version="3.20"/>
|
| 5 |
- <object class="GtkWindow" id="plugins_window">
|
|
| 6 |
- <property name="width_request">650</property>
|
|
| 7 |
- <property name="height_request">500</property>
|
|
| 8 |
- <property name="can_focus">False</property>
|
|
| 9 |
- <property name="border_width">6</property>
|
|
| 10 |
- <property name="title" translatable="yes">Plugins</property>
|
|
| 11 |
- <property name="default_width">650</property>
|
|
| 12 |
- <property name="default_height">500</property>
|
|
| 13 |
- <property name="type_hint">dialog</property>
|
|
| 14 |
- <signal name="destroy" handler="on_plugins_window_destroy" swapped="no"/>
|
|
| 15 |
- <signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
|
|
| 16 |
- <child type="titlebar">
|
|
| 17 |
- <placeholder/>
|
|
| 18 |
- </child>
|
|
| 5 |
+ <object class="GtkNotebook" id="plugins_notebook">
|
|
| 6 |
+ <property name="visible">True</property>
|
|
| 7 |
+ <property name="can_focus">True</property>
|
|
| 19 | 8 |
<child>
|
| 20 |
- <object class="GtkNotebook" id="plugins_notebook">
|
|
| 9 |
+ <object class="GtkBox">
|
|
| 21 | 10 |
<property name="visible">True</property>
|
| 22 |
- <property name="can_focus">True</property>
|
|
| 11 |
+ <property name="can_focus">False</property>
|
|
| 12 |
+ <property name="border_width">18</property>
|
|
| 13 |
+ <property name="spacing">18</property>
|
|
| 14 |
+ <child>
|
|
| 15 |
+ <object class="GtkBox">
|
|
| 16 |
+ <property name="width_request">200</property>
|
|
| 17 |
+ <property name="visible">True</property>
|
|
| 18 |
+ <property name="can_focus">False</property>
|
|
| 19 |
+ <property name="orientation">vertical</property>
|
|
| 20 |
+ <child>
|
|
| 21 |
+ <object class="GtkScrolledWindow">
|
|
| 22 |
+ <property name="visible">True</property>
|
|
| 23 |
+ <property name="can_focus">True</property>
|
|
| 24 |
+ <property name="hscrollbar_policy">never</property>
|
|
| 25 |
+ <property name="shadow_type">out</property>
|
|
| 26 |
+ <child>
|
|
| 27 |
+ <object class="GtkTreeView" id="installed_plugins_treeview">
|
|
| 28 |
+ <property name="visible">True</property>
|
|
| 29 |
+ <property name="can_focus">True</property>
|
|
| 30 |
+ <child internal-child="selection">
|
|
| 31 |
+ <object class="GtkTreeSelection" id="treeview-selection"/>
|
|
| 32 |
+ </child>
|
|
| 33 |
+ <style>
|
|
| 34 |
+ <class name="space"/>
|
|
| 35 |
+ </style>
|
|
| 36 |
+ </object>
|
|
| 37 |
+ </child>
|
|
| 38 |
+ </object>
|
|
| 39 |
+ <packing>
|
|
| 40 |
+ <property name="expand">True</property>
|
|
| 41 |
+ <property name="fill">True</property>
|
|
| 42 |
+ <property name="position">0</property>
|
|
| 43 |
+ </packing>
|
|
| 44 |
+ </child>
|
|
| 45 |
+ <child>
|
|
| 46 |
+ <object class="GtkToolbar">
|
|
| 47 |
+ <property name="visible">True</property>
|
|
| 48 |
+ <property name="can_focus">False</property>
|
|
| 49 |
+ <property name="show_arrow">False</property>
|
|
| 50 |
+ <property name="icon_size">1</property>
|
|
| 51 |
+ <child>
|
|
| 52 |
+ <object class="GtkToolButton" id="install_plugin_button">
|
|
| 53 |
+ <property name="visible">True</property>
|
|
| 54 |
+ <property name="can_focus">False</property>
|
|
| 55 |
+ <property name="tooltip_text" translatable="yes">Install Plugin from ZIP-File</property>
|
|
| 56 |
+ <property name="label" translatable="yes">Install from File…</property>
|
|
| 57 |
+ <property name="use_underline">True</property>
|
|
| 58 |
+ <property name="icon_name">system-software-install-symbolic</property>
|
|
| 59 |
+ <signal name="clicked" handler="_on_install_plugin" swapped="no"/>
|
|
| 60 |
+ </object>
|
|
| 61 |
+ <packing>
|
|
| 62 |
+ <property name="expand">False</property>
|
|
| 63 |
+ <property name="homogeneous">True</property>
|
|
| 64 |
+ </packing>
|
|
| 65 |
+ </child>
|
|
| 66 |
+ <child>
|
|
| 67 |
+ <object class="GtkToolButton" id="uninstall_plugin_button">
|
|
| 68 |
+ <property name="visible">True</property>
|
|
| 69 |
+ <property name="can_focus">False</property>
|
|
| 70 |
+ <property name="tooltip_text" translatable="yes">Uninstall Plugin</property>
|
|
| 71 |
+ <property name="use_underline">True</property>
|
|
| 72 |
+ <property name="icon_name">edit-delete-symbolic</property>
|
|
| 73 |
+ <signal name="clicked" handler="_on_uninstall_plugin" swapped="no"/>
|
|
| 74 |
+ </object>
|
|
| 75 |
+ <packing>
|
|
| 76 |
+ <property name="expand">False</property>
|
|
| 77 |
+ <property name="homogeneous">True</property>
|
|
| 78 |
+ </packing>
|
|
| 79 |
+ </child>
|
|
| 80 |
+ <style>
|
|
| 81 |
+ <class name="inline-toolbar"/>
|
|
| 82 |
+ </style>
|
|
| 83 |
+ </object>
|
|
| 84 |
+ <packing>
|
|
| 85 |
+ <property name="expand">False</property>
|
|
| 86 |
+ <property name="fill">True</property>
|
|
| 87 |
+ <property name="position">1</property>
|
|
| 88 |
+ </packing>
|
|
| 89 |
+ </child>
|
|
| 90 |
+ </object>
|
|
| 91 |
+ <packing>
|
|
| 92 |
+ <property name="expand">False</property>
|
|
| 93 |
+ <property name="fill">True</property>
|
|
| 94 |
+ <property name="position">1</property>
|
|
| 95 |
+ </packing>
|
|
| 96 |
+ </child>
|
|
| 23 | 97 |
<child>
|
| 24 | 98 |
<object class="GtkBox">
|
| 99 |
+ <property name="width_request">400</property>
|
|
| 25 | 100 |
<property name="visible">True</property>
|
| 26 | 101 |
<property name="can_focus">False</property>
|
| 27 |
- <property name="border_width">18</property>
|
|
| 102 |
+ <property name="hexpand">True</property>
|
|
| 103 |
+ <property name="orientation">vertical</property>
|
|
| 28 | 104 |
<property name="spacing">18</property>
|
| 29 | 105 |
<child>
|
| 30 | 106 |
<object class="GtkBox">
|
| 31 |
- <property name="width_request">200</property>
|
|
| 32 | 107 |
<property name="visible">True</property>
|
| 33 | 108 |
<property name="can_focus">False</property>
|
| 34 |
- <property name="orientation">vertical</property>
|
|
| 109 |
+ <property name="hexpand">False</property>
|
|
| 110 |
+ <property name="spacing">18</property>
|
|
| 35 | 111 |
<child>
|
| 36 |
- <object class="GtkScrolledWindow">
|
|
| 112 |
+ <object class="GtkLabel" id="plugin_name_label">
|
|
| 37 | 113 |
<property name="visible">True</property>
|
| 38 |
- <property name="can_focus">True</property>
|
|
| 39 |
- <property name="hscrollbar_policy">never</property>
|
|
| 40 |
- <property name="shadow_type">out</property>
|
|
| 41 |
- <child>
|
|
| 42 |
- <object class="GtkTreeView" id="installed_plugins_treeview">
|
|
| 43 |
- <property name="visible">True</property>
|
|
| 44 |
- <property name="can_focus">True</property>
|
|
| 45 |
- <child internal-child="selection">
|
|
| 46 |
- <object class="GtkTreeSelection" id="treeview-selection"/>
|
|
| 47 |
- </child>
|
|
| 48 |
- <style>
|
|
| 49 |
- <class name="space"/>
|
|
| 50 |
- </style>
|
|
| 51 |
- </object>
|
|
| 52 |
- </child>
|
|
| 114 |
+ <property name="can_focus">False</property>
|
|
| 115 |
+ <property name="halign">start</property>
|
|
| 116 |
+ <property name="label" translatable="yes"><Plugin Name></property>
|
|
| 117 |
+ <property name="selectable">True</property>
|
|
| 118 |
+ <style>
|
|
| 119 |
+ <class name="large-header"/>
|
|
| 120 |
+ </style>
|
|
| 53 | 121 |
</object>
|
| 54 | 122 |
<packing>
|
| 55 |
- <property name="expand">True</property>
|
|
| 123 |
+ <property name="expand">False</property>
|
|
| 56 | 124 |
<property name="fill">True</property>
|
| 57 | 125 |
<property name="position">0</property>
|
| 58 | 126 |
</packing>
|
| 59 | 127 |
</child>
|
| 60 | 128 |
<child>
|
| 61 |
- <object class="GtkToolbar">
|
|
| 129 |
+ <object class="GtkButton" id="configure_plugin_button">
|
|
| 62 | 130 |
<property name="visible">True</property>
|
| 63 |
- <property name="can_focus">False</property>
|
|
| 64 |
- <property name="show_arrow">False</property>
|
|
| 65 |
- <property name="icon_size">1</property>
|
|
| 66 |
- <child>
|
|
| 67 |
- <object class="GtkToolButton" id="install_plugin_button">
|
|
| 68 |
- <property name="visible">True</property>
|
|
| 69 |
- <property name="can_focus">False</property>
|
|
| 70 |
- <property name="tooltip_text" translatable="yes">Install Plugin from ZIP-File</property>
|
|
| 71 |
- <property name="label" translatable="yes">Install from File…</property>
|
|
| 72 |
- <property name="use_underline">True</property>
|
|
| 73 |
- <property name="icon_name">system-software-install-symbolic</property>
|
|
| 74 |
- <signal name="clicked" handler="on_install_plugin_button_clicked" swapped="no"/>
|
|
| 75 |
- </object>
|
|
| 76 |
- <packing>
|
|
| 77 |
- <property name="expand">False</property>
|
|
| 78 |
- <property name="homogeneous">True</property>
|
|
| 79 |
- </packing>
|
|
| 80 |
- </child>
|
|
| 131 |
+ <property name="can_focus">True</property>
|
|
| 132 |
+ <property name="receives_default">True</property>
|
|
| 133 |
+ <property name="tooltip_text" translatable="yes">Plugin Settings</property>
|
|
| 134 |
+ <signal name="clicked" handler="_on_configure_plugin" swapped="no"/>
|
|
| 81 | 135 |
<child>
|
| 82 |
- <object class="GtkToolButton" id="uninstall_plugin_button">
|
|
| 136 |
+ <object class="GtkImage">
|
|
| 83 | 137 |
<property name="visible">True</property>
|
| 84 | 138 |
<property name="can_focus">False</property>
|
| 85 |
- <property name="tooltip_text" translatable="yes">Uninstall Plugin</property>
|
|
| 86 |
- <property name="use_underline">True</property>
|
|
| 87 |
- <property name="icon_name">edit-delete-symbolic</property>
|
|
| 88 |
- <signal name="clicked" handler="on_uninstall_plugin_button_clicked" swapped="no"/>
|
|
| 139 |
+ <property name="icon_name">applications-system-symbolic</property>
|
|
| 89 | 140 |
</object>
|
| 90 |
- <packing>
|
|
| 91 |
- <property name="expand">False</property>
|
|
| 92 |
- <property name="homogeneous">True</property>
|
|
| 93 |
- </packing>
|
|
| 94 | 141 |
</child>
|
| 95 |
- <style>
|
|
| 96 |
- <class name="inline-toolbar"/>
|
|
| 97 |
- </style>
|
|
| 98 | 142 |
</object>
|
| 99 | 143 |
<packing>
|
| 100 | 144 |
<property name="expand">False</property>
|
| 101 |
- <property name="fill">True</property>
|
|
| 145 |
+ <property name="fill">False</property>
|
|
| 146 |
+ <property name="pack_type">end</property>
|
|
| 102 | 147 |
<property name="position">1</property>
|
| 103 | 148 |
</packing>
|
| 104 | 149 |
</child>
|
| ... | ... | @@ -106,33 +151,41 @@ |
| 106 | 151 |
<packing>
|
| 107 | 152 |
<property name="expand">False</property>
|
| 108 | 153 |
<property name="fill">True</property>
|
| 109 |
- <property name="position">1</property>
|
|
| 154 |
+ <property name="position">0</property>
|
|
| 110 | 155 |
</packing>
|
| 111 | 156 |
</child>
|
| 112 | 157 |
<child>
|
| 113 |
- <object class="GtkBox">
|
|
| 114 |
- <property name="width_request">400</property>
|
|
| 158 |
+ <object class="GtkInfoBar" id="available_text">
|
|
| 115 | 159 |
<property name="visible">True</property>
|
| 116 | 160 |
<property name="can_focus">False</property>
|
| 117 |
- <property name="hexpand">True</property>
|
|
| 118 |
- <property name="orientation">vertical</property>
|
|
| 119 |
- <property name="spacing">18</property>
|
|
| 120 |
- <child>
|
|
| 161 |
+ <property name="no_show_all">True</property>
|
|
| 162 |
+ <property name="message_type">error</property>
|
|
| 163 |
+ <child internal-child="action_area">
|
|
| 164 |
+ <object class="GtkButtonBox">
|
|
| 165 |
+ <property name="can_focus">False</property>
|
|
| 166 |
+ <property name="spacing">6</property>
|
|
| 167 |
+ <property name="layout_style">end</property>
|
|
| 168 |
+ <child>
|
|
| 169 |
+ <placeholder/>
|
|
| 170 |
+ </child>
|
|
| 171 |
+ </object>
|
|
| 172 |
+ <packing>
|
|
| 173 |
+ <property name="expand">False</property>
|
|
| 174 |
+ <property name="fill">False</property>
|
|
| 175 |
+ <property name="position">0</property>
|
|
| 176 |
+ </packing>
|
|
| 177 |
+ </child>
|
|
| 178 |
+ <child internal-child="content_area">
|
|
| 121 | 179 |
<object class="GtkBox">
|
| 122 |
- <property name="visible">True</property>
|
|
| 123 | 180 |
<property name="can_focus">False</property>
|
| 124 |
- <property name="hexpand">False</property>
|
|
| 125 |
- <property name="spacing">18</property>
|
|
| 181 |
+ <property name="spacing">16</property>
|
|
| 126 | 182 |
<child>
|
| 127 |
- <object class="GtkLabel" id="plugin_name_label">
|
|
| 183 |
+ <object class="GtkLabel" id="available_text_label">
|
|
| 128 | 184 |
<property name="visible">True</property>
|
| 129 | 185 |
<property name="can_focus">False</property>
|
| 130 |
- <property name="halign">start</property>
|
|
| 131 |
- <property name="label" translatable="yes"><Plugin Name></property>
|
|
| 132 |
- <property name="selectable">True</property>
|
|
| 133 |
- <style>
|
|
| 134 |
- <class name="large-header"/>
|
|
| 135 |
- </style>
|
|
| 186 |
+ <property name="wrap">True</property>
|
|
| 187 |
+ <property name="wrap_mode">word-char</property>
|
|
| 188 |
+ <property name="xalign">0</property>
|
|
| 136 | 189 |
</object>
|
| 137 | 190 |
<packing>
|
| 138 | 191 |
<property name="expand">False</property>
|
| ... | ... | @@ -140,241 +193,171 @@ |
| 140 | 193 |
<property name="position">0</property>
|
| 141 | 194 |
</packing>
|
| 142 | 195 |
</child>
|
| 143 |
- <child>
|
|
| 144 |
- <object class="GtkButton" id="configure_plugin_button">
|
|
| 145 |
- <property name="visible">True</property>
|
|
| 146 |
- <property name="can_focus">True</property>
|
|
| 147 |
- <property name="receives_default">True</property>
|
|
| 148 |
- <property name="tooltip_text" translatable="yes">Plugin Settings</property>
|
|
| 149 |
- <signal name="clicked" handler="on_configure_plugin_button_clicked" swapped="no"/>
|
|
| 150 |
- <child>
|
|
| 151 |
- <object class="GtkImage">
|
|
| 152 |
- <property name="visible">True</property>
|
|
| 153 |
- <property name="can_focus">False</property>
|
|
| 154 |
- <property name="icon_name">applications-system-symbolic</property>
|
|
| 155 |
- </object>
|
|
| 156 |
- </child>
|
|
| 157 |
- </object>
|
|
| 158 |
- <packing>
|
|
| 159 |
- <property name="expand">False</property>
|
|
| 160 |
- <property name="fill">False</property>
|
|
| 161 |
- <property name="pack_type">end</property>
|
|
| 162 |
- <property name="position">1</property>
|
|
| 163 |
- </packing>
|
|
| 164 |
- </child>
|
|
| 165 | 196 |
</object>
|
| 166 | 197 |
<packing>
|
| 167 | 198 |
<property name="expand">False</property>
|
| 168 |
- <property name="fill">True</property>
|
|
| 199 |
+ <property name="fill">False</property>
|
|
| 169 | 200 |
<property name="position">0</property>
|
| 170 | 201 |
</packing>
|
| 171 | 202 |
</child>
|
| 203 |
+ </object>
|
|
| 204 |
+ <packing>
|
|
| 205 |
+ <property name="expand">False</property>
|
|
| 206 |
+ <property name="fill">True</property>
|
|
| 207 |
+ <property name="position">1</property>
|
|
| 208 |
+ </packing>
|
|
| 209 |
+ </child>
|
|
| 210 |
+ <child>
|
|
| 211 |
+ <object class="GtkLabel" id="description">
|
|
| 212 |
+ <property name="visible">True</property>
|
|
| 213 |
+ <property name="can_focus">False</property>
|
|
| 214 |
+ <property name="halign">start</property>
|
|
| 215 |
+ <property name="label" translatable="yes"><Description></property>
|
|
| 216 |
+ <property name="wrap">True</property>
|
|
| 217 |
+ <property name="wrap_mode">word-char</property>
|
|
| 218 |
+ <property name="selectable">True</property>
|
|
| 219 |
+ <property name="xalign">0</property>
|
|
| 220 |
+ </object>
|
|
| 221 |
+ <packing>
|
|
| 222 |
+ <property name="expand">False</property>
|
|
| 223 |
+ <property name="fill">True</property>
|
|
| 224 |
+ <property name="position">2</property>
|
|
| 225 |
+ </packing>
|
|
| 226 |
+ </child>
|
|
| 227 |
+ <child>
|
|
| 228 |
+ <object class="GtkGrid">
|
|
| 229 |
+ <property name="visible">True</property>
|
|
| 230 |
+ <property name="can_focus">False</property>
|
|
| 231 |
+ <property name="row_spacing">6</property>
|
|
| 232 |
+ <property name="column_spacing">12</property>
|
|
| 233 |
+ <child>
|
|
| 234 |
+ <object class="GtkLabel">
|
|
| 235 |
+ <property name="visible">True</property>
|
|
| 236 |
+ <property name="can_focus">False</property>
|
|
| 237 |
+ <property name="halign">end</property>
|
|
| 238 |
+ <property name="valign">start</property>
|
|
| 239 |
+ <property name="label" translatable="yes">Version</property>
|
|
| 240 |
+ <style>
|
|
| 241 |
+ <class name="dim-label"/>
|
|
| 242 |
+ </style>
|
|
| 243 |
+ </object>
|
|
| 244 |
+ <packing>
|
|
| 245 |
+ <property name="left_attach">0</property>
|
|
| 246 |
+ <property name="top_attach">0</property>
|
|
| 247 |
+ </packing>
|
|
| 248 |
+ </child>
|
|
| 172 | 249 |
<child>
|
| 173 |
- <object class="GtkInfoBar" id="available_text">
|
|
| 250 |
+ <object class="GtkLabel" id="plugin_version_label">
|
|
| 174 | 251 |
<property name="visible">True</property>
|
| 175 | 252 |
<property name="can_focus">False</property>
|
| 176 |
- <property name="no_show_all">True</property>
|
|
| 177 |
- <property name="message_type">error</property>
|
|
| 178 |
- <child internal-child="action_area">
|
|
| 179 |
- <object class="GtkButtonBox">
|
|
| 180 |
- <property name="can_focus">False</property>
|
|
| 181 |
- <property name="spacing">6</property>
|
|
| 182 |
- <property name="layout_style">end</property>
|
|
| 183 |
- <child>
|
|
| 184 |
- <placeholder/>
|
|
| 185 |
- </child>
|
|
| 186 |
- </object>
|
|
| 187 |
- <packing>
|
|
| 188 |
- <property name="expand">False</property>
|
|
| 189 |
- <property name="fill">False</property>
|
|
| 190 |
- <property name="position">0</property>
|
|
| 191 |
- </packing>
|
|
| 192 |
- </child>
|
|
| 193 |
- <child internal-child="content_area">
|
|
| 194 |
- <object class="GtkBox">
|
|
| 195 |
- <property name="can_focus">False</property>
|
|
| 196 |
- <property name="spacing">16</property>
|
|
| 197 |
- <child>
|
|
| 198 |
- <object class="GtkLabel" id="available_text_label">
|
|
| 199 |
- <property name="visible">True</property>
|
|
| 200 |
- <property name="can_focus">False</property>
|
|
| 201 |
- <property name="wrap">True</property>
|
|
| 202 |
- <property name="wrap_mode">word-char</property>
|
|
| 203 |
- <property name="xalign">0</property>
|
|
| 204 |
- </object>
|
|
| 205 |
- <packing>
|
|
| 206 |
- <property name="expand">False</property>
|
|
| 207 |
- <property name="fill">True</property>
|
|
| 208 |
- <property name="position">0</property>
|
|
| 209 |
- </packing>
|
|
| 210 |
- </child>
|
|
| 211 |
- </object>
|
|
| 212 |
- <packing>
|
|
| 213 |
- <property name="expand">False</property>
|
|
| 214 |
- <property name="fill">False</property>
|
|
| 215 |
- <property name="position">0</property>
|
|
| 216 |
- </packing>
|
|
| 217 |
- </child>
|
|
| 253 |
+ <property name="halign">start</property>
|
|
| 254 |
+ <property name="label"><empty></property>
|
|
| 255 |
+ <property name="wrap">True</property>
|
|
| 256 |
+ <property name="wrap_mode">word-char</property>
|
|
| 257 |
+ <property name="selectable">True</property>
|
|
| 258 |
+ <property name="xalign">0</property>
|
|
| 218 | 259 |
</object>
|
| 219 | 260 |
<packing>
|
| 220 |
- <property name="expand">False</property>
|
|
| 221 |
- <property name="fill">True</property>
|
|
| 222 |
- <property name="position">1</property>
|
|
| 261 |
+ <property name="left_attach">1</property>
|
|
| 262 |
+ <property name="top_attach">0</property>
|
|
| 223 | 263 |
</packing>
|
| 224 | 264 |
</child>
|
| 225 | 265 |
<child>
|
| 226 |
- <object class="GtkLabel" id="description">
|
|
| 266 |
+ <object class="GtkLabel">
|
|
| 267 |
+ <property name="visible">True</property>
|
|
| 268 |
+ <property name="can_focus">False</property>
|
|
| 269 |
+ <property name="halign">end</property>
|
|
| 270 |
+ <property name="valign">start</property>
|
|
| 271 |
+ <property name="label" translatable="yes">Authors</property>
|
|
| 272 |
+ <style>
|
|
| 273 |
+ <class name="dim-label"/>
|
|
| 274 |
+ </style>
|
|
| 275 |
+ </object>
|
|
| 276 |
+ <packing>
|
|
| 277 |
+ <property name="left_attach">0</property>
|
|
| 278 |
+ <property name="top_attach">1</property>
|
|
| 279 |
+ </packing>
|
|
| 280 |
+ </child>
|
|
| 281 |
+ <child>
|
|
| 282 |
+ <object class="GtkLabel" id="plugin_authors_label">
|
|
| 227 | 283 |
<property name="visible">True</property>
|
| 228 | 284 |
<property name="can_focus">False</property>
|
| 229 | 285 |
<property name="halign">start</property>
|
| 230 |
- <property name="label" translatable="yes"><Description></property>
|
|
| 286 |
+ <property name="label"><empty></property>
|
|
| 231 | 287 |
<property name="wrap">True</property>
|
| 232 | 288 |
<property name="wrap_mode">word-char</property>
|
| 233 | 289 |
<property name="selectable">True</property>
|
| 290 |
+ <property name="lines">10</property>
|
|
| 234 | 291 |
<property name="xalign">0</property>
|
| 235 | 292 |
</object>
|
| 236 | 293 |
<packing>
|
| 237 |
- <property name="expand">False</property>
|
|
| 238 |
- <property name="fill">True</property>
|
|
| 239 |
- <property name="position">2</property>
|
|
| 294 |
+ <property name="left_attach">1</property>
|
|
| 295 |
+ <property name="top_attach">1</property>
|
|
| 240 | 296 |
</packing>
|
| 241 | 297 |
</child>
|
| 242 | 298 |
<child>
|
| 243 |
- <object class="GtkGrid">
|
|
| 299 |
+ <object class="GtkLabel">
|
|
| 244 | 300 |
<property name="visible">True</property>
|
| 245 | 301 |
<property name="can_focus">False</property>
|
| 246 |
- <property name="row_spacing">6</property>
|
|
| 247 |
- <property name="column_spacing">12</property>
|
|
| 248 |
- <child>
|
|
| 249 |
- <object class="GtkLabel">
|
|
| 250 |
- <property name="visible">True</property>
|
|
| 251 |
- <property name="can_focus">False</property>
|
|
| 252 |
- <property name="halign">end</property>
|
|
| 253 |
- <property name="valign">start</property>
|
|
| 254 |
- <property name="label" translatable="yes">Version</property>
|
|
| 255 |
- <style>
|
|
| 256 |
- <class name="dim-label"/>
|
|
| 257 |
- </style>
|
|
| 258 |
- </object>
|
|
| 259 |
- <packing>
|
|
| 260 |
- <property name="left_attach">0</property>
|
|
| 261 |
- <property name="top_attach">0</property>
|
|
| 262 |
- </packing>
|
|
| 263 |
- </child>
|
|
| 264 |
- <child>
|
|
| 265 |
- <object class="GtkLabel" id="plugin_version_label">
|
|
| 266 |
- <property name="visible">True</property>
|
|
| 267 |
- <property name="can_focus">False</property>
|
|
| 268 |
- <property name="halign">start</property>
|
|
| 269 |
- <property name="label"><empty></property>
|
|
| 270 |
- <property name="wrap">True</property>
|
|
| 271 |
- <property name="wrap_mode">word-char</property>
|
|
| 272 |
- <property name="selectable">True</property>
|
|
| 273 |
- <property name="xalign">0</property>
|
|
| 274 |
- </object>
|
|
| 275 |
- <packing>
|
|
| 276 |
- <property name="left_attach">1</property>
|
|
| 277 |
- <property name="top_attach">0</property>
|
|
| 278 |
- </packing>
|
|
| 279 |
- </child>
|
|
| 280 |
- <child>
|
|
| 281 |
- <object class="GtkLabel">
|
|
| 282 |
- <property name="visible">True</property>
|
|
| 283 |
- <property name="can_focus">False</property>
|
|
| 284 |
- <property name="halign">end</property>
|
|
| 285 |
- <property name="valign">start</property>
|
|
| 286 |
- <property name="label" translatable="yes">Authors</property>
|
|
| 287 |
- <style>
|
|
| 288 |
- <class name="dim-label"/>
|
|
| 289 |
- </style>
|
|
| 290 |
- </object>
|
|
| 291 |
- <packing>
|
|
| 292 |
- <property name="left_attach">0</property>
|
|
| 293 |
- <property name="top_attach">1</property>
|
|
| 294 |
- </packing>
|
|
| 295 |
- </child>
|
|
| 296 |
- <child>
|
|
| 297 |
- <object class="GtkLabel" id="plugin_authors_label">
|
|
| 298 |
- <property name="visible">True</property>
|
|
| 299 |
- <property name="can_focus">False</property>
|
|
| 300 |
- <property name="halign">start</property>
|
|
| 301 |
- <property name="label"><empty></property>
|
|
| 302 |
- <property name="wrap">True</property>
|
|
| 303 |
- <property name="wrap_mode">word-char</property>
|
|
| 304 |
- <property name="selectable">True</property>
|
|
| 305 |
- <property name="lines">10</property>
|
|
| 306 |
- <property name="xalign">0</property>
|
|
| 307 |
- </object>
|
|
| 308 |
- <packing>
|
|
| 309 |
- <property name="left_attach">1</property>
|
|
| 310 |
- <property name="top_attach">1</property>
|
|
| 311 |
- </packing>
|
|
| 312 |
- </child>
|
|
| 313 |
- <child>
|
|
| 314 |
- <object class="GtkLabel">
|
|
| 315 |
- <property name="visible">True</property>
|
|
| 316 |
- <property name="can_focus">False</property>
|
|
| 317 |
- <property name="halign">end</property>
|
|
| 318 |
- <property name="valign">start</property>
|
|
| 319 |
- <property name="label" translatable="yes">Homepage</property>
|
|
| 320 |
- <style>
|
|
| 321 |
- <class name="dim-label"/>
|
|
| 322 |
- </style>
|
|
| 323 |
- </object>
|
|
| 324 |
- <packing>
|
|
| 325 |
- <property name="left_attach">0</property>
|
|
| 326 |
- <property name="top_attach">2</property>
|
|
| 327 |
- </packing>
|
|
| 328 |
- </child>
|
|
| 329 |
- <child>
|
|
| 330 |
- <object class="GtkLabel" id="plugin_homepage_linkbutton">
|
|
| 331 |
- <property name="visible">True</property>
|
|
| 332 |
- <property name="can_focus">False</property>
|
|
| 333 |
- <property name="halign">start</property>
|
|
| 334 |
- <property name="label" translatable="yes"><empty></property>
|
|
| 335 |
- <property name="wrap">True</property>
|
|
| 336 |
- <property name="wrap_mode">word-char</property>
|
|
| 337 |
- <property name="xalign">0</property>
|
|
| 338 |
- </object>
|
|
| 339 |
- <packing>
|
|
| 340 |
- <property name="left_attach">1</property>
|
|
| 341 |
- <property name="top_attach">2</property>
|
|
| 342 |
- </packing>
|
|
| 343 |
- </child>
|
|
| 302 |
+ <property name="halign">end</property>
|
|
| 303 |
+ <property name="valign">start</property>
|
|
| 304 |
+ <property name="label" translatable="yes">Homepage</property>
|
|
| 305 |
+ <style>
|
|
| 306 |
+ <class name="dim-label"/>
|
|
| 307 |
+ </style>
|
|
| 344 | 308 |
</object>
|
| 345 | 309 |
<packing>
|
| 346 |
- <property name="expand">False</property>
|
|
| 347 |
- <property name="fill">True</property>
|
|
| 348 |
- <property name="position">3</property>
|
|
| 310 |
+ <property name="left_attach">0</property>
|
|
| 311 |
+ <property name="top_attach">2</property>
|
|
| 312 |
+ </packing>
|
|
| 313 |
+ </child>
|
|
| 314 |
+ <child>
|
|
| 315 |
+ <object class="GtkLabel" id="plugin_homepage_linkbutton">
|
|
| 316 |
+ <property name="visible">True</property>
|
|
| 317 |
+ <property name="can_focus">False</property>
|
|
| 318 |
+ <property name="halign">start</property>
|
|
| 319 |
+ <property name="label" translatable="yes"><empty></property>
|
|
| 320 |
+ <property name="wrap">True</property>
|
|
| 321 |
+ <property name="wrap_mode">word-char</property>
|
|
| 322 |
+ <property name="xalign">0</property>
|
|
| 323 |
+ </object>
|
|
| 324 |
+ <packing>
|
|
| 325 |
+ <property name="left_attach">1</property>
|
|
| 326 |
+ <property name="top_attach">2</property>
|
|
| 349 | 327 |
</packing>
|
| 350 | 328 |
</child>
|
| 351 | 329 |
</object>
|
| 352 | 330 |
<packing>
|
| 353 | 331 |
<property name="expand">False</property>
|
| 354 | 332 |
<property name="fill">True</property>
|
| 355 |
- <property name="position">2</property>
|
|
| 333 |
+ <property name="position">3</property>
|
|
| 356 | 334 |
</packing>
|
| 357 | 335 |
</child>
|
| 358 | 336 |
</object>
|
| 359 |
- </child>
|
|
| 360 |
- <child type="tab">
|
|
| 361 |
- <object class="GtkLabel">
|
|
| 362 |
- <property name="visible">True</property>
|
|
| 363 |
- <property name="can_focus">False</property>
|
|
| 364 |
- <property name="label" translatable="yes">Installed</property>
|
|
| 365 |
- </object>
|
|
| 366 | 337 |
<packing>
|
| 367 |
- <property name="tab_fill">False</property>
|
|
| 338 |
+ <property name="expand">False</property>
|
|
| 339 |
+ <property name="fill">True</property>
|
|
| 340 |
+ <property name="position">2</property>
|
|
| 368 | 341 |
</packing>
|
| 369 | 342 |
</child>
|
| 370 |
- <child>
|
|
| 371 |
- <placeholder/>
|
|
| 372 |
- </child>
|
|
| 373 |
- <child type="tab">
|
|
| 374 |
- <placeholder/>
|
|
| 375 |
- </child>
|
|
| 376 | 343 |
</object>
|
| 377 | 344 |
</child>
|
| 345 |
+ <child type="tab">
|
|
| 346 |
+ <object class="GtkLabel">
|
|
| 347 |
+ <property name="visible">True</property>
|
|
| 348 |
+ <property name="can_focus">False</property>
|
|
| 349 |
+ <property name="label" translatable="yes">Installed</property>
|
|
| 350 |
+ </object>
|
|
| 351 |
+ <packing>
|
|
| 352 |
+ <property name="tab_fill">False</property>
|
|
| 353 |
+ </packing>
|
|
| 354 |
+ </child>
|
|
| 355 |
+ <child>
|
|
| 356 |
+ <placeholder/>
|
|
| 357 |
+ </child>
|
|
| 358 |
+ <child type="tab">
|
|
| 359 |
+ <placeholder/>
|
|
| 360 |
+ </child>
|
|
| 378 | 361 |
</object>
|
| 379 | 362 |
<object class="GtkTextBuffer" id="textbuffer1">
|
| 380 | 363 |
<property name="text" translatable="yes">Plug-in decription should be displayed here. This text will be erased during PluginsWindow initialization.</property>
|
| ... | ... | @@ -131,4 +131,5 @@ WINDOW_MODULES = { |
| 131 | 131 |
'SubscriptionRequest': 'gajim.gtk.subscription_request',
|
| 132 | 132 |
'RemoveAccount': 'gajim.gtk.remove_account',
|
| 133 | 133 |
'ChangePassword': 'gajim.gtk.change_password',
|
| 134 |
+ 'PluginsWindow': 'gajim.plugins.gui',
|
|
| 134 | 135 |
}
|
| ... | ... | @@ -56,74 +56,70 @@ class Column(IntEnum): |
| 56 | 56 |
ICON = 4
|
| 57 | 57 |
|
| 58 | 58 |
|
| 59 |
-class PluginsWindow(EventHelper):
|
|
| 60 |
- |
|
| 59 |
+class PluginsWindow(Gtk.ApplicationWindow, EventHelper):
|
|
| 61 | 60 |
def __init__(self):
|
| 61 |
+ Gtk.ApplicationWindow.__init__(self)
|
|
| 62 | 62 |
EventHelper.__init__(self)
|
| 63 | 63 |
|
| 64 |
- builder = get_builder('plugins_window.ui')
|
|
| 65 |
- self.window = builder.get_object('plugins_window')
|
|
| 66 |
- self.window.set_transient_for(app.interface.roster.window)
|
|
| 67 |
- |
|
| 68 |
- widgets_to_extract = ('plugins_notebook', 'plugin_name_label',
|
|
| 69 |
- 'plugin_version_label', 'plugin_authors_label',
|
|
| 70 |
- 'plugin_homepage_linkbutton', 'install_plugin_button',
|
|
| 71 |
- 'uninstall_plugin_button', 'configure_plugin_button',
|
|
| 72 |
- 'installed_plugins_treeview', 'available_text',
|
|
| 73 |
- 'available_text_label')
|
|
| 74 |
- |
|
| 75 |
- for widget_name in widgets_to_extract:
|
|
| 76 |
- setattr(self, widget_name, builder.get_object(widget_name))
|
|
| 64 |
+ self.set_application(app.app)
|
|
| 65 |
+ self.set_position(Gtk.WindowPosition.CENTER)
|
|
| 66 |
+ self.set_default_size(650, 500)
|
|
| 67 |
+ self.set_show_menubar(False)
|
|
| 68 |
+ self.set_title(_('Plugins'))
|
|
| 77 | 69 |
|
| 78 |
- self.plugin_description_textview = builder.get_object('description')
|
|
| 70 |
+ self._ui = get_builder('plugins_window.ui')
|
|
| 71 |
+ self.add(self._ui.plugins_notebook)
|
|
| 79 | 72 |
|
| 80 | 73 |
# Disable 'Install from ZIP' for Flatpak installs
|
| 81 | 74 |
if app.is_flatpak():
|
| 82 |
- self.install_plugin_button.set_tooltip_text(
|
|
| 83 |
- _('Click to view Gajim\'s wiki page on how to install plugins in Flatpak.'))
|
|
| 75 |
+ self._ui.install_plugin_button.set_tooltip_text(
|
|
| 76 |
+ _('Click to view Gajim\'s wiki page on how to install plugins '
|
|
| 77 |
+ 'in Flatpak.'))
|
|
| 84 | 78 |
|
| 85 | 79 |
self.installed_plugins_model = Gtk.ListStore(object, str, bool, bool,
|
| 86 |
- GdkPixbuf.Pixbuf)
|
|
| 87 |
- self.installed_plugins_treeview.set_model(self.installed_plugins_model)
|
|
| 80 |
+ GdkPixbuf.Pixbuf)
|
|
| 81 |
+ self._ui.installed_plugins_treeview.set_model(
|
|
| 82 |
+ self.installed_plugins_model)
|
|
| 88 | 83 |
|
| 89 | 84 |
renderer = Gtk.CellRendererText()
|
| 90 |
- col = Gtk.TreeViewColumn(_('Plugin'))#, renderer, text=Column.NAME)
|
|
| 85 |
+ col = Gtk.TreeViewColumn(_('Plugin')) # , renderer, text=Column.NAME)
|
|
| 91 | 86 |
cell = Gtk.CellRendererPixbuf()
|
| 92 | 87 |
col.pack_start(cell, False)
|
| 93 | 88 |
col.add_attribute(cell, 'pixbuf', Column.ICON)
|
| 94 | 89 |
col.pack_start(renderer, True)
|
| 95 | 90 |
col.add_attribute(renderer, 'text', Column.NAME)
|
| 96 | 91 |
col.set_property('expand', True)
|
| 97 |
- self.installed_plugins_treeview.append_column(col)
|
|
| 92 |
+ self._ui.installed_plugins_treeview.append_column(col)
|
|
| 98 | 93 |
|
| 99 | 94 |
renderer = Gtk.CellRendererToggle()
|
| 100 |
- renderer.connect('toggled', self.installed_plugins_toggled_cb)
|
|
| 95 |
+ renderer.connect('toggled', self._installed_plugin_toggled)
|
|
| 101 | 96 |
col = Gtk.TreeViewColumn(_('Active'), renderer, active=Column.ACTIVE,
|
| 102 |
- activatable=Column.ACTIVATABLE)
|
|
| 103 |
- self.installed_plugins_treeview.append_column(col)
|
|
| 97 |
+ activatable=Column.ACTIVATABLE)
|
|
| 98 |
+ self._ui.installed_plugins_treeview.append_column(col)
|
|
| 104 | 99 |
|
| 105 |
- self.def_icon = load_icon('preferences-desktop',
|
|
| 106 |
- self.window,
|
|
| 107 |
- pixbuf=True)
|
|
| 100 |
+ self.def_icon = load_icon('preferences-desktop', self, pixbuf=True)
|
|
| 108 | 101 |
|
| 109 | 102 |
# connect signal for selection change
|
| 110 |
- selection = self.installed_plugins_treeview.get_selection()
|
|
| 111 |
- selection.connect('changed',
|
|
| 112 |
- self.installed_plugins_treeview_selection_changed)
|
|
| 103 |
+ selection = self._ui.installed_plugins_treeview.get_selection()
|
|
| 104 |
+ selection.connect(
|
|
| 105 |
+ 'changed', self._installed_plugins_treeview_selection_changed)
|
|
| 113 | 106 |
selection.set_mode(Gtk.SelectionMode.SINGLE)
|
| 114 | 107 |
|
| 115 | 108 |
self._clear_installed_plugin_info()
|
| 116 | 109 |
|
| 117 |
- self.fill_installed_plugins_model()
|
|
| 110 |
+ self._fill_installed_plugins_model()
|
|
| 118 | 111 |
root_iter = self.installed_plugins_model.get_iter_first()
|
| 119 | 112 |
if root_iter:
|
| 120 | 113 |
selection.select_iter(root_iter)
|
| 121 | 114 |
|
| 122 |
- builder.connect_signals(self)
|
|
| 115 |
+ self.connect('destroy', self._on_destroy)
|
|
| 116 |
+ self.connect('key-press-event', self._on_key_press)
|
|
| 117 |
+ self._ui.connect_signals(self)
|
|
| 123 | 118 |
|
| 124 |
- self.plugins_notebook.set_current_page(0)
|
|
| 119 |
+ self._ui.plugins_notebook.set_current_page(0)
|
|
| 125 | 120 |
|
| 126 |
- # Adding GUI extension point for Plugins that want to hook the Plugin Window
|
|
| 121 |
+ # Adding GUI extension point for Plugins that want to hook
|
|
| 122 |
+ # the Plugin Window
|
|
| 127 | 123 |
app.plugin_manager.gui_extension_point('plugin_window', self)
|
| 128 | 124 |
|
| 129 | 125 |
self.register_events([
|
| ... | ... | @@ -131,17 +127,21 @@ class PluginsWindow(EventHelper): |
| 131 | 127 |
('plugin-added', ged.GUI1, self._on_plugin_added),
|
| 132 | 128 |
])
|
| 133 | 129 |
|
| 134 |
- self.window.show_all()
|
|
| 130 |
+ self.show_all()
|
|
| 135 | 131 |
|
| 136 | 132 |
def get_notebook(self):
|
| 137 | 133 |
# Used by plugins
|
| 138 |
- return self.plugins_notebook
|
|
| 134 |
+ return self._ui.plugins_notebook
|
|
| 139 | 135 |
|
| 140 |
- def on_key_press_event(self, widget, event):
|
|
| 136 |
+ def _on_key_press(self, _widget, event):
|
|
| 141 | 137 |
if event.keyval == Gdk.KEY_Escape:
|
| 142 |
- self.window.destroy()
|
|
| 138 |
+ self.destroy()
|
|
| 143 | 139 |
|
| 144 |
- def installed_plugins_treeview_selection_changed(self, treeview_selection):
|
|
| 140 |
+ def _on_destroy(self, *args):
|
|
| 141 |
+ self.unregister_events()
|
|
| 142 |
+ app.plugin_manager.remove_gui_extension_point('plugin_window', self)
|
|
| 143 |
+ |
|
| 144 |
+ def _installed_plugins_treeview_selection_changed(self, treeview_selection):
|
|
| 145 | 145 |
model, iter_ = treeview_selection.get_selected()
|
| 146 | 146 |
if iter_:
|
| 147 | 147 |
plugin = model.get_value(iter_, Column.PLUGIN)
|
| ... | ... | @@ -150,57 +150,62 @@ class PluginsWindow(EventHelper): |
| 150 | 150 |
self._clear_installed_plugin_info()
|
| 151 | 151 |
|
| 152 | 152 |
def _display_installed_plugin_info(self, plugin):
|
| 153 |
- self.plugin_name_label.set_text(plugin.name)
|
|
| 154 |
- self.plugin_version_label.set_text(plugin.version)
|
|
| 155 |
- self.plugin_authors_label.set_text(plugin.authors)
|
|
| 153 |
+ self._ui.plugin_name_label.set_text(plugin.name)
|
|
| 154 |
+ self._ui.plugin_version_label.set_text(plugin.version)
|
|
| 155 |
+ self._ui.plugin_authors_label.set_text(plugin.authors)
|
|
| 156 | 156 |
markup = '<a href="%s">%s</a>' % (plugin.homepage, plugin.homepage)
|
| 157 |
- self.plugin_homepage_linkbutton.set_markup(markup)
|
|
| 157 |
+ self._ui.plugin_homepage_linkbutton.set_markup(markup)
|
|
| 158 | 158 |
|
| 159 | 159 |
if plugin.available_text:
|
| 160 | 160 |
text = _('Warning: %s') % plugin.available_text
|
| 161 |
- self.available_text_label.set_text(text)
|
|
| 162 |
- self.available_text.show()
|
|
| 161 |
+ self._ui.available_text_label.set_text(text)
|
|
| 162 |
+ self._ui.available_text.show()
|
|
| 163 | 163 |
# Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=710888
|
| 164 |
- self.available_text.queue_resize()
|
|
| 164 |
+ self._ui.available_text.queue_resize()
|
|
| 165 | 165 |
else:
|
| 166 |
- self.available_text.hide()
|
|
| 166 |
+ self._ui.available_text.hide()
|
|
| 167 | 167 |
|
| 168 |
- self.plugin_description_textview.set_text(plugin.description)
|
|
| 168 |
+ self._ui.description.set_text(plugin.description)
|
|
| 169 | 169 |
|
| 170 |
- self.uninstall_plugin_button.set_property(
|
|
| 171 |
- 'sensitive', configpaths.get('PLUGINS_USER') in plugin.__path__)
|
|
| 172 |
- self.configure_plugin_button.set_property(
|
|
| 173 |
- 'sensitive', plugin.config_dialog is not None)
|
|
| 170 |
+ self._ui.uninstall_plugin_button.set_sensitive(
|
|
| 171 |
+ configpaths.get('PLUGINS_USER') in plugin.__path__)
|
|
| 172 |
+ self._ui.configure_plugin_button.set_sensitive(
|
|
| 173 |
+ plugin.config_dialog is not None)
|
|
| 174 | 174 |
|
| 175 | 175 |
def _clear_installed_plugin_info(self):
|
| 176 |
- self.plugin_name_label.set_text('')
|
|
| 177 |
- self.plugin_version_label.set_text('')
|
|
| 178 |
- self.plugin_authors_label.set_text('')
|
|
| 179 |
- self.plugin_homepage_linkbutton.set_markup('')
|
|
| 176 |
+ self._ui.plugin_name_label.set_text('')
|
|
| 177 |
+ self._ui.plugin_version_label.set_text('')
|
|
| 178 |
+ self._ui.plugin_authors_label.set_text('')
|
|
| 179 |
+ self._ui.plugin_homepage_linkbutton.set_markup('')
|
|
| 180 | 180 |
|
| 181 |
- self.plugin_description_textview.set_text('')
|
|
| 182 |
- self.uninstall_plugin_button.set_property('sensitive', False)
|
|
| 183 |
- self.configure_plugin_button.set_property('sensitive', False)
|
|
| 181 |
+ self._ui.description.set_text('')
|
|
| 182 |
+ self._ui.uninstall_plugin_button.set_sensitive(False)
|
|
| 183 |
+ self._ui.configure_plugin_button.set_sensitive(False)
|
|
| 184 | 184 |
|
| 185 |
- def fill_installed_plugins_model(self):
|
|
| 185 |
+ def _fill_installed_plugins_model(self):
|
|
| 186 | 186 |
pm = app.plugin_manager
|
| 187 | 187 |
self.installed_plugins_model.clear()
|
| 188 |
- self.installed_plugins_model.set_sort_column_id(1, Gtk.SortType.ASCENDING)
|
|
| 188 |
+ self.installed_plugins_model.set_sort_column_id(1,
|
|
| 189 |
+ Gtk.SortType.ASCENDING)
|
|
| 189 | 190 |
|
| 190 | 191 |
for plugin in pm.plugins:
|
| 191 |
- icon = self.get_plugin_icon(plugin)
|
|
| 192 |
- self.installed_plugins_model.append([plugin, plugin.name,
|
|
| 193 |
- plugin.active and plugin.activatable, plugin.activatable, icon])
|
|
| 194 |
- |
|
| 195 |
- def get_plugin_icon(self, plugin):
|
|
| 192 |
+ icon = self._get_plugin_icon(plugin)
|
|
| 193 |
+ self.installed_plugins_model.append(
|
|
| 194 |
+ [plugin,
|
|
| 195 |
+ plugin.name,
|
|
| 196 |
+ plugin.active and plugin.activatable,
|
|
| 197 |
+ plugin.activatable,
|
|
| 198 |
+ icon])
|
|
| 199 |
+ |
|
| 200 |
+ def _get_plugin_icon(self, plugin):
|
|
| 196 | 201 |
icon_file = os.path.join(plugin.__path__, os.path.split(
|
| 197 |
- plugin.__path__)[1]) + '.png'
|
|
| 202 |
+ plugin.__path__)[1]) + '.png'
|
|
| 198 | 203 |
icon = self.def_icon
|
| 199 | 204 |
if os.path.isfile(icon_file):
|
| 200 | 205 |
icon = GdkPixbuf.Pixbuf.new_from_file_at_size(icon_file, 16, 16)
|
| 201 | 206 |
return icon
|
| 202 | 207 |
|
| 203 |
- def installed_plugins_toggled_cb(self, cell, path):
|
|
| 208 |
+ def _installed_plugin_toggled(self, _cell, path):
|
|
| 204 | 209 |
is_active = self.installed_plugins_model[path][Column.ACTIVE]
|
| 205 | 210 |
plugin = self.installed_plugins_model[path][Column.PLUGIN]
|
| 206 | 211 |
|
| ... | ... | @@ -211,27 +216,21 @@ class PluginsWindow(EventHelper): |
| 211 | 216 |
app.plugin_manager.activate_plugin(plugin)
|
| 212 | 217 |
except GajimPluginActivateException as e:
|
| 213 | 218 |
WarningDialog(_('Plugin failed'), str(e),
|
| 214 |
- transient_for=self.window)
|
|
| 219 |
+ transient_for=self)
|
|
| 215 | 220 |
return
|
| 216 | 221 |
|
| 217 | 222 |
self.installed_plugins_model[path][Column.ACTIVE] = not is_active
|
| 218 | 223 |
|
| 219 |
- def on_plugins_window_destroy(self, widget):
|
|
| 220 |
- '''Close window'''
|
|
| 221 |
- self.unregister_events()
|
|
| 222 |
- app.plugin_manager.remove_gui_extension_point('plugin_window', self)
|
|
| 223 |
- del app.interface.instances['plugins']
|
|
| 224 |
- |
|
| 225 |
- def on_configure_plugin_button_clicked(self, widget):
|
|
| 226 |
- selection = self.installed_plugins_treeview.get_selection()
|
|
| 224 |
+ def _on_configure_plugin(self, _widget):
|
|
| 225 |
+ selection = self._ui.installed_plugins_treeview.get_selection()
|
|
| 227 | 226 |
model, iter_ = selection.get_selected()
|
| 228 | 227 |
if iter_:
|
| 229 | 228 |
plugin = model.get_value(iter_, Column.PLUGIN)
|
| 230 | 229 |
|
| 231 | 230 |
if isinstance(plugin.config_dialog, GajimPluginConfigDialog):
|
| 232 |
- plugin.config_dialog.run(self.window)
|
|
| 231 |
+ plugin.config_dialog.run(self)
|
|
| 233 | 232 |
else:
|
| 234 |
- plugin.config_dialog(self.window)
|
|
| 233 |
+ plugin.config_dialog(self)
|
|
| 235 | 234 |
|
| 236 | 235 |
else:
|
| 237 | 236 |
# No plugin selected. this should never be reached. As configure
|
| ... | ... | @@ -239,8 +238,8 @@ class PluginsWindow(EventHelper): |
| 239 | 238 |
# XXX: maybe throw exception here?
|
| 240 | 239 |
pass
|
| 241 | 240 |
|
| 242 |
- def on_uninstall_plugin_button_clicked(self, widget):
|
|
| 243 |
- selection = self.installed_plugins_treeview.get_selection()
|
|
| 241 |
+ def _on_uninstall_plugin(self, _widget):
|
|
| 242 |
+ selection = self._ui.installed_plugins_treeview.get_selection()
|
|
| 244 | 243 |
model, iter_ = selection.get_selected()
|
| 245 | 244 |
if iter_:
|
| 246 | 245 |
plugin = model.get_value(iter_, Column.PLUGIN)
|
| ... | ... | @@ -248,7 +247,7 @@ class PluginsWindow(EventHelper): |
| 248 | 247 |
app.plugin_manager.uninstall_plugin(plugin)
|
| 249 | 248 |
except PluginsystemError as e:
|
| 250 | 249 |
WarningDialog(_('Unable to properly remove the plugin'),
|
| 251 |
- str(e), self.window)
|
|
| 250 |
+ str(e), self)
|
|
| 252 | 251 |
return
|
| 253 | 252 |
|
| 254 | 253 |
def _on_plugin_removed(self, event):
|
| ... | ... | @@ -258,21 +257,21 @@ class PluginsWindow(EventHelper): |
| 258 | 257 |
break
|
| 259 | 258 |
|
| 260 | 259 |
def _on_plugin_added(self, event):
|
| 261 |
- icon = self.get_plugin_icon(event.plugin)
|
|
| 260 |
+ icon = self._get_plugin_icon(event.plugin)
|
|
| 262 | 261 |
self.installed_plugins_model.append([event.plugin,
|
| 263 | 262 |
event.plugin.name,
|
| 264 | 263 |
False,
|
| 265 | 264 |
event.plugin.activatable,
|
| 266 | 265 |
icon])
|
| 267 | 266 |
|
| 268 |
- def on_install_plugin_button_clicked(self, widget):
|
|
| 267 |
+ def _on_install_plugin(self, _widget):
|
|
| 269 | 268 |
if app.is_flatpak():
|
| 270 | 269 |
open_uri('https://dev.gajim.org/gajim/gajim/wikis/help/flathub')
|
| 271 | 270 |
return
|
| 272 | 271 |
|
| 273 |
- def show_warn_dialog():
|
|
| 272 |
+ def _show_warn_dialog():
|
|
| 274 | 273 |
text = _('Archive is malformed')
|
| 275 |
- dialog = WarningDialog(text, '', transient_for=self.window)
|
|
| 274 |
+ dialog = WarningDialog(text, '', transient_for=self)
|
|
| 276 | 275 |
dialog.set_modal(False)
|
| 277 | 276 |
dialog.popup()
|
| 278 | 277 |
|
| ... | ... | @@ -281,7 +280,7 @@ class PluginsWindow(EventHelper): |
| 281 | 280 |
plugin = app.plugin_manager.install_from_zip(zip_filename,
|
| 282 | 281 |
True)
|
| 283 | 282 |
if not plugin:
|
| 284 |
- show_warn_dialog()
|
|
| 283 |
+ _show_warn_dialog()
|
|
| 285 | 284 |
return
|
| 286 | 285 |
|
| 287 | 286 |
NewConfirmationDialog(
|
| ... | ... | @@ -292,7 +291,7 @@ class PluginsWindow(EventHelper): |
| 292 | 291 |
DialogButton.make('Remove',
|
| 293 | 292 |
text=_('_Overwrite'),
|
| 294 | 293 |
callback=_on_yes)],
|
| 295 |
- transient_for=self.window).show()
|
|
| 294 |
+ transient_for=self).show()
|
|
| 296 | 295 |
|
| 297 | 296 |
def _try_install(zip_filename):
|
| 298 | 297 |
try:
|
| ... | ... | @@ -303,19 +302,19 @@ class PluginsWindow(EventHelper): |
| 303 | 302 |
_on_plugin_exists(zip_filename)
|
| 304 | 303 |
return
|
| 305 | 304 |
|
| 306 |
- WarningDialog(error_text, '"%s"' % zip_filename, self.window)
|
|
| 305 |
+ WarningDialog(error_text, '"%s"' % zip_filename, self)
|
|
| 307 | 306 |
return
|
| 308 | 307 |
if not plugin:
|
| 309 |
- show_warn_dialog()
|
|
| 308 |
+ _show_warn_dialog()
|
|
| 310 | 309 |
return
|
| 311 | 310 |
|
| 312 |
- ArchiveChooserDialog(_try_install, transient_for=self.window)
|
|
| 311 |
+ ArchiveChooserDialog(_try_install, transient_for=self)
|
|
| 313 | 312 |
|
| 314 | 313 |
|
| 315 | 314 |
class GajimPluginConfigDialog(Gtk.Dialog):
|
| 316 | 315 |
def __init__(self, plugin, **kwargs):
|
| 317 |
- Gtk.Dialog.__init__(self, title='%s %s'%(plugin.name,
|
|
| 318 |
- _('Configuration')), **kwargs)
|
|
| 316 |
+ Gtk.Dialog.__init__(self, title='%s %s' % (plugin.name,
|
|
| 317 |
+ _('Configuration')), **kwargs)
|
|
| 319 | 318 |
self.plugin = plugin
|
| 320 | 319 |
button = self.add_button('gtk-close', Gtk.ResponseType.CLOSE)
|
| 321 | 320 |
button.connect('clicked', self.on_close_button_clicked)
|