Remove duplicated code
This commit is contained in:
@@ -84,18 +84,7 @@ Curves::Curves(QWidget * parent, ModelData & model):
|
||||
QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview);
|
||||
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
||||
ui->curvePreview->setScene(scene);
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
|
||||
QString Theme=getTheme();
|
||||
QIcon ClearIcon;
|
||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||
|
||||
|
||||
@@ -123,17 +123,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
|
||||
|
||||
#ifdef PHONON
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon PlayIcon;
|
||||
populate_icon(&PlayIcon,Theme,"play.png");
|
||||
playBT[i] = new QPushButton(this);
|
||||
@@ -173,17 +163,7 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
|
||||
{
|
||||
if (phononLock)
|
||||
return;
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon PlayIcon;
|
||||
populate_icon(&PlayIcon,Theme,"play.png");
|
||||
|
||||
@@ -216,17 +196,8 @@ void CustomFunctionsPanel::playMusic()
|
||||
QPushButton *playButton = qobject_cast<QPushButton*>(sender());
|
||||
int index=playButton->objectName().mid(5,2).toInt();
|
||||
QString function=playButton->objectName().left(4);
|
||||
QString Theme=getTheme();
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QIcon PlayIcon;
|
||||
populate_icon(&PlayIcon,Theme,"play.png");
|
||||
QIcon StopIcon;
|
||||
@@ -499,17 +470,7 @@ void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedFunction = label->property("index").toInt();
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon ClearIcon;
|
||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||
QIcon CopyIcon;
|
||||
|
||||
@@ -382,17 +382,7 @@ void CustomSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedSwitch = label->property("index").toInt();
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon ClearIcon;
|
||||
populate_icon(&ClearIcon,Theme,"clear.png");
|
||||
QIcon CopyIcon;
|
||||
|
||||
@@ -8,17 +8,7 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
|
||||
generalSettings(generalSettings),
|
||||
expoInserted(false)
|
||||
{
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
|
||||
QGridLayout * exposLayout = new QGridLayout(this);
|
||||
|
||||
@@ -358,17 +348,7 @@ void InputsPanel::expoAdd()
|
||||
|
||||
void InputsPanel::expolistWidget_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon AddIcon;
|
||||
populate_icon(&AddIcon,Theme,"add.png");
|
||||
QIcon EditIcon;
|
||||
|
||||
@@ -8,17 +8,6 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
generalSettings(generalSettings),
|
||||
mixInserted(false)
|
||||
{
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QGridLayout * mixesLayout = new QGridLayout(this);
|
||||
|
||||
MixerlistWidget = new MixersList(this, false); // TODO enum
|
||||
@@ -26,6 +15,7 @@ MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
QPushButton * qbDown = new QPushButton(this);
|
||||
QPushButton * qbClear = new QPushButton(this);
|
||||
|
||||
QString Theme=getTheme();
|
||||
QIcon qbUpIcon;
|
||||
populate_icon(&qbUpIcon,Theme,"moveup.png");
|
||||
qbUp->setText(tr("Move Up"));
|
||||
@@ -423,17 +413,7 @@ void MixesPanel::mixerAdd()
|
||||
|
||||
void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QString Theme=getTheme();
|
||||
QIcon AddIcon;
|
||||
populate_icon(&AddIcon,Theme,"add.png");
|
||||
QIcon EditIcon;
|
||||
|
||||
@@ -21,18 +21,9 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
|
||||
generalSettings(generalSettings)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QString Theme=getTheme();
|
||||
QSettings settings("companion", "companion");
|
||||
restoreGeometry(settings.value("modelEditGeometry").toByteArray());
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
QIcon SimulateIcon;
|
||||
populate_icon(&SimulateIcon,Theme,"simulate.png");
|
||||
ui->pushButton->setIcon(SimulateIcon);
|
||||
|
||||
Reference in New Issue
Block a user