walletconfig::walletconfig( QWidget * parent ) : QDialog( parent ),m_ui( new Ui::walletconfig ) { m_ui->setupUi( this ) ; this->setFixedSize( this->size() ) ; this->setFont( parent->font() ) ; m_ui->tableWidget->setColumnWidth( 0,386 ) ; m_ui->tableWidget->setColumnWidth( 1,237 ) ; m_ui->tableWidget->hideColumn( 2 ) ; connect( m_ui->pbAdd,SIGNAL( clicked() ),this,SLOT( pbAdd() ) ) ; connect( m_ui->pbClose,SIGNAL( clicked() ),this,SLOT( pbClose() ) ) ; connect( m_ui->pbDelete,SIGNAL( clicked() ),this,SLOT( pbDelete() ) ) ; connect( m_ui->tableWidget,SIGNAL( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ), this,SLOT(currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ) ) ; connect( m_ui->tableWidget,SIGNAL( itemClicked( QTableWidgetItem * ) ), this,SLOT( itemClicked( QTableWidgetItem * ) ) ) ; this->installEventFilter( this ) ; }
void MainWindow::setUpShortCuts() { auto 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 ) ; auto qa = new QAction( this ) ; QList<QKeySequence> z ; z.append( Qt::Key_M ) ; qa->setShortcuts( z ) ; connect( qa,SIGNAL( triggered() ),this,SLOT( pbMount() ) ) ; this->addAction( qa ) ; qa = new QAction( this ) ; QList<QKeySequence> p ; p.append( Qt::Key_U ) ; qa->setShortcuts( p ) ; connect( qa,SIGNAL( triggered() ),this,SLOT( pbUmount() ) ) ; this->addAction( qa ) ; qa = new QAction( this ) ; QList<QKeySequence> q ; q.append( Qt::Key_R ) ; qa->setShortcuts( q ) ; connect( qa,SIGNAL( triggered() ),this,SLOT( pbUpdate() ) ) ; this->addAction( qa ) ; qa = new QAction( this ) ; QList<QKeySequence> e ; e.append( Qt::Key_C ) ; qa->setShortcuts( e ) ; connect( qa,SIGNAL( triggered() ),this,SLOT( pbClose() ) ) ; this->addAction( qa ) ; }
plugin::plugin( QDialog * parent,plugins::plugin t,std::function< void( const QByteArray& ) > function,const QString& e,const QVector<QString>& exe ) : QDialog( parent ),m_ui( new Ui::plugin ),m_function( std::move( function ) ),m_pluginType( t ),m_exe( exe ) { m_ui->setupUi( this ) ; if( !e.isEmpty() ){ m_ui->label->setText( e ) ; } this->setFixedSize( this->size() ) ; this->setFont( parent->font() ) ; connect( m_ui->pbSetKey,SIGNAL( clicked() ),this,SLOT( pbSetKey() ) ) ; connect( m_ui->pbCancel,SIGNAL( clicked() ),this,SLOT( pbClose() ) ) ; connect( m_ui->pbKeyFile,SIGNAL( clicked() ),this,SLOT( pbSelectKeyFile() ) ) ; m_ui->pbKeyFile->setIcon( QIcon( ":/file.png" ) ) ; m_ui->lineEdit->setFocus() ; this->ShowUI() ; }
void MainWindow::setUpApp( const QString& volume ) { this->setLocalizationLanguage() ; m_ui = new Ui::MainWindow ; m_ui->setupUi( this ) ; this->setFixedSize( this->size() ) ; m_ui->tableWidget->setColumnWidth( 0,220 ) ; m_ui->tableWidget->setColumnWidth( 1,320 ) ; m_ui->tableWidget->setColumnWidth( 2,145 ) ; m_ui->tableWidget->setColumnWidth( 4,87 ) ; m_ui->tableWidget->setColumnWidth( 5,87 ) ; m_ui->tableWidget->hideColumn( 3 ) ; #if QT_VERSION < QT_VERSION_CHECK( 5,0,0 ) m_ui->tableWidget->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ) ; #else m_ui->tableWidget->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ) ; #endif m_ui->tableWidget->verticalHeader()->setMinimumSectionSize( 30 ) ; this->setAcceptDrops( true ) ; this->setWindowIcon( QIcon( ":/zuluMount.png" ) ) ; m_ui->tableWidget->setMouseTracking( true ) ; connect( m_ui->tableWidget,SIGNAL( itemEntered( QTableWidgetItem * ) ),this,SLOT( itemEntered( QTableWidgetItem * ) ) ) ; connect( m_ui->tableWidget,SIGNAL( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ), this,SLOT( slotCurrentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ) ) ; connect( m_ui->pbmount,SIGNAL( clicked() ),this,SLOT( pbMount() ) ) ; connect( m_ui->pbupdate,SIGNAL( clicked()),this,SLOT( pbUpdate() ) ) ; connect( m_ui->pbclose,SIGNAL( clicked() ),this,SLOT( pbClose() ) ) ; connect( m_ui->tableWidget,SIGNAL( itemClicked( QTableWidgetItem * ) ),this,SLOT( itemClicked( QTableWidgetItem * ) ) ) ; connect( m_ui->pbunlockencfs,SIGNAL( clicked() ),this,SLOT( unlockencfs() ) ) ; connect( this,SIGNAL( unlistVolume( QString ) ),this,SLOT( removeVolume( QString ) ) ) ; this->setUpShortCuts() ; this->setUpFont() ; m_trayIcon = new QSystemTrayIcon( this ) ; m_trayIcon->setIcon( QIcon( ":/zuluMount.png" ) ) ; auto trayMenu = new QMenu( this ) ; m_autoMountAction = new QAction( this ) ; m_autoMount = this->autoMount() ; m_autoMountAction->setCheckable( true ) ; m_autoMountAction->setChecked( m_autoMount ) ; m_autoMountAction->setText( tr( "Automount Volumes" ) ) ; connect( m_autoMountAction,SIGNAL( toggled( bool ) ),this,SLOT( autoMountToggled( bool ) ) ) ; trayMenu->addAction( m_autoMountAction ) ; auto autoOpenFolderOnMount = new QAction( this ) ; autoOpenFolderOnMount->setCheckable( true ) ; m_autoOpenFolderOnMount = this->autoOpenFolderOnMount() ; autoOpenFolderOnMount->setChecked( m_autoOpenFolderOnMount ) ; autoOpenFolderOnMount->setText( tr( "Auto Open Mount Point" ) ) ; connect( autoOpenFolderOnMount,SIGNAL( toggled( bool ) ),this,SLOT( autoOpenFolderOnMount( bool ) ) ) ; trayMenu->addAction( autoOpenFolderOnMount ) ; auto ac = new QAction( this ) ; ac->setText( tr( "Show The Interface" ) ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( raiseWindow() ) ) ; trayMenu->addAction( ac ) ; ac = new QAction( this ) ; ac->setText( tr( "Unmount All" ) ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( unMountAll() ) ) ; trayMenu->addAction( ac ) ; m_favorite_menu = trayMenu->addMenu( tr( "Favorites" ) ) ; connect( m_favorite_menu,SIGNAL( triggered( QAction * ) ),this,SLOT( favoriteClicked( QAction * ) ) ) ; connect( m_favorite_menu,SIGNAL( aboutToShow() ),this,SLOT( showFavorites() ) ) ; m_not_hidden_volume_menu = trayMenu->addMenu( tr( "Hide Volume From View" ) ) ; connect( m_not_hidden_volume_menu,SIGNAL( triggered( QAction * ) ),this,SLOT( removeVolumeFromVisibleVolumeList( QAction * ) ) ) ; connect( m_not_hidden_volume_menu,SIGNAL( aboutToShow() ),this,SLOT( showVisibleVolumeList() ) ) ; m_hidden_volume_menu = trayMenu->addMenu( tr( "Unhide Volume From View" ) ) ; connect( m_hidden_volume_menu,SIGNAL( triggered( QAction * ) ),this,SLOT( removeVolumeFromHiddenVolumeList( QAction * ) ) ) ; connect( m_hidden_volume_menu,SIGNAL( aboutToShow() ),this,SLOT( showHiddenVolumeList() ) ) ; ac = new QAction( this ) ; ac->setText( tr( "About" ) ) ; connect( ac,SIGNAL( triggered() ),this,SLOT( licenseInfo() ) ) ; trayMenu->addAction( ac ) ; trayMenu->addAction( tr( "Quit" ),this,SLOT( pbClose() ) ) ; m_trayIcon->setContextMenu( trayMenu ) ; connect( m_trayIcon,SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), this,SLOT( slotTrayClicked( QSystemTrayIcon::ActivationReason ) ) ) ; m_trayIcon->show() ; QString dirPath = utility::homePath() + "/.zuluCrypt/" ; QDir dir( dirPath ) ; if( !dir.exists() ){ dir.mkdir( dirPath ) ; } this->disableAll() ; this->startAutoMonitor() ; this->updateVolumeList( zuluMountTask::updateVolumeList().await() ) ; if( volume.isEmpty() ) { this->enableAll() ; }else{ this->showMoungDialog( volume ) ; } }
void MainWindow::setUpApp() { this->setLocalizationLanguage() ; m_ui = new Ui::MainWindow ; m_ui->setupUi( this ) ; this->setFixedSize( this->size() ) ; m_ui->tableWidget->setColumnWidth( 0,225 ) ; m_ui->tableWidget->setColumnWidth( 1,320 ) ; m_ui->tableWidget->setColumnWidth( 2,105 ) ; m_ui->tableWidget->hideColumn( 3 ) ; m_ui->tableWidget->setColumnWidth( 4,87 ) ; m_ui->tableWidget->setColumnWidth( 5,87 ) ; #if QT_VERSION < QT_VERSION_CHECK( 5,0,0 ) m_ui->tableWidget->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ) ; #else m_ui->tableWidget->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ) ; #endif m_ui->tableWidget->verticalHeader()->setMinimumSectionSize( 30 ) ; this->setAcceptDrops( true ) ; this->setWindowIcon( QIcon( QString( ":/zuluMount.png" ) ) ) ; m_ui->tableWidget->setMouseTracking( true ) ; connect( m_ui->tableWidget,SIGNAL( itemEntered( QTableWidgetItem * ) ),this,SLOT( itemEntered( QTableWidgetItem * ) ) ) ; connect( m_ui->tableWidget,SIGNAL( currentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ), this,SLOT( slotCurrentItemChanged( QTableWidgetItem *,QTableWidgetItem * ) ) ) ; connect( m_ui->pbmount,SIGNAL( clicked() ),this,SLOT( pbMount() ) ) ; connect( m_ui->pbupdate,SIGNAL( clicked()),this,SLOT(pbUpdate() ) ) ; connect( m_ui->pbclose,SIGNAL( clicked() ),this,SLOT( pbClose() ) ) ; connect( m_ui->tableWidget,SIGNAL( itemClicked( QTableWidgetItem * ) ),this,SLOT( itemClicked( QTableWidgetItem * ) ) ) ; this->setUpShortCuts() ; this->setUpFont() ; m_trayIcon = new QSystemTrayIcon( this ) ; m_trayIcon->setIcon( QIcon( QString( ":/zuluMount.png" ) ) ) ; QMenu * trayMenu = new QMenu( this ) ; m_autoMountAction = new QAction( this ) ; m_autoMount = this->autoMount() ; m_autoMountAction->setCheckable( true ) ; m_autoMountAction->setChecked( m_autoMount ) ; m_autoMountAction->setText( tr( "automount volumes" ) ) ; connect( m_autoMountAction,SIGNAL( toggled( bool ) ),this,SLOT( autoMountToggled( bool ) ) ) ; trayMenu->addAction( m_autoMountAction ) ; QAction * autoOpenFolderOnMount = new QAction( this ) ; autoOpenFolderOnMount->setCheckable( true ) ; m_autoOpenFolderOnMount = this->autoOpenFolderOnMount() ; autoOpenFolderOnMount->setChecked( m_autoOpenFolderOnMount ) ; autoOpenFolderOnMount->setText( tr( "auto open mount point" ) ) ; connect( autoOpenFolderOnMount,SIGNAL( toggled( bool ) ),this,SLOT( autoOpenFolderOnMount( bool ) ) ) ; trayMenu->addAction( autoOpenFolderOnMount ) ; trayMenu->addAction( tr( "quit" ),this,SLOT( pbClose() ) ) ; m_trayIcon->setContextMenu( trayMenu ) ; connect( m_trayIcon,SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), this,SLOT( slotTrayClicked( QSystemTrayIcon::ActivationReason ) ) ) ; m_trayIcon->show() ; QString dirPath = QDir::homePath() + QString( "/.zuluCrypt/" ) ; QDir dir( dirPath ) ; if( !dir.exists() ){ dir.mkdir( dirPath ) ; } Task * t = new Task() ; this->disableAll() ; connect( t,SIGNAL( signalMountedList( QStringList,QStringList ) ), this,SLOT( slotMountedList( QStringList,QStringList ) ) ) ; connect( t,SIGNAL( done() ),this,SLOT( openVolumeFromArgumentList() ) ) ; connect( t,SIGNAL( done() ),this,SLOT( started() ) ) ; t->start( Task::Update ) ; this->startAutoMonitor() ; }