|
20 | 20 | """ |
21 | 21 |
|
22 | 22 | import os |
| 23 | +import sys |
23 | 24 | import tempfile |
24 | 25 | import socket |
25 | 26 | import shutil |
@@ -743,15 +744,17 @@ def startupLoading(self): |
743 | 744 | log.info("starting local server {} on {}:{}".format(servers.localServerPath(), server.host, server.port)) |
744 | 745 |
|
745 | 746 | if not servers.localServerPath(): |
746 | | - log.info("not local server is configured") |
| 747 | + log.info("no local server is configured") |
747 | 748 | return |
748 | 749 |
|
749 | | - if servers.startLocalServer(servers.localServerPath(), server.host, server.port): |
750 | | - thread = WaitForConnectionThread(server.host, server.port) |
751 | | - dialog = ProgressDialog(thread, "Local server", "Connecting...", "Cancel", busy=True, parent=self) |
752 | | - dialog.show() |
753 | | - if dialog.exec_() == False: |
754 | | - return |
| 750 | + if sys.platform.startswith("win"): |
| 751 | + QtGui.QMessageBox.critical(self, "Local server", "Please manually start the server: All programs -> GNS3-ER -> GNS3 Server") |
| 752 | + elif servers.startLocalServer(servers.localServerPath(), server.host, server.port): |
| 753 | + thread = WaitForConnectionThread(server.host, server.port) |
| 754 | + self._progress_dialog = ProgressDialog(thread, "Local server", "Connecting...", "Cancel", busy=True, parent=self) |
| 755 | + self._progress_dialog.show() |
| 756 | + if self._progress_dialog.exec_() == False: |
| 757 | + return |
755 | 758 | else: |
756 | 759 | QtGui.QMessageBox.critical(self, "Local server", "Could not start the local server process: {}".format(servers.localServerPath())) |
757 | 760 | return |
@@ -798,14 +801,14 @@ def _saveProjectAs(self): |
798 | 801 | # move files if saving from a temporary project |
799 | 802 | log.info("moving project files from {} to {}".format(self._project_files_dir, new_project_files_dir)) |
800 | 803 | thread = ProcessFilesThread(self._project_files_dir, new_project_files_dir, move=True) |
801 | | - dialog = ProgressDialog(thread, "Project", "Moving project files...", "Cancel", parent=self) |
| 804 | + self._progress_dialog = ProgressDialog(thread, "Project", "Moving project files...", "Cancel", parent=self) |
802 | 805 | else: |
803 | 806 | # else, just copy the files |
804 | 807 | log.info("copying project files from {} to {}".format(self._project_files_dir, new_project_files_dir)) |
805 | 808 | thread = ProcessFilesThread(self._project_files_dir, new_project_files_dir) |
806 | | - dialog = ProgressDialog(thread, "Project", "Copying project files...", "Cancel", parent=self) |
807 | | - dialog.show() |
808 | | - if not dialog.exec_(): |
| 809 | + self._progress_dialog = ProgressDialog(thread, "Project", "Copying project files...", "Cancel", parent=self) |
| 810 | + self._progress_dialog.show() |
| 811 | + if not self._progress_dialog.exec_(): |
809 | 812 | return False |
810 | 813 |
|
811 | 814 | self._deleteTemporaryProject() |
|
0 commit comments