rename ftp manager plugin to plugin installer
This commit is contained in:
parent
3de3987f47
commit
e7deda826e
5 changed files with 21 additions and 24 deletions
|
@ -1 +0,0 @@
|
||||||
from ftp_manager import FtpManager
|
|
1
plugins/plugin_installer/__init__.py
Normal file
1
plugins/plugin_installer/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from plugin_installer import PluginInstaller
|
|
@ -1,7 +1,7 @@
|
||||||
[info]
|
[info]
|
||||||
name: Ftp Manager
|
name: Plugin Installer
|
||||||
short_name: ftp_manager
|
short_name: plugin_installer
|
||||||
version: 0.3
|
version: 0.3
|
||||||
description: Install and upgrade plugins from ftp
|
description: Install and upgrade plugins from ftp
|
||||||
authors: Denis Fomin <fominde@gmail.com>
|
authors: Denis Fomin <fominde@gmail.com>
|
||||||
homepage: http://trac-plugins.gajim.org/wiki/
|
homepage: http://www.gajim.org/
|
|
@ -1,8 +1,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
## plugins/ftp_manager/ftp_manager.py
|
## plugins/plugin_installer/plugin_installer.py
|
||||||
##
|
##
|
||||||
## Copyright (C) 2010 Denis Fomin <fominde AT gmail.com>
|
## Copyright (C) 2010-2011 Denis Fomin <fominde AT gmail.com>
|
||||||
|
## Copyright (C) 2011 Yann Leboulanger <asterix AT lagaule.org>
|
||||||
##
|
##
|
||||||
## This file is part of Gajim.
|
## This file is part of Gajim.
|
||||||
##
|
##
|
||||||
|
@ -37,14 +38,14 @@ from plugins.gui import GajimPluginConfigDialog
|
||||||
from common import i18n
|
from common import i18n
|
||||||
|
|
||||||
|
|
||||||
class FtpManager(GajimPlugin):
|
class PluginInstaller(GajimPlugin):
|
||||||
|
|
||||||
@log_calls('FtpManagerPlugin')
|
@log_calls('PluginInstallerPlugin')
|
||||||
def init(self):
|
def init(self):
|
||||||
self.config_dialog = FtpManagerPluginConfigDialog(self)
|
self.config_dialog = PluginInstallerPluginConfigDialog(self)
|
||||||
self.config_default_values = {'ftp_server': ('ftp.gajim.org', '')}
|
self.config_default_values = {'ftp_server': ('ftp.gajim.org', '')}
|
||||||
|
|
||||||
@log_calls('FtpManagerPlugin')
|
@log_calls('PluginInstallerPlugin')
|
||||||
def activate(self):
|
def activate(self):
|
||||||
self.pl_menuitem = gajim.interface.roster.xml.get_object(
|
self.pl_menuitem = gajim.interface.roster.xml.get_object(
|
||||||
'plugins_menuitem')
|
'plugins_menuitem')
|
||||||
|
@ -52,7 +53,7 @@ class FtpManager(GajimPlugin):
|
||||||
if 'plugins' in gajim.interface.instances:
|
if 'plugins' in gajim.interface.instances:
|
||||||
self.on_activate(None)
|
self.on_activate(None)
|
||||||
|
|
||||||
@log_calls('FtpManagerPlugin')
|
@log_calls('PluginInstallerPlugin')
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
self.pl_menuitem.disconnect(self.id_)
|
self.pl_menuitem.disconnect(self.id_)
|
||||||
if hasattr(self, 'page_num'):
|
if hasattr(self, 'page_num'):
|
||||||
|
@ -71,15 +72,13 @@ class FtpManager(GajimPlugin):
|
||||||
self.on_notebook_switch_page)
|
self.on_notebook_switch_page)
|
||||||
self.window = gajim.interface.instances['plugins'].window
|
self.window = gajim.interface.instances['plugins'].window
|
||||||
self.window.connect('destroy', self.on_win_destroy)
|
self.window.connect('destroy', self.on_win_destroy)
|
||||||
self.GTK_BUILDER_FILE_PATH = self.local_file_path(
|
self.GTK_BUILDER_FILE_PATH = self.local_file_path('config_dialog.ui')
|
||||||
'config_dialog.ui')
|
|
||||||
self.xml = gtk.Builder()
|
self.xml = gtk.Builder()
|
||||||
self.xml.set_translation_domain(i18n.APP)
|
self.xml.set_translation_domain(i18n.APP)
|
||||||
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH,
|
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, ['hpaned2'])
|
||||||
['hpaned2'])
|
|
||||||
hpaned = self.xml.get_object('hpaned2')
|
hpaned = self.xml.get_object('hpaned2')
|
||||||
self.page_num = self.notebook.append_page(hpaned,
|
self.page_num = self.notebook.append_page(hpaned,
|
||||||
gtk.Label('Ftp Manager'))
|
gtk.Label('Available'))
|
||||||
|
|
||||||
widgets_to_extract = ('plugin_name_label1',
|
widgets_to_extract = ('plugin_name_label1',
|
||||||
'available_treeview', 'progressbar', 'inslall_upgrade_button',
|
'available_treeview', 'progressbar', 'inslall_upgrade_button',
|
||||||
|
@ -209,7 +208,7 @@ class FtpManager(GajimPlugin):
|
||||||
continue
|
continue
|
||||||
if is_active and plugin.name != self.name:
|
if is_active and plugin.name != self.name:
|
||||||
gobject.idle_add(gajim.plugin_manager.activate_plugin, plugin)
|
gobject.idle_add(gajim.plugin_manager.activate_plugin, plugin)
|
||||||
if plugin.name != 'Ftp Manager':
|
if plugin.name != 'Plugin Installer':
|
||||||
self.installed_plugins_model.append([plugin, plugin.name,
|
self.installed_plugins_model.append([plugin, plugin.name,
|
||||||
is_active])
|
is_active])
|
||||||
dialog = HigDialog(None, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
|
dialog = HigDialog(None, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
|
||||||
|
@ -379,8 +378,7 @@ class Ftp(threading.Thread):
|
||||||
def download_plugin(self):
|
def download_plugin(self):
|
||||||
gobject.idle_add(self.progressbar.show)
|
gobject.idle_add(self.progressbar.show)
|
||||||
self.pulse = gobject.timeout_add(150, self.progressbar_pulse)
|
self.pulse = gobject.timeout_add(150, self.progressbar_pulse)
|
||||||
gobject.idle_add(self.progressbar.set_text,
|
gobject.idle_add(self.progressbar.set_text, 'Create a list of files')
|
||||||
'Create a list of files')
|
|
||||||
for remote_dir in self.remote_dirs:
|
for remote_dir in self.remote_dirs:
|
||||||
|
|
||||||
def nlstr(dir_, subdir=None):
|
def nlstr(dir_, subdir=None):
|
||||||
|
@ -438,13 +436,12 @@ class Ftp(threading.Thread):
|
||||||
gobject.source_remove(self.pulse)
|
gobject.source_remove(self.pulse)
|
||||||
|
|
||||||
|
|
||||||
class FtpManagerPluginConfigDialog(GajimPluginConfigDialog):
|
class PluginInstallerPluginConfigDialog(GajimPluginConfigDialog):
|
||||||
def init(self):
|
def init(self):
|
||||||
self.GTK_BUILDER_FILE_PATH = self.plugin.local_file_path(
|
self.GTK_BUILDER_FILE_PATH = self.plugin.local_file_path(
|
||||||
'config_dialog.ui')
|
'config_dialog.ui')
|
||||||
self.xml = gtk.Builder()
|
self.xml = gtk.Builder()
|
||||||
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH,
|
self.xml.add_objects_from_file(self.GTK_BUILDER_FILE_PATH, ['hbox111'])
|
||||||
['hbox111'])
|
|
||||||
hbox = self.xml.get_object('hbox111')
|
hbox = self.xml.get_object('hbox111')
|
||||||
self.child.pack_start(hbox)
|
self.child.pack_start(hbox)
|
||||||
|
|
Loading…
Add table
Reference in a new issue