Adjustments for PR #929.

This commit is contained in:
grossmj
2016-01-26 16:06:47 -07:00
committed by Julien Duponchelle
parent 41a68e7b0e
commit 965a98d5a7
6 changed files with 34 additions and 41 deletions

View File

@@ -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():

View File

@@ -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('<span style="color: green"><strong>OK</strong></span>')
@@ -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)

View File

@@ -14,7 +14,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Doctor</string>
<string>GNS3 Doctor</string>
</property>
<property name="modal">
<bool>true</bool>
@@ -48,8 +48,8 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Checking...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:600; font-style:italic;&quot;&gt;Starting checks...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -90,9 +90,6 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
</layout>
<zorder>label</zorder>
<zorder></zorder>
<zorder>uiDoctorResultTextEdit</zorder>
</widget>
<resources>
<include location="../../resources/resources.qrc"/>

View File

@@ -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", "<html><head/><body><p>This will list potential problem in your GNS3 installation:</p></body></html>"))
self.uiDoctorResultTextEdit.setHtml(_translate("DoctorDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'.SF NS Text\'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
"<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;\">\n"
"<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>"))
from . import resources_rc

View File

@@ -950,7 +950,7 @@ background-none;
</action>
<action name="uiCheckForUpdateAction">
<property name="text">
<string>Check for Update</string>
<string>Check for &amp;Update</string>
</property>
<property name="statusTip">
<string>Check for Update</string>
@@ -1101,7 +1101,7 @@ background-none;
</action>
<action name="uiLabInstructionsAction">
<property name="text">
<string>Lab instructions</string>
<string>&amp;Lab instructions</string>
</property>
</action>
<action name="uiFitInViewAction">
@@ -1204,12 +1204,12 @@ background-none;
<string>Export debug information</string>
</property>
<property name="toolTip">
<string>Export debug information</string>
<string>&amp;Export debug information</string>
</property>
</action>
<action name="uiDoctorAction">
<property name="text">
<string>Doctor</string>
<string>GNS3 &amp;Doctor</string>
</property>
</action>
</widget>

View File

@@ -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