Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
78
Issues
78
List
Boards
Labels
Milestones
Merge Requests
31
Merge Requests
31
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim-plugins
Commits
d7884afc
Commit
d7884afc
authored
Oct 13, 2018
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[installer] Use get_builder()
parent
3e2abc58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
58 deletions
+42
-58
plugin_installer/config.ui
plugin_installer/config.ui
+25
-0
plugin_installer/installer.ui
plugin_installer/installer.ui
+0
-31
plugin_installer/plugin_installer.py
plugin_installer/plugin_installer.py
+17
-27
No files found.
plugin_installer/config.ui
0 → 100644
View file @
d7884afc
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires
lib=
"gtk+"
version=
"3.20"
/>
<object
class=
"GtkGrid"
id=
"config_grid"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin_top"
>
12
</property>
<property
name=
"margin_bottom"
>
12
</property>
<child>
<object
class=
"GtkCheckButton"
id=
"check_update"
>
<property
name=
"label"
translatable=
"yes"
>
Check update after start
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"focus_on_click"
>
False
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"draw_indicator"
>
True
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
</object>
</interface>
plugin_installer/
config_dialog
.ui
→
plugin_installer/
installer
.ui
View file @
d7884afc
...
...
@@ -2,37 +2,6 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires
lib=
"gtk+"
version=
"3.20"
/>
<object
class=
"GtkWindow"
id=
"ConfigWindow"
>
<property
name=
"can_focus"
>
False
</property>
<child>
<placeholder/>
</child>
<child>
<object
class=
"GtkGrid"
id=
"config_grid"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin_left"
>
12
</property>
<property
name=
"margin_right"
>
12
</property>
<property
name=
"margin_top"
>
12
</property>
<property
name=
"margin_bottom"
>
12
</property>
<child>
<object
class=
"GtkCheckButton"
id=
"check_update"
>
<property
name=
"label"
translatable=
"yes"
>
Check update after start
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"focus_on_click"
>
False
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"draw_indicator"
>
True
</property>
<signal
name=
"toggled"
handler=
"on_check_update_toggled"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
</object>
</child>
</object>
<object
class=
"GtkListStore"
id=
"plugin_store"
>
<columns>
<!-- column-name icon -->
...
...
plugin_installer/plugin_installer.py
View file @
d7884afc
...
...
@@ -36,22 +36,18 @@ from urllib.request import urlopen
from
gi.repository
import
Gtk
from
gi.repository
import
GdkPixbuf
from
gi.repository
import
Pango
from
gi.repository
import
GLib
try
:
from
common
import
gajim
as
app
from
plugins
import
GajimPlugin
from
plugins.gui
import
GajimPluginConfigDialog
from
dialogs
import
WarningDialog
,
HigDialog
,
YesNoDialog
from
gtkgui_helpers
import
get_action
except
ImportError
:
from
gajim.common
import
app
from
gajim.common
import
configpaths
from
gajim.plugins
import
GajimPlugin
from
gajim.plugins.gui
import
GajimPluginConfigDialog
from
gajim.dialogs
import
WarningDialog
,
HigDialog
,
YesNoDialog
from
gajim.gtkgui_helpers
import
get_action
from
gajim.common
import
app
from
gajim.common
import
configpaths
from
gajim.plugins
import
GajimPlugin
from
gajim.plugins.gui
import
GajimPluginConfigDialog
from
gajim.plugins.plugins_i18n
import
_
from
gajim.plugins.helpers
import
get_builder
from
gajim.gtk.dialogs
import
WarningDialog
from
gajim.gtk.dialogs
import
HigDialog
from
gajim.gtk.dialogs
import
YesNoDialog
from
gajim.gtkgui_helpers
import
get_action
log
=
logging
.
getLogger
(
'gajim.plugin_system.plugin_installer'
)
...
...
@@ -176,11 +172,9 @@ class PluginInstaller(GajimPlugin):
self
.
window
=
plugin_win
.
window
id_
=
self
.
window
.
connect
(
'destroy'
,
self
.
on_win_destroy
)
self
.
connected_ids
[
id_
]
=
self
.
window
self
.
Gtk_BUILDER_FILE_PATH
=
self
.
local_file_path
(
'config_dialog.ui'
)
self
.
xml
=
Gtk
.
Builder
()
self
.
xml
.
set_translation_domain
(
'gajim_plugins'
)
self
.
xml
.
add_objects_from_file
(
self
.
Gtk_BUILDER_FILE_PATH
,
[
'refresh'
,
'available_plugins_box'
,
'plugin_store'
])
path
=
self
.
local_file_path
(
'installer.ui'
)
self
.
xml
=
get_builder
(
path
,
widgets
=
[
'refresh'
,
'available_plugins_box'
,
'plugin_store'
])
widgets_to_extract
=
(
'available_plugins_box'
,
'install_plugin_button'
,
'plugin_name_label'
,
...
...
@@ -511,18 +505,14 @@ class DownloadAsync(threading.Thread):
class
PluginInstallerPluginConfigDialog
(
GajimPluginConfigDialog
):
def
init
(
self
):
glade_file_path
=
self
.
plugin
.
local_file_path
(
'config_dialog.ui'
)
self
.
xml
=
Gtk
.
Builder
()
self
.
xml
.
set_translation_domain
(
'gajim_plugins'
)
self
.
xml
.
add_objects_from_file
(
glade_file_path
,
[
'config_grid'
])
grid
=
self
.
xml
.
get_object
(
'config_grid'
)
self
.
get_child
()
.
pack_start
(
grid
,
True
,
True
,
0
)
glade_file_path
=
self
.
plugin
.
local_file_path
(
'config.ui'
)
self
.
xml
=
get_builder
(
glade_file_path
)
self
.
get_child
()
.
pack_start
(
self
.
xml
.
config_grid
,
True
,
True
,
0
)
self
.
xml
.
connect_signals
(
self
)
def
on_run
(
self
):
self
.
xml
.
get_object
(
'check_update'
)
.
set_active
(
self
.
plugin
.
config
[
'check_update'
])
self
.
xml
.
check_update
.
set_active
(
self
.
plugin
.
config
[
'check_update'
])
def
on_check_update_toggled
(
self
,
widget
):
self
.
plugin
.
config
[
'check_update'
]
=
widget
.
get_active
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment