void KviToolBar::mousePressEvent(QMouseEvent * e) { if(!(e->button() & Qt::RightButton)) { QToolBar::mousePressEvent(e); return; } if(!g_pToolBarContextPopup) { g_pToolBarContextPopup = new QMenu(); g_pToolBarIconSizesPopup = new QMenu(); g_pToolBarWindowsPopup = new QMenu(); g_pToolBarButtonStylePopup = new QMenu(); QAction * pAction = g_pToolBarContextPopup->addAction(__tr2qs("Toolbars")); pAction->setMenu(g_pToolBarWindowsPopup); pAction = g_pToolBarContextPopup->addAction(__tr2qs("Icon Size")); pAction->setMenu(g_pToolBarIconSizesPopup); pAction = g_pToolBarContextPopup->addAction(__tr2qs("Button Style")); pAction->setMenu(g_pToolBarButtonStylePopup); // fill toolbars menu g_pMainWindow->fillToolBarsPopup(g_pToolBarWindowsPopup); // fill icon size menu QActionGroup * pIconSizeGroup = new QActionGroup(g_pToolBarIconSizesPopup); QAction * pTmp = nullptr; IconSizes iconSize; for(auto & valid_iconsize : valid_iconsizes) { iconSize = valid_iconsize; pTmp = pIconSizeGroup->addAction(g_pToolBarIconSizesPopup->addAction(__tr2qs(iconSize.pcName))); pTmp->setData((uint)iconSize.uSize); pTmp->setCheckable(true); if(iconSize.uSize == KVI_OPTION_UINT(KviOption_uintToolBarIconSize)) pTmp->setChecked(true); } connect(pIconSizeGroup, SIGNAL(triggered(QAction *)), g_pMainWindow, SLOT(iconSizePopupSelected(QAction *))); // fill button style menu QActionGroup * pButtonStyleGroup = new QActionGroup(g_pToolBarButtonStylePopup); pTmp = nullptr; ButtonStyles buttonStyle; for(auto & valid_buttonstyle : valid_buttonstyles) { buttonStyle = valid_buttonstyle; pTmp = pButtonStyleGroup->addAction(g_pToolBarButtonStylePopup->addAction(__tr2qs(buttonStyle.pcName))); pTmp->setData((uint)buttonStyle.uStyle); pTmp->setCheckable(true); if(buttonStyle.uStyle == KVI_OPTION_UINT(KviOption_uintToolBarButtonStyle)) pTmp->setChecked(true); } connect(pButtonStyleGroup, SIGNAL(triggered(QAction *)), g_pMainWindow, SLOT(buttonStylePopupSelected(QAction *))); } g_pToolBarContextPopup->popup(QCursor::pos()); }
MainGui::MainGui(QWidget *p) : QMainWindow(p), currenthdr(NULL) { setupUi(this); setAcceptDrops(true); //main toolbar setup QActionGroup *toolBarOptsGroup = new QActionGroup(this); toolBarOptsGroup->addAction(actionText_Under_Icons); toolBarOptsGroup->addAction(actionIcons_Only); toolBarOptsGroup->addAction(actionText_Alongside_Icons); toolBarOptsGroup->addAction(actionText_Only); menuToolbars->addAction(toolBar->toggleViewAction()); mdiArea = new QMdiArea(this); mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setBackground(QBrush(QColor::fromRgb(192, 192, 192)) ); setCentralWidget(mdiArea); qtpfsgui_options=QtpfsguiOptions::getInstance(); load_options(); setWindowTitle("Qtpfsgui "QTPFSGUIVERSION); connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(updateActions(QMdiSubWindow*))); connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNewViaWizard())); connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(TonemapAction, SIGNAL(triggered()), this, SLOT(tonemap_requested())); connect(rotateccw, SIGNAL(triggered()), this, SLOT(rotateccw_requested())); connect(rotatecw, SIGNAL(triggered()), this, SLOT(rotatecw_requested())); connect(actionResizeHDR, SIGNAL(triggered()), this, SLOT(resize_requested())); connect(action_Projective_Transformation, SIGNAL(triggered()), this, SLOT(projectiveTransf_requested())); connect(actionBatch_Tone_Mapping, SIGNAL(triggered()), this, SLOT(batch_requested())); connect(Low_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_ldr_exp())); connect(Fit_to_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_fit_exp())); connect(Shrink_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_shrink_exp())); connect(Extend_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_extend_exp())); connect(Decrease_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_decrease_exp())); connect(Increase_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_increase_exp())); connect(zoomInAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomin())); connect(zoomOutAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomout())); connect(fitToWindowAct,SIGNAL(toggled(bool)),this,SLOT(current_mdi_fit_to_win(bool))); connect(normalSizeAct,SIGNAL(triggered()),this,SLOT(current_mdi_original_size())); connect(documentationAction,SIGNAL(triggered()),this,SLOT(openDocumentation())); connect(actionWhat_s_This,SIGNAL(triggered()),this,SLOT(enterWhatsThis())); connect(actionAbout_Qt,SIGNAL(triggered()),qApp,SLOT(aboutQt())); connect(actionAbout_Qtpfsgui,SIGNAL(triggered()),this,SLOT(aboutQtpfsgui())); connect(OptionsAction,SIGNAL(triggered()),this,SLOT(preferences_called())); connect(Transplant_Exif_Data_action,SIGNAL(triggered()),this,SLOT(transplant_called())); connect(actionTile,SIGNAL(triggered()),mdiArea,SLOT(tileSubWindows())); connect(actionCascade,SIGNAL(triggered()),mdiArea,SLOT(cascadeSubWindows())); connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit())); connect(menuWindows, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu())); connect(actionSave_Hdr_Preview, SIGNAL(triggered()), this, SLOT(saveHdrPreview())); //QSignalMapper? connect(actionText_Under_Icons,SIGNAL(triggered()),this,SLOT(Text_Under_Icons())); connect(actionIcons_Only,SIGNAL(triggered()),this,SLOT(Icons_Only())); connect(actionText_Alongside_Icons,SIGNAL(triggered()),this,SLOT(Text_Alongside_Icons())); connect(actionText_Only,SIGNAL(triggered()),this,SLOT(Text_Only())); windowMapper = new QSignalMapper(this); connect(windowMapper,SIGNAL(mapped(QWidget*)),this,SLOT(setActiveSubWindow(QWidget*))); //recent files for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile())); } separatorRecentFiles = menuFile->addSeparator(); for (int i = 0; i < MaxRecentFiles; ++i) menuFile->addAction(recentFileActs[i]); updateRecentFileActions(); //this->showMaximized(); testTempDir(qtpfsgui_options->tempfilespath); statusBar()->showMessage(tr("Ready.... Now open an Hdr or create one!"),17000); }
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 Emerald 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 Emerald"), this); aboutAction->setToolTip(tr("Show information about Emerald")); 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 Emerald")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &Emerald"), this); toggleHideAction->setToolTip(tr("Show or hide the Emerald 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 BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(SingleColorIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(SingleColorIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Bitcoin address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); sendCoinsMenuAction = new QAction(TextColorIcon(":/icons/send"), sendCoinsAction->text(), this); sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip()); sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip()); receiveCoinsAction = new QAction(SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcoin: URIs)")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); receiveCoinsMenuAction = new QAction(TextColorIcon(":/icons/receiving_addresses"), receiveCoinsAction->text(), this); receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip()); receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip()); historyAction = new QAction(SingleColorIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); #ifdef ENABLE_WALLET // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. 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(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); // if we have a wallet, this is a menu. Otherwise the RPCConsole is the main widget. openRPCConsoleAction = new QAction(TextColorIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); #endif // ENABLE_WALLET quitAction = new QAction(TextColorIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(TextColorIcon(":/icons/about"), tr("&About Bitcoin XT"), this); aboutAction->setStatusTip(tr("Show information about Bitcoin XT")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(TextColorIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin XT")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(TextColorIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(TextColorIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(TextColorIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(TextColorIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them")); verifyMessageAction = new QAction(TextColorIcon(":/icons/verify"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses")); usedSendingAddressesAction = new QAction(TextColorIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); usedReceivingAddressesAction = new QAction(TextColorIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); openAction = new QAction(TextColorIcon(":/icons/open"), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a bitcoin: URI or payment request")); showHelpMessageAction = new QAction(TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); showHelpMessageAction->setStatusTip(tr("Show the Bitcoin XT help message to get a list with possible Bitcoin command-line options")); 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(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); #ifdef ENABLE_WALLET Q_ASSERT(walletFrame); connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showRPCConsoleWindow())); #endif // ENABLE_WALLET }
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); statisticsAction = new QAction(QIcon(":/icons/statistics"), tr("&Statistics"), this); statisticsAction->setToolTip(tr("View statistics")); statisticsAction->setCheckable(true); tabGroup->addAction(statisticsAction); chatAction = new QAction(QIcon(":/icons/social"), tr("&Social/Exchange"), this); chatAction->setToolTip(tr("View chat, links to social media and exchanges")); chatAction->setCheckable(true); tabGroup->addAction(chatAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a ColossusCoin2 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); blockAction = new QAction(QIcon(":/icons/block"), tr("&Block Explorer"), this); blockAction->setToolTip(tr("Explore the BlockChain")); blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); blockAction->setCheckable(true); tabGroup->addAction(blockAction); connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(statisticsAction, SIGNAL(triggered()), this, SLOT(gotoStatisticsPage())); connect(chatAction, SIGNAL(triggered()), this, SLOT(gotoChatPage())); 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/bitcoin"), tr("&About ColossusCoin2"), this); aboutAction->setToolTip(tr("Show information about ColossusCoin2")); aboutAction->setMenuRole(QAction::AboutRole); charityAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Stake For Charity"), this); charityAction->setToolTip(tr("Enable Stake For Charity")); charityAction->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 ColossusCoin2")); 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); checkWalletAction = new QAction(QIcon(":/icons/transaction_confirmed"), tr("&Check Wallet..."), this); checkWalletAction->setStatusTip(tr("Check wallet integrity and report findings")); repairWalletAction = new QAction(QIcon(":/icons/options"), tr("&Repair Wallet..."), this); repairWalletAction->setStatusTip(tr("Fix wallet integrity and remove orphans")); 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(charityAction, SIGNAL(triggered()), this, SLOT(charityClicked())); 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(checkWalletAction, SIGNAL(triggered()), this, SLOT(checkWallet())); connect(repairWalletAction, SIGNAL(triggered()), this, SLOT(repairWallet())); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(unlockWalletAction, SIGNAL(triggered()), this, SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), this, SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); /* zeewolf: Hot swappable wallet themes */ if (themesList.count()>0) { QSignalMapper* signalMapper = new QSignalMapper (this) ; //QActionGroup* menuActionGroup = new QActionGroup( this ); //menuActionGroup->setExclusive(true); // Add custom themes (themes directory) for( int i=0; i < themesList.count(); i++ ) { QString theme=themesList[i]; customActions[i] = new QAction(QIcon(":/icons/options"), theme, this); customActions[i]->setToolTip(QString("Switch to " + theme + " theme")); customActions[i]->setStatusTip(QString("Switch to " + theme + " theme")); //customActions[i]->setActionGroup(menuActionGroup); signalMapper->setMapping(customActions[i], theme); connect(customActions[i], SIGNAL(triggered()), signalMapper, SLOT (map())); } connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(changeTheme(QString))); } /* zeewolf: Hot swappable wallet themes */ }
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); 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 ppcoin address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); messageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message"), this); messageAction->setToolTip(tr("Prove you control an address")); #ifdef FIRST_CLASS_MESSAGING messageAction->setCheckable(true); #endif tabGroup->addAction(messageAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); 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(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage())); 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/ppcoin"), tr("&About %1").arg(qApp->applicationName()), this); aboutAction->setToolTip(tr("Show information about PPCoin")); 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 ppcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/ppcoin"), tr("Show/Hide &PPCoin"), this); toggleHideAction->setToolTip(tr("Show or hide the PPCoin 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(tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); exportPeercoinKeysAction = new QAction(QIcon(":/icons/export"), tr("&Export Peercoin keys"), this); exportPeercoinKeysAction->setToolTip(tr("Export the Peercoin keys associated with the Peershares addresses to Peercoin via RPC")); distributeDividendsAction = new QAction(tr("&Distribute dividends"), this); distributeDividendsAction->setToolTip(tr("Distribute dividends to share holders")); 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())); connect(exportPeercoinKeysAction, SIGNAL(triggered()), this, SLOT(exportPeercoinKeys())); connect(distributeDividendsAction, SIGNAL(triggered()), this, SLOT(distributeDividendsClicked())); }
MainWindow::MainWindow() : QMainWindow() , m_view(new SvgView) { QMenu *fileMenu = new QMenu(tr("&File"), this); QAction *openAction = fileMenu->addAction(tr("&Open...")); openAction->setShortcut(QKeySequence(tr("Ctrl+O"))); QAction *quitAction = fileMenu->addAction(tr("E&xit")); quitAction->setShortcut(QKeySequence(tr("Ctrl+Q"))); menuBar()->addMenu(fileMenu); QMenu *viewMenu = new QMenu(tr("&View"), this); m_backgroundAction = viewMenu->addAction(tr("&Background")); m_backgroundAction->setEnabled(false); m_backgroundAction->setCheckable(true); m_backgroundAction->setChecked(false); connect(m_backgroundAction, SIGNAL(toggled(bool)), m_view, SLOT(setViewBackground(bool))); m_outlineAction = viewMenu->addAction(tr("&Outline")); m_outlineAction->setEnabled(false); m_outlineAction->setCheckable(true); m_outlineAction->setChecked(true); connect(m_outlineAction, SIGNAL(toggled(bool)), m_view, SLOT(setViewOutline(bool))); menuBar()->addMenu(viewMenu); QMenu *rendererMenu = new QMenu(tr("&Renderer"), this); m_nativeAction = rendererMenu->addAction(tr("&Native")); m_nativeAction->setCheckable(true); m_nativeAction->setChecked(true); #ifndef QT_NO_OPENGL m_glAction = rendererMenu->addAction(tr("&OpenGL")); m_glAction->setCheckable(true); #endif m_imageAction = rendererMenu->addAction(tr("&Image")); m_imageAction->setCheckable(true); #ifndef QT_NO_OPENGL rendererMenu->addSeparator(); m_highQualityAntialiasingAction = rendererMenu->addAction(tr("&High Quality Antialiasing")); m_highQualityAntialiasingAction->setEnabled(false); m_highQualityAntialiasingAction->setCheckable(true); m_highQualityAntialiasingAction->setChecked(false); connect(m_highQualityAntialiasingAction, SIGNAL(toggled(bool)), m_view, SLOT(setHighQualityAntialiasing(bool))); #endif QActionGroup *rendererGroup = new QActionGroup(this); rendererGroup->addAction(m_nativeAction); #ifndef QT_NO_OPENGL rendererGroup->addAction(m_glAction); #endif rendererGroup->addAction(m_imageAction); menuBar()->addMenu(rendererMenu); connect(openAction, SIGNAL(triggered()), this, SLOT(openFile())); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(rendererGroup, SIGNAL(triggered(QAction *)), this, SLOT(setRenderer(QAction *))); setCentralWidget(m_view); setWindowTitle(tr("SVG Viewer")); }
MainWindow::MainWindow(FmPath* path): QMainWindow(), fileLauncher_(this) { Settings& settings = static_cast<Application*>(qApp)->settings(); setAttribute(Qt::WA_DeleteOnClose); // setup user interface ui.setupUi(this); // FIXME: why popup menus over back/forward buttons don't work when they're disabled? QToolButton* forwardButton = static_cast<QToolButton*>(ui.toolBar->widgetForAction(ui.actionGoForward)); forwardButton->setContextMenuPolicy(Qt::CustomContextMenu); connect(forwardButton, SIGNAL(customContextMenuRequested(QPoint)), SLOT(onBackForwardContextMenu(QPoint))); QToolButton* backButton = static_cast<QToolButton*>(ui.toolBar->widgetForAction(ui.actionGoBack)); backButton->setContextMenuPolicy(Qt::CustomContextMenu); connect(backButton, SIGNAL(customContextMenuRequested(QPoint)), SLOT(onBackForwardContextMenu(QPoint))); /* QToolButton* btn = new QToolButton(); btn->setArrowType(Qt::DownArrow); btn->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); ui.toolBar->insertWidget(ui.actionGoUp, btn); */ // tabbed browsing interface ui.tabBar->setDocumentMode(true); ui.tabBar->setTabsClosable(true); ui.tabBar->setElideMode(Qt::ElideRight); ui.tabBar->setExpanding(false); connect(ui.tabBar, SIGNAL(currentChanged(int)), SLOT(onTabBarCurrentChanged(int))); connect(ui.tabBar, SIGNAL(tabCloseRequested(int)), SLOT(onTabBarCloseRequested(int))); connect(ui.stackedWidget, SIGNAL(widgetRemoved(int)), SLOT(onStackedWidgetWidgetRemoved(int))); // side pane ui.sidePane->setIconSize(QSize(settings.sidePaneIconSize(), settings.sidePaneIconSize())); ui.sidePane->setMode(Fm::SidePane::ModePlaces); connect(ui.sidePane, SIGNAL(chdirRequested(int, FmPath*)), SLOT(onSidePaneChdirRequested(int, FmPath*))); // path bar pathEntry = new Fm::PathEdit(this); connect(pathEntry, SIGNAL(returnPressed()), SLOT(onPathEntryReturnPressed())); ui.toolBar->insertWidget(ui.actionGo, pathEntry); // add filesystem info to status bar fsInfoLabel = new QLabel(ui.statusbar); ui.statusbar->addPermanentWidget(fsInfoLabel); // setup the splitter ui.splitter->setStretchFactor(1, 1); // only the right pane can be stretched QList<int> sizes; sizes.append(150); sizes.append(300); ui.splitter->setSizes(sizes); // load bookmark menu bookmarks = fm_bookmarks_dup(); g_signal_connect(bookmarks, "changed", G_CALLBACK(onBookmarksChanged), this); loadBookmarksMenu(); // Fix the menu groups which is not done by Qt designer // To my suprise, this was supported in Qt designer 3 :-( QActionGroup* group = new QActionGroup(ui.menu_View); group->setExclusive(true); group->addAction(ui.actionIconView); group->addAction(ui.actionCompactView); group->addAction(ui.actionThumbnailView); group->addAction(ui.actionDetailedList); group = new QActionGroup(ui.menuSorting); group->setExclusive(true); group->addAction(ui.actionByFileName); group->addAction(ui.actionByMTime); group->addAction(ui.actionByFileSize); group->addAction(ui.actionByFileType); group->addAction(ui.actionByOwner); group = new QActionGroup(ui.menuSorting); group->setExclusive(true); group->addAction(ui.actionAscending); group->addAction(ui.actionDescending); // create shortcuts QShortcut* shortcut = new QShortcut(Qt::CTRL + Qt::Key_L, this); connect(shortcut, SIGNAL(activated()), pathEntry, SLOT(setFocus())); shortcut = new QShortcut(Qt::ALT + Qt::Key_D, this); connect(shortcut, SIGNAL(activated()), pathEntry, SLOT(setFocus())); shortcut = new QShortcut(Qt::CTRL + Qt::Key_Tab, this); connect(shortcut, SIGNAL(activated()), SLOT(onShortcutNextTab())); shortcut = new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this); connect(shortcut, SIGNAL(activated()), SLOT(onShortcutPrevTab())); int i; for(i = 0; i < 10; ++i) { shortcut = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_0 + i), this); connect(shortcut, SIGNAL(activated()), SLOT(onShortcutJumpToTab())); shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_0 + i), this); connect(shortcut, SIGNAL(activated()), SLOT(onShortcutJumpToTab())); } if(path) addTab(path); }
void TokenWithLayout::fillMenu( QMenu * menu ) { DEBUG_BLOCK KAction *boldAction = new KAction( KIcon( "format-text-bold"), i18n( "Bold" ), menu ); boldAction->setObjectName( ActionBoldName ); boldAction->setCheckable( true ); boldAction->setChecked( m_bold ); KAction *italicAction = new KAction( KIcon( "format-text-italic"), i18n( "Italic" ), menu ); italicAction->setObjectName( ActionItalicName ); italicAction->setCheckable( true ); italicAction->setChecked( m_italic ); KAction *alignLeftAction = new KAction( KIcon( "format-justify-left"), i18n( "Left" ), menu ); KAction *alignCenterAction = new KAction( KIcon( "format-justify-center"), i18n( "Center" ), menu ); KAction *alignRightAction = new KAction( KIcon( "format-justify-right"), i18n( "Right" ), menu ); alignLeftAction->setObjectName( ActionAlignLeftName ); alignLeftAction->setCheckable( true ); alignCenterAction->setObjectName( ActionAlignCenterName ); alignCenterAction->setCheckable( true ); alignRightAction->setObjectName( ActionAlignRightName ); alignRightAction->setCheckable( true ); if ( m_alignment & Qt::AlignLeft ) alignLeftAction->setChecked( true ); else if ( m_alignment & Qt::AlignHCenter ) alignCenterAction->setChecked( true ); else if ( m_alignment & Qt::AlignRight ) alignRightAction->setChecked( true ); QActionGroup *alignmentGroup = new QActionGroup( menu ); alignmentGroup->addAction( alignLeftAction ); alignmentGroup->addAction( alignCenterAction ); alignmentGroup->addAction( alignRightAction ); menu->addAction( boldAction ); menu->addAction( italicAction ); menu->addSeparator()->setText( i18n( "Alignment" ) ); menu->addAction( alignLeftAction ); menu->addAction( alignCenterAction ); menu->addAction( alignRightAction ); menu->addSeparator()->setText( i18n( "Width" ) ); menu->adjustSize(); int orgHeight = menu->height(); KHBox * sliderBox = new KHBox( menu ); sliderBox->setFixedWidth( menu->width() - 4 ); sliderBox->move( sliderBox->pos().x() + 2, orgHeight ); QSlider * slider = new QSlider( Qt::Horizontal, sliderBox ); slider->setMaximum( 100 ); slider->setMinimum( 0 ); // this should really not be done here as it makes upward assumptions // it was however done in setWidth with similar upward assumptions as well // solution: the popup stuff -iff- should be done in the dialog or the editWidget if ( parentWidget() ) { if ( TokenDropTarget *editWidget = qobject_cast<TokenDropTarget*>( parentWidget() ) ) { qreal spareWidth = 100.0; int row = editWidget->row( this ); if ( row > -1 ) { QList<Token*> tokens = editWidget->drags( row ); foreach (Token *t, tokens) { if (t == this) continue; if ( TokenWithLayout *twl = qobject_cast<TokenWithLayout*>( t ) ) spareWidth -= twl->width() * 100.0; } } int max = qMax( spareWidth, 0.0 ); debug() << "slider max value: " << max; if ( max >= m_width * 100.0 ) slider->setMaximum( qMax( spareWidth, 0.0 ) ); else slider->setMaximum( m_width * 100.0 ); }
ViewerWindow::ViewerWindow(): fileLoaded_(false){ setupUi( this ); #ifdef WIN32 //Reposition console window QRect myRegion=frameGeometry(); QPoint putAt=myRegion.topRight(); SetWindowPos(GetConsoleWindow(),winId(),putAt.x()+1,putAt.y(),0,0,SWP_NOSIZE); #endif mProdconn.ConnectConsumer( mViewer->InputPort()[0] ); mViewer->SetColorTransformType( M4D::GUI::ctTransferFunction1D ); action2D->setChecked(true); //---TF Editor--- std::vector<M4D::GUI::TF::Size> dataCT1D(1, 4096); //default CT editingSystem_ = M4D::GUI::TFPalette::Ptr(new M4D::GUI::TFPalette(this, dataCT1D)); editingSystem_->setupDefault(); bool previewUpdateConnected = QObject::connect(&(*editingSystem_), SIGNAL(UpdatePreview(M4D::GUI::TF::Size)), this, SLOT(updatePreview(M4D::GUI::TF::Size))); tfAssert(previewUpdateConnected); QDockWidget* dockWidget = new QDockWidget("Transfer Function Palette", this); dockWidget->setWidget( &(*editingSystem_) ); dockWidget->setFeatures(QDockWidget::AllDockWidgetFeatures); dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas); addDockWidget(Qt::LeftDockWidgetArea, dockWidget); dockWidget->setFloating(true); //---Timer--- changeChecker_.setInterval( 500 ); QObject::connect( &changeChecker_, SIGNAL( timeout() ), this, SLOT( updateTransferFunction() ) ); //---Viewer Switch--- QActionGroup *viewerTypeSwitch = new QActionGroup( this ); QSignalMapper *viewerTypeSwitchSignalMapper = new QSignalMapper( this ); viewerTypeSwitch->setExclusive( true ); viewerTypeSwitch->addAction( action2D ); viewerTypeSwitch->addAction( action3D ); viewerTypeSwitchSignalMapper->setMapping( action2D, M4D::GUI::rt2DAlignedSlices ); viewerTypeSwitchSignalMapper->setMapping( action3D, M4D::GUI::rt3D ); QObject::connect( action2D, SIGNAL( triggered() ), viewerTypeSwitchSignalMapper, SLOT( map() ) ); QObject::connect( action3D, SIGNAL( triggered() ), viewerTypeSwitchSignalMapper, SLOT( map() ) ); QObject::connect( viewerTypeSwitchSignalMapper, SIGNAL( mapped ( int ) ), this, SLOT( changeViewerType( int ) ) ); //---Mouse info--- QLabel *infoLabel = new QLabel(); statusbar->addWidget( infoLabel ); mViewer->setMouseTracking ( true ); QObject::connect( mViewer, SIGNAL( MouseInfoUpdate( const QString & ) ), infoLabel, SLOT( setText( const QString & ) ) ); //---Default buffer--- buffer_ = Buffer1D::Ptr(new Buffer1D(4096, Interval(0.0f, 4095.0f))); #ifdef TF_NDEBUG showMaximized(); #endif #ifndef TF_NDEBUG show(); #endif //show must be called before setting transfer function buffer mViewer->SetTransferFunctionBuffer(buffer_); }
MainWindow::MainWindow( QWidget *parent ) : QWidget( parent ) , cardsGroup( new QActionGroup( this ) ) { setAttribute( Qt::WA_DeleteOnClose, true ); setupUi( this ); cards->hide(); cards->hack(); languages->hack(); setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint ); #if QT_VERSION >= 0x040500 setWindowFlags( windowFlags() | Qt::WindowCloseButtonHint ); #else setWindowFlags( windowFlags() | Qt::WindowSystemMenuHint ); #endif // Buttons QButtonGroup *buttonGroup = new QButtonGroup( this ); buttonGroup->addButton( settings, HeadSettings ); buttonGroup->addButton( help, HeadHelp ); buttonGroup->addButton( about, HeadAbout ); buttonGroup->addButton( homeCreate, HomeCreate ); buttonGroup->addButton( homeView, HomeView ); introNext = introButtons->addButton( tr( "Next" ), QDialogButtonBox::ActionRole ); buttonGroup->addButton( introNext, IntroNext ); buttonGroup->addButton( introButtons->button( QDialogButtonBox::Cancel ), IntroBack ); viewCrypt = viewButtons->addButton( tr("Encrypt"), QDialogButtonBox::ActionRole ); buttonGroup->addButton( viewCrypt, ViewCrypt ); buttonGroup->addButton( viewButtons->button( QDialogButtonBox::Close ), ViewClose ); connect( buttonGroup, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)) ); connect( cards, SIGNAL(activated(QString)), qApp->poller(), SLOT(selectCard(QString)), Qt::QueuedConnection ); connect( qApp->poller(), SIGNAL(dataChanged()), SLOT(showCardStatus()) ); // Cryptodoc doc = new CryptoDoc( this ); // Translations lang << "et" << "en" << "ru"; retranslate(); QActionGroup *langGroup = new QActionGroup( this ); for( int i = 0; i < lang.size(); ++i ) { QAction *a = langGroup->addAction( new QAction( langGroup ) ); a->setData( lang[i] ); a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_0 + i ); } addActions( langGroup->actions() ); connect( langGroup, SIGNAL(triggered(QAction*)), SLOT(changeLang(QAction*)) ); connect( cardsGroup, SIGNAL(triggered(QAction*)), SLOT(changeCard(QAction*)) ); // Views connect( viewContentView, SIGNAL(remove(int)), SLOT(removeDocument(int)) ); connect( viewContentView, SIGNAL(save(int,QString)), doc, SLOT(saveDocument(int,QString)) ); }
HgCommitDialog::HgCommitDialog(QWidget *parent): KDialog(parent, Qt::Dialog) { // dialog properties this->setCaption(i18nc("@title:window", "<application>Hg</application> Commit")); this->setButtons(KDialog::Ok | KDialog::Cancel); this->setDefaultButton(KDialog::Ok); this->setButtonText(KDialog::Ok, i18nc("@action:button", "Commit")); this->enableButtonOk(false); // since commit message is empty when loaded // To show diff between commit KTextEditor::Editor *editor = KTextEditor::EditorChooser::editor(); if (!editor) { KMessageBox::error(this, i18n("A KDE text-editor component could not be found;" "\nplease check your KDE installation.")); return; } m_fileDiffDoc = editor->createDocument(0); m_fileDiffView = qobject_cast<KTextEditor::View*>(m_fileDiffDoc->createView(this)); m_fileDiffDoc->setReadWrite(false); // Setup actions m_useCurrentBranch= new KAction(this); m_useCurrentBranch->setCheckable(true); m_useCurrentBranch->setText(i18nc("@action:inmenu", "Commit to current branch")); m_newBranch = new KAction(this); m_newBranch->setCheckable(true); m_newBranch->setText(i18nc("@action:inmenu", "Create new branch")); m_closeBranch = new KAction(this); m_closeBranch->setCheckable(true); m_closeBranch->setText(i18nc("@action:inmenu", "Close current branch")); m_branchMenu = new KMenu(this); m_branchMenu->addAction(m_useCurrentBranch); m_branchMenu->addAction(m_newBranch); m_branchMenu->addAction(m_closeBranch); QActionGroup *branchActionGroup = new QActionGroup(this); branchActionGroup->addAction(m_useCurrentBranch); branchActionGroup->addAction(m_newBranch); branchActionGroup->addAction(m_closeBranch); m_useCurrentBranch->setChecked(true); connect(branchActionGroup, SIGNAL(triggered(QAction *)), this, SLOT(slotBranchActions(QAction *))); ////////////// // Setup UI // ////////////// // Top bar of buttons QHBoxLayout *topBarLayout = new QHBoxLayout; m_copyMessageButton = new KPushButton(i18n("Copy Message")); m_branchButton = new KPushButton(i18n("Branch")); m_copyMessageMenu = new KMenu(this); createCopyMessageMenu(); topBarLayout->addWidget(new QLabel(getParentForLabel())); topBarLayout->addStretch(); topBarLayout->addWidget(m_branchButton); topBarLayout->addWidget(m_copyMessageButton); m_branchButton->setMenu(m_branchMenu); m_copyMessageButton->setMenu(m_copyMessageMenu); // the commit box itself QGroupBox *messageGroupBox = new QGroupBox; QVBoxLayout *commitLayout = new QVBoxLayout; m_commitMessage = new QPlainTextEdit; commitLayout->addWidget(m_commitMessage); messageGroupBox->setTitle(i18nc("@title:group", "Commit Message")); messageGroupBox->setLayout(commitLayout); // Show diff here QGroupBox *diffGroupBox = new QGroupBox; QVBoxLayout *diffLayout = new QVBoxLayout(diffGroupBox); diffLayout->addWidget(m_fileDiffView); diffGroupBox->setTitle(i18nc("@title:group", "Diff/Content")); diffGroupBox->setLayout(diffLayout); // Set up layout for Status, Commit and Diff boxes QGridLayout *bodyLayout = new QGridLayout; m_statusList = new HgStatusList; bodyLayout->addWidget(m_statusList, 0, 0, 0, 1); bodyLayout->addWidget(messageGroupBox, 0, 1); bodyLayout->addWidget(diffGroupBox, 1, 1); bodyLayout->setColumnStretch(0, 1); bodyLayout->setColumnStretch(1, 2); bodyLayout->setRowStretch(0, 1); bodyLayout->setRowStretch(1, 1); // Set up layout and container for main dialog QFrame *frame = new QFrame; QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topBarLayout); mainLayout->addLayout(bodyLayout); frame->setLayout(mainLayout); setMainWidget(frame); slotBranchActions(m_useCurrentBranch); slotInitDiffOutput(); // initialise with whole repo diff // Load saved settings FileViewHgPluginSettings *settings = FileViewHgPluginSettings::self(); this->setInitialSize(QSize(settings->commitDialogWidth(), settings->commitDialogHeight())); // connect(m_statusList, SIGNAL(itemSelectionChanged(const char, const QString &)), this, SLOT(slotItemSelectionChanged(const char, const QString &))); connect(m_commitMessage, SIGNAL(textChanged()), this, SLOT(slotMessageChanged())); connect(this, SIGNAL(finished()), this, SLOT(saveGeometry())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_preferencesWindow(nullptr) { ui->setupUi(this); // Init actions for sidebar and menu ui->buttonDownloads->setDefaultAction(ui->actionDownloads); ui->buttonSeries->setDefaultAction(ui->actionTV_Shows); QActionGroup *viewActionGroup = new QActionGroup(this); viewActionGroup->addAction(ui->actionDownloads); viewActionGroup->addAction(ui->actionTV_Shows); // Init downloads page m_downloadsModel = new DownloadsItemModel(this); ui->treeViewDownloads->setAttribute(Qt::WA_MacShowFocusRect, false); ui->treeViewDownloads->setModel(m_downloadsModel); ui->treeViewDownloads->setItemDelegate(new DownloadsItemDelegate(this)); ui->treeViewDownloads->setContextMenuPolicy(Qt::ActionsContextMenu); ui->treeViewDownloads->addAction(ui->actionDeleteDownload); ui->treeViewDownloads->addAction(ui->actionResetDownload); ui->treeViewDownloads->addAction(ui->actionExtract); ui->treeViewDownloads->setSelectionMode(QAbstractItemView::ExtendedSelection); connect(ui->treeViewDownloads->selectionModel(), &QItemSelectionModel::selectionChanged, this, &MainWindow::enableActionsAccordingToDownloadSelection); // Init series page m_seriesModel = new SeriesListModel(this); ui->treeViewSeries->setAttribute(Qt::WA_MacShowFocusRect, false); ui->treeViewSeries->setModel(m_seriesModel); ui->treeViewSeries->setItemDelegate(new SeriesListItemDelegate(this)); m_seasonsModel = new SeasonsListModel(this); ui->treeViewSeasons->setAttribute(Qt::WA_MacShowFocusRect, false); ui->treeViewSeasons->setModel(m_seasonsModel); m_episodesModel = new EpisodesListModel(this); ui->treeViewEpisodes->setAttribute(Qt::WA_MacShowFocusRect, false); ui->treeViewEpisodes->setModel(m_episodesModel); connect(ui->treeViewSeries->selectionModel(), &QItemSelectionModel::selectionChanged, this, &MainWindow::showSeasonsForSelectedSeries); connect(ui->treeViewSeasons->selectionModel(), &QItemSelectionModel::selectionChanged, this, &MainWindow::showEpisodesForSelectedSeason); // Restore settings QSettings settings; restoreGeometry(settings.value(WINDOWGEOMETRY, "").toByteArray()); restoreState(settings.value(WINDOWSTATE, "").toByteArray()); ui->treeViewDownloads->header()->restoreState(settings.value(DOWNLOADSHEADERSTATE, "").toByteArray()); // ui->splitter_2->restoreState(settings.value(SERIESPAGESPLITTERSTATE, "").toByteArray()); connect(Controller::downloads(), &DownloadController::statusChanged, this, &MainWindow::enableActionsAccordingToDownloadStatus); enableActionsAccordingToDownloadSelection(); }
void QCSXCAD::BuildToolBar() { QToolBar *mainTB = addToolBar(tr("General")); mainTB->setObjectName("General_ToolBar"); QSize TBIconSize(16,16); mainTB->setIconSize(TBIconSize); if (QCSX_Settings.GetEdit()) mainTB->addAction(QIcon(":/images/filenew.png"),tr("New"),this,SLOT(New())); if (QCSX_Settings.GetEdit()) mainTB->addAction(QIcon(":/images/down.png"),tr("Import"),this,SLOT(ImportGeometry())); mainTB->addAction(QIcon(":/images/up.png"),tr("Export"),this,SLOT(ExportGeometry())); QToolBar *ItemTB = addToolBar(tr("Item View")); ItemTB->setIconSize(TBIconSize); ItemTB->setObjectName("Item_View_ToolBar"); ItemTB->addAction(tr("CollapseAll"),CSTree,SLOT(collapseAll())); ItemTB->addAction(tr("ExpandAll"),CSTree,SLOT(expandAll())); ItemTB->addAction(QIcon(":/images/bulb.png"),tr("ShowAll"),this,SLOT(ShowAll())); ItemTB->addAction(QIcon(":/images/bulb_off.png"),tr("HideAll"),this,SLOT(HideAll())); QToolBar *newObjct = NULL; QAction* newAct = NULL; if (QCSX_Settings.GetEdit()) { newObjct = addToolBar(tr("add new Primitive")); newObjct->setObjectName("New_Primitive_ToolBar"); newAct = newObjct->addAction(tr("Box"),this,SLOT(NewBox())); newAct->setToolTip(tr("add new Box")); newAct = newObjct->addAction(tr("MultiBox"),this,SLOT(NewMultiBox())); newAct->setToolTip(tr("add new Multi-Box")); newAct = newObjct->addAction(tr("Sphere"),this,SLOT(NewSphere())); newAct->setToolTip(tr("add new Sphere")); newAct = newObjct->addAction(tr("Cylinder"),this,SLOT(NewCylinder())); newAct->setToolTip(tr("add new Cylinder")); newAct = newObjct->addAction(tr("Polygon"),this,SLOT(NewPolygon())); newAct->setToolTip(tr("add new Polygon")); newAct = newObjct->addAction(tr("User Defined"),this,SLOT(NewUserDefined())); newAct->setToolTip(tr("add new User Definied Primitive")); newObjct = addToolBar(tr("add new Property")); newObjct->setObjectName("New_Property_ToolBar"); newAct = newObjct->addAction(tr("Material"),this,SLOT(NewMaterial())); newAct->setToolTip(tr("add new Material-Property")); newAct = newObjct->addAction(tr("Metal"),this,SLOT(NewMetal())); newAct->setToolTip(tr("add new Metal-Property")); newAct = newObjct->addAction(tr("Excitation"),this,SLOT(NewExcitation())); newAct->setToolTip(tr("add new Excitation-Property")); newAct = newObjct->addAction(tr("ProbeBox"),this,SLOT(NewChargeBox())); newAct->setToolTip(tr("add new Probe-Box-Property")); newAct = newObjct->addAction(tr("ResBox"),this,SLOT(NewResBox())); newAct->setToolTip(tr("add new Res-Box-Property")); newAct = newObjct->addAction(tr("DumpBox"),this,SLOT(NewDumpBox())); newAct->setToolTip(tr("add new Dump-Box-Property")); } newObjct = addToolBar(tr("Zoom")); newObjct->setIconSize(TBIconSize); newObjct->setObjectName("Zoom_ToolBar"); newAct = newObjct->addAction(QIcon(":/images/viewmagfit.png"),tr("Zoom fit"),this,SLOT(BestView())); newAct->setToolTip("Zoom to best fit all objects"); viewPlane[0] = newObjct->addAction(GridEditor->GetNormName(0),this,SLOT(setYZ())); viewPlane[0]->setToolTip(tr("Switch to y-z-plane view (x-normal)")); viewPlane[1] = newObjct->addAction(GridEditor->GetNormName(1),this,SLOT(setZX())); viewPlane[1]->setToolTip(tr("Switch to z-x-plane view (y-normal)")); viewPlane[2] = newObjct->addAction(GridEditor->GetNormName(2),this,SLOT(setXY())); viewPlane[2]->setToolTip(tr("Switch to x-y-plane view (z-normal)")); addToolBarBreak(); QActionGroup* ActViewGrp = new QActionGroup(this); newAct = newObjct->addAction(tr("2D"),this,SLOT(View2D())); newAct->setToolTip(tr("Switch to 2D view mode")); ActViewGrp->addAction(newAct); newAct->setCheckable(true); newAct = newObjct->addAction(tr("3D"),this,SLOT(View3D())); newAct->setToolTip(tr("Switch to 3D view mode")); ActViewGrp->addAction(newAct); newAct->setCheckable(true); m_PPview = newObjct->addAction(tr("PP")); m_PPview->setToolTip(tr("Toggle parallel projection view mode")); QObject::connect(m_PPview,SIGNAL(toggled(bool)),this,SLOT(SetParallelProjection(bool))); m_PPview->setCheckable(true); if (QCSX_Settings.GetEdit()) addToolBar(GridEditor->BuildToolbar()); }
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); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&SEND ZS"), this); sendCoinsAction->setToolTip(tr("Send coins to a Zimstake address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&RECEIVE ZS"), 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("&ADDRESSES"), 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); blockAction = new QAction(QIcon(":/icons/block"), tr("&EXPLORER"), this); blockAction->setToolTip(tr("Explore the BlockChain")); blockAction->setCheckable(true); blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); tabGroup->addAction(blockAction); chatAction = new QAction(QIcon(":/icons/ircchat"), tr("&IRC CHAT"), this); chatAction->setToolTip(tr("View chat")); chatAction->setCheckable(true); tabGroup->addAction(chatAction); 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(blockAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockExplorer())); connect(chatAction, SIGNAL(triggered()), this, SLOT(gotoChatPage())); 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/zimstake"), tr("&About Zimstake"), this); aboutAction->setToolTip(tr("Show information about Zimstake")); 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 Zimstake")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/zimstake"), 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()), 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(unlockWalletAction, SIGNAL(triggered()), this, SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), this, SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
XmlConsole::XmlConsole(Client* client, QWidget *parent) : QWidget(parent), m_ui(new Ui::XmlConsole), m_client(client), m_filter(0x1f) { m_ui->setupUi(this); m_client->addXmlStreamHandler(this); QPalette pal = palette(); pal.setColor(QPalette::Base, Qt::black); pal.setColor(QPalette::Text, Qt::white); m_ui->xmlBrowser->viewport()->setPalette(pal); QTextDocument *doc = m_ui->xmlBrowser->document(); doc->setDocumentLayout(new QPlainTextDocumentLayout(doc)); doc->clear(); QTextFrameFormat format = doc->rootFrame()->frameFormat(); format.setBackground(QColor(Qt::black)); format.setMargin(0); doc->rootFrame()->setFrameFormat(format); QMenu *menu = new QMenu(m_ui->filterButton); menu->setSeparatorsCollapsible(false); menu->addSeparator()->setText(tr("Filter")); QActionGroup *group = new QActionGroup(menu); QAction *disabled = group->addAction(menu->addAction(tr("Disabled"))); disabled->setCheckable(true); disabled->setData(Disabled); QAction *jid = group->addAction(menu->addAction(tr("By JID"))); jid->setCheckable(true); jid->setData(ByJid); QAction *xmlns = group->addAction(menu->addAction(tr("By namespace uri"))); xmlns->setCheckable(true); xmlns->setData(ByXmlns); QAction *attrb = group->addAction(menu->addAction(tr("By all attributes"))); attrb->setCheckable(true); attrb->setData(ByAllAttributes); disabled->setChecked(true); connect(group, SIGNAL(triggered(QAction*)), this, SLOT(onActionGroupTriggered(QAction*))); menu->addSeparator()->setText(tr("Visible stanzas")); group = new QActionGroup(menu); group->setExclusive(false); QAction *iq = group->addAction(menu->addAction(tr("Information query"))); iq->setCheckable(true); iq->setData(XmlNode::Iq); iq->setChecked(true); QAction *message = group->addAction(menu->addAction(tr("Message"))); message->setCheckable(true); message->setData(XmlNode::Message); message->setChecked(true); QAction *presence = group->addAction(menu->addAction(tr("Presence"))); presence->setCheckable(true); presence->setData(XmlNode::Presence); presence->setChecked(true); QAction *custom = group->addAction(menu->addAction(tr("Custom"))); custom->setCheckable(true); custom->setData(XmlNode::Custom); custom->setChecked(true); connect(group, SIGNAL(triggered(QAction*)), this, SLOT(onActionGroupTriggered(QAction*))); m_ui->filterButton->setMenu(menu); m_stackBracketsColor = QColor(0x666666); m_stackIncoming.bodyColor = QColor(0xbb66bb); m_stackIncoming.tagColor = QColor(0x006666); m_stackIncoming.attributeColor = QColor(0x009933); m_stackIncoming.paramColor = QColor(0xcc0000); m_stackOutgoing.bodyColor = QColor(0x999999); m_stackOutgoing.tagColor = QColor(0x22aa22); m_stackOutgoing.attributeColor = QColor(0xffff33); m_stackOutgoing.paramColor = QColor(0xdd8811); QAction *action = new QAction(tr("Close"),this); action->setSoftKeyRole(QAction::NegativeSoftKey); connect(action, SIGNAL(triggered()), SLOT(close())); addAction(action); }
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); 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); mintingAction = new QAction(QIcon(":/icons/stake"), tr("&Minting"), this); mintingAction->setToolTip(tr("Show your minting capacity")); mintingAction->setCheckable(true); mintingAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(mintingAction); 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_6)); 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 DigiCube address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); onthewebAction = new QAction(QIcon(":/icons/web"), tr("&On the Web"), this); onthewebAction->setToolTip(tr("Visit links related to DigiCube")); onthewebAction->setCheckable(true); onthewebAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7)); tabGroup->addAction(onthewebAction); messageAction = new QAction(QIcon(":/icons/edit"), tr("Sign/Verify &message"), this); messageAction->setToolTip(tr("Prove you control an address")); #ifdef FIRST_CLASS_MESSAGING messageAction->setCheckable(true); #endif tabGroup->addAction(messageAction); multisigAction = new QAction(QIcon(":/icons/send"), tr("Multisig"), this); tabGroup->addAction(multisigAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(mintingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(mintingAction, SIGNAL(triggered()), this, SLOT(gotoMintingPage())); 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(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage())); connect(multisigAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(multisigAction, SIGNAL(triggered()), this, SLOT(gotoMultisigPage())); connect(onthewebAction, SIGNAL(triggered()), this, SLOT(gotoOnthewebPage())); connect(onthewebAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); 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/DigiCube_tooltip"), tr("&About DigiCube"), this); aboutAction->setToolTip(tr("Show information about DigiCube")); 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 DigiCube")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/DigiCube_tooltip"), tr("Show/Hide &DigiCube"), this); toggleHideAction->setToolTip(tr("Show or hide the DigiCube 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); unlockForMintingAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Unlock Wallet for Minting Only"), this); unlockForMintingAction->setToolTip(tr("Unlock wallet only for minting. Sending coins will still require the passphrase.")); unlockForMintingAction->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(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(unlockForMintingAction, SIGNAL(triggered(bool)), this, SLOT(unlockForMinting(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Dashboard"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); blockAction = new QAction(QIcon(":/icons/block"), tr("&Block Explorer"), this); blockAction->setToolTip(tr("Explore the BlockChain")); blockAction->setCheckable(true); tabGroup->addAction(blockAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(receiveCoinsAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setToolTip(tr("Send coins to a SatoshiChain address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(sendCoinsAction); 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); statisticsAction = new QAction(QIcon(":/icons/statistics"), tr("&Statistics"), this); statisticsAction->setToolTip(tr("View statistics")); statisticsAction->setCheckable(true); statisticsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); tabGroup->addAction(statisticsAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(statisticsAction, SIGNAL(triggered()), this, SLOT(gotoStatisticsPage())); connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser())); 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(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(tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(tr("&About SatoshiChain"), this); aboutAction->setToolTip(tr("Show information about SatoshiChain")); 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(tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for SatoshiChain")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); encryptWalletAction = new QAction(tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); backupWalletAction = new QAction(tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this); unlockWalletAction->setToolTip(tr("Unlock wallet")); lockWalletAction = new QAction(tr("&Lock Wallet"), this); lockWalletAction->setToolTip(tr("Lock wallet")); signMessageAction = new QAction(tr("Sign &message..."), this); verifyMessageAction = new QAction(tr("&Verify message..."), this); exportAction = new QAction(tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); openRPCConsoleAction = new QAction(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()), this, SLOT(encryptWallet())); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(unlockWalletAction, SIGNAL(triggered()), this, SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), this, SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
VBoxDbgConsoleOutput::VBoxDbgConsoleOutput(QWidget *pParent/* = NULL*/, IVirtualBox *a_pVirtualBox /* = NULL */, const char *pszName/* = NULL*/) : QTextEdit(pParent), m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()), m_pVirtualBox(a_pVirtualBox) { setReadOnly(true); setUndoRedoEnabled(false); setOverwriteMode(false); setPlainText(""); setTextInteractionFlags(Qt::TextBrowserInteraction); setAutoFormatting(QTextEdit::AutoAll); setTabChangesFocus(true); setAcceptRichText(false); /* * Create actions for color-scheme menu items. */ m_pGreenOnBlackAction = new QAction(tr("Green On Black"), this); m_pGreenOnBlackAction->setCheckable(true); m_pGreenOnBlackAction->setShortcut(Qt::ControlModifier + Qt::Key_1); m_pGreenOnBlackAction->setData((int)kGreenOnBlack); connect(m_pGreenOnBlackAction, SIGNAL(triggered()), this, SLOT(sltSelectColorScheme())); m_pBlackOnWhiteAction = new QAction(tr("Black On White"), this); m_pBlackOnWhiteAction->setCheckable(true); m_pBlackOnWhiteAction->setShortcut(Qt::ControlModifier + Qt::Key_2); m_pBlackOnWhiteAction->setData((int)kBlackOnWhite); connect(m_pBlackOnWhiteAction, SIGNAL(triggered()), this, SLOT(sltSelectColorScheme())); /* Create action group for grouping of exclusive color-scheme menu items. */ QActionGroup *pActionColorGroup = new QActionGroup(this); pActionColorGroup->addAction(m_pGreenOnBlackAction); pActionColorGroup->addAction(m_pBlackOnWhiteAction); pActionColorGroup->setExclusive(true); /* * Create actions for font menu items. */ m_pCourierFontAction = new QAction(tr("Courier"), this); m_pCourierFontAction->setCheckable(true); m_pCourierFontAction->setShortcut(Qt::ControlModifier + Qt::Key_D); m_pCourierFontAction->setData((int)kFontType_Courier); connect(m_pCourierFontAction, SIGNAL(triggered()), this, SLOT(sltSelectFontType())); m_pMonospaceFontAction = new QAction(tr("Monospace"), this); m_pMonospaceFontAction->setCheckable(true); m_pMonospaceFontAction->setShortcut(Qt::ControlModifier + Qt::Key_M); m_pMonospaceFontAction->setData((int)kFontType_Monospace); connect(m_pMonospaceFontAction, SIGNAL(triggered()), this, SLOT(sltSelectFontType())); /* Create action group for grouping of exclusive font menu items. */ QActionGroup *pActionFontGroup = new QActionGroup(this); pActionFontGroup->addAction(m_pCourierFontAction); pActionFontGroup->addAction(m_pMonospaceFontAction); pActionFontGroup->setExclusive(true); /* * Create actions for font size menu. */ uint32_t const uDefaultFontSize = font().pointSize(); m_pActionFontSizeGroup = new QActionGroup(this); for (uint32_t i = 0; i < RT_ELEMENTS(m_apFontSizeActions); i++) { char szTitle[32]; RTStrPrintf(szTitle, sizeof(szTitle), s_uMinFontSize + i != uDefaultFontSize ? "%upt" : "%upt (default)", s_uMinFontSize + i); m_apFontSizeActions[i] = new QAction(tr(szTitle), this); m_apFontSizeActions[i]->setCheckable(true); m_apFontSizeActions[i]->setData(i + s_uMinFontSize); connect(m_apFontSizeActions[i], SIGNAL(triggered()), this, SLOT(sltSelectFontSize())); m_pActionFontSizeGroup->addAction(m_apFontSizeActions[i]); } /* * Set the defaults (which syncs with the menu item checked state). */ /* color scheme: */ com::Bstr bstrColor; HRESULT hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/ColorScheme").raw(), bstrColor.asOutParam()) : E_FAIL; if ( SUCCEEDED(hrc) && bstrColor.compareUtf8("blackonwhite", com::Bstr::CaseInsensitive) == 0) setColorScheme(kBlackOnWhite, false /*fSaveIt*/); else setColorScheme(kGreenOnBlack, false /*fSaveIt*/); /* font: */ com::Bstr bstrFont; hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/Font").raw(), bstrFont.asOutParam()) : E_FAIL; if ( SUCCEEDED(hrc) && bstrFont.compareUtf8("monospace", com::Bstr::CaseInsensitive) == 0) setFontType(kFontType_Monospace, false /*fSaveIt*/); else setFontType(kFontType_Courier, false /*fSaveIt*/); /* font size: */ com::Bstr bstrFontSize; hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/FontSize").raw(), bstrFontSize.asOutParam()) : E_FAIL; if (SUCCEEDED(hrc)) { com::Utf8Str strFontSize(bstrFontSize); uint32_t uFontSizePrf = strFontSize.strip().toUInt32(); if ( uFontSizePrf - s_uMinFontSize < (uint32_t)RT_ELEMENTS(m_apFontSizeActions) && uFontSizePrf != uDefaultFontSize) setFontSize(uFontSizePrf, false /*fSaveIt*/); } NOREF(pszName); }
QgsComposer::QgsComposer( QgisApp *qgis, const QString& title ) : QMainWindow() , mTitle( title ) , mUndoView( 0 ) { setupUi( this ); setWindowTitle( mTitle ); setupTheme(); connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) ); QSettings settings; int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt(); setIconSize( QSize( size, size ) ); #ifndef Q_WS_MAC setFontSize( settings.value( "/fontPointSize", QGIS_DEFAULT_FONTSIZE ).toInt() ); #endif QToolButton* orderingToolButton = new QToolButton( this ); orderingToolButton->setPopupMode( QToolButton::InstantPopup ); orderingToolButton->setAutoRaise( true ); orderingToolButton->setToolButtonStyle( Qt::ToolButtonIconOnly ); orderingToolButton->addAction( mActionRaiseItems ); orderingToolButton->addAction( mActionLowerItems ); orderingToolButton->addAction( mActionMoveItemsToTop ); orderingToolButton->addAction( mActionMoveItemsToBottom ); orderingToolButton->setDefaultAction( mActionRaiseItems ); toolBar->addWidget( orderingToolButton ); QToolButton* alignToolButton = new QToolButton( this ); alignToolButton->setPopupMode( QToolButton::InstantPopup ); alignToolButton->setAutoRaise( true ); alignToolButton->setToolButtonStyle( Qt::ToolButtonIconOnly ); alignToolButton->addAction( mActionAlignLeft ); alignToolButton->addAction( mActionAlignHCenter ); alignToolButton->addAction( mActionAlignRight ); alignToolButton->addAction( mActionAlignTop ); alignToolButton->addAction( mActionAlignVCenter ); alignToolButton->addAction( mActionAlignBottom ); alignToolButton->setDefaultAction( mActionAlignLeft ); toolBar->addWidget( alignToolButton ); QToolButton* shapeToolButton = new QToolButton( toolBar ); shapeToolButton->setCheckable( true ); shapeToolButton->setPopupMode( QToolButton::InstantPopup ); shapeToolButton->setAutoRaise( true ); shapeToolButton->setToolButtonStyle( Qt::ToolButtonIconOnly ); shapeToolButton->addAction( mActionAddRectangle ); shapeToolButton->addAction( mActionAddTriangle ); shapeToolButton->addAction( mActionAddEllipse ); shapeToolButton->setDefaultAction( mActionAddEllipse ); toolBar->insertWidget( mActionAddArrow, shapeToolButton ); QActionGroup* toggleActionGroup = new QActionGroup( this ); toggleActionGroup->addAction( mActionMoveItemContent ); toggleActionGroup->addAction( mActionAddNewMap ); toggleActionGroup->addAction( mActionAddNewLabel ); toggleActionGroup->addAction( mActionAddNewLegend ); toggleActionGroup->addAction( mActionAddNewScalebar ); toggleActionGroup->addAction( mActionAddImage ); toggleActionGroup->addAction( mActionSelectMoveItem ); toggleActionGroup->addAction( mActionAddRectangle ); toggleActionGroup->addAction( mActionAddTriangle ); toggleActionGroup->addAction( mActionAddEllipse ); toggleActionGroup->addAction( mActionAddArrow ); toggleActionGroup->addAction( mActionAddTable ); toggleActionGroup->setExclusive( true ); mActionAddNewMap->setCheckable( true ); mActionAddNewLabel->setCheckable( true ); mActionAddNewLegend->setCheckable( true ); mActionSelectMoveItem->setCheckable( true ); mActionAddNewScalebar->setCheckable( true ); mActionAddImage->setCheckable( true ); mActionMoveItemContent->setCheckable( true ); mActionAddArrow->setCheckable( true ); #ifdef Q_WS_MAC QMenu *appMenu = menuBar()->addMenu( tr( "QGIS" ) ); appMenu->addAction( QgisApp::instance()->actionAbout() ); appMenu->addAction( QgisApp::instance()->actionOptions() ); #endif QMenu *fileMenu = menuBar()->addMenu( tr( "File" ) ); fileMenu->addAction( mActionLoadFromTemplate ); fileMenu->addAction( mActionSaveAsTemplate ); fileMenu->addSeparator(); fileMenu->addAction( mActionExportAsImage ); fileMenu->addAction( mActionExportAsPDF ); fileMenu->addAction( mActionExportAsSVG ); fileMenu->addSeparator(); fileMenu->addAction( mActionPageSetup ); fileMenu->addAction( mActionPrint ); fileMenu->addSeparator(); fileMenu->addAction( mActionQuit ); QObject::connect( mActionQuit, SIGNAL( triggered() ), this, SLOT( close() ) ); QMenu *viewMenu = menuBar()->addMenu( tr( "View" ) ); viewMenu->addAction( mActionZoomIn ); viewMenu->addAction( mActionZoomOut ); viewMenu->addAction( mActionZoomAll ); viewMenu->addSeparator(); viewMenu->addAction( mActionRefreshView ); QMenu *layoutMenu = menuBar()->addMenu( tr( "Layout" ) ); layoutMenu->addAction( mActionUndo ); layoutMenu->addAction( mActionRedo ); layoutMenu->addSeparator(); layoutMenu->addAction( mActionAddNewMap ); layoutMenu->addAction( mActionAddNewLabel ); layoutMenu->addAction( mActionAddNewScalebar ); layoutMenu->addAction( mActionAddNewLegend ); layoutMenu->addAction( mActionAddImage ); layoutMenu->addAction( mActionSelectMoveItem ); layoutMenu->addAction( mActionMoveItemContent ); layoutMenu->addAction( mActionAddArrow ); layoutMenu->addAction( mActionAddTable ); layoutMenu->addSeparator(); layoutMenu->addAction( mActionGroupItems ); layoutMenu->addAction( mActionUngroupItems ); layoutMenu->addAction( mActionRaiseItems ); layoutMenu->addAction( mActionLowerItems ); layoutMenu->addAction( mActionMoveItemsToTop ); layoutMenu->addAction( mActionMoveItemsToBottom ); #ifdef Q_WS_MAC #ifndef Q_WS_MAC64 /* assertion failure in NSMenuItem setSubmenu (Qt 4.5.0-snapshot-20080830) */ menuBar()->addMenu( QgisApp::instance()->windowMenu() ); menuBar()->addMenu( QgisApp::instance()->helpMenu() ); #endif #endif mQgis = qgis; mFirstTime = true; // Create action to select this window mWindowAction = new QAction( windowTitle(), this ); connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) ); QgsDebugMsg( "entered." ); setMouseTracking( true ); mViewFrame->setMouseTracking( true ); //create composer view mView = new QgsComposerView( mViewFrame ); //init undo/redo buttons mComposition = new QgsComposition( mQgis->mapCanvas()->mapRenderer() ); mActionUndo->setEnabled( false ); mActionRedo->setEnabled( false ); if ( mComposition->undoStack() ) { connect( mComposition->undoStack(), SIGNAL( canUndoChanged( bool ) ), mActionUndo, SLOT( setEnabled( bool ) ) ); connect( mComposition->undoStack(), SIGNAL( canRedoChanged( bool ) ), mActionRedo, SLOT( setEnabled( bool ) ) ); }
MainWindow::MainWindow() : DemosMainWindow() { setupUi(this); this->graphicsView->setAcceptDrops(false); // Add a GraphicItem for the Delaunay triangulation dgi = new CGAL::Qt::TriangulationGraphicsItem<Delaunay>(&dt); QObject::connect(this, SIGNAL(changed()), dgi, SLOT(modelChanged())); dgi->setVerticesPen(QPen(Qt::red, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); scene.addItem(dgi); // Add a GraphicItem for the Voronoi diagram vgi = new CGAL::Qt::VoronoiGraphicsItem<Delaunay>(&dt); QObject::connect(this, SIGNAL(changed()), vgi, SLOT(modelChanged())); vgi->setEdgesPen(QPen(Qt::blue, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); scene.addItem(vgi); vgi->hide(); // Setup input handlers. They get events before the scene gets them // and the input they generate is passed to the triangulation with // the signal/slot mechanism pi = new CGAL::Qt::TriangulationPointInputAndConflictZone<Delaunay>(&scene, &dt, this ); QObject::connect(pi, SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object))); mp = new CGAL::Qt::TriangulationMovingPoint<Delaunay>(&dt, this); // TriangulationMovingPoint<Delaunay> emits a modelChanged() signal each // time the moving point moves. // The following connection is for the purpose of emitting changed(). QObject::connect(mp, SIGNAL(modelChanged()), this, SIGNAL(changed())); trv = new CGAL::Qt::TriangulationRemoveVertex<Delaunay>(&dt, this); QObject::connect(trv, SIGNAL(modelChanged()), this, SIGNAL(changed())); tcc = new CGAL::Qt::TriangulationCircumcircle<Delaunay>(&scene, &dt, this); tcc->setPen(QPen(Qt::red, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); cz = new CGAL::Qt::TriangulationConflictZone<Delaunay>(&scene, &dt, this); // // Manual handling of actions // QObject::connect(this->actionQuit, SIGNAL(triggered()), this, SLOT(close())); // We put mutually exclusive actions in an QActionGroup QActionGroup* ag = new QActionGroup(this); ag->addAction(this->actionInsertPoint); ag->addAction(this->actionMovingPoint); ag->addAction(this->actionCircumcenter); ag->addAction(this->actionShowConflictZone); // Check two actions this->actionInsertPoint->setChecked(true); this->actionShowDelaunay->setChecked(true); // // Setup the scene and the view // scene.setItemIndexMethod(QGraphicsScene::NoIndex); scene.setSceneRect(-100, -100, 100, 100); this->graphicsView->setScene(&scene); this->graphicsView->setMouseTracking(true); // Turn the vertical axis upside down this->graphicsView->matrix().scale(1, -1); // The navigation adds zooming and translation functionality to the // QGraphicsView this->addNavigation(this->graphicsView); this->setupStatusBar(); this->setupOptionsMenu(); this->addAboutDemo(":/cgal/help/about_Delaunay_triangulation_2.html"); this->addAboutCGAL(); this->setupExportSVG(actionExport_SVG, graphicsView); this->addRecentFiles(this->menuFile, this->actionQuit); connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); }
void JoyAxisContextMenu::buildAxisMenu() { QAction *action = 0; QActionGroup *presetGroup = new QActionGroup(this); int presetMode = 0; int currentPreset = getPresetIndex(); action = this->addAction(tr("Mouse (Horizontal)")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Mouse (Inverted Horizontal)")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Mouse (Vertical)")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Mouse (Inverted Vertical)")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Arrows: Up | Down")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Arrows: Left | Right")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Keys: W | S")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("Keys: A | D")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("NumPad: KP_8 | KP_2")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("NumPad: KP_4 | KP_6")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); presetMode++; action = this->addAction(tr("None")); action->setCheckable(true); action->setChecked(currentPreset == presetMode+1); action->setData(QVariant(presetMode)); connect(action, SIGNAL(triggered()), this, SLOT(setAxisPreset())); presetGroup->addAction(action); this->addSeparator(); action = this->addAction(tr("Mouse Settings")); action->setCheckable(false); connect(action, SIGNAL(triggered()), this, SLOT(openMouseSettingsDialog())); }
void EkwicoinGUI::createActions(bool fIsTestnet) { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Ekwicoin address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and ekwicoin: URIs)")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. 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())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); if (!fIsTestnet) aboutAction = new QAction(QIcon(":/icons/ekwicoin"), tr("&About Ekwicoin Core"), this); else aboutAction = new QAction(QIcon(":/icons/ekwicoin_testnet"), tr("&About Ekwicoin Core"), this); aboutAction->setStatusTip(tr("Show information about Ekwicoin")); aboutAction->setMenuRole(QAction::AboutRole); #if QT_VERSION < 0x050000 aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #else aboutQtAction = new QAction(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #endif aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Ekwicoin")); optionsAction->setMenuRole(QAction::PreferencesRole); if (!fIsTestnet) toggleHideAction = new QAction(QIcon(":/icons/ekwicoin"), tr("&Show / Hide"), this); else toggleHideAction = new QAction(QIcon(":/icons/ekwicoin_testnet"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Ekwicoin addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Ekwicoin addresses")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a ekwicoin: URI or payment request")); showHelpMessageAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Command-line options"), this); showHelpMessageAction->setStatusTip(tr("Show the Ekwicoin Core help message to get a list with possible Ekwicoin command-line options")); 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(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); #ifdef ENABLE_WALLET if(walletFrame) { connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); } #endif }
PianorollEditor::PianorollEditor(QWidget* parent) : QMainWindow(parent) { setWindowTitle(QString("MuseScore")); waveView = 0; _score = 0; staff = 0; QWidget* mainWidget = new QWidget; QToolBar* tb = addToolBar(tr("toolbar 1")); tb->addAction(getAction("undo")); tb->addAction(getAction("redo")); tb->addSeparator(); #ifdef HAS_MIDI tb->addAction(getAction("midi-on")); #endif tb->addSeparator(); tb->addAction(getAction("rewind")); tb->addAction(getAction("play")); tb->addSeparator(); tb->addAction(getAction("loop")); tb->addSeparator(); tb->addAction(getAction("repeat")); tb->addAction(getAction("follow")); tb->addSeparator(); tb->addAction(getAction("metronome")); showWave = new QAction(tr("Wave"), tb); showWave->setToolTip(tr("show wave display")); showWave->setCheckable(true); showWave->setChecked(false); connect(showWave, SIGNAL(toggled(bool)), SLOT(showWaveView(bool))); tb->addAction(showWave); //------------- tb = addToolBar(tr("toolbar 2")); static const char* sl3[] = { "voice-1", "voice-2", "voice-3", "voice-4" }; QActionGroup* voiceGroup = new QActionGroup(this); for (const char* s : sl3) { QAction* a = getAction(s); a->setCheckable(true); voiceGroup->addAction(a); tb->addAction(getAction(s)); } tb->addSeparator(); tb->addWidget(new QLabel(tr("Cursor:"))); pos = new Awl::PosLabel; pos->setFrameStyle(QFrame::NoFrame | QFrame::Plain); tb->addWidget(pos); Awl::PitchLabel* pl = new Awl::PitchLabel(); pl->setFrameStyle(QFrame::NoFrame | QFrame::Plain); tb->addWidget(pl); tb->addSeparator(); tb->addWidget(new QLabel(tr("Velocity:"))); veloType = new QComboBox; veloType->addItem(tr("offset"), MScore::OFFSET_VAL); veloType->addItem(tr("user"), MScore::USER_VAL); tb->addWidget(veloType); velocity = new QSpinBox; velocity->setRange(-1, 127); velocity->setSpecialValueText("--"); velocity->setReadOnly(true); tb->addWidget(velocity); tb->addWidget(new QLabel(tr("Pitch:"))); pitch = new Awl::PitchEdit; pitch->setReadOnly(true); tb->addWidget(pitch); //------------- qreal xmag = .1; ruler = new Ruler; ruler->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); ruler->setFixedHeight(rulerHeight); ruler->setMag(xmag, 1.0); Piano* piano = new Piano; piano->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); piano->setFixedWidth(pianoWidth); gv = new PianoView; gv->scale(xmag, 1.0); gv->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); gv->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); hsb = new QScrollBar(Qt::Horizontal); connect(gv->horizontalScrollBar(), SIGNAL(rangeChanged(int,int)), SLOT(rangeChanged(int,int))); // layout QHBoxLayout* hbox = new QHBoxLayout; hbox->setSpacing(0); hbox->addWidget(piano); hbox->addWidget(gv); split = new QSplitter(Qt::Vertical); split->setFrameShape(QFrame::NoFrame); QWidget* split1 = new QWidget; // piano - pianoview split1->setLayout(hbox); split->addWidget(split1); QGridLayout* layout = new QGridLayout; layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->setColumnMinimumWidth(0, pianoWidth + 5); layout->addWidget(tb, 0, 0, 1, 2); layout->addWidget(ruler, 1, 1); layout->addWidget(split, 2, 0, 1, 2); layout->addWidget(hsb, 3, 1); mainWidget->setLayout(layout); setCentralWidget(mainWidget); connect(gv->verticalScrollBar(), SIGNAL(valueChanged(int)), piano, SLOT(setYpos(int))); connect(gv, SIGNAL(magChanged(double,double)), ruler, SLOT(setMag(double,double))); connect(gv, SIGNAL(magChanged(double,double)), piano, SLOT(setMag(double,double))); connect(gv, SIGNAL(pitchChanged(int)), pl, SLOT(setPitch(int))); connect(gv, SIGNAL(pitchChanged(int)), piano, SLOT(setPitch(int))); connect(piano, SIGNAL(pitchChanged(int)), pl, SLOT(setPitch(int))); connect(gv, SIGNAL(posChanged(const Pos&)), pos, SLOT(setValue(const Pos&))); connect(gv, SIGNAL(posChanged(const Pos&)), ruler, SLOT(setPos(const Pos&))); connect(ruler, SIGNAL(posChanged(const Pos&)), pos, SLOT(setValue(const Pos&))); connect(hsb, SIGNAL(valueChanged(int)), SLOT(setXpos(int))); connect(gv, SIGNAL(xposChanged(int)), SLOT(setXpos(int))); connect(gv->horizontalScrollBar(), SIGNAL(valueChanged(int)), SLOT(setXpos(int))); connect(ruler, SIGNAL(locatorMoved(int, const Pos&)), SLOT(moveLocator(int, const Pos&))); connect(veloType, SIGNAL(activated(int)), SLOT(veloTypeChanged(int))); connect(velocity, SIGNAL(valueChanged(int)), SLOT(velocityChanged(int))); connect(gv->scene(), SIGNAL(selectionChanged()), SLOT(selectionChanged())); connect(piano, SIGNAL(keyPressed(int)), SLOT(keyPressed(int))); connect(piano, SIGNAL(keyReleased(int)), SLOT(keyReleased(int))); resize(800, 400); QActionGroup* ag = new QActionGroup(this); QAction* a = new QAction(this); a->setData("delete"); a->setShortcut(Qt::Key_Delete); ag->addAction(a); addActions(ag->actions()); connect(ag, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*))); setXpos(0); }
CoverFoundDialog::CoverFoundDialog( const CoverFetchUnit::Ptr unit, const CoverFetch::Metadata &data, QWidget *parent ) : KDialog( parent ) , m_album( unit->album() ) , m_isSorted( false ) , m_sortEnabled( false ) , m_unit( unit ) , m_queryPage( 0 ) { DEBUG_BLOCK setButtons( KDialog::Ok | KDialog::Cancel | KDialog::User1 ); // User1: clear icon view setButtonGuiItem( KDialog::User1, KStandardGuiItem::clear() ); connect( button( KDialog::User1 ), SIGNAL(clicked()), SLOT(clearView()) ); m_save = button( KDialog::Ok ); QSplitter *splitter = new QSplitter( this ); m_sideBar = new CoverFoundSideBar( m_album, splitter ); KVBox *vbox = new KVBox( splitter ); vbox->setSpacing( 4 ); KHBox *breadcrumbBox = new KHBox( vbox ); QLabel *breadcrumbLabel = new QLabel( i18n( "Finding cover for" ), breadcrumbBox ); AlbumBreadcrumbWidget *breadcrumb = new AlbumBreadcrumbWidget( m_album, breadcrumbBox ); QFont breadcrumbLabelFont; breadcrumbLabelFont.setBold( true ); breadcrumbLabel->setFont( breadcrumbLabelFont ); breadcrumbLabel->setIndent( 4 ); connect( breadcrumb, SIGNAL(artistClicked(QString)), SLOT(addToCustomSearch(QString)) ); connect( breadcrumb, SIGNAL(albumClicked(QString)), SLOT(addToCustomSearch(QString)) ); KHBox *searchBox = new KHBox( vbox ); vbox->setSpacing( 4 ); QStringList completionNames; QString firstRunQuery( m_album->name() ); completionNames << firstRunQuery; if( m_album->hasAlbumArtist() ) { const QString &name = m_album->albumArtist()->name(); completionNames << name; firstRunQuery += ' ' + name; } m_query = firstRunQuery; m_album->setSuppressImageAutoFetch( true ); m_search = new KComboBox( searchBox ); m_search->setEditable( true ); // creates a KLineEdit for the combobox m_search->setTrapReturnKey( true ); m_search->setInsertPolicy( QComboBox::NoInsert ); // insertion is handled by us m_search->setCompletionMode( KGlobalSettings::CompletionPopup ); m_search->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); qobject_cast<KLineEdit*>( m_search->lineEdit() )->setClickMessage( i18n( "Enter Custom Search" ) ); m_search->completionObject()->setOrder( KCompletion::Insertion ); m_search->completionObject()->setIgnoreCase( true ); m_search->completionObject()->setItems( completionNames ); m_search->insertItem( 0, KStandardGuiItem::find().icon(), QString() ); m_search->insertSeparator( 1 ); m_search->insertItem( 2, KIcon("filename-album-amarok"), m_album->name() ); if( m_album->hasAlbumArtist() ) m_search->insertItem( 3, KIcon("filename-artist-amarok"), m_album->albumArtist()->name() ); m_searchButton = new KPushButton( KStandardGuiItem::find(), searchBox ); KPushButton *sourceButton = new KPushButton( KStandardGuiItem::configure(), searchBox ); updateSearchButton( firstRunQuery ); QMenu *sourceMenu = new QMenu( sourceButton ); QAction *lastFmAct = new QAction( i18n( "Last.fm" ), sourceMenu ); QAction *googleAct = new QAction( i18n( "Google" ), sourceMenu ); QAction *discogsAct = new QAction( i18n( "Discogs" ), sourceMenu ); lastFmAct->setCheckable( true ); googleAct->setCheckable( true ); discogsAct->setCheckable( true ); connect( lastFmAct, SIGNAL(triggered()), this, SLOT(selectLastFm()) ); connect( googleAct, SIGNAL(triggered()), this, SLOT(selectGoogle()) ); connect( discogsAct, SIGNAL(triggered()), this, SLOT(selectDiscogs()) ); m_sortAction = new QAction( i18n( "Sort by size" ), sourceMenu ); m_sortAction->setCheckable( true ); connect( m_sortAction, SIGNAL(triggered(bool)), this, SLOT(sortingTriggered(bool)) ); QActionGroup *ag = new QActionGroup( sourceButton ); ag->addAction( lastFmAct ); ag->addAction( googleAct ); ag->addAction( discogsAct ); sourceMenu->addActions( ag->actions() ); sourceMenu->addSeparator(); sourceMenu->addAction( m_sortAction ); sourceButton->setMenu( sourceMenu ); connect( m_search, SIGNAL(returnPressed(QString)), SLOT(insertComboText(QString)) ); connect( m_search, SIGNAL(returnPressed(QString)), SLOT(processQuery(QString)) ); connect( m_search, SIGNAL(returnPressed(QString)), SLOT(updateSearchButton(QString)) ); connect( m_search, SIGNAL(editTextChanged(QString)), SLOT(updateSearchButton(QString)) ); connect( m_search->lineEdit(), SIGNAL(clearButtonClicked()), SLOT(clearQueryButtonClicked())); connect( m_searchButton, SIGNAL(clicked()), SLOT(processQuery()) ); m_view = new KListWidget( vbox ); m_view->setAcceptDrops( false ); m_view->setContextMenuPolicy( Qt::CustomContextMenu ); m_view->setDragDropMode( QAbstractItemView::NoDragDrop ); m_view->setDragEnabled( false ); m_view->setDropIndicatorShown( false ); m_view->setMovement( QListView::Static ); m_view->setGridSize( QSize( 140, 150 ) ); m_view->setIconSize( QSize( 120, 120 ) ); m_view->setSpacing( 4 ); m_view->setViewMode( QListView::IconMode ); m_view->setResizeMode( QListView::Adjust ); connect( m_view, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentItemChanged(QListWidgetItem*,QListWidgetItem*)) ); connect( m_view, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(itemDoubleClicked(QListWidgetItem*)) ); connect( m_view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(itemMenuRequested(QPoint)) ); splitter->addWidget( m_sideBar ); splitter->addWidget( vbox ); setMainWidget( splitter ); const KConfigGroup config = Amarok::config( "Cover Fetcher" ); const QString source = config.readEntry( "Interactive Image Source", "LastFm" ); m_sortEnabled = config.readEntry( "Sort by Size", false ); m_sortAction->setChecked( m_sortEnabled ); m_isSorted = m_sortEnabled; restoreDialogSize( config ); // call this after setMainWidget() if( source == "LastFm" ) lastFmAct->setChecked( true ); else if( source == "Discogs" ) discogsAct->setChecked( true ); else googleAct->setChecked( true ); typedef CoverFetchArtPayload CFAP; const CFAP *payload = dynamic_cast< const CFAP* >( unit->payload() ); if( !m_album->hasImage() ) m_sideBar->setPixmap( QPixmap::fromImage( m_album->image(190 ) ) ); else if( payload ) add( m_album->image(), data, payload->imageSize() ); else add( m_album->image(), data ); m_view->setCurrentItem( m_view->item( 0 ) ); updateGui(); connect( The::networkAccessManager(), SIGNAL(requestRedirected(QNetworkReply*,QNetworkReply*)), this, SLOT(fetchRequestRedirected(QNetworkReply*,QNetworkReply*)) ); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Your Piggy Bank"), this); overviewAction->setToolTip(tr("A virtual teller window at your own piggy bank")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Transfer Pennies"), this); sendCoinsAction->setToolTip(tr("Send pennies to another piggy bank")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Save Pennies"), this); receiveCoinsAction->setToolTip(tr("Deposit pennies in to your piggy bank")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Register"), this); historyAction->setToolTip(tr("Statement of transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Directory"), this); addressBookAction->setToolTip(tr("A list of other piggy banks with unique identifiers")); 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/bitcoin"), tr("&About Pennies"), this); aboutAction->setToolTip(tr("Show information about Pennies")); 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 Pennies")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Piggy Bank..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt Piggy Bank")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Piggy Bank..."), 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 information for use in other financial programs")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Command Line Banking"), this); openRPCConsoleAction->setToolTip(tr("Banking by text, for those who prefer less clicking")); 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())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Evopedia), titleListModel(new TitleListModel(this)) { titleListModel->setTitleIterator(TitleIterator()); ui->setupUi(this); Evopedia *evopedia = (static_cast<EvopediaApplication *>(qApp))->evopedia(); foreach (LocalArchive *b, evopedia->getArchiveManager()->getDefaultLocalArchives()) ui->languageChooser->addItem(b->getLanguage()); ui->listView->setModel(titleListModel); connect(evopedia->getArchiveManager(), SIGNAL(defaultLocalArchivesChanged(QList<LocalArchive*>)), SLOT(backendsChanged(QList<LocalArchive*>))); connect(evopedia->findChild<EvopediaWebServer *>("evopediaWebserver"), SIGNAL(mapViewRequested(qreal, qreal, uint)), SLOT(mapViewRequested(qreal,qreal,uint))); QActionGroup *network = new QActionGroup(this); network->addAction(ui->actionAuto); network->addAction(ui->actionAllow); network->addAction(ui->actionDeny); QActionGroup *access = new QActionGroup(this); access->addAction(ui->actionLocal); access->addAction(ui->actionNetwork); QSettings settings("Evopedia", "GUI"); int networkUse = settings.value("network use", 1).toInt(); evopedia->setNetworkUse(networkUse); if (networkUse < 0) ui->actionDeny->setChecked(true); else if (networkUse > 0) ui->actionAllow->setChecked(true); else ui->actionAuto->setChecked(true); if (evopedia->isPubliclyAccessible()) ui->actionNetwork->setChecked(true); else ui->actionLocal->setChecked(true); QString defaultLanguage = settings.value("default language", "").toString(); if (evopedia->getArchiveManager()->hasLanguage(defaultLanguage)) { for (int i = 0; i < ui->languageChooser->count(); i ++) { if (ui->languageChooser->itemText(i) == defaultLanguage) { ui->languageChooser->setCurrentIndex(i); break; } } } QPointF mapPos = settings.value("map pos", QPointF(10.7387413, 59.9138204)).toPointF(); int mapZoom = settings.value("map zoom", 15).toInt(); /* TODO1 this should be improved: any key press that is accepted by the searchField should go to the searchField */ /* TODO does not work setFocusPolicy(Qt::StrongFocus); setFocusProxy(ui->searchField); setFocus(); */ ui->searchField->setFocus(); mapWindow = new MapWindow(this); mapWindow->setPosition(mapPos.y(), mapPos.x(), mapZoom); dumpSettings = new DumpSettings(this); #ifndef Q_OS_SYMBIAN mapWindow->resize(600, 450); #endif #ifdef Q_WS_MAEMO_5 this->setAttribute(Qt::WA_Maemo5StackedWindow); mapWindow->setAttribute(Qt::WA_Maemo5StackedWindow); dumpSettings->setAttribute(Qt::WA_Maemo5StackedWindow); #endif ArchiveManager *archiveManager = evopedia->getArchiveManager(); if (archiveManager->getDefaultLocalArchives().isEmpty()) { QMessageBox::StandardButton answer = QMessageBox::question(this, tr("No Archives Configured"), tr("To be able to use evopedia you have to " "download a Wikipedia archive. " "This can be done from within evopedia " "via the menu option \"Archives\". " "If you only want to try out evopedia, " "you can use the language \"small\", which " "is a small version of the English Wikipedia.<br />" "Do you want to download an archive now?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (answer == QMessageBox::Yes) { dumpSettings->show(); archiveManager->updateRemoteArchives(); } } }
void AppWindow::createActions() { // Creates a new action for quiting and pushes it onto the menu actions vector QAction* quitAct = new QAction(tr("&Quit"), this); m_menu_actions.push_back(quitAct); // We set the accelerator keys // Alternatively, you could use: setShortcuts(Qt::CTRL + Qt::Key_P); quitAct->setShortcuts(QKeySequence::Quit); // Set the tip quitAct->setStatusTip(tr("Exits the file")); // Connect the action with the signal and slot designated connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); // Application menu QAction* resetPositionAct = new QAction(tr("Reset Pos&ition"), this); m_menu_actions.push_back(resetPositionAct); resetPositionAct->setShortcut(QKeySequence(Qt::Key_I)); connect(resetPositionAct, SIGNAL(triggered()), m_viewer, SLOT(resetPosition())); QAction* resetOrientationAct = new QAction(tr("Reset &Orientation"), this); m_menu_actions.push_back(resetOrientationAct); resetOrientationAct->setShortcut(QKeySequence(Qt::Key_O)); connect(resetOrientationAct, SIGNAL(triggered()), m_viewer, SLOT(resetOrientation())); QAction* resetAllAct = new QAction(tr("Reset &All"), this); m_menu_actions.push_back(resetAllAct); resetAllAct->setShortcut(QKeySequence(Qt::Key_A)); connect(resetAllAct, SIGNAL(triggered()), m_viewer, SLOT(resetAll())); // Mode menu QAction* posOriAct = new QAction(tr("&Position/Orientation"), this); m_menu_mode_actions.push_back(posOriAct); posOriAct->setShortcut(QKeySequence(Qt::Key_P)); posOriAct->setCheckable(true); connect(posOriAct, SIGNAL(triggered()), m_viewer, SLOT(setToPositionOrientation())); QAction* jointsAct = new QAction(tr("&Joints"), this); m_menu_mode_actions.push_back(jointsAct); jointsAct->setShortcut(QKeySequence(Qt::Key_J)); jointsAct->setCheckable(true); connect(jointsAct, SIGNAL(triggered()), m_viewer, SLOT(setToJoints())); QActionGroup* modeActionGroup = new QActionGroup(this); modeActionGroup->addAction(posOriAct); modeActionGroup->addAction(jointsAct); modeActionGroup->setExclusive(true); posOriAct->setChecked(true); // Edit menu QAction* undoAct = new QAction(tr("&Undo"), this); m_menu_edit_actions.push_back(undoAct); undoAct->setShortcut(QKeySequence(Qt::Key_U)); connect(undoAct, SIGNAL(triggered()), m_viewer, SLOT(undo())); QAction* redoAct = new QAction(tr("&Redo"), this); m_menu_edit_actions.push_back(redoAct); redoAct->setShortcut(QKeySequence(Qt::Key_R)); connect(redoAct, SIGNAL(triggered()), m_viewer, SLOT(redo())); // Options menu QAction* circleAct = new QAction(tr("&Circle"), this); m_menu_options_actions.push_back(circleAct); circleAct->setShortcut(QKeySequence(Qt::Key_C)); circleAct->setCheckable(true); connect(circleAct, SIGNAL(triggered()), m_viewer, SLOT(setToCircle())); QAction* zBufferAct = new QAction(tr("&Z-buffer"), this); m_menu_options_actions.push_back(zBufferAct); zBufferAct->setShortcut(QKeySequence(Qt::Key_Z)); zBufferAct->setCheckable(true); connect(zBufferAct, SIGNAL(triggered()), m_viewer, SLOT(setToZBuffer())); QAction* backfaceCullAct = new QAction(tr("&Backface cull"), this); m_menu_options_actions.push_back(backfaceCullAct); backfaceCullAct->setShortcut(QKeySequence(Qt::Key_B)); connect(backfaceCullAct, SIGNAL(triggered()), m_viewer, SLOT(setToBackfaceCull())); backfaceCullAct->setCheckable(true); QAction* frontfaceCullAct = new QAction(tr("&Frontface cull"), this); m_menu_options_actions.push_back(frontfaceCullAct); frontfaceCullAct->setShortcut(QKeySequence(Qt::Key_F)); connect(frontfaceCullAct, SIGNAL(triggered()), m_viewer, SLOT(setToFrontfaceCull())); frontfaceCullAct->setCheckable(true); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a CateDoge address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Addresses"), this); addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setToolTip(addressBookAction->statusTip()); 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->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About CateDoge"), this); aboutAction->setStatusTip(tr("Show information about CateDoge")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for CateDoge")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your CateDoge addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified CateDoge addresses")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(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)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
Menu::Menu() { MenuWrapper * fileMenu = addMenu("File"); #ifdef Q_OS_MAC addActionToQMenuAndActionHash(fileMenu, MenuOption::AboutApp, 0, qApp, SLOT(aboutApp()), QAction::AboutRole); #endif auto dialogsManager = DependencyManager::get<DialogsManager>(); AccountManager& accountManager = AccountManager::getInstance(); { addActionToQMenuAndActionHash(fileMenu, MenuOption::Login); // connect to the appropriate signal of the AccountManager so that we can change the Login/Logout menu item connect(&accountManager, &AccountManager::profileChanged, dialogsManager.data(), &DialogsManager::toggleLoginDialog); connect(&accountManager, &AccountManager::logoutComplete, dialogsManager.data(), &DialogsManager::toggleLoginDialog); } addDisabledActionAndSeparator(fileMenu, "Scripts"); addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, qApp, SLOT(loadDialog())); addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL, Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog())); addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts())); addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R, qApp, SLOT(reloadAllScripts())); addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J, qApp, SLOT(toggleRunningScriptsWidget())); addDisabledActionAndSeparator(fileMenu, "Location"); qApp->getBookmarks()->setupMenus(this, fileMenu); addActionToQMenuAndActionHash(fileMenu, MenuOption::AddressBar, Qt::CTRL | Qt::Key_L, dialogsManager.data(), SLOT(toggleAddressBar())); auto addressManager = DependencyManager::get<AddressManager>(); addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0, addressManager.data(), SLOT(copyAddress())); addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0, addressManager.data(), SLOT(copyPath())); addActionToQMenuAndActionHash(fileMenu, MenuOption::Quit, Qt::CTRL | Qt::Key_Q, qApp, SLOT(quit()), QAction::QuitRole); MenuWrapper* editMenu = addMenu("Edit"); QUndoStack* undoStack = qApp->getUndoStack(); QAction* undoAction = undoStack->createUndoAction(editMenu); undoAction->setShortcut(Qt::CTRL | Qt::Key_Z); addActionToQMenuAndActionHash(editMenu, undoAction); QAction* redoAction = undoStack->createRedoAction(editMenu); redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z); addActionToQMenuAndActionHash(editMenu, redoAction); addActionToQMenuAndActionHash(editMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_Comma, dialogsManager.data(), SLOT(editPreferences()), QAction::PreferencesRole); addActionToQMenuAndActionHash(editMenu, MenuOption::Attachments, 0, dialogsManager.data(), SLOT(editAttachments())); addActionToQMenuAndActionHash(editMenu, MenuOption::Animations, 0, dialogsManager.data(), SLOT(editAnimations())); MenuWrapper* toolsMenu = addMenu("Tools"); addActionToQMenuAndActionHash(toolsMenu, MenuOption::ScriptEditor, Qt::ALT | Qt::Key_S, dialogsManager.data(), SLOT(showScriptEditor())); #if defined(Q_OS_MAC) || defined(Q_OS_WIN) auto speechRecognizer = DependencyManager::get<SpeechRecognizer>(); QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(toolsMenu, MenuOption::ControlWithSpeech, Qt::CTRL | Qt::SHIFT | Qt::Key_C, speechRecognizer->getEnabled(), speechRecognizer.data(), SLOT(setEnabled(bool))); connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); #endif addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat, 0, // QML Qt::Key_Backslash, dialogsManager.data(), SLOT(showIRCLink())); addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0, qApp, SLOT(showFriendsWindow())); MenuWrapper* visibilityMenu = toolsMenu->addMenu("I Am Visible To"); { QActionGroup* visibilityGroup = new QActionGroup(toolsMenu); auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>(); QAction* visibleToEveryone = addCheckableActionToQMenuAndActionHash(visibilityMenu, MenuOption::VisibleToEveryone, 0, discoverabilityManager->getDiscoverabilityMode() == Discoverability::All, discoverabilityManager.data(), SLOT(setVisibility())); visibilityGroup->addAction(visibleToEveryone); QAction* visibleToFriends = addCheckableActionToQMenuAndActionHash(visibilityMenu, MenuOption::VisibleToFriends, 0, discoverabilityManager->getDiscoverabilityMode() == Discoverability::Friends, discoverabilityManager.data(), SLOT(setVisibility())); visibilityGroup->addAction(visibleToFriends); QAction* visibleToNoOne = addCheckableActionToQMenuAndActionHash(visibilityMenu, MenuOption::VisibleToNoOne, 0, discoverabilityManager->getDiscoverabilityMode() == Discoverability::None, discoverabilityManager.data(), SLOT(setVisibility())); visibilityGroup->addAction(visibleToNoOne); connect(discoverabilityManager.data(), &DiscoverabilityManager::discoverabilityModeChanged, discoverabilityManager.data(), &DiscoverabilityManager::visibilityChanged); } addActionToQMenuAndActionHash(toolsMenu, MenuOption::ToolWindow, Qt::CTRL | Qt::ALT | Qt::Key_T, dialogsManager.data(), SLOT(toggleToolWindow())); addActionToQMenuAndActionHash(toolsMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, DependencyManager::get<StandAloneJSConsole>().data(), SLOT(toggleConsole())); addActionToQMenuAndActionHash(toolsMenu, MenuOption::ResetSensors, 0, // QML Qt::Key_Apostrophe, qApp, SLOT(resetSensors())); addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0, qApp, SLOT(packageModel())); MenuWrapper* avatarMenu = addMenu("Avatar"); QObject* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar(); MenuWrapper* avatarSizeMenu = avatarMenu->addMenu("Size"); addActionToQMenuAndActionHash(avatarSizeMenu, MenuOption::IncreaseAvatarSize, 0, // QML Qt::Key_Plus, avatar, SLOT(increaseSize())); addActionToQMenuAndActionHash(avatarSizeMenu, MenuOption::DecreaseAvatarSize, 0, // QML Qt::Key_Minus, avatar, SLOT(decreaseSize())); addActionToQMenuAndActionHash(avatarSizeMenu, MenuOption::ResetAvatarSize, 0, // QML Qt::Key_Equal, avatar, SLOT(resetSize())); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::KeyboardMotorControl, Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar, SLOT(updateMotionBehavior())); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::ScriptedMotorControl, 0, true, avatar, SLOT(updateMotionBehavior())); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::GlowWhenSpeaking, 0, true); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableCharacterController, 0, true, avatar, SLOT(updateMotionBehavior())); addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::ShiftHipsForIdleAnimations, 0, false, avatar, SLOT(updateMotionBehavior())); MenuWrapper* viewMenu = addMenu("View"); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Fullscreen, #ifdef Q_OS_MAC Qt::CTRL | Qt::META | Qt::Key_F, #else Qt::CTRL | Qt::Key_F, #endif false, qApp, SLOT(setFullscreen(bool))); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPerson, 0, // QML Qt::Key_P, true, qApp, SLOT(cameraMenuChanged())); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror, 0, //QML Qt::SHIFT | Qt::Key_H, true); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror, 0, // QML Qt::Key_H, false, qApp, SLOT(cameraMenuChanged())); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools, #ifdef Q_OS_MAC Qt::META | Qt::Key_H, #else Qt::CTRL | Qt::Key_H, #endif false, dialogsManager.data(), SLOT(hmdTools(bool))); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::EnableVRMode, 0, false, qApp, SLOT(setEnableVRMode(bool))); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Enable3DTVMode, 0, false, qApp, SLOT(setEnable3DTVMode(bool))); MenuWrapper* nodeBordersMenu = viewMenu->addMenu("Server Borders"); NodeBounds& nodeBounds = qApp->getNodeBoundsDisplay(); addCheckableActionToQMenuAndActionHash(nodeBordersMenu, MenuOption::ShowBordersEntityNodes, Qt::CTRL | Qt::SHIFT | Qt::Key_1, false, &nodeBounds, SLOT(setShowEntityNodes(bool))); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats); addActionToQMenuAndActionHash(viewMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L, qApp, SLOT(toggleLogDialog())); addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0, dialogsManager.data(), SLOT(bandwidthDetails())); addActionToQMenuAndActionHash(viewMenu, MenuOption::OctreeStats, 0, dialogsManager.data(), SLOT(octreeStatsDetails())); MenuWrapper* developerMenu = addMenu("Developer"); MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render"); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere, 0, // QML Qt::SHIFT | Qt::Key_A, true); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DontFadeOnOctreeServerChanges); MenuWrapper* ambientLightMenu = renderOptionsMenu->addMenu(MenuOption::RenderAmbientLight); QActionGroup* ambientLightGroup = new QActionGroup(ambientLightMenu); ambientLightGroup->setExclusive(true); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLightGlobal, 0, true)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight0, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight1, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight2, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight3, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight4, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight5, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight6, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight7, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight8, 0, false)); ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight9, 0, false)); MenuWrapper* shadowMenu = renderOptionsMenu->addMenu("Shadows"); QActionGroup* shadowGroup = new QActionGroup(shadowMenu); shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, "None", 0, true)); shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::SimpleShadows, 0, false)); shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::CascadedShadows, 0, false)); { MenuWrapper* framerateMenu = renderOptionsMenu->addMenu(MenuOption::RenderTargetFramerate); QActionGroup* framerateGroup = new QActionGroup(framerateMenu); framerateGroup->setExclusive(true); framerateGroup->addAction(addCheckableActionToQMenuAndActionHash(framerateMenu, MenuOption::RenderTargetFramerateUnlimited, 0, true)); framerateGroup->addAction(addCheckableActionToQMenuAndActionHash(framerateMenu, MenuOption::RenderTargetFramerate60, 0, false)); framerateGroup->addAction(addCheckableActionToQMenuAndActionHash(framerateMenu, MenuOption::RenderTargetFramerate50, 0, false)); framerateGroup->addAction(addCheckableActionToQMenuAndActionHash(framerateMenu, MenuOption::RenderTargetFramerate40, 0, false)); framerateGroup->addAction(addCheckableActionToQMenuAndActionHash(framerateMenu, MenuOption::RenderTargetFramerate30, 0, false)); #if defined(Q_OS_MAC) #else addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::RenderTargetFramerateVSyncOn, 0, true, qApp, SLOT(setVSyncEnabled())); #endif } MenuWrapper* resolutionMenu = renderOptionsMenu->addMenu(MenuOption::RenderResolution); QActionGroup* resolutionGroup = new QActionGroup(resolutionMenu); resolutionGroup->setExclusive(true); resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionOne, 0, true)); resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionTwoThird, 0, false)); resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionHalf, 0, false)); resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, false)); resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false)); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, 0, // QML Qt::Key_Asterisk, true); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true, DependencyManager::get<GlowEffect>().data(), SLOT(toggleGlowEffect(bool))); addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false); addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0, // QML Qt::SHIFT | Qt::Key_L, dialogsManager.data(), SLOT(lodTools())); MenuWrapper* avatarDebugMenu = developerMenu->addMenu("Avatar"); MenuWrapper* faceTrackingMenu = avatarDebugMenu->addMenu("Face Tracking"); { QActionGroup* faceTrackerGroup = new QActionGroup(avatarDebugMenu); QAction* noFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::NoFaceTracking, 0, true, qApp, SLOT(setActiveFaceTracker())); faceTrackerGroup->addAction(noFaceTracker); #ifdef HAVE_FACESHIFT QAction* faceshiftFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::Faceshift, 0, false, qApp, SLOT(setActiveFaceTracker())); faceTrackerGroup->addAction(faceshiftFaceTracker); #endif #ifdef HAVE_DDE QAction* ddeFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::UseCamera, 0, false, qApp, SLOT(setActiveFaceTracker())); faceTrackerGroup->addAction(ddeFaceTracker); #endif } #ifdef HAVE_DDE faceTrackingMenu->addSeparator(); QAction* binaryEyelidControl = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::BinaryEyelidControl, 0, true); binaryEyelidControl->setVisible(false); QAction* useAudioForMouth = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::UseAudioForMouth, 0, true); useAudioForMouth->setVisible(false); QAction* ddeFiltering = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::VelocityFilter, 0, true); ddeFiltering->setVisible(false); QAction* ddeCalibrate = addActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::CalibrateCamera, 0, DependencyManager::get<DdeFaceTracker>().data(), SLOT(calibrate())); ddeCalibrate->setVisible(false); #endif #if defined(HAVE_FACESHIFT) || defined(HAVE_DDE) faceTrackingMenu->addSeparator(); addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::MuteFaceTracking, Qt::CTRL | Qt::SHIFT | Qt::Key_F, false, qApp, SLOT(toggleFaceTrackerMute())); #endif auto avatarManager = DependencyManager::get<AvatarManager>(); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false, avatarManager.data(), SLOT(setShouldShowReceiveStats(bool))); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderSkeletonCollisionShapes); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderHeadCollisionShapes); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderBoundingCollisionShapes); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderLookAtVectors, 0, false); addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false); MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands"); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlternateIK, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false); MenuWrapper* sixenseOptionsMenu = handOptionsMenu->addMenu("Sixense"); #ifdef __APPLE__ addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu, MenuOption::SixenseEnabled, 0, false, &SixenseManager::getInstance(), SLOT(toggleSixense(bool))); #endif addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu, MenuOption::FilterSixense, 0, true, &SixenseManager::getInstance(), SLOT(setFilter(bool))); addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu, MenuOption::LowVelocityFilter, 0, true, qApp, SLOT(setLowVelocityFilter(bool))); addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu, MenuOption::SixenseMouseInput, 0, true); addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu, MenuOption::SixenseLasers, 0, false); MenuWrapper* leapOptionsMenu = handOptionsMenu->addMenu("Leap Motion"); addCheckableActionToQMenuAndActionHash(leapOptionsMenu, MenuOption::LeapMotionOnHMD, 0, false); #ifdef HAVE_RSSDK MenuWrapper* realSenseOptionsMenu = handOptionsMenu->addMenu("RealSense"); addActionToQMenuAndActionHash(realSenseOptionsMenu, MenuOption::LoadRSSDKFile, 0, RealSense::getInstance(), SLOT(loadRSSDKFile())); #endif MenuWrapper* networkMenu = developerMenu->addMenu("Network"); addCheckableActionToQMenuAndActionHash(networkMenu, MenuOption::DisableNackPackets, 0, false); addCheckableActionToQMenuAndActionHash(networkMenu, MenuOption::DisableActivityLogger, 0, false, &UserActivityLogger::getInstance(), SLOT(disable(bool))); addActionToQMenuAndActionHash(networkMenu, MenuOption::CachesSize, 0, dialogsManager.data(), SLOT(cachesSizeDialog())); addActionToQMenuAndActionHash(networkMenu, MenuOption::DiskCacheEditor, 0, dialogsManager.data(), SLOT(toggleDiskCacheEditor())); MenuWrapper* timingMenu = developerMenu->addMenu("Timing and Stats"); MenuWrapper* perfTimerMenu = timingMenu->addMenu("Performance Timer"); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::DisplayDebugTimingDetails, 0, false); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::OnlyDisplayTopTen, 0, true); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::ExpandUpdateTiming, 0, false); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::ExpandMyAvatarTiming, 0, false); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::ExpandMyAvatarSimulateTiming, 0, false); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::ExpandOtherAvatarTiming, 0, false); addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::ExpandPaintGLTiming, 0, false); addCheckableActionToQMenuAndActionHash(timingMenu, MenuOption::TestPing, 0, true); addCheckableActionToQMenuAndActionHash(timingMenu, MenuOption::FrameTimer); addActionToQMenuAndActionHash(timingMenu, MenuOption::RunTimingTests, 0, qApp, SLOT(runTests())); addCheckableActionToQMenuAndActionHash(timingMenu, MenuOption::PipelineWarnings); addCheckableActionToQMenuAndActionHash(timingMenu, MenuOption::SuppressShortTimings); auto audioIO = DependencyManager::get<AudioClient>(); MenuWrapper* audioDebugMenu = developerMenu->addMenu("Audio"); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioNoiseReduction, 0, true, audioIO.data(), SLOT(toggleAudioNoiseReduction())); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoServerAudio, 0, false, audioIO.data(), SLOT(toggleServerEcho())); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoLocalAudio, 0, false, audioIO.data(), SLOT(toggleLocalEcho())); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::MuteAudio, Qt::CTRL | Qt::Key_M, false, audioIO.data(), SLOT(toggleMute())); addActionToQMenuAndActionHash(audioDebugMenu, MenuOption::MuteEnvironment, 0, audioIO.data(), SLOT(sendMuteEnvironmentPacket())); auto scope = DependencyManager::get<AudioScope>(); MenuWrapper* audioScopeMenu = audioDebugMenu->addMenu("Audio Scope"); addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScope, Qt::CTRL | Qt::Key_P, false, scope.data(), SLOT(toggle())); addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopePause, Qt::CTRL | Qt::SHIFT | Qt::Key_P , false, scope.data(), SLOT(togglePause())); addDisabledActionAndSeparator(audioScopeMenu, "Display Frames"); { QAction *fiveFrames = addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopeFiveFrames, 0, true, scope.data(), SLOT(selectAudioScopeFiveFrames())); QAction *twentyFrames = addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopeTwentyFrames, 0, false, scope.data(), SLOT(selectAudioScopeTwentyFrames())); QAction *fiftyFrames = addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopeFiftyFrames, 0, false, scope.data(), SLOT(selectAudioScopeFiftyFrames())); QActionGroup* audioScopeFramesGroup = new QActionGroup(audioScopeMenu); audioScopeFramesGroup->addAction(fiveFrames); audioScopeFramesGroup->addAction(twentyFrames); audioScopeFramesGroup->addAction(fiftyFrames); } auto statsRenderer = DependencyManager::get<AudioIOStatsRenderer>(); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStats, Qt::CTRL | Qt::SHIFT | Qt::Key_A, false, statsRenderer.data(), SLOT(toggle())); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStatsShowInjectedStreams, 0, false, statsRenderer.data(), SLOT(toggleShowInjectedStreams())); MenuWrapper* physicsOptionsMenu = developerMenu->addMenu("Physics"); addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowOwned); addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls); MenuWrapper* helpMenu = addMenu("Help"); addActionToQMenuAndActionHash(helpMenu, MenuOption::EditEntitiesHelp, 0, qApp, SLOT(showEditEntitiesHelp())); #ifndef Q_OS_MAC QAction* aboutAction = helpMenu->addAction(MenuOption::AboutApp); connect(aboutAction, SIGNAL(triggered()), qApp, SLOT(aboutApp())); #endif }