diff options
author | John Fultz <jfultz@wolfram.com> | 2015-08-18 10:30:10 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2015-08-18 10:30:10 -0500 |
commit | f814628b3aabef20db3320a5e58217f758fa2760 (patch) | |
tree | 85d192532fb81c8c5003a199775103c15a70d136 | |
parent | dc92d571f4f97f6420fdf1a94cc41c1d2808d71b (diff) |
Populate alphabet popup in lexicon dialog.
Moved Settings::populateComboFromFileNames() to be a
static method, then invoked it from the lexicon dialog.
-rw-r--r-- | quacker/lexicondialog.cpp | 13 | ||||
-rw-r--r-- | quacker/settings.cpp | 4 | ||||
-rw-r--r-- | quacker/settings.h | 6 |
3 files changed, 13 insertions, 10 deletions
diff --git a/quacker/lexicondialog.cpp b/quacker/lexicondialog.cpp index f812eed..9d1998c 100644 --- a/quacker/lexicondialog.cpp +++ b/quacker/lexicondialog.cpp @@ -23,6 +23,7 @@ #include "lexicondialog.h" #include "customqsettings.h" +#include "settings.h" #include "geometry.h" @@ -60,7 +61,7 @@ LexiconDialog::LexiconDialog(QWidget *parent, const QString &originalName) : QDi Geometry::setupInnerLayout(addRemoveWordsRow); QHBoxLayout * buttonRow = new QHBoxLayout; Geometry::setupInnerLayout(buttonRow); - QGroupBox * lexiconInformationGroup = new QGroupBox(tr("Lexicon information:")); + QGroupBox * lexiconInformationGroup = new QGroupBox(tr("Lexicon information")); QVBoxLayout * lexiconInformationLayout = new QVBoxLayout(lexiconInformationGroup); // build the layout @@ -97,6 +98,8 @@ LexiconDialog::LexiconDialog(QWidget *parent, const QString &originalName) : QDi connect(m_deleteLexicon, SIGNAL(clicked()), this, SLOT(deleteLexicon())); setWindowTitle(tr("Configure Lexicon - Quackle")); + + Settings::populateComboFromFilenames(m_alphabetCombo, "alphabets", ""); updateLexiconInformation(); // sync game board with control states and draw board @@ -125,10 +128,10 @@ void LexiconDialog::accept() void LexiconDialog::updateLexiconInformation() { QString text; - text.append(tr("File name:")); - text.append(tr("\n\nFile size:")); - text.append(tr("\n\nWord count:")); - text.append(tr("\n\nLexicon hash:")); + text.append(tr("File name: ")); + text.append(tr("\n\nFile size: ")); + text.append(tr("\n\nWord count: ")); + text.append(tr("\n\nLexicon hash: ")); m_lexiconInformation->setText(text); } diff --git a/quacker/settings.cpp b/quacker/settings.cpp index c516b91..3c42a39 100644 --- a/quacker/settings.cpp +++ b/quacker/settings.cpp @@ -476,10 +476,10 @@ void Settings::editTheme() void Settings::populateComboFromFilenames(QComboBox* combo, const QString &path, const QString &label) { QStringList fileList; - QDir dir(m_appDataDir); + QDir dir(self()->m_appDataDir); if (dir.cd(path)) fileList << dir.entryList(QDir::Files | QDir::Readable, QDir::Name); - dir = QDir(m_userDataDir); + dir = QDir(self()->m_userDataDir); if (dir.cd(path)) fileList << dir.entryList(QDir::Files | QDir::Readable, QDir::Name); diff --git a/quacker/settings.h b/quacker/settings.h index ee1b59a..cee0562 100644 --- a/quacker/settings.h +++ b/quacker/settings.h @@ -39,6 +39,9 @@ public: static Settings *self(); + // load up an item list based on a list of filenames + static void populateComboFromFilenames(QComboBox* combo, const QString &path, const QString &label); + signals: void refreshViews(); @@ -91,9 +94,6 @@ private: // populate the popup based on what's in QSettings void loadBoardNameCombo(); - // load up an item list based on a list of filenames - void populateComboFromFilenames(QComboBox* combo, const QString &path, const QString &label); - static Settings *m_self; }; |