Mon, 12 Dec 2016 18:56:42 +0100
Improved the histories handling of the debugger UI.
--- a/APIs/Python3/eric6.api Sun Dec 11 18:43:05 2016 +0100 +++ b/APIs/Python3/eric6.api Mon Dec 12 18:56:42 2016 +0100 @@ -497,15 +497,15 @@ eric6.Debugger.DebugUI.DebugUI.initMenus?4() eric6.Debugger.DebugUI.DebugUI.initToolbars?4(toolbarManager) eric6.Debugger.DebugUI.DebugUI.resetUI?7 -eric6.Debugger.DebugUI.DebugUI.setArgvHistory?4(argsStr, clearHistories=False) +eric6.Debugger.DebugUI.DebugUI.setArgvHistory?4(argsStr, clearHistories=False, history=None) eric6.Debugger.DebugUI.DebugUI.setAutoClearShell?4(autoClearShell) eric6.Debugger.DebugUI.DebugUI.setAutoContinue?4(autoContinue) -eric6.Debugger.DebugUI.DebugUI.setEnvHistory?4(envStr, clearHistories=False) +eric6.Debugger.DebugUI.DebugUI.setEnvHistory?4(envStr, clearHistories=False, history=None) eric6.Debugger.DebugUI.DebugUI.setExcIgnoreList?4(excIgnoreList) eric6.Debugger.DebugUI.DebugUI.setExcList?4(excList) eric6.Debugger.DebugUI.DebugUI.setExceptionReporting?4(exceptions) eric6.Debugger.DebugUI.DebugUI.setTracePython?4(tracePython) -eric6.Debugger.DebugUI.DebugUI.setWdHistory?4(wdStr, clearHistories=False) +eric6.Debugger.DebugUI.DebugUI.setWdHistory?4(wdStr, clearHistories=False, history=None) eric6.Debugger.DebugUI.DebugUI.shutdown?4() eric6.Debugger.DebugUI.DebugUI.shutdownServer?4() eric6.Debugger.DebugUI.DebugUI.variablesFilter?4(scope) @@ -674,11 +674,14 @@ eric6.Debugger.ExceptionsFilterDialog.ExceptionsFilterDialog.on_exceptionEdit_textChanged?4(txt) eric6.Debugger.ExceptionsFilterDialog.ExceptionsFilterDialog.on_exceptionList_itemSelectionChanged?4() eric6.Debugger.ExceptionsFilterDialog.ExceptionsFilterDialog?1(excList, ignore, parent=None) +eric6.Debugger.StartDialog.StartDialog.clearHistories?4() eric6.Debugger.StartDialog.StartDialog.getCoverageData?4() eric6.Debugger.StartDialog.StartDialog.getData?4() eric6.Debugger.StartDialog.StartDialog.getDebugData?4() +eric6.Debugger.StartDialog.StartDialog.getHistories?4() eric6.Debugger.StartDialog.StartDialog.getProfilingData?4() eric6.Debugger.StartDialog.StartDialog.getRunData?4() +eric6.Debugger.StartDialog.StartDialog.historiesModified?4() eric6.Debugger.StartDialog.StartDialog.on_buttonBox_clicked?4(button) eric6.Debugger.StartDialog.StartDialog.on_modFuncCombo_editTextChanged?4() eric6.Debugger.StartDialog.StartDialog?1(caption, argvList, wdList, envList, exceptions, parent=None, type=0, modfuncList=None, tracePython=False, autoClearShell=True, autoContinue=True, autoFork=False, forkChild=False)
--- a/Debugger/DebugUI.py Sun Dec 11 18:43:05 2016 +0100 +++ b/Debugger/DebugUI.py Mon Dec 12 18:56:42 2016 +0100 @@ -650,7 +650,6 @@ return [starttb, debugtb] - # TODO: accept history list def setArgvHistory(self, argsStr, clearHistories=False, history=None): """ Public slot to initialize the argv history. @@ -661,13 +660,14 @@ @param history list of history entries to be set (list of strings) """ if clearHistories: - self.argvHistory = [] + del self.argvHistory[1:] + elif history is not None: + self.argvHistory = history[:] else: if argsStr in self.argvHistory: self.argvHistory.remove(argsStr) - self.argvHistory.insert(0, argsStr) + self.argvHistory.insert(0, argsStr) - # TODO: accept history list def setWdHistory(self, wdStr, clearHistories=False, history=None): """ Public slot to initialize the wd history. @@ -678,13 +678,14 @@ @param history list of history entries to be set (list of strings) """ if clearHistories: - self.wdHistory = [] + del self.wdHistory[1:] + elif history is not None: + self.wdHistory = history[:] else: if wdStr in self.wdHistory: self.wdHistory.remove(wdStr) - self.wdHistory.insert(0, wdStr) + self.wdHistory.insert(0, wdStr) - # TODO: accept history list def setEnvHistory(self, envStr, clearHistories=False, history=None): """ Public slot to initialize the env history. @@ -695,11 +696,13 @@ @param history list of history entries to be set (list of strings) """ if clearHistories: - self.envHistory = [] + del self.envHistory[1:] + elif history is not None: + self.envHistory = history[:] else: if envStr in self.envHistory: self.envHistory.remove(envStr) - self.envHistory.insert(0, envStr) + self.envHistory.insert(0, envStr) def setExceptionReporting(self, exceptions): """ @@ -1520,9 +1523,7 @@ self.envHistory, self.exceptions, self.ui, 2, autoClearShell=self.autoClearShell) if dlg.exec_() == QDialog.Accepted: - # TODO: get the complete histories - argv, wd, env, exceptions, clearShell, clearHistories, console = \ - dlg.getData() + argv, wd, env, exceptions, clearShell, console = dlg.getData() eraseCoverage = dlg.getCoverageData() if runProject: @@ -1568,10 +1569,9 @@ # This moves any previous occurrence of these arguments to the head # of the list. - # TODO: modify histories as retrieved - self.setArgvHistory(argv, clearHistories) - self.setWdHistory(wd, clearHistories) - self.setEnvHistory(env, clearHistories) + self.setArgvHistory(argv) + self.setWdHistory(wd) + self.setEnvHistory(env) # Save the exception flags self.exceptions = exceptions @@ -1604,7 +1604,17 @@ clientType=self.clientType) self.stopAct.setEnabled(True) - + + if dlg.clearHistories(): + self.setArgvHistory("", clearHistories=True) + self.setWdHistory("", clearHistories=True) + self.setEnvHistory("", clearHistories=True) + elif dlg.historiesModified(): + argvHistory, wdHistory, envHistory = dlg.getHistories() + self.setArgvHistory("", history=argvHistory) + self.setWdHistory("", history=wdHistory) + self.setEnvHistory("", history=envHistory) + def __profileScript(self): """ Private slot to handle the profile script action. @@ -1641,9 +1651,7 @@ self.exceptions, self.ui, 3, autoClearShell=self.autoClearShell) if dlg.exec_() == QDialog.Accepted: - # TODO: get the complete histories - argv, wd, env, exceptions, clearShell, clearHistories, console = \ - dlg.getData() + argv, wd, env, exceptions, clearShell, console = dlg.getData() eraseTimings = dlg.getProfilingData() if runProject: @@ -1689,10 +1697,9 @@ # This moves any previous occurrence of these arguments to the head # of the list. - # TODO: modify histories as retrieved - self.setArgvHistory(argv, clearHistories) - self.setWdHistory(wd, clearHistories) - self.setEnvHistory(env, clearHistories) + self.setArgvHistory(argv) + self.setWdHistory(wd) + self.setEnvHistory(env) # Save the exception flags self.exceptions = exceptions @@ -1725,7 +1732,17 @@ clientType=self.clientType) self.stopAct.setEnabled(True) - + + if dlg.clearHistories(): + self.setArgvHistory("", clearHistories=True) + self.setWdHistory("", clearHistories=True) + self.setEnvHistory("", clearHistories=True) + elif dlg.historiesModified(): + argvHistory, wdHistory, envHistory = dlg.getHistories() + self.setArgvHistory("", history=argvHistory) + self.setWdHistory("", history=wdHistory) + self.setEnvHistory("", history=envHistory) + def __runScript(self): """ Private slot to handle the run script action. @@ -1764,9 +1781,7 @@ autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) if dlg.exec_() == QDialog.Accepted: - # TODO: get the complete histories - argv, wd, env, exceptions, clearShell, clearHistories, console = \ - dlg.getData() + argv, wd, env, exceptions, clearShell, console = dlg.getData() forkAutomatically, forkIntoChild = dlg.getRunData() if runProject: @@ -1812,10 +1827,9 @@ # This moves any previous occurrence of these arguments to the head # of the list. - # TODO: modify histories as retrieved - self.setArgvHistory(argv, clearHistories) - self.setWdHistory(wd, clearHistories) - self.setEnvHistory(env, clearHistories) + self.setArgvHistory(argv) + self.setWdHistory(wd) + self.setEnvHistory(env) # Save the exception flags self.exceptions = exceptions @@ -1850,6 +1864,16 @@ self.stopAct.setEnabled(True) + if dlg.clearHistories(): + self.setArgvHistory("", clearHistories=True) + self.setWdHistory("", clearHistories=True) + self.setEnvHistory("", clearHistories=True) + elif dlg.historiesModified(): + argvHistory, wdHistory, envHistory = dlg.getHistories() + self.setArgvHistory("", history=argvHistory) + self.setWdHistory("", history=wdHistory) + self.setEnvHistory("", history=envHistory) + def __debugScript(self): """ Private slot to handle the debug script action. @@ -1887,9 +1911,7 @@ autoClearShell=self.autoClearShell, autoContinue=self.autoContinue, autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) if dlg.exec_() == QDialog.Accepted: - # TODO: get the complete histories - argv, wd, env, exceptions, clearShell, clearHistories, console = \ - dlg.getData() + argv, wd, env, exceptions, clearShell, console = dlg.getData() tracePython, autoContinue, forkAutomatically, forkIntoChild = \ dlg.getDebugData() @@ -1937,10 +1959,9 @@ # This moves any previous occurrence of these arguments to the head # of the list. - # TODO: modify histories as retrieved - self.setArgvHistory(argv, clearHistories) - self.setWdHistory(wd, clearHistories) - self.setEnvHistory(env, clearHistories) + self.setArgvHistory(argv) + self.setWdHistory(wd) + self.setEnvHistory(env) # Save the exception flags self.exceptions = exceptions @@ -1993,6 +2014,16 @@ self.stopAct.setEnabled(True) + if dlg.clearHistories(): + self.setArgvHistory("", clearHistories=True) + self.setWdHistory("", clearHistories=True) + self.setEnvHistory("", clearHistories=True) + elif dlg.historiesModified(): + argvHistory, wdHistory, envHistory = dlg.getHistories() + self.setArgvHistory("", history=argvHistory) + self.setWdHistory("", history=wdHistory) + self.setEnvHistory("", history=envHistory) + def __doRestart(self): """ Private slot to handle the restart action to restart the last
--- a/Debugger/StartDialog.py Sun Dec 11 18:43:05 2016 +0100 +++ b/Debugger/StartDialog.py Mon Dec 12 18:56:42 2016 +0100 @@ -136,10 +136,8 @@ @return a tuple of argv (string), workdir (string), environment (string), exceptions flag (boolean), clear interpreter flag - (boolean), clear histories flag (boolean) and run in console - flag (boolean) + (boolean) and run in console flag (boolean) """ - # TODO: add the complete histories cmdLine = self.ui.cmdlineCombo.currentText() workdir = self.ui.workdirPicker.currentText() environment = self.ui.environmentCombo.currentText() @@ -149,7 +147,6 @@ environment, self.ui.exceptionCheckBox.isChecked(), self.ui.clearShellCheckBox.isChecked(), - self.__clearHistoryLists, self.ui.consoleCheckBox.isChecked()) def getDebugData(self): @@ -210,6 +207,7 @@ clear the lists. """ self.__clearHistoryLists = True + self.__historiesModified = False # clear catches it all cmdLine = self.ui.cmdlineCombo.currentText() workdir = self.ui.workdirPicker.currentText() @@ -266,7 +264,41 @@ combo.addItems(history) self.__historiesModified = True + + def historiesModified(self): + """ + Public method to test for modified histories. + @return flag indicating modified histories + @rtype bool + """ + return self.__historiesModified + + def clearHistories(self): + """ + Public method to test, if histories shall be cleared. + + @return flag indicating histories shall be cleared + @rtype bool + """ + return self.__clearHistoryLists + + def getHistories(self): + """ + Public method to get the lists of histories. + + @return tuple containing the histories of command line arguments, + working directories and environment settings + @rtype tuple of three list of str + """ + return ( + [self.ui.cmdlineCombo.itemText(index) for index in range( + self.ui.cmdlineCombo.count())], + self.ui.workdirPicker.getPathItems(), + [self.ui.environmentCombo.itemText(index) for index in range( + self.ui.environmentCombo.count())], + ) + def on_buttonBox_clicked(self, button): """ Private slot called by a button of the button box clicked.
--- a/Documentation/Help/source.qhp Sun Dec 11 18:43:05 2016 +0100 +++ b/Documentation/Help/source.qhp Mon Dec 12 18:56:42 2016 +0100 @@ -12664,11 +12664,14 @@ <keyword name="StartDialog (Module)" id="StartDialog (Module)" ref="eric6.Debugger.StartDialog.html" /> <keyword name="StartDialog.__clearHistories" id="StartDialog.__clearHistories" ref="eric6.Debugger.StartDialog.html#StartDialog.__clearHistories" /> <keyword name="StartDialog.__editHistory" id="StartDialog.__editHistory" ref="eric6.Debugger.StartDialog.html#StartDialog.__editHistory" /> + <keyword name="StartDialog.clearHistories" id="StartDialog.clearHistories" ref="eric6.Debugger.StartDialog.html#StartDialog.clearHistories" /> <keyword name="StartDialog.getCoverageData" id="StartDialog.getCoverageData" ref="eric6.Debugger.StartDialog.html#StartDialog.getCoverageData" /> <keyword name="StartDialog.getData" id="StartDialog.getData" ref="eric6.Debugger.StartDialog.html#StartDialog.getData" /> <keyword name="StartDialog.getDebugData" id="StartDialog.getDebugData" ref="eric6.Debugger.StartDialog.html#StartDialog.getDebugData" /> + <keyword name="StartDialog.getHistories" id="StartDialog.getHistories" ref="eric6.Debugger.StartDialog.html#StartDialog.getHistories" /> <keyword name="StartDialog.getProfilingData" id="StartDialog.getProfilingData" ref="eric6.Debugger.StartDialog.html#StartDialog.getProfilingData" /> <keyword name="StartDialog.getRunData" id="StartDialog.getRunData" ref="eric6.Debugger.StartDialog.html#StartDialog.getRunData" /> + <keyword name="StartDialog.historiesModified" id="StartDialog.historiesModified" ref="eric6.Debugger.StartDialog.html#StartDialog.historiesModified" /> <keyword name="StartDialog.on_buttonBox_clicked" id="StartDialog.on_buttonBox_clicked" ref="eric6.Debugger.StartDialog.html#StartDialog.on_buttonBox_clicked" /> <keyword name="StartDialog.on_modFuncCombo_editTextChanged" id="StartDialog.on_modFuncCombo_editTextChanged" ref="eric6.Debugger.StartDialog.html#StartDialog.on_modFuncCombo_editTextChanged" /> <keyword name="StartHistoryEditDialog" id="StartHistoryEditDialog" ref="eric6.Debugger.StartHistoryEditDialog.html#StartHistoryEditDialog" />
--- a/Documentation/Source/eric6.Debugger.DebugUI.html Sun Dec 11 18:43:05 2016 +0100 +++ b/Documentation/Source/eric6.Debugger.DebugUI.html Mon Dec 12 18:56:42 2016 +0100 @@ -817,7 +817,7 @@ </dd> </dl><a NAME="DebugUI.setArgvHistory" ID="DebugUI.setArgvHistory"></a> <h4>DebugUI.setArgvHistory</h4> -<b>setArgvHistory</b>(<i>argsStr, clearHistories=False</i>) +<b>setArgvHistory</b>(<i>argsStr, clearHistories=False, history=None</i>) <p> Public slot to initialize the argv history. </p><dl> @@ -828,6 +828,9 @@ <dd> flag indicating, that the list should be cleared (boolean) +</dd><dt><i>history</i></dt> +<dd> +list of history entries to be set (list of strings) </dd> </dl><a NAME="DebugUI.setAutoClearShell" ID="DebugUI.setAutoClearShell"></a> <h4>DebugUI.setAutoClearShell</h4> @@ -853,7 +856,7 @@ </dd> </dl><a NAME="DebugUI.setEnvHistory" ID="DebugUI.setEnvHistory"></a> <h4>DebugUI.setEnvHistory</h4> -<b>setEnvHistory</b>(<i>envStr, clearHistories=False</i>) +<b>setEnvHistory</b>(<i>envStr, clearHistories=False, history=None</i>) <p> Public slot to initialize the env history. </p><dl> @@ -864,6 +867,9 @@ <dd> flag indicating, that the list should be cleared (boolean) +</dd><dt><i>history</i></dt> +<dd> +list of history entries to be set (list of strings) </dd> </dl><a NAME="DebugUI.setExcIgnoreList" ID="DebugUI.setExcIgnoreList"></a> <h4>DebugUI.setExcIgnoreList</h4> @@ -908,7 +914,7 @@ </dd> </dl><a NAME="DebugUI.setWdHistory" ID="DebugUI.setWdHistory"></a> <h4>DebugUI.setWdHistory</h4> -<b>setWdHistory</b>(<i>wdStr, clearHistories=False</i>) +<b>setWdHistory</b>(<i>wdStr, clearHistories=False, history=None</i>) <p> Public slot to initialize the wd history. </p><dl> @@ -919,6 +925,9 @@ <dd> flag indicating, that the list should be cleared (boolean) +</dd><dt><i>history</i></dt> +<dd> +list of history entries to be set (list of strings) </dd> </dl><a NAME="DebugUI.shutdown" ID="DebugUI.shutdown"></a> <h4>DebugUI.shutdown</h4>
--- a/Documentation/Source/eric6.Debugger.StartDialog.html Sun Dec 11 18:43:05 2016 +0100 +++ b/Documentation/Source/eric6.Debugger.StartDialog.html Mon Dec 12 18:56:42 2016 +0100 @@ -71,6 +71,9 @@ <td><a href="#StartDialog.__editHistory">__editHistory</a></td> <td>Private slot to edit a history list.</td> </tr><tr> +<td><a href="#StartDialog.clearHistories">clearHistories</a></td> +<td>Public method to test, if histories shall be cleared.</td> +</tr><tr> <td><a href="#StartDialog.getCoverageData">getCoverageData</a></td> <td>Public method to retrieve the coverage related data entered into this dialog.</td> </tr><tr> @@ -80,12 +83,18 @@ <td><a href="#StartDialog.getDebugData">getDebugData</a></td> <td>Public method to retrieve the debug related data entered into this dialog.</td> </tr><tr> +<td><a href="#StartDialog.getHistories">getHistories</a></td> +<td>Public method to get the lists of histories.</td> +</tr><tr> <td><a href="#StartDialog.getProfilingData">getProfilingData</a></td> <td>Public method to retrieve the profiling related data entered into this dialog.</td> </tr><tr> <td><a href="#StartDialog.getRunData">getRunData</a></td> <td>Public method to retrieve the debug related data entered into this dialog.</td> </tr><tr> +<td><a href="#StartDialog.historiesModified">historiesModified</a></td> +<td>Public method to test for modified histories.</td> +</tr><tr> <td><a href="#StartDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> <td>Private slot called by a button of the button box clicked.</td> </tr><tr> @@ -165,7 +174,22 @@ <b>__editHistory</b>(<i></i>) <p> Private slot to edit a history list. -</p><a NAME="StartDialog.getCoverageData" ID="StartDialog.getCoverageData"></a> +</p><a NAME="StartDialog.clearHistories" ID="StartDialog.clearHistories"></a> +<h4>StartDialog.clearHistories</h4> +<b>clearHistories</b>(<i></i>) +<p> + Public method to test, if histories shall be cleared. +</p><dl> +<dt>Returns:</dt> +<dd> +flag indicating histories shall be cleared +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="StartDialog.getCoverageData" ID="StartDialog.getCoverageData"></a> <h4>StartDialog.getCoverageData</h4> <b>getCoverageData</b>(<i></i>) <p> @@ -186,8 +210,7 @@ <dd> a tuple of argv (string), workdir (string), environment (string), exceptions flag (boolean), clear interpreter flag - (boolean), clear histories flag (boolean) and run in console - flag (boolean) + (boolean) and run in console flag (boolean) </dd> </dl><a NAME="StartDialog.getDebugData" ID="StartDialog.getDebugData"></a> <h4>StartDialog.getDebugData</h4> @@ -205,6 +228,22 @@ indicating, that the debugger should debug the child process after forking automatically (boolean) </dd> +</dl><a NAME="StartDialog.getHistories" ID="StartDialog.getHistories"></a> +<h4>StartDialog.getHistories</h4> +<b>getHistories</b>(<i></i>) +<p> + Public method to get the lists of histories. +</p><dl> +<dt>Returns:</dt> +<dd> +tuple containing the histories of command line arguments, + working directories and environment settings +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +tuple of three list of str +</dd> </dl><a NAME="StartDialog.getProfilingData" ID="StartDialog.getProfilingData"></a> <h4>StartDialog.getProfilingData</h4> <b>getProfilingData</b>(<i></i>) @@ -230,6 +269,21 @@ should debug the child process after forking automatically (boolean) </dd> +</dl><a NAME="StartDialog.historiesModified" ID="StartDialog.historiesModified"></a> +<h4>StartDialog.historiesModified</h4> +<b>historiesModified</b>(<i></i>) +<p> + Public method to test for modified histories. +</p><dl> +<dt>Returns:</dt> +<dd> +flag indicating modified histories +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> </dl><a NAME="StartDialog.on_buttonBox_clicked" ID="StartDialog.on_buttonBox_clicked"></a> <h4>StartDialog.on_buttonBox_clicked</h4> <b>on_buttonBox_clicked</b>(<i>button</i>)