eric7/Debugger/StartDialog.py

branch
eric7-maintenance
changeset 9111
4ac66b6c33a4
parent 8881
54e42bc2437a
child 9192
a763d57e23bc
--- a/eric7/Debugger/StartDialog.py	Mon May 02 15:53:05 2022 +0200
+++ b/eric7/Debugger/StartDialog.py	Wed Jun 01 13:48:49 2022 +0200
@@ -322,11 +322,11 @@
         histories = [
             "",
             self.tr("Script Name"),
-            self.tr("Command Line"),
+            self.tr("Script Parameters"),
             self.tr("Working Directory"),
             self.tr("Environment"),
         ]
-        combos = [
+        widgets = [
             None,
             self.ui.scriptnamePicker,
             self.ui.cmdlineCombo,
@@ -335,7 +335,7 @@
         ]
         if self.dialogType == 0:
             histories.append(self.tr("No Debug Programs"))
-            combos.append(self.ui.multiprocessNoDebugCombo)
+            widgets.append(self.ui.multiprocessNoDebugCombo)
         historyKind, ok = QInputDialog.getItem(
             self,
             self.tr("Edit History"),
@@ -345,22 +345,22 @@
         if ok and historyKind:
             history = []
             historiesIndex = histories.index(historyKind)
-            if historiesIndex == 1:
-                history = self.ui.scriptnamePicker.getPathItems()
-            elif historiesIndex == 3:
-                history = self.ui.workdirPicker.getPathItems()
+            if historiesIndex in (1, 3):
+                picker = widgets[historiesIndex]
+                history = picker.getPathItems()
             else:
-                combo = combos[historiesIndex]
+                combo = widgets[historiesIndex]
                 if combo:
-                    for index in range(combo.count()):
-                        history.append(combo.itemText(index))
+                    history = [
+                        combo.itemText(idx) for idx in range(combo.count())
+                    ]
             
             if history:
                 from .StartHistoryEditDialog import StartHistoryEditDialog
                 dlg = StartHistoryEditDialog(history, self)
             if dlg.exec() == QDialog.DialogCode.Accepted:
                 history = dlg.getHistory()
-                combo = combos[historiesIndex]
+                combo = widgets[historiesIndex]
                 if combo:
                     combo.clear()
                     combo.addItems(history)
@@ -403,7 +403,7 @@
             None
         )
         return (
-            self.ui.scriptnamePicker.getPathNames(),
+            self.ui.scriptnamePicker.getPathItems(),
             [self.ui.cmdlineCombo.itemText(index) for index in range(
                 self.ui.cmdlineCombo.count())],
             self.ui.workdirPicker.getPathItems(),

eric ide

mercurial