Skip to content

Commit 2e727ea

Browse files
author
borysiasty
committed
Plugin Installer - revert last changes in order to keep the stable gui
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10363 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0e1f397 commit 2e727ea

File tree

7 files changed

+208
-590
lines changed

7 files changed

+208
-590
lines changed

python/plugins/plugin_installer/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def name():
1414
return "Plugin Installer"
1515

1616
def version():
17-
return "Version 0.9.11"
17+
return "Version 0.9.8"
1818

1919
def description():
2020
return "Downloads and installs QGIS python plugins"
@@ -23,7 +23,7 @@ def qgisMinimumVersion():
2323
return "0.9"
2424

2525
def authorName():
26-
return "Matthew Perry, Borys Jurgiel"
26+
return "perrygeo, borysiasty"
2727

2828
def homepage():
2929
return "http://bwj.aster.net.pl/qgis/"

python/plugins/plugin_installer/i18n.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ QgsPluginInstallerDialog::foo()
200200
// def ChangeCheckingPolicy
201201

202202
// def addKnownRepositories
203-
tr( "You are about to add several plugin repositories that are neither authorized nor supported by the Quantum GIS team. Plugin authors generally make efforts to ensure that their work is useful and safe, however, we can assume no responsibility for them." )
203+
tr( "You are going to add some plugin repositories neither authorized nor supported by the Quantum GIS team, however provided by folks associated with us. Plugin authors generally make efforts to make their works useful and safe, but we can't assume any responsibility for them. FEEL WARNED!" )
204204
tr( "QGIS Python Plugin Installer" )
205205

206206
// def addRepository

python/plugins/plugin_installer/installer_data.py

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"error_details" QString,
4444
"homepage" QString,
4545
"url" QString,
46-
"experimental" bool
4746
"filename" QString,
4847
"repository" QString,
4948
"localdir" QString,
@@ -84,7 +83,7 @@ def setIface(qgisIface):
8483
("Martin Dobias' Sandbox", "http://mapserver.sk/~wonder/qgis/plugins-sandbox.xml", ""),
8584
("Aaron Racicot's Repository", "http://qgisplugins.z-pulley.com", ""),
8685
("Barry Rowlingson's Repository", "http://www.maths.lancs.ac.uk/~rowlings/Qgis/Plugins/plugins.xml", ""),
87-
("GIS-Lab Repository", "http://gis-lab.info/programs/qgis/qgis-repo.xml", "")]
86+
("GIS-Lab Repository", "http://gis-lab.info/programs/qgis/qgis-repo.xml", "")]
8887

8988

9089
# --- class QPHttp ----------------------------------------------------------------------- #
@@ -97,8 +96,6 @@ def __init__(self,*args):
9796
if settings.value("/proxyEnabled").toBool():
9897
self.proxy=QNetworkProxy()
9998
proxyType = settings.value( "/proxyType", QVariant(0)).toString()
100-
if len(args)>0 and settings.value("/proxyExcludedUrls").toString().contains(args[0]):
101-
proxyType = "NoProxy"
10299
if proxyType in ["1","Socks5Proxy"]: self.proxy.setType(QNetworkProxy.Socks5Proxy)
103100
elif proxyType in ["2","NoProxy"]: self.proxy.setType(QNetworkProxy.NoProxy)
104101
elif proxyType in ["3","HttpProxy"]: self.proxy.setType(QNetworkProxy.HttpProxy)
@@ -238,48 +235,6 @@ def setCheckingOnStart(self, state):
238235
settings.setValue(settingsGroup+"/checkOnStart", QVariant(state))
239236

240237

241-
# ----------------------------------------- #
242-
def checkingOnStartInterval(self):
243-
""" return checking for news and updates interval """
244-
settings = QSettings()
245-
(i, ok) = settings.value(settingsGroup+"/checkOnStartInterval").toInt()
246-
if i < 0 or not ok:
247-
i = 1
248-
# allowed values: 0,1,3,7,14,30 days
249-
interval = 0
250-
for j in [1,3,7,14,30]:
251-
if i >= j:
252-
interval = j
253-
return interval
254-
255-
256-
# ----------------------------------------- #
257-
def setCheckingOnStartInterval(self, interval):
258-
""" set checking for news and updates interval """
259-
settings = QSettings()
260-
settings.setValue(settingsGroup+"/checkOnStartInterval", QVariant(interval))
261-
262-
263-
# ----------------------------------------- #
264-
def saveCheckingOnStartLastDate(self):
265-
""" set today's date as the day of last checking """
266-
settings = QSettings()
267-
settings.setValue(settingsGroup+"/checkOnStartLastDate", QVariant(QDate.currentDate()))
268-
269-
270-
# ----------------------------------------- #
271-
def timeForChecking(self):
272-
""" determine whether it's the time for checking for news and updates now """
273-
if self.checkingOnStartInterval() == 0:
274-
return True
275-
settings = QSettings()
276-
interval = settings.value(settingsGroup+"/checkOnStartLastDate").toDate().daysTo(QDate.currentDate())
277-
if interval >= self.checkingOnStartInterval():
278-
return True
279-
else:
280-
return False
281-
282-
283238
# ----------------------------------------- #
284239
def load(self):
285240
""" populate the mRepositories dict"""
@@ -376,19 +331,15 @@ def xmlDownloaded(self,nr,state):
376331
fileName = QFileInfo(pluginNodes.item(i).firstChildElement("download_url").text().trimmed()).fileName()
377332
name = fileName.section(".", 0, 0)
378333
name = str(name)
379-
experimental = False
380-
if pluginNodes.item(i).firstChildElement("experimental").text().simplified().toUpper() in ["TRUE","YES"]:
381-
experimental = True
382334
plugin = {}
383335
plugin[name] = {
384336
"name" : pluginNodes.item(i).toElement().attribute("name"),
385337
"version_avail" : pluginNodes.item(i).toElement().attribute("version"),
386-
"desc_repo" : pluginNodes.item(i).firstChildElement("description").text().simplified(),
338+
"desc_repo" : pluginNodes.item(i).firstChildElement("description").text().trimmed(),
387339
"desc_local" : "",
388-
"author" : pluginNodes.item(i).firstChildElement("author_name").text().simplified(),
389-
"homepage" : pluginNodes.item(i).firstChildElement("homepage").text().simplified(),
390-
"url" : pluginNodes.item(i).firstChildElement("download_url").text().simplified(),
391-
"experimental" : experimental,
340+
"author" : pluginNodes.item(i).firstChildElement("author_name").text().trimmed(),
341+
"homepage" : pluginNodes.item(i).firstChildElement("homepage").text().trimmed(),
342+
"url" : pluginNodes.item(i).firstChildElement("download_url").text().trimmed(),
392343
"filename" : fileName,
393344
"status" : "not installed",
394345
"error" : "",
@@ -397,14 +348,14 @@ def xmlDownloaded(self,nr,state):
397348
"repository" : reposName,
398349
"localdir" : name,
399350
"read-only" : False}
400-
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().simplified()
351+
qgisMinimumVersion = pluginNodes.item(i).firstChildElement("qgis_minimum_version").text().trimmed()
401352
if not qgisMinimumVersion: qgisMinimumVersion = "0"
402353
# please use the tag below only if really needed! (for example if plugin development is abandoned)
403-
qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().simplified()
354+
qgisMaximumVersion = pluginNodes.item(i).firstChildElement("qgis_maximum_version").text().trimmed()
404355
if not qgisMaximumVersion: qgisMaximumVersion = "2"
405356
#if compatible, add the plugin to the list
406357
if compareVersions(QGIS_VER, qgisMinimumVersion) < 2 and compareVersions(qgisMaximumVersion, QGIS_VER) < 2:
407-
if QGIS_VER[0]==qgisMinimumVersion[0] or name=="plugin_installer" or (qgisMinimumVersion!="0" and qgisMaximumVersion!="2"):
358+
if QGIS_VER[0]=="0" or qgisMinimumVersion[0]=="1" or name=="plugin_installer":
408359
plugins.addPlugin(plugin)
409360
plugins.workarounds()
410361
self.mRepositories[reposName]["state"] = 2
@@ -418,7 +369,6 @@ def xmlDownloaded(self,nr,state):
418369
# is the checking done?
419370
if not self.fetchingInProgress():
420371
plugins.getAllInstalled()
421-
self.saveCheckingOnStartLastDate()
422372
self.emit(SIGNAL("checkingDone()"))
423373
# --- /class Repositories ---------------------------------------------------------------- #
424374

@@ -552,7 +502,6 @@ def updatePlugin(self, key, readOnly):
552502
"author" : auth,
553503
"homepage" : homepage,
554504
"url" : path,
555-
"experimental" : False,
556505
"filename" : "",
557506
"status" : "",
558507
"error" : error,
@@ -572,7 +521,6 @@ def updatePlugin(self, key, readOnly):
572521
self.mPlugins[key]["name"] = plugin["name"] # local name has higher priority
573522
self.mPlugins[key]["version_inst"] = plugin["version_inst"]
574523
self.mPlugins[key]["desc_local"] = plugin["desc_local"]
575-
self.mPlugins[key]["experimental"] = False
576524
# set status
577525
#
578526
# installed available status

python/plugins/plugin_installer/installer_gui.py

Lines changed: 17 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -262,27 +262,15 @@ def __init__(self, parent, fl):
262262
self.connect(self.buttonAddRep, SIGNAL("clicked()"), self.addRepository)
263263
self.connect(self.buttonEditRep, SIGNAL("clicked()"), self.editRepository)
264264
self.connect(self.buttonDeleteRep, SIGNAL("clicked()"), self.deleteRepository)
265-
self.buttonEditRep.setEnabled(False)
266-
self.buttonDeleteRep.setEnabled(False)
267-
# configuration widgets
268-
self.connect(self.checkUpdates, SIGNAL("toggled (bool)"), self.changeCheckingPolicy)
269-
self.connect(self.comboInterval, SIGNAL("currentIndexChanged (int)"), self.changeCheckingInterval)
270-
self.connect(self.radioPluginType0, SIGNAL("toggled (bool)"), self.changePluginPolicy)
271-
self.connect(self.radioPluginType1, SIGNAL("toggled (bool)"), self.changePluginPolicy)
272-
self.connect(self.radioPluginType2, SIGNAL("toggled (bool)"), self.changePluginPolicy)
265+
# checkingOnStart checkbox
266+
self.connect(self.checkUpdates, SIGNAL("stateChanged (int)"), self.ChangeCheckingPolicy)
273267
if repositories.checkingOnStart():
274-
self.checkUpdates.setChecked(Qt.Checked)
275-
else:
276-
self.checkUpdates.setChecked(Qt.Unchecked)
277-
interval = repositories.checkingOnStartInterval()
278-
intervals = [0,1,3,7,14,30] # days
279-
if intervals.count(interval):
280-
index = intervals.index(interval)
268+
self.checkUpdates.setCheckState(Qt.Checked)
281269
else:
282-
index = 1
283-
if QGIS_VER[0] == "0":
284-
self.label_2.setText("<b>Note: This functionality requires QGIS 1.0</b>")
285-
self.comboInterval.setCurrentIndex(index)
270+
self.checkUpdates.setCheckState(Qt.Unchecked)
271+
self.buttonEditRep.setEnabled(False)
272+
self.buttonDeleteRep.setEnabled(False)
273+
286274
self.populateMostWidgets()
287275

288276

@@ -340,32 +328,13 @@ def populateMostWidgets(self):
340328
for i in [0,1,2]:
341329
self.treeRepositories.resizeColumnToContents(i)
342330
self.comboFilter1.addItem(self.tr("orphans"))
343-
# fill the status filter comboBox
331+
# filling the status filter comboBox
344332
self.comboFilter2.clear()
345333
self.comboFilter2.addItem(self.tr("any status"))
346334
self.comboFilter2.addItem(self.tr("not installed", "plural"))
347335
self.comboFilter2.addItem(self.tr("installed", "plural"))
348336
if plugins.isThereAnythingNew():
349337
self.comboFilter2.addItem(self.tr("upgradeable and news"))
350-
#set configuration widgets (dependent on the repository list)
351-
if len(repositories.all()) == 1 or QGIS_VER[0] == "0":
352-
self.radioPluginType0.setEnabled(False)
353-
self.radioPluginType1.setEnabled(False)
354-
self.radioPluginType2.setEnabled(False)
355-
else:
356-
self.radioPluginType0.setEnabled(True)
357-
self.radioPluginType1.setEnabled(True)
358-
self.radioPluginType2.setEnabled(True)
359-
settings = QSettings()
360-
(i, ok) = settings.value(settingsGroup+"/allowedPluginType", QVariant(2)).toInt()
361-
if QGIS_VER[0] == "0":
362-
self.radioPluginType1.setChecked(Qt.Checked)
363-
elif i == 1 or len(repositories.all()) == 1:
364-
self.radioPluginType0.setChecked(Qt.Checked)
365-
elif i == 3:
366-
self.radioPluginType2.setChecked(Qt.Checked)
367-
else:
368-
self.radioPluginType1.setChecked(Qt.Checked)
369338

370339

371340
# ----------------------------------------- #
@@ -389,17 +358,14 @@ def filterCheck(self,plugin):
389358
return False
390359
if self.comboFilter2.currentIndex() == 3 and not plugin["status"] in ["upgradeable","new"]:
391360
return False
392-
if self.radioPluginType0.isChecked() and plugin["repository"] != officialRepo[0] and plugin["status"] in ["not installed","new"]:
393-
return False
394-
if self.radioPluginType1.isChecked() and plugin["experimental"] and plugin["status"] in ["not installed","new"]:
395-
return False
396361
if self.lineFilter.text() == "":
397362
return True
398363
else:
399364
for i in ["name","version_inst","version_avail","desc_repo","desc_local","author","status","repository"]:
400365
item = QString(plugin[i]) #.toUpper()
401366
if item != None:
402367
if item.contains(self.lineFilter.text(), Qt.CaseInsensitive):
368+
#if item.find(self.lineFilter.text().toUpper()) > -1:
403369
return True
404370
return False
405371

@@ -692,41 +658,17 @@ def repositoryTreeClicked(self):
692658

693659

694660
# ----------------------------------------- #
695-
def changeCheckingPolicy(self,policy):
696-
""" the Checking On Start checkbox has been clicked """
697-
if policy:
661+
def ChangeCheckingPolicy(self,policy):
662+
if policy == Qt.Checked:
698663
repositories.setCheckingOnStart(True)
699664
else:
700665
repositories.setCheckingOnStart(False)
701666

702667

703-
# ----------------------------------------- #
704-
def changeCheckingInterval(self,interval):
705-
""" the Checking on start interval combobox has been clicked """
706-
intervals = [0,1,3,7,14,30]
707-
repositories.setCheckingOnStartInterval(intervals[interval])
708-
709-
710-
# ----------------------------------------- #
711-
def changePluginPolicy(self, state):
712-
""" one of the plugin type radiobuttons has been clicked """
713-
if not state: # radio button released
714-
return
715-
if self.radioPluginType0.isChecked():
716-
i = 1
717-
elif self.radioPluginType1.isChecked():
718-
i = 2
719-
else:
720-
i = 3
721-
settings = QSettings()
722-
settings.setValue(settingsGroup+"/allowedPluginType", QVariant(i))
723-
self.populatePluginTree()
724-
725-
726668
# ----------------------------------------- #
727669
def addKnownRepositories(self):
728670
""" update list of known repositories - in the future it will be replaced with an online fetching """
729-
message = self.tr("You are about to add several plugin repositories that are neither authorized nor supported by the Quantum GIS team. Plugin authors generally make efforts to ensure that their work is useful and safe, however, we can assume no responsibility for them.")
671+
message = self.tr("You are going to add some plugin repositories neither authorized nor supported by the Quantum GIS team, however provided by folks associated with us. Plugin authors generally make efforts to make their works useful and safe, but we can't assume any responsibility for them. FEEL WARNED!")
730672
if QMessageBox.question(self, self.tr("QGIS Python Plugin Installer"), message, QMessageBox.Ok, QMessageBox.Abort) == QMessageBox.Ok:
731673
repositories.addKnownRepos()
732674
# refresh lists and populate widgets
@@ -745,13 +687,13 @@ def addRepository(self):
745687
if not dlg.exec_():
746688
return
747689
for i in repositories.all().values():
748-
if dlg.editURL.text().trimmed() == i["url"]:
690+
if dlg.editURL.text() == i["url"]:
749691
QMessageBox.warning(self, self.tr("QGIS Python Plugin Installer"), self.tr("Unable to add another repository with the same URL!"))
750692
return
751693
settings = QSettings()
752694
settings.beginGroup(self.reposGroup)
753695
reposName = dlg.editName.text()
754-
reposURL = dlg.editURL.text().trimmed()
696+
reposURL = dlg.editURL.text()
755697
if repositories.all().has_key(reposName):
756698
reposName = reposName + "(2)"
757699
# add to settings
@@ -787,7 +729,7 @@ def editRepository(self):
787729
if not dlg.exec_():
788730
return # nothing to do if cancelled
789731
for i in repositories.all().values():
790-
if dlg.editURL.text().trimmed() == i["url"] and dlg.editURL.text().trimmed() != repositories.all()[reposName]["url"]:
732+
if dlg.editURL.text() == i["url"] and dlg.editURL.text() != repositories.all()[reposName]["url"]:
791733
QMessageBox.warning(self, self.tr("QGIS Python Plugin Installer"), self.tr("Unable to add another repository with the same URL!"))
792734
return
793735
# delete old repo from QSettings and create new one
@@ -797,9 +739,9 @@ def editRepository(self):
797739
newName = dlg.editName.text()
798740
if repositories.all().has_key(newName) and newName != reposName:
799741
newName = newName + "(2)"
800-
settings.setValue(newName+"/url", QVariant(dlg.editURL.text().trimmed()))
742+
settings.setValue(newName+"/url", QVariant(dlg.editURL.text()))
801743
settings.setValue(newName+"/enabled", QVariant(bool(dlg.checkBoxEnabled.checkState())))
802-
if dlg.editURL.text().trimmed() == repositories.all()[reposName]["url"] and dlg.checkBoxEnabled.checkState() == checkState[repositories.all()[reposName]["enabled"]]:
744+
if dlg.editURL.text() == repositories.all()[reposName]["url"] and dlg.checkBoxEnabled.checkState() == checkState[repositories.all()[reposName]["enabled"]]:
803745
repositories.rename(reposName, newName)
804746
self.populateMostWidgets()
805747
return # nothing else to do if only repository name was changed

0 commit comments

Comments
 (0)