#include <QtGui>
-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;
SdiWindow::iSdiWindow * win = evafQueryInterface<SdiWindow::iSdiWindow>("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);
}
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);
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;
if (mStorage) {
QExplicitlySharedDataPointer<PswGen::Storage::Data> 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);