]> vaikene.ee Git - evaf/blobdiff - src/apps/PswGen/GUI/gui.cpp
Modified the PswGen application to follow the tutorial.
[evaf] / src / apps / PswGen / GUI / gui.cpp
index 34bd2f0028d89e69de8a8f51337257d492c70466..dad6f691c75df8418d82e71175856f23add5e4d3 100644 (file)
@@ -40,6 +40,8 @@ Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, PswGen::GUI::Module)
 
 using namespace eVaf::PswGen::GUI;
 
+int const Module::DefaultPasswordLength = 16;
+
 Module::Module()
     : Plugins::iPlugin()
     , mReady(false)
@@ -100,7 +102,7 @@ bool Module::init(QString const & args)
     wLength = new QSpinBox;
     l->setBuddy(wLength);
     wLength->setRange(0, mGenerator->maxLength());
-    wLength->setValue(PswGen::iGenerator::DEFAULT_LENGTH);
+    wLength->setValue(DefaultPasswordLength);
     wLength->setSpecialValueText(tr("Maximum", VER_MODULE_NAME_STR));
     g->addWidget(wLength, 2, 1);
 
@@ -162,7 +164,7 @@ void Module::generateClicked()
 {
     if (wMasterPassword->text().isEmpty() || wName->text().isEmpty())
         return;
-    wPassword->setText(mGenerator->generatePassword(wName->text().toLatin1().constData(), wMasterPassword->text().toLatin1().constData(), wLength->value()));
+    wPassword->setText(mGenerator->generatePassword(wName->text(), wMasterPassword->text(), wLength->value()));
     wCopy->setEnabled(true);
 }