Mod: [skip ci] implementation classes don't inherit from UI classes any more
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DlgStartPreferencesImp.h"
|
||||
#include "ui_DlgStartPreferences.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Gui/Application.h>
|
||||
@@ -35,15 +36,16 @@ using namespace StartGui;
|
||||
*/
|
||||
DlgStartPreferencesImp::DlgStartPreferencesImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
, ui(new Ui_DlgStartPreferences)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
// Hide currently unused controls
|
||||
label_12->hide();
|
||||
label_7->hide();
|
||||
colorButton_7->hide();
|
||||
radioButton_1->hide();
|
||||
radioButton_2->hide();
|
||||
ui->label_12->hide();
|
||||
ui->label_7->hide();
|
||||
ui->colorButton_7->hide();
|
||||
ui->radioButton_1->hide();
|
||||
ui->radioButton_2->hide();
|
||||
|
||||
// fills the combo box with all available workbenches
|
||||
// sorted by their menu text
|
||||
@@ -59,17 +61,17 @@ DlgStartPreferencesImp::DlgStartPreferencesImp( QWidget* parent )
|
||||
QString key = QString::fromLatin1("<last>");
|
||||
QString value = QString::fromLatin1("$LastModule");
|
||||
if (px.isNull())
|
||||
AutoloadModuleCombo->addItem(key, QVariant(value));
|
||||
ui->AutoloadModuleCombo->addItem(key, QVariant(value));
|
||||
else
|
||||
AutoloadModuleCombo->addItem(px, key, QVariant(value));
|
||||
ui->AutoloadModuleCombo->addItem(px, key, QVariant(value));
|
||||
}
|
||||
|
||||
for (QMap<QString, QString>::Iterator it = menuText.begin(); it != menuText.end(); ++it) {
|
||||
QPixmap px = Gui::Application::Instance->workbenchIcon(it.value());
|
||||
if (px.isNull())
|
||||
AutoloadModuleCombo->addItem(it.key(), QVariant(it.value()));
|
||||
ui->AutoloadModuleCombo->addItem(it.key(), QVariant(it.value()));
|
||||
else
|
||||
AutoloadModuleCombo->addItem(px, it.key(), QVariant(it.value()));
|
||||
ui->AutoloadModuleCombo->addItem(px, it.key(), QVariant(it.value()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,32 +86,32 @@ DlgStartPreferencesImp::~DlgStartPreferencesImp()
|
||||
|
||||
void DlgStartPreferencesImp::saveSettings()
|
||||
{
|
||||
int index = AutoloadModuleCombo->currentIndex();
|
||||
QVariant data = AutoloadModuleCombo->itemData(index);
|
||||
int index = ui->AutoloadModuleCombo->currentIndex();
|
||||
QVariant data = ui->AutoloadModuleCombo->itemData(index);
|
||||
QString startWbName = data.toString();
|
||||
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Start")->
|
||||
SetASCII("AutoloadModule", startWbName.toLatin1());
|
||||
colorButton_1->onSave();
|
||||
colorButton_2->onSave();
|
||||
colorButton_3->onSave();
|
||||
colorButton_4->onSave();
|
||||
colorButton_5->onSave();
|
||||
colorButton_6->onSave();
|
||||
colorButton_7->onSave();
|
||||
fileChooser_1->onSave();
|
||||
fileChooser_2->onSave();
|
||||
fileChooser_3->onSave();
|
||||
radioButton_1->onSave();
|
||||
radioButton_2->onSave();
|
||||
checkBox->onSave();
|
||||
checkBox_1->onSave();
|
||||
checkBox_2->onSave();
|
||||
checkBox_3->onSave();
|
||||
checkBox_4->onSave();
|
||||
checkBox_5->onSave();
|
||||
checkBox_6->onSave();
|
||||
lineEdit->onSave();
|
||||
spinBox->onSave();
|
||||
ui->colorButton_1->onSave();
|
||||
ui->colorButton_2->onSave();
|
||||
ui->colorButton_3->onSave();
|
||||
ui->colorButton_4->onSave();
|
||||
ui->colorButton_5->onSave();
|
||||
ui->colorButton_6->onSave();
|
||||
ui->colorButton_7->onSave();
|
||||
ui->fileChooser_1->onSave();
|
||||
ui->fileChooser_2->onSave();
|
||||
ui->fileChooser_3->onSave();
|
||||
ui->radioButton_1->onSave();
|
||||
ui->radioButton_2->onSave();
|
||||
ui->checkBox->onSave();
|
||||
ui->checkBox_1->onSave();
|
||||
ui->checkBox_2->onSave();
|
||||
ui->checkBox_3->onSave();
|
||||
ui->checkBox_4->onSave();
|
||||
ui->checkBox_5->onSave();
|
||||
ui->checkBox_6->onSave();
|
||||
ui->lineEdit->onSave();
|
||||
ui->spinBox->onSave();
|
||||
}
|
||||
|
||||
void DlgStartPreferencesImp::loadSettings()
|
||||
@@ -118,28 +120,28 @@ void DlgStartPreferencesImp::loadSettings()
|
||||
start = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Start")->
|
||||
GetASCII("AutoloadModule", start.c_str());
|
||||
QString startWbName = QLatin1String(start.c_str());
|
||||
AutoloadModuleCombo->setCurrentIndex(AutoloadModuleCombo->findData(startWbName));
|
||||
colorButton_1->onRestore();
|
||||
colorButton_2->onRestore();
|
||||
colorButton_3->onRestore();
|
||||
colorButton_4->onRestore();
|
||||
colorButton_5->onRestore();
|
||||
colorButton_6->onRestore();
|
||||
colorButton_7->onRestore();
|
||||
fileChooser_1->onRestore();
|
||||
fileChooser_2->onRestore();
|
||||
fileChooser_3->onRestore();
|
||||
radioButton_1->onRestore();
|
||||
radioButton_2->onRestore();
|
||||
checkBox->onRestore();
|
||||
checkBox_1->onRestore();
|
||||
checkBox_2->onRestore();
|
||||
checkBox_3->onRestore();
|
||||
checkBox_4->onRestore();
|
||||
checkBox_5->onRestore();
|
||||
checkBox_6->onRestore();
|
||||
lineEdit->onRestore();
|
||||
spinBox->onRestore();
|
||||
ui->AutoloadModuleCombo->setCurrentIndex(ui->AutoloadModuleCombo->findData(startWbName));
|
||||
ui->colorButton_1->onRestore();
|
||||
ui->colorButton_2->onRestore();
|
||||
ui->colorButton_3->onRestore();
|
||||
ui->colorButton_4->onRestore();
|
||||
ui->colorButton_5->onRestore();
|
||||
ui->colorButton_6->onRestore();
|
||||
ui->colorButton_7->onRestore();
|
||||
ui->fileChooser_1->onRestore();
|
||||
ui->fileChooser_2->onRestore();
|
||||
ui->fileChooser_3->onRestore();
|
||||
ui->radioButton_1->onRestore();
|
||||
ui->radioButton_2->onRestore();
|
||||
ui->checkBox->onRestore();
|
||||
ui->checkBox_1->onRestore();
|
||||
ui->checkBox_2->onRestore();
|
||||
ui->checkBox_3->onRestore();
|
||||
ui->checkBox_4->onRestore();
|
||||
ui->checkBox_5->onRestore();
|
||||
ui->checkBox_6->onRestore();
|
||||
ui->lineEdit->onRestore();
|
||||
ui->spinBox->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +150,7 @@ void DlgStartPreferencesImp::loadSettings()
|
||||
void DlgStartPreferencesImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#ifndef STARTGUI_DLGSTARTPREFERENCESIMP_H
|
||||
#define STARTGUI_DLGSTARTPREFERENCESIMP_H
|
||||
|
||||
#include "ui_DlgStartPreferences.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
#include <memory>
|
||||
|
||||
class Ui_DlgStartPreferences;
|
||||
namespace StartGui {
|
||||
|
||||
class DlgStartPreferencesImp : public Gui::Dialog::PreferencePage, public Ui_DlgStartPreferences
|
||||
class DlgStartPreferencesImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -41,6 +41,9 @@ namespace StartGui {
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgStartPreferences> ui;
|
||||
};
|
||||
|
||||
} // namespace StartGui
|
||||
|
||||
Reference in New Issue
Block a user