mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Merge branch 'comet0-snap_to_grid' into 1.5
This commit is contained in:
@@ -18,6 +18,10 @@ it on https://github.com/GNS3/gns3-gui we will take care of the triage.
|
|||||||
|
|
||||||
For bugs specific to the GNS3 VM, please report on https://github.com/GNS3/gns3-vm
|
For bugs specific to the GNS3 VM, please report on https://github.com/GNS3/gns3-vm
|
||||||
|
|
||||||
|
## Security issues
|
||||||
|
|
||||||
|
For security issues please keep it private and send an email to developers@gns3.net
|
||||||
|
|
||||||
## Asking for new features
|
## Asking for new features
|
||||||
|
|
||||||
The best is to start a discussion on the community website in order to get feedback
|
The best is to start a discussion on the community website in order to get feedback
|
||||||
|
|||||||
@@ -377,6 +377,11 @@ class NodeItem():
|
|||||||
:param value: value of the change
|
:param value: value of the change
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# was causing infinite recursion loops when placed within the below if statements
|
||||||
|
if change == QtWidgets.QGraphicsItem.ItemPositionHasChanged and self._main_window.uiSnapToGridAction.isChecked():
|
||||||
|
GRID_SIZE = 75
|
||||||
|
self.setPos(float(GRID_SIZE * round(self.x() / GRID_SIZE)), float(GRID_SIZE * round(self.y() / GRID_SIZE)))
|
||||||
|
|
||||||
# dynamically change the renderer when this node item is selected/unselected.
|
# dynamically change the renderer when this node item is selected/unselected.
|
||||||
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
||||||
if value:
|
if value:
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ background-none;
|
|||||||
<addaction name="uiFitInViewAction"/>
|
<addaction name="uiFitInViewAction"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="uiShowLayersAction"/>
|
<addaction name="uiShowLayersAction"/>
|
||||||
|
<addaction name="uiSnapToGridAction"/>
|
||||||
<addaction name="uiResetPortLabelsAction"/>
|
<addaction name="uiResetPortLabelsAction"/>
|
||||||
<addaction name="uiShowPortNamesAction"/>
|
<addaction name="uiShowPortNamesAction"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
@@ -904,6 +905,17 @@ background-none;
|
|||||||
<string>Show layers</string>
|
<string>Show layers</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="uiSnapToGridAction">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Snap To Grid</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string>Snap To Grid</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="uiSaveProjectAsAction">
|
<action name="uiSaveProjectAsAction">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../resources/resources.qrc">
|
<iconset resource="../../resources/resources.qrc">
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/main_window.ui'
|
# Form implementation generated from reading ui file '/Users/noplay/code/gns3/gns3-gui/gns3/ui/main_window.ui'
|
||||||
#
|
#
|
||||||
# Created: Tue May 10 10:08:21 2016
|
# Created by: PyQt5 UI code generator 5.6
|
||||||
# by: PyQt5 UI code generator 5.2.1
|
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
|
||||||
@@ -87,8 +86,8 @@ class Ui_MainWindow(object):
|
|||||||
self.uiNodesDockWidgetContents = QtWidgets.QWidget()
|
self.uiNodesDockWidgetContents = QtWidgets.QWidget()
|
||||||
self.uiNodesDockWidgetContents.setObjectName("uiNodesDockWidgetContents")
|
self.uiNodesDockWidgetContents.setObjectName("uiNodesDockWidgetContents")
|
||||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.uiNodesDockWidgetContents)
|
self.vboxlayout = QtWidgets.QVBoxLayout(self.uiNodesDockWidgetContents)
|
||||||
self.vboxlayout.setSpacing(0)
|
|
||||||
self.vboxlayout.setContentsMargins(0, 0, 0, 0)
|
self.vboxlayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.vboxlayout.setSpacing(0)
|
||||||
self.vboxlayout.setObjectName("vboxlayout")
|
self.vboxlayout.setObjectName("vboxlayout")
|
||||||
self.uiNodesView = NodesView(self.uiNodesDockWidgetContents)
|
self.uiNodesView = NodesView(self.uiNodesDockWidgetContents)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||||
@@ -129,8 +128,8 @@ class Ui_MainWindow(object):
|
|||||||
self.uiConsoleDockWidgetContents = QtWidgets.QWidget()
|
self.uiConsoleDockWidgetContents = QtWidgets.QWidget()
|
||||||
self.uiConsoleDockWidgetContents.setObjectName("uiConsoleDockWidgetContents")
|
self.uiConsoleDockWidgetContents.setObjectName("uiConsoleDockWidgetContents")
|
||||||
self.vboxlayout1 = QtWidgets.QVBoxLayout(self.uiConsoleDockWidgetContents)
|
self.vboxlayout1 = QtWidgets.QVBoxLayout(self.uiConsoleDockWidgetContents)
|
||||||
self.vboxlayout1.setSpacing(0)
|
|
||||||
self.vboxlayout1.setContentsMargins(0, 0, 0, 0)
|
self.vboxlayout1.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.vboxlayout1.setSpacing(0)
|
||||||
self.vboxlayout1.setObjectName("vboxlayout1")
|
self.vboxlayout1.setObjectName("vboxlayout1")
|
||||||
self.uiConsoleTextEdit = ConsoleView(self.uiConsoleDockWidgetContents)
|
self.uiConsoleTextEdit = ConsoleView(self.uiConsoleDockWidgetContents)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||||
@@ -324,6 +323,9 @@ class Ui_MainWindow(object):
|
|||||||
self.uiShowLayersAction = QtWidgets.QAction(MainWindow)
|
self.uiShowLayersAction = QtWidgets.QAction(MainWindow)
|
||||||
self.uiShowLayersAction.setCheckable(True)
|
self.uiShowLayersAction.setCheckable(True)
|
||||||
self.uiShowLayersAction.setObjectName("uiShowLayersAction")
|
self.uiShowLayersAction.setObjectName("uiShowLayersAction")
|
||||||
|
self.uiSnapToGridAction = QtWidgets.QAction(MainWindow)
|
||||||
|
self.uiSnapToGridAction.setCheckable(True)
|
||||||
|
self.uiSnapToGridAction.setObjectName("uiSnapToGridAction")
|
||||||
self.uiSaveProjectAsAction = QtWidgets.QAction(MainWindow)
|
self.uiSaveProjectAsAction = QtWidgets.QAction(MainWindow)
|
||||||
icon21 = QtGui.QIcon()
|
icon21 = QtGui.QIcon()
|
||||||
icon21.addPixmap(QtGui.QPixmap(":/icons/save-as-project.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon21.addPixmap(QtGui.QPixmap(":/icons/save-as-project.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
@@ -385,9 +387,9 @@ class Ui_MainWindow(object):
|
|||||||
self.uiAddLinkAction.setCheckable(True)
|
self.uiAddLinkAction.setCheckable(True)
|
||||||
icon29 = QtGui.QIcon()
|
icon29 = QtGui.QIcon()
|
||||||
icon29.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
icon29.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Active, QtGui.QIcon.On)
|
||||||
|
icon29.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
||||||
icon29.addPixmap(QtGui.QPixmap(":/icons/connection-new-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
icon29.addPixmap(QtGui.QPixmap(":/icons/connection-new-hover.svg"), QtGui.QIcon.Active, QtGui.QIcon.Off)
|
||||||
icon29.addPixmap(QtGui.QPixmap(":/icons/connection-new.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon29.addPixmap(QtGui.QPixmap(":/icons/connection-new.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
icon29.addPixmap(QtGui.QPixmap(":/icons/cancel-connection.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
|
|
||||||
self.uiAddLinkAction.setIcon(icon29)
|
self.uiAddLinkAction.setIcon(icon29)
|
||||||
self.uiAddLinkAction.setObjectName("uiAddLinkAction")
|
self.uiAddLinkAction.setObjectName("uiAddLinkAction")
|
||||||
self.uiGettingStartedAction = QtWidgets.QAction(MainWindow)
|
self.uiGettingStartedAction = QtWidgets.QAction(MainWindow)
|
||||||
@@ -475,6 +477,7 @@ class Ui_MainWindow(object):
|
|||||||
self.uiViewMenu.addAction(self.uiFitInViewAction)
|
self.uiViewMenu.addAction(self.uiFitInViewAction)
|
||||||
self.uiViewMenu.addSeparator()
|
self.uiViewMenu.addSeparator()
|
||||||
self.uiViewMenu.addAction(self.uiShowLayersAction)
|
self.uiViewMenu.addAction(self.uiShowLayersAction)
|
||||||
|
self.uiViewMenu.addAction(self.uiSnapToGridAction)
|
||||||
self.uiViewMenu.addAction(self.uiResetPortLabelsAction)
|
self.uiViewMenu.addAction(self.uiResetPortLabelsAction)
|
||||||
self.uiViewMenu.addAction(self.uiShowPortNamesAction)
|
self.uiViewMenu.addAction(self.uiShowPortNamesAction)
|
||||||
self.uiViewMenu.addSeparator()
|
self.uiViewMenu.addSeparator()
|
||||||
@@ -642,6 +645,8 @@ class Ui_MainWindow(object):
|
|||||||
self.uiSnapshotAction.setStatusTip(_translate("MainWindow", "Manage snapshots"))
|
self.uiSnapshotAction.setStatusTip(_translate("MainWindow", "Manage snapshots"))
|
||||||
self.uiShowLayersAction.setText(_translate("MainWindow", "Show layers"))
|
self.uiShowLayersAction.setText(_translate("MainWindow", "Show layers"))
|
||||||
self.uiShowLayersAction.setStatusTip(_translate("MainWindow", "Show layers"))
|
self.uiShowLayersAction.setStatusTip(_translate("MainWindow", "Show layers"))
|
||||||
|
self.uiSnapToGridAction.setText(_translate("MainWindow", "Snap To Grid"))
|
||||||
|
self.uiSnapToGridAction.setStatusTip(_translate("MainWindow", "Snap To Grid"))
|
||||||
self.uiSaveProjectAsAction.setText(_translate("MainWindow", "&Save project as..."))
|
self.uiSaveProjectAsAction.setText(_translate("MainWindow", "&Save project as..."))
|
||||||
self.uiSaveProjectAsAction.setToolTip(_translate("MainWindow", "Save project as..."))
|
self.uiSaveProjectAsAction.setToolTip(_translate("MainWindow", "Save project as..."))
|
||||||
self.uiSaveProjectAsAction.setStatusTip(_translate("MainWindow", "Save project as..."))
|
self.uiSaveProjectAsAction.setStatusTip(_translate("MainWindow", "Save project as..."))
|
||||||
@@ -702,9 +707,9 @@ class Ui_MainWindow(object):
|
|||||||
self.uiEditReadmeAction.setText(_translate("MainWindow", "Edit readme"))
|
self.uiEditReadmeAction.setText(_translate("MainWindow", "Edit readme"))
|
||||||
self.uiAcademyAction.setText(_translate("MainWindow", "GNS3 &Academy"))
|
self.uiAcademyAction.setText(_translate("MainWindow", "GNS3 &Academy"))
|
||||||
|
|
||||||
from ..graphics_view import GraphicsView
|
|
||||||
from ..console_view import ConsoleView
|
from ..console_view import ConsoleView
|
||||||
|
from ..graphics_view import GraphicsView
|
||||||
from ..nodes_view import NodesView
|
from ..nodes_view import NodesView
|
||||||
from ..topology_summary_view import TopologySummaryView
|
|
||||||
from ..server_summary_view import ServerSummaryView
|
from ..server_summary_view import ServerSummaryView
|
||||||
|
from ..topology_summary_view import TopologySummaryView
|
||||||
from . import resources_rc
|
from . import resources_rc
|
||||||
|
|||||||
Reference in New Issue
Block a user