Skip to content

Commit

Permalink
Add variables tab
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Feb 18, 2024
1 parent aa1b104 commit 252f55c
Show file tree
Hide file tree
Showing 14 changed files with 514 additions and 153 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ target_sources(
lib/variables/variable-spinbox.hpp
lib/variables/variable-string.cpp
lib/variables/variable-string.hpp
lib/variables/variable-tab.cpp
lib/variables/variable-text-edit.cpp
lib/variables/variable-text-edit.hpp
lib/variables/variable.cpp
Expand Down
12 changes: 12 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ AdvSceneSwitcher.generalTab.transitionOverride="Set transition overrides"
AdvSceneSwitcher.generalTab.adjustActiveTransitionType="Change active transition type"
AdvSceneSwitcher.generalTab.transitionBehaviorSelectionError="At least one option must be enabled:\n\n - Use transition overrides\n\n - Change active transition type"

; Variables Tab
AdvSceneSwitcher.variableTab.title="Variables"
AdvSceneSwitcher.variableTab.help="Variables can be used in many places throughout the plugin.\n\nClick on the highlighted plus symbol to add a new variable."
AdvSceneSwitcher.variableTab.tooltip.variableAddButton="Add new variable"
AdvSceneSwitcher.variableTab.tooltip.variableRemoveButton="Remove selected variables"
AdvSceneSwitcher.variableTab.header.name="Name"
AdvSceneSwitcher.variableTab.header.value="Value"
AdvSceneSwitcher.variableTab.header.saveLoadBehavior="Save/Load behavior"
AdvSceneSwitcher.variableTab.header.lastUse="Last used"
AdvSceneSwitcher.variableTab.neverNused="Never"
AdvSceneSwitcher.variableTab.lastUsed="%1 seconds ago"

; Macro Tab
AdvSceneSwitcher.macroTab.title="Macro"
AdvSceneSwitcher.macroTab.macros="Macros"
Expand Down
98 changes: 98 additions & 0 deletions forms/advanced-scene-switcher.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,104 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="variableTab">
<attribute name="title">
<string>AdvSceneSwitcher.variableTab.title</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_33">
<item>
<layout class="QGridLayout" name="gridLayout_25">
<item row="0" column="0">
<widget class="QTableWidget" name="variables">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="variablesHelp">
<property name="text">
<string>AdvSceneSwitcher.variableTab.help</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_30">
<item>
<widget class="QPushButton" name="variableAdd">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>AdvSceneSwitcher.variableTab.tooltip.variableAddButton</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string notr="true">addIconSmall</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="variableRemove">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>AdvSceneSwitcher.variableTab.tooltip.variableRemoveButton</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string notr="true">removeIconSmall</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_211">
<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>
</item>
</layout>
</widget>
<widget class="QWidget" name="networkTab">
<attribute name="title">
<string>AdvSceneSwitcher.networkTab.title</string>
Expand Down
1 change: 1 addition & 0 deletions lib/advanced-scene-switcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void AdvSceneSwitcher::LoadUI()
SetupSceneGroupTab();
SetupTriggerTab();
SetupMacroTab();
SetupVariableTab();

SetDeprecationWarnings();
SetTabOrder();
Expand Down
10 changes: 10 additions & 0 deletions lib/advanced-scene-switcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ public slots:

/* --- End of macro tab section --- */

/* --- Begin of variable tab section --- */
public:
void SetupVariableTab();

public slots:
void on_variableAdd_clicked();
void on_variableRemove_clicked();

/* --- End of variable tab section --- */

/* --- Begin of legacy tab section --- */
public:
void ClearFrames(QListWidget *list);
Expand Down
Loading

0 comments on commit 252f55c

Please sign in to comment.