Skip to content

Commit

Permalink
New icons for WebClient. Fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed May 22, 2020
1 parent c0d5e21 commit f05b157
Show file tree
Hide file tree
Showing 17 changed files with 3,117 additions and 5,895 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This method should work on most Linux distros. Please open an new issue if this

## Debugging

Use the `xdg-open` tool on Linux, for instance to start a Telnet console:
Use the `xdg-open` tool on Linux (from the `xdg-utils` package). For instance to start a Telnet console:

`xdg-open "gns3+telnet://127.0.0.1:5000/PC1"`

Expand Down
2 changes: 1 addition & 1 deletion gns3_webclient_pack/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, argv, hdpi=True):
self.setApplicationVersion(__version__)

# set the window icon
self.setWindowIcon(QtGui.QIcon(":/images/gns3.ico"))
self.setWindowIcon(QtGui.QIcon(":/images/gns3_webclient.ico"))

def event(self, event):
# Handle QFileOpenEvent on macOS to received an URL
Expand Down
12 changes: 6 additions & 6 deletions gns3_webclient_pack/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def launcher(argv):
"""

try:
log.info('Parsing URL "{}"'.format(argv))
url = urllib.parse.urlparse(argv)
host = url.hostname
if not host or host in ("0.0.0.0", "0:0:0:0:0:0:0:0", "::"):
Expand All @@ -136,18 +137,18 @@ def launcher(argv):
settings = local_config.loadSectionSettings("CommandsSettings", COMMANDS_SETTINGS)
if url.scheme == "gns3+telnet":
command_line = settings["telnet_command"]
log.info('Launch telnet command: "{}"'.format(command_line))
log.info('Launching Telnet command: "{}"'.format(command_line))
elif url.scheme == "gns3+vnc":
if url.port and url.port < 5900:
raise LauncherError("VNC requires a port superior or equal to 5900, current port is '{}'".format(url.port))
command_line = settings["vnc_command"]
log.info('Launch VNC command: "{}"'.format(command_line))
log.info('Launching VNC command: "{}"'.format(command_line))
elif url.scheme == "gns3+spice":
command_line = settings["spice_command"]
log.info('Launch SPICE command: "{}"'.format(command_line))
log.info('Launching SPICE command: "{}"'.format(command_line))
elif url.scheme == "gns3+pcap":
command_line = settings["pcap_command"]
log.info('Launch PCAP command: "{}"'.format(command_line))
log.info('Launching PCAP command: "{}"'.format(command_line))
pcap_stream = PcapStream(command_line, **url_data)
pcap_stream.start()
return
Expand Down Expand Up @@ -236,7 +237,6 @@ def on_request(url):
url = url_open_requests.pop()
else:
url = sys.argv[1]
log.info('Launching URL "{}"'.format(url))
launcher(url)
except IndexError:
if hasattr(sys, "frozen"):
Expand All @@ -247,7 +247,7 @@ def on_request(url):
raise SystemExit("usage: {} <url>".format(program))
except LauncherError as e:
QtWidgets.QMessageBox.critical(None, "GNS3 Command launcher", "{}".format(e))
log.critical("Could not launch URL: {}".format(e))
log.critical("Could not launch using URL: {}".format(e))
raise SystemExit("{}".format(e))


Expand Down
2 changes: 1 addition & 1 deletion gns3_webclient_pack/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _onlineHelpActionSlot(self):
Slot to launch a browser pointing to the documentation page.
"""

QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://gns3.com/support/docs"))
QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://docs.gns3.com/"))

def _aboutQtActionSlot(self):
"""
Expand Down
1 change: 1 addition & 0 deletions gns3_webclient_pack/pcap_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def _addAuth(self, request):
def _showError(self, error_message):

QtWidgets.QMessageBox.critical(None, "GNS3 Command launcher", error_message)
log.error(error_message)
self._loop.quit()

def start(self, timeout=30):
Expand Down
5 changes: 2 additions & 3 deletions gns3_webclient_pack/ui/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>426</width>
<width>728</width>
<height>478</height>
</rect>
</property>
Expand Down Expand Up @@ -227,14 +227,13 @@
<zorder>uiButtonBox</zorder>
<zorder>verticalSpacer</zorder>
<zorder>uiPacketCaptureCommandLabel</zorder>
<zorder>layoutWidget</zorder>
</widget>
<widget class="QMenuBar" name="uiMenuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>426</width>
<width>728</width>
<height>42</height>
</rect>
</property>
Expand Down
6 changes: 3 additions & 3 deletions gns3_webclient_pack/ui/main_window_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-webclient-pack/gns3_webclient_pack/ui/main_window.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!

Expand All @@ -14,7 +14,7 @@ class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setWindowModality(QtCore.Qt.NonModal)
MainWindow.resize(426, 478)
MainWindow.resize(728, 478)
self.uiCentralWidget = QtWidgets.QWidget(MainWindow)
self.uiCentralWidget.setObjectName("uiCentralWidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiCentralWidget)
Expand Down Expand Up @@ -135,7 +135,7 @@ def setupUi(self, MainWindow):
self.uiPacketCaptureCommandLabel.raise_()
MainWindow.setCentralWidget(self.uiCentralWidget)
self.uiMenuBar = QtWidgets.QMenuBar(MainWindow)
self.uiMenuBar.setGeometry(QtCore.QRect(0, 0, 426, 42))
self.uiMenuBar.setGeometry(QtCore.QRect(0, 0, 728, 42))
self.uiMenuBar.setObjectName("uiMenuBar")
self.uiFileMenu = QtWidgets.QMenu(self.uiMenuBar)
self.uiFileMenu.setObjectName("uiFileMenu")
Expand Down
Loading

0 comments on commit f05b157

Please sign in to comment.