Skip to content
Permalink
Browse files

All customization and QGIS browser work in one commit.

  • Loading branch information
wonder-sk committed May 13, 2011
1 parent c087409 commit 153ad164fefc34555e64d5ec70513f16be6a862b
Showing with 9,312 additions and 695 deletions.
  1. 0 dbl.txt
  2. +2 −0 images/images.qrc
  3. BIN images/splash/deblin.png
  4. BIN images/splash/splash.png
  5. BIN images/splash/splash.png.orig
  6. BIN images/themes/default/customization/calendarwidget.png
  7. BIN images/themes/default/customization/checkbox.png
  8. BIN images/themes/default/customization/columnview.png
  9. BIN images/themes/default/customization/combobox.png
  10. BIN images/themes/default/customization/commandlinkbutton.png
  11. BIN images/themes/default/customization/dateedit.png
  12. BIN images/themes/default/customization/datetimeedit.png
  13. BIN images/themes/default/customization/dial.png
  14. BIN images/themes/default/customization/dialogbuttonbox.png
  15. BIN images/themes/default/customization/dockwidget.png
  16. BIN images/themes/default/customization/doublespinbox.png
  17. BIN images/themes/default/customization/fontcombobox.png
  18. BIN images/themes/default/customization/frame.png
  19. BIN images/themes/default/customization/graphicsview.png
  20. BIN images/themes/default/customization/groupbox.png
  21. BIN images/themes/default/customization/groupboxcollapsible.png
  22. BIN images/themes/default/customization/hscrollbar.png
  23. BIN images/themes/default/customization/hslider.png
  24. BIN images/themes/default/customization/hsplit.png
  25. BIN images/themes/default/customization/label.png
  26. BIN images/themes/default/customization/lcdnumber.png
  27. BIN images/themes/default/customization/line.png
  28. BIN images/themes/default/customization/lineedit.png
  29. BIN images/themes/default/customization/listbox.png
  30. BIN images/themes/default/customization/listview.png
  31. BIN images/themes/default/customization/mdiarea.png
  32. BIN images/themes/default/customization/plaintextedit.png
  33. BIN images/themes/default/customization/progress.png
  34. BIN images/themes/default/customization/pushbutton.png
  35. BIN images/themes/default/customization/radiobutton.png
  36. BIN images/themes/default/customization/scrollarea.png
  37. BIN images/themes/default/customization/spacer.png
  38. BIN images/themes/default/customization/spinbox.png
  39. BIN images/themes/default/customization/tabbar.png
  40. BIN images/themes/default/customization/table.png
  41. BIN images/themes/default/customization/tabwidget.png
  42. BIN images/themes/default/customization/textedit.png
  43. BIN images/themes/default/customization/timeedit.png
  44. BIN images/themes/default/customization/toolbox.png
  45. BIN images/themes/default/customization/toolbutton.png
  46. BIN images/themes/default/customization/vline.png
  47. BIN images/themes/default/customization/vscrollbar.png
  48. BIN images/themes/default/customization/vslider.png
  49. BIN images/themes/default/customization/vspacer.png
  50. BIN images/themes/default/customization/widget.png
  51. BIN images/themes/default/customization/widgetstack.png
  52. BIN images/themes/default/customization/wizard.png
  53. BIN images/themes/default/mIconWms.png
  54. BIN images/themes/default/mIconWmsLayer.png
  55. +129 −0 python/widgets_tree.py
  56. +1 −1 resources/CMakeLists.txt
  57. +1,832 −0 resources/customization.ini
  58. +2,024 −0 resources/customization.xml
  59. +1 −1 src/CMakeLists.txt
  60. +3 −20 src/app/CMakeLists.txt
  61. +52 −16 src/app/attributetable/qgsattributetabledialog.cpp
  62. +25 −0 src/app/attributetable/qgsattributetabledialog.h
  63. +26 −0 src/app/main.cpp
  64. +72 −110 src/app/qgisapp.cpp
  65. +13 −15 src/app/qgisapp.h
  66. +5 −4 src/app/qgsattributedialog.cpp
  67. +897 −0 src/app/qgscustomization.cpp
  68. +165 −0 src/app/qgscustomization.h
  69. +32 −276 src/app/qgsvectorlayerproperties.cpp
  70. +112 −0 src/browser/CMakeLists.txt
  71. +112 −0 src/browser/main.cpp
  72. +481 −0 src/browser/qgsbrowser.cpp
  73. +81 −0 src/browser/qgsbrowser.h
  74. +246 −0 src/browser/qgsbrowserbase.ui
  75. +314 −0 src/browser/qgsbrowsermodel.cpp
  76. +70 −0 src/browser/qgsbrowsermodel.h
  77. +18 −0 src/browser/template.cpp
  78. +22 −0 src/browser/template.h
  79. +5 −0 src/core/CMakeLists.txt
  80. +8 −1 src/core/qgsapplication.cpp
  81. +3 −0 src/core/qgsapplication.h
  82. +7 −0 src/core/qgsattributeaction.cpp
  83. +1 −0 src/core/qgsattributeaction.h
  84. +514 −0 src/core/qgsdataitem.cpp
  85. +197 −0 src/core/qgsdataitem.h
  86. +13 −0 src/core/qgsdataprovider.h
  87. +5 −0 src/core/qgsmaplayer.cpp
  88. +3 −0 src/core/qgsmaplayer.h
  89. +60 −0 src/core/qgsproviderregistry.cpp
  90. +14 −0 src/core/qgsproviderregistry.h
  91. +43 −0 src/core/qgspythonrunner.cpp
  92. +41 −0 src/core/qgspythonrunner.h
  93. +233 −0 src/core/qgsvectorlayer.cpp
  94. +2 −0 src/core/qgsvectorlayer.h
  95. +27 −0 src/gui/CMakeLists.txt
  96. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.cpp
  97. 0 src/{app → gui}/attributetable/qgsattributetabledelegate.h
  98. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.cpp
  99. 0 src/{app → gui}/attributetable/qgsattributetablefiltermodel.h
  100. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.cpp
  101. 0 src/{app → gui}/attributetable/qgsattributetableidcolumnpair.h
  102. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.cpp
  103. 0 src/{app → gui}/attributetable/qgsattributetablememorymodel.h
  104. +5 −9 src/{app → gui}/attributetable/qgsattributetablemodel.cpp
  105. +11 −2 src/{app → gui}/attributetable/qgsattributetablemodel.h
  106. +22 −32 src/{app → gui}/attributetable/qgsattributetableview.cpp
  107. +4 −21 src/{app → gui}/attributetable/qgsattributetableview.h
  108. 0 src/{app → gui}/qgsmanageconnectionsdialog.cpp
  109. +1 −1 src/{app → gui}/qgsmanageconnectionsdialog.h
  110. 0 src/{app → gui}/qgsnewhttpconnection.cpp
  111. +1 −1 src/{app → gui}/qgsnewhttpconnection.h
  112. +105 −3 src/{app → gui}/qgsnewvectorlayerdialog.cpp
  113. +5 −1 src/{app → gui}/qgsnewvectorlayerdialog.h
  114. 0 src/{app → gui}/qgsnumericsortlistviewitem.cpp
  115. +1 −1 src/{app → gui}/qgsnumericsortlistviewitem.h
  116. +0 −5 src/plugins/wfs/CMakeLists.txt
  117. +147 −11 src/providers/gdal/qgsgdalprovider.cpp
  118. +14 −2 src/providers/gdal/qgsgdalprovider.h
  119. +280 −4 src/providers/ogr/qgsogrprovider.cpp
  120. +16 −0 src/providers/ogr/qgsogrprovider.h
  121. +15 −3 src/providers/wms/CMakeLists.txt
  122. +131 −0 src/providers/wms/qgswmsconnection.cpp
  123. +55 −0 src/providers/wms/qgswmsconnection.h
  124. +258 −2 src/providers/wms/qgswmsprovider.cpp
  125. +60 −0 src/providers/wms/qgswmsprovider.h
  126. +76 −137 src/{app → providers/wms}/qgswmssourceselect.cpp
  127. +21 −4 src/{app → providers/wms}/qgswmssourceselect.h
  128. +33 −12 src/ui/qgisapp.ui
  129. +140 −0 src/ui/qgscustomizationdialogbase.ui
Empty file.
@@ -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.
BIN -150 KB (65%) images/splash/splash.png
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 customization.ini
DESTINATION ${QGIS_DATA_DIR}/resources)

SUBDIRS(context_help)

0 comments on commit 153ad16

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