diff --git a/gns3/__init__.py b/gns3/__init__.py index e69de29b..58f3ace6 100644 --- a/gns3/__init__.py +++ b/gns3/__init__.py @@ -0,0 +1 @@ +from .version import __version__ diff --git a/gns3/main_window.py b/gns3/main_window.py index 240c1d94..f29ef486 100644 --- a/gns3/main_window.py +++ b/gns3/main_window.py @@ -20,6 +20,7 @@ Main window for the GUI. """ import os +import sys import tempfile import socket import shutil @@ -743,15 +744,17 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): log.info("starting local server {} on {}:{}".format(servers.localServerPath(), server.host, server.port)) if not servers.localServerPath(): - log.info("not local server is configured") + log.info("no local server is configured") return - if servers.startLocalServer(servers.localServerPath(), server.host, server.port): - thread = WaitForConnectionThread(server.host, server.port) - dialog = ProgressDialog(thread, "Local server", "Connecting...", "Cancel", busy=True, parent=self) - dialog.show() - if dialog.exec_() == False: - return + if sys.platform.startswith("win"): + QtGui.QMessageBox.critical(self, "Local server", "Please manually start the server: All programs -> GNS3-ER -> GNS3 Server") + elif servers.startLocalServer(servers.localServerPath(), server.host, server.port): + thread = WaitForConnectionThread(server.host, server.port) + self._progress_dialog = ProgressDialog(thread, "Local server", "Connecting...", "Cancel", busy=True, parent=self) + self._progress_dialog.show() + if self._progress_dialog.exec_() == False: + return else: QtGui.QMessageBox.critical(self, "Local server", "Could not start the local server process: {}".format(servers.localServerPath())) return @@ -798,14 +801,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # move files if saving from a temporary project log.info("moving project files from {} to {}".format(self._project_files_dir, new_project_files_dir)) thread = ProcessFilesThread(self._project_files_dir, new_project_files_dir, move=True) - dialog = ProgressDialog(thread, "Project", "Moving project files...", "Cancel", parent=self) + self._progress_dialog = ProgressDialog(thread, "Project", "Moving project files...", "Cancel", parent=self) else: # else, just copy the files log.info("copying project files from {} to {}".format(self._project_files_dir, new_project_files_dir)) thread = ProcessFilesThread(self._project_files_dir, new_project_files_dir) - dialog = ProgressDialog(thread, "Project", "Copying project files...", "Cancel", parent=self) - dialog.show() - if not dialog.exec_(): + self._progress_dialog = ProgressDialog(thread, "Project", "Copying project files...", "Cancel", parent=self) + self._progress_dialog.show() + if not self._progress_dialog.exec_(): return False self._deleteTemporaryProject() diff --git a/gns3/modules/dynamips/__init__.py b/gns3/modules/dynamips/__init__.py index 07c58f7d..74d8aaa1 100644 --- a/gns3/modules/dynamips/__init__.py +++ b/gns3/modules/dynamips/__init__.py @@ -249,6 +249,13 @@ class Dynamips(Module): if params: for server in self._servers: + if server.isLocal(): + params.update({"working_dir": self._working_dir}) + else: + project_name = os.path.basename(self._working_dir) + if project_name.endswith("-files"): + project_name = project_name[:-6] + params.update({"project_name": project_name}) server.send_notification("dynamips.settings", params) self._settings.update(settings) diff --git a/gns3/modules/dynamips/settings.py b/gns3/modules/dynamips/settings.py index 41cf4130..a89fb1e1 100644 --- a/gns3/modules/dynamips/settings.py +++ b/gns3/modules/dynamips/settings.py @@ -24,7 +24,7 @@ import os # default path to Dynamips executable if sys.platform.startswith("win"): - DEFAULT_DYNAMIPS_PATH = "dynamips.exe" + DEFAULT_DYNAMIPS_PATH = "C:/Program Files (x86)/GNS3-ER/dynamips.exe" elif sys.platform.startswith('darwin'): if hasattr(sys, "frozen"): DEFAULT_DYNAMIPS_PATH = os.path.join(os.getcwdu(), "../Resources/dynamips-0.2.12-OSX.intel64.bin") diff --git a/gns3/modules/iou/__init__.py b/gns3/modules/iou/__init__.py index 3983176d..7e1ea6e5 100644 --- a/gns3/modules/iou/__init__.py +++ b/gns3/modules/iou/__init__.py @@ -253,6 +253,15 @@ class IOU(Module): # encode the iourc file in base64 params["iourc"] = self._base64iourc(params["iourc"]) for server in self._servers: + # send the local working directory only if this is a local server + if server.isLocal(): + params.update({"working_dir": self._working_dir}) + else: + del params["iouyap"] # do not send iouyap path to remote servers + project_name = os.path.basename(self._working_dir) + if project_name.endswith("-files"): + project_name = project_name[:-6] + params.update({"project_name": project_name}) server.send_notification("iou.settings", params) self._settings.update(settings) diff --git a/gns3/news_dialog.py b/gns3/news_dialog.py index 693a453e..a078bdd9 100644 --- a/gns3/news_dialog.py +++ b/gns3/news_dialog.py @@ -35,7 +35,7 @@ class NewsDialog(QtGui.QDialog, Ui_NewsDialog): QtGui.QDialog.__init__(self, parent) self.setupUi(self) - self.webpage = QtCore.QUrl('http://ads.gns3.net/ads.php') + self.webpage = QtCore.QUrl('http://ads.gns3.net/er_ads.php') self.uiWebView.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks) self.connect(self.uiWebView, QtCore.SIGNAL('linkClicked(const QUrl &)'), self._urlClickedSlot) self.connect(self.uiWebView, QtCore.SIGNAL('loadFinished(bool)'), self._loadFinishedSlot) diff --git a/gns3/servers.py b/gns3/servers.py index fafd4f25..6d95f570 100644 --- a/gns3/servers.py +++ b/gns3/servers.py @@ -58,7 +58,7 @@ class Servers(QtCore.QObject): # default path to the local GNS3 server executable or script if sys.platform.startswith("win"): - DEFAULT_LOCAL_SERVER_PATH = "gns3server.exe" + DEFAULT_LOCAL_SERVER_PATH = "C:/Program Files (x86)/GNS3-ER/gns3server.exe" else: # look for gns3server in PATH gns3server = None