Souce buttons checked in edit splash dialog.

Corrected faulty theme icon.
This commit is contained in:
Kjell Kernen
2014-02-22 00:41:27 +01:00
parent e9ce69c6a4
commit ccfa25d58e
6 changed files with 86 additions and 29 deletions
-4
View File
@@ -56,9 +56,6 @@ void appPreferencesDialog::writeValues()
g.jsSupport(false);
g.jsCtrl(0);
}
g.id(ui->profileIndexLE->text().toInt());
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
@@ -147,7 +144,6 @@ void appPreferencesDialog::initSettings()
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
ui->sdPath->setText(g.profile[g.id()].sdPath());
ui->profileIndexLE->setText(QString("%1").arg(g.id()));
ui->profileNameLE->setText(g.profile[g.id()].name());
ui->firmwareLE->setText(g.profile[g.id()].firmware());
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
+42 -25
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>685</width>
<height>446</height>
<height>442</height>
</rect>
</property>
<property name="sizePolicy">
@@ -133,12 +133,12 @@
</property>
<item>
<property name="text">
<string>Include companion splashes</string>
<string>Only show user splash images</string>
</property>
</item>
<item>
<property name="text">
<string>Only user defined splashes</string>
<string>Show user and companion splash images</string>
</property>
</item>
</widget>
@@ -706,13 +706,6 @@ This is used by the templated to determine which channel goes to what number out
</item>
</widget>
</item>
<item row="3" column="1" colspan="5">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_14">
<property name="sizePolicy">
@@ -809,6 +802,12 @@ This is used by the templated to determine which channel goes to what number out
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
@@ -862,10 +861,16 @@ This is used by the templated to determine which channel goes to what number out
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
@@ -883,6 +888,18 @@ This is used by the templated to determine which channel goes to what number out
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="4" column="6">
@@ -899,27 +916,20 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLineEdit" name="profileIndexLE">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="profileNameLE">
<property name="minimumSize">
<size>
<width>0</width>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="7" column="1">
@@ -956,6 +966,13 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="3" column="1" colspan="6">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
+22
View File
@@ -14,11 +14,21 @@ Side::Side(){
imageLabel = 0;
fileNameEdit = 0;
saveButton = 0;
loadFwButton=0;
loadPictButton = 0;
loadProfileButton = 0;
saveToFileName = new QString("");
source = new Source(UNDEFINED);
format = new LCDFormat(LCDTARANIS);
}
void Side::markSourceButton()
{
loadFwButton->setChecked(*source == FW ? true : false );
loadPictButton->setChecked(*source == PICT ? true : false );
loadProfileButton->setChecked(*source == PROFILE ? true : false );
}
void Side::copyImage( Side side )
{
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
@@ -160,8 +170,17 @@ customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
right.libraryButton = ui->rightLibraryButton;
left.invertButton = ui->leftInvertButton;
right.invertButton = ui->rightInvertButton;
left.loadFwButton = ui->leftLoadFwButton;
right.loadFwButton = ui->rightLoadFwButton;
left.loadPictButton = ui->leftLoadPictButton;
right.loadPictButton = ui->rightLoadPictButton;
left.loadProfileButton = ui->leftLoadProfileButton;
right.loadProfileButton = ui->rightLoadProfileButton;
loadProfile(left);
left.markSourceButton();
resize(0,0);
}
@@ -189,6 +208,7 @@ void customizeSplashDialog::loadFirmware(Side side)
else
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
@@ -208,6 +228,7 @@ void customizeSplashDialog::loadPicture(Side side)
else
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
@@ -220,6 +241,7 @@ void customizeSplashDialog::loadProfile(Side side)
if (!side.displayImage( fileName, PROFILE ))
QMessageBox::critical(this, tr("Error"), tr("Cannot load the profile image %1.").arg(fileName));
}
side.markSourceButton();
}
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
+4
View File
@@ -22,6 +22,7 @@ class Side
{
public:
Side();
void markSourceButton();
void copyImage( Side );
bool displayImage( QString fileName, Source source );
bool saveImage();
@@ -32,6 +33,9 @@ public:
QPushButton *saveButton;
QPushButton *invertButton;
QToolButton *libraryButton;
QPushButton *loadFwButton;
QPushButton *loadPictButton;
QPushButton *loadProfileButton;
QString *saveToFileName;
+18
View File
@@ -258,6 +258,9 @@
<property name="text">
<string>Load Profile</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -265,6 +268,9 @@
<property name="text">
<string>Load FW</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -272,6 +278,9 @@
<property name="text">
<string>Load Pict</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -554,6 +563,9 @@
<property name="text">
<string>Load Profile</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -564,6 +576,9 @@
<property name="text">
<string>Load FW</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -571,6 +586,9 @@
<property name="text">
<string>Load Pict</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 245 B