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 = [
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,
......
......@@ -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)
......
......@@ -151,10 +151,8 @@
<property name="title">
<string>&amp;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>
......
......@@ -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):
......
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