aboutsummaryrefslogtreecommitdiff
path: root/src/avp/gui/mainwindow.py
diff options
context:
space:
mode:
authorBrianna Rainey2026-01-29 14:50:29 -0500
committerGitHub2026-01-29 14:50:29 -0500
commit71a22c6a121d1294a05ef35020c525fa70cae2fd (patch)
tree025dd2329c214a5fe5ac78c7f2e8342e2bfde14d /src/avp/gui/mainwindow.py
parentf66eb99465c61232a7f649e66bee59504bb0e52c (diff)
v2.2.2 - fix flaky tests, fix UnboundLocalError in MainWindow.createNewProject (#94)
* search more than one filename for compName * remove extra QVBoxLayout * insert default components using name instead of index * bump version 2.2.1 to 2.2.2 * tests do not use `.config` for settings Core.storeSettings() is no longer called as a side effect any time avp.core is imported. Thus the tests use a new `initCore` method and the normal user path now relies on entering via `cli.py`. This means certain toolkit functions (e.g., ones using `FFMPEG_BIN`) no longer work if imported from a different python script, unless they call Core.storeSettings() themselves to initialize the settings.ini file * fix UnboundLocalError in createNewProject
Diffstat (limited to 'src/avp/gui/mainwindow.py')
-rw-r--r--src/avp/gui/mainwindow.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/avp/gui/mainwindow.py b/src/avp/gui/mainwindow.py
index 5a051fd..3221783 100644
--- a/src/avp/gui/mainwindow.py
+++ b/src/avp/gui/mainwindow.py
@@ -414,8 +414,10 @@ class MainWindow(QtWidgets.QMainWindow):
# Add initial components if none are in the list
if not self.core.selectedComponents:
- self.core.insertComponent(0, 0, self)
- self.core.insertComponent(1, 1, self)
+ self.core.insertComponent(
+ 0, self.core.moduleIndexFor("Classic Visualizer"), self
+ )
+ self.core.insertComponent(1, self.core.moduleIndexFor("Color"), self)
# set colors to white and black to match classic appearance of program
self.core.selectedComponents[0].page.lineEdit_visColor.setText(
"255,255,255"
@@ -900,8 +902,8 @@ class MainWindow(QtWidgets.QMainWindow):
def createNewProject(self, prompt=True):
if prompt:
ch = self.openSaveChangesDialog("starting a new project")
- if ch is None:
- return
+ if ch is None:
+ return
self.clear()
self.currentProject = None