Skip to content

Commit 619558d

Browse files
committedJun 25, 2013
[Plugin Installer] Fix #8080
1 parent 0485aa0 commit 619558d

File tree

3 files changed

+192
-144
lines changed

3 files changed

+192
-144
lines changed
 

‎python/pyplugin_installer/installer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ def exportRepositoriesToManager(self):
172172
""" Update manager's repository tree widget with current data """
173173
iface.pluginManagerInterface().clearRepositoryList()
174174
for key in repositories.all():
175-
url = repositories.all()[key]["url"]
176-
v=str(QGis.QGIS_VERSION_INT)
177-
url += "?qgis=%d.%d" % ( int(v[0]), int(v[1:3]) )
175+
url = repositories.all()[key]["url"] + repositories.urlParams()
178176
repository = repositories.all()[key]
179177
if repositories.inspectionFilter():
180178
enabled = ( key == repositories.inspectionFilter() )
@@ -449,6 +447,7 @@ def editRepository(self, reposName):
449447
dlg = QgsPluginInstallerRepositoryDialog( iface.mainWindow() )
450448
dlg.editName.setText(reposName)
451449
dlg.editURL.setText(repositories.all()[reposName]["url"])
450+
dlg.editParams.setText(repositories.urlParams())
452451
dlg.checkBoxEnabled.setCheckState(checkState[repositories.all()[reposName]["enabled"]])
453452
if repositories.all()[reposName]["valid"]:
454453
dlg.checkBoxEnabled.setEnabled(True)

‎python/pyplugin_installer/installer_data.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ def allUnavailable(self):
236236
return repos
237237

238238

239+
# ----------------------------------------- #
240+
def urlParams(self):
241+
""" return GET parameters to be added to every request """
242+
v=str(QGis.QGIS_VERSION_INT)
243+
return "?qgis=%d.%d" % ( int(v[0]), int(v[1:3]) )
244+
245+
239246
# ----------------------------------------- #
240247
def setRepositoryData(self, reposName, key, value):
241248
""" write data to the mRepositories dict """
@@ -355,9 +362,9 @@ def load(self):
355362
def requestFetching(self,key):
356363
""" start fetching the repository given by key """
357364
self.mRepositories[key]["state"] = 1
358-
url = QUrl(self.mRepositories[key]["url"])
359-
v=str(QGis.QGIS_VERSION_INT)
360-
url.addQueryItem('qgis', '.'.join([str(int(s)) for s in [v[0], v[1:3]]]) ) # don't include the bugfix version!
365+
url = QUrl(self.mRepositories[key]["url"] + self.urlParams() )
366+
#v=str(QGis.QGIS_VERSION_INT)
367+
#url.addQueryItem('qgis', '.'.join([str(int(s)) for s in [v[0], v[1:3]]]) ) # don't include the bugfix version!
361368

362369
self.mRepositories[key]["QRequest"] = QNetworkRequest(url)
363370
self.mRepositories[key]["QRequest"].setAttribute( QNetworkRequest.User, key)

‎python/pyplugin_installer/qgsplugininstallerrepositorybase.ui

Lines changed: 180 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,219 +1,261 @@
1-
<ui version="4.0" >
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
23
<author>Borys Jurgiel</author>
34
<class>QgsPluginInstallerRepositoryDetailsDialogBase</class>
4-
<widget class="QDialog" name="QgsPluginInstallerRepositoryDetailsDialogBase" >
5-
<property name="geometry" >
5+
<widget class="QDialog" name="QgsPluginInstallerRepositoryDetailsDialogBase">
6+
<property name="geometry">
67
<rect>
78
<x>0</x>
89
<y>0</y>
910
<width>522</width>
10-
<height>191</height>
11+
<height>185</height>
1112
</rect>
1213
</property>
13-
<property name="sizePolicy" >
14-
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
14+
<property name="sizePolicy">
15+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1516
<horstretch>0</horstretch>
1617
<verstretch>0</verstretch>
1718
</sizepolicy>
1819
</property>
19-
<property name="windowTitle" >
20+
<property name="windowTitle">
2021
<string>Repository details</string>
2122
</property>
22-
<property name="statusTip" >
23+
<property name="statusTip">
2324
<string/>
2425
</property>
25-
<property name="whatsThis" >
26+
<property name="whatsThis">
2627
<string/>
2728
</property>
28-
<layout class="QGridLayout" >
29-
<item row="0" column="0" >
30-
<widget class="QLabel" name="label" >
31-
<property name="sizePolicy" >
32-
<sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
29+
<layout class="QGridLayout">
30+
<item row="5" column="1" colspan="2">
31+
<widget class="QLabel" name="labelInfo">
32+
<property name="enabled">
33+
<bool>true</bool>
34+
</property>
35+
<property name="sizePolicy">
36+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
3337
<horstretch>0</horstretch>
3438
<verstretch>0</verstretch>
3539
</sizepolicy>
3640
</property>
37-
<property name="text" >
38-
<string>Name:</string>
41+
<property name="palette">
42+
<palette>
43+
<active>
44+
<colorrole role="WindowText">
45+
<brush brushstyle="SolidPattern">
46+
<color alpha="255">
47+
<red>175</red>
48+
<green>0</green>
49+
<blue>0</blue>
50+
</color>
51+
</brush>
52+
</colorrole>
53+
</active>
54+
<inactive>
55+
<colorrole role="WindowText">
56+
<brush brushstyle="SolidPattern">
57+
<color alpha="255">
58+
<red>175</red>
59+
<green>0</green>
60+
<blue>0</blue>
61+
</color>
62+
</brush>
63+
</colorrole>
64+
</inactive>
65+
<disabled>
66+
<colorrole role="WindowText">
67+
<brush brushstyle="SolidPattern">
68+
<color alpha="255">
69+
<red>128</red>
70+
<green>128</green>
71+
<blue>128</blue>
72+
</color>
73+
</brush>
74+
</colorrole>
75+
</disabled>
76+
</palette>
77+
</property>
78+
<property name="font">
79+
<font>
80+
<weight>75</weight>
81+
<bold>true</bold>
82+
</font>
83+
</property>
84+
<property name="frameShape">
85+
<enum>QFrame::NoFrame</enum>
86+
</property>
87+
<property name="text">
88+
<string/>
3989
</property>
4090
</widget>
4191
</item>
42-
<item row="0" column="1" >
43-
<spacer>
44-
<property name="orientation" >
92+
<item row="7" column="0" colspan="3">
93+
<widget class="QDialogButtonBox" name="buttonBox">
94+
<property name="orientation">
4595
<enum>Qt::Horizontal</enum>
4696
</property>
47-
<property name="sizeType" >
48-
<enum>QSizePolicy::Fixed</enum>
97+
<property name="standardButtons">
98+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
4999
</property>
50-
<property name="sizeHint" >
51-
<size>
52-
<width>16</width>
53-
<height>27</height>
54-
</size>
55-
</property>
56-
</spacer>
100+
</widget>
57101
</item>
58-
<item row="0" column="2" colspan="2" >
59-
<widget class="QLineEdit" name="editName" >
60-
<property name="toolTip" >
61-
<string>Enter a name for the repository</string>
102+
<item row="0" column="0">
103+
<widget class="QLabel" name="label">
104+
<property name="sizePolicy">
105+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
106+
<horstretch>0</horstretch>
107+
<verstretch>0</verstretch>
108+
</sizepolicy>
62109
</property>
63-
<property name="whatsThis" >
64-
<string>Enter a name for the repository</string>
110+
<property name="text">
111+
<string>Name</string>
112+
</property>
113+
<property name="buddy">
114+
<cstring>editName</cstring>
65115
</property>
66116
</widget>
67117
</item>
68-
<item row="1" column="0" >
69-
<widget class="QLabel" name="label_2" >
70-
<property name="text" >
71-
<string>URL:</string>
118+
<item row="4" column="1" colspan="2">
119+
<spacer name="verticalSpacer">
120+
<property name="orientation">
121+
<enum>Qt::Vertical</enum>
72122
</property>
73-
</widget>
123+
<property name="sizeHint" stdset="0">
124+
<size>
125+
<width>20</width>
126+
<height>40</height>
127+
</size>
128+
</property>
129+
</spacer>
74130
</item>
75-
<item row="1" column="2" colspan="2" >
76-
<widget class="QLineEdit" name="editURL" >
77-
<property name="toolTip" >
78-
<string>Enter the repository URL, beginning with "http://"</string>
131+
<item row="1" column="1" colspan="2">
132+
<widget class="QLineEdit" name="editURL">
133+
<property name="toolTip">
134+
<string>Enter the repository URL, beginning with &quot;http://&quot;</string>
79135
</property>
80-
<property name="whatsThis" >
81-
<string>Enter the repository URL, beginning with "http://"</string>
136+
<property name="whatsThis">
137+
<string>Enter the repository URL, beginning with &quot;http://&quot;</string>
82138
</property>
83-
<property name="text" >
139+
<property name="text">
84140
<string/>
85141
</property>
86142
</widget>
87143
</item>
88-
<item row="2" column="2" >
89-
<widget class="QCheckBox" name="checkBoxEnabled" >
90-
<property name="enabled" >
144+
<item row="3" column="1">
145+
<widget class="QCheckBox" name="checkBoxEnabled">
146+
<property name="enabled">
91147
<bool>true</bool>
92148
</property>
93-
<property name="sizePolicy" >
94-
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
149+
<property name="sizePolicy">
150+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
95151
<horstretch>0</horstretch>
96152
<verstretch>0</verstretch>
97153
</sizepolicy>
98154
</property>
99-
<property name="toolTip" >
155+
<property name="toolTip">
100156
<string>Enable or disable the repository (disabled repositories will be omitted)</string>
101157
</property>
102-
<property name="whatsThis" >
158+
<property name="whatsThis">
103159
<string>Enable or disable the repository (disabled repositories will be omitted)</string>
104160
</property>
105-
<property name="text" >
106-
<string>Enabled</string>
161+
<property name="text">
162+
<string/>
107163
</property>
108-
<property name="checked" >
164+
<property name="checked">
109165
<bool>false</bool>
110166
</property>
111167
</widget>
112168
</item>
113-
<item row="2" column="3" >
114-
<spacer>
115-
<property name="orientation" >
116-
<enum>Qt::Horizontal</enum>
117-
</property>
118-
<property name="sizeType" >
119-
<enum>QSizePolicy::Fixed</enum>
169+
<item row="2" column="0">
170+
<widget class="QLabel" name="label_3">
171+
<property name="text">
172+
<string>Parameters</string>
120173
</property>
121-
<property name="sizeHint" >
122-
<size>
123-
<width>351</width>
124-
<height>23</height>
125-
</size>
174+
<property name="buddy">
175+
<cstring>editParams</cstring>
126176
</property>
127-
</spacer>
177+
</widget>
128178
</item>
129-
<item row="3" column="2" colspan="2" >
130-
<widget class="QLabel" name="labelInfo" >
131-
<property name="enabled" >
132-
<bool>true</bool>
179+
<item row="2" column="1" colspan="2">
180+
<widget class="QLineEdit" name="editParams">
181+
<property name="enabled">
182+
<bool>false</bool>
133183
</property>
134-
<property name="sizePolicy" >
135-
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
136-
<horstretch>0</horstretch>
137-
<verstretch>0</verstretch>
138-
</sizepolicy>
184+
<property name="text">
185+
<string>?qgis=</string>
139186
</property>
140-
<property name="palette" >
141-
<palette>
142-
<active>
143-
<colorrole role="WindowText" >
144-
<brush brushstyle="SolidPattern" >
145-
<color alpha="255" >
146-
<red>175</red>
147-
<green>0</green>
148-
<blue>0</blue>
149-
</color>
150-
</brush>
151-
</colorrole>
152-
</active>
153-
<inactive>
154-
<colorrole role="WindowText" >
155-
<brush brushstyle="SolidPattern" >
156-
<color alpha="255" >
157-
<red>175</red>
158-
<green>0</green>
159-
<blue>0</blue>
160-
</color>
161-
</brush>
162-
</colorrole>
163-
</inactive>
164-
<disabled>
165-
<colorrole role="WindowText" >
166-
<brush brushstyle="SolidPattern" >
167-
<color alpha="255" >
168-
<red>128</red>
169-
<green>128</green>
170-
<blue>128</blue>
171-
</color>
172-
</brush>
173-
</colorrole>
174-
</disabled>
175-
</palette>
187+
</widget>
188+
</item>
189+
<item row="0" column="1" colspan="2">
190+
<widget class="QLineEdit" name="editName">
191+
<property name="toolTip">
192+
<string>Enter a name for the repository</string>
176193
</property>
177-
<property name="font" >
178-
<font>
179-
<weight>75</weight>
180-
<bold>true</bold>
181-
</font>
194+
<property name="whatsThis">
195+
<string>Enter a name for the repository</string>
182196
</property>
183-
<property name="frameShape" >
184-
<enum>QFrame::NoFrame</enum>
197+
</widget>
198+
</item>
199+
<item row="1" column="0">
200+
<widget class="QLabel" name="label_2">
201+
<property name="text">
202+
<string>URL</string>
185203
</property>
186-
<property name="text" >
187-
<string/>
204+
<property name="buddy">
205+
<cstring>editURL</cstring>
188206
</property>
189207
</widget>
190208
</item>
191-
<item row="5" column="0" colspan="4" >
192-
<widget class="QDialogButtonBox" name="buttonBox" >
193-
<property name="orientation" >
209+
<item row="3" column="2">
210+
<spacer>
211+
<property name="orientation">
194212
<enum>Qt::Horizontal</enum>
195213
</property>
196-
<property name="standardButtons" >
197-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
214+
<property name="sizeType">
215+
<enum>QSizePolicy::Fixed</enum>
216+
</property>
217+
<property name="sizeHint" stdset="0">
218+
<size>
219+
<width>351</width>
220+
<height>23</height>
221+
</size>
222+
</property>
223+
</spacer>
224+
</item>
225+
<item row="3" column="0">
226+
<widget class="QLabel" name="label_4">
227+
<property name="text">
228+
<string>Enabled</string>
229+
</property>
230+
<property name="buddy">
231+
<cstring>checkBoxEnabled</cstring>
198232
</property>
199233
</widget>
200234
</item>
201235
</layout>
202236
</widget>
237+
<tabstops>
238+
<tabstop>editName</tabstop>
239+
<tabstop>editURL</tabstop>
240+
<tabstop>editParams</tabstop>
241+
<tabstop>checkBoxEnabled</tabstop>
242+
<tabstop>buttonBox</tabstop>
243+
</tabstops>
244+
<resources/>
203245
<connections>
204246
<connection>
205247
<sender>buttonBox</sender>
206248
<signal>accepted()</signal>
207249
<receiver>QgsPluginInstallerRepositoryDetailsDialogBase</receiver>
208250
<slot>accept()</slot>
209251
<hints>
210-
<hint type="sourcelabel" >
211-
<x>257</x>
212-
<y>207</y>
252+
<hint type="sourcelabel">
253+
<x>276</x>
254+
<y>178</y>
213255
</hint>
214-
<hint type="destinationlabel" >
256+
<hint type="destinationlabel">
215257
<x>157</x>
216-
<y>216</y>
258+
<y>184</y>
217259
</hint>
218260
</hints>
219261
</connection>
@@ -223,13 +265,13 @@
223265
<receiver>QgsPluginInstallerRepositoryDetailsDialogBase</receiver>
224266
<slot>reject()</slot>
225267
<hints>
226-
<hint type="sourcelabel" >
227-
<x>325</x>
228-
<y>207</y>
268+
<hint type="sourcelabel">
269+
<x>344</x>
270+
<y>178</y>
229271
</hint>
230-
<hint type="destinationlabel" >
272+
<hint type="destinationlabel">
231273
<x>286</x>
232-
<y>216</y>
274+
<y>184</y>
233275
</hint>
234276
</hints>
235277
</connection>

0 commit comments

Comments
 (0)
Please sign in to comment.