Skip to content

Commit 13795a6

Browse files
committed
UI resized.
1 parent 04ed3ad commit 13795a6

25 files changed

+1348
-78
lines changed

Diff for: geobricks_qgis_plugin_faostat.py

+19-15
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ def __init__(self, iface):
6464

6565
# Declare instance attributes
6666
self.actions = []
67-
self.menu = self.tr(u'&FAOSTAT Data Downloader')
67+
self.menu = self.tr('FAOSTAT Data Downloader')
6868
# TODO: We are going to let the user set this up in a future iteration
69-
self.toolbar = self.iface.addToolBar(u'geobricks_qgis_plugin_faostat')
70-
self.toolbar.setObjectName(u'geobricks_qgis_plugin_faostat')
69+
self.toolbar = self.iface.addToolBar('geobricks_qgis_plugin_faostat')
70+
self.toolbar.setObjectName('geobricks_qgis_plugin_faostat')
7171

7272
# TODO: check if there is a better way to handle inizialition
7373
self.initialized = False
@@ -167,7 +167,7 @@ def initGui(self):
167167
icon_path = ':/plugins/geobricks_qgis_plugin_faostat/icon.png'
168168
self.add_action(
169169
icon_path,
170-
text=self.tr(u'FAOSTAT Data Downloader'),
170+
text=self.tr('FAOSTAT Data Downloader'),
171171
callback=self.run,
172172
parent=self.iface.mainWindow())
173173

@@ -176,20 +176,21 @@ def unload(self):
176176
"""Removes the plugin menu item and icon from QGIS GUI."""
177177
for action in self.actions:
178178
self.iface.removePluginMenu(
179-
self.tr(u'&FAOSTAT Data Downloader'),
179+
self.tr('FAOSTAT Data Downloader'),
180180
action)
181181
self.iface.removeToolBarIcon(action)
182182
# remove the toolbar
183183
del self.toolbar
184184

185185

186186
def update_items_elements(self):
187-
188-
domain_name = self.dlg.cbDomain.currentText()
189-
domain_code = self.domains[domain_name]
190-
191-
self.update_items(domain_code)
192-
self.update_elements(domain_code)
187+
try:
188+
domain_name = self.dlg.cbDomain.currentText()
189+
domain_code = self.domains[domain_name]
190+
self.update_items(domain_code)
191+
self.update_elements(domain_code)
192+
except:
193+
pass
193194

194195
def update_items(self, domain_code):
195196

@@ -198,12 +199,13 @@ def update_items(self, domain_code):
198199
data = get_items(domain_code)
199200

200201
values = []
202+
values.append('Please select an item...')
201203
self.elements = {}
202204
for d in data:
203205
self.domains[d['label']] = d
204206
values.append(d['label'])
205207

206-
values.sort()
208+
# values.sort()
207209
self.dlg.cbItem.addItems(values)
208210

209211
def update_elements(self, domain_code):
@@ -213,12 +215,13 @@ def update_elements(self, domain_code):
213215
data = get_elements(domain_code)
214216

215217
values = []
218+
values.append('Please select an element...')
216219
self.elements = {}
217220
for d in data:
218221
self.domains[d['label']] = d
219222
values.append(d['label'])
220223

221-
values.sort()
224+
# values.sort()
222225
self.dlg.cbElement.addItems(values)
223226

224227

@@ -239,12 +242,13 @@ def initialize_domains(self):
239242

240243
# cache codes
241244
values = []
245+
values.append('Please select a domain...')
242246
self.domains = {}
243247
for d in data:
244248
self.domains[d['name']] = d['id']
245249
values.append(d['name'])
246250

247-
values.sort()
251+
# values.sort()
248252
self.dlg.cbDomain.addItems(values)
249253

250254
def select_output_file(self):
@@ -255,7 +259,7 @@ def run(self):
255259

256260
# if the interface is initiated
257261
if self.initialized:
258-
self.dlg.progressText.setText('')
262+
# self.dlg.progressText.setText('')
259263
self.dlg.progressBar.setValue(0)
260264

261265
if not self.initialized:

Diff for: geobricks_qgis_plugin_faostat_dialog_base.ui

+27-40
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>393</width>
10-
<height>316</height>
9+
<width>390</width>
10+
<height>290</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -16,45 +16,19 @@
1616
<widget class="QComboBox" name="cbItem">
1717
<property name="geometry">
1818
<rect>
19-
<x>10</x>
19+
<x>8</x>
2020
<y>80</y>
21-
<width>231</width>
21+
<width>376</width>
2222
<height>27</height>
2323
</rect>
2424
</property>
2525
</widget>
26-
<widget class="QProgressBar" name="progressBar">
27-
<property name="geometry">
28-
<rect>
29-
<x>10</x>
30-
<y>282</y>
31-
<width>191</width>
32-
<height>21</height>
33-
</rect>
34-
</property>
35-
<property name="value">
36-
<number>0</number>
37-
</property>
38-
</widget>
39-
<widget class="QLabel" name="progressText">
40-
<property name="geometry">
41-
<rect>
42-
<x>10</x>
43-
<y>260</y>
44-
<width>371</width>
45-
<height>17</height>
46-
</rect>
47-
</property>
48-
<property name="text">
49-
<string/>
50-
</property>
51-
</widget>
5226
<widget class="QComboBox" name="cbDomain">
5327
<property name="geometry">
5428
<rect>
55-
<x>10</x>
29+
<x>8</x>
5630
<y>30</y>
57-
<width>231</width>
31+
<width>376</width>
5832
<height>27</height>
5933
</rect>
6034
</property>
@@ -63,7 +37,7 @@
6337
<property name="geometry">
6438
<rect>
6539
<x>210</x>
66-
<y>280</y>
40+
<y>254</y>
6741
<width>176</width>
6842
<height>27</height>
6943
</rect>
@@ -77,7 +51,7 @@
7751
<rect>
7852
<x>10</x>
7953
<y>190</y>
80-
<width>281</width>
54+
<width>303</width>
8155
<height>27</height>
8256
</rect>
8357
</property>
@@ -89,7 +63,7 @@
8963
<property name="geometry">
9064
<rect>
9165
<x>10</x>
92-
<y>230</y>
66+
<y>225</y>
9367
<width>361</width>
9468
<height>22</height>
9569
</rect>
@@ -104,10 +78,10 @@
10478
<widget class="QPushButton" name="pushButton">
10579
<property name="geometry">
10680
<rect>
107-
<x>300</x>
108-
<y>190</y>
81+
<x>306</x>
82+
<y>186</y>
10983
<width>81</width>
110-
<height>27</height>
84+
<height>39</height>
11185
</rect>
11286
</property>
11387
<property name="text">
@@ -169,13 +143,26 @@
169143
<widget class="QComboBox" name="cbElement">
170144
<property name="geometry">
171145
<rect>
172-
<x>10</x>
146+
<x>8</x>
173147
<y>130</y>
174-
<width>231</width>
148+
<width>376</width>
175149
<height>27</height>
176150
</rect>
177151
</property>
178152
</widget>
153+
<widget class="QProgressBar" name="progressBar">
154+
<property name="geometry">
155+
<rect>
156+
<x>10</x>
157+
<y>254</y>
158+
<width>208</width>
159+
<height>23</height>
160+
</rect>
161+
</property>
162+
<property name="value">
163+
<number>0</number>
164+
</property>
165+
</widget>
179166
</widget>
180167
<resources/>
181168
<connections/>

Diff for: help/Makefile

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14+
15+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16+
17+
help:
18+
@echo "Please use \`make <target>' where <target> is one of"
19+
@echo " html to make standalone HTML files"
20+
@echo " dirhtml to make HTML files named index.html in directories"
21+
@echo " singlehtml to make a single large HTML file"
22+
@echo " pickle to make pickle files"
23+
@echo " json to make JSON files"
24+
@echo " htmlhelp to make HTML files and a HTML help project"
25+
@echo " qthelp to make HTML files and a qthelp project"
26+
@echo " devhelp to make HTML files and a Devhelp project"
27+
@echo " epub to make an epub"
28+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
29+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
30+
@echo " text to make text files"
31+
@echo " man to make manual pages"
32+
@echo " changes to make an overview of all changed/added/deprecated items"
33+
@echo " linkcheck to check all external links for integrity"
34+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
35+
36+
clean:
37+
-rm -rf $(BUILDDIR)/*
38+
39+
html:
40+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
41+
@echo
42+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
43+
44+
dirhtml:
45+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
46+
@echo
47+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
48+
49+
singlehtml:
50+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51+
@echo
52+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53+
54+
pickle:
55+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
56+
@echo
57+
@echo "Build finished; now you can process the pickle files."
58+
59+
json:
60+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
61+
@echo
62+
@echo "Build finished; now you can process the JSON files."
63+
64+
htmlhelp:
65+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
66+
@echo
67+
@echo "Build finished; now you can run HTML Help Workshop with the" \
68+
".hhp project file in $(BUILDDIR)/htmlhelp."
69+
70+
qthelp:
71+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
72+
@echo
73+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
74+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
75+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/template_class.qhcp"
76+
@echo "To view the help file:"
77+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/template_class.qhc"
78+
79+
devhelp:
80+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
81+
@echo
82+
@echo "Build finished."
83+
@echo "To view the help file:"
84+
@echo "# mkdir -p $$HOME/.local/share/devhelp/template_class"
85+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/template_class"
86+
@echo "# devhelp"
87+
88+
epub:
89+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
90+
@echo
91+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
92+
93+
latex:
94+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
95+
@echo
96+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
97+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
98+
"(use \`make latexpdf' here to do that automatically)."
99+
100+
latexpdf:
101+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102+
@echo "Running LaTeX files through pdflatex..."
103+
make -C $(BUILDDIR)/latex all-pdf
104+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105+
106+
text:
107+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
108+
@echo
109+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
110+
111+
man:
112+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
113+
@echo
114+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115+
116+
changes:
117+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118+
@echo
119+
@echo "The overview file is in $(BUILDDIR)/changes."
120+
121+
linkcheck:
122+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
123+
@echo
124+
@echo "Link check complete; look for any errors in the above output " \
125+
"or in $(BUILDDIR)/linkcheck/output.txt."
126+
127+
doctest:
128+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129+
@echo "Testing of doctests in the sources finished, look at the " \
130+
"results in $(BUILDDIR)/doctest/output.txt."

0 commit comments

Comments
 (0)