From 965a98d5a7bcd0c137f5d86d66fc857a841a8ca2 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 26 Jan 2016 16:06:47 -0700 Subject: [PATCH] Adjustments for PR #929. --- gns3/console_view.py | 2 +- gns3/dialogs/doctor_dialog.py | 33 +++++++++++++++------------------ gns3/ui/doctor_dialog.ui | 9 +++------ gns3/ui/doctor_dialog_ui.py | 13 ++++++------- gns3/ui/main_window.ui | 8 ++++---- gns3/ui/main_window_ui.py | 10 +++++----- 6 files changed, 34 insertions(+), 41 deletions(-) diff --git a/gns3/console_view.py b/gns3/console_view.py index c0b31610..52f8bcdc 100644 --- a/gns3/console_view.py +++ b/gns3/console_view.py @@ -43,7 +43,7 @@ class ConsoleView(PyCutExt, ConsoleCmd): current_year = datetime.date.today().year self.intro = "GNS3 management console.\nRunning GNS3 version {} on {} ({}-bit) with Python {} Qt {}.\n" \ "Copyright (c) 2006-{} GNS3 Technologies.\n" \ - "In case of problem use Help / Doctor to detect common issues." \ + "Use Help -> GNS3 Doctor to detect common issues." \ "".format(__version__, platform.system(), bitness, platform.python_version(), QtCore.QT_VERSION_STR, current_year) if LocalConfig.instance().experimental(): diff --git a/gns3/dialogs/doctor_dialog.py b/gns3/dialogs/doctor_dialog.py index 2effa93e..737f680a 100644 --- a/gns3/dialogs/doctor_dialog.py +++ b/gns3/dialogs/doctor_dialog.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2015 GNS3 Technologies Inc. +# Copyright (C) 2016 GNS3 Technologies Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ import psutil - -from gns3.version import __version__ -from gns3.qt import QtWidgets, QtCore +from gns3.qt import QtWidgets from gns3.ui.doctor_dialog_ui import Ui_DoctorDialog from gns3.servers import Servers from gns3.local_config import LocalConfig @@ -45,7 +43,7 @@ class DoctorDialog(QtWidgets.QDialog, Ui_DoctorDialog): self.uiOkButton.clicked.connect(self._okButtonClickedSlot) for method in sorted(dir(self)): if method.startswith('check'): - self.write(getattr(self, method).__doc__ + ": ") + self.write(getattr(self, method).__doc__ + "...") (res, msg) = getattr(self, method)() if res == 0: self.write('OK') @@ -65,51 +63,50 @@ class DoctorDialog(QtWidgets.QDialog, Ui_DoctorDialog): self.accept() def checkLocalServerEnabled(self): - """Check if local server is enabled""" + """Checking if the local server is enabled""" if Servers.instance().shouldLocalServerAutoStart() is False: - return (2, "The local server is disabled. Go to Preferences / Server / Local Server and enable the local server.") + return (2, "The local server is disabled. Go to Preferences -> Server -> Local Server and enable the local server.") return (0, None) def checkDevVersionOfGNS3(self): - """Check if it's a stable version of GNS3""" + """Checking for stable GNS3 version""" if version.__version_info__[3] != 0: - return (2, "You are using a non stable version of GNS3.") + return (1, "You are using a unstable version of GNS3.") return (0, None) def checkExperimentalFeaturesEnabled(self): - """Check if experimental features of GNS3 are not enabled""" + """Checking if experimental features are not enabled""" if LocalConfig.instance().experimental(): - return (2, "Experimental features are enabled. Please turn it off by going to Preferences / General / Miscellaneous.") + return (1, "Experimental features are enabled. Turn them off by going to Preferences -> General -> Miscellaneous.") return (0, None) def checkAVGInstalled(self): - """Check if AVG is not installed""" + """Checking if AVG software is not installed""" for proc in psutil.process_iter(): try: psinfo = proc.as_dict(["exe"]) if psinfo["exe"] and "AVG\\" in psinfo["exe"]: - return (2, "AVG has known troubles with GNS3 even when you disable it. You need to whitelist dynamips.exe in AVG preferences.") + return (2, "AVG has known issues with GNS3, even after you disable it. You must whitelist dynamips.exe in the AVG preferences.") except psutil.NoSuchProcess: pass return (0, None) def checkFreeRam(self): - """Check free RAM""" + """Checking for amount of free virtual memory""" if int(psutil.virtual_memory().available / (1024 * 1024)) < 600: - return (2, "You have less than 600MB of RAM, this could block appliance like CISCO 7200") + return (2, "You have less than 600MB of available virtual memory, this could prevent nodes to start") return (0, None) def checkVmrun(self): - """Check if vmrun is installed""" + """Checking if vmrun is installed""" vmrun = VMware.instance().findVmrun() if len(vmrun) == 0: - return (1, "vmrun not found on your system you can not use the VMware support.") + return (1, "The vmrun executable could not be found, VMware VMs cannot be used") return (0, None) - if __name__ == '__main__': import sys app = QtWidgets.QApplication(sys.argv) diff --git a/gns3/ui/doctor_dialog.ui b/gns3/ui/doctor_dialog.ui index 12a97d2e..ace7aa4e 100755 --- a/gns3/ui/doctor_dialog.ui +++ b/gns3/ui/doctor_dialog.ui @@ -14,7 +14,7 @@ - Doctor + GNS3 Doctor true @@ -48,8 +48,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Checking...</p></body></html> +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:600; font-style:italic;">Starting checks...</span></p></body></html> @@ -90,9 +90,6 @@ p, li { white-space: pre-wrap; } - label - - uiDoctorResultTextEdit diff --git a/gns3/ui/doctor_dialog_ui.py b/gns3/ui/doctor_dialog_ui.py index aaac6ddd..8150f965 100644 --- a/gns3/ui/doctor_dialog_ui.py +++ b/gns3/ui/doctor_dialog_ui.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/Users/noplay/code/gns3/gns3-gui/gns3/ui/doctor_dialog.ui' +# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/doctor_dialog.ui' # -# Created by: PyQt5 UI code generator 5.5.1 +# Created: Tue Jan 26 16:05:25 2016 +# by: PyQt5 UI code generator 5.2.1 # # WARNING! All changes made in this file will be lost! @@ -43,20 +44,18 @@ class Ui_DoctorDialog(object): self.uiOkButton.setObjectName("uiOkButton") self.horizontalLayout.addWidget(self.uiOkButton) self.verticalLayout.addLayout(self.horizontalLayout) - self.label.raise_() - self.uiDoctorResultTextEdit.raise_() self.retranslateUi(DoctorDialog) QtCore.QMetaObject.connectSlotsByName(DoctorDialog) def retranslateUi(self, DoctorDialog): _translate = QtCore.QCoreApplication.translate - DoctorDialog.setWindowTitle(_translate("DoctorDialog", "Doctor")) + DoctorDialog.setWindowTitle(_translate("DoctorDialog", "GNS3 Doctor")) self.label.setText(_translate("DoctorDialog", "

This will list potential problem in your GNS3 installation:

")) self.uiDoctorResultTextEdit.setHtml(_translate("DoctorDialog", "\n" "\n" -"

Checking...

")) +"\n" +"

Starting checks...

")) from . import resources_rc diff --git a/gns3/ui/main_window.ui b/gns3/ui/main_window.ui index e813649d..1b83e38a 100644 --- a/gns3/ui/main_window.ui +++ b/gns3/ui/main_window.ui @@ -950,7 +950,7 @@ background-none; - Check for Update + Check for &Update Check for Update @@ -1101,7 +1101,7 @@ background-none; - Lab instructions + &Lab instructions @@ -1204,12 +1204,12 @@ background-none; Export debug information - Export debug information + &Export debug information - Doctor + GNS3 &Doctor diff --git a/gns3/ui/main_window_ui.py b/gns3/ui/main_window_ui.py index 60d29350..7e3dc870 100644 --- a/gns3/ui/main_window_ui.py +++ b/gns3/ui/main_window_ui.py @@ -377,8 +377,8 @@ class Ui_MainWindow(object): icon28 = QtGui.QIcon() 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/cancel-connection.svg"), QtGui.QIcon.Active, QtGui.QIcon.On) 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) self.uiAddLinkAction.setObjectName("uiAddLinkAction") self.uiGettingStartedAction = QtWidgets.QAction(MainWindow) @@ -641,7 +641,7 @@ class Ui_MainWindow(object): self.uiResetPortLabelsAction.setText(_translate("MainWindow", "Reset interface labels")) self.uiResetPortLabelsAction.setToolTip(_translate("MainWindow", "Reset interface labels")) self.uiResetPortLabelsAction.setStatusTip(_translate("MainWindow", "Reset Interface Labels")) - self.uiCheckForUpdateAction.setText(_translate("MainWindow", "Check for Update")) + self.uiCheckForUpdateAction.setText(_translate("MainWindow", "Check for &Update")) self.uiCheckForUpdateAction.setStatusTip(_translate("MainWindow", "Check for Update")) self.uiEnergySavingStyleAction.setText(_translate("MainWindow", "Energy Saving")) self.uiEnergySavingStyleAction.setStatusTip(_translate("MainWindow", "Energy Saving Mode")) @@ -670,7 +670,7 @@ class Ui_MainWindow(object): self.uiAddLinkAction.setStatusTip(_translate("MainWindow", "Add a link")) self.uiGettingStartedAction.setText(_translate("MainWindow", "Getting started")) self.uiGettingStartedAction.setToolTip(_translate("MainWindow", "Show GNS3 news")) - self.uiLabInstructionsAction.setText(_translate("MainWindow", "Lab instructions")) + self.uiLabInstructionsAction.setText(_translate("MainWindow", "&Lab instructions")) self.uiFitInViewAction.setText(_translate("MainWindow", "Fit in view")) self.uiExportProjectAction.setText(_translate("MainWindow", "Backup project to cloud")) self.uiImportProjectAction.setText(_translate("MainWindow", "Restore backup from cloud")) @@ -686,8 +686,8 @@ class Ui_MainWindow(object): self.uiIOUVMConverterAction.setText(_translate("MainWindow", "IOU VM Converter")) self.uiOpenApplianceAction.setText(_translate("MainWindow", "Import appliance")) self.uiExportDebugInformationAction.setText(_translate("MainWindow", "Export debug information")) - self.uiExportDebugInformationAction.setToolTip(_translate("MainWindow", "Export debug information")) - self.uiDoctorAction.setText(_translate("MainWindow", "Doctor")) + self.uiExportDebugInformationAction.setToolTip(_translate("MainWindow", "&Export debug information")) + self.uiDoctorAction.setText(_translate("MainWindow", "GNS3 &Doctor")) from ..console_view import ConsoleView from ..graphics_view import GraphicsView