Commit 304f10c8 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

MainWindow, Config: Minor change and bug fixe for windows config.

Showing with 30 additions and 22 deletions
+30 -22
...@@ -41,6 +41,7 @@ no_model_action = [ ...@@ -41,6 +41,7 @@ no_model_action = [
model_action = [ model_action = [
"action_menu_close", "action_menu_edit", "action_menu_save", "action_menu_close", "action_menu_edit", "action_menu_save",
"action_menu_save_as", "action_toolBar_close", "action_toolBar_save", "action_menu_save_as", "action_toolBar_close", "action_toolBar_save",
"action_menu_numerical_parameter",
] ]
other_model_action = [ other_model_action = [
...@@ -117,6 +118,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ...@@ -117,6 +118,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_menu_open": self.open_model, "action_menu_open": self.open_model,
"action_menu_save": self.save_study, "action_menu_save": self.save_study,
"action_menu_save_as": self.save_as_study, "action_menu_save_as": self.save_as_study,
"action_menu_numerical_parameter": self.open_solver_parameters,
"action_run_solver": self.run_solver, "action_run_solver": self.run_solver,
## Help ## Help
"action_menu_about": self.open_about, "action_menu_about": self.open_about,
...@@ -125,9 +127,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ...@@ -125,9 +127,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_toolBar_open": self.open_model, "action_toolBar_open": self.open_model,
"action_toolBar_save": self.save_study, "action_toolBar_save": self.save_study,
"action_toolBar_close": self.close_model, "action_toolBar_close": self.close_model,
"action_toolBar_run_solver": self.open_dummy, "action_toolBar_run_solver": self.run_solver,
"action_toolBar_kill_solver": self.open_dummy,
"action_toolBar_listing": self.open_dummy,
## Current actions ## Current actions
"action_toolBar_network": self.open_network, "action_toolBar_network": self.open_network,
"action_toolBar_geometry": self.open_geometry, "action_toolBar_geometry": self.open_geometry,
......
...@@ -279,6 +279,7 @@ class GraphWidget(QGraphicsView): ...@@ -279,6 +279,7 @@ class GraphWidget(QGraphicsView):
self._selected_item = None self._selected_item = None
self._selected_new_edge_src_node = None self._selected_new_edge_src_node = None
self._current_edge = None self._current_edge = None
self._current_moved_node = None
self.tmp_line = None self.tmp_line = None
self.node_items = [] self.node_items = []
...@@ -714,15 +715,16 @@ class GraphWidget(QGraphicsView): ...@@ -714,15 +715,16 @@ class GraphWidget(QGraphicsView):
self.clicked = False self.clicked = False
if self._state == "move": if self._state == "move":
pos = self.mapToScene(event.pos()) if self._current_moved_node is not None:
self._undo.push( pos = self.mapToScene(event.pos())
SetNodePosCommand( self._undo.push(
self._current_moved_node, SetNodePosCommand(
(pos.x(), pos.y()), self._current_moved_node,
(self._mouse_origin_x, (pos.x(), pos.y()),
self._mouse_origin_y) (self._mouse_origin_x,
self._mouse_origin_y)
)
) )
)
self.update() self.update()
super(GraphWidget, self).mouseReleaseEvent(event) super(GraphWidget, self).mouseReleaseEvent(event)
......
...@@ -151,10 +151,8 @@ ...@@ -151,10 +151,8 @@
<property name="title"> <property name="title">
<string>&amp;Execute</string> <string>&amp;Execute</string>
</property> </property>
<addaction name="action_numerical_parameter_MAGE"/> <addaction name="action_menu_numerical_parameter"/>
<addaction name="action_run_solver"/> <addaction name="action_run_solver"/>
<addaction name="action_stop_solver"/>
<addaction name="action_display_listings"/>
<addaction name="action_simulation_directory_management"/> <addaction name="action_simulation_directory_management"/>
<addaction name="separator"/> <addaction name="separator"/>
</widget> </widget>
...@@ -263,8 +261,6 @@ ...@@ -263,8 +261,6 @@
<addaction name="action_toolBar_close"/> <addaction name="action_toolBar_close"/>
<addaction name="action_toolBar_quit"/> <addaction name="action_toolBar_quit"/>
<addaction name="action_toolBar_run_solver"/> <addaction name="action_toolBar_run_solver"/>
<addaction name="action_toolBar_kill_solver"/>
<addaction name="action_toolBar_listing"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_toolBar_network"/> <addaction name="action_toolBar_network"/>
<addaction name="action_toolBar_geometry"/> <addaction name="action_toolBar_geometry"/>
...@@ -298,8 +294,6 @@ ...@@ -298,8 +294,6 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_toolBar_sections"/> <addaction name="action_toolBar_sections"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_toolBar_stricklers"/>
<addaction name="separator"/>
<addaction name="action_toolBar_building"/> <addaction name="action_toolBar_building"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_toolBar_initial_cond"/> <addaction name="action_toolBar_initial_cond"/>
...@@ -504,9 +498,12 @@ ...@@ -504,9 +498,12 @@
<string>XYZ</string> <string>XYZ</string>
</property> </property>
</action> </action>
<action name="action_numerical_parameter_MAGE"> <action name="action_menu_numerical_parameter">
<property name="text"> <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> </property>
</action> </action>
<action name="action_boundary_conditions"> <action name="action_boundary_conditions">
...@@ -696,7 +693,7 @@ ...@@ -696,7 +693,7 @@
<action name="action_toolBar_run_solver"> <action name="action_toolBar_run_solver">
<property name="icon"> <property name="icon">
<iconset> <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>
<property name="text"> <property name="text">
<string>Run solver</string> <string>Run solver</string>
......
...@@ -19,6 +19,8 @@ class Config(SQL): ...@@ -19,6 +19,8 @@ class Config(SQL):
self.filename = Config.filename() self.filename = Config.filename()
self.set_default_value() self.set_default_value()
print(self.filename)
super(Config, self).__init__(filename = self.filename) super(Config, self).__init__(filename = self.filename)
def _create(self): def _create(self):
...@@ -226,7 +228,14 @@ class Config(SQL): ...@@ -226,7 +228,14 @@ class Config(SQL):
@classmethod @classmethod
def filename(cls): 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 @classmethod
def languages(cls): def languages(cls):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment