diff options
| author | Brianna Rainey | 2026-01-29 14:50:29 -0500 |
|---|---|---|
| committer | GitHub | 2026-01-29 14:50:29 -0500 |
| commit | 71a22c6a121d1294a05ef35020c525fa70cae2fd (patch) | |
| tree | 025dd2329c214a5fe5ac78c7f2e8342e2bfde14d /src | |
| parent | f66eb99465c61232a7f649e66bee59504bb0e52c (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')
| -rw-r--r-- | src/avp/__init__.py | 2 | ||||
| -rw-r--r-- | src/avp/cli.py | 5 | ||||
| -rw-r--r-- | src/avp/command.py | 1 | ||||
| -rw-r--r-- | src/avp/components/spectrum.ui | 1686 | ||||
| -rw-r--r-- | src/avp/core.py | 14 | ||||
| -rw-r--r-- | src/avp/gui/mainwindow.py | 10 |
6 files changed, 857 insertions, 861 deletions
diff --git a/src/avp/__init__.py b/src/avp/__init__.py index a88bf10..9de9f93 100644 --- a/src/avp/__init__.py +++ b/src/avp/__init__.py @@ -3,7 +3,7 @@ import os import logging -__version__ = "2.2.1" +__version__ = "2.2.2" class Logger(logging.getLoggerClass()): diff --git a/src/avp/cli.py b/src/avp/cli.py index 02ceee6..0176f76 100644 --- a/src/avp/cli.py +++ b/src/avp/cli.py @@ -5,6 +5,11 @@ import re import string +from .core import Core + +# Core class must store settings as class variables +# before we can use many things in AVP +Core.storeSettings() log = logging.getLogger("AVP.Main") diff --git a/src/avp/command.py b/src/avp/command.py index 7a77848..870391b 100644 --- a/src/avp/command.py +++ b/src/avp/command.py @@ -256,7 +256,6 @@ class Command(QtCore.QObject): for i, compFileName in enumerate(compFileNames): if name.lower() in compFileName: return self.core.compNames[i] - return return None diff --git a/src/avp/components/spectrum.ui b/src/avp/components/spectrum.ui index c6a8a15..3bde075 100644 --- a/src/avp/components/spectrum.ui +++ b/src/avp/components/spectrum.ui @@ -27,909 +27,899 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="leftMargin"> - <number>4</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"/> + <widget class="QLabel" name="label_4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Type</string> + </property> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Type</string> - </property> - </widget> - </item> + <widget class="QComboBox" name="comboBox_filterType"> <item> - <widget class="QComboBox" name="comboBox_filterType"> - <item> - <property name="text"> - <string>Spectrum</string> - </property> - </item> - <item> - <property name="text"> - <string>Histogram</string> - </property> - </item> - <item> - <property name="text"> - <string>Vector Scope</string> - </property> - </item> - <item> - <property name="text"> - <string>Musical Scale</string> - </property> - </item> - <item> - <property name="text"> - <string>Phase</string> - </property> - </item> - </widget> + <property name="text"> + <string>Spectrum</string> + </property> </item> <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>5</width> - <height>20</height> - </size> - </property> - </spacer> + <property name="text"> + <string>Histogram</string> + </property> </item> <item> - <widget class="QLabel" name="label_xTitleAlign"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>X</string> - </property> - </widget> + <property name="text"> + <string>Vector Scope</string> + </property> </item> <item> - <widget class="QSpinBox" name="spinBox_x"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>80</width> - <height>16777215</height> - </size> - </property> - <property name="minimum"> - <number>-10000</number> - </property> - <property name="maximum"> - <number>10000</number> - </property> - </widget> + <property name="text"> + <string>Musical Scale</string> + </property> </item> <item> - <widget class="QLabel" name="label_yTitleAlign"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Y</string> - </property> - </widget> + <property name="text"> + <string>Phase</string> + </property> </item> - <item> - <widget class="QSpinBox" name="spinBox_y"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>80</width> - <height>16777215</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="minimum"> - <number>-10000</number> - </property> - <property name="maximum"> - <number>10000</number> - </property> - <property name="value"> - <number>0</number> - </property> - </widget> - </item> - </layout> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QCheckBox" name="checkBox_compress"> - <property name="text"> - <string>Compress</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_mono"> - <property name="text"> - <string>Mono</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_mirror"> - <property name="text"> - <string>Mirror</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_11"> - <property name="text"> - <string>Hue</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_hue"> - <property name="suffix"> - <string>° </string> - </property> - <property name="maximum"> - <number>359</number> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Scale</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_scale"> - <property name="buttonSymbols"> - <enum>QAbstractSpinBox::UpDownArrows</enum> - </property> - <property name="suffix"> - <string>%</string> - </property> - <property name="minimum"> - <number>10</number> - </property> - <property name="maximum"> - <number>400</number> - </property> - <property name="value"> - <number>100</number> - </property> - </widget> - </item> - </layout> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>5</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item> - <widget class="QStackedWidget" name="stackedWidget"> + <widget class="QLabel" name="label_xTitleAlign"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="autoFillBackground"> - <bool>false</bool> + <property name="text"> + <string>X</string> </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_x"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>80</width> + <height>16777215</height> + </size> + </property> + <property name="minimum"> + <number>-10000</number> + </property> + <property name="maximum"> + <number>10000</number> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_yTitleAlign"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> + <property name="text"> + <string>Y</string> </property> - <property name="currentIndex"> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_y"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>80</width> + <height>16777215</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="minimum"> + <number>-10000</number> + </property> + <property name="maximum"> + <number>10000</number> + </property> + <property name="value"> <number>0</number> </property> - <widget class="QWidget" name="page"> - <widget class="QWidget" name="verticalLayoutWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>561</width> - <height>66</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="QCheckBox" name="checkBox_compress"> + <property name="text"> + <string>Compress</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_mono"> + <property name="text"> + <string>Mono</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_mirror"> + <property name="text"> + <string>Mirror</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_11"> + <property name="text"> + <string>Hue</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_hue"> + <property name="suffix"> + <string>° </string> + </property> + <property name="maximum"> + <number>359</number> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Scale</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_scale"> + <property name="buttonSymbols"> + <enum>QAbstractSpinBox::ButtonSymbols::UpDownArrows</enum> + </property> + <property name="suffix"> + <string>%</string> + </property> + <property name="minimum"> + <number>10</number> + </property> + <property name="maximum"> + <number>400</number> + </property> + <property name="value"> + <number>100</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>QFrame::Shape::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Shadow::Plain</enum> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="page"> + <widget class="QWidget" name="verticalLayoutWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>561</width> + <height>76</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="sizeConstraint"> + <enum>QLayout::SizeConstraint::SetMaximumSize</enum> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> <property name="sizeConstraint"> - <enum>QLayout::SetMaximumSize</enum> - </property> - <property name="rightMargin"> - <number>0</number> + <enum>QLayout::SizeConstraint::SetDefaultConstraint</enum> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QLabel" name="label_textColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>31</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Window</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_window"> - <item> - <property name="text"> - <string>hann</string> - </property> - </item> - <item> - <property name="text"> - <string>gauss</string> - </property> - </item> - <item> - <property name="text"> - <string>tukey</string> - </property> - </item> - <item> - <property name="text"> - <string>dolph</string> - </property> - </item> - <item> - <property name="text"> - <string>cauchy</string> - </property> - </item> - <item> - <property name="text"> - <string>parzen</string> - </property> - </item> - <item> - <property name="text"> - <string>poisson</string> - </property> - </item> - <item> - <property name="text"> - <string>rect</string> - </property> - </item> - <item> - <property name="text"> - <string>bartlett</string> - </property> - </item> - <item> - <property name="text"> - <string>hanning</string> - </property> - </item> - <item> - <property name="text"> - <string>hamming</string> - </property> - </item> - <item> - <property name="text"> - <string>blackman</string> - </property> - </item> - <item> - <property name="text"> - <string>welch</string> - </property> - </item> - <item> - <property name="text"> - <string>flattop</string> - </property> - </item> - <item> - <property name="text"> - <string>bharris</string> - </property> - </item> - <item> - <property name="text"> - <string>bnuttall</string> - </property> - </item> - <item> - <property name="text"> - <string>lanczos</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Amplitude</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_amplitude0"> - <item> - <property name="text"> - <string>Square root</string> - </property> - </item> - <item> - <property name="text"> - <string>Cubic root</string> - </property> - </item> - <item> - <property name="text"> - <string>4thrt</string> - </property> - </item> - <item> - <property name="text"> - <string>5thrt</string> - </property> - </item> - <item> - <property name="text"> - <string>Linear</string> - </property> - </item> - <item> - <property name="text"> - <string>Logarithmic</string> - </property> - </item> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QLabel" name="label_textColor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>31</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Window</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Color </string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_color"> - <item> - <property name="text"> - <string>Channel</string> - </property> - </item> - <item> - <property name="text"> - <string>Intensity</string> - </property> - </item> - <item> - <property name="text"> - <string>Rainbow</string> - </property> - </item> - <item> - <property name="text"> - <string>Moreland</string> - </property> - </item> - <item> - <property name="text"> - <string>Nebulae</string> - </property> - </item> - <item> - <property name="text"> - <string>Fire</string> - </property> - </item> - <item> - <property name="text"> - <string>Fiery</string> - </property> - </item> - <item> - <property name="text"> - <string>Fruit</string> - </property> - </item> - <item> - <property name="text"> - <string>Cool</string> - </property> - </item> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QComboBox" name="comboBox_window"> + <item> + <property name="text"> + <string>hann</string> + </property> + </item> + <item> + <property name="text"> + <string>gauss</string> + </property> + </item> + <item> + <property name="text"> + <string>tukey</string> + </property> + </item> + <item> + <property name="text"> + <string>dolph</string> + </property> + </item> + <item> + <property name="text"> + <string>cauchy</string> + </property> + </item> + <item> + <property name="text"> + <string>parzen</string> + </property> + </item> + <item> + <property name="text"> + <string>poisson</string> + </property> + </item> + <item> + <property name="text"> + <string>rect</string> + </property> + </item> + <item> + <property name="text"> + <string>bartlett</string> + </property> + </item> + <item> + <property name="text"> + <string>hanning</string> + </property> + </item> + <item> + <property name="text"> + <string>hamming</string> + </property> + </item> + <item> + <property name="text"> + <string>blackman</string> + </property> + </item> + <item> + <property name="text"> + <string>welch</string> + </property> + </item> + <item> + <property name="text"> + <string>flattop</string> + </property> + </item> + <item> + <property name="text"> + <string>bharris</string> + </property> + </item> + <item> + <property name="text"> + <string>bnuttall</string> + </property> + </item> + <item> + <property name="text"> + <string>lanczos</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Amplitude</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_amplitude0"> + <item> + <property name="text"> + <string>Square root</string> + </property> + </item> + <item> + <property name="text"> + <string>Cubic root</string> + </property> + </item> + <item> + <property name="text"> + <string>4thrt</string> + </property> + </item> + <item> + <property name="text"> + <string>5thrt</string> + </property> + </item> + <item> + <property name="text"> + <string>Linear</string> + </property> + </item> + <item> + <property name="text"> + <string>Logarithmic</string> + </property> + </item> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> - </widget> - </widget> - <widget class="QWidget" name="page_2"> - <widget class="QWidget" name="verticalLayoutWidget_2"> - <property name="geometry"> - <rect> - <x>-1</x> - <y>-1</y> - <width>561</width> - <height>31</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Display Scale</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_display"> - <item> - <property name="text"> - <string>Logarithmic</string> - </property> - </item> - <item> - <property name="text"> - <string>Square root</string> - </property> - </item> - <item> - <property name="text"> - <string>Cubic root</string> - </property> - </item> - <item> - <property name="text"> - <string>Linear</string> - </property> - </item> - <item> - <property name="text"> - <string>Reverse Log</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="QLabel" name="label_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Amplitude</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_amplitude1"> - <item> - <property name="text"> - <string>Logarithmic</string> - </property> - </item> - <item> - <property name="text"> - <string>Linear</string> - </property> - </item> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QLabel" name="label_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Color </string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_color"> + <item> + <property name="text"> + <string>Channel</string> + </property> + </item> + <item> + <property name="text"> + <string>Intensity</string> + </property> + </item> + <item> + <property name="text"> + <string>Rainbow</string> + </property> + </item> + <item> + <property name="text"> + <string>Moreland</string> + </property> + </item> + <item> + <property name="text"> + <string>Nebulae</string> + </property> + </item> + <item> + <property name="text"> + <string>Fire</string> + </property> + </item> + <item> + <property name="text"> + <string>Fiery</string> + </property> + </item> + <item> + <property name="text"> + <string>Fruit</string> + </property> + </item> + <item> + <property name="text"> + <string>Cool</string> + </property> + </item> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> - </widget> - </widget> - <widget class="QWidget" name="page_3"> - <widget class="QWidget" name="verticalLayoutWidget_3"> - <property name="geometry"> - <rect> - <x>-1</x> - <y>-1</y> - <width>585</width> - <height>64</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> + </item> + </layout> + </widget> + </widget> + <widget class="QWidget" name="page_2"> + <widget class="QWidget" name="verticalLayoutWidget_2"> + <property name="geometry"> + <rect> + <x>-1</x> + <y>-1</y> + <width>561</width> + <height>36</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_9"> - <property name="text"> - <string>Mode</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_mode"> - <item> - <property name="text"> - <string>lissajous</string> - </property> - </item> - <item> - <property name="text"> - <string>lissajous_xy</string> - </property> - </item> - <item> - <property name="text"> - <string>polar</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="QLabel" name="label_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Amplitude</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox_amplitude2"> - <item> - <property name="text"> - <string>Linear</string> - </property> - </item> - <item> - <property name="text"> - <string>Square root</string> - </property> - </item> - <item> - <property name="text"> - <string>Cubic root</string> - </property> - </item> - <item> - <property name="text"> - <string>Logarithmic</string> - </property> - </item> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QLabel" name="label_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Display Scale</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QLabel" name="label_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Zoom</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_zoom"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>10</number> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_draw"> - <property name="text"> - <string>Line</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QComboBox" name="comboBox_display"> + <item> + <property name="text"> + <string>Logarithmic</string> + </property> + </item> + <item> + <property name="text"> + <string>Square root</string> + </property> + </item> + <item> + <property name="text"> + <string>Cubic root</string> + </property> + </item> + <item> + <property name="text"> + <string>Linear</string> + </property> + </item> + <item> + <property name="text"> + <string>Reverse Log</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QLabel" name="label_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Amplitude</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_amplitude1"> + <item> + <property name="text"> + <string>Logarithmic</string> + </property> + </item> + <item> + <property name="text"> + <string>Linear</string> + </property> + </item> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Minimum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + <widget class="QWidget" name="page_3"> + <widget class="QWidget" name="verticalLayoutWidget_3"> + <property name="geometry"> + <rect> + <x>-1</x> + <y>-1</y> + <width>585</width> + <height>76</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label_9"> + <property name="text"> + <string>Mode</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_mode"> + <item> + <property name="text"> + <string>lissajous</string> + </property> + </item> + <item> + <property name="text"> + <string>lissajous_xy</string> + </property> + </item> + <item> + <property name="text"> + <string>polar</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Amplitude</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_amplitude2"> + <item> + <property name="text"> + <string>Linear</string> + </property> + </item> + <item> + <property name="text"> + <string>Square root</string> + </property> + </item> + <item> + <property name="text"> + <string>Cubic root</string> + </property> + </item> + <item> + <property name="text"> + <string>Logarithmic</string> + </property> + </item> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> - </widget> - </widget> - <widget class="QWidget" name="page_4"> - <widget class="QWidget" name="verticalLayoutWidget_4"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>561</width> - <height>31</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QLabel" name="label_8"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Zoom</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_zoom"> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>10</number> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_draw"> + <property name="text"> + <string>Line</string> + </property> + </widget> + </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QLabel" name="label_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Timeclamp</string> - </property> - <property name="margin"> - <number>4</number> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="spinBox_tc"> - <property name="suffix"> - <string>s</string> - </property> - <property name="decimals"> - <number>3</number> - </property> - <property name="minimum"> - <double>0.002000000000000</double> - </property> - <property name="maximum"> - <double>1.000000000000000</double> - </property> - <property name="singleStep"> - <double>0.010000000000000</double> - </property> - <property name="value"> - <double>0.017000000000000</double> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> - </widget> - </widget> - <widget class="QWidget" name="page_5"> - <widget class="QWidget" name="verticalLayoutWidget_5"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>551</width> - <height>31</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> + </item> + </layout> + </widget> + </widget> + <widget class="QWidget" name="page_4"> + <widget class="QWidget" name="verticalLayoutWidget_4"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>561</width> + <height>36</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_11"/> + <widget class="QLabel" name="label_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Timeclamp</string> + </property> + <property name="margin"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QDoubleSpinBox" name="spinBox_tc"> + <property name="suffix"> + <string>s</string> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>0.002000000000000</double> + </property> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.010000000000000</double> + </property> + <property name="value"> + <double>0.017000000000000</double> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> - </widget> - </widget> + </item> + </layout> </widget> - </item> - </layout> + </widget> + <widget class="QWidget" name="page_5"> + <widget class="QWidget" name="verticalLayoutWidget_5"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>551</width> + <height>31</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"/> + </item> + </layout> + </widget> + </widget> + </widget> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <enum>QSizePolicy::Policy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> diff --git a/src/avp/core.py b/src/avp/core.py index 099b0b4..1e9a9c3 100644 --- a/src/avp/core.py +++ b/src/avp/core.py @@ -420,14 +420,18 @@ class Core: Core.canceled = False @classmethod - def storeSettings(cls): + def storeSettings(cls, dataDir=None): """Store settings/paths to directories as class variables""" from .__init__ import wd from .toolkit.ffmpeg import findFfmpeg cls.wd = wd - dataDir = QtCore.QStandardPaths.writableLocation( - QtCore.QStandardPaths.StandardLocation.AppConfigLocation + dataDir = ( + QtCore.QStandardPaths.writableLocation( + QtCore.QStandardPaths.StandardLocation.AppConfigLocation + ) + if dataDir is None + else dataDir ) # Windows: C:/Users/<USER>/AppData/Local/audio-visualizer # macOS: ~/Library/Preferences/audio-visualizer @@ -589,7 +593,3 @@ class Core: libLog.addHandler(libLogFile) # lowest level must be explicitly set on the root Logger libLog.setLevel(0) - - -# always store settings in class variables even if a Core object is not created -Core.storeSettings() 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 |
