Reworked settings menu / switchable button alpha and gui toggle
This commit is contained in:
parent
873b1e2dde
commit
72397d880e
@ -52,6 +52,10 @@ public:
|
|||||||
bool oldGUI() const override;
|
bool oldGUI() const override;
|
||||||
void setAlphaTrans(size_t value) override;
|
void setAlphaTrans(size_t value) override;
|
||||||
size_t getAlphaTrans() const override;
|
size_t getAlphaTrans() const override;
|
||||||
|
void hideMenuToggle(bool value) override;
|
||||||
|
bool hideMenuToggle() const override;
|
||||||
|
void hideAlpha(bool value) override;
|
||||||
|
bool hideAlpha() const override;
|
||||||
|
|
||||||
aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const override;
|
aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const override;
|
||||||
void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) override;
|
void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) override;
|
||||||
@ -92,6 +96,8 @@ private:
|
|||||||
bool showBigClock_;
|
bool showBigClock_;
|
||||||
bool oldGUI_;
|
bool oldGUI_;
|
||||||
size_t alphaTrans_;
|
size_t alphaTrans_;
|
||||||
|
bool hideMenuToggle_;
|
||||||
|
bool hideAlpha_;
|
||||||
|
|
||||||
aasdk::proto::enums::VideoFPS::Enum videoFPS_;
|
aasdk::proto::enums::VideoFPS::Enum videoFPS_;
|
||||||
aasdk::proto::enums::VideoResolution::Enum videoResolution_;
|
aasdk::proto::enums::VideoResolution::Enum videoResolution_;
|
||||||
@ -113,6 +119,8 @@ private:
|
|||||||
static const std::string cGeneralShowBigClockKey;
|
static const std::string cGeneralShowBigClockKey;
|
||||||
static const std::string cGeneralOldGUIKey;
|
static const std::string cGeneralOldGUIKey;
|
||||||
static const std::string cGeneralAlphaTransKey;
|
static const std::string cGeneralAlphaTransKey;
|
||||||
|
static const std::string cGeneralHideMenuToggleKey;
|
||||||
|
static const std::string cGeneralHideAlphaKey;
|
||||||
|
|
||||||
static const std::string cGeneralHandednessOfTrafficTypeKey;
|
static const std::string cGeneralHandednessOfTrafficTypeKey;
|
||||||
|
|
||||||
|
@ -60,6 +60,10 @@ public:
|
|||||||
virtual bool oldGUI() const = 0;
|
virtual bool oldGUI() const = 0;
|
||||||
virtual void setAlphaTrans(size_t value) = 0;
|
virtual void setAlphaTrans(size_t value) = 0;
|
||||||
virtual size_t getAlphaTrans() const = 0;
|
virtual size_t getAlphaTrans() const = 0;
|
||||||
|
virtual void hideMenuToggle(bool value) = 0;
|
||||||
|
virtual bool hideMenuToggle() const = 0;
|
||||||
|
virtual void hideAlpha(bool value) = 0;
|
||||||
|
virtual bool hideAlpha() const = 0;
|
||||||
|
|
||||||
virtual aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const = 0;
|
virtual aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const = 0;
|
||||||
virtual void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) = 0;
|
virtual void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) = 0;
|
||||||
|
@ -174,8 +174,8 @@ private:
|
|||||||
bool c7ButtonForce = false;
|
bool c7ButtonForce = false;
|
||||||
bool c8ButtonForce = false;
|
bool c8ButtonForce = false;
|
||||||
|
|
||||||
int screen_width = 800;
|
//int screen_width = 800;
|
||||||
int screen_height = 480;
|
//int screen_height = 480;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,16 @@ private slots:
|
|||||||
void onUpdateSystemVolume(int value);
|
void onUpdateSystemVolume(int value);
|
||||||
void onUpdateSystemCapture(int value);
|
void onUpdateSystemCapture(int value);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void show_tab1();
|
||||||
|
void show_tab2();
|
||||||
|
void show_tab3();
|
||||||
|
void show_tab4();
|
||||||
|
void show_tab5();
|
||||||
|
void show_tab6();
|
||||||
|
void show_tab7();
|
||||||
|
void show_tab8();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void showEvent(QShowEvent* event);
|
void showEvent(QShowEvent* event);
|
||||||
void load();
|
void load();
|
||||||
|
@ -36,6 +36,8 @@ const std::string Configuration::cGeneralShowClockKey = "General.ShowClock";
|
|||||||
const std::string Configuration::cGeneralShowBigClockKey = "General.ShowBigClock";
|
const std::string Configuration::cGeneralShowBigClockKey = "General.ShowBigClock";
|
||||||
const std::string Configuration::cGeneralOldGUIKey = "General.OldGUI";
|
const std::string Configuration::cGeneralOldGUIKey = "General.OldGUI";
|
||||||
const std::string Configuration::cGeneralAlphaTransKey = "General.AlphaTrans";
|
const std::string Configuration::cGeneralAlphaTransKey = "General.AlphaTrans";
|
||||||
|
const std::string Configuration::cGeneralHideMenuToggleKey = "General.HideMenuToggle";
|
||||||
|
const std::string Configuration::cGeneralHideAlphaKey = "General.HideAlpha";
|
||||||
|
|
||||||
const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.HandednessOfTrafficType";
|
const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.HandednessOfTrafficType";
|
||||||
|
|
||||||
@ -91,6 +93,8 @@ void Configuration::load()
|
|||||||
showBigClock_ = iniConfig.get<bool>(cGeneralShowBigClockKey, false);
|
showBigClock_ = iniConfig.get<bool>(cGeneralShowBigClockKey, false);
|
||||||
oldGUI_ = iniConfig.get<bool>(cGeneralOldGUIKey, false);
|
oldGUI_ = iniConfig.get<bool>(cGeneralOldGUIKey, false);
|
||||||
alphaTrans_ = iniConfig.get<size_t>(cGeneralAlphaTransKey, 50);
|
alphaTrans_ = iniConfig.get<size_t>(cGeneralAlphaTransKey, 50);
|
||||||
|
hideMenuToggle_ = iniConfig.get<bool>(cGeneralHideMenuToggleKey, false);
|
||||||
|
hideAlpha_ = iniConfig.get<bool>(cGeneralHideAlphaKey, false);
|
||||||
|
|
||||||
videoFPS_ = static_cast<aasdk::proto::enums::VideoFPS::Enum>(iniConfig.get<uint32_t>(cVideoFPSKey,
|
videoFPS_ = static_cast<aasdk::proto::enums::VideoFPS::Enum>(iniConfig.get<uint32_t>(cVideoFPSKey,
|
||||||
aasdk::proto::enums::VideoFPS::_60));
|
aasdk::proto::enums::VideoFPS::_60));
|
||||||
@ -130,6 +134,8 @@ void Configuration::reset()
|
|||||||
showBigClock_ = false;
|
showBigClock_ = false;
|
||||||
oldGUI_ = false;
|
oldGUI_ = false;
|
||||||
alphaTrans_ = 50;
|
alphaTrans_ = 50;
|
||||||
|
hideMenuToggle_ = false;
|
||||||
|
hideAlpha_ = false;
|
||||||
videoFPS_ = aasdk::proto::enums::VideoFPS::_60;
|
videoFPS_ = aasdk::proto::enums::VideoFPS::_60;
|
||||||
videoResolution_ = aasdk::proto::enums::VideoResolution::_480p;
|
videoResolution_ = aasdk::proto::enums::VideoResolution::_480p;
|
||||||
screenDPI_ = 140;
|
screenDPI_ = 140;
|
||||||
@ -153,6 +159,8 @@ void Configuration::save()
|
|||||||
iniConfig.put<bool>(cGeneralShowBigClockKey, showBigClock_);
|
iniConfig.put<bool>(cGeneralShowBigClockKey, showBigClock_);
|
||||||
iniConfig.put<bool>(cGeneralOldGUIKey, oldGUI_);
|
iniConfig.put<bool>(cGeneralOldGUIKey, oldGUI_);
|
||||||
iniConfig.put<size_t>(cGeneralAlphaTransKey, alphaTrans_);
|
iniConfig.put<size_t>(cGeneralAlphaTransKey, alphaTrans_);
|
||||||
|
iniConfig.put<bool>(cGeneralHideMenuToggleKey, hideMenuToggle_);
|
||||||
|
iniConfig.put<bool>(cGeneralHideAlphaKey, hideAlpha_);
|
||||||
|
|
||||||
iniConfig.put<uint32_t>(cVideoFPSKey, static_cast<uint32_t>(videoFPS_));
|
iniConfig.put<uint32_t>(cVideoFPSKey, static_cast<uint32_t>(videoFPS_));
|
||||||
iniConfig.put<uint32_t>(cVideoResolutionKey, static_cast<uint32_t>(videoResolution_));
|
iniConfig.put<uint32_t>(cVideoResolutionKey, static_cast<uint32_t>(videoResolution_));
|
||||||
@ -242,6 +250,26 @@ void Configuration::setAlphaTrans(size_t value)
|
|||||||
alphaTrans_ = value;
|
alphaTrans_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::hideMenuToggle(bool value)
|
||||||
|
{
|
||||||
|
hideMenuToggle_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Configuration::hideMenuToggle() const
|
||||||
|
{
|
||||||
|
return hideMenuToggle_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Configuration::hideAlpha(bool value)
|
||||||
|
{
|
||||||
|
hideAlpha_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Configuration::hideAlpha() const
|
||||||
|
{
|
||||||
|
return hideAlpha_;
|
||||||
|
}
|
||||||
|
|
||||||
aasdk::proto::enums::VideoFPS::Enum Configuration::getVideoFPS() const
|
aasdk::proto::enums::VideoFPS::Enum Configuration::getVideoFPS() const
|
||||||
{
|
{
|
||||||
return videoFPS_;
|
return videoFPS_;
|
||||||
|
@ -555,6 +555,17 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hide gui toggle if enabled in settings
|
||||||
|
if (configuration->hideMenuToggle()) {
|
||||||
|
ui_->pushButtonToggleGUI->hide();
|
||||||
|
ui_->pushButtonToggleGUI2->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// hide alpha controls if enabled in settings
|
||||||
|
if (configuration->hideAlpha()) {
|
||||||
|
ui_->pushButtonAlpha->hide();
|
||||||
|
}
|
||||||
|
|
||||||
// init alpha values
|
// init alpha values
|
||||||
ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans()));
|
ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans()));
|
||||||
MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans()));
|
MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans()));
|
||||||
|
@ -53,7 +53,24 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
|
|||||||
connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings);
|
connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings);
|
||||||
connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume);
|
connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume);
|
||||||
connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture);
|
connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture);
|
||||||
|
// menu
|
||||||
|
ui_->tab1->show();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->horizontalGroupBox->hide();
|
||||||
|
connect(ui_->pushButtonTab1, &QPushButton::clicked, this, &SettingsWindow::show_tab1);
|
||||||
|
connect(ui_->pushButtonTab2, &QPushButton::clicked, this, &SettingsWindow::show_tab2);
|
||||||
|
connect(ui_->pushButtonTab3, &QPushButton::clicked, this, &SettingsWindow::show_tab3);
|
||||||
|
connect(ui_->pushButtonTab4, &QPushButton::clicked, this, &SettingsWindow::show_tab4);
|
||||||
|
connect(ui_->pushButtonTab5, &QPushButton::clicked, this, &SettingsWindow::show_tab5);
|
||||||
|
connect(ui_->pushButtonTab6, &QPushButton::clicked, this, &SettingsWindow::show_tab6);
|
||||||
|
connect(ui_->pushButtonTab7, &QPushButton::clicked, this, &SettingsWindow::show_tab7);
|
||||||
|
connect(ui_->pushButtonTab8, &QPushButton::clicked, this, &SettingsWindow::show_tab8);
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsWindow::~SettingsWindow()
|
SettingsWindow::~SettingsWindow()
|
||||||
@ -69,6 +86,8 @@ void SettingsWindow::onSave()
|
|||||||
configuration_->showBigClock(ui_->checkBoxShowBigClock->isChecked());
|
configuration_->showBigClock(ui_->checkBoxShowBigClock->isChecked());
|
||||||
configuration_->oldGUI(ui_->checkBoxOldGUI->isChecked());
|
configuration_->oldGUI(ui_->checkBoxOldGUI->isChecked());
|
||||||
configuration_->setAlphaTrans(static_cast<size_t>(ui_->horizontalSliderAlphaTrans->value()));
|
configuration_->setAlphaTrans(static_cast<size_t>(ui_->horizontalSliderAlphaTrans->value()));
|
||||||
|
configuration_->hideMenuToggle(ui_->checkBoxHideMenuToggle->isChecked());
|
||||||
|
configuration_->hideAlpha(ui_->checkBoxHideAlpha->isChecked());
|
||||||
|
|
||||||
configuration_->setVideoFPS(ui_->radioButton30FPS->isChecked() ? aasdk::proto::enums::VideoFPS::_30 : aasdk::proto::enums::VideoFPS::_60);
|
configuration_->setVideoFPS(ui_->radioButton30FPS->isChecked() ? aasdk::proto::enums::VideoFPS::_30 : aasdk::proto::enums::VideoFPS::_60);
|
||||||
|
|
||||||
@ -243,6 +262,8 @@ void SettingsWindow::load()
|
|||||||
|
|
||||||
ui_->checkBoxShowBigClock->setChecked(configuration_->showBigClock());
|
ui_->checkBoxShowBigClock->setChecked(configuration_->showBigClock());
|
||||||
ui_->checkBoxOldGUI->setChecked(configuration_->oldGUI());
|
ui_->checkBoxOldGUI->setChecked(configuration_->oldGUI());
|
||||||
|
ui_->checkBoxHideMenuToggle->setChecked(configuration_->hideMenuToggle());
|
||||||
|
ui_->checkBoxHideAlpha->setChecked(configuration_->hideAlpha());
|
||||||
|
|
||||||
ui_->radioButton30FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_30);
|
ui_->radioButton30FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_30);
|
||||||
ui_->radioButton60FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_60);
|
ui_->radioButton60FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_60);
|
||||||
@ -656,6 +677,102 @@ void SettingsWindow::onShowBindings()
|
|||||||
confirmationMessage.exec();
|
confirmationMessage.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab1()
|
||||||
|
{
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab1->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab2()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab2->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab3()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab3->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab4()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab4->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab5()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab5->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab6()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab6->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab7()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab8->hide();
|
||||||
|
ui_->tab7->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::show_tab8()
|
||||||
|
{
|
||||||
|
ui_->tab1->hide();
|
||||||
|
ui_->tab2->hide();
|
||||||
|
ui_->tab3->hide();
|
||||||
|
ui_->tab4->hide();
|
||||||
|
ui_->tab5->hide();
|
||||||
|
ui_->tab6->hide();
|
||||||
|
ui_->tab7->hide();
|
||||||
|
ui_->tab8->show();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>740</width>
|
<width>800</width>
|
||||||
<height>837</height>
|
<height>837</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -16,6 +16,12 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>800</width>
|
||||||
|
<height>480</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -96,7 +96,9 @@ int main(int argc, char* argv[])
|
|||||||
mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||||
|
|
||||||
autoapp::ui::SettingsWindow settingsWindow(configuration);
|
autoapp::ui::SettingsWindow settingsWindow(configuration);
|
||||||
|
settingsWindow.setFixedSize(width, height);
|
||||||
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||||
|
settingsWindow.adjustSize();
|
||||||
|
|
||||||
autoapp::configuration::RecentAddressesList recentAddressesList(7);
|
autoapp::configuration::RecentAddressesList recentAddressesList(7);
|
||||||
recentAddressesList.read();
|
recentAddressesList.read();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user