Lock or unlock all items button. Fixes #1134.
@@ -157,6 +157,9 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
# clear the topology summary
|
||||
self._main_window.uiTopologySummaryTreeWidget.clear()
|
||||
|
||||
# reset the lock button
|
||||
self._main_window.uiLockAllAction.setChecked(False)
|
||||
|
||||
# clear all objects on the scene
|
||||
self.scene().clear()
|
||||
|
||||
|
||||
@@ -224,6 +224,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.uiShowPortNamesAction.triggered.connect(self._showPortNamesActionSlot)
|
||||
self.uiShowGridAction.triggered.connect(self._showGridActionSlot)
|
||||
self.uiSnapToGridAction.triggered.connect(self._snapToGridActionSlot)
|
||||
self.uiLockAllAction.triggered.connect(self._lockActionSlot)
|
||||
|
||||
# tool menu connections
|
||||
self.uiWebInterfaceAction.triggered.connect(self._openWebInterfaceActionSlot)
|
||||
@@ -333,6 +334,15 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
project.setSnapToGrid(self.uiSnapToGridAction.isChecked())
|
||||
project.update()
|
||||
|
||||
def _lockActionSlot(self):
|
||||
"""
|
||||
Called when user click on the lock menu item
|
||||
:return: None
|
||||
"""
|
||||
|
||||
for item in self.uiGraphicsView.items():
|
||||
item.setEnabled(not self.uiLockAllAction.isChecked())
|
||||
|
||||
def analyticsClient(self):
|
||||
"""
|
||||
Return the analytics client
|
||||
|
||||
@@ -82,6 +82,15 @@ class Style:
|
||||
self._mw.uiBrowseAllDevicesAction.setIcon(self._getStyleIcon(":/icons/browse-all-icons.png", ":/icons/browse-all-icons-hover.png"))
|
||||
self._mw.uiAddLinkAction.setIcon(self._getStyleIcon(":/icons/connection-new.svg", ":/charcoal_icons/connection-new-hover.svg"))
|
||||
|
||||
# Lock action has 4 different icons (use the ones from classic theme)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/lock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/lock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/unlock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/unlock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
self._mw.uiLockAllAction.setIcon(icon)
|
||||
|
||||
|
||||
def setClassicStyle(self):
|
||||
"""
|
||||
Sets the classic GUI style.
|
||||
@@ -127,6 +136,14 @@ class Style:
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/add-link-cancel.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
self._mw.uiAddLinkAction.setIcon(icon)
|
||||
|
||||
# Lock action has 4 different icons
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/lock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/lock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/unlock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon.addPixmap(QtGui.QPixmap(":/classic_icons/unlock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
self._mw.uiLockAllAction.setIcon(icon)
|
||||
|
||||
def setCharcoalStyle(self):
|
||||
"""
|
||||
Sets the charcoal GUI style.
|
||||
@@ -177,3 +194,11 @@ class Style:
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/add-link-1-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/add-link-1-cancel.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
self._mw.uiAddLinkAction.setIcon(icon)
|
||||
|
||||
# Lock action has 4 different icons
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/lock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/lock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/unlock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon.addPixmap(QtGui.QPixmap(":/charcoal_icons/unlock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
self._mw.uiLockAllAction.setIcon(icon)
|
||||
|
||||
@@ -126,6 +126,7 @@ background-none;
|
||||
<addaction name="uiShowGridAction"/>
|
||||
<addaction name="uiResetPortLabelsAction"/>
|
||||
<addaction name="uiShowPortNamesAction"/>
|
||||
<addaction name="uiLockAllAction"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="uiDocksMenu"/>
|
||||
</widget>
|
||||
@@ -447,6 +448,7 @@ background-none;
|
||||
<addaction name="uiDrawRectangleAction"/>
|
||||
<addaction name="uiDrawEllipseAction"/>
|
||||
<addaction name="uiDrawLineAction"/>
|
||||
<addaction name="uiLockAllAction"/>
|
||||
<addaction name="uiZoomInAction"/>
|
||||
<addaction name="uiZoomOutAction"/>
|
||||
<addaction name="uiScreenshotAction"/>
|
||||
@@ -1245,6 +1247,29 @@ background-none;
|
||||
<string>Drawn line</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="uiLockAllAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../resources/resources.qrc">
|
||||
<normaloff>:/classic_icons/unlock.svg</normaloff>
|
||||
<normalon>:/classic_icons/lock.svg</normalon>
|
||||
<disabledoff>:/classic_icons/lock-hover.svg</disabledoff>
|
||||
<disabledon>:/classic_icons/lock-hover.svg</disabledon>
|
||||
<activeoff>:/classic_icons/unlock-hover.svg</activeoff>
|
||||
<activeon>:/classic_icons/lock-hover.svg</activeon>:/classic_icons/unlock.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lock or unlock all items</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Lock or unlock all items</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -389,8 +389,8 @@ class Ui_MainWindow(object):
|
||||
self.uiAddLinkAction = QtWidgets.QAction(MainWindow)
|
||||
self.uiAddLinkAction.setCheckable(True)
|
||||
icon28 = QtGui.QIcon()
|
||||
icon28.addPixmap(QtGui.QPixmap(":/icons/connection-new-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
icon28.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
icon28.addPixmap(QtGui.QPixmap(":/icons/connection-new-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
icon28.addPixmap(QtGui.QPixmap(":/icons/connection-new.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon28.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||
self.uiAddLinkAction.setIcon(icon28)
|
||||
@@ -445,6 +445,18 @@ class Ui_MainWindow(object):
|
||||
icon33.addPixmap(QtGui.QPixmap(":/icons/vertically.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.uiDrawLineAction.setIcon(icon33)
|
||||
self.uiDrawLineAction.setObjectName("uiDrawLineAction")
|
||||
self.uiLockAllAction = QtWidgets.QAction(MainWindow)
|
||||
self.uiLockAllAction.setCheckable(True)
|
||||
self.uiLockAllAction.setChecked(False)
|
||||
icon34 = QtGui.QIcon()
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/lock-hover.svg"), QtGui.QIcon.Disabled, QtGui.QIcon.Off)
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/lock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/lock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/unlock-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/unlock.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon34.addPixmap(QtGui.QPixmap(":/classic_icons/lock-hover.svg"), QtGui.QIcon.Disabled, QtGui.QIcon.On)
|
||||
self.uiLockAllAction.setIcon(icon34)
|
||||
self.uiLockAllAction.setObjectName("uiLockAllAction")
|
||||
self.uiEditMenu.addAction(self.uiSelectAllAction)
|
||||
self.uiEditMenu.addAction(self.uiSelectNoneAction)
|
||||
self.uiEditMenu.addSeparator()
|
||||
@@ -482,6 +494,7 @@ class Ui_MainWindow(object):
|
||||
self.uiViewMenu.addAction(self.uiShowGridAction)
|
||||
self.uiViewMenu.addAction(self.uiResetPortLabelsAction)
|
||||
self.uiViewMenu.addAction(self.uiShowPortNamesAction)
|
||||
self.uiViewMenu.addAction(self.uiLockAllAction)
|
||||
self.uiViewMenu.addSeparator()
|
||||
self.uiViewMenu.addAction(self.uiDocksMenu.menuAction())
|
||||
self.uiControlMenu.addAction(self.uiStartAllAction)
|
||||
@@ -534,6 +547,7 @@ class Ui_MainWindow(object):
|
||||
self.uiAnnotationToolBar.addAction(self.uiDrawRectangleAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiDrawEllipseAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiDrawLineAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiLockAllAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiZoomInAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiZoomOutAction)
|
||||
self.uiAnnotationToolBar.addAction(self.uiScreenshotAction)
|
||||
@@ -705,6 +719,8 @@ class Ui_MainWindow(object):
|
||||
self.uiEditProjectAction.setText(_translate("MainWindow", "Edit project"))
|
||||
self.uiWebInterfaceAction.setText(_translate("MainWindow", "Web interface"))
|
||||
self.uiDrawLineAction.setText(_translate("MainWindow", "Drawn line"))
|
||||
self.uiLockAllAction.setText(_translate("MainWindow", "Lock or unlock all items"))
|
||||
self.uiLockAllAction.setToolTip(_translate("MainWindow", "Lock or unlock all items"))
|
||||
|
||||
from ..compute_summary_view import ComputeSummaryView
|
||||
from ..console_view import ConsoleView
|
||||
|
||||
215202
gns3/ui/resources_rc.py
@@ -36,9 +36,9 @@
|
||||
inkscape:window-height="1752"
|
||||
id="namedview39"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.2777778"
|
||||
inkscape:cx="-55.269714"
|
||||
inkscape:cy="145.12302"
|
||||
inkscape:zoom="4.6354778"
|
||||
inkscape:cx="102.21671"
|
||||
inkscape:cy="118.35528"
|
||||
inkscape:window-x="130"
|
||||
inkscape:window-y="48"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -48,4 +48,10 @@
|
||||
id="path3-3" /><path
|
||||
style="fill:#ffffff;fill-opacity:1"
|
||||
d="M 139.77344 11.765625 C 102.12672 11.765625 71.498047 42.40284 71.498047 80.041016 L 71.498047 131.24805 C 52.645362 131.24805 37.359375 146.53402 37.359375 165.38672 L 37.359375 250.73047 C 37.359375 269.58317 52.645362 284.86914 71.498047 284.86914 L 208.04883 284.86914 C 226.90152 284.86914 242.1875 269.58317 242.1875 250.73047 L 242.1875 165.38672 C 242.1875 146.53402 226.90152 131.24805 208.04883 131.24805 L 208.04883 121.89062 L 173.91211 121.89062 L 173.91211 131.24805 L 105.63477 131.24805 L 105.63477 80.041016 C 105.63477 61.204859 120.94581 45.904297 139.77344 45.904297 C 150.01245 45.904297 159.20938 50.439433 165.47266 57.603516 L 204.24219 57.603516 C 194.93864 30.952339 169.56639 11.765625 139.77344 11.765625 z M 139.77344 182.45508 C 149.19978 182.45508 156.8418 190.09104 156.8418 199.52539 C 156.8418 205.77638 153.3178 211.00922 148.30859 213.97656 L 148.30859 242.19727 C 148.30859 246.91471 144.49087 250.73047 139.77344 250.73047 C 135.05599 250.73047 131.23828 246.91471 131.23828 242.19727 L 131.23828 213.97656 C 126.22907 211.00922 122.70508 205.77638 122.70508 199.52539 C 122.70508 190.09052 130.3471 182.45508 139.77344 182.45508 z "
|
||||
id="path3" /></svg>
|
||||
id="path3" /><rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4136"
|
||||
width="34.322033"
|
||||
height="9.3813562"
|
||||
x="173.83409"
|
||||
y="121.86888" /></svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -36,9 +36,9 @@
|
||||
inkscape:window-height="1752"
|
||||
id="namedview39"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.2777778"
|
||||
inkscape:cx="16.730286"
|
||||
inkscape:cy="145.12302"
|
||||
inkscape:zoom="6.5555556"
|
||||
inkscape:cx="79.360005"
|
||||
inkscape:cy="125.77353"
|
||||
inkscape:window-x="130"
|
||||
inkscape:window-y="48"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -48,4 +48,10 @@
|
||||
id="path3-3" /><path
|
||||
style="fill:#cdcdcd;fill-opacity:1"
|
||||
d="M 139.77344 11.765625 C 102.12672 11.765625 71.498047 42.40284 71.498047 80.041016 L 71.498047 131.24805 C 52.645362 131.24805 37.359375 146.53402 37.359375 165.38672 L 37.359375 250.73047 C 37.359375 269.58317 52.645362 284.86914 71.498047 284.86914 L 208.04883 284.86914 C 226.90152 284.86914 242.1875 269.58317 242.1875 250.73047 L 242.1875 165.38672 C 242.1875 146.53402 226.90152 131.24805 208.04883 131.24805 L 208.04883 121.89062 L 173.91211 121.89062 L 173.91211 131.24805 L 105.63477 131.24805 L 105.63477 80.041016 C 105.63477 61.204859 120.94581 45.904297 139.77344 45.904297 C 150.01245 45.904297 159.20938 50.439433 165.47266 57.603516 L 204.24219 57.603516 C 194.93864 30.952339 169.56639 11.765625 139.77344 11.765625 z M 139.77344 182.45508 C 149.19978 182.45508 156.8418 190.09104 156.8418 199.52539 C 156.8418 205.77638 153.3178 211.00922 148.30859 213.97656 L 148.30859 242.19727 C 148.30859 246.91471 144.49087 250.73047 139.77344 250.73047 C 135.05599 250.73047 131.23828 246.91471 131.23828 242.19727 L 131.23828 213.97656 C 126.22907 211.00922 122.70508 205.77638 122.70508 199.52539 C 122.70508 190.09052 130.3471 182.45508 139.77344 182.45508 z "
|
||||
id="path3" /></svg>
|
||||
id="path3" /><rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4136"
|
||||
width="34.322033"
|
||||
height="9.3813562"
|
||||
x="173.86569"
|
||||
y="121.89123" /></svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -36,9 +36,9 @@
|
||||
inkscape:window-height="1752"
|
||||
id="namedview39"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.2777778"
|
||||
inkscape:cx="-199.26971"
|
||||
inkscape:cy="145.12302"
|
||||
inkscape:zoom="2.3177389"
|
||||
inkscape:cx="164.86862"
|
||||
inkscape:cy="25.070211"
|
||||
inkscape:window-x="130"
|
||||
inkscape:window-y="48"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -48,4 +48,10 @@
|
||||
id="path3-3" /><path
|
||||
style="fill:#666666;fill-opacity:1"
|
||||
d="M 139.77344 11.765625 C 102.12672 11.765625 71.498047 42.40284 71.498047 80.041016 L 71.498047 131.24805 C 52.645362 131.24805 37.359375 146.53402 37.359375 165.38672 L 37.359375 250.73047 C 37.359375 269.58317 52.645362 284.86914 71.498047 284.86914 L 208.04883 284.86914 C 226.90152 284.86914 242.1875 269.58317 242.1875 250.73047 L 242.1875 165.38672 C 242.1875 146.53402 226.90152 131.24805 208.04883 131.24805 L 208.04883 121.89062 L 173.91211 121.89062 L 173.91211 131.24805 L 105.63477 131.24805 L 105.63477 80.041016 C 105.63477 61.204859 120.94581 45.904297 139.77344 45.904297 C 150.01245 45.904297 159.20938 50.439433 165.47266 57.603516 L 204.24219 57.603516 C 194.93864 30.952339 169.56639 11.765625 139.77344 11.765625 z M 139.77344 182.45508 C 149.19978 182.45508 156.8418 190.09104 156.8418 199.52539 C 156.8418 205.77638 153.3178 211.00922 148.30859 213.97656 L 148.30859 242.19727 C 148.30859 246.91471 144.49087 250.73047 139.77344 250.73047 C 135.05599 250.73047 131.23828 246.91471 131.23828 242.19727 L 131.23828 213.97656 C 126.22907 211.00922 122.70508 205.77638 122.70508 199.52539 C 122.70508 190.09052 130.3471 182.45508 139.77344 182.45508 z "
|
||||
id="path3" /></svg>
|
||||
id="path3" /><rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4136"
|
||||
width="34.207626"
|
||||
height="9.4194918"
|
||||
x="173.86018"
|
||||
y="121.88135" /></svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -36,9 +36,9 @@
|
||||
inkscape:window-height="1752"
|
||||
id="namedview39"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.2777778"
|
||||
inkscape:cx="-55.269714"
|
||||
inkscape:cy="145.12302"
|
||||
inkscape:zoom="6.5555556"
|
||||
inkscape:cx="137.13854"
|
||||
inkscape:cy="183.75451"
|
||||
inkscape:window-x="130"
|
||||
inkscape:window-y="48"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -48,4 +48,10 @@
|
||||
id="path3-3" /><path
|
||||
style="fill:#999999;fill-opacity:1"
|
||||
d="M 139.77344 11.765625 C 102.12672 11.765625 71.498047 42.40284 71.498047 80.041016 L 71.498047 131.24805 C 52.645362 131.24805 37.359375 146.53402 37.359375 165.38672 L 37.359375 250.73047 C 37.359375 269.58317 52.645362 284.86914 71.498047 284.86914 L 208.04883 284.86914 C 226.90152 284.86914 242.1875 269.58317 242.1875 250.73047 L 242.1875 165.38672 C 242.1875 146.53402 226.90152 131.24805 208.04883 131.24805 L 208.04883 121.89062 L 173.91211 121.89062 L 173.91211 131.24805 L 105.63477 131.24805 L 105.63477 80.041016 C 105.63477 61.204859 120.94581 45.904297 139.77344 45.904297 C 150.01245 45.904297 159.20938 50.439433 165.47266 57.603516 L 204.24219 57.603516 C 194.93864 30.952339 169.56639 11.765625 139.77344 11.765625 z M 139.77344 182.45508 C 149.19978 182.45508 156.8418 190.09104 156.8418 199.52539 C 156.8418 205.77638 153.3178 211.00922 148.30859 213.97656 L 148.30859 242.19727 C 148.30859 246.91471 144.49087 250.73047 139.77344 250.73047 C 135.05599 250.73047 131.23828 246.91471 131.23828 242.19727 L 131.23828 213.97656 C 126.22907 211.00922 122.70508 205.77638 122.70508 199.52539 C 122.70508 190.09052 130.3471 182.45508 139.77344 182.45508 z "
|
||||
id="path3" /></svg>
|
||||
id="path3" /><rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4136"
|
||||
width="34.322033"
|
||||
height="9.3813562"
|
||||
x="173.74576"
|
||||
y="121.88135" /></svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.3 KiB |