Icons for Settingsdialog
This commit is contained in:
parent
dfaa6b1d95
commit
926f1560a6
3 changed files with 43 additions and 2 deletions
|
@ -49,6 +49,14 @@ GeneralSettingsPage::GeneralSettingsPage()
|
||||||
QPushButton *cardDatabasePathButton = new QPushButton("...");
|
QPushButton *cardDatabasePathButton = new QPushButton("...");
|
||||||
connect(cardDatabasePathButton, SIGNAL(clicked()), this, SLOT(cardDatabasePathButtonClicked()));
|
connect(cardDatabasePathButton, SIGNAL(clicked()), this, SLOT(cardDatabasePathButtonClicked()));
|
||||||
|
|
||||||
|
/*
|
||||||
|
cardBackgroundPathLabel = new QLabel;
|
||||||
|
cardBackgroundPathEdit = new QLineEdit(settings.value("cardbackground").toString());
|
||||||
|
cardBackgroundPathEdit->setReadOnly(true);
|
||||||
|
QPushButton *cardBackgroundPathButton = new QPushButton("...");
|
||||||
|
connect(cardBackgroundPathButton, SIGNAL(clicked()), this, SLOT(cardBackgroundPathButtonClicked()));
|
||||||
|
*/
|
||||||
|
|
||||||
QGridLayout *pathsGrid = new QGridLayout;
|
QGridLayout *pathsGrid = new QGridLayout;
|
||||||
pathsGrid->addWidget(deckPathLabel, 0, 0);
|
pathsGrid->addWidget(deckPathLabel, 0, 0);
|
||||||
pathsGrid->addWidget(deckPathEdit, 0, 1);
|
pathsGrid->addWidget(deckPathEdit, 0, 1);
|
||||||
|
@ -59,6 +67,11 @@ GeneralSettingsPage::GeneralSettingsPage()
|
||||||
pathsGrid->addWidget(cardDatabasePathLabel, 2, 0);
|
pathsGrid->addWidget(cardDatabasePathLabel, 2, 0);
|
||||||
pathsGrid->addWidget(cardDatabasePathEdit, 2, 1);
|
pathsGrid->addWidget(cardDatabasePathEdit, 2, 1);
|
||||||
pathsGrid->addWidget(cardDatabasePathButton, 2, 2);
|
pathsGrid->addWidget(cardDatabasePathButton, 2, 2);
|
||||||
|
/*
|
||||||
|
pathsGrid->addWidget(cardBackgroundPathLabel, 3, 0);
|
||||||
|
pathsGrid->addWidget(cardBackgroundPathEdit, 3, 1);
|
||||||
|
pathsGrid->addWidget(cardBackgroundPathButton, 3, 2);
|
||||||
|
*/
|
||||||
pathsGroupBox->setLayout(pathsGrid);
|
pathsGroupBox->setLayout(pathsGrid);
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
|
@ -125,6 +138,19 @@ void GeneralSettingsPage::cardDatabasePathButtonClicked()
|
||||||
emit cardDatabasePathChanged(path);
|
emit cardDatabasePathChanged(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralSettingsPage::cardBackgroundPathButtonClicked()
|
||||||
|
{
|
||||||
|
QString path = QFileDialog::getOpenFileName(this, tr("Choose path"));
|
||||||
|
if (path.isEmpty())
|
||||||
|
return;
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup("paths");
|
||||||
|
settings.setValue("cardbackground", path);
|
||||||
|
cardBackgroundPathEdit->setText(path);
|
||||||
|
|
||||||
|
emit cardBackgroundPathChanged(path);
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralSettingsPage::languageBoxChanged(int index)
|
void GeneralSettingsPage::languageBoxChanged(int index)
|
||||||
{
|
{
|
||||||
QString qmFile = languageBox->itemData(index).toString();
|
QString qmFile = languageBox->itemData(index).toString();
|
||||||
|
@ -142,6 +168,7 @@ void GeneralSettingsPage::retranslateUi()
|
||||||
deckPathLabel->setText(tr("Decks directory:"));
|
deckPathLabel->setText(tr("Decks directory:"));
|
||||||
picsPathLabel->setText(tr("Pictures directory:"));
|
picsPathLabel->setText(tr("Pictures directory:"));
|
||||||
cardDatabasePathLabel->setText(tr("Path to card database:"));
|
cardDatabasePathLabel->setText(tr("Path to card database:"));
|
||||||
|
//cardBackgroundPathLabel->setText(tr("Path to card background:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
AppearanceSettingsPage::AppearanceSettingsPage()
|
AppearanceSettingsPage::AppearanceSettingsPage()
|
||||||
|
@ -302,7 +329,11 @@ void DlgSettings::retranslateUi()
|
||||||
setWindowTitle(tr("Settings"));
|
setWindowTitle(tr("Settings"));
|
||||||
|
|
||||||
generalButton->setText(tr("General"));
|
generalButton->setText(tr("General"));
|
||||||
|
QIcon generalIcon("resources/icon_general_v1.svg");
|
||||||
|
generalButton->setIcon(generalIcon);
|
||||||
appearanceButton->setText(tr("Appearance"));
|
appearanceButton->setText(tr("Appearance"));
|
||||||
|
QIcon messagesIcon("resources/icon_messages_v1.svg");
|
||||||
|
messagesButton->setIcon(messagesIcon);
|
||||||
messagesButton->setText(tr("Messages"));
|
messagesButton->setText(tr("Messages"));
|
||||||
|
|
||||||
closeButton->setText(tr("&Close"));
|
closeButton->setText(tr("&Close"));
|
||||||
|
|
|
@ -28,18 +28,20 @@ private slots:
|
||||||
void deckPathButtonClicked();
|
void deckPathButtonClicked();
|
||||||
void picsPathButtonClicked();
|
void picsPathButtonClicked();
|
||||||
void cardDatabasePathButtonClicked();
|
void cardDatabasePathButtonClicked();
|
||||||
|
void cardBackgroundPathButtonClicked();
|
||||||
void languageBoxChanged(int index);
|
void languageBoxChanged(int index);
|
||||||
signals:
|
signals:
|
||||||
void picsPathChanged(const QString &path);
|
void picsPathChanged(const QString &path);
|
||||||
void cardDatabasePathChanged(const QString &path);
|
void cardDatabasePathChanged(const QString &path);
|
||||||
|
void cardBackgroundPathChanged(const QString &path);
|
||||||
void changeLanguage(const QString &qmFile);
|
void changeLanguage(const QString &qmFile);
|
||||||
private:
|
private:
|
||||||
QStringList findQmFiles();
|
QStringList findQmFiles();
|
||||||
QString languageName(const QString &qmFile);
|
QString languageName(const QString &qmFile);
|
||||||
QLineEdit *deckPathEdit, *picsPathEdit, *cardDatabasePathEdit;
|
QLineEdit *deckPathEdit, *picsPathEdit, *cardDatabasePathEdit, *cardBackgroundPathEdit;
|
||||||
QGroupBox *personalGroupBox, *pathsGroupBox;
|
QGroupBox *personalGroupBox, *pathsGroupBox;
|
||||||
QComboBox *languageBox;
|
QComboBox *languageBox;
|
||||||
QLabel *languageLabel, *deckPathLabel, *picsPathLabel, *cardDatabasePathLabel;
|
QLabel *languageLabel, *deckPathLabel, *picsPathLabel, *cardDatabasePathLabel, *cardBackgroundPathLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AppearanceSettingsPage : public AbstractSettingsPage {
|
class AppearanceSettingsPage : public AbstractSettingsPage {
|
||||||
|
|
|
@ -66,8 +66,16 @@ int main(int argc, char *argv[])
|
||||||
translator.load(lang);
|
translator.load(lang);
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MainWindow ui(&translator);
|
MainWindow ui(&translator);
|
||||||
qDebug("main(): MainWindow constructor finished");
|
qDebug("main(): MainWindow constructor finished");
|
||||||
|
|
||||||
|
//set Icon
|
||||||
|
QIcon icon("resources/icon.svg");
|
||||||
|
ui.setWindowIcon(icon);
|
||||||
|
//
|
||||||
|
|
||||||
ui.show();
|
ui.show();
|
||||||
qDebug("main(): ui.show() finished");
|
qDebug("main(): ui.show() finished");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue