void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); miningAction = new QAction(QIcon(":/icons/mining"), tr("&Mining"), this); miningAction->setToolTip(tr("Configure mining")); miningAction->setCheckable(true); tabGroup->addAction(miningAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a Zugzwang address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address")); tabGroup->addAction(signMessageAction); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); tabGroup->addAction(verifyMessageAction); #ifdef FIRST_CLASS_MESSAGING firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this); firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString(".")); firstClassMessagingAction->setCheckable(true); tabGroup->addAction(firstClassMessagingAction); #endif connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(miningAction, SIGNAL(triggered()), this, SLOT(gotoMiningPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); #ifdef FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); // Always start with the sign message tab for FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); #endif quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Zugzwang"), this); aboutAction->setToolTip(tr("Show information about Zugzwang")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for Zugzwang")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &Zugzwang"), this); toggleHideAction->setToolTip(tr("Show or hide the Zugzwang window")); exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); }
void MainWindow::updateMenu(){ //as all the meshes are the same in all viewers we //take one of them to create the menu //disconneciton of previous signals delete signalMapper; disconnect(this,SIGNAL(toggleMeshVisible(int)),this,SLOT( setMeshvisible(int) )); QAction *action; //using signal mapper to match non parameter signals with parameter slots signalMapper = new QSignalMapper(this); QVBoxLayout *layout=new QVBoxLayout(); QWidget *wid=new QWidget; wid->setLayout(layout); ui->scrollArea->setWidget(wid); QHBoxLayout * titleLayout=new QHBoxLayout(); QWidget *title=new QWidget; title->setLayout(titleLayout); QLabel *labeltext=new QLabel("Mesh list"); //labeltext->setMinimumWidth(100); titleLayout->addWidget(labeltext); titleLayout->addWidget(new QLabel("Visible")); layout->addWidget(title); const float * color; for( int i=0;i<ui->viewer->getNumberOfMeshes();i++ ){ color=ui->viewer->getMeshColor(i); QPixmap *pixmap=new QPixmap(QSize(22,22)); pixmap->fill(QColor(color[0]*255,color[1]*255,color[2]*255)); //action=ui->menuMesh->addAction( QString("") ); action=new QAction(this); action->setCheckable(true); if(i<ui->viewer->getNumberOfMeshes()){ action->setChecked( ui->viewer->isMeshVisible(i) ); }else{ action->setChecked(true); } QToolButton *tool=new QToolButton(); tool->setDefaultAction(action); //layout->addWidget(tool); QHBoxLayout * hlayout=new QHBoxLayout; QLabel *pixlabel=new QLabel(); pixlabel->setPixmap(*pixmap ); hlayout->addWidget( pixlabel ); QLabel *label=new QLabel(QString("Mesh id: %1").arg(i)); hlayout->addWidget(label); hlayout->addWidget( tool ); layout->addLayout( hlayout ); connect(action, SIGNAL(triggered()), signalMapper, SLOT(map())); signalMapper->setMapping(action, i ); //ui->listWidget->addItem(QString("Mesh id: %1").arg(i)); delete pixmap; } connect(signalMapper, SIGNAL(mapped(int)), this, SIGNAL( toggleMeshVisible(int) )); connect(this,SIGNAL(toggleMeshVisible(int)),this,SLOT( setMeshvisible(int) )); }
void GlobalShortcuts::AddShortcut(const QString& id, const QString& name, const char* signal, const QKeySequence& default_key) { Shortcut shortcut = AddShortcut(id, name, default_key); connect(shortcut.action, SIGNAL(triggered()), this, signal); }
PerfectCoinGUI::PerfectCoinGUI(QWidget *parent): QMainWindow(parent), bridge(new PerfectCoinBridge(this)), clientModel(0), walletModel(0), messageModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), nWeight(0) { webView = new QWebView(); webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); webView->page()->action(QWebPage::Reload )->setVisible(false); webView->page()->action(QWebPage::Back )->setVisible(false); webView->page()->action(QWebPage::Forward)->setVisible(false); connect(webView, SIGNAL(linkClicked(const QUrl&)), this, SLOT(urlClicked(const QUrl&))); setCentralWidget(webView); resize(1280, 720); setWindowTitle(tr("PerfectCoin") + " - " + tr("Client")); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/perfectcoin")); setWindowIcon(QIcon(":icons/perfectcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the tray icon (or setup the dock icon) createTrayIcon(); signVerifyMessageDialog = new SignVerifyMessageDialog(this); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // prevents an oben debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); documentFrame = webView->page()->mainFrame(); QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); //connect(webView->page()->action(QWebPage::Reload), SIGNAL(triggered()), SLOT(pageLoaded(bool))); connect(webView, SIGNAL(loadFinished(bool)), SLOT(pageLoaded(bool))); connect(documentFrame, SIGNAL(javaScriptWindowObjectCleared()), SLOT(addJavascriptObjects())); connect(documentFrame, SIGNAL(urlChanged(QUrl)), SLOT(urlClicked(const QUrl&))); #ifdef Q_OS_WIN QFile html("C:/perfectcoin/index.html"); #else QFile html("/opt/perfectcoin/index.html"); #endif if(html.exists()) webView->setUrl(QUrl("file:///" + html.fileName())); else webView->setUrl(QUrl("qrc:///src/qt/res/index.html")); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->actionNew_project, SIGNAL(triggered()), SLOT(addNewProject())); connect(ui->actionOpen_project, SIGNAL(triggered()), SLOT(openProject())); connect(ui->actionSave_project, SIGNAL(triggered()), SLOT(saveProject())); connect(ui->actionSave_project_as, SIGNAL(triggered()), SLOT(saveProjectAs())); connect(ui->actionClose_project, SIGNAL(triggered()), SLOT(closeProject())); connect(ui->actionUndo, SIGNAL(triggered()), SLOT(undo())); connect(ui->actionRedo, SIGNAL(triggered()), SLOT(redo())); connect(ui->actionImport, SIGNAL(triggered()), SLOT(importProject())); connect(ui->actionExport, SIGNAL(triggered()), SLOT(exportProject())); connect(ui->actionAbout, SIGNAL(triggered()), SLOT(showAbout())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), SLOT(showAboutQt())); QString fileName = //"/home/gogi/Downloads/pcsc_pcsc_00001.vcf"; "G:\\pcsc_pcsc_00001.vcf"; QFile file(fileName); //showProject(new VCardProject(file)); updateProjectState(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), mPeriodSizeValidator(NULL), mPeriodCountValidator(NULL), mSourceCountValidator(NULL), mEffectSlotValidator(NULL), mSourceSendValidator(NULL), mSampleRateValidator(NULL), mJackBufferValidator(NULL), mNeedsSave(false) { ui->setupUi(this); for(int i = 0;speakerModeList[i].name[0];i++) ui->channelConfigCombo->addItem(speakerModeList[i].name); ui->channelConfigCombo->adjustSize(); for(int i = 0;sampleTypeList[i].name[0];i++) ui->sampleFormatCombo->addItem(sampleTypeList[i].name); ui->sampleFormatCombo->adjustSize(); for(int i = 0;stereoModeList[i].name[0];i++) ui->stereoModeCombo->addItem(stereoModeList[i].name); ui->stereoModeCombo->adjustSize(); for(int i = 0;stereoPanList[i].name[0];i++) ui->stereoPanningComboBox->addItem(stereoPanList[i].name); ui->stereoPanningComboBox->adjustSize(); int count; for(count = 0;resamplerList[count].name[0];count++) { } ui->resamplerSlider->setRange(0, count-1); ui->hrtfStateComboBox->adjustSize(); #if !defined(HAVE_NEON) && !defined(HAVE_SSE) ui->cpuExtDisabledLabel->move(ui->cpuExtDisabledLabel->x(), ui->cpuExtDisabledLabel->y() - 60); #else ui->cpuExtDisabledLabel->setVisible(false); #endif #ifndef HAVE_NEON #ifndef HAVE_SSE4_1 #ifndef HAVE_SSE3 #ifndef HAVE_SSE2 #ifndef HAVE_SSE ui->enableSSECheckBox->setVisible(false); #endif /* !SSE */ ui->enableSSE2CheckBox->setVisible(false); #endif /* !SSE2 */ ui->enableSSE3CheckBox->setVisible(false); #endif /* !SSE3 */ ui->enableSSE41CheckBox->setVisible(false); #endif /* !SSE4.1 */ ui->enableNeonCheckBox->setVisible(false); #else /* !Neon */ #ifndef HAVE_SSE4_1 #ifndef HAVE_SSE3 #ifndef HAVE_SSE2 #ifndef HAVE_SSE ui->enableNeonCheckBox->move(ui->enableNeonCheckBox->x(), ui->enableNeonCheckBox->y() - 30); ui->enableSSECheckBox->setVisible(false); #endif /* !SSE */ ui->enableSSE2CheckBox->setVisible(false); #endif /* !SSE2 */ ui->enableSSE3CheckBox->setVisible(false); #endif /* !SSE3 */ ui->enableSSE41CheckBox->setVisible(false); #endif /* !SSE4.1 */ #endif mPeriodSizeValidator = new QIntValidator(64, 8192, this); ui->periodSizeEdit->setValidator(mPeriodSizeValidator); mPeriodCountValidator = new QIntValidator(2, 16, this); ui->periodCountEdit->setValidator(mPeriodCountValidator); mSourceCountValidator = new QIntValidator(0, 256, this); ui->srcCountLineEdit->setValidator(mSourceCountValidator); mEffectSlotValidator = new QIntValidator(0, 16, this); ui->effectSlotLineEdit->setValidator(mEffectSlotValidator); mSourceSendValidator = new QIntValidator(0, 4, this); ui->srcSendLineEdit->setValidator(mSourceSendValidator); mSampleRateValidator = new QIntValidator(8000, 192000, this); ui->sampleRateCombo->lineEdit()->setValidator(mSampleRateValidator); mJackBufferValidator = new QIntValidator(0, 8192, this); ui->jackBufferSizeLine->setValidator(mJackBufferValidator); connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(loadConfigFromFile())); connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(saveConfigAsFile())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutPage())); connect(ui->closeCancelButton, SIGNAL(clicked()), this, SLOT(cancelCloseAction())); connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(saveCurrentConfig())); connect(ui->channelConfigCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->sampleFormatCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->stereoModeCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->sampleRateCombo, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->sampleRateCombo, SIGNAL(editTextChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->resamplerSlider, SIGNAL(valueChanged(int)), this, SLOT(updateResamplerLabel(int))); connect(ui->periodSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updatePeriodSizeEdit(int))); connect(ui->periodSizeEdit, SIGNAL(editingFinished()), this, SLOT(updatePeriodSizeSlider())); connect(ui->periodCountSlider, SIGNAL(valueChanged(int)), this, SLOT(updatePeriodCountEdit(int))); connect(ui->periodCountEdit, SIGNAL(editingFinished()), this, SLOT(updatePeriodCountSlider())); connect(ui->stereoPanningComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoderHQModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(toggleHqState(int))); connect(ui->decoderDistCompCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->decoderQuadLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoderQuadButton, SIGNAL(clicked()), this, SLOT(selectQuadDecoderFile())); connect(ui->decoder51LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoder51Button, SIGNAL(clicked()), this, SLOT(select51DecoderFile())); connect(ui->decoder51RearLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoder51RearButton, SIGNAL(clicked()), this, SLOT(select51RearDecoderFile())); connect(ui->decoder61LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoder61Button, SIGNAL(clicked()), this, SLOT(select61DecoderFile())); connect(ui->decoder71LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->decoder71Button, SIGNAL(clicked()), this, SLOT(select71DecoderFile())); connect(ui->preferredHrtfComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->hrtfStateComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->hrtfAddButton, SIGNAL(clicked()), this, SLOT(addHrtfFile())); connect(ui->hrtfRemoveButton, SIGNAL(clicked()), this, SLOT(removeHrtfFile())); connect(ui->hrtfFileList, SIGNAL(itemSelectionChanged()), this, SLOT(updateHrtfRemoveButton())); connect(ui->defaultHrtfPathsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->srcCountLineEdit, SIGNAL(editingFinished()), this, SLOT(enableApplyButton())); connect(ui->srcSendLineEdit, SIGNAL(editingFinished()), this, SLOT(enableApplyButton())); connect(ui->effectSlotLineEdit, SIGNAL(editingFinished()), this, SLOT(enableApplyButton())); connect(ui->enableSSECheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableSSE2CheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableSSE3CheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableSSE41CheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableNeonCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); ui->enabledBackendList->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->enabledBackendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showEnabledBackendMenu(QPoint))); ui->disabledBackendList->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->disabledBackendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDisabledBackendMenu(QPoint))); connect(ui->backendCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->defaultReverbComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->emulateEaxCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableEaxReverbCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableStdReverbCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableChorusCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableCompressorCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableDistortionCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableEchoCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableEqualizerCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableFlangerCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableModulatorCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->enableDedicatedCheck, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->pulseAutospawnCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->pulseAllowMovesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->pulseFixRateCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->jackAutospawnCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->jackBufferSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updateJackBufferSizeEdit(int))); connect(ui->jackBufferSizeLine, SIGNAL(editingFinished()), this, SLOT(updateJackBufferSizeSlider())); connect(ui->alsaDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->alsaDefaultCaptureLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->alsaResamplerCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->alsaMmapCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->ossDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->ossPlaybackPushButton, SIGNAL(clicked(bool)), this, SLOT(selectOSSPlayback())); connect(ui->ossDefaultCaptureLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->ossCapturePushButton, SIGNAL(clicked(bool)), this, SLOT(selectOSSCapture())); connect(ui->solarisDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->solarisPlaybackPushButton, SIGNAL(clicked(bool)), this, SLOT(selectSolarisPlayback())); connect(ui->waveOutputLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->waveOutputButton, SIGNAL(clicked(bool)), this, SLOT(selectWaveOutput())); connect(ui->waveBFormatCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); ui->backendListWidget->setCurrentRow(0); ui->tabWidget->setCurrentIndex(0); for(int i = 1;i < ui->backendListWidget->count();i++) ui->backendListWidget->setRowHidden(i, true); for(int i = 0;backendList[i].backend_name[0];i++) { QList<QListWidgetItem*> items = ui->backendListWidget->findItems( backendList[i].full_string, Qt::MatchFixedString ); foreach(const QListWidgetItem *item, items) ui->backendListWidget->setItemHidden(item, false); } loadConfig(getDefaultConfigName()); }
foreach (FilterAction::Action extra_action, extra_actions) { fa = new FilterAction(&ctx_menu_, extra_action); ctx_menu_.addAction(fa); connect(fa, SIGNAL(triggered()), this, SLOT(filterActionTriggered())); }
QAction* QgsLayerTreeViewDefaultActions::actionMakeTopLevel( QObject* parent ) { QAction* a = new QAction( tr( "&Move to Top-level" ), parent ); connect( a, SIGNAL( triggered() ), this, SLOT( makeTopLevel() ) ); return a; }
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookPage), model(0), optionsModel(0), mode(mode), tab(tab) { ui->setupUi(this); #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac ui->newAddressButton->setIcon(QIcon()); ui->copyToClipboard->setIcon(QIcon()); ui->deleteButton->setIcon(QIcon()); #endif #ifndef USE_QRCODE ui->showQRCode->setVisible(false); #endif switch(mode) { case ForSending: connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); break; case ForEditing: ui->buttonBox->setVisible(false); break; } switch(tab) { case SendingTab: ui->labelExplanation->setVisible(false); ui->deleteButton->setVisible(true); ui->signMessage->setVisible(false); break; case ReceivingTab: ui->deleteButton->setVisible(false); ui->signMessage->setVisible(true); break; } // Context menu actions QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *copyAddressAction = new QAction(ui->copyToClipboard->text(), this); QAction *editAction = new QAction(tr("&Edit"), this); QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this); QAction *signMessageAction = new QAction(ui->signMessage->text(), this); QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this); deleteAction = new QAction(ui->deleteButton->text(), this); // Build context menu contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(editAction); if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); contextMenu->addAction(showQRCodeAction); if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); else if(tab == SendingTab) contextMenu->addAction(verifyMessageAction); // Connect signals for context menu actions connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboard_clicked())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction())); connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction())); connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked())); connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); // Pass through accept action from button box connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); }
QAction* QgsLayerTreeViewDefaultActions::actionRemoveGroupOrLayer( QObject* parent ) { QAction* a = new QAction( QgsApplication::getThemeIcon( "/mActionRemoveLayer.svg" ), tr( "&Remove" ), parent ); connect( a, SIGNAL( triggered() ), this, SLOT( removeGroupOrLayer() ) ); return a; }
QAction* QgsLayerTreeViewDefaultActions::actionRenameGroupOrLayer( QObject* parent ) { QAction* a = new QAction( tr( "Re&name" ), parent ); connect( a, SIGNAL( triggered() ), this, SLOT( renameGroupOrLayer() ) ); return a; }
QAction* QgsLayerTreeViewDefaultActions::actionAddGroup( QObject* parent ) { QAction* a = new QAction( QgsApplication::getThemeIcon( "/mActionAddGroup.svg" ), tr( "&Add Group" ), parent ); connect( a, SIGNAL( triggered() ), this, SLOT( addGroup() ) ); return a; }
QAction* QgsLayerTreeViewDefaultActions::actionGroupSelected( QObject* parent ) { QAction* a = new QAction( tr( "&Group Selected" ), parent ); connect( a, SIGNAL( triggered() ), this, SLOT( groupSelected() ) ); return a; }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("Zugzwang") + " - " + tr("Wallet")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); miningPage = new MiningPage(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(miningPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(signVerifyMessageDialog); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(73); frameBlocks->setMaximumWidth(73); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelMiningIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelMiningIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), treeWidget(0), trayIcon(0), dockTile(0) { tabWidget = new MultiSessionTabWidget(this); connect(tabWidget, SIGNAL(newTabRequested()), this, SLOT(connectTo()), Qt::QueuedConnection); connect(tabWidget, SIGNAL(alerted(MessageView*,IrcMessage*)), this, SLOT(alert(MessageView*,IrcMessage*))); connect(tabWidget, SIGNAL(highlighted(MessageView*,IrcMessage*)), this, SLOT(highlight(MessageView*,IrcMessage*))); connect(tabWidget, SIGNAL(splitterChanged(QByteArray)), this, SLOT(splitterChanged(QByteArray))); connect(tabWidget, SIGNAL(sessionAdded(Session*)), this, SLOT(sessionAdded(Session*))); connect(tabWidget, SIGNAL(sessionRemoved(Session*)), this, SLOT(sessionRemoved(Session*))); HomePage* homePage = new HomePage(tabWidget); connect(homePage, SIGNAL(connectRequested()), this, SLOT(connectTo())); tabWidget->insertTab(0, homePage, tr("Home")); QSplitter* splitter = new QSplitter(this); splitter->setHandleWidth(1); splitter->addWidget(tabWidget); setCentralWidget(splitter); if (QSystemTrayIcon::isSystemTrayAvailable()) { trayIcon = new TrayIcon(this); trayIcon->setIcon(QApplication::windowIcon()); trayIcon->setVisible(true); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); } if (QtDockTile::isAvailable()) dockTile = new QtDockTile(this); QShortcut* shortcut = new QShortcut(QKeySequence(tr("Ctrl+Q")), this); connect(shortcut, SIGNAL(activated()), this, SLOT(close())); #ifdef Q_WS_MAC QMenu* menu = new QMenu(this); menuBar()->addMenu(menu); QAction* action = new QAction(tr("Connect"), this); connect(action, SIGNAL(triggered()), this, SLOT(connectTo())); menu->addAction(action); action = new QAction(tr("Settings"), this); action->setMenuRole(QAction::PreferencesRole); connect(action, SIGNAL(triggered()), qApp, SLOT(showSettings())); menu->addAction(action); action = new QAction(tr("About %1").arg(Application::applicationName()), this); action->setMenuRole(QAction::AboutRole); connect(action, SIGNAL(triggered()), qApp, SLOT(aboutApplication())); menu->addAction(action); action = new QAction(tr("About Qt"), this); action->setMenuRole(QAction::AboutQtRole); connect(action, SIGNAL(triggered()), qApp, SLOT(aboutQt())); menu->addAction(action); #endif // Q_WS_MAC QSettings settings; if (settings.contains("geometry")) restoreGeometry(settings.value("geometry").toByteArray()); applySettings(Application::settings()); connect(qApp, SIGNAL(settingsChanged(Settings)), this, SLOT(applySettings(Settings))); QTimer::singleShot(1000, this, SLOT(initialize())); }
//! [8] void MainWindow::createActions() { //! [8] brushColorAction = new QAction(tr("&Brush Color..."), this); brushColorAction->setShortcut(tr("Ctrl+C")); connect(brushColorAction, SIGNAL(triggered()), this, SLOT(brushColorAct())); //! [9] alphaChannelPressureAction = new QAction(tr("&Pressure"), this); alphaChannelPressureAction->setCheckable(true); alphaChannelTiltAction = new QAction(tr("&Tilt"), this); alphaChannelTiltAction->setCheckable(true); noAlphaChannelAction = new QAction(tr("No Alpha Channel"), this); noAlphaChannelAction->setCheckable(true); noAlphaChannelAction->setChecked(true); alphaChannelGroup = new QActionGroup(this); alphaChannelGroup->addAction(alphaChannelPressureAction); alphaChannelGroup->addAction(alphaChannelTiltAction); alphaChannelGroup->addAction(noAlphaChannelAction); connect(alphaChannelGroup, SIGNAL(triggered(QAction *)), this, SLOT(alphaActionTriggered(QAction *))); //! [9] colorSaturationVTiltAction = new QAction(tr("&Vertical Tilt"), this); colorSaturationVTiltAction->setCheckable(true); colorSaturationHTiltAction = new QAction(tr("&Horizontal Tilt"), this); colorSaturationHTiltAction->setCheckable(true); colorSaturationPressureAction = new QAction(tr("&Pressure"), this); colorSaturationPressureAction->setCheckable(true); noColorSaturationAction = new QAction(tr("&No Color Saturation"), this); noColorSaturationAction->setCheckable(true); noColorSaturationAction->setChecked(true); colorSaturationGroup = new QActionGroup(this); colorSaturationGroup->addAction(colorSaturationVTiltAction); colorSaturationGroup->addAction(colorSaturationHTiltAction); colorSaturationGroup->addAction(colorSaturationPressureAction); colorSaturationGroup->addAction(noColorSaturationAction); connect(colorSaturationGroup, SIGNAL(triggered(QAction *)), this, SLOT(saturationActionTriggered(QAction *))); lineWidthPressureAction = new QAction(tr("&Pressure"), this); lineWidthPressureAction->setCheckable(true); lineWidthPressureAction->setChecked(true); lineWidthTiltAction = new QAction(tr("&Tilt"), this); lineWidthTiltAction->setCheckable(true); lineWidthFixedAction = new QAction(tr("&Fixed"), this); lineWidthFixedAction->setCheckable(true); lineWidthGroup = new QActionGroup(this); lineWidthGroup->addAction(lineWidthPressureAction); lineWidthGroup->addAction(lineWidthTiltAction); lineWidthGroup->addAction(lineWidthFixedAction); connect(lineWidthGroup, SIGNAL(triggered(QAction *)), this, SLOT(lineWidthActionTriggered(QAction *))); exitAction = new QAction(tr("E&xit"), this); exitAction->setShortcut(tr("Ctrl+X")); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); loadAction = new QAction(tr("&Open..."), this); loadAction->setShortcut(tr("Ctrl+O")); connect(loadAction, SIGNAL(triggered()), this, SLOT(loadAct())); saveAction = new QAction(tr("&Save As..."), this); saveAction->setShortcut(tr("Ctrl+S")); connect(saveAction, SIGNAL(triggered()), this, SLOT(saveAct())); aboutAction = new QAction(tr("A&bout"), this); aboutAction->setShortcut(tr("Ctrl+B")); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutAct())); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setShortcut(tr("Ctrl+Q")); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); //! [10] }
CollectionSetup::CollectionSetup( QWidget *parent ) : QWidget( parent ) , m_rescanDirAction( new QAction( this ) ) { m_ui.setupUi(this); setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); setObjectName( "CollectionSetup" ); s_instance = this; if( KGlobalSettings::graphicEffectsLevel() != KGlobalSettings::NoEffects ) m_ui.view->setAnimated( true ); connect( m_ui.view, SIGNAL(clicked(QModelIndex)), this, SIGNAL(changed()) ); connect( m_ui.view, SIGNAL(pressed(QModelIndex)), this, SLOT(slotPressed(QModelIndex)) ); connect( m_rescanDirAction, SIGNAL(triggered()), this, SLOT(slotRescanDirTriggered()) ); KPushButton *rescan = new KPushButton( KIcon( "collection-rescan-amarok" ), i18n( "Full rescan" ), m_ui.buttonContainer ); rescan->setToolTip( i18n( "Rescan your entire collection. This will <i>not</i> delete any statistics." ) ); connect( rescan, SIGNAL(clicked()), CollectionManager::instance(), SLOT(startFullScan()) ); KPushButton *import = new KPushButton( KIcon( "tools-wizard" ), i18n( "Import batch file..." ), m_ui.buttonContainer ); import->setToolTip( i18n( "Import collection from file produced by amarokcollectionscanner." ) ); connect( import, SIGNAL(clicked()), this, SLOT(importCollection()) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addWidget( rescan ); buttonLayout->addWidget( import ); m_ui.buttonContainer->setLayout( buttonLayout ); m_recursive = new QCheckBox( i18n("&Scan folders recursively (requires full rescan if newly checked)"), m_ui.checkboxContainer ); m_monitor = new QCheckBox( i18n("&Watch folders for changes"), m_ui.checkboxContainer ); connect( m_recursive, SIGNAL(toggled(bool)), this, SIGNAL(changed()) ); connect( m_monitor , SIGNAL(toggled(bool)), this, SIGNAL(changed()) ); QVBoxLayout *checkboxLayout = new QVBoxLayout(); checkboxLayout->addWidget( m_recursive ); checkboxLayout->addWidget( m_monitor ); m_ui.checkboxContainer->setLayout( checkboxLayout ); m_recursive->setToolTip( i18n( "If selected, Amarok will read all subfolders." ) ); m_monitor->setToolTip( i18n( "If selected, the collection folders will be watched " "for changes.\nThe watcher will not notice changes behind symbolic links." ) ); m_recursive->setChecked( AmarokConfig::scanRecursively() ); m_monitor->setChecked( AmarokConfig::monitorChanges() ); // set the model _after_ constructing the checkboxes m_model = new CollectionFolder::Model( this ); m_ui.view->setModel( m_model ); #ifndef Q_OS_WIN m_ui.view->setRootIndex( m_model->setRootPath( QDir::rootPath() ) ); #else m_ui.view->setRootIndex( m_model->setRootPath( m_model->myComputer().toString() ) ); #endif Collections::Collection *primaryCollection = CollectionManager::instance()->primaryCollection(); QStringList dirs = primaryCollection ? primaryCollection->property( "collectionFolders" ).toStringList() : QStringList(); m_model->setDirectories( dirs ); // make sure that the tree is expanded to show all selected items foreach( const QString &dir, dirs ) { QModelIndex index = m_model->index( dir ); m_ui.view->scrollTo( index, QAbstractItemView::EnsureVisible ); }
void MainWindow::createHelpMenu() { QMenu* helpMenu = menuBar()->addMenu("&Help"); QAction* aboutAction = helpMenu->addAction("&About"); connect(aboutAction, SIGNAL(triggered()), this, SLOT(onAbout())); }
foreach (FilterAction::ActionType at, FilterAction::actionTypes()) { FilterAction *fa = new FilterAction(submenu, cur_action, at); submenu->addAction(fa); connect(fa, SIGNAL(triggered()), this, SLOT(filterActionTriggered())); }
void StatusWidget::createMenu() { menu = new QMenu( this ); signalMapper = new QSignalMapper( this ); replyAction = new QAction( this ); replyAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_R ) ); menu->addAction( replyAction ); connect( replyAction, SIGNAL(triggered()), this, SLOT(slotReply()) ); connect( this, SIGNAL(reply(QString,quint64)), StatusModel::instance(), SIGNAL(reply(QString,quint64)) ); retweetAction = new QAction( tr( "Retweet" ), this ); retweetAction->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_T ) ); menu->addAction( retweetAction ); connect( retweetAction, SIGNAL(triggered()), this, SLOT(slotRetweet()) ); connect( this, SIGNAL(retweet(QString)), StatusModel::instance(), SIGNAL(retweet(QString)) ); dmAction = new QAction( this ); dmAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_D ) ); menu->addAction( dmAction ); connect( dmAction, SIGNAL(triggered()), this, SLOT(slotDM()) ); menu->addSeparator(); favoriteAction = new QAction( tr( "Add to Favorites" ), this ); favoriteAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_F ) ); menu->addAction( favoriteAction ); connect( favoriteAction, SIGNAL(triggered()), this, SLOT(slotFavorite()) ); copylinkAction = new QAction( tr( "Copy link to this status" ), this ); copylinkAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_C ) ); menu->addAction( copylinkAction ); connect( copylinkAction, SIGNAL(triggered()), this, SLOT(slotCopyLink()) ); deleteAction = new QAction( this ); deleteAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Backspace ) ); menu->addAction( deleteAction ); connect( deleteAction, SIGNAL(triggered()), this, SLOT(slotDelete()) ); markallasreadAction = new QAction( tr( "Mark list as read" ), this ); markallasreadAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_A ) ); menu->addAction( markallasreadAction ); connect( markallasreadAction, SIGNAL(triggered()), StatusModel::instance(), SLOT(markAllAsRead()) ); markeverythingasreadAction = new QAction( tr( "Mark everything as read" ), this ); markeverythingasreadAction->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_A ) ); menu->addAction( markeverythingasreadAction ); connect( markeverythingasreadAction, SIGNAL(triggered()), StatusModel::instance(), SIGNAL(markEverythingAsRead()) ); menu->addSeparator(); gototwitterpageAction = new QAction( this ); gototwitterpageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_T ) ); menu->addAction( gototwitterpageAction ); connect( gototwitterpageAction, SIGNAL(triggered()), signalMapper, SLOT(map()) ); connect( signalMapper, SIGNAL(mapped(QString)), StatusModel::instance(), SLOT(emitOpenBrowser(QString)) ); gotohomepageAction = new QAction( tr( "Go to User's homepage" ), this); gotohomepageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_H ) ); menu->addAction( gotohomepageAction ); connect( gotohomepageAction, SIGNAL(triggered()), signalMapper, SLOT(map()) ); }
void PerfectCoinGUI::createActions() { quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About PerfectCoin"), this); aboutAction->setToolTip(tr("Show information about PerfectCoin")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for PerfectCoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); unlockWalletAction = new QAction(QIcon(":/icons/lock_open"), tr("&Unlock Wallet..."), this); unlockWalletAction->setToolTip(tr("Unlock wallet")); lockWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Lock Wallet"), this); lockWalletAction->setToolTip(tr("Lock wallet")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); //exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); //exportAction->setToolTip(tr("Export the data in the current tab to a file")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), SLOT(changePassphrase())); connect(unlockWalletAction, SIGNAL(triggered()), SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), SLOT(gotoVerifyMessageTab())); }
EditTagDialog::EditTagDialog(Application* app, QWidget* parent) : QDialog(parent), ui_(new Ui_EditTagDialog), app_(app), album_cover_choice_controller_(new AlbumCoverChoiceController(this)), loading_(false), ignore_edits_(false), tag_fetcher_(new TagFetcher(this)), cover_art_id_(0), cover_art_is_set_(false), results_dialog_(new TrackSelectionDialog(this)) { cover_options_.default_output_image_ = AlbumCoverLoader::ScaleAndPad(cover_options_, QImage(":nocover.png")); connect(app_->album_cover_loader(), SIGNAL(ImageLoaded(quint64, QImage, QImage)), SLOT(ArtLoaded(quint64, QImage, QImage))); connect(tag_fetcher_, SIGNAL(ResultAvailable(Song, SongList)), results_dialog_, SLOT(FetchTagFinished(Song, SongList)), Qt::QueuedConnection); connect(tag_fetcher_, SIGNAL(Progress(Song, QString)), results_dialog_, SLOT(FetchTagProgress(Song, QString))); connect(results_dialog_, SIGNAL(SongChosen(Song, Song)), SLOT(FetchTagSongChosen(Song, Song))); connect(results_dialog_, SIGNAL(finished(int)), tag_fetcher_, SLOT(Cancel())); album_cover_choice_controller_->SetApplication(app_); ui_->setupUi(this); ui_->splitter->setSizes(QList<int>() << 200 << width() - 200); ui_->loading_label->hide(); // An editable field is one that has a label as a buddy. The label is // important because it gets turned bold when the field is changed. for (QLabel* label : findChildren<QLabel*>()) { QWidget* widget = label->buddy(); if (widget) { // Store information about the field fields_ << FieldData(label, widget, widget->objectName()); // Connect the Reset signal if (dynamic_cast<ExtendedEditor*>(widget)) { connect(widget, SIGNAL(Reset()), SLOT(ResetField())); } // Connect the edited signal if (qobject_cast<QLineEdit*>(widget)) { connect(widget, SIGNAL(textChanged(QString)), SLOT(FieldValueEdited())); } else if (qobject_cast<QPlainTextEdit*>(widget)) { connect(widget, SIGNAL(textChanged()), SLOT(FieldValueEdited())); } else if (qobject_cast<QSpinBox*>(widget)) { connect(widget, SIGNAL(valueChanged(int)), SLOT(FieldValueEdited())); } } } // Set the colour of all the labels on the summary page const bool light = palette().color(QPalette::Base).value() > 128; const QColor color = palette().color(QPalette::WindowText); QPalette summary_label_palette(palette()); summary_label_palette.setColor( QPalette::WindowText, light ? color.lighter(150) : color.darker(150)); for (QLabel* label : ui_->summary_tab->findChildren<QLabel*>()) { if (label->property("field_label").toBool()) { label->setPalette(summary_label_palette); } } // Pretend the summary text is just a label ui_->summary->setMaximumHeight(ui_->art->height() - ui_->summary_art_button->height() - 4); connect(ui_->song_list->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(SelectionChanged())); connect(ui_->button_box, SIGNAL(clicked(QAbstractButton*)), SLOT(ButtonClicked(QAbstractButton*))); connect(ui_->rating, SIGNAL(RatingChanged(float)), SLOT(SongRated(float))); connect(ui_->playcount_reset, SIGNAL(clicked()), SLOT(ResetPlayCounts())); connect(ui_->fetch_tag, SIGNAL(clicked()), SLOT(FetchTag())); // Set up the album cover menu cover_menu_ = new QMenu(this); QList<QAction*> actions = album_cover_choice_controller_->GetAllActions(); connect(album_cover_choice_controller_->cover_from_file_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromFile())); connect(album_cover_choice_controller_->cover_to_file_action(), SIGNAL(triggered()), this, SLOT(SaveCoverToFile())); connect(album_cover_choice_controller_->cover_from_url_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromURL())); connect(album_cover_choice_controller_->search_for_cover_action(), SIGNAL(triggered()), this, SLOT(SearchForCover())); connect(album_cover_choice_controller_->unset_cover_action(), SIGNAL(triggered()), this, SLOT(UnsetCover())); connect(album_cover_choice_controller_->show_cover_action(), SIGNAL(triggered()), this, SLOT(ShowCover())); cover_menu_->addActions(actions); ui_->summary_art_button->setMenu(cover_menu_); ui_->art->installEventFilter(this); ui_->art->setAcceptDrops(true); // Add the next/previous buttons previous_button_ = new QPushButton(IconLoader::Load("go-previous"), tr("Previous"), this); next_button_ = new QPushButton(IconLoader::Load("go-next"), tr("Next"), this); ui_->button_box->addButton(previous_button_, QDialogButtonBox::ResetRole); ui_->button_box->addButton(next_button_, QDialogButtonBox::ResetRole); connect(previous_button_, SIGNAL(clicked()), SLOT(PreviousSong())); connect(next_button_, SIGNAL(clicked()), SLOT(NextSong())); // Set some shortcuts for the buttons new QShortcut(QKeySequence::Back, previous_button_, SLOT(click())); new QShortcut(QKeySequence::Forward, next_button_, SLOT(click())); new QShortcut(QKeySequence::MoveToPreviousPage, previous_button_, SLOT(click())); new QShortcut(QKeySequence::MoveToNextPage, next_button_, SLOT(click())); // Show the shortcuts as tooltips previous_button_->setToolTip(QString("%1 (%2 / %3)").arg( previous_button_->text(), QKeySequence(QKeySequence::Back).toString(QKeySequence::NativeText), QKeySequence(QKeySequence::MoveToPreviousPage) .toString(QKeySequence::NativeText))); next_button_->setToolTip(QString("%1 (%2 / %3)").arg( next_button_->text(), QKeySequence(QKeySequence::Forward).toString(QKeySequence::NativeText), QKeySequence(QKeySequence::MoveToNextPage) .toString(QKeySequence::NativeText))); new TagCompleter(app_->library_backend(), Playlist::Column_Artist, ui_->artist); new TagCompleter(app_->library_backend(), Playlist::Column_Album, ui_->album); new TagCompleter(app_->library_backend(), Playlist::Column_AlbumArtist, ui_->albumartist); new TagCompleter(app_->library_backend(), Playlist::Column_Genre, ui_->genre); new TagCompleter(app_->library_backend(), Playlist::Column_Composer, ui_->composer); new TagCompleter(app_->library_backend(), Playlist::Column_Performer, ui_->performer); new TagCompleter(app_->library_backend(), Playlist::Column_Grouping, ui_->grouping); }
QWidget *QFRDRTableDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const { QVariant dat=index.data(Qt::DisplayRole); QString expression=index.data(QFRDRTable::TableExpressionRole).toString(); if (expression.isEmpty()) { if (dat.type()==QVariant::Invalid) { dat=index.data(Qt::EditRole); } if ( dat.type() == QVariant::DateTime || dat.type() == QVariant::Time || dat.type() == QVariant::Date ) { QDateTimeEdit *editor = new QDateTimeEdit(parent); //editor->setDisplayFormat("dd/M/yyyy"); editor->setCalendarPopup(true); return editor; } if ( !index.isValid() || dat.type() == QVariant::Double ) { QFDoubleEdit* editor=new QFDoubleEdit(parent); editor->setCheckBounds(false, false); editor->setShowUpDown(false); return editor; } if ( dat.type() == QVariant::Int || dat.type() == QVariant::LongLong ) { QSpinBox* editor=new QSpinBox(parent); editor->setRange(INT_MIN, INT_MAX); editor->setButtonSymbols(QAbstractSpinBox::NoButtons); return editor; } if ( dat.type() == QVariant::UInt || dat.type() == QVariant::ULongLong ) { QSpinBox* editor=new QSpinBox(parent); editor->setRange(0, UINT_MAX); editor->setButtonSymbols(QAbstractSpinBox::NoButtons); return editor; } if ( dat.type() == QVariant::Bool) { QCheckBox* editor=new QCheckBox(parent); return editor; } QLineEdit *editor = new QLineEdit(parent); // create a completer with the strings in the column as model QStringList allStrings; for (int i = 1; i<index.model()->rowCount(); i++) { QString strItem(index.model()->data(index.sibling(i, index.column()), Qt::EditRole).toString()); if (!allStrings.contains(strItem)) allStrings.append(strItem); } QCompleter *autoComplete = new QCompleter(allStrings); editor->setCompleter(autoComplete); connect(editor, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor())); return editor; } else { QWidget* widExpression=new QWidget(parent); widExpression->setFocusPolicy(Qt::StrongFocus); widExpression->setAutoFillBackground(true); QHBoxLayout* layout=new QHBoxLayout(); layout->setContentsMargins(0,0,0,0); layout->setSpacing(1); widExpression->setLayout(layout); QLabel* label=new QLabel(widExpression); layout->addWidget(label, 1); label->setTextFormat(Qt::RichText); label->setText(tr("<b><font color=\"blue\">Σ:</font> %1</b><i> = %2</i>").arg(expression).arg(dat.toString())); label->setAutoFillBackground(true); QFont f=label->font(); f.setPointSizeF(f.pointSizeF()*0.9); label->setFont(f); QAction* actEdtExp; QToolButton* btnEdtExp=createButtonAndAction(actEdtExp, QIcon(":/table/formula.png"), tr("edit expression ..."), widExpression); actEdtExp->setParent(widExpression); connect(actEdtExp, SIGNAL(triggered()), this, SLOT(doEditExpression())); layout->addWidget(btnEdtExp); QAction* actClearExp; QToolButton* btnClearExp=createButtonAndAction(actClearExp, QIcon(":/table/formulaclear.png"), tr("clear expression ..."), widExpression); actClearExp->setParent(widExpression); connect(actClearExp, SIGNAL(triggered()), this, SLOT(doClearExpression())); layout->addWidget(btnClearExp); widExpression->setFocus(); return widExpression; } }
void NoirSharesGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a NoirShares address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/NoirShares"), tr("&About NoirShares"), this); aboutAction->setToolTip(tr("Show information about NoirShares")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for NoirShares")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/NoirShares"), tr("&Show / Hide"), this); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
SendCoinsDialog::SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent) : QDialog(parent), ui(new Ui::SendCoinsDialog), clientModel(0), model(0), fNewRecipientAllowed(true), fFeeMinimized(true), platformStyle(platformStyle) { ui->setupUi(this); if (!platformStyle->getImagesOnButtons()) { ui->addButton->setIcon(QIcon()); ui->clearButton->setIcon(QIcon()); ui->sendButton->setIcon(QIcon()); } else { ui->addButton->setIcon(platformStyle->SingleColorIcon(":/icons/add")); ui->clearButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove")); ui->sendButton->setIcon(platformStyle->SingleColorIcon(":/icons/send")); } GUIUtil::setupAddressWidget(ui->lineEditCoinControlChange, this); addEntry(); connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry())); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); // Coin Control connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(coinControlButtonClicked())); connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int))); connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &))); // Coin Control: clipboard actions QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this); QAction *clipboardAmountAction = new QAction(tr("Copy amount"), this); QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this); QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this); QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity())); connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount())); connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardFee())); connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAfterFee())); connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardBytes())); connect(clipboardPriorityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardPriority())); connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardLowOutput())); connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardChange())); ui->labelCoinControlQuantity->addAction(clipboardQuantityAction); ui->labelCoinControlAmount->addAction(clipboardAmountAction); ui->labelCoinControlFee->addAction(clipboardFeeAction); ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction); ui->labelCoinControlBytes->addAction(clipboardBytesAction); ui->labelCoinControlPriority->addAction(clipboardPriorityAction); ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction); ui->labelCoinControlChange->addAction(clipboardChangeAction); // init transaction fee section QSettings settings; if (!settings.contains("fFeeSectionMinimized")) settings.setValue("fFeeSectionMinimized", true); if (!settings.contains("nFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility settings.setValue("nFeeRadio", 1); // custom if (!settings.contains("nFeeRadio")) settings.setValue("nFeeRadio", 0); // recommended if (!settings.contains("nCustomFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility settings.setValue("nCustomFeeRadio", 1); // total at least if (!settings.contains("nCustomFeeRadio")) settings.setValue("nCustomFeeRadio", 0); // per kilobyte if (!settings.contains("nSmartFeeSliderPosition")) settings.setValue("nSmartFeeSliderPosition", 0); if (!settings.contains("nTransactionFee")) settings.setValue("nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE); if (!settings.contains("fPayOnlyMinFee")) settings.setValue("fPayOnlyMinFee", false); // Dogecoin: Disable free transactions /* if (!settings.contains("fSendFreeTransactions")) settings.setValue("fSendFreeTransactions", false); */ ui->groupFee->setId(ui->radioSmartFee, 0); ui->groupFee->setId(ui->radioCustomFee, 1); ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true); ui->groupCustomFee->setId(ui->radioCustomPerKilobyte, 0); ui->groupCustomFee->setId(ui->radioCustomAtLeast, 1); ui->groupCustomFee->button((int)std::max(0, std::min(1, settings.value("nCustomFeeRadio").toInt())))->setChecked(true); ui->sliderSmartFee->setValue(settings.value("nSmartFeeSliderPosition").toInt()); ui->customFee->setValue(settings.value("nTransactionFee").toLongLong()); ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool()); // Dogecoin: Disable free transactions // ui->checkBoxFreeTx->setChecked(settings.value("fSendFreeTransactions").toBool()); minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); }
NoirSharesGUI::NoirSharesGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("NoirShares") + " - " + tr("Wallet")); // QPalette pal = this->palette(); // pal.setColor(QPalette::Window, Qt::black); // pal.setColor(QPalette::WindowText, Qt::white); // this->setPalette(pal); // this->setAutoFillBackground(true); this->setStyleSheet("QMainWindow {background-color: black; color: white;} " #ifndef Q_OS_MAC "QToolButton {background-color: black; color: white;} " "QToolButton:hover {background-color: black; color: #ffff77;} " "QToolButton:pressed {background-color: #0000bb; color: white;} " "QToolButton:checked {background-color: #000099; color: white;} " "QToolButton:disabled {background-color: #333333; color: white;} " #endif "QComboBox {border:1px solid white; border-radius: 3px; min-width: 5em; " " color:white; background-color:black;} " "QComboBox::drop-down {border: 0px;} " "QComboBox * {color: black;} " "QComboBox:on {color: black} " "QComboBox:on *:hover {background-color: blue} " "QMessageBox QLabel {color: black;} " "AddressBookPage {background-color: black; border-color: white;" " color: white; border-width: 1px;} " "TransactionView {background-color: black; color: white;} " "transactionView {background-color: black; color: white;} " "QLabel {color: white;} " "QHeaderView::section{background-color: black; border-color:white;" " color: white; font-weight:bold;" " border-width: 1px; border-style: solid;} " "QValidatedLineEdit {border-style: solid; border-width: 1px;" " border-color: white;}" "QDoubleSpinBox {color:white;background-color:#222222; " " border-color:white;border-width:1px;font-weight:bold;} " "QLineEdit {border-style: solid; border-width: 1px;" " border-color: white;}" // "SendCoinsEntry {background-color: black; color: white; " // " border-color: white; border-width: 1px;} " // "SendCoinsDialog {background-color: black; color: white; " // " border-color: white; border-width: 1px;} " // "QScrollArea {background-color: white; border-color: white; " // " color: white; border-width: 1px;} " // "scrollAreaWidgetContents {background-color: white; border-color: white; " // " color: white; border-width: 1px;} " ); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/NoirShares")); setWindowIcon(QIcon(":icons/NoirShares")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); #ifdef Q_OS_MAC progressBarLabel->setStyleSheet("color:black"); #endif // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) : QDialog(parent), ui(new Ui::CoinControlDialog), model(0), platformStyle(_platformStyle) { ui->setupUi(this); /* Open CSS when configured */ this->setStyleSheet(GUIUtil::loadStyleSheet()); // context menu actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyAmountAction = new QAction(tr("Copy amount"), this); copyTransactionHashAction = new QAction(tr("Copy transaction ID"), this); // we need to enable/disable this lockAction = new QAction(tr("Lock unspent"), this); // we need to enable/disable this unlockAction = new QAction(tr("Unlock unspent"), this); // we need to enable/disable this // context menu contextMenu = new QMenu(this); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTransactionHashAction); contextMenu->addSeparator(); contextMenu->addAction(lockAction); contextMenu->addAction(unlockAction); // context menu signals connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint))); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTransactionHashAction, SIGNAL(triggered()), this, SLOT(copyTransactionHash())); connect(lockAction, SIGNAL(triggered()), this, SLOT(lockCoin())); connect(unlockAction, SIGNAL(triggered()), this, SLOT(unlockCoin())); // clipboard actions QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this); QAction *clipboardAmountAction = new QAction(tr("Copy amount"), this); QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this); QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this); QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this); QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this); QAction *clipboardChangeAction = new QAction(tr("Copy change"), this); connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity())); connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(clipboardAmount())); connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(clipboardFee())); connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(clipboardAfterFee())); connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(clipboardBytes())); connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(clipboardLowOutput())); connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(clipboardChange())); ui->labelCoinControlQuantity->addAction(clipboardQuantityAction); ui->labelCoinControlAmount->addAction(clipboardAmountAction); ui->labelCoinControlFee->addAction(clipboardFeeAction); ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction); ui->labelCoinControlBytes->addAction(clipboardBytesAction); ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction); ui->labelCoinControlChange->addAction(clipboardChangeAction); // toggle tree/list mode connect(ui->radioTreeMode, SIGNAL(toggled(bool)), this, SLOT(radioTreeMode(bool))); connect(ui->radioListMode, SIGNAL(toggled(bool)), this, SLOT(radioListMode(bool))); // click on checkbox connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int))); // click on header #if QT_VERSION < 0x050000 ui->treeWidget->header()->setClickable(true); #else ui->treeWidget->header()->setSectionsClickable(true); #endif connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int))); // ok button connect(ui->buttonBox, SIGNAL(clicked( QAbstractButton*)), this, SLOT(buttonBoxClicked(QAbstractButton*))); // (un)select all connect(ui->pushButtonSelectAll, SIGNAL(clicked()), this, SLOT(buttonSelectAllClicked())); // Toggle lock state connect(ui->pushButtonToggleLock, SIGNAL(clicked()), this, SLOT(buttonToggleLockClicked())); // change coin control first column label due Qt4 bug. // see https://github.com/bitcoin/bitcoin/issues/5716 ui->treeWidget->headerItem()->setText(COLUMN_CHECKBOX, QString()); ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, 84); ui->treeWidget->setColumnWidth(COLUMN_AMOUNT, 100); ui->treeWidget->setColumnWidth(COLUMN_LABEL, 170); ui->treeWidget->setColumnWidth(COLUMN_ADDRESS, 190); ui->treeWidget->setColumnWidth(COLUMN_PRIVATESEND_ROUNDS, 88); ui->treeWidget->setColumnWidth(COLUMN_DATE, 80); ui->treeWidget->setColumnWidth(COLUMN_CONFIRMATIONS, 100); ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transaction hash in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_VOUT_INDEX, true); // store vout index in this column, but don't show it // default view is sorted by amount desc sortView(COLUMN_AMOUNT, Qt::DescendingOrder); // restore list mode and sortorder as a convenience feature QSettings settings; if (settings.contains("nCoinControlMode") && !settings.value("nCoinControlMode").toBool()) ui->radioTreeMode->click(); if (settings.contains("nCoinControlSortColumn") && settings.contains("nCoinControlSortOrder")) sortView(settings.value("nCoinControlSortColumn").toInt(), ((Qt::SortOrder)settings.value("nCoinControlSortOrder").toInt())); }
void CLogisticMainWindow::setupMenu(const bool &visible) { if (!visible) return; // Document QMenu *documentMenu = menuBar()->addMenu(tr("&Документ")); documentMenu->addAction(tr("Новый"), this, SLOT(slotNewDocument()), QKeySequence(Qt::Key_F3)); documentMenu->addAction(tr("Открыть"), this, SLOT(slotOpenDocument()), QKeySequence(Qt::Key_F4)); documentMenu->addSeparator(); documentMenu->addAction(tr("Печать"), this, SLOT(slotPrintDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Переместить"), this, SLOT(slotCutDocument()), QKeySequence(Qt::Key_F6)); documentMenu->addAction(tr("Копировать"), this, SLOT(slotCopyDocument())); documentMenu->addAction(tr("Вставить"),this, SLOT(slotPasteDocument())); documentMenu->addAction(tr("Удалить"), this, SLOT(slotDeleteDocument()), QKeySequence(Qt::Key_F8)); documentMenu->addSeparator(); documentMenu->addAction(tr("Найти..."), this, SLOT(slotSearchDocument())); documentMenu->addAction(tr("Найти следующий"), this, SLOT(slotSearchNextDocument())); documentMenu->addAction(tr("Найти предыдущий"), this, SLOT(slotSearchPrevDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Обновить"), this, SLOT(slotRefreshDocument())); documentMenu->addAction(tr("Стать владельцем"), this, SLOT(slotOwnerDocument())); documentMenu->addSeparator(); documentMenu->addAction(tr("Выход"), this, SLOT(close()), QKeySequence(Qt::ALT | Qt::Key_F4)); // Folder QMenu *folderMenu = menuBar()->addMenu(tr("&Папка")); folderMenu->addAction(tr("Взаимоотношения"), this, SLOT(slotRelationsFolder())); folderMenu->addAction(tr("Календать"), this, SLOT(slotCalendarFolder())); folderMenu->addAction(tr("Напоминания"), this, SLOT(slotReminderFolder())); // Dictionary QMenu *dictionaryMenu = menuBar()->addMenu(tr("Справочники")); dictionaryMenu->addAction(tr("Заказчики"), this, SLOT(slotCustomerDictionary())); dictionaryMenu->addAction(tr("Поставщики"), this, SLOT(slotSuppliersDictionary())); dictionaryMenu->addAction(tr("Производители"), this, SLOT(slotProdusersDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Контакты"), this, SLOT(slotContactsDictionary())); dictionaryMenu->addAction(tr("Должности"), this, SLOT(slotPositionsDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Типы задач"), this, SLOT(slotTaskTypesDictionary())); dictionaryMenu->addAction(tr("Типы контрагентов"), this, SLOT(slotContractorTypesDictionary())); dictionaryMenu->addAction(tr("Статусы"), this, SLOT(slotStatusDictionary())); dictionaryMenu->addAction(tr("Приоритеты"), this, SLOT(slotPrioritiesDictionary())); dictionaryMenu->addSeparator(); dictionaryMenu->addAction(tr("Страны и города"), this, SLOT(slotCountryCityDictionary())); // View QMenu *viewMenu = menuBar()->addMenu(tr("&Вид")); QAction *m_actual = viewMenu->addAction(tr("Актуальные документы")); connect(m_actual, SIGNAL(triggered()), SLOT(slotActualDocumentsView())); viewMenu->addAction(tr("Дерево документов"), this, SLOT(slotTreeDocumentsView()), QKeySequence(Qt::Key_F9)); // Window QMenu *windowMenu = menuBar()->addMenu(tr("&Окно")); QAction *close = windowMenu->addAction(tr("Закрыть")); connect(close, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow())); QAction *closeAll = windowMenu->addAction(tr("Закрыть все")); connect(closeAll, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); windowMenu->addSeparator(); QAction *m_tile = windowMenu->addAction(tr("Плитка")); connect(m_tile, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); QAction *m_cascade = windowMenu->addAction(tr("Каскад")); connect(m_cascade, SIGNAL(triggered()), mdiArea, SLOT(cascadeSubWindows())); windowMenu->addSeparator(); QMenu *modeMenu = windowMenu->addMenu(tr("Режим отображения")); QAction *m_modeMdi = modeMenu->addAction(tr("Оконный")); connect(m_modeMdi, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); QAction *m_modeWindow = modeMenu->addAction(tr("Вкладки")); connect(m_modeWindow, SIGNAL(triggered()), mdiArea, SLOT(tileSubWindows())); windowMenu->addSeparator(); QAction *next = windowMenu->addAction(tr("Следующее")); connect(next, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); QAction *previous = windowMenu->addAction(tr("Предыдущее")); connect(previous, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }
void MainWindow::createActions() { _newProjectAction = new QAction( QIcon( "img/icones/new1.png" ), "New project", this ); _newProjectAction->setShortcut( QKeySequence( "Ctrl+N" ) ); _newProjectAction->setStatusTip( "Create a new project" ); connect( _newProjectAction, SIGNAL( triggered() ), this, SLOT( on_newProjectAction_triggered() ) ); _openProjectAction = new QAction( QIcon( "img/icones/open.png" ), "Open project", this ); _openProjectAction->setShortcut( QKeySequence( "Ctrl+O" ) ); _openProjectAction->setStatusTip( "Open a project" ); connect( _openProjectAction, SIGNAL( triggered() ), this, SLOT( on_openProjectAction_triggered() ) ); _saveProjectAction = new QAction( QIcon( "img/icones/save1.png" ), "Save", this ); _saveProjectAction->setShortcut( QKeySequence( "Ctrl+S" ) ); _saveProjectAction->setStatusTip( "Save your project" ); connect( _saveProjectAction, SIGNAL( triggered() ), this, SLOT( on_saveProjectAction_triggered() ) ); _saveAsProjectAction = new QAction( "Save As", this ); //_saveProjectAction->setShortcut( QKeySequence( "Ctrl+S" ) ); _saveProjectAction->setStatusTip( "Save your project" ); connect( _saveAsProjectAction, SIGNAL( triggered() ), this, SLOT( on_saveAsProjectAction_triggered() ) ); _quitAction = new QAction( QIcon( "img/icones/quit.png" ), "&Quitter", this ); _quitAction->setShortcut( QKeySequence( "Ctrl+Q" ) ); _quitAction->setStatusTip( "Quit Tweedy" ); connect( _quitAction, SIGNAL( triggered() ), qApp, SLOT( quit() ) ); _undoAction = new QAction( QIcon( "img/icones/undo.png" ), "Undo", this ); _undoAction->setShortcut( QKeySequence( "Ctrl+Z" ) ); connect( _undoAction, SIGNAL( triggered() ), this, SLOT( on_undoButton_clicked() ) ); _redoAction = new QAction( QIcon( "img/icones/redo.png" ), "Redo", this ); _redoAction->setShortcut( QKeySequence( "Shift+Ctrl+Z" ) ); connect( _redoAction, SIGNAL( triggered() ), this, SLOT( on_redoButton_clicked() ) ); _aboutAction = new QAction( "About Tweedy", this ); connect( _aboutAction, SIGNAL( triggered() ), this, SLOT( on_aboutAction_triggered() ) ); _aboutQtAction = new QAction( "About Qt", this ); connect( _aboutQtAction, SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) ); _configAction = new QAction( "Camera configuration", this ); connect( _configAction, SIGNAL( triggered() ), this, SLOT( on_configAction_triggered() ) ); _captureAction = new QAction( QIcon( "img/icones/capture.png" ), "Capture", this ); _captureAction->setShortcut( QKeySequence( "Retour" ) ); connect( _captureAction, SIGNAL( triggered() ), this, SLOT( on_captureAction_triggered() ) ); _exportAction = new QAction( "Export", this ); _exportAction->setStatusTip( "Export your timeline" ); connect( _exportAction, SIGNAL( triggered() ), this, SLOT( on_exportAction_triggered() ) ); _playPauseAction = new QAction( QIcon( "img/icones/play.png" ), "", this ); _playPauseAction->setShortcut( QKeySequence( "Space" ) ); _playPauseAction->setStatusTip( "Play" ); connect( _playPauseAction, SIGNAL( triggered() ), this, SLOT( handle_playPauseAction_triggered() ) ); _nextAction = new QAction( QIcon( "img/icones/next.png" ), "Next", this ); _nextAction->setShortcut( QKeySequence( "Alt+Right" ) ); _nextAction->setStatusTip( "Next clip" ); connect( _nextAction, SIGNAL( triggered() ), this, SLOT( handle_nextAction_triggered() ) ); _prevAction = new QAction( QIcon( "img/icones/previous.png" ), "Previous", this ); _prevAction->setShortcut( QKeySequence( "Alt+Left" ) ); _prevAction->setStatusTip( "Previous clip" ); connect( _prevAction, SIGNAL( triggered() ), this, SLOT( handle_prevAction_triggered() ) ); _zeroAction = new QAction( QIcon( "img/icones/retour0.png" ), "Reset", this ); _zeroAction->setShortcut( QKeySequence( "0" ) ); _zeroAction->setStatusTip( "Reset" ); connect( _zeroAction, SIGNAL( triggered() ), this, SLOT( handle_zeroAction_triggered() ) ); _initialPlaceWidgets = new QAction( "Restore display", this ); _initialPlaceWidgets->setStatusTip( "Restore widget's location" ); connect( _initialPlaceWidgets, SIGNAL( triggered() ), this, SLOT( on_initialPlaceWidgets_triggered() ) ); }
BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0) { restoreWindowGeometry(); setWindowTitle(tr("Zestcoin") + " - " + tr("Wallet")); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/zestcoin")); setWindowIcon(QIcon(":icons/zestcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Create wallet frame and make it the central widget walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); }