curvedsalsa

changeset 11:ff31768c7d47

started gui :)
author Konrad Miller <konrad@miller-online.eu>
date Tue, 02 Dec 2008 15:14:40 +0100
parents e8fcefa25d42
children 930cb9f40fbf
files curvedsalsa.cpp gui/CurvedSalsaDialog/curvedsalsagui.ui gui/curvedsalsadialog.cpp gui/curvedsalsadialog.h gui/gui.pro gui/main.cpp
diffstat 6 files changed, 201 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/curvedsalsa.cpp	Thu Nov 27 18:51:16 2008 +0100
     1.2 +++ b/curvedsalsa.cpp	Tue Dec 02 15:14:40 2008 +0100
     1.3 @@ -23,8 +23,8 @@
     1.4  std::string b64encode( byte in[32] );
     1.5  void b64decode( byte out[32], const std::string in );
     1.6  bool hash( byte* out, const std::string &in );
     1.7 -bool encryptFile(  const std::string &outfile, const std::string &infile, const std::string &passphrase, const std::string &publicKey );
     1.8 -bool decryptFile(  const std::string &outfile, const std::string &infile, const std::string &passphrase );
     1.9 +bool encryptFile( const std::string &outfile, const std::string &infile, const std::string &passphrase, const std::string &publicKey );
    1.10 +bool decryptFile( const std::string &outfile, const std::string &infile, const std::string &passphrase );
    1.11  std::string prompt_password( const std::string &what, bool hidden = false );
    1.12  
    1.13  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gui/CurvedSalsaDialog/curvedsalsagui.ui	Tue Dec 02 15:14:40 2008 +0100
     2.3 @@ -0,0 +1,116 @@
     2.4 +<ui version="4.0" >
     2.5 + <class>CurvedSalsaDialog</class>
     2.6 + <widget class="QWidget" name="CurvedSalsaDialog" >
     2.7 +  <property name="geometry" >
     2.8 +   <rect>
     2.9 +    <x>0</x>
    2.10 +    <y>0</y>
    2.11 +    <width>400</width>
    2.12 +    <height>300</height>
    2.13 +   </rect>
    2.14 +  </property>
    2.15 +  <property name="sizePolicy" >
    2.16 +   <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
    2.17 +    <horstretch>0</horstretch>
    2.18 +    <verstretch>0</verstretch>
    2.19 +   </sizepolicy>
    2.20 +  </property>
    2.21 +  <property name="windowTitle" >
    2.22 +   <string>Form</string>
    2.23 +  </property>
    2.24 +  <layout class="QGridLayout" name="gridLayout_4" >
    2.25 +   <item row="0" column="0" >
    2.26 +    <layout class="QGridLayout" name="gridLayout_3" >
    2.27 +     <item row="0" column="0" >
    2.28 +      <layout class="QGridLayout" name="gridLayout" >
    2.29 +       <item row="0" column="0" >
    2.30 +        <widget class="QLabel" name="label" >
    2.31 +         <property name="text" >
    2.32 +          <string>&amp;Source File:</string>
    2.33 +         </property>
    2.34 +         <property name="buddy" >
    2.35 +          <cstring>inFileLine</cstring>
    2.36 +         </property>
    2.37 +        </widget>
    2.38 +       </item>
    2.39 +       <item row="0" column="1" >
    2.40 +        <widget class="QLineEdit" name="inFileLine" />
    2.41 +       </item>
    2.42 +       <item row="0" column="2" >
    2.43 +        <widget class="QPushButton" name="inFileButton" >
    2.44 +         <property name="text" >
    2.45 +          <string>&amp;Browse</string>
    2.46 +         </property>
    2.47 +        </widget>
    2.48 +       </item>
    2.49 +       <item row="1" column="0" >
    2.50 +        <widget class="QLabel" name="label_2" >
    2.51 +         <property name="text" >
    2.52 +          <string>&amp;Target File:</string>
    2.53 +         </property>
    2.54 +         <property name="buddy" >
    2.55 +          <cstring>outFileLine</cstring>
    2.56 +         </property>
    2.57 +        </widget>
    2.58 +       </item>
    2.59 +       <item row="1" column="1" >
    2.60 +        <widget class="QLineEdit" name="outFileLine" />
    2.61 +       </item>
    2.62 +       <item row="1" column="2" >
    2.63 +        <widget class="QPushButton" name="outFileButton" >
    2.64 +         <property name="text" >
    2.65 +          <string>B&amp;rowse</string>
    2.66 +         </property>
    2.67 +        </widget>
    2.68 +       </item>
    2.69 +      </layout>
    2.70 +     </item>
    2.71 +    </layout>
    2.72 +   </item>
    2.73 +   <item row="1" column="0" >
    2.74 +    <widget class="QGroupBox" name="Operation" >
    2.75 +     <property name="title" >
    2.76 +      <string>&amp;Operation</string>
    2.77 +     </property>
    2.78 +     <layout class="QGridLayout" name="gridLayout_5" >
    2.79 +      <item row="0" column="0" >
    2.80 +       <layout class="QGridLayout" name="gridLayout_2" >
    2.81 +        <item row="0" column="0" >
    2.82 +         <widget class="QRadioButton" name="encrypt" >
    2.83 +          <property name="text" >
    2.84 +           <string>&amp;Encrypt</string>
    2.85 +          </property>
    2.86 +         </widget>
    2.87 +        </item>
    2.88 +        <item row="1" column="0" >
    2.89 +         <widget class="QRadioButton" name="decrypt" >
    2.90 +          <property name="text" >
    2.91 +           <string>&amp;Decrypt</string>
    2.92 +          </property>
    2.93 +         </widget>
    2.94 +        </item>
    2.95 +       </layout>
    2.96 +      </item>
    2.97 +     </layout>
    2.98 +    </widget>
    2.99 +   </item>
   2.100 +   <item row="2" column="0" >
   2.101 +    <widget class="QPushButton" name="okButton" >
   2.102 +     <property name="text" >
   2.103 +      <string>&amp;Ok</string>
   2.104 +     </property>
   2.105 +    </widget>
   2.106 +   </item>
   2.107 +  </layout>
   2.108 + </widget>
   2.109 + <tabstops>
   2.110 +  <tabstop>inFileLine</tabstop>
   2.111 +  <tabstop>inFileButton</tabstop>
   2.112 +  <tabstop>outFileLine</tabstop>
   2.113 +  <tabstop>outFileButton</tabstop>
   2.114 +  <tabstop>encrypt</tabstop>
   2.115 +  <tabstop>decrypt</tabstop>
   2.116 + </tabstops>
   2.117 + <resources/>
   2.118 + <connections/>
   2.119 +</ui>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/gui/curvedsalsadialog.cpp	Tue Dec 02 15:14:40 2008 +0100
     3.3 @@ -0,0 +1,29 @@
     3.4 +#include <QtGui>
     3.5 +#include <QDir>
     3.6 +#include "curvedsalsadialog.h"
     3.7 +
     3.8 +CurvedSalsaDialog::CurvedSalsaDialog( QWidget *parent ) : QDialog(parent)
     3.9 +{
    3.10 +	setupUi( this );
    3.11 +
    3.12 +	layout()->setSizeConstraint( QLayout::SetFixedSize );
    3.13 +
    3.14 +	connect( inFileButton,  SIGNAL(clicked()), this, SLOT(slot_browseInputFile()) );
    3.15 +	connect( outFileButton, SIGNAL(clicked()), this, SLOT(slot_browseOutputFile()) );
    3.16 +}
    3.17 +
    3.18 +void CurvedSalsaDialog::slot_browseInputFile()
    3.19 +{
    3.20 +	m_inFilename = QFileDialog::getOpenFileName( this, tr("Open File"), "", "All (*.*)" );
    3.21 +	inFileLine->setText( m_inFilename );	
    3.22 +}
    3.23 +
    3.24 +void CurvedSalsaDialog::slot_browseOutputFile()
    3.25 +{
    3.26 +	m_outFilename = QFileDialog::getOpenFileName( this, tr("Open File"), "", "All (*.*)" );
    3.27 +	outFileLine->setText( m_outFilename );	
    3.28 +}
    3.29 +
    3.30 +void CurvedSalsaDialog::slot_doit()
    3.31 +{
    3.32 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/gui/curvedsalsadialog.h	Tue Dec 02 15:14:40 2008 +0100
     4.3 @@ -0,0 +1,27 @@
     4.4 +#ifndef CURVEDSALSADIALOG_H 
     4.5 +#define CURVEDSALSADIALOG_H
     4.6 +
     4.7 +#include <QDialog>
     4.8 +#include "ui_curvedsalsagui.h"
     4.9 +
    4.10 +class QDir;
    4.11 +
    4.12 +class CurvedSalsaDialog : public QDialog, public Ui::CurvedSalsaDialog
    4.13 +{
    4.14 +	Q_OBJECT
    4.15 +
    4.16 +public:
    4.17 +	CurvedSalsaDialog( QWidget *parent = 0 );
    4.18 +
    4.19 +public slots:
    4.20 +	void slot_browseInputFile();
    4.21 +	void slot_browseOutputFile();
    4.22 +	void slot_doit();
    4.23 +
    4.24 +protected:
    4.25 +	QString m_inFilename;
    4.26 +	QString m_outFilename;
    4.27 +
    4.28 +};
    4.29 +
    4.30 +#endif
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gui/gui.pro	Tue Dec 02 15:14:40 2008 +0100
     5.3 @@ -0,0 +1,13 @@
     5.4 +######################################################################
     5.5 +# Automatically generated by qmake (2.01a) Di Dez 2 15:00:08 2008
     5.6 +######################################################################
     5.7 +
     5.8 +TEMPLATE = app
     5.9 +TARGET = 
    5.10 +DEPENDPATH += . CurvedSalsaDialog
    5.11 +INCLUDEPATH += .
    5.12 +
    5.13 +# Input
    5.14 +HEADERS += curvedsalsadialog.h
    5.15 +FORMS += CurvedSalsaDialog/curvedsalsagui.ui
    5.16 +SOURCES += curvedsalsadialog.cpp main.cpp
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/gui/main.cpp	Tue Dec 02 15:14:40 2008 +0100
     6.3 @@ -0,0 +1,14 @@
     6.4 +#include <QApplication>
     6.5 +#include <QDialog>
     6.6 +
     6.7 +#include "curvedsalsadialog.h"
     6.8 +
     6.9 +int main( int argc, char *argv[] )
    6.10 +{
    6.11 +	QApplication app( argc, argv );
    6.12 +	
    6.13 +	CurvedSalsaDialog dialog;
    6.14 +	dialog.show();
    6.15 +
    6.16 +	return app.exec();
    6.17 +}