mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Updates for Borys and added some missing files
git-svn-id: http://svn.osgeo.org/qgis/trunk@9310 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
9b5849d65b
commit
0715a13804
@ -2,30 +2,33 @@
|
|||||||
# file or the ui change
|
# file or the ui change
|
||||||
SET(INSTALLER_FILES
|
SET(INSTALLER_FILES
|
||||||
dialog.py
|
dialog.py
|
||||||
|
fetchingbase.py
|
||||||
|
fetchingbase.ui
|
||||||
|
guibase.py
|
||||||
|
guibase.ui
|
||||||
gui.py
|
gui.py
|
||||||
icon.xpm
|
icon.xpm
|
||||||
__init__.py
|
__init__.py
|
||||||
installer_plugin.py
|
|
||||||
qgis_plugins.py
|
|
||||||
resources.py
|
|
||||||
repository_ui.py
|
|
||||||
repository_dialog.py
|
|
||||||
qgis-icon.png
|
|
||||||
installingbase.ui
|
|
||||||
fetchingbase.py
|
|
||||||
guibase.py
|
|
||||||
repositorybase.py
|
|
||||||
plugin_installer.png
|
|
||||||
unzip.py
|
|
||||||
installer_gui.py
|
|
||||||
installingbase.py
|
|
||||||
pluginerrorbase.ui
|
|
||||||
installer_data.py
|
installer_data.py
|
||||||
repoConnected.png
|
installer_gui.py
|
||||||
guibase.ui
|
installer_plugin.py
|
||||||
|
installingbase.py
|
||||||
|
installingbase.ui
|
||||||
pluginerrorbase.py
|
pluginerrorbase.py
|
||||||
repositorybase.ui
|
pluginerrorbase.ui
|
||||||
resources_rc.py
|
plugin_installer.png
|
||||||
|
PluginInstaller.png
|
||||||
|
qgis-icon.png
|
||||||
|
qgis_plugins.py
|
||||||
|
repoConnected.png
|
||||||
repoDisabled.png
|
repoDisabled.png
|
||||||
|
repositorybase.py
|
||||||
|
repositorybase.ui
|
||||||
|
repository_dialog.py
|
||||||
|
repository_ui.py
|
||||||
|
repoUnavailable.png
|
||||||
|
resources.py
|
||||||
|
resources_rc.py
|
||||||
|
unzip.py
|
||||||
)
|
)
|
||||||
INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/plugin_installer)
|
INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/plugin_installer)
|
||||||
|
BIN
python/plugins/plugin_installer/PluginInstaller.png
Normal file
BIN
python/plugins/plugin_installer/PluginInstaller.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
@ -20,7 +20,7 @@ def author_name():
|
|||||||
return "perrygeo, borysiasty"
|
return "perrygeo, borysiasty"
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
return "Version 0.05.6"
|
return "Version 0.06.1"
|
||||||
|
|
||||||
def classFactory(iface):
|
def classFactory(iface):
|
||||||
from installer_plugin import InstallerPlugin
|
from installer_plugin import InstallerPlugin
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'fetchingbase.ui'
|
# Form implementation generated from reading ui file 'fetchingbase.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Sep 7 16:22:19 2008
|
# Created: Fri Sep 12 19:21:37 2008
|
||||||
# by: PyQt4 UI code generator 4.3
|
# by: PyQt4 UI code generator 4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
200
python/plugins/plugin_installer/fetchingbase.ui
Normal file
200
python/plugins/plugin_installer/fetchingbase.ui
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
<ui version="4.0" >
|
||||||
|
<author>Matthew Perry, Borys Jurgiel</author>
|
||||||
|
<class>QgsPluginInstallerFetchingDialog</class>
|
||||||
|
<widget class="QDialog" name="QgsPluginInstallerFetchingDialog" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>521</width>
|
||||||
|
<height>332</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle" >
|
||||||
|
<string>Fetching repositories</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon" >
|
||||||
|
<iconset resource="resources.qrc" >:/plugins/installer/qgis-icon.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>249</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" >
|
||||||
|
<widget class="QLabel" name="label1" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Overall progress:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
|
<widget class="QProgressBar" name="progressBar" >
|
||||||
|
<property name="value" >
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignHCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="textDirection" >
|
||||||
|
<enum>QProgressBar::TopToBottom</enum>
|
||||||
|
</property>
|
||||||
|
<property name="format" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>248</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" >
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>27</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="buttonSkip" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize" >
|
||||||
|
<size>
|
||||||
|
<width>180</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy" >
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Abort fetching</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="default" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="flat" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>140</width>
|
||||||
|
<height>27</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QTreeWidget" name="treeWidget" >
|
||||||
|
<property name="enabled" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy" >
|
||||||
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
|
</property>
|
||||||
|
<property name="showDropIndicator" stdset="0" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode" >
|
||||||
|
<enum>QAbstractItemView::NoSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollMode" >
|
||||||
|
<enum>QAbstractItemView::ScrollPerItem</enum>
|
||||||
|
</property>
|
||||||
|
<property name="rootIsDecorated" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="itemsExpandable" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text" >
|
||||||
|
<string>Repository</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text" >
|
||||||
|
<string>State</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="resources.qrc" />
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonSkip</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>QgsPluginInstallerFetchingDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel" >
|
||||||
|
<x>350</x>
|
||||||
|
<y>321</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel" >
|
||||||
|
<x>250</x>
|
||||||
|
<y>76</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'guibase.ui'
|
# Form implementation generated from reading ui file 'guibase.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Sep 7 21:28:01 2008
|
# Created: Fri Sep 12 19:21:37 2008
|
||||||
# by: PyQt4 UI code generator 4.3
|
# by: PyQt4 UI code generator 4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
@ -229,7 +229,6 @@ class Repositories(QObject):
|
|||||||
|
|
||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def xmlDownloaded(self,nr,state):
|
def xmlDownloaded(self,nr,state):
|
||||||
#print reposName, nr, state
|
|
||||||
if not self.httpId.has_key(nr):
|
if not self.httpId.has_key(nr):
|
||||||
return
|
return
|
||||||
reposName = self.httpId[nr]
|
reposName = self.httpId[nr]
|
||||||
@ -296,8 +295,8 @@ class Plugins(QObject):
|
|||||||
|
|
||||||
|
|
||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def firstByName(self, name):
|
def keyByUrl(self, name):
|
||||||
plugins = [i for i in self.mPlugins if self.mPlugins[i]["name"] == name]
|
plugins = [i for i in self.mPlugins if self.mPlugins[i]["url"] == name]
|
||||||
if plugins:
|
if plugins:
|
||||||
return plugins[0]
|
return plugins[0]
|
||||||
return None
|
return None
|
||||||
@ -420,6 +419,11 @@ class Plugins(QObject):
|
|||||||
self.mPlugins[key] = plugin # add the plugin if not present yet or if is newer than existing one
|
self.mPlugins[key] = plugin # add the plugin if not present yet or if is newer than existing one
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------- #
|
||||||
|
def remove(self, key):
|
||||||
|
del self.mPlugins[key]
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def updatePlugin(self, key, readOnly):
|
def updatePlugin(self, key, readOnly):
|
||||||
try:
|
try:
|
||||||
@ -452,6 +456,11 @@ class Plugins(QObject):
|
|||||||
desc = ""
|
desc = ""
|
||||||
auth = ""
|
auth = ""
|
||||||
homepage = ""
|
homepage = ""
|
||||||
|
if readOnly:
|
||||||
|
path = QgsApplication.pkgDataPath()
|
||||||
|
else:
|
||||||
|
path = QgsApplication.qgisSettingsDirPath()
|
||||||
|
path = QDir.cleanPath(unicode(path,"utf-8") + "python/plugins/" + key)
|
||||||
normVer = self.normalizeVersion(QString(ver))
|
normVer = self.normalizeVersion(QString(ver))
|
||||||
plugin = {
|
plugin = {
|
||||||
"name" : nam,
|
"name" : nam,
|
||||||
@ -461,7 +470,7 @@ class Plugins(QObject):
|
|||||||
"desc_repo" : "",
|
"desc_repo" : "",
|
||||||
"author" : auth,
|
"author" : auth,
|
||||||
"homepage" : homepage,
|
"homepage" : homepage,
|
||||||
"url" : "",
|
"url" : path,
|
||||||
"filename" : "",
|
"filename" : "",
|
||||||
"status" : stat,
|
"status" : stat,
|
||||||
"repository" : "",
|
"repository" : "",
|
||||||
@ -478,10 +487,6 @@ class Plugins(QObject):
|
|||||||
self.mPlugins[key]["name"] = plugin["name"] # local name has higher priority, except invalid plugins
|
self.mPlugins[key]["name"] = plugin["name"] # local name has higher priority, except invalid plugins
|
||||||
self.mPlugins[key]["version_inst"] = plugin["version_inst"]
|
self.mPlugins[key]["version_inst"] = plugin["version_inst"]
|
||||||
self.mPlugins[key]["desc_local"] = plugin["desc_local"]
|
self.mPlugins[key]["desc_local"] = plugin["desc_local"]
|
||||||
if plugin["author"]:
|
|
||||||
self.mPlugins[key]["author"] = plugin["author"] #local author name has higher priority, if exists
|
|
||||||
if plugin["homepage"]:
|
|
||||||
self.mPlugins[key]["homepage"] = plugin["homepage"] # local homepage adress has higher priority, if exists
|
|
||||||
# set status
|
# set status
|
||||||
#
|
#
|
||||||
# installed available status
|
# installed available status
|
||||||
@ -509,7 +514,6 @@ class Plugins(QObject):
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def getAllInstalled(self):
|
def getAllInstalled(self):
|
||||||
""" update the mPlugins dict with alredy installed plugins """
|
""" update the mPlugins dict with alredy installed plugins """
|
||||||
#print "getting list of installed plugins"
|
|
||||||
# first, try to add the read-only plugins...
|
# first, try to add the read-only plugins...
|
||||||
try:
|
try:
|
||||||
pluginDir = QDir.cleanPath(unicode(QgsApplication.pkgDataPath(),'utf-8') + "/python/plugins")
|
pluginDir = QDir.cleanPath(unicode(QgsApplication.pkgDataPath(),'utf-8') + "/python/plugins")
|
||||||
@ -537,7 +541,6 @@ class Plugins(QObject):
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def markNews(self):
|
def markNews(self):
|
||||||
""" mark all new plugins as new """
|
""" mark all new plugins as new """
|
||||||
#print "marking the new plugins"
|
|
||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
|
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
|
||||||
if len(seenPlugins) > 0:
|
if len(seenPlugins) > 0:
|
||||||
@ -549,7 +552,6 @@ class Plugins(QObject):
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def updateSeenPluginsList(self):
|
def updateSeenPluginsList(self):
|
||||||
""" update the list of all seen plugins """
|
""" update the list of all seen plugins """
|
||||||
#print "updating the list of seen plugins"
|
|
||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
|
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
|
||||||
for i in self.mPlugins.keys():
|
for i in self.mPlugins.keys():
|
||||||
|
@ -15,7 +15,7 @@ Copyright (C) 2008 Borys Jurgiel
|
|||||||
from PyQt4.QtCore import *
|
from PyQt4.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
from qgis.core import QgsApplication, QgsContextHelp
|
from qgis.core import QgsApplication, QgsContextHelp
|
||||||
import sys
|
import sys, time
|
||||||
from fetchingbase import Ui_QgsPluginInstallerFetchingDialog
|
from fetchingbase import Ui_QgsPluginInstallerFetchingDialog
|
||||||
from installingbase import Ui_QgsPluginInstallerInstallingDialog
|
from installingbase import Ui_QgsPluginInstallerInstallingDialog
|
||||||
from repositorybase import Ui_QgsPluginInstallerRepositoryDetailsDialog
|
from repositorybase import Ui_QgsPluginInstallerRepositoryDetailsDialog
|
||||||
@ -24,6 +24,7 @@ from guibase import Ui_QgsPluginInstallerDialog
|
|||||||
from installer_data import *
|
from installer_data import *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# --- common functions ------------------------------------------------------------------- #
|
# --- common functions ------------------------------------------------------------------- #
|
||||||
def removeDir(path):
|
def removeDir(path):
|
||||||
result = QString()
|
result = QString()
|
||||||
@ -44,11 +45,15 @@ def removeDir(path):
|
|||||||
iterator = QDirIterator(path, fltr, QDirIterator.Subdirectories)
|
iterator = QDirIterator(path, fltr, QDirIterator.Subdirectories)
|
||||||
while iterator.hasNext():
|
while iterator.hasNext():
|
||||||
item = iterator.next()
|
item = iterator.next()
|
||||||
if QDir(item).rmpath("."):
|
if QDir().rmpath(item):
|
||||||
#print " Directory removing successfull: %s" % item
|
#print " Directory removing successfull: %s" % item
|
||||||
pass
|
pass
|
||||||
if QFile(path).exists():
|
if QFile(path).exists():
|
||||||
result = QCoreApplication.translate("QgsPluginInstaller","Failed to remove directory")+" "+path+" \n"+QCoreApplication.translate("QgsPluginInstaller","Check permissions or remove it manually")
|
result = QCoreApplication.translate("QgsPluginInstaller","Failed to remove directory")+" "+path+" \n"+QCoreApplication.translate("QgsPluginInstaller","Check permissions or remove it manually")
|
||||||
|
# restore plugin directory if removed by QDir().rmpath()
|
||||||
|
pluginDir = unicode(QFileInfo(QgsApplication.qgisUserDbFilePath()).path()+"/python/plugins")
|
||||||
|
if not QDir(pluginDir).exists():
|
||||||
|
QDir().mkpath(pluginDir)
|
||||||
return result
|
return result
|
||||||
# --- /common functions ------------------------------------------------------------------ #
|
# --- /common functions ------------------------------------------------------------------ #
|
||||||
|
|
||||||
@ -189,23 +194,18 @@ class QgsPluginInstallerInstallingDialog(QDialog, Ui_QgsPluginInstallerInstallin
|
|||||||
|
|
||||||
# make sure that the parent directory exists
|
# make sure that the parent directory exists
|
||||||
if not QDir(pluginDir).exists():
|
if not QDir(pluginDir).exists():
|
||||||
QDir(pluginDir).mkpath(".")
|
QDir().mkpath(pluginDir)
|
||||||
|
|
||||||
#print "Extracting to plugin directory (%s)" % pluginDir
|
#print "Extracting to plugin directory (%s)" % pluginDir
|
||||||
#try:
|
try:
|
||||||
|
|
||||||
|
|
||||||
un = unzip()
|
un = unzip()
|
||||||
un.extract(tmpPath, pluginDir) # test extract. If fails, then exception will be raised and no removing occurs
|
un.extract(tmpPath, pluginDir) # test extract. If fails, then exception will be raised and no removing occurs
|
||||||
#print "Removing old plugin files if exist"
|
#print "Removing old plugin files if exist"
|
||||||
removeDir(QDir.cleanPath(pluginDir+"/"+self.plugin["localdir"])) # remove old plugin if exists
|
removeDir(QDir.cleanPath(pluginDir+"/"+self.plugin["localdir"])) # remove old plugin if exists
|
||||||
un.extract(tmpPath, pluginDir) # final extract.
|
un.extract(tmpPath, pluginDir) # final extract.
|
||||||
|
except:
|
||||||
|
self.mResult = self.tr("Failed to unzip file to ") + pluginDir + "\n" + self.tr("check permissions")
|
||||||
#except:
|
self.reject()
|
||||||
#self.mResult = self.tr("Failed to unzip file to ") + pluginDir + "\n" + self.tr("check permissions")
|
return
|
||||||
#self.reject()
|
|
||||||
#return
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
#print "Cleaning: removing the zip file (%s)" % tmpPath
|
#print "Cleaning: removing the zip file (%s)" % tmpPath
|
||||||
@ -414,13 +414,8 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
p["desc_local"] = self.tr("This plugin seems to be invalid or have unfulfilled dependencies")
|
p["desc_local"] = self.tr("This plugin seems to be invalid or have unfulfilled dependencies")
|
||||||
p["desc_repo"] = self.tr("This plugin seems to be invalid or have unfulfilled dependencies\nIt has been installed, but can't be loaded")
|
p["desc_repo"] = self.tr("This plugin seems to be invalid or have unfulfilled dependencies\nIt has been installed, but can't be loaded")
|
||||||
if p["status"] == "orphan":
|
if p["status"] == "orphan":
|
||||||
if p["read-only"]:
|
|
||||||
url = unicode(QgsApplication.pkgDataPath(),'utf-8') + "/python/plugins/" + p["localdir"]
|
|
||||||
else:
|
|
||||||
url = unicode(QgsApplication.qgisSettingsDirPath(),'utf-8') + "/python/plugins/" + p["localdir"]
|
|
||||||
repository = self.tr("only locally available")
|
repository = self.tr("only locally available")
|
||||||
else:
|
else:
|
||||||
url = p["url"]
|
|
||||||
repository = p["repository"]
|
repository = p["repository"]
|
||||||
if not p["desc_local"]:
|
if not p["desc_local"]:
|
||||||
p["desc_local"] = p["desc_repo"]
|
p["desc_local"] = p["desc_repo"]
|
||||||
@ -438,7 +433,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
else:
|
else:
|
||||||
a.setToolTip(4,"")
|
a.setToolTip(4,"")
|
||||||
a.setText(5,repository)
|
a.setText(5,repository)
|
||||||
a.setToolTip(5,url)
|
a.setToolTip(5,p["url"])
|
||||||
# set fonts and colours
|
# set fonts and colours
|
||||||
for i in [0,1,2,3,4,5]:
|
for i in [0,1,2,3,4,5]:
|
||||||
if p["status"] == "invalid":
|
if p["status"] == "invalid":
|
||||||
@ -483,7 +478,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
item = self.treePlugins.currentItem()
|
item = self.treePlugins.currentItem()
|
||||||
if not item:
|
if not item:
|
||||||
return
|
return
|
||||||
key = plugins.firstByName(item.text(1))
|
key = plugins.keyByUrl(item.toolTip(5))
|
||||||
if not key:
|
if not key:
|
||||||
return
|
return
|
||||||
plugin = plugins.all()[key]
|
plugin = plugins.all()[key]
|
||||||
@ -501,7 +496,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
""" install currently selected plugin """
|
""" install currently selected plugin """
|
||||||
if not self.treePlugins.currentItem():
|
if not self.treePlugins.currentItem():
|
||||||
return
|
return
|
||||||
key = plugins.firstByName(self.treePlugins.currentItem().text(1))
|
key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
|
||||||
plugin = plugins.all()[key]
|
plugin = plugins.all()[key]
|
||||||
if not plugin:
|
if not plugin:
|
||||||
return
|
return
|
||||||
@ -547,7 +542,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
""" uninstall currently selected plugin """
|
""" uninstall currently selected plugin """
|
||||||
if not self.treePlugins.currentItem():
|
if not self.treePlugins.currentItem():
|
||||||
return
|
return
|
||||||
key = plugins.firstByName(self.treePlugins.currentItem().text(1))
|
key = plugins.keyByUrl(self.treePlugins.currentItem().toolTip(5))
|
||||||
plugin = plugins.all()[key]
|
plugin = plugins.all()[key]
|
||||||
if not plugin:
|
if not plugin:
|
||||||
return
|
return
|
||||||
@ -568,6 +563,9 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialog):
|
|||||||
exec ("del sys.modules[%s]" % plugin["localdir"])
|
exec ("del sys.modules[%s]" % plugin["localdir"])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
if plugin["status"] == "orphan":
|
||||||
|
plugins.remove(key)
|
||||||
|
else:
|
||||||
plugins.setPluginData(key, "status", "not installed")
|
plugins.setPluginData(key, "status", "not installed")
|
||||||
plugins.setPluginData(key, "version_inst", "")
|
plugins.setPluginData(key, "version_inst", "")
|
||||||
plugins.setPluginData(key, "desc_local", "")
|
plugins.setPluginData(key, "desc_local", "")
|
||||||
|
@ -33,14 +33,14 @@ class InstallerPlugin:
|
|||||||
# ----------------------------------------- #
|
# ----------------------------------------- #
|
||||||
def initGui(self):
|
def initGui(self):
|
||||||
""" create action that will start plugin window and then add it to menu """
|
""" create action that will start plugin window and then add it to menu """
|
||||||
self.action = QAction(QIcon(":/plugins/installer/PluginInstaller.png"), QCoreApplication.translate("QgsPluginInstaller","Plugin Installer..."), self.mainWindow())
|
self.action = QAction(QIcon(":/plugins/installer/PluginInstaller.png"), QCoreApplication.translate("QgsPluginInstaller","Fetch Python Plugins..."), self.mainWindow())
|
||||||
self.action.setWhatsThis(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
|
self.action.setWhatsThis(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
|
||||||
self.action.setStatusTip(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
|
self.action.setStatusTip(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
|
||||||
if str(QGis.qgisVersion)[0] == "0":
|
if str(QGis.qgisVersion)[0] == "0":
|
||||||
nextAction = self.mainWindow().menuBar().actions()[4].menu().actions()[1]
|
nextAction = self.mainWindow().menuBar().actions()[4].menu().actions()[1]
|
||||||
self.mainWindow().menuBar().actions()[4].menu().insertAction(nextAction,self.action)
|
self.mainWindow().menuBar().actions()[4].menu().insertAction(nextAction,self.action)
|
||||||
else:
|
else:
|
||||||
nextAction = self.iface.actionPluginSeparator1()
|
nextAction = self.iface.actionManagePlugins() #actionPluginSeparator1()
|
||||||
self.iface.pluginMenu().insertAction(nextAction,self.action)
|
self.iface.pluginMenu().insertAction(nextAction,self.action)
|
||||||
QObject.connect(self.action, SIGNAL("activated()"), self.run)
|
QObject.connect(self.action, SIGNAL("activated()"), self.run)
|
||||||
self.statusLabel = None
|
self.statusLabel = None
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'installingbase.ui'
|
# Form implementation generated from reading ui file 'installingbase.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Sep 7 16:22:38 2008
|
# Created: Fri Sep 12 19:21:37 2008
|
||||||
# by: PyQt4 UI code generator 4.3
|
# by: PyQt4 UI code generator 4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'pluginerrorbase.ui'
|
# Form implementation generated from reading ui file 'pluginerrorbase.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Sep 7 16:22:47 2008
|
# Created: Fri Sep 12 19:21:37 2008
|
||||||
# by: PyQt4 UI code generator 4.3
|
# by: PyQt4 UI code generator 4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
BIN
python/plugins/plugin_installer/repoUnavailable.png
Normal file
BIN
python/plugins/plugin_installer/repoUnavailable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 910 B |
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'repositorybase.ui'
|
# Form implementation generated from reading ui file 'repositorybase.ui'
|
||||||
#
|
#
|
||||||
# Created: Tue Sep 9 00:09:51 2008
|
# Created: Fri Sep 12 19:21:37 2008
|
||||||
# by: PyQt4 UI code generator 4.3
|
# by: PyQt4 UI code generator 4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Resource object code
|
# Resource object code
|
||||||
#
|
#
|
||||||
# Created: ?r. wrz 3 18:43:47 2008
|
# Created: pt. wrz 12 19:21:37 2008
|
||||||
# by: The Resource Compiler for PyQt (Qt v4.3.2)
|
# by: The Resource Compiler for PyQt (Qt v4.3.2)
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user