From a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Wed, 25 Mar 2015 10:15:50 +0100 Subject: First commit of IT-Sicherheit --- src/tabwidgetselectalgorithm.cpp | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/tabwidgetselectalgorithm.cpp (limited to 'src/tabwidgetselectalgorithm.cpp') 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 )); +} -- cgit v1.2.3-70-g09d2