diff --git a/qt/dic_wizard.cpp b/qt/dic_wizard.cpp index 7d3dabe..050cb02 100644 --- a/qt/dic_wizard.cpp +++ b/qt/dic_wizard.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "dic_wizard.h" #include "qtcommon.h" @@ -72,6 +74,19 @@ WizardInfoPage::WizardInfoPage(QWidget *parent) : QWizardPage(parent) registerField("dicName*", editDicName); registerField("genDic*", editGenDic); registerField("wordList*", editWordList); + + // Auto-completion on the paths + QCompleter *completer1 = new QCompleter(this); + QFileSystemModel *model1 = new QFileSystemModel(this); + model1->setRootPath(QDir::currentPath()); + completer1->setModel(model1); + editGenDic->setCompleter(completer1); + + QCompleter *completer2 = new QCompleter(this); + QFileSystemModel *model2 = new QFileSystemModel(this); + model2->setRootPath(QDir::currentPath()); + completer2->setModel(model2); + editWordList->setCompleter(completer2); } diff --git a/qt/prefs_dialog.cpp b/qt/prefs_dialog.cpp index 71cf127..7b4a53f 100644 --- a/qt/prefs_dialog.cpp +++ b/qt/prefs_dialog.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include "prefs_dialog.h" #include "game_exception.h" @@ -61,6 +63,13 @@ PrefsDialog::PrefsDialog(QWidget *iParent) "Use a value of -1 to disable the alert.\n" "Changing this value will reset the timer.")); + // Auto-completion on the dictionary path + QCompleter *completer = new QCompleter(this); + QFileSystemModel *model = new QFileSystemModel(completer); + model->setRootPath(QDir::currentPath()); + completer->setModel(model); + lineEditIntfDicPath->setCompleter(completer); + try { // Interface settings