diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 493878841827f17cf5b1547135d409e8dbe6f104..fed284a7b7bdb8a3538eabe1a78b02bbdc79f0ce 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -41,6 +41,7 @@ no_model_action = [ model_action = [ "action_menu_close", "action_menu_edit", "action_menu_save", "action_menu_save_as", "action_toolBar_close", "action_toolBar_save", + "action_menu_numerical_parameter", ] other_model_action = [ @@ -117,6 +118,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): "action_menu_open": self.open_model, "action_menu_save": self.save_study, "action_menu_save_as": self.save_as_study, + "action_menu_numerical_parameter": self.open_solver_parameters, "action_run_solver": self.run_solver, ## Help "action_menu_about": self.open_about, @@ -125,9 +127,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): "action_toolBar_open": self.open_model, "action_toolBar_save": self.save_study, "action_toolBar_close": self.close_model, - "action_toolBar_run_solver": self.open_dummy, - "action_toolBar_kill_solver": self.open_dummy, - "action_toolBar_listing": self.open_dummy, + "action_toolBar_run_solver": self.run_solver, ## Current actions "action_toolBar_network": self.open_network, "action_toolBar_geometry": self.open_geometry, diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 26aa87c24b540c569b6b08c4ed9ed63d064fcf47..2569497ad08fa52321732841454d86361e254b82 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -279,6 +279,7 @@ class GraphWidget(QGraphicsView): self._selected_item = None self._selected_new_edge_src_node = None self._current_edge = None + self._current_moved_node = None self.tmp_line = None self.node_items = [] @@ -714,15 +715,16 @@ class GraphWidget(QGraphicsView): self.clicked = False if self._state == "move": - pos = self.mapToScene(event.pos()) - self._undo.push( - SetNodePosCommand( - self._current_moved_node, - (pos.x(), pos.y()), - (self._mouse_origin_x, - self._mouse_origin_y) + if self._current_moved_node is not None: + pos = self.mapToScene(event.pos()) + self._undo.push( + SetNodePosCommand( + self._current_moved_node, + (pos.x(), pos.y()), + (self._mouse_origin_x, + self._mouse_origin_y) + ) ) - ) self.update() super(GraphWidget, self).mouseReleaseEvent(event) diff --git a/src/View/ui/MainWindow.ui b/src/View/ui/MainWindow.ui index fa4be386d4870e4b18c9937acb38e2971c991ba8..777288fe2bb79be0b621dbd5a20cf870b53cf799 100644 --- a/src/View/ui/MainWindow.ui +++ b/src/View/ui/MainWindow.ui @@ -151,10 +151,8 @@ <property name="title"> <string>&Execute</string> </property> - <addaction name="action_numerical_parameter_MAGE"/> + <addaction name="action_menu_numerical_parameter"/> <addaction name="action_run_solver"/> - <addaction name="action_stop_solver"/> - <addaction name="action_display_listings"/> <addaction name="action_simulation_directory_management"/> <addaction name="separator"/> </widget> @@ -263,8 +261,6 @@ <addaction name="action_toolBar_close"/> <addaction name="action_toolBar_quit"/> <addaction name="action_toolBar_run_solver"/> - <addaction name="action_toolBar_kill_solver"/> - <addaction name="action_toolBar_listing"/> <addaction name="separator"/> <addaction name="action_toolBar_network"/> <addaction name="action_toolBar_geometry"/> @@ -298,8 +294,6 @@ <addaction name="separator"/> <addaction name="action_toolBar_sections"/> <addaction name="separator"/> - <addaction name="action_toolBar_stricklers"/> - <addaction name="separator"/> <addaction name="action_toolBar_building"/> <addaction name="separator"/> <addaction name="action_toolBar_initial_cond"/> @@ -504,9 +498,12 @@ <string>XYZ</string> </property> </action> - <action name="action_numerical_parameter_MAGE"> + <action name="action_menu_numerical_parameter"> <property name="text"> - <string>Numerical parameter for MAGE solver</string> + <string>Numerical parameter for solvers</string> + </property> + <property name="toolTip"> + <string>Numerical parameter for solvers</string> </property> </action> <action name="action_boundary_conditions"> @@ -696,7 +693,7 @@ <action name="action_toolBar_run_solver"> <property name="icon"> <iconset> - <normaloff>ressources/gtk-execute.png</normaloff>ressources/gtk-execute.png</iconset> + <normaloff>ressources/player_play.png</normaloff>ressources/player_play.png</iconset> </property> <property name="text"> <string>Run solver</string> diff --git a/src/config.py b/src/config.py index 64f5664a3d92519093026085f11580cd6932ca99..16421b8d028ca1ea223f11fa289e58b3a40f3f9e 100644 --- a/src/config.py +++ b/src/config.py @@ -19,6 +19,8 @@ class Config(SQL): self.filename = Config.filename() self.set_default_value() + print(self.filename) + super(Config, self).__init__(filename = self.filename) def _create(self): @@ -226,7 +228,14 @@ class Config(SQL): @classmethod def filename(cls): - return os.path.expanduser('~') + config_dir + config_file + file = "" + + if os.name == 'posix': + file = os.path.expanduser('~') + config_dir + config_file + else: + file = os.path.expanduser('~') + config_file + + return file @classmethod def languages(cls):