mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
New icon for bring to front. Ref #847.
This commit is contained in:
@@ -590,6 +590,8 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
self.configureSlot()
|
||||
return
|
||||
else:
|
||||
if sys.platform.startswith("win") and item.node().bringToFront():
|
||||
return
|
||||
self.consoleFromItems(self.scene().selectedItems())
|
||||
return
|
||||
elif isinstance(item, NoteItem) and isinstance(item.parentItem(), NodeItem):
|
||||
@@ -823,7 +825,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if sys.platform.startswith("win") and True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "bringToFront"), items)):
|
||||
# Action: bring console or window to front (Windows only)
|
||||
bring_to_front_action = QtWidgets.QAction("Bring to front", menu)
|
||||
bring_to_front_action.setIcon(QtGui.QIcon(':/icons/console.svg'))
|
||||
bring_to_front_action.setIcon(QtGui.QIcon(':/icons/front.svg'))
|
||||
bring_to_front_action.triggered.connect(self.bringToFrontSlot)
|
||||
menu.addAction(bring_to_front_action)
|
||||
|
||||
|
||||
@@ -137,6 +137,9 @@ class VirtualBoxVM(Node):
|
||||
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} [".format(self._settings["vmname"]))
|
||||
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} (".format(self._settings["vmname"]))
|
||||
|
||||
# bring any console to front
|
||||
return Node.bringToFront(self)
|
||||
|
||||
def configPage(self):
|
||||
"""
|
||||
Returns the configuration page widget to be used by the node properties dialog.
|
||||
|
||||
@@ -167,6 +167,9 @@ class VMwareVM(Node):
|
||||
bring_window_to_front_from_process_name("vmplayer.exe", title=window_name)
|
||||
bring_window_to_front_from_process_name("vmware.exe", title=window_name)
|
||||
|
||||
# bring any console to front
|
||||
return Node.bringToFront(self)
|
||||
|
||||
def configPage(self):
|
||||
"""
|
||||
Returns the configuration page widget to be used by the node properties dialog.
|
||||
|
||||
@@ -22,7 +22,7 @@ import pathlib
|
||||
from gns3.controller import Controller
|
||||
from gns3.ports.ethernet_port import EthernetPort
|
||||
from gns3.ports.serial_port import SerialPort
|
||||
from gns3.utils.bring_to_front import bring_windows_to_front_from_title
|
||||
from gns3.utils.bring_to_front import bring_window_to_front_from_title
|
||||
from gns3.qt import QtGui, QtCore
|
||||
|
||||
from .base_node import BaseNode
|
||||
@@ -530,7 +530,12 @@ class Node(BaseNode):
|
||||
"""
|
||||
|
||||
if self.status() == Node.started:
|
||||
bring_windows_to_front_from_title(self.name())
|
||||
if bring_window_to_front_from_title(self.name()):
|
||||
return True
|
||||
else:
|
||||
log.info("Could not find window title '{}' to bring it to front".format(self.name()))
|
||||
return False
|
||||
|
||||
|
||||
def setName(self, name):
|
||||
"""
|
||||
|
||||
249769
gns3/ui/resources_rc.py
249769
gns3/ui/resources_rc.py
File diff suppressed because it is too large
Load Diff
@@ -71,6 +71,8 @@ def bring_window_to_front_from_title(title):
|
||||
hwnd = win32gui.FindWindow(None, title)
|
||||
if hwnd:
|
||||
set_foreground_window(hwnd)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def bring_windows_to_front_from_title(title):
|
||||
|
||||
286
resources/icons/front.svg
Normal file
286
resources/icons/front.svg
Normal file
@@ -0,0 +1,286 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="48"
|
||||
height="48"
|
||||
id="svg4198"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="front.svg">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="3070"
|
||||
inkscape:window-height="1752"
|
||||
id="namedview46"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.9166667"
|
||||
inkscape:cx="19.695325"
|
||||
inkscape:cy="15.864407"
|
||||
inkscape:window-x="130"
|
||||
inkscape:window-y="48"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs4200">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4166">
|
||||
<stop
|
||||
style="stop-color:#5f8dd3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4168" />
|
||||
<stop
|
||||
style="stop-color:#5f8dd3;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop4170" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3558">
|
||||
<stop
|
||||
id="stop3560"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop3562"
|
||||
style="stop-color:#000000;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
cx="22.571428"
|
||||
cy="30.857143"
|
||||
r="15.571428"
|
||||
fx="22.571428"
|
||||
fy="30.857143"
|
||||
id="radialGradient3564"
|
||||
xlink:href="#linearGradient3558"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.651376,0,10.75754)" />
|
||||
<linearGradient
|
||||
id="linearGradient15218">
|
||||
<stop
|
||||
id="stop15220"
|
||||
style="stop-color:#f8f8f7;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2269"
|
||||
style="stop-color:#e8e8e8;stop-opacity:1"
|
||||
offset="0.59928656" />
|
||||
<stop
|
||||
id="stop15222"
|
||||
style="stop-color:#e2e2de;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="22.308331"
|
||||
y1="18.99214"
|
||||
x2="35.785294"
|
||||
y2="39.498238"
|
||||
id="linearGradient15224"
|
||||
xlink:href="#linearGradient15218"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.060837,0,0,0.987595,4.641161,4.108291)" />
|
||||
<linearGradient
|
||||
id="linearGradient2259">
|
||||
<stop
|
||||
id="stop2261"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2263"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="26.076092"
|
||||
y1="26.696676"
|
||||
x2="30.811172"
|
||||
y2="42.007351"
|
||||
id="linearGradient2265"
|
||||
xlink:href="#linearGradient2259"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.993566,0,0,1,6.219859,4.033411)" />
|
||||
<linearGradient
|
||||
id="linearGradient2216">
|
||||
<stop
|
||||
id="stop2218"
|
||||
style="stop-color:#000000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2220"
|
||||
style="stop-color:#000000;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="36.8125"
|
||||
y1="39.15625"
|
||||
x2="39.0625"
|
||||
y2="42.0625"
|
||||
id="linearGradient2222"
|
||||
xlink:href="#linearGradient2216"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(6.161836,4.033411)" />
|
||||
<linearGradient
|
||||
id="linearGradient2224">
|
||||
<stop
|
||||
id="stop2226"
|
||||
style="stop-color:#7c7c7c;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2228"
|
||||
style="stop-color:#b8b8b8;stop-opacity:1"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="20.794008"
|
||||
y1="18.378813"
|
||||
x2="35.596001"
|
||||
y2="39.60046"
|
||||
id="linearGradient2240"
|
||||
xlink:href="#linearGradient15218"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.342704,0,0,1.235378,-8.219611,-6.577189)" />
|
||||
<linearGradient
|
||||
x1="26.5"
|
||||
y1="34.25"
|
||||
x2="26.25"
|
||||
y2="43.571831"
|
||||
id="linearGradient2314"
|
||||
xlink:href="#linearGradient2308"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient2308">
|
||||
<stop
|
||||
id="stop2310"
|
||||
style="stop-color:#edd400;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2312"
|
||||
style="stop-color:#edd400;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="26.5"
|
||||
y1="34.25"
|
||||
x2="26.25"
|
||||
y2="43.571831"
|
||||
id="linearGradient2322"
|
||||
xlink:href="#linearGradient2316"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient2316">
|
||||
<stop
|
||||
id="stop2318"
|
||||
style="stop-color:#c4a000;stop-opacity:1"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop2320"
|
||||
style="stop-color:#c4a000;stop-opacity:0"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="26.5"
|
||||
y1="34.25"
|
||||
x2="26.25"
|
||||
y2="43.571831"
|
||||
id="linearGradient3048"
|
||||
xlink:href="#linearGradient2308"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0630341,0,0,0.97284054,-5.2806841,0.40829463)" />
|
||||
<linearGradient
|
||||
x1="26.5"
|
||||
y1="34.25"
|
||||
x2="26.25"
|
||||
y2="43.571831"
|
||||
id="linearGradient3050"
|
||||
xlink:href="#linearGradient2316"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0630341,0,0,0.97284054,-5.2806841,0.40829463)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2216"
|
||||
id="linearGradient3024"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.3947237,0,0,1.0793483,-7.1041004,-1.6497535)"
|
||||
x1="26.5"
|
||||
y1="34.25"
|
||||
x2="26.25"
|
||||
y2="43.571831" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4166"
|
||||
id="linearGradient4172"
|
||||
x1="17.76956"
|
||||
y1="15.462945"
|
||||
x2="76.213036"
|
||||
y2="21.529425"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata4203">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:date>2005-10-29</dc:date>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Andreas Nilsson</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>justify</rdf:li>
|
||||
<rdf:li>center</rdf:li>
|
||||
<rdf:li>format</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="matrix(-0.01104921,0.99993896,-0.99993896,-0.01104921,48.200713,0.50407338)">
|
||||
<path
|
||||
d="M 6.2607584,46.958017 C 62.085702,48.383989 53.262894,11.619271 24.224756,11.839564 l 0,-10.1193329 L 4.2193521,15.2846 1.004725,17.46423 l 23.220031,16.511364 0,-10.43555 C 43.838907,22.907579 49.577387,46.673263 6.2607584,46.958017 Z"
|
||||
id="path1432"
|
||||
style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient4172);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3024);stroke-width:1.2269448;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
@@ -106,6 +106,7 @@
|
||||
<file>icons/browse-all-icons-hover.png</file>
|
||||
<file>icons/camera-photo.svg</file>
|
||||
<file>icons/camera-photo-hover.svg</file>
|
||||
<file>icons/front.svg</file>
|
||||
<file>images/gns3_logo.png</file>
|
||||
<file>images/gns3_icon_128x128.png</file>
|
||||
<file>images/gns3_icon_256x256.png</file>
|
||||
|
||||
Reference in New Issue
Block a user