mountPartition::mountPartition( QWidget * parent,QTableWidget * table ) : QWidget( parent ),m_ui( new Ui::mountPartition ) { m_ui->setupUi( this ) ; m_ui->checkBoxShareMountPoint->setToolTip( utility::shareMountPointToolTip() ) ; m_table = table ; this->setFixedSize( this->size() ) ; this->setWindowFlags( Qt::Window | Qt::Dialog ) ; this->setFont( parent->font() ) ; m_ui->pbMount->setFocus() ; m_ui->checkBoxMountReadOnly->setChecked( utility::getOpenVolumeReadOnlyOption( "zuluMount-gui" ) ) ; connect( m_ui->pbOptions,SIGNAL( clicked() ),this,SLOT( pbOptions() ) ) ; connect( m_ui->pbMount,SIGNAL( clicked() ),this,SLOT( pbMount() ) ) ; connect( m_ui->pbMountFolder,SIGNAL( clicked() ),this,SLOT( pbOpenMountPath() ) ) ; connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( m_ui->checkBox,SIGNAL( stateChanged( int ) ),this,SLOT( stateChanged( int ) ) ) ; connect( m_ui->checkBoxMountReadOnly,SIGNAL( stateChanged(int) ),this,SLOT( checkBoxReadOnlyStateChanged( int ) ) ) ; m_ui->pbMountFolder->setIcon( QIcon( ":/folder.png" ) ) ; userfont F( this ) ; this->setFont( F.getFont() ) ; m_ui->pbMountFolder->setVisible( false ) ; QAction * ac = new QAction( this ) ; QKeySequence s( Qt::CTRL + Qt::Key_F ) ; ac->setShortcut( s ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( showOffSetWindowOption() ) ) ; this->addAction( ac ) ; m_menu = new QMenu( this ) ; m_menu->addAction( tr( "Set File System Options" ) ) ; m_menu->addAction( tr( "Set Volume Offset" ) ) ; connect( m_menu,SIGNAL( triggered( QAction * ) ),this,SLOT( doAction( QAction * ) ) ) ; this->installEventFilter( this ) ; }
keyDialog::keyDialog( QWidget * parent,QTableWidget * table,const volumeEntryProperties& e,std::function< void() > p,std::function< void( const QString& ) > q ) : QDialog( parent ),m_ui( new Ui::keyDialog ),m_cancel( std::move( p ) ),m_success( std::move( q ) ) { m_ui->setupUi( this ) ; m_ui->checkBoxShareMountPoint->setToolTip( utility::shareMountPointToolTip() ) ; m_table = table ; m_path = e.volumeName() ; m_working = false ; m_volumeIsEncFs = e.fileSystem() == "encfs" ; QString msg ; if( e.fileSystem() == "crypto_LUKS" ){ msg = tr( "Mount A LUKS volume in \"%1\"").arg( m_path ) ; }else{ msg = tr( "Mount An Encrypted Volume In \"%1\"").arg( m_path ) ; } this->setWindowTitle( msg ) ; m_ui->lineEditMountPoint->setText( m_path ) ; m_ui->pbOpenMountPoint->setIcon( QIcon( ":/folder.png" ) ) ; m_menu = new QMenu( this ) ; connect( m_menu,SIGNAL( triggered( QAction * ) ),this,SLOT( pbPluginEntryClicked( QAction * ) ) ) ; this->setFixedSize( this->size() ) ; this->setWindowFlags( Qt::Window | Qt::Dialog ) ; this->setFont( parent->font() ) ; m_ui->lineEditKey->setFocus() ; m_ui->checkBoxOpenReadOnly->setChecked( utility::getOpenVolumeReadOnlyOption( "zuluMount-gui" ) ) ; m_ui->pbkeyOption->setEnabled( false ) ; m_ui->lineEditKey->setEchoMode( QLineEdit::Password ) ; connect( m_ui->pbOptions,SIGNAL( clicked() ),this,SLOT( pbOptions() ) ) ; connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbCancel() ) ) ; connect( m_ui->pbOpen,SIGNAL( clicked() ),this,SLOT( pbOpen() ) ) ; connect( m_ui->pbkeyOption,SIGNAL( clicked() ),this,SLOT( pbkeyOption() ) ) ; connect( m_ui->pbOpenMountPoint,SIGNAL( clicked() ),this,SLOT( pbMountPointPath() ) ) ; connect( m_ui->checkBoxOpenReadOnly,SIGNAL( stateChanged( int ) ),this,SLOT( cbMountReadOnlyStateChanged( int ) ) ) ; connect( m_ui->cbKeyType,SIGNAL( currentIndexChanged( int ) ),this,SLOT( cbActicated( int ) ) ) ; m_ui->pbOpenMountPoint->setVisible( false ) ; m_point = utility::mountPathPostFix( m_path.split( "/" ).last() ) ; m_ui->lineEditMountPoint->setText( m_point ) ; QAction * ac = new QAction( this ) ; QKeySequence s( Qt::CTRL + Qt::Key_F ) ; ac->setShortcut( s ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( showOffSetWindowOption() ) ) ; this->addAction( ac ) ; m_menu_1 = new QMenu( this ) ; auto _add_action = [ & ]( const QString& e ){ ac = m_menu_1->addAction( e ) ; ac ->setEnabled( !m_volumeIsEncFs ) ; } ; _add_action( tr( "Set File System Options" ) ) ; _add_action( tr( "Set Volume Offset" ) ) ; _add_action( tr( "Set Volume As VeraCrypt Volume" ) ) ; _add_action( tr( "Set VeraCrypt PIM value" ) ) ; m_ui->cbKeyType->addItem( tr( "Key" ) ) ; m_ui->cbKeyType->addItem( tr( "KeyFile" ) ) ; m_ui->cbKeyType->addItem( tr( "Plugin" ) ) ; if( m_volumeIsEncFs ){ m_ui->checkBoxShareMountPoint->setEnabled( false ) ; }else{ #if VERACRYPT_SUPPORT m_ui->cbKeyType->addItem( tr( "TrueCrypt/VeraCrypt Keys" ) ) ; #else m_ui->cbKeyType->addItem( tr( "TrueCrypt keys" ) ) ; #endif } connect( m_menu_1,SIGNAL( triggered( QAction * ) ),this,SLOT( doAction( QAction * ) ) ) ; m_veraCryptWarning.setWarningLabel( m_ui->veraCryptWarning ) ; this->installEventFilter( this ) ; }