diff --git a/src/Solver/GenericSolver.py b/src/Solver/GenericSolver.py
index 8f5b0afb..7cf3e332 100644
--- a/src/Solver/GenericSolver.py
+++ b/src/Solver/GenericSolver.py
@@ -15,3 +15,6 @@ class GenericSolver(AbstractSolver):
lst = super(GenericSolver, cls).default_parameters()
return lst
+
+ def log_file(self):
+ return ""
diff --git a/src/View/Configure/Window.py b/src/View/Configure/Window.py
index c0c1b104..3e51f5c1 100644
--- a/src/View/Configure/Window.py
+++ b/src/View/Configure/Window.py
@@ -127,6 +127,9 @@ class ConfigureWindow(ASubWindow, ListedSubWindow):
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
table.setAlternatingRowColors(True)
+ # Editor
+ self.set_line_edit_text("lineEdit_editor_cmd", str(self.conf.editor))
+
# Language
languages = Config.languages()
for lang in languages:
@@ -190,6 +193,9 @@ class ConfigureWindow(ASubWindow, ListedSubWindow):
# Stricklers
self.conf.stricklers = deepcopy(self._stricklers)
+ # Editor
+ self.conf.editor = self.get_line_edit_text("lineEdit_editor_cmd")
+
# Language
self.conf.lang = Config.languages()[self.get_combobox_text("comboBox_language")]
diff --git a/src/View/RunSolver/Log/Window.py b/src/View/RunSolver/Log/Window.py
index fb77fe6f..fb7ba631 100644
--- a/src/View/RunSolver/Log/Window.py
+++ b/src/View/RunSolver/Log/Window.py
@@ -54,7 +54,10 @@ class SolverLogFileWindow(ASubMainWindow, ListedSubWindow):
def setup_action(self):
self.find(QAction, "action_revert").setEnabled(True)
- self.find(QAction, "action_open_in_editor").setEnabled(True)
+ if self._config.editor != "":
+ self.find(QAction, "action_open_in_editor").setEnabled(True)
+ else:
+ self.find(QAction, "action_open_in_editor").setEnabled(False)
def setup_connections(self):
self.find(QAction, "action_revert").triggered.connect(self.revert)
@@ -71,4 +74,15 @@ class SolverLogFileWindow(ASubMainWindow, ListedSubWindow):
self.setup_text()
def open_on_editor(self):
- print("TODO: open in editor")
+ p = QProcess(self)
+
+ cmd = self._config.editor
+ cmd = cmd.replace("@file", self._file_name)
+
+ cmd = cmd.split()
+ exe = cmd[0]
+ args = cmd[1:]
+
+ p.start(
+ exe, args,
+ )
diff --git a/src/View/RunSolver/Window.py b/src/View/RunSolver/Window.py
index 427cea01..1b427b10 100644
--- a/src/View/RunSolver/Window.py
+++ b/src/View/RunSolver/Window.py
@@ -126,6 +126,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(False)
self.find(QAction, "action_pause").setEnabled(True)
self.find(QAction, "action_stop").setEnabled(True)
+ self.find(QAction, "action_log_file").setEnabled(False)
def setup_alarm(self):
self._alarm = QTimer()
@@ -159,7 +160,8 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(False)
- # self.find(QAction, "action_log_file").setEnabled(True)
+ if self._solver.log_file() != "":
+ self.find(QAction, "action_log_file").setEnabled(True)
while self._output.qsize() != 0:
s = self._output.get()
@@ -191,7 +193,8 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(False)
- self.find(QAction, "action_log_file").setEnabled(True)
+ if self._solver.log_file() != "":
+ self.find(QAction, "action_log_file").setEnabled(True)
def log_file(self):
file_name = os.path.join(self._workdir, self._solver.log_file())
diff --git a/src/View/ui/ConfigureDialog.ui b/src/View/ui/ConfigureDialog.ui
index 693971a0..8f9a5603 100644
--- a/src/View/ui/ConfigureDialog.ui
+++ b/src/View/ui/ConfigureDialog.ui
@@ -409,6 +409,56 @@
+
+
+ Editor
+
+
+ -
+
+
+
+ true
+
+
+
+ This value must be used for reading or editing files in speficic case
+
+
+
+ -
+
+
-
+
+
+ Editor command
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
Language
diff --git a/src/View/ui/SolverLogFile.ui b/src/View/ui/SolverLogFile.ui
index dae48914..15922be4 100644
--- a/src/View/ui/SolverLogFile.ui
+++ b/src/View/ui/SolverLogFile.ui
@@ -13,6 +13,9 @@
MainWindow
+
+
+
-
diff --git a/src/config.py b/src/config.py
index 60550351..f1db3b8c 100644
--- a/src/config.py
+++ b/src/config.py
@@ -16,7 +16,6 @@ class Config(object):
self.set_default_value()
def set_default_value(self):
- print('toto')
# Solvers
self._solvers = []
@@ -33,6 +32,9 @@ class Config(object):
self.backup_frequence = "00:05:00"
self.backup_max = 10
+ # Editor
+ self.editor = "emacs @file"
+
# Languages
self.lang = ""