Skip to content
Permalink
Browse files

Patch #2422 applied

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13086 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty
borysiasty committed Mar 19, 2010
1 parent 0a4f8f4 commit d98b6aed1bed8990ca1d3f7cf0d59131cef929f0
Showing with 18 additions and 12 deletions.
  1. +2 −0 python/plugins/plugin_installer/installer_data.py
  2. +16 −12 python/plugins/plugin_installer/installer_gui.py
@@ -58,10 +58,12 @@
else:
QGIS_MAJOR_VER = 0
QGIS_14 = False
QGIS_15 = False
except:
QGIS_VER = QGis.QGIS_VERSION
QGIS_MAJOR_VER = 1
QGIS_14 = (QGIS_VER[2] > 3)
QGIS_15 = (QGIS_VER[2] > 4)



@@ -26,7 +26,8 @@
from installer_data import *

try:
from qgis.utils import startPlugin, unloadPlugin
from qgis.utils import startPlugin, unloadPlugin, loadPlugin # QGIS >= 1.4
from qgis.utils import updateAvailablePlugins # QGIS >= 1.5
except Exception:
pass

@@ -592,28 +593,31 @@ def installPlugin(self):
plugins.rebuild()
QApplication.restoreOverrideCursor()
else:
try:
exec ("sys.path_importer_cache.clear()")
exec ("import %s" % plugin["localdir"])
exec ("reload (%s)" % plugin["localdir"])
except:
pass
if QGIS_14:
if QGIS_15: # update the list of plugins in plugin handling routines
updateAvailablePlugins()
# try to load the plugin
loadPlugin(plugin["localdir"])
else: # QGIS < 1.4
try:
exec ("sys.path_importer_cache.clear()")
exec ("import %s" % plugin["localdir"])
exec ("reload (%s)" % plugin["localdir"])
except:
pass
plugins.getAllInstalled()
plugins.rebuild()
plugin = plugins.all()[key]
if not plugin["error"]:
if previousStatus in ["not installed", "new"]:
if QGIS_14:
if QGIS_14: # plugins can be started in python from QGIS >= 1.4
infoString = (self.tr("Plugin installed successfully"), self.tr("Plugin installed successfully"))
settings = QSettings()
settings.setValue("/PythonPlugins/"+plugin["localdir"], QVariant(True))
startPlugin(plugin["localdir"])
else: infoString = (self.tr("Plugin installed successfully"), self.tr("Python plugin installed.\nNow you need to enable it in Plugin Manager."))
else:
infoString = (self.tr("Plugin reinstalled successfully"), self.tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it."))
try:
startPlugin(plugin["localdir"])
except:
pass
else:
if plugin["error"] == "incompatible":
message = self.tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")

0 comments on commit d98b6ae

Please sign in to comment.
You can’t perform that action at this time.