X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Fapps%2FPswGen%2FGUI%2Fgui.cpp;h=23a3c881c2591c82d5f3a4f81a0c2051e9d9672f;hb=d50faf159f17a66fb89ea3e7878b6f56e34b9e72;hp=965d70ea7b4052fdf2f6b59f8faa269dc9634413;hpb=95547de3c87b4f0dc46b2fc53f18e7cbd1782de4;p=evaf
diff --git a/src/apps/PswGen/GUI/gui.cpp b/src/apps/PswGen/GUI/gui.cpp
index 965d70e..23a3c88 100644
--- a/src/apps/PswGen/GUI/gui.cpp
+++ b/src/apps/PswGen/GUI/gui.cpp
@@ -31,14 +31,13 @@
#include
-using namespace eVaf;
-
VER_EXPORT_VERSION_INFO()
-Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, PswGen::GUI::Module)
+Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, eVaf::PswGen::GUI::Module)
//-------------------------------------------------------------------
+using namespace eVaf;
using namespace eVaf::PswGen::GUI;
int const Module::DefaultPasswordLength = 16;
@@ -75,8 +74,11 @@ bool Module::init(QString const & args)
SdiWindow::iSdiWindow * win = evafQueryInterface("iSdiWindow");
EVAF_TEST_X(win, "No iSdiWindow interface");
+ QWidget * masterWidget = new QWidget;
+ win->addWidget(masterWidget);
+
QVBoxLayout * v = new QVBoxLayout;
- win->widget()->setLayout(v);
+ masterWidget->setLayout(v);
QGridLayout * g = new QGridLayout;
v->addLayout(g);
@@ -106,7 +108,7 @@ bool Module::init(QString const & args)
}
connect(wName, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
g->addWidget(wName, 1, 1, 1, 2);
- win->widget()->setFocusProxy(wName);
+ masterWidget->setFocusProxy(wName);
l = new QLabel(tr("&Length of the password:", VER_MODULE_NAME_STR));
l->setAlignment(Qt::AlignRight);
@@ -144,15 +146,15 @@ bool Module::init(QString const & args)
connect(wCopy, SIGNAL(clicked()), this, SLOT(copyClicked()));
h->addWidget(wCopy);
- QAction * a = new QAction(win->widget());
+ QAction * a = new QAction(masterWidget);
a->setShortcut(Qt::Key_Return);
connect(a, SIGNAL(triggered()), this, SLOT(generateClicked()));
- win->widget()->addAction(a);
+ masterWidget->addAction(a);
- a = new QAction(win->widget());
+ a = new QAction(masterWidget);
a->setShortcut(Qt::Key_Escape);
connect(a, SIGNAL(triggered()), qApp, SLOT(quit()));
- win->widget()->addAction(a);
+ masterWidget->addAction(a);
mReady = true;
@@ -187,7 +189,7 @@ void Module::generateClicked()
if (mStorage) {
QExplicitlySharedDataPointer data = mStorage->query(wName->text());
if (!data)
- data = new Storage::Data(wLength->value());
+ data = new Storage::Data(wName->text(), wLength->value());
else
data->setLength(wLength->value());
mStorage->save(wName->text(), data);