Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
timlinux committed May 22, 2011
2 parents ffed1d7 + 9784cd7 commit 5fea5a8c6194822a0b19feb4cffe2c4efd7741ae
Showing with 7,811 additions and 787 deletions.
  1. +4 −0 images/images.qrc
  2. BIN images/themes/default/customization/calendarwidget.png
  3. BIN images/themes/default/customization/checkbox.png
  4. BIN images/themes/default/customization/columnview.png
  5. BIN images/themes/default/customization/combobox.png
  6. BIN images/themes/default/customization/commandlinkbutton.png
  7. BIN images/themes/default/customization/dateedit.png
  8. BIN images/themes/default/customization/datetimeedit.png
  9. BIN images/themes/default/customization/dial.png
  10. BIN images/themes/default/customization/dialogbuttonbox.png
  11. BIN images/themes/default/customization/dockwidget.png
  12. BIN images/themes/default/customization/doublespinbox.png
  13. BIN images/themes/default/customization/fontcombobox.png
  14. BIN images/themes/default/customization/frame.png
  15. BIN images/themes/default/customization/graphicsview.png
  16. BIN images/themes/default/customization/groupbox.png
  17. BIN images/themes/default/customization/groupboxcollapsible.png
  18. BIN images/themes/default/customization/hscrollbar.png
  19. BIN images/themes/default/customization/hslider.png
  20. BIN images/themes/default/customization/hsplit.png
  21. BIN images/themes/default/customization/label.png
  22. BIN images/themes/default/customization/lcdnumber.png
  23. BIN images/themes/default/customization/line.png
  24. BIN images/themes/default/customization/lineedit.png
  25. BIN images/themes/default/customization/listbox.png
  26. BIN images/themes/default/customization/listview.png
  27. BIN images/themes/default/customization/mdiarea.png
  28. BIN images/themes/default/customization/plaintextedit.png
  29. BIN images/themes/default/customization/progress.png
  30. BIN images/themes/default/customization/pushbutton.png
  31. BIN images/themes/default/customization/radiobutton.png
  32. BIN images/themes/default/customization/scrollarea.png
  33. BIN images/themes/default/customization/spacer.png
  34. BIN images/themes/default/customization/spinbox.png
  35. BIN images/themes/default/customization/tabbar.png
  36. BIN images/themes/default/customization/table.png
  37. BIN images/themes/default/customization/tabwidget.png
  38. BIN images/themes/default/customization/textedit.png
  39. BIN images/themes/default/customization/timeedit.png
  40. BIN images/themes/default/customization/toolbox.png
  41. BIN images/themes/default/customization/toolbutton.png
  42. BIN images/themes/default/customization/vline.png
  43. BIN images/themes/default/customization/vscrollbar.png
  44. BIN images/themes/default/customization/vslider.png
  45. BIN images/themes/default/customization/vspacer.png
  46. BIN images/themes/default/customization/widget.png
  47. BIN images/themes/default/customization/widgetstack.png
  48. BIN images/themes/default/customization/wizard.png
  49. BIN images/themes/default/grass_location.png
  50. BIN images/themes/default/grass_mapset.png
  51. BIN images/themes/default/mIconWms.png
  52. BIN images/themes/default/mIconWmsLayer.png
  53. +129 −0 python/widgets_tree.py
  54. +1 −1 resources/CMakeLists.txt
  55. +2,024 −0 resources/customization.xml
  56. +1 −1 src/CMakeLists.txt
  57. +3 −20 src/app/CMakeLists.txt
  58. +52 −16 src/app/attributetable/qgsattributetabledialog.cpp
  59. +25 −0 src/app/attributetable/qgsattributetabledialog.h
  60. +26 −0 src/app/main.cpp
  61. +90 −119 src/app/qgisapp.cpp
  62. +13 −15 src/app/qgisapp.h
  63. +5 −4 src/app/qgsattributedialog.cpp
  64. +899 −0 src/app/qgscustomization.cpp
  65. +165 −0 src/app/qgscustomization.h
  66. +9 −245 src/app/qgsvectorlayerproperties.cpp
  67. +112 −0 src/browser/CMakeLists.txt
  68. +112 −0 src/browser/main.cpp
  69. +505 −0 src/browser/qgsbrowser.cpp
  70. +84 −0 src/browser/qgsbrowser.h
  71. +246 −0 src/browser/qgsbrowserbase.ui
  72. +312 −0 src/browser/qgsbrowsermodel.cpp
  73. +70 −0 src/browser/qgsbrowsermodel.h
  74. +18 −0 src/browser/template.cpp
  75. +22 −0 src/browser/template.h
  76. +5 −0 src/core/CMakeLists.txt
  77. +4 −4 src/core/composer/qgscomposermap.cpp
  78. +8 −1 src/core/qgsapplication.cpp
  79. +3 −0 src/core/qgsapplication.h
  80. +7 −0 src/core/qgsattributeaction.cpp
  81. +1 −0 src/core/qgsattributeaction.h
  82. +558 −0 src/core/qgsdataitem.cpp
  83. +238 −0 src/core/qgsdataitem.h
  84. +13 −0 src/core/qgsdataprovider.h
  85. +5 −0 src/core/qgsmaplayer.cpp
  86. +3 −0 src/core/qgsmaplayer.h
  87. +60 −0 src/core/qgsproviderregistry.cpp
  88. +14 −0 src/core/qgsproviderregistry.h
  89. +43 −0 src/core/qgspythonrunner.cpp
  90. +41 −0 src/core/qgspythonrunner.h
  91. +232 −0 src/core/qgsvectorlayer.cpp
  92. +2 −0 src/core/qgsvectorlayer.h
  93. +2 −2 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
  94. +27 −0 src/gui/CMakeLists.txt
  95. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.cpp
  96. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.h
  97. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.cpp
  98. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.h
  99. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.cpp
  100. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.h
  101. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.cpp
  102. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.h
  103. +5 −9 src/{app → gui}/attributetable/qgsattributetablemodel.cpp
  104. +11 −2 src/{app → gui}/attributetable/qgsattributetablemodel.h
  105. +22 −32 src/{app → gui}/attributetable/qgsattributetableview.cpp
  106. +4 −21 src/{app → gui}/attributetable/qgsattributetableview.h
  107. +2 −1 src/gui/qgsannotationitem.cpp
  108. 0 src/{app → gui}/qgsmanageconnectionsdialog.cpp
  109. +1 −1 src/{app → gui}/qgsmanageconnectionsdialog.h
  110. +1 −1 src/gui/qgsmapcanvasitem.cpp
  111. 0 src/{app → gui}/qgsnewhttpconnection.cpp
  112. +1 −1 src/{app → gui}/qgsnewhttpconnection.h
  113. +105 −3 src/{app → gui}/qgsnewvectorlayerdialog.cpp
  114. +5 −1 src/{app → gui}/qgsnewvectorlayerdialog.h
  115. 0 src/{app → gui}/qgsnumericsortlistviewitem.cpp
  116. +1 −1 src/{app → gui}/qgsnumericsortlistviewitem.h
  117. +1 −1 src/plugins/georeferencer/qgsgcpcanvasitem.cpp
  118. +1 −1 src/plugins/grass/qgsgrassbrowser.cpp
  119. +1 −1 src/plugins/grass/qgsgrassmodel.cpp
  120. +1 −1 src/plugins/grass/qgsgrassmodule.cpp
  121. +1 −95 src/plugins/grass/qgsgrassselect.cpp
  122. +0 −3 src/plugins/grass/qgsgrassselect.h
  123. +1 −1 src/plugins/grass/qgsgrassutils.cpp
  124. +0 −5 src/plugins/wfs/CMakeLists.txt
  125. +135 −11 src/providers/gdal/qgsgdalprovider.cpp
  126. +12 −2 src/providers/gdal/qgsgdalprovider.h
  127. +2 −2 src/providers/grass/CMakeLists.txt
  128. +93 −0 src/providers/grass/qgsgrass.cpp
  129. +3 −0 src/providers/grass/qgsgrass.h
  130. +125 −0 src/providers/grass/qgsgrassprovider.cpp
  131. +28 −1 src/providers/grass/qgsgrassprovider.h
  132. +270 −4 src/providers/ogr/qgsogrprovider.cpp
  133. +13 −0 src/providers/ogr/qgsogrprovider.h
  134. +1 −0 src/providers/wfs/qgswfsdata.cpp
  135. +15 −3 src/providers/wms/CMakeLists.txt
  136. +131 −0 src/providers/wms/qgswmsconnection.cpp
  137. +55 −0 src/providers/wms/qgswmsconnection.h
  138. +245 −2 src/providers/wms/qgswmsprovider.cpp
  139. +56 −0 src/providers/wms/qgswmsprovider.h
  140. +76 −137 src/{app → providers/wms}/qgswmssourceselect.cpp
  141. +21 −4 src/{app → providers/wms}/qgswmssourceselect.h
  142. +33 −12 src/ui/qgisapp.ui
  143. +140 −0 src/ui/qgscustomizationdialogbase.ui
@@ -13,6 +13,8 @@
<file>themes/default/geographic.png</file>
<file>themes/default/gpsicons/barchart.svg</file>
<file>themes/default/gpsicons/polarchart.svg</file>
<file>themes/default/grass_location.png</file>
<file>themes/default/grass_mapset.png</file>
<file>themes/default/join_bevel.png</file>
<file>themes/default/join_miter.png</file>
<file>themes/default/join_round.png</file>
@@ -178,6 +180,8 @@
<file>themes/default/mIconTableLayer.png</file>
<file>themes/default/mIconUnknownLayerType.png</file>
<file>themes/default/mIconWaitingForLayerType.png</file>
<file>themes/default/mIconWms.png</file>
<file>themes/default/mIconWmsLayer.png</file>
<file>themes/default/mMapserverExport.png</file>
<file>themes/default/plugin.png</file>
<file>themes/default/propertyicons/action.png</file>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -0,0 +1,129 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

"""
Reads .ui files from ../src/ui/ directory and write to stdout an XML describing
widgets tree.
Python bindings must be compiled and in PYTHONPATH
QGIS libraries must be in LD_LIBRARY_PATH
Output should go to ../resources/customization.xml
"""

import sys
import os, glob, imp
from PyQt4.QtGui import *
from PyQt4.uic import loadUi, compileUi
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import minidom

# qwt_plot is missing somehow but it may depend on installed packages
from PyQt4 import Qwt5 as qwt_plot
sys.modules['qwt_plot'] = qwt_plot

# loadUi is looking for custom widget in module which is lowercase version of
# the class, which do not exist (AFAIK) -> preload them, problems anyway:
# missing in gui: QgsColorRampComboBox, QgsRendererRulesTreeWidget,
# QgsRendererRulesTreeWidget, QgsAttributeTableView
# and QgsProjectionSelector cannot open db file
from qgis import gui
for m in ['qgscolorbutton', 'qgscolorrampcombobox', 'qgsprojectionselector', 'qgslabelpreview', 'qgsrulebasedrendererv2widget', 'qgsattributetableview' ]:
sys.modules[m] = gui

class UiInspector:
def __init__(self ):
self.ui_dir = os.path.abspath ( os.path.join( os.path.dirname(__file__) , '../src/ui/*.ui' ) )
self.printMsg ( "Loading UI files " + self.ui_dir )
# list of widget classes we want to follow
self.follow = [
QWidget, QDialog,
QCheckBox, QComboBox, QDial, QPushButton, QLabel, QLCDNumber, QLineEdit, QRadioButton, QScrollBar, QSlider, QSpinBox, QTextEdit,
QDateEdit, QTimeEdit, QDateTimeEdit, QListView, QProgressBar, QTableView, QTabWidget, QTextBrowser, QDialogButtonBox,
QScrollArea, QGroupBox, QStackedWidget,
]

def printMsg ( self, msg ):
sys.stderr.write( msg + "\n" )

def widgetXml(self, element, widget, level = 0, label = None ):
#print tostring ( element )
#self.printMsg ( "class: " + str( type ( widget ) ) )
#self.printMsg ( "objectName: " + widget.objectName() )
#self.printMsg ( "windowTitle: " + widget.windowTitle() )

if not widget.objectName(): return

lab = label
if hasattr( widget, 'text' ):
lab = widget.text()
if widget.windowTitle():
label = widget.windowTitle()
if not lab:
lab = ''

lab = unicode(lab).encode("ascii","replace")

sub_element = SubElement( element, 'widget')
sub_element.set('class', widget.__class__.__name__ )
sub_element.set('objectName', widget.objectName() )
sub_element.set('label', lab )

#print str ( widget.children () )
# tab widget label is stored in QTabWidget->QTabBarPrivate->tabList->QTab ..
if type(widget) in [ QTabWidget ]:
children = list ( { 'widget': widget.widget(i), 'label': widget.tabText(i) } for i in range ( 0, widget.count() ) )
else:
children = list ( { 'widget': c, 'label': None } for c in widget.children () )
for child in children:
w = child['widget']
if w.isWidgetType() and ( type(w) in self.follow ):
self.widgetXml ( sub_element, w, level+1, child['label'] )


def treeXml(self, element ):
xml = ''
# debug
for p in glob.glob( self.ui_dir ):
#for p in ['/home/radim/devel/qgis_trunk/src/ui/qgsabout.ui']:
#for p in ['/home/radim/devel/qgis_trunk/src/ui/qgsrasterlayerpropertiesbase.ui']:
self.printMsg ( "Loading " + p )
# qgsrasterlayerpropertiesbase.ui is giving: No module named qwt_plot
try:
widget = loadUi ( p )
#print dir ( ui )
self.widgetXml ( element, widget )
except Exception, e:
#except IOError, e:
self.printMsg ( str(e) )

return xml

def xml( self ) :
#xml = "<?xml version='1.0' encoding='UTF-8'?>\n"
#xml += "<!DOCTYPE qgiswidgets SYSTEM 'http://mrcc.com/qgiswidgets.dtd'>\n"
element = Element('qgiswidgets')
self.treeXml( element )

string = tostring ( element, 'utf-8' )
reparsed = minidom.parseString(string)
xml = reparsed.toprettyxml(indent=" ")
return xml


if __name__ == '__main__':
app = QApplication(sys.argv) # required by loadUi
inspector = UiInspector()
xml = inspector.xml()
sys.stdout.write( xml )
sys.stdout.flush()

del app
sys.exit(0)
@@ -1,5 +1,5 @@

INSTALL(FILES srs.db qgis.db qgis_help.db symbology-ng-style.xml spatialite.db
INSTALL(FILES srs.db qgis.db qgis_help.db symbology-ng-style.xml spatialite.db customization.xml
DESTINATION ${QGIS_DATA_DIR}/resources)

SUBDIRS(context_help)

0 comments on commit 5fea5a8

Please sign in to comment.
You can’t perform that action at this time.