Skip to content
Permalink
Browse files

Merge branch 'browser-and-customization'

  • Loading branch information
wonder-sk committed May 20, 2011
2 parents 0390131 + 62db3d7 commit b656ebdea48fd0cfe8a4abea1b11aa8b3b34029f
Showing with 7,473 additions and 673 deletions.
  1. +2 −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/mIconWms.png
  50. BIN images/themes/default/mIconWmsLayer.png
  51. +129 −0 python/widgets_tree.py
  52. +1 −1 resources/CMakeLists.txt
  53. +2,024 −0 resources/customization.xml
  54. +1 −1 src/CMakeLists.txt
  55. +3 −20 src/app/CMakeLists.txt
  56. +52 −16 src/app/attributetable/qgsattributetabledialog.cpp
  57. +25 −0 src/app/attributetable/qgsattributetabledialog.h
  58. +26 −0 src/app/main.cpp
  59. +90 −119 src/app/qgisapp.cpp
  60. +13 −15 src/app/qgisapp.h
  61. +5 −4 src/app/qgsattributedialog.cpp
  62. +899 −0 src/app/qgscustomization.cpp
  63. +165 −0 src/app/qgscustomization.h
  64. +9 −245 src/app/qgsvectorlayerproperties.cpp
  65. +112 −0 src/browser/CMakeLists.txt
  66. +112 −0 src/browser/main.cpp
  67. +505 −0 src/browser/qgsbrowser.cpp
  68. +84 −0 src/browser/qgsbrowser.h
  69. +246 −0 src/browser/qgsbrowserbase.ui
  70. +311 −0 src/browser/qgsbrowsermodel.cpp
  71. +70 −0 src/browser/qgsbrowsermodel.h
  72. +18 −0 src/browser/template.cpp
  73. +22 −0 src/browser/template.h
  74. +5 −0 src/core/CMakeLists.txt
  75. +8 −1 src/core/qgsapplication.cpp
  76. +3 −0 src/core/qgsapplication.h
  77. +7 −0 src/core/qgsattributeaction.cpp
  78. +1 −0 src/core/qgsattributeaction.h
  79. +497 −0 src/core/qgsdataitem.cpp
  80. +231 −0 src/core/qgsdataitem.h
  81. +13 −0 src/core/qgsdataprovider.h
  82. +5 −0 src/core/qgsmaplayer.cpp
  83. +3 −0 src/core/qgsmaplayer.h
  84. +60 −0 src/core/qgsproviderregistry.cpp
  85. +14 −0 src/core/qgsproviderregistry.h
  86. +43 −0 src/core/qgspythonrunner.cpp
  87. +41 −0 src/core/qgspythonrunner.h
  88. +232 −0 src/core/qgsvectorlayer.cpp
  89. +2 −0 src/core/qgsvectorlayer.h
  90. +27 −0 src/gui/CMakeLists.txt
  91. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.cpp
  92. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.h
  93. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.cpp
  94. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.h
  95. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.cpp
  96. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.h
  97. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.cpp
  98. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.h
  99. +5 −9 src/{app → gui}/attributetable/qgsattributetablemodel.cpp
  100. +11 −2 src/{app → gui}/attributetable/qgsattributetablemodel.h
  101. +22 −32 src/{app → gui}/attributetable/qgsattributetableview.cpp
  102. +4 −21 src/{app → gui}/attributetable/qgsattributetableview.h
  103. 0 src/{app → gui}/qgsmanageconnectionsdialog.cpp
  104. +1 −1 src/{app → gui}/qgsmanageconnectionsdialog.h
  105. 0 src/{app → gui}/qgsnewhttpconnection.cpp
  106. +1 −1 src/{app → gui}/qgsnewhttpconnection.h
  107. +105 −3 src/{app → gui}/qgsnewvectorlayerdialog.cpp
  108. +5 −1 src/{app → gui}/qgsnewvectorlayerdialog.h
  109. 0 src/{app → gui}/qgsnumericsortlistviewitem.cpp
  110. +1 −1 src/{app → gui}/qgsnumericsortlistviewitem.h
  111. +0 −5 src/plugins/wfs/CMakeLists.txt
  112. +135 −11 src/providers/gdal/qgsgdalprovider.cpp
  113. +12 −2 src/providers/gdal/qgsgdalprovider.h
  114. +270 −4 src/providers/ogr/qgsogrprovider.cpp
  115. +13 −0 src/providers/ogr/qgsogrprovider.h
  116. +15 −3 src/providers/wms/CMakeLists.txt
  117. +131 −0 src/providers/wms/qgswmsconnection.cpp
  118. +55 −0 src/providers/wms/qgswmsconnection.h
  119. +245 −2 src/providers/wms/qgswmsprovider.cpp
  120. +56 −0 src/providers/wms/qgswmsprovider.h
  121. +76 −137 src/{app → providers/wms}/qgswmssourceselect.cpp
  122. +21 −4 src/{app → providers/wms}/qgswmssourceselect.h
  123. +33 −12 src/ui/qgisapp.ui
  124. +140 −0 src/ui/qgscustomizationdialogbase.ui
@@ -178,6 +178,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.
@@ -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 b656ebd

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