Skip to content

Commit 0715a13

Browse files
author
timlinux
committed
Updates for Borys and added some missing files
git-svn-id: http://svn.osgeo.org/qgis/trunk@9310 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9b5849d commit 0715a13

14 files changed

+269
-66
lines changed

python/plugins/plugin_installer/CMakeLists.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,33 @@
22
# file or the ui change
33
SET(INSTALLER_FILES
44
dialog.py
5+
fetchingbase.py
6+
fetchingbase.ui
7+
guibase.py
8+
guibase.ui
59
gui.py
610
icon.xpm
711
__init__.py
8-
installer_plugin.py
9-
qgis_plugins.py
10-
resources.py
11-
repository_ui.py
12-
repository_dialog.py
13-
qgis-icon.png
14-
installingbase.ui
15-
fetchingbase.py
16-
guibase.py
17-
repositorybase.py
18-
plugin_installer.png
19-
unzip.py
12+
installer_data.py
2013
installer_gui.py
14+
installer_plugin.py
2115
installingbase.py
16+
installingbase.ui
17+
pluginerrorbase.py
2218
pluginerrorbase.ui
23-
installer_data.py
19+
plugin_installer.png
20+
PluginInstaller.png
21+
qgis-icon.png
22+
qgis_plugins.py
2423
repoConnected.png
25-
guibase.ui
26-
pluginerrorbase.py
24+
repoDisabled.png
25+
repositorybase.py
2726
repositorybase.ui
27+
repository_dialog.py
28+
repository_ui.py
29+
repoUnavailable.png
30+
resources.py
2831
resources_rc.py
29-
repoDisabled.png
32+
unzip.py
3033
)
3134
INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/plugin_installer)
4.81 KB
Loading

python/plugins/plugin_installer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def author_name():
2020
return "perrygeo, borysiasty"
2121

2222
def version():
23-
return "Version 0.05.6"
23+
return "Version 0.06.1"
2424

2525
def classFactory(iface):
2626
from installer_plugin import InstallerPlugin

python/plugins/plugin_installer/fetchingbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file 'fetchingbase.ui'
44
#
5-
# Created: Sun Sep 7 16:22:19 2008
5+
# Created: Fri Sep 12 19:21:37 2008
66
# by: PyQt4 UI code generator 4.3
77
#
88
# WARNING! All changes made in this file will be lost!
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<ui version="4.0" >
2+
<author>Matthew Perry, Borys Jurgiel</author>
3+
<class>QgsPluginInstallerFetchingDialog</class>
4+
<widget class="QDialog" name="QgsPluginInstallerFetchingDialog" >
5+
<property name="geometry" >
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>521</width>
10+
<height>332</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle" >
14+
<string>Fetching repositories</string>
15+
</property>
16+
<property name="windowIcon" >
17+
<iconset resource="resources.qrc" >:/plugins/installer/qgis-icon.png</iconset>
18+
</property>
19+
<layout class="QGridLayout" >
20+
<item row="1" column="0" >
21+
<spacer>
22+
<property name="orientation" >
23+
<enum>Qt::Vertical</enum>
24+
</property>
25+
<property name="sizeType" >
26+
<enum>QSizePolicy::Fixed</enum>
27+
</property>
28+
<property name="sizeHint" >
29+
<size>
30+
<width>249</width>
31+
<height>10</height>
32+
</size>
33+
</property>
34+
</spacer>
35+
</item>
36+
<item row="2" column="0" >
37+
<widget class="QLabel" name="label1" >
38+
<property name="text" >
39+
<string>Overall progress:</string>
40+
</property>
41+
</widget>
42+
</item>
43+
<item row="3" column="0" >
44+
<widget class="QProgressBar" name="progressBar" >
45+
<property name="value" >
46+
<number>24</number>
47+
</property>
48+
<property name="alignment" >
49+
<set>Qt::AlignHCenter</set>
50+
</property>
51+
<property name="textDirection" >
52+
<enum>QProgressBar::TopToBottom</enum>
53+
</property>
54+
<property name="format" >
55+
<string/>
56+
</property>
57+
</widget>
58+
</item>
59+
<item row="4" column="0" >
60+
<spacer>
61+
<property name="orientation" >
62+
<enum>Qt::Vertical</enum>
63+
</property>
64+
<property name="sizeType" >
65+
<enum>QSizePolicy::Fixed</enum>
66+
</property>
67+
<property name="sizeHint" >
68+
<size>
69+
<width>248</width>
70+
<height>10</height>
71+
</size>
72+
</property>
73+
</spacer>
74+
</item>
75+
<item row="5" column="0" >
76+
<layout class="QHBoxLayout" >
77+
<item>
78+
<spacer>
79+
<property name="orientation" >
80+
<enum>Qt::Horizontal</enum>
81+
</property>
82+
<property name="sizeType" >
83+
<enum>QSizePolicy::MinimumExpanding</enum>
84+
</property>
85+
<property name="sizeHint" >
86+
<size>
87+
<width>140</width>
88+
<height>27</height>
89+
</size>
90+
</property>
91+
</spacer>
92+
</item>
93+
<item>
94+
<widget class="QPushButton" name="buttonSkip" >
95+
<property name="sizePolicy" >
96+
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
97+
<horstretch>0</horstretch>
98+
<verstretch>0</verstretch>
99+
</sizepolicy>
100+
</property>
101+
<property name="minimumSize" >
102+
<size>
103+
<width>180</width>
104+
<height>0</height>
105+
</size>
106+
</property>
107+
<property name="focusPolicy" >
108+
<enum>Qt::NoFocus</enum>
109+
</property>
110+
<property name="text" >
111+
<string>Abort fetching</string>
112+
</property>
113+
<property name="autoDefault" >
114+
<bool>false</bool>
115+
</property>
116+
<property name="default" >
117+
<bool>false</bool>
118+
</property>
119+
<property name="flat" >
120+
<bool>false</bool>
121+
</property>
122+
</widget>
123+
</item>
124+
<item>
125+
<spacer>
126+
<property name="orientation" >
127+
<enum>Qt::Horizontal</enum>
128+
</property>
129+
<property name="sizeType" >
130+
<enum>QSizePolicy::MinimumExpanding</enum>
131+
</property>
132+
<property name="sizeHint" >
133+
<size>
134+
<width>140</width>
135+
<height>27</height>
136+
</size>
137+
</property>
138+
</spacer>
139+
</item>
140+
</layout>
141+
</item>
142+
<item row="0" column="0" >
143+
<widget class="QTreeWidget" name="treeWidget" >
144+
<property name="enabled" >
145+
<bool>true</bool>
146+
</property>
147+
<property name="horizontalScrollBarPolicy" >
148+
<enum>Qt::ScrollBarAsNeeded</enum>
149+
</property>
150+
<property name="showDropIndicator" stdset="0" >
151+
<bool>false</bool>
152+
</property>
153+
<property name="selectionMode" >
154+
<enum>QAbstractItemView::NoSelection</enum>
155+
</property>
156+
<property name="horizontalScrollMode" >
157+
<enum>QAbstractItemView::ScrollPerItem</enum>
158+
</property>
159+
<property name="rootIsDecorated" >
160+
<bool>false</bool>
161+
</property>
162+
<property name="itemsExpandable" >
163+
<bool>false</bool>
164+
</property>
165+
<column>
166+
<property name="text" >
167+
<string>Repository</string>
168+
</property>
169+
</column>
170+
<column>
171+
<property name="text" >
172+
<string>State</string>
173+
</property>
174+
</column>
175+
</widget>
176+
</item>
177+
</layout>
178+
</widget>
179+
<resources>
180+
<include location="resources.qrc" />
181+
</resources>
182+
<connections>
183+
<connection>
184+
<sender>buttonSkip</sender>
185+
<signal>clicked()</signal>
186+
<receiver>QgsPluginInstallerFetchingDialog</receiver>
187+
<slot>reject()</slot>
188+
<hints>
189+
<hint type="sourcelabel" >
190+
<x>350</x>
191+
<y>321</y>
192+
</hint>
193+
<hint type="destinationlabel" >
194+
<x>250</x>
195+
<y>76</y>
196+
</hint>
197+
</hints>
198+
</connection>
199+
</connections>
200+
</ui>

python/plugins/plugin_installer/guibase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file 'guibase.ui'
44
#
5-
# Created: Sun Sep 7 21:28:01 2008
5+
# Created: Fri Sep 12 19:21:37 2008
66
# by: PyQt4 UI code generator 4.3
77
#
88
# WARNING! All changes made in this file will be lost!

python/plugins/plugin_installer/installer_data.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def killConnection(self, key):
229229

230230
# ----------------------------------------- #
231231
def xmlDownloaded(self,nr,state):
232-
#print reposName, nr, state
233232
if not self.httpId.has_key(nr):
234233
return
235234
reposName = self.httpId[nr]
@@ -296,8 +295,8 @@ def all(self):
296295

297296

298297
# ----------------------------------------- #
299-
def firstByName(self, name):
300-
plugins = [i for i in self.mPlugins if self.mPlugins[i]["name"] == name]
298+
def keyByUrl(self, name):
299+
plugins = [i for i in self.mPlugins if self.mPlugins[i]["url"] == name]
301300
if plugins:
302301
return plugins[0]
303302
return None
@@ -420,6 +419,11 @@ def addPlugin(self, plugins):
420419
self.mPlugins[key] = plugin # add the plugin if not present yet or if is newer than existing one
421420

422421

422+
# ----------------------------------------- #
423+
def remove(self, key):
424+
del self.mPlugins[key]
425+
426+
423427
# ----------------------------------------- #
424428
def updatePlugin(self, key, readOnly):
425429
try:
@@ -452,6 +456,11 @@ def updatePlugin(self, key, readOnly):
452456
desc = ""
453457
auth = ""
454458
homepage = ""
459+
if readOnly:
460+
path = QgsApplication.pkgDataPath()
461+
else:
462+
path = QgsApplication.qgisSettingsDirPath()
463+
path = QDir.cleanPath(unicode(path,"utf-8") + "python/plugins/" + key)
455464
normVer = self.normalizeVersion(QString(ver))
456465
plugin = {
457466
"name" : nam,
@@ -461,7 +470,7 @@ def updatePlugin(self, key, readOnly):
461470
"desc_repo" : "",
462471
"author" : auth,
463472
"homepage" : homepage,
464-
"url" : "",
473+
"url" : path,
465474
"filename" : "",
466475
"status" : stat,
467476
"repository" : "",
@@ -478,10 +487,6 @@ def updatePlugin(self, key, readOnly):
478487
self.mPlugins[key]["name"] = plugin["name"] # local name has higher priority, except invalid plugins
479488
self.mPlugins[key]["version_inst"] = plugin["version_inst"]
480489
self.mPlugins[key]["desc_local"] = plugin["desc_local"]
481-
if plugin["author"]:
482-
self.mPlugins[key]["author"] = plugin["author"] #local author name has higher priority, if exists
483-
if plugin["homepage"]:
484-
self.mPlugins[key]["homepage"] = plugin["homepage"] # local homepage adress has higher priority, if exists
485490
# set status
486491
#
487492
# installed available status
@@ -509,7 +514,6 @@ def updatePlugin(self, key, readOnly):
509514
# ----------------------------------------- #
510515
def getAllInstalled(self):
511516
""" update the mPlugins dict with alredy installed plugins """
512-
#print "getting list of installed plugins"
513517
# first, try to add the read-only plugins...
514518
try:
515519
pluginDir = QDir.cleanPath(unicode(QgsApplication.pkgDataPath(),'utf-8') + "/python/plugins")
@@ -537,7 +541,6 @@ def getAllInstalled(self):
537541
# ----------------------------------------- #
538542
def markNews(self):
539543
""" mark all new plugins as new """
540-
#print "marking the new plugins"
541544
settings = QSettings()
542545
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
543546
if len(seenPlugins) > 0:
@@ -549,7 +552,6 @@ def markNews(self):
549552
# ----------------------------------------- #
550553
def updateSeenPluginsList(self):
551554
""" update the list of all seen plugins """
552-
#print "updating the list of seen plugins"
553555
settings = QSettings()
554556
seenPlugins = settings.value(seenPluginGroup, QVariant(QStringList(self.mPlugins.keys()))).toStringList()
555557
for i in self.mPlugins.keys():

0 commit comments

Comments
 (0)