Change the location of the topology json schema

Fix #415
This commit is contained in:
Julien Duponchelle
2015-06-10 17:04:38 +02:00
parent c202399eb6
commit 7466bda816
13 changed files with 4256 additions and 4246 deletions

View File

@@ -947,13 +947,13 @@ class GraphicsView(QtWidgets.QGraphicsView):
for item in self.scene().selectedItems():
if isinstance(item, NodeItem) and item.node().initialized():
node = item.node()
vm_dir = node.project().filesDir() #FIXME: get the VM directory instead
vm_dir = node.project().filesDir() # FIXME: get the VM directory instead
if os.path.exists(vm_dir):
if QtGui.QDesktopServices.openUrl(QtCore.QUrl.fromLocalFile(vm_dir)) is False:
QtWidgets.QMessageBox.critical(self, "Show in file manager", "Failed to open {}".format(vm_dir))
break
else:
#TODO: this is a remote server, show an info box
# TODO: this is a remote server, show an info box
pass
def consoleToNode(self, node, aux=False):

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_iosRouterConfigPageWidget:
def setupUi(self, iosRouterConfigPageWidget):
iosRouterConfigPageWidget.setObjectName("iosRouterConfigPageWidget")
iosRouterConfigPageWidget.resize(467, 493)
@@ -597,4 +599,3 @@ class Ui_iosRouterConfigPageWidget:
self.uiSensor4Label.setText(_translate("iosRouterConfigPageWidget", "NPE outlet:"))
self.uiSensor4SpinBox.setSuffix(_translate("iosRouterConfigPageWidget", " C"))
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiEnvironmentPageWidget), _translate("iosRouterConfigPageWidget", "Environment"))

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_iouDeviceConfigPageWidget:
def setupUi(self, iouDeviceConfigPageWidget):
iouDeviceConfigPageWidget.setObjectName("iouDeviceConfigPageWidget")
iouDeviceConfigPageWidget.resize(429, 516)
@@ -199,4 +201,3 @@ class Ui_iouDeviceConfigPageWidget:
self.uiSerialAdaptersLabel.setText(_translate("iouDeviceConfigPageWidget", "Serial adapters:"))
self.uiSerialAdaptersSpinBox.setToolTip(_translate("iouDeviceConfigPageWidget", "1 adapter equals 4 serial interfaces"))
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_2), _translate("iouDeviceConfigPageWidget", "Network"))

View File

@@ -9,7 +9,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_QemuImageWizard:
def setupUi(self, QemuImageWizard):
QemuImageWizard.setObjectName("QemuImageWizard")
QemuImageWizard.resize(420, 300)
@@ -318,11 +320,11 @@ class Ui_QemuImageWizard:
self.uiFormatQcow2Radio.setToolTip(_translate("QemuImageWizard", "Qcow2 is the current Qemu format, supporting many special features."))
self.uiFormatQcowRadio.setToolTip(_translate("QemuImageWizard", "Qcow is a legacy Qemu format that is also supported by VirtualBox."))
self.uiFormatVhdRadio.setToolTip(_translate("QemuImageWizard", "VHD is the format used by Microsoft VirtualPC, and is also supported by Qemu and VirtualBox.\n"
"On Windows 7 and above, it can be mounted on the host PC."))
"On Windows 7 and above, it can be mounted on the host PC."))
self.uiFormatVdiRadio.setToolTip(_translate("QemuImageWizard", "VDI is the native format of VirtualBox"))
self.uiFormatVmdkRadio.setToolTip(_translate("QemuImageWizard", "VMDK is the native format for VMware and is also supported by Qemu and VirtualBox."))
self.uiFormatRawRadio.setToolTip(_translate("QemuImageWizard", "Raw image files represent the actual data on the image, with zero special features.\n"
"It can easily be converted to various other formats by various utilities, making it the most portable format."))
"It can easily be converted to various other formats by various utilities, making it the most portable format."))
self.uiFormatRawRadio.setText(_translate("QemuImageWizard", "Raw"))
self.uiQcow2OptionsWizardPage.setTitle(_translate("QemuImageWizard", "Qcow2 options"))
self.uiSizeOptionsGroupBox.setTitle(_translate("QemuImageWizard", "Size options"))
@@ -330,12 +332,12 @@ class Ui_QemuImageWizard:
self.uiQcow2PreallocationOffRadio.setToolTip(_translate("QemuImageWizard", "The file only takes as much space from the host as needed. The VM will still see the full capacity you specify."))
self.uiQcow2PreallocationOffRadio.setText(_translate("QemuImageWizard", "off"))
self.uiQcow2PreallocationMetadataRadio.setToolTip(_translate("QemuImageWizard", "Same as \"off\", but preallocates enough space to hold any potenial metadata for the HDD.\n"
"This improves performance when the image file needs to grow."))
"This improves performance when the image file needs to grow."))
self.uiQcow2PreallocationMetadataRadio.setText(_translate("QemuImageWizard", "metadata"))
self.uiQcow2PreallocationFallocRadio.setToolTip(_translate("QemuImageWizard", "Same as \"full\", but uses C\'s posix_fallocate() if available on the host, instead of zero filling the file."))
self.uiQcow2PreallocationFallocRadio.setText(_translate("QemuImageWizard", "falloc"))
self.uiQcow2PreallocationFullRadio.setToolTip(_translate("QemuImageWizard", "The file will start off at the full size you specify.\n"
"Free space will be zero filled."))
"Free space will be zero filled."))
self.uiQcow2PreallocationFullRadio.setText(_translate("QemuImageWizard", "full"))
self.uiClusterSizeLabel.setText(_translate("QemuImageWizard", "Cluster size:"))
self.uiQcow2ClusterSizeComboBox.setItemText(0, _translate("QemuImageWizard", "<default>"))
@@ -395,4 +397,3 @@ class Ui_QemuImageWizard:
self.uiLocationBrowseToolButton.setText(_translate("QemuImageWizard", "Browse"))
self.uiSizeLabel.setText(_translate("QemuImageWizard", "Disk size:"))
self.uiSizeSpinBox.setSuffix(_translate("QemuImageWizard", " MiB"))

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_QemuVMConfigPageWidget:
def setupUi(self, QemuVMConfigPageWidget):
QemuVMConfigPageWidget.setObjectName("QemuVMConfigPageWidget")
QemuVMConfigPageWidget.resize(490, 460)
@@ -315,4 +317,3 @@ class Ui_QemuVMConfigPageWidget:
self.uiQemuOptionsLabel.setText(_translate("QemuVMConfigPageWidget", "Options:"))
self.uiACPIShutdownCheckBox.setText(_translate("QemuVMConfigPageWidget", "Enable ACPI shutdown (experimental)"))
self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.tab_2), _translate("QemuVMConfigPageWidget", "Advanced settings"))

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_virtualBoxVMConfigPageWidget:
def setupUi(self, virtualBoxVMConfigPageWidget):
virtualBoxVMConfigPageWidget.setObjectName("virtualBoxVMConfigPageWidget")
virtualBoxVMConfigPageWidget.resize(509, 346)
@@ -127,4 +129,3 @@ class Ui_virtualBoxVMConfigPageWidget:
self.label.setText(_translate("virtualBoxVMConfigPageWidget", "Type:"))
self.uiUseAnyAdapterCheckBox.setText(_translate("virtualBoxVMConfigPageWidget", "Allow GNS3 to use any configured VirtualBox adapter"))
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_2), _translate("virtualBoxVMConfigPageWidget", "Network"))

View File

@@ -127,7 +127,6 @@ class Servers(QtCore.QObject):
"""
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(64))
def _loadSettings(self):
"""
Loads the server settings from the persistent settings file.

View File

@@ -17,6 +17,7 @@
import jsonschema
import json
import os
from gns3.utils.get_resource import get_resource
@@ -29,7 +30,7 @@ def getTopologyValidationErrors(topology):
:returns: Return None if ok otherwise an error message
"""
with open(get_resource("topology_schema.json")) as f:
with open(get_resource(os.path.join("schemas", "topology.json"))) as f:
schema = json.load(f)
v = jsonschema.Draft4Validator(schema)

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_NodePropertiesDialog:
def setupUi(self, NodePropertiesDialog):
NodePropertiesDialog.setObjectName("NodePropertiesDialog")
NodePropertiesDialog.resize(689, 454)
@@ -70,7 +72,7 @@ class Ui_NodePropertiesDialog:
self.gridlayout.addWidget(self.splitter, 0, 0, 1, 1)
self.uiButtonBox = QtWidgets.QDialogButtonBox(NodePropertiesDialog)
self.uiButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.uiButtonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Reset)
self.uiButtonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply | QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Reset)
self.uiButtonBox.setObjectName("uiButtonBox")
self.gridlayout.addWidget(self.uiButtonBox, 1, 0, 1, 1)
@@ -84,6 +86,6 @@ class Ui_NodePropertiesDialog:
self.uiNodesTreeWidget.headerItem().setText(0, _translate("NodePropertiesDialog", "Nodes"))
self.uiTitleLabel.setText(_translate("NodePropertiesDialog", "Node Configuration"))
self.textLabel.setText(_translate("NodePropertiesDialog", "Please select a node in the list \n"
"to display the configuration page."))
"to display the configuration page."))
from . import resources_rc

View File

@@ -10,7 +10,9 @@
import gns3.qt
from gns3.qt import QtCore, QtGui, QtWidgets
class Ui_ServerPreferencesPageWidget:
def setupUi(self, ServerPreferencesPageWidget):
ServerPreferencesPageWidget.setObjectName("ServerPreferencesPageWidget")
ServerPreferencesPageWidget.resize(508, 595)
@@ -303,4 +305,3 @@ class Ui_ServerPreferencesPageWidget:
self.uiDeleteRemoteServerPushButton.setText(_translate("ServerPreferencesPageWidget", "&Delete"))
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiRemoteTabWidget), _translate("ServerPreferencesPageWidget", "Remote servers"))
self.uiRestoreDefaultsPushButton.setText(_translate("ServerPreferencesPageWidget", "Restore defaults"))

View File

@@ -64,7 +64,7 @@ setup(
},
packages=find_packages(".", exclude=["docs", "tests"]),
include_package_data=True,
package_data={"gns3": ["configs/*.txt", "resources/*.json"]},
package_data={"gns3": ["configs/*.txt", "schemas/*.json"]},
platforms="any",
classifiers=[
"Development Status :: 4 - Beta",