diff --git a/CommonWindow.h b/CommonWindow.h index d15da29..bb2fc11 100644 --- a/CommonWindow.h +++ b/CommonWindow.h @@ -15,6 +15,7 @@ public: CommonWindow() = default; ~CommonWindow() = default; protected: + virtual void connections()=0; unique_ptr selectionBox; unique_ptr actionButton; unique_ptr mainLayout; diff --git a/KeyManagementWindow.cpp b/KeyManagementWindow.cpp index cbfd923..a5d0a60 100644 --- a/KeyManagementWindow.cpp +++ b/KeyManagementWindow.cpp @@ -103,7 +103,4 @@ void KeyManagementWindow::generation() gk.keyMove(); gk.keyDump(); } -void KeyManagementWindow::exitApplication() -{ - this->hide(); -} +void KeyManagementWindow::exitApplication() { this->hide(); } diff --git a/PasswordManagementWindow.cpp b/PasswordManagementWindow.cpp index 4224ff8..b83447f 100644 --- a/PasswordManagementWindow.cpp +++ b/PasswordManagementWindow.cpp @@ -14,16 +14,24 @@ void PasswordManagementWindow::setupWindow() selectionBox=unique_ptr{new QComboBox}; actionButton=unique_ptr{new QPushButton{"i3"}}; + closeButton=unique_ptr{new QPushButton{"close"}}; crypticText=unique_ptr{new QLineEdit}; mainLayout=unique_ptr{new QHBoxLayout}; subLayoutOne=unique_ptr{new QVBoxLayout}; subLayoutTwo=unique_ptr{new QVBoxLayout}; + subLayoutGoonOne=unique_ptr{new QVBoxLayout}; + subLayoutGoonTwo=unique_ptr{new QVBoxLayout}; + + subLayoutGoonOne.get()->addWidget(selectionBox.get()); + subLayoutGoonOne.get()->addWidget(actionButton.get()); + subLayoutGoonTwo.get()->addWidget(crypticText.get()); + subLayoutGoonTwo.get()->addWidget(closeButton.get()); + subLayoutOne.get()->addWidget(elementView.get()); - subLayoutTwo.get()->addWidget(selectionBox.get()); - subLayoutTwo.get()->addWidget(actionButton.get()); - subLayoutTwo.get()->addWidget(crypticText.get()); + subLayoutTwo.get()->addLayout(subLayoutGoonOne.get()); + subLayoutTwo.get()->addLayout(subLayoutGoonTwo.get()); mainLayout.get()->addLayout(subLayoutOne.get()); mainLayout.get()->addLayout(subLayoutTwo.get()); @@ -37,5 +45,6 @@ void PasswordManagementWindow::setupWindow() } void PasswordManagementWindow::connections() { - + QObject::connect(closeButton.get(), SIGNAL(clicked()), this, SLOT(exitApplication())); } +void PasswordManagementWindow::exitApplication() { this->hide(); } diff --git a/PasswordManagementWindow.h b/PasswordManagementWindow.h index c54d593..5819d8d 100644 --- a/PasswordManagementWindow.h +++ b/PasswordManagementWindow.h @@ -18,5 +18,6 @@ private: unique_ptr passwordField; private slots: + void exitApplication(); }; #endif