mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-29 20:34:56 +01:00
Add auto-completion on the dictionary path
This commit is contained in:
parent
84c4937d8d
commit
ea4b4396a8
2 changed files with 24 additions and 0 deletions
|
@ -28,6 +28,8 @@
|
|||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QList>
|
||||
#include <QtGui/QCompleter>
|
||||
#include <QtGui/QFileSystemModel>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtGui/QCompleter>
|
||||
#include <QtGui/QFileSystemModel>
|
||||
|
||||
#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
|
||||
|
|
Loading…
Add table
Reference in a new issue