MainWindow::MainWindow( QWidget * parent ) : QWidget( parent ),m_ui( new Ui::MainWindow ),m_handle( nullptr ) { m_ui->setupUi( this ) ; this->setFixedSize( this->size() ) ; m_ui->lineEditKey->setEchoMode( QLineEdit::Password ) ; this->setWindowIcon( QIcon( ":/default.png" ) ) ; //m_ui->pbKeyFile->setIcon( QIcon( QString( ":/default.png" ) ) ); connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( m_ui->pbOpen,SIGNAL( clicked() ),this,SLOT( pbOpen() ) ) ; connect( m_ui->pbKeyFile,SIGNAL( clicked() ),this,SLOT( pbKeyFile() ) ) ; m_ui->lineEditKey->setFocus() ; m_working = false ; m_requireKey = false ; m_requireKeyFile = true ; QAction * ac = new QAction( this ) ; QList<QKeySequence> keys ; keys.append( Qt::Key_Enter ) ; keys.append( Qt::Key_Return ) ; ac->setShortcuts( keys ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( defaultButton() ) ) ; this->addAction( ac ) ; m_findExecutable = []( QVector<QString>& exe ){ if( exe.isEmpty() ){ return QString() ; } QString e ; for( auto& it : exe ){ auto _not_found = [&]( const char * path ){ e = path + it ; bool r = QFile::exists( e ) ; if( r ){ it = e ; } return r == false ; } ; if( _not_found( "/usr/local/bin/" ) ){ if( _not_found( "/usr/bin/" ) ){ if( _not_found( "/usr/sbin/" ) ){ return it ; } } } } return QString() ; } ; }
managevolumeheader::managevolumeheader( QWidget * parent ) : QDialog( parent ), m_ui( new Ui::managevolumeheader ) { m_ui->setupUi( this ) ; this->setFont( parent->font() ) ; this->setFixedSize( this->size() ) ; //m_ui->pbOpenFolder->setIcon( QIcon( QString( ":/folder.png" ) ) ) ; m_ui->pushButtonPartition->setIcon( QIcon( ":/partition.png" ) ) ; m_ui->pushButtonFile->setIcon( QIcon( ":/file.png" ) ) ; m_ui->lineEditDevicePath->setFocus() ; connect( m_ui->pbCreate,SIGNAL( clicked() ),this,SLOT( pbCreate() ) ) ; connect( m_ui->pbOpenFolder,SIGNAL( clicked() ),this,SLOT( pbOpenLuksHeaderBackUp() ) ) ; connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( m_ui->pushButtonFile,SIGNAL( clicked() ),this,SLOT( pbOpenFile() ) ) ; connect( m_ui->pushButtonPartition,SIGNAL( clicked() ),this,SLOT( pbOpenPartition() ) ) ; connect( m_ui->lineEditDevicePath,SIGNAL( textChanged( QString ) ),this,SLOT( backUpHeaderNameChange( QString ) ) ) ; connect( m_ui->rbKey,SIGNAL( toggled( bool ) ),this,SLOT( rbKeyToggled( bool ) ) ) ; connect( m_ui->pBKeyFile,SIGNAL( clicked() ),this,SLOT( pbKeyFile() ) ) ; connect( m_ui->rbTrueCryptHeader,SIGNAL( toggled( bool ) ),this,SLOT( rbTrueCryptVolume( bool ) ) ) ; m_OperationInProgress = false ; m_trueCryptWarning = false ; this->enableTrueCrypt( false ) ; this->installEventFilter( this ) ; m_ui->groupBox_2->setEnabled( false ) ; m_ui->rbFDETrueCrypt->setEnabled( false ) ; m_ui->rbNormalTrueCrypt->setEnabled( false ) ; m_ui->rbSystemTrueCrypt->setEnabled( false ) ; #if TCPLAY_NEW_API m_ui->rbTrueCryptHeader->setEnabled( true ) ; #else m_ui->rbTrueCryptHeader->setEnabled( false ) ; #endif }
cryptfiles::cryptfiles( QWidget * parent ) :QDialog( parent ),m_ui( new Ui::cryptfiles ) { m_ui->setupUi( this ) ; this->setFont( parent->font() ) ; this->setFixedSize( this->size() ) ; m_ui->progressBar->setMinimum( 0 ) ; m_ui->progressBar->setMaximum( 100 ) ; m_ui->progressBar->setValue( 0 ) ; m_ui->pbOpenFolder->setIcon( QIcon( ":/folder.png" ) ) ; m_ui->pushButtonFile->setIcon( QIcon( ":/file.png" ) ) ; connect( m_ui->pbCreate,SIGNAL( clicked() ),this,SLOT( pbCreate() ) ) ; connect( m_ui->pushButtonFile,SIGNAL( clicked() ),this,SLOT( pbOpenFile() ) ) ; connect( m_ui->pbOpenFolder,SIGNAL( clicked() ),this,SLOT( pbOpenFolder() ) ) ; connect( m_ui->comboBox,SIGNAL( activated( int ) ),this,SLOT( cbChanged( int ) ) ) ; connect( m_ui->lineEditSourcePath,SIGNAL( textChanged( QString ) ),this,SLOT( sourceTextChanged( QString ) ) ) ; connect( m_ui->pushButtonKeyFile,SIGNAL( clicked() ),this,SLOT( pbKeyFile() ) ) ; connect( m_ui->pushButtonCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( this,SIGNAL( progressUpdate( int ) ),this,SLOT( progressBarUpdate( int ) ) ) ; this->cbChanged( 0 ) ; m_OperationInProgress = false ; m_ui->lineEditPass_2->setEchoMode( QLineEdit::Password ) ; m_ui->lineEditSourcePath->setFocus() ; m_ui->lineEditDestinationPath->setText( QString() ) ; m_ui->lineEditDestinationPath->setEnabled( false ) ; m_ui->lineEditSourcePath->setEnabled( false ) ; this->installEventFilter( this ) ; }
MainWindow::MainWindow( QWidget * parent ) : QWidget( parent ),m_ui( new Ui::MainWindow ) { m_ui->setupUi( this ) ; m_ui->lineEditKey->setEchoMode( QLineEdit::Password ) ; this->setWindowIcon( QIcon( QString( ":/keyfile.png" ) ) ) ; m_ui->pbKeyFile->setIcon( QIcon( QString( ":/keyfile.png" ) ) ) ; QAction * ac = new QAction( this ) ; QList<QKeySequence> keys ; keys.append( Qt::Key_Enter ) ; keys.append( Qt::Key_Return ) ; ac->setShortcuts( keys ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( defaultButton() ) ) ; this->addAction( ac ) ; connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( m_ui->pbOpen,SIGNAL( clicked() ),this,SLOT( pbOpen() ) ) ; connect( m_ui->pbKeyFile,SIGNAL( clicked() ),this,SLOT( pbKeyFile() ) ) ; this->SetFocus() ; }