diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-03-25 10:15:50 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-03-25 10:33:32 +0100 |
| commit | a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 (patch) | |
| tree | 859befb5df101432b7388e1562f90a01c6d8e238 /src/tabwidgetselectalgorithm.cpp | |
| download | IT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.tar.gz IT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.zip | |
First commit of IT-Sicherheit
Diffstat (limited to 'src/tabwidgetselectalgorithm.cpp')
| -rw-r--r-- | src/tabwidgetselectalgorithm.cpp | 80 |
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 )); +} |
