(Qt) Combine qt/options/generic.cpp and qt/options/nongeneric.cpp

This commit is contained in:
twinaphex 2021-03-10 09:39:14 +01:00 committed by Autechre
parent 3b59939dea
commit d940c10afe
10 changed files with 226 additions and 229 deletions

View File

@ -493,8 +493,7 @@ ifeq ($(HAVE_QT), 1)
ui/drivers/qt/qt_playlist.o \
ui/drivers/qt/qt_downloads.o
ifeq ($(HAVE_MENU), 1)
OBJ += ui/drivers/qt/options/nongeneric.o \
ui/drivers/qt/options/generic.o
OBJ += ui/drivers/qt/qt_options.o
endif
MOC_HEADERS += ui/drivers/ui_qt.h \
@ -510,7 +509,7 @@ ifeq ($(HAVE_QT), 1)
endif
ifeq ($(HAVE_MENU), 1)
MOC_HEADERS += ui/drivers/qt/settingswidgets.h \
ui/drivers/qt/options/options.h
ui/drivers/qt/qt_options.h
endif
DEFINES += -DHAVE_MAIN

View File

@ -57,9 +57,8 @@ UI
#include "../ui/drivers/qt/qt_playlist.cpp"
#include "../ui/drivers/qt/qt_downloads.cpp"
#ifdef HAVE_MENU
#include "../ui/drivers/qt/options/generic.cpp"
#include "../ui/drivers/qt/options/nongeneric.cpp"
#include "../ui/drivers/qt/options/moc_options.cpp"
#include "../ui/drivers/qt/qt_options.cpp"
#include "../ui/drivers/qt/moc_options.cpp"
#include "../ui/drivers/qt/moc_settingswidgets.cpp"
#endif
#include "../ui/drivers/moc_ui_qt.cpp"

View File

@ -2510,7 +2510,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Cg|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Cg|x64'">true</ExcludedFromBuild>
</CustomBuild>
<CustomBuild Include="..\..\..\ui\drivers\qt\options\options.h">
<CustomBuild Include="..\..\..\ui\drivers\qt\qt_options.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug QT|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug QT+CG|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug QT|x64'">moc.exe "%(FullPath)" &gt; "%(RootDir)%(Directory)moc_%(Filename).cpp"</Command>

View File

@ -37,6 +37,6 @@
<CustomBuild Include="..\..\..\ui\drivers\qt\coreinfodialog.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\filedropwidget.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\settingswidgets.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\options\options.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\qt_options.h" />
</ItemGroup>
</Project>
</Project>

View File

@ -2510,7 +2510,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Cg|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Cg|x64'">true</ExcludedFromBuild>
</CustomBuild>
<CustomBuild Include="..\..\..\ui\drivers\qt\options\options.h">
<CustomBuild Include="..\..\..\ui\drivers\qt\qt_options.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug QT|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug QT+CG|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug QT|x64'">moc.exe "%(FullPath)" &gt; "%(RootDir)%(Directory)moc_%(Filename).cpp"</Command>
@ -2564,4 +2564,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -37,6 +37,6 @@
<CustomBuild Include="..\..\..\ui\drivers\qt\coreinfodialog.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\filedropwidget.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\settingswidgets.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\options\options.h" />
<CustomBuild Include="..\..\..\ui\drivers\qt\qt_options.h" />
</ItemGroup>
</Project>
</Project>

View File

@ -1,212 +0,0 @@
#include "options.h"
/* DRIVERS */
DriversCategory::DriversCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS);
setCategoryIcon("menu_drivers");
}
QVector<OptionsPage*> DriversCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new DriversPage(this);
return pages;
}
DriversPage::DriversPage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS);
}
QWidget *DriversPage::widget()
{
return create_widget(DISPLAYLIST_DRIVER_SETTINGS_LIST);
}
/* DIRECTORY */
DirectoryCategory::DirectoryCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS);
setCategoryIcon("folder");
}
QVector<OptionsPage*> DirectoryCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new DirectoryPage(this);
return pages;
}
DirectoryPage::DirectoryPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *DirectoryPage::widget()
{
return create_widget(DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
}
/* CONFIGURATION */
ConfigurationCategory::ConfigurationCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS);
setCategoryIcon("setting");
}
QVector<OptionsPage*> ConfigurationCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new ConfigurationPage(this);
return pages;
}
ConfigurationPage::ConfigurationPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *ConfigurationPage::widget()
{
return create_widget(DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
}
/* CORE */
CoreCategory::CoreCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS);
setCategoryIcon("core-options");
}
QVector<OptionsPage*> CoreCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new CorePage(this);
return pages;
}
CorePage::CorePage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *CorePage::widget()
{
return create_widget(DISPLAYLIST_CORE_SETTINGS_LIST);
}
/* LOGGING */
LoggingCategory::LoggingCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS);
setCategoryIcon("menu_log");
}
QVector<OptionsPage*> LoggingCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new LoggingPage(this);
return pages;
}
LoggingPage::LoggingPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *LoggingPage::widget()
{
return create_widget(DISPLAYLIST_LOGGING_SETTINGS_LIST);
}
/* AI SERVICE */
AIServiceCategory::AIServiceCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS);
setCategoryIcon("menu_drivers");
}
QVector<OptionsPage*> AIServiceCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new AIServicePage(this);
return pages;
}
AIServicePage::AIServicePage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS);
}
QWidget *AIServicePage::widget()
{
return create_widget(DISPLAYLIST_AI_SERVICE_SETTINGS_LIST);
}
/* FRAME THROTTLE */
FrameThrottleCategory::FrameThrottleCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS);
setCategoryIcon("menu_frameskip");
}
QVector<OptionsPage*> FrameThrottleCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new FrameThrottlePage(this);
pages << new RewindPage(this);
return pages;
}
FrameThrottlePage::FrameThrottlePage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS);
}
QWidget *FrameThrottlePage::widget()
{
return create_widget(DISPLAYLIST_FRAME_THROTTLE_SETTINGS_LIST);
}
RewindPage::RewindPage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS);
}
QWidget *RewindPage::widget()
{
return create_widget(DISPLAYLIST_REWIND_SETTINGS_LIST);
}

View File

@ -71,7 +71,7 @@ extern "C" {
#include "shaderparamsdialog.h"
#endif
#include "options/options.h"
#include "qt_options.h"
#if defined(_MSC_VER) && !defined(_XBOX) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
/* https://support.microsoft.com/en-us/kb/980263 */

View File

@ -3,8 +3,8 @@
#include <QStackedWidget>
#include <QButtonGroup>
#include "options.h"
#include "../viewoptionsdialog.h"
#include "qt_options.h"
#include "viewoptionsdialog.h"
#ifndef CXX_BUILD
extern "C" {
@ -1472,3 +1472,214 @@ AspectRatioRadioButton::AspectRatioRadioButton(unsigned min, unsigned max, QWidg
,m_max(max)
{
}
/* DRIVERS */
DriversCategory::DriversCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS);
setCategoryIcon("menu_drivers");
}
QVector<OptionsPage*> DriversCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new DriversPage(this);
return pages;
}
DriversPage::DriversPage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS);
}
QWidget *DriversPage::widget()
{
return create_widget(DISPLAYLIST_DRIVER_SETTINGS_LIST);
}
/* DIRECTORY */
DirectoryCategory::DirectoryCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS);
setCategoryIcon("folder");
}
QVector<OptionsPage*> DirectoryCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new DirectoryPage(this);
return pages;
}
DirectoryPage::DirectoryPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *DirectoryPage::widget()
{
return create_widget(DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
}
/* CONFIGURATION */
ConfigurationCategory::ConfigurationCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS);
setCategoryIcon("setting");
}
QVector<OptionsPage*> ConfigurationCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new ConfigurationPage(this);
return pages;
}
ConfigurationPage::ConfigurationPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *ConfigurationPage::widget()
{
return create_widget(DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
}
/* CORE */
CoreCategory::CoreCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS);
setCategoryIcon("core-options");
}
QVector<OptionsPage*> CoreCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new CorePage(this);
return pages;
}
CorePage::CorePage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *CorePage::widget()
{
return create_widget(DISPLAYLIST_CORE_SETTINGS_LIST);
}
/* LOGGING */
LoggingCategory::LoggingCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS);
setCategoryIcon("menu_log");
}
QVector<OptionsPage*> LoggingCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new LoggingPage(this);
return pages;
}
LoggingPage::LoggingPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *LoggingPage::widget()
{
return create_widget(DISPLAYLIST_LOGGING_SETTINGS_LIST);
}
/* AI SERVICE */
AIServiceCategory::AIServiceCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS);
setCategoryIcon("menu_drivers");
}
QVector<OptionsPage*> AIServiceCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new AIServicePage(this);
return pages;
}
AIServicePage::AIServicePage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS);
}
QWidget *AIServicePage::widget()
{
return create_widget(DISPLAYLIST_AI_SERVICE_SETTINGS_LIST);
}
/* FRAME THROTTLE */
FrameThrottleCategory::FrameThrottleCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS);
setCategoryIcon("menu_frameskip");
}
QVector<OptionsPage*> FrameThrottleCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new FrameThrottlePage(this);
pages << new RewindPage(this);
return pages;
}
FrameThrottlePage::FrameThrottlePage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS);
}
QWidget *FrameThrottlePage::widget()
{
return create_widget(DISPLAYLIST_FRAME_THROTTLE_SETTINGS_LIST);
}
RewindPage::RewindPage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS);
}
QWidget *RewindPage::widget()
{
return create_widget(DISPLAYLIST_REWIND_SETTINGS_LIST);
}

View File

@ -6,7 +6,7 @@
#include <QScrollArea>
#include <QDebug>
#include "../settingswidgets.h"
#include "settingswidgets.h"
class MainWindow;
class ViewOptionsWidget;