Added vacant Password Management Window
This commit is contained in:
+12
-11
@@ -10,29 +10,30 @@ public:
|
||||
Conversions() = default;
|
||||
~Conversions()=default;
|
||||
|
||||
std::string cstringToString(char[], const int);
|
||||
//char stringToChar(const string&);
|
||||
template<typename C=char,typename S=std::string>
|
||||
S cstringToString(const C[], const int);
|
||||
template<typename C=char,typename S=std::string>
|
||||
C stringToChar(const S&);
|
||||
private:
|
||||
};
|
||||
|
||||
std::string Conversions::cstringToString(char tmp[], const int size)
|
||||
template<typename C=char,typename S=std::string>
|
||||
S Conversions::cstringToString(const C tmp[], const int size)
|
||||
{
|
||||
std::string tmpString{};
|
||||
std::stringstream cToS{};
|
||||
for (auto index=0; index!=size; ++index)
|
||||
cToS<<tmp[index];
|
||||
std::string tmpString{};
|
||||
cToS>>tmpString;
|
||||
return tmpString;
|
||||
}
|
||||
/**
|
||||
char Conversions::stringToChar(const string& tmp)
|
||||
template<typename C=char,typename S=std::string>
|
||||
C Conversions::stringToChar(const S& tmp)
|
||||
{
|
||||
std::stringstream sToC{};
|
||||
for (auto tmpElements:tmp)
|
||||
sToC<<tmpElements;
|
||||
char tmpChar{};
|
||||
stringstream sToC{};
|
||||
for (auto index=0; index!=tmp.size(); ++index)
|
||||
sToC << tmpChar;
|
||||
sToC>>tmpChar;
|
||||
return tmpChar;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (3.1) Fri Mar 24 12:16:30 2017
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = EncryptedMessaging
|
||||
QT += core gui
|
||||
QT += widgets
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
HEADERS += Decryption.h Encryption.h GenerateKeys.h MessagingControls.h Cryption.h KeyManagementWindow.h KeyRetrieval.h Conversions.h CommonWindow.h ViewingWindow.h
|
||||
SOURCES += Decryption.cpp \
|
||||
Encryption.cpp \
|
||||
Cryption.cpp \
|
||||
KeyManagementWindow.cpp \
|
||||
KeyRetrieval.cpp \
|
||||
GenerateKeys.cpp \
|
||||
Main.cpp \
|
||||
MessagingControls.cpp
|
||||
+22
-15
@@ -12,6 +12,25 @@
|
||||
#include"Conversions.h"
|
||||
|
||||
KeyManagementWindow::KeyManagementWindow(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setupWindow();
|
||||
connections();
|
||||
}
|
||||
|
||||
|
||||
void KeyManagementWindow::setContentsOfComboBox()
|
||||
{
|
||||
KeyRetrieval kr{};
|
||||
std::vector<int> c{kr.codeCharacterStructure()};
|
||||
|
||||
for (auto index = 0u; index!=c.size(); ++index)
|
||||
{
|
||||
std::string ch{static_cast<char>(c[index])};
|
||||
QString bl = QString::fromStdString(ch);
|
||||
selectionBox.get()->addItem(bl);
|
||||
}
|
||||
}
|
||||
void KeyManagementWindow::setupWindow()
|
||||
{
|
||||
windowWidth = 450;
|
||||
windowHeight = 450;
|
||||
@@ -54,25 +73,13 @@ KeyManagementWindow::KeyManagementWindow(QWidget* parent) : QDialog(parent)
|
||||
setFixedHeight(windowHeight);
|
||||
|
||||
setWindowTitle("Key Management Window");
|
||||
|
||||
}
|
||||
void KeyManagementWindow::connections()
|
||||
{
|
||||
QObject::connect(selectionBox.get(), SIGNAL(currentIndexChanged(int)), SLOT(test()));
|
||||
QObject::connect(generateNewKeys.get(), SIGNAL(clicked()), this, SLOT(generation()));
|
||||
QObject::connect(closeButton.get(), SIGNAL(clicked()), this, SLOT(exitApplication()));
|
||||
}
|
||||
|
||||
|
||||
void KeyManagementWindow::setContentsOfComboBox()
|
||||
{
|
||||
KeyRetrieval kr{};
|
||||
std::vector<int> c{kr.codeCharacterStructure()};
|
||||
|
||||
for (auto index = 0u; index!=c.size(); ++index)
|
||||
{
|
||||
std::string ch{static_cast<char>(c[index])};
|
||||
QString bl = QString::fromStdString(ch);
|
||||
selectionBox.get()->addItem(bl);
|
||||
}
|
||||
}
|
||||
void KeyManagementWindow::test()
|
||||
{
|
||||
std::string emp{"d"};
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
#define KEYMANAGEMENTWINDOW_H
|
||||
|
||||
#include<QDialog>
|
||||
#include<QVBoxLayout>
|
||||
#include<QHBoxLayout>
|
||||
#include<QComboBox>
|
||||
#include<QLineEdit>
|
||||
#include<QPushButton>
|
||||
#include<memory>
|
||||
#include"CommonWindow.h"
|
||||
#include"ViewingWindow.h"
|
||||
@@ -17,13 +12,13 @@ class KeyManagementWindow : public QDialog, public CommonWindow, public ViewingW
|
||||
public:
|
||||
KeyManagementWindow(QWidget* parent = 0);
|
||||
~KeyManagementWindow() = default;
|
||||
|
||||
void setContentsOfComboBox();
|
||||
private slots:
|
||||
void test();
|
||||
void generation();
|
||||
void exitApplication();
|
||||
private:
|
||||
void setContentsOfComboBox();
|
||||
void setupWindow();
|
||||
void connections();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+15
-6
@@ -6,15 +6,16 @@
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
windowHeight = 450;
|
||||
windowWidth = 450;
|
||||
kh = unique_ptr<KeyManagementWindow>{new KeyManagementWindow};
|
||||
ph = unique_ptr<PasswordManagementWindow>{new PasswordManagementWindow};
|
||||
setupMainWindow();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::setupMainWindow()
|
||||
{
|
||||
kh = unique_ptr<KeyManagementWindow>{new KeyManagementWindow};
|
||||
windowHeight = 450;
|
||||
windowWidth = 450;
|
||||
textForCryption = unique_ptr<QTextEdit>{new QTextEdit{}};
|
||||
actionButton = unique_ptr<QPushButton>{new QPushButton(tr("encrypt"))};
|
||||
selectionBox = unique_ptr<QComboBox>{new QComboBox{}};
|
||||
@@ -37,12 +38,10 @@ void MainWindow::setupMainWindow()
|
||||
|
||||
createMenus();
|
||||
|
||||
QObject::connect(closeApplication.get(), SIGNAL(triggered()), this, SLOT(exitApplication()));
|
||||
QObject::connect(keyEdit.get(), SIGNAL(triggered()), this, SLOT(keyManagementWindow()));
|
||||
|
||||
setWindowTitle("Encryption Decryption Messaging");
|
||||
setFixedHeight(windowHeight);
|
||||
setFixedWidth(windowWidth);
|
||||
connections();
|
||||
}
|
||||
void MainWindow::createMenus()
|
||||
{
|
||||
@@ -54,9 +53,18 @@ void MainWindow::createMenus()
|
||||
|
||||
keyEdit = unique_ptr<QAction>{new QAction(new QObject(nullptr))};
|
||||
keyEdit.get()->setText("Key Management");
|
||||
passwordManage = unique_ptr<QAction>{new QAction{new QObject{nullptr}}};
|
||||
passwordManage.get()->setText("PasswordManagement");
|
||||
|
||||
fileMenu.get()->addAction(closeApplication.get());
|
||||
editMenu.get()->addAction(keyEdit.get());
|
||||
editMenu.get()->addAction(passwordManage.get());
|
||||
}
|
||||
void MainWindow::connections()
|
||||
{
|
||||
QObject::connect(closeApplication.get(), SIGNAL(triggered()), this, SLOT(exitApplication()));
|
||||
QObject::connect(keyEdit.get(), SIGNAL(triggered()), this, SLOT(keyManagementWindow()));
|
||||
QObject::connect(passwordManage.get(), SIGNAL(triggered()), this, SLOT(passwordManageWindow()));
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +97,7 @@ void MainWindow::determineCryption()
|
||||
}
|
||||
}
|
||||
void MainWindow::keyManagementWindow() { kh.get()->show(); }
|
||||
void MainWindow::passwordManageWindow() { ph.get()->show(); }
|
||||
void MainWindow::exitApplication() { exit(0); }
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include<QWidget>
|
||||
#include<memory>
|
||||
#include"KeyManagementWindow.h"
|
||||
#include"PasswordManagementWindow.h"
|
||||
#include"CommonWindow.h"
|
||||
|
||||
|
||||
@@ -29,10 +30,12 @@ private slots:
|
||||
void changeCryptionType();
|
||||
void determineCryption();
|
||||
void keyManagementWindow();
|
||||
void passwordManageWindow();
|
||||
void exitApplication();
|
||||
private:
|
||||
void setupMainWindow();
|
||||
void createMenus();
|
||||
void connections();
|
||||
|
||||
unique_ptr<QVBoxLayout> buttonLayout;
|
||||
|
||||
@@ -52,8 +55,10 @@ private:
|
||||
unique_ptr<QMenu> editMenu;
|
||||
unique_ptr<QAction> closeApplication;
|
||||
unique_ptr<QAction> keyEdit;
|
||||
unique_ptr<QAction> passwordManage;
|
||||
|
||||
unique_ptr<KeyManagementWindow> kh;
|
||||
unique_ptr<PasswordManagementWindow> ph;
|
||||
|
||||
std::string grabCryptionText();
|
||||
|
||||
|
||||
@@ -1,6 +1,41 @@
|
||||
#include"PasswordManagementWindow.h"
|
||||
|
||||
PasswordManagementWindow::PasswordManagementWindow(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setupWindow();
|
||||
}
|
||||
|
||||
void PasswordManagementWindow::setupWindow()
|
||||
{
|
||||
windowWidth=450;
|
||||
windowHeight=450;
|
||||
|
||||
elementView=unique_ptr<QTableView>{new QTableView};
|
||||
|
||||
selectionBox=unique_ptr<QComboBox>{new QComboBox};
|
||||
actionButton=unique_ptr<QPushButton>{new QPushButton{"i3"}};
|
||||
crypticText=unique_ptr<QLineEdit>{new QLineEdit};
|
||||
|
||||
mainLayout=unique_ptr<QHBoxLayout>{new QHBoxLayout};
|
||||
subLayoutOne=unique_ptr<QVBoxLayout>{new QVBoxLayout};
|
||||
subLayoutTwo=unique_ptr<QVBoxLayout>{new QVBoxLayout};
|
||||
|
||||
subLayoutOne.get()->addWidget(elementView.get());
|
||||
subLayoutTwo.get()->addWidget(selectionBox.get());
|
||||
subLayoutTwo.get()->addWidget(actionButton.get());
|
||||
subLayoutTwo.get()->addWidget(crypticText.get());
|
||||
|
||||
mainLayout.get()->addLayout(subLayoutOne.get());
|
||||
mainLayout.get()->addLayout(subLayoutTwo.get());
|
||||
|
||||
setLayout(mainLayout.get());
|
||||
|
||||
setFixedWidth(windowWidth);
|
||||
setFixedHeight(windowHeight);
|
||||
|
||||
connections();
|
||||
}
|
||||
void PasswordManagementWindow::connections()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
#ifndef PASSWORDMANAGEMENTWINDOW_H_
|
||||
#define PASSWORDMANAGEMENTWINDOW_H_
|
||||
|
||||
#include<QDialog>
|
||||
#include"CommonWindow.h"
|
||||
#include"ViewingWindow.h"
|
||||
|
||||
class PasswordManagementWindow : public QDialog, public CommonWindow, public ViewingWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PasswordManagementWindow(QWidget* parent=0);
|
||||
~PasswordManagementWindow()=default;
|
||||
|
||||
private:
|
||||
void setupWindow();
|
||||
void connections();
|
||||
|
||||
unique_ptr<QLineEdit> passwordField;
|
||||
private slots:
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user