Commit 95b533f1 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

tbd

parent 0c7f3d27
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>322</width>
<height>213</height>
<width>312</width>
<height>269</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -31,355 +31,121 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>299</width>
<height>500</height>
</rect>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>257</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QToolButton" name="btnToggleMapViewVisibility">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Toggle map view visibility</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/timeseriesviewer/icons/mapviewHidden.svg</normaloff>:/timeseriesviewer/icons/mapviewHidden.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="popupMode">
<enum>QToolButton::DelayedPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnToggleCrosshair">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>500</height>
<width>40</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QFrame" name="btnBar">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QToolButton" name="btnToggleMapViewVisibility">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Toggle map view visibility</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/timeseriesviewer/icons/mapviewHidden.svg</normaloff>:/timeseriesviewer/icons/mapviewHidden.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="popupMode">
<enum>QToolButton::DelayedPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnToggleCrosshair">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Show/hide crosshair</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/timeseriesviewer/icons/crosshair.svg</normaloff>:/timeseriesviewer/icons/crosshair.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tbName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Map View Title</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="gbVectorRendering">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Vector Rendering</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QgsMapLayerComboBox" name="cbQgsVectorLayer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="allowEmptyLayer">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnSetVectorStyle">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
<zorder>collapseButton</zorder>
<zorder>cbQgsVectorLayer</zorder>
<zorder>btnSetVectorStyle</zorder>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="gbRasterRendering">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="title">
<string>Raster Rendering</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="collapsed">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
<property name="toolTip">
<string>Show/hide crosshair</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/timeseriesviewer/icons/crosshair.svg</normaloff>:/timeseriesviewer/icons/crosshair.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="tbName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Map View Title</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QgsLayerTreeView" name="mLayerTreeView">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>261</width>
<height>211</height>
</rect>
</property>
</widget>
<action name="actionToggleMapViewHidden">
<property name="checkable">
<bool>true</bool>
......@@ -473,15 +239,9 @@
</widget>
<customwidgets>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsMapLayerComboBox</class>
<extends>QComboBox</extends>
<header>qgsmaplayercombobox.h</header>
<class>QgsLayerTreeView</class>
<extends>QTreeView</extends>
<header>qgis.gui</header>
</customwidget>
</customwidgets>
<resources>
......
......@@ -12,8 +12,8 @@
</property>
<property name="minimumSize">
<size>
<width>190</width>
<height>210</height>
<width>229</width>
<height>255</height>
</size>
</property>
<property name="windowTitle">
......@@ -53,7 +53,7 @@
<property name="title">
<string>Map Properties</string>
</property>
<property name="collapsed">
<property name="collapsed" stdset="0">
<bool>true</bool>
</property>
<layout class="QFormLayout" name="formLayout">
......@@ -289,10 +289,10 @@
<height>0</height>
</size>
</property>
<property name="colorDialogTitle">
<property name="colorDialogTitle" stdset="0">
<string>Select Map Canvas Background Color</string>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
......@@ -312,7 +312,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QgsProjectionSelectionWidget" name="btnCrs">
<widget class="QgsProjectionSelectionWidget" name="btnCrs" native="true">
<property name="minimumSize">
<size>
<width>0</width>
......
......@@ -68,7 +68,7 @@
<number>0</number>
</property>
<item>
<widget class="QFrame" name="">
<widget class="QFrame" name="frame">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>2</number>
......
......@@ -20,8 +20,13 @@ class QGISTest(unittest.TestCase):
from eotimeseriesviewer.tests import TestObjects
layer = TestObjects.createVectorLayer()
layer2 = TestObjects.createRasterLayer()
QgsProject.instance().addMapLayers([layer, layer2])
layer2 = TestObjects.createVectorLayer()
layer2.setName('free layer')
layer3fix = TestObjects.createVectorLayer()
layer3fix.setName('Time Series Raster')
assert isinstance(layer3fix, QgsMapLayer)
layer3fix.setProperty('eotsv/fixed', True)
QgsProject.instance().addMapLayers([layer, layer2, layer3fix])
w = QWidget()
w.setLayout(QHBoxLayout())
......@@ -52,7 +57,7 @@ class QGISTest(unittest.TestCase):
self.actionAddGroup = self.mDefActions.actionAddGroup()
self.actionRename = self.mDefActions.actionRenameGroupOrLayer()
self.actionRemove = self.mDefActions.actionRemoveGroupOrLayer()
def layerTreeView(self)->QgsLayerTreeView:
return self._view
......@@ -69,8 +74,6 @@ class QGISTest(unittest.TestCase):
i = view.currentIndex()
view.currentGroupNode().insertGroup(i.row(), 'Group')
def createContextMenu(self)->QMenu:
model = self.layerTreeModel()
......@@ -78,7 +81,8 @@ class QGISTest(unittest.TestCase):
view = self.layerTreeView()
l = view.currentLayer()
i = view.currentIndex()
fixedLayers = [l for l in view.selectedLayersRecursive() if l.property('eotsv/fixed')]
self.actionRemove.setEnabled(len(fixedLayers) == 0)
def copyAction(menu:QMenu, action:QAction):
......@@ -92,6 +96,10 @@ class QGISTest(unittest.TestCase):
menu.addAction(self.actionRename)
#copyAction(menu, self.actionRename)
menu.addAction(self.actionRemove)
#a = menu.addAction('Settings')
#from qps.layerproperties import showLayerPropertiesDialog
#a.triggered.connect(lambda *args, lyr=l:showLayerPropertiesDialog(lyr, self._canvas))
......@@ -107,6 +115,7 @@ class QGISTest(unittest.TestCase):
ltree.addLayer(layer)
ltree.addLayer(layer3fix)
ltree.addLayer(layer2)
grp = ltree.addGroup('Name')
grp.addLayer(layer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment