summaryrefslogtreecommitdiffstats
path: root/src/tabwidgetselectalgorithm.cpp
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 10:15:50 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 10:33:32 +0100
commita1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 (patch)
tree859befb5df101432b7388e1562f90a01c6d8e238 /src/tabwidgetselectalgorithm.cpp
downloadIT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.tar.gz
IT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.zip
First commit of IT-Sicherheit
Diffstat (limited to 'src/tabwidgetselectalgorithm.cpp')
-rw-r--r--src/tabwidgetselectalgorithm.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/tabwidgetselectalgorithm.cpp b/src/tabwidgetselectalgorithm.cpp
new file mode 100644
index 0000000..a3d85af
--- /dev/null
+++ b/src/tabwidgetselectalgorithm.cpp
@@ -0,0 +1,80 @@
+#include "tabwidgetselectalgorithm.h"
+
+TabWidgetSelectAlgorithm::TabWidgetSelectAlgorithm(QWidget *parent) :
+ QTabWidget(parent)
+{
+ //Create the Widgets for Algorithm-Selection
+ m_nullCipher = new QWidget(this);
+ m_symmetric = new TabSymmetric(this);
+ m_asymmetric = new TabAsymmetric(this);
+ m_hybrid = new TabHybrid(this);
+
+ //Add those Widgets as Tabs
+ addTab(m_nullCipher, "NullCipher");
+ addTab(m_symmetric, "Symmetric");
+ addTab(m_asymmetric, "Asymmetric");
+ addTab(m_hybrid, "Hybrid");
+
+
+ connect( this, SIGNAL(currentChanged(int)),
+ this, SLOT(oncurrentChanged_triggered(int)));
+
+ //Send Selection from SubTabs on: Ciphers
+ connect( m_symmetric, SIGNAL(cipherChanged(int)),
+ this, SIGNAL(cipherChanged(int)) );
+ connect( m_asymmetric, SIGNAL(cipherChanged(int)),
+ this, SIGNAL(cipherChanged(int)) );
+ connect( m_hybrid, SIGNAL(cipherChanged(int)),
+ this, SIGNAL(cipherChanged(int)) );
+
+ //Send Selection from SubTabs on: KeyLength
+ connect( m_symmetric, SIGNAL(keyLengthChanged(int, bool)),
+ this, SIGNAL(keyLengthChanged(int,bool)));
+ connect( m_asymmetric, SIGNAL(keyLengthChanged(int, bool)),
+ this, SIGNAL(keyLengthChanged(int,bool)));
+ connect( m_hybrid, SIGNAL(keyLengthChanged(int, bool)),
+ this, SIGNAL(keyLengthChanged(int,bool)));
+}
+
+
+
+//public slots:
+void TabWidgetSelectAlgorithm::onNullCipher_selected()
+{
+ setCurrentWidget(m_nullCipher);
+}
+
+void TabWidgetSelectAlgorithm::onSymmetric_selected()
+{
+ setCurrentWidget(m_symmetric);
+}
+
+void TabWidgetSelectAlgorithm::onAsymmetric_selected()
+{
+ setCurrentWidget(m_asymmetric);
+}
+
+void TabWidgetSelectAlgorithm::onHybrid_selected()
+{
+ setCurrentWidget(m_hybrid);
+}
+
+
+
+
+// private slots:
+void TabWidgetSelectAlgorithm::oncurrentChanged_triggered(int index)
+{
+ QString tabName;
+
+ if( currentWidget() == m_nullCipher )
+ tabName = "NullCipher";
+ else if( currentWidget() == m_symmetric )
+ tabName = "Symmetric";
+ else if( currentWidget() == m_asymmetric )
+ tabName = "Asymmetric";
+ else if( currentWidget() == m_hybrid )
+ tabName = "Hybrid";
+
+ emit (currentTabChanged( tabName ));
+}