void BitcoinGUI::gotoReceiveCoinsPage() { receiveCoinsAction->setChecked(true); centralWidget->setCurrentWidget(receiveCoinsPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); }
void BitcoinGUI::gotoAddressBookPage() { addressBookAction->setChecked(true); centralWidget->setCurrentWidget(addressBookPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); }
void BitcoinGUI::gotoHistoryPage() { historyAction->setChecked(true); centralWidget->setCurrentWidget(transactionsPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); }
void BitcoinGUI::gotoMintingPage() { mintingAction->setChecked(true); centralWidget->setCurrentWidget(mintingPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), mintingView, SLOT(exportClicked())); }
WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): QStackedWidget(parent), gui(_gui), clientModel(0), walletModel(0) { // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); QPushButton *exportButton = new QPushButton(tr("&Export"), this); exportButton->setToolTip(tr("Export the data in the current tab to a file")); #ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac exportButton->setIcon(QIcon(":/icons/export")); #endif hbox_buttons->addStretch(); hbox_buttons->addWidget(exportButton); vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(gui); signVerifyMessageDialog = new SignVerifyMessageDialog(gui); addWidget(overviewPage); addWidget(transactionsPage); addWidget(addressBookPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); // Clicking on "Send Coins" in the address book sends you to the send coins tab connect(addressBookPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString))); // Clicking on "Verify Message" in the address book opens the verify message tab in the Sign/Verify Message dialog connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); // Clicking on "Export" allows to export the transaction list connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); gotoOverviewPage(); }
Programa::Programa(QWidget* parent) : QDialog(parent) { setupUi(this); connect(submitButton, SIGNAL(clicked()), SLOT(submitClicked())); connect(importButton, SIGNAL(clicked()), SLOT(importClicked())); connect(exportButton, SIGNAL(clicked()), SLOT(exportClicked())); connect(closeButton, SIGNAL(clicked()), SLOT(close())); }
TableView3D::TableView3D(QWidget *parent) { Q_UNUSED(parent) m_isFlashOnly = false; m_tableMap=0; ui.setupUi(this); tableData=0; m_tracingEnabled = false; connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveClicked())); connect(ui.loadFlashPushButton,SIGNAL(clicked()),this,SLOT(loadClicked())); connect(ui.loadRamPushButton,SIGNAL(clicked()),this,SLOT(loadRamClicked())); connect(ui.exportPushButton,SIGNAL(clicked()),this,SLOT(exportClicked())); connect(ui.importPushButton,SIGNAL(clicked()),this,SLOT(importClicked())); connect(ui.tableWidget,SIGNAL(hotKeyPressed(int,Qt::KeyboardModifier)),this,SLOT(hotKeyPressed(int,Qt::KeyboardModifier))); connect(ui.tracingCheckBox,SIGNAL(stateChanged(int)),this,SLOT(tracingCheckBoxStateChanged(int))); ui.tableWidget->addHotkey(Qt::Key_Plus,Qt::ShiftModifier); ui.tableWidget->addHotkey(Qt::Key_Minus,Qt::NoModifier); ui.tableWidget->addHotkey(Qt::Key_Underscore,Qt::ShiftModifier); ui.tableWidget->addHotkey(Qt::Key_Equal,Qt::NoModifier); connect(ui.tableWidget,SIGNAL(itemChangeRequest(int,int,int,int,QString)),this,SLOT(itemChangeRequest(int,int,int,int,QString))); //ui.tableWidget->setItemDelegate(new TableWidgetDelegate()); setContextMenuPolicy(Qt::DefaultContextMenu); //QAction* fooAction = new QAction("foo",this); //QAction* barAction = new QAction("bar",this); //connect(fooAction, SIGNAL(triggered()), this, SLOT(doSomethingFoo())); //connect(barAction, SIGNAL(triggered()), this, SLOT(doSomethingBar())); //addAction(fooAction); //addAction(barAction); metaDataValid = true; /*if (!isram) { //Is only flash ui.loadRamPushButton->setVisible(false); } else if (!isflash) { //Is only ram ui.savePushButton->setVisible(false); ui.loadFlashPushButton->setVisible(false); } else { //Is both ram and flash }*/ //ui.importPushButton->setVisible(false); //ui.tracingCheckBox->setVisible(false); //ui.tracingCheckBox->setEnabled(false); connect(ui.showMapPushButton,SIGNAL(clicked()),this,SLOT(showMapClicked())); m_inputTimer = new QTimer(this); connect(m_inputTimer,SIGNAL(timeout()),this,SLOT(inputTimerTimeout())); }
void WalletView::gotoAddressBookPage(bool fExportOnly, bool fExportConnect, bool fExportFirstTime) { if (fExportOnly && addressBookAction->isChecked() ) { if (fExportFirstTime) disconnect(gui->exportAction, SIGNAL(triggered()), 0, 0); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } else if (fExportOnly && !addressBookAction->isChecked()) { return; } else { addressBookAction->setChecked(true); setCurrentWidget(addressBookPage); gui->exportAction->setEnabled(true); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } }
void BitcoinGUI::gotoHistoryPage() { historyAction->setChecked(true); centralWidget->setCurrentWidget(transactionsPage); connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); transactionView->setModel(this->walletModel); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); }
WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent): QStackedWidget(parent), clientModel(0), walletModel(0), platformStyle(_platformStyle) { // Create tabs overviewPage = new OverviewPage(platformStyle); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(platformStyle, this); vbox->addWidget(transactionView); QPushButton *exportButton = new QPushButton(tr("&Export"), this); exportButton->setToolTip(tr("Export the data in the current tab to a file")); if (platformStyle->getImagesOnButtons()) { exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); } hbox_buttons->addStretch(); hbox_buttons->addWidget(exportButton); vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); receiveCoinsPage = new ReceiveCoinsDialog(platformStyle); sendCoinsPage = new SendCoinsDialog(platformStyle); usedSendingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::SendingTab, this); usedReceivingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this); addWidget(overviewPage); addWidget(transactionsPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo())); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); // Clicking on "Export" allows to export the transaction list connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); // Pass through messages from sendCoinsPage connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); // Pass through messages from transactionView connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); }
void WalletView::gotoReceiveCoinsPage(bool fExportOnly, bool fExportConnect, bool fExportFirstTime) { if (fExportOnly && receiveCoinsAction->isChecked() ) { if (fExportFirstTime) disconnect(gui->exportAction, SIGNAL(triggered()), 0, 0); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } else if (fExportOnly && !receiveCoinsAction->isChecked()) { return; } else { receiveCoinsAction->setChecked(true); setCurrentWidget(receiveCoinsPage); gui->exportAction->setEnabled(true); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } }
TransactionFilterWidget::TransactionFilterWidget(QWidget *parent) : QFrame(parent) , ui(new Ui::TransactionFilterWidget) { ui->setupUi(this); ui->recent_transaction_button->setCheckable(true); ui->recent_transaction_button->setChecked(true); connect(ui->tabbed_date_widget, SIGNAL(tabPressed()), this, SLOT(dateTabPressed())); connect(ui->tabbed_date_widget, SIGNAL(tabReleased()), this, SLOT(dateTabReleased())); connect(ui->recent_transaction_button, SIGNAL(pressed()), this, SLOT(recentTransactionButtonPressed())); connect(ui->transaction_export_button,SIGNAL(pressed()),this,SIGNAL(exportClicked())); }
void WalletView::gotoHistoryPage(bool fExportOnly, bool fExportConnect, bool fExportFirstTime) { if (fExportOnly && historyAction->isChecked() ) { if (fExportFirstTime) disconnect(gui->exportAction, SIGNAL(triggered()), 0, 0); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } else if (fExportOnly && !historyAction->isChecked()) { return; } else { historyAction->setChecked(true); setCurrentWidget(transactionsPage); gui->exportAction->setEnabled(true); if (fExportConnect) connect(gui->exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } }
void BitcoinGUI::gotoReceiveCoinsPage() { receiveCoinsAction->setChecked(true); //clearWidgets(); //receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); //receiveCoinsPage->setOptionsModel(this->clientModel->getOptionsModel()); //receiveCoinsPage->setModel(this->walletModel->getAddressTableModel()); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab //connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); //centralStackedWidget->addWidget(receiveCoinsPage); centralStackedWidget->setCurrentWidget(receiveCoinsPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); }
void BitcoinGUI::gotoAddressBookPage() { addressBookAction->setChecked(true); //clearWidgets(); //addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); //addressBookPage->setOptionsModel(this->clientModel->getOptionsModel()); //addressBookPage->setModel(this->walletModel->getAddressTableModel()); // Clicking on "Verify Message" in the address book sends you to the verify message tab //connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); //centralStackedWidget->addWidget(addressBookPage); centralStackedWidget->setCurrentWidget(addressBookPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); }
WalletView::WalletView(QWidget *parent): QStackedWidget(parent), clientModel(0), walletModel(0) { // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); QPushButton *exportButton = new QPushButton(tr("&Export"), this); exportButton->setToolTip(tr("Export the data in the current tab to a file")); #ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac exportButton->setIcon(QIcon(":/icons/export")); #endif hbox_buttons->addStretch(); hbox_buttons->addWidget(exportButton); vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); receiveCoinsPage = new ReceiveCoinsDialog(); sendCoinsPage = new SendCoinsDialog(); utilPage = new UtilDialog(); addWidget(overviewPage); addWidget(transactionsPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); addWidget(utilPage); // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); // Clicking on "Export" allows to export the transaction list connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); // Pass through messages from sendCoinsPage connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); // Pass through messages from transactionView connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); }
void BitcoinGUI::gotoHistoryPage() { historyAction->setChecked(true); //clearWidgets(); /*transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); centralStackedWidget->addWidget(transactionsPage);*/ centralStackedWidget->setCurrentWidget(transactionsPage); //connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); //transactionView->setModel(this->walletModel); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); }
MainMenu::MainMenu(bool isIP, bool isPlugin, QWidget *parent) : QMenuBar(parent), m_isPlugin(isPlugin) { m_isIP = isIP; QAction * action = 0; bool isConnected = 0; // File menu m_fileMenu = new QMenu(tr("&File"),this); addMenu(m_fileMenu); // DLM: actions which result in this menu being deleted should be queued action = new QAction(tr("&New"), this); action->setShortcut(QKeySequence(QKeySequence::New)); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(newClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); // DLM: actions which result in this menu being deleted should be queued action = new QAction(tr("&Open"), this); action->setShortcut(QKeySequence(QKeySequence::Open)); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(loadFileClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); m_fileMenu->addSeparator(); m_revertToSavedAction = new QAction(tr("Revert to Saved"), this); m_revertToSavedAction->setDisabled(true); m_fileMenu->addAction(m_revertToSavedAction); isConnected = connect(m_revertToSavedAction, SIGNAL(triggered()), this, SIGNAL(revertFileClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); action = new QAction(tr("&Save"), this); action->setShortcut(QKeySequence(QKeySequence::Save)); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(saveFileClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Save &As"), this); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(saveAsFileClicked())); OS_ASSERT(isConnected); m_fileMenu->addSeparator(); //formatMenu = editMenu->addMenu(tr("&Format")) QMenu * importMenu = m_fileMenu->addMenu(tr("Import")); action = new QAction(tr("IDF"), this); importMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(importClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); action = new QAction(tr("gbXML"), this); importMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(importgbXMLClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); action = new QAction(tr("SDD"), this); importMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(importSDDClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); QMenu * exportMenu = m_fileMenu->addMenu(tr("Export")); action = new QAction(tr("IDF"), this); exportMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(exportClicked())); OS_ASSERT(isConnected); action = new QAction(tr("gbXML"), this); exportMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(exportgbXMLClicked())); OS_ASSERT(isConnected); action = new QAction(tr("SDD"), this); exportMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(exportSDDClicked())); OS_ASSERT(isConnected); action = new QAction(tr("&Load Library"), this); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(loadLibraryClicked())); OS_ASSERT(isConnected); if (!m_isPlugin){ m_fileMenu->addSeparator(); //m_fileMenu->addAction(action); //isConnected = connect(action, SIGNAL(triggered()), this, SIGNAL(showRubyConsoleClicked())); //OS_ASSERT(isConnected); m_fileMenu->addSeparator(); action = new QAction(tr("E&xit"), this); action->setShortcuts(QKeySequence::Quit); m_fileMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(exitClicked()), Qt::QueuedConnection); OS_ASSERT(isConnected); } // Preferences menu m_preferencesMenu = new QMenu(tr("&Preferences"),this); addMenu(m_preferencesMenu); QMenu * unitsMenu = m_preferencesMenu->addMenu(tr("Units")); m_displaySIUnitsAction = new QAction(tr("Metric (&SI)"),this); unitsMenu->addAction(m_displaySIUnitsAction); isConnected = connect(m_displaySIUnitsAction, SIGNAL(triggered()),this,SLOT(displaySIUnitsClicked())); OS_ASSERT(isConnected); m_displayIPUnitsAction = new QAction(tr("English (&I-P)"),this); unitsMenu->addAction(m_displayIPUnitsAction); isConnected = connect(m_displayIPUnitsAction, SIGNAL(triggered()),this,SLOT(displayIPUnitsClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Change My Measures Directory"),this); m_preferencesMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(changeMyMeasuresDir())); OS_ASSERT(isConnected); action = new QAction(tr("Scan for Tools"),this); m_preferencesMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(scanForToolsClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Show Tools"),this); m_preferencesMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(showRunManagerPreferencesClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Change BCL Login Information"),this); //m_preferencesMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(changeBclLogin())); OS_ASSERT(isConnected); action = new QAction(tr("&Configure Internet Proxy"),this); m_preferencesMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(configureProxyClicked())); OS_ASSERT(isConnected); if(m_isIP){ m_displayIPUnitsAction->trigger(); } else{ m_displaySIUnitsAction->trigger(); } // Measure menu m_measureMenu = new QMenu(tr("Components && Measures"),this); addMenu(m_measureMenu); action = new QAction(tr("Apply Measure Now"),this); action->setShortcut(QKeySequence(QKeySequence(tr("Ctrl+M")))); m_measureMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(applyMeasureClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Find Measures"),this); m_measureMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(downloadMeasuresClicked())); OS_ASSERT(isConnected); action = new QAction(tr("Find Components"),this); m_measureMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(downloadComponentsClicked())); OS_ASSERT(isConnected); // Help menu m_helpMenu = new QMenu(tr("&Help"),this); addMenu(m_helpMenu); action = new QAction(tr("OpenStudio &Help"),this); m_helpMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(helpClicked())); OS_ASSERT(isConnected); action = new QAction(tr("&About"),this); m_helpMenu->addAction(action); isConnected = connect(action, SIGNAL(triggered()),this,SIGNAL(aboutClicked())); OS_ASSERT(isConnected); }
RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par) : QWidget(par) { g_pRegisteredUsersDialog = this; g_pLocalRegisteredUserDataBase = new KviRegisteredUserDataBase(); g_pLocalRegisteredUserDataBase->copyFrom(g_pRegisteredUserDataBase); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::RegUsers))); setWindowTitle(__tr2qs_ctx("Registered Users - KVIrc","register")); QGridLayout * g = new QGridLayout(this); m_pListView = new KviRegisteredUsersListView(this); m_pListView->setItemDelegate(new RegisteredUsersDialogItemDelegate()); connect(m_pListView,SIGNAL(itemPressed(QTreeWidgetItem *,int)),this,SLOT(itemPressed(QTreeWidgetItem *,int))); connect(m_pListView,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); g->addWidget(m_pListView,0,0,2,2); KviTalVBox * vbox = new KviTalVBox(this); vbox->setSpacing(4); g->addWidget(vbox,0,2); m_pWizardAddButton = new QPushButton(__tr2qs_ctx("Add (Wizard)...","register"),vbox); connect(m_pWizardAddButton,SIGNAL(clicked()),this,SLOT(addWizardClicked())); m_pWizardAddButton->setToolTip(__tr2qs_ctx("Add a registered user by means of a user-friendly wizard.","register")); m_pWizardAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItemByWizard))); m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","register"),vbox); connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); m_pAddButton->setToolTip(__tr2qs_ctx("Open the edit dialog to create a new user entry.","register")); m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); m_pAddGroupButton = new QPushButton(__tr2qs_ctx("&Add Group...","register"),vbox); connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked())); m_pAddGroupButton->setToolTip(__tr2qs_ctx("Adds a new group","register")); m_pAddGroupButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","register"),vbox); connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); m_pRemoveButton->setEnabled(false); m_pRemoveButton->setToolTip(__tr2qs_ctx("Remove the currently selected entries.","register")); m_pRemoveButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem))); m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit...","register"),vbox); connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked())); m_pEditButton->setEnabled(false); m_pEditButton->setToolTip(__tr2qs_ctx("Edit the first selected entry.","register")); m_pEditButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem))); QFrame * f = new QFrame(vbox); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); m_pSelectAllButton = new QPushButton(__tr2qs_ctx("Select all","register"),vbox); connect(m_pSelectAllButton,SIGNAL(clicked()),this,SLOT(selectAllClicked())); m_pSelectAllButton->setToolTip(__tr2qs_ctx("Select all the entries","register")); m_pSelectAllButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Plus))); m_pExportButton = new QPushButton(__tr2qs_ctx("Export To...","register"),vbox); m_pExportButton->setEnabled(false); connect(m_pExportButton,SIGNAL(clicked()),this,SLOT(exportClicked())); m_pExportButton->setToolTip(__tr2qs_ctx("Export the selected entries to a file.<br>All the data associated with the selected registered users will be exported.<br>You (or anyone else) can later import the entries by using the \"Import\" button.","register")); m_pExportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Floppy))); m_pImportButton = new QPushButton(__tr2qs_ctx("Import From...","register"),vbox); connect(m_pImportButton,SIGNAL(clicked()),this,SLOT(importClicked())); m_pImportButton->setToolTip(__tr2qs_ctx("Import entries from a file exported earlier by the \"export\" function of this dialog.","register")); m_pImportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Folder))); KviTalHBox * hbox = new KviTalHBox(this); hbox->setSpacing(4); g->addWidget(hbox,3,1,1,2); QPushButton * b; b = new QPushButton(__tr2qs_ctx("&OK","register"),hbox); connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); //b->setMinimumWidth(120); b = new QPushButton(__tr2qs_ctx("Cancel","register"),hbox); connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); //b->setMinimumWidth(120); g->addItem(new QSpacerItem(0, 15), 2, 0); g->setColumnStretch(0,1); g->setRowStretch(1,1); connect(m_pListView,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)),this,SLOT(rightButtonPressed(QTreeWidgetItem *, QPoint))); new QShortcut(Qt::Key_Escape, this, SLOT(cancelClicked())); fillList(); if(!parent()) { if(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y() < 5) KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).setY(5); //setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry)); resize(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width(), KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width())/2),rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height())/2)); } }
TransactionView::TransactionView(QWidget *parent) : QWidget(parent), walletModel(0), transactionProxyModel(0), transactionView(0) { QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); #ifdef Q_OS_MAC hlayout->setSpacing(5); hlayout->addSpacing(26); #else hlayout->setSpacing(0); hlayout->addSpacing(23); #endif watchOnlyWidget = new QComboBox(this); watchOnlyWidget->setFixedWidth(24); watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); watchOnlyWidget->addItem(QIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); watchOnlyWidget->addItem(QIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); //hlayout->addWidget(watchOnlyWidget); dateWidget = new QComboBox(this); #ifdef Q_OS_MAC dateWidget->setFixedWidth(121); #else dateWidget->setFixedWidth(120); #endif dateWidget->addItem(tr("All"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); dateWidget->addItem(tr("Range..."), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); #ifdef Q_OS_MAC typeWidget->setFixedWidth(121); #else typeWidget->setFixedWidth(120); #endif typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther)); typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) | TransactionFilterProxy::TYPE(TransactionRecord::SendToOther)); //typeWidget->addItem(tr("Darksent"), TransactionFilterProxy::TYPE(TransactionRecord::Darksent)); //typeWidget->addItem(tr("Darksend Make Collateral Inputs"), TransactionFilterProxy::TYPE(TransactionRecord::DarksendMakeCollaterals)); //typeWidget->addItem(tr("Darksend Create Denominations"), TransactionFilterProxy::TYPE(TransactionRecord::DarksendCreateDenominations)); //typeWidget->addItem(tr("Darksend Denominate"), TransactionFilterProxy::TYPE(TransactionRecord::DarksendDenominate)); //typeWidget->addItem(tr("Darksend Collateral Payment"), TransactionFilterProxy::TYPE(TransactionRecord::DarksendCollateralPayment)); typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); typeWidget->addItem(tr("Sent by delegate"), TransactionFilterProxy::TYPE(TransactionRecord::SendByDelegate)); typeWidget->addItem(tr("Sent as delegate"), TransactionFilterProxy::TYPE(TransactionRecord::SendAsDelegate)); hlayout->addWidget(typeWidget); addressWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 addressWidget->setPlaceholderText(tr("Enter address or label to search")); #endif hlayout->addWidget(addressWidget); QPushButton *exportButton = new QPushButton(tr("&Export"), this); exportButton->setFixedHeight(24); exportButton->setToolTip(tr("Export the data in the current tab to a file")); #ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac exportButton->setIcon(QIcon(":/icons/export")); #endif hlayout->addWidget(exportButton); /* amountWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 amountWidget->setPlaceholderText(tr("Min amount")); #endif #ifdef Q_OS_MAC amountWidget->setFixedWidth(97); #else amountWidget->setFixedWidth(100); #endif amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); */ QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setContentsMargins(0,0,0,0); vlayout->setSpacing(0); // create and position the balancesframe bframe = new QFrame(this); bframe->setFixedHeight(120); bframe->setFixedWidth(750); bframe->setObjectName("bframe"); //bframe->setStyleSheet("color: white; border-radius: 6px; border: 1px solid white"); // labels availablebalancelabel = new QLabel(bframe); availablebalancelabel->move(20, 20); availablebalancelabel->setFixedWidth(220); availablebalancelabel->setText("Available Balance:"); availablebalancelabel->setObjectName("availablebalancelabel"); //availablebalancelabel->setStyleSheet("border: none; font: 18pt;"); labelBalance = new QLabel(bframe); labelBalance->move(250, 20); labelBalance->setFixedWidth(300); labelBalance->setText("Available Balance:"); labelBalance->setTextInteractionFlags(Qt::TextSelectableByMouse); labelBalance->setObjectName("labelBalance"); //labelBalance->setStyleSheet("border: none; font: 18pt;"); unconfirmedbalancelabel = new QLabel(bframe); unconfirmedbalancelabel->move(20, 65); unconfirmedbalancelabel->setFixedWidth(200); unconfirmedbalancelabel->setText("Unconfirmed:"); //unconfirmedbalancelabel->setStyleSheet("border: none"); labelUnconfirmed = new QLabel(bframe); labelUnconfirmed->move(250, 65); labelUnconfirmed->setFixedWidth(200); labelUnconfirmed->setText("Available Balance:"); labelUnconfirmed->setTextInteractionFlags(Qt::TextSelectableByMouse); //labelUnconfirmed->setStyleSheet("border: none"); immaturebalancelabel = new QLabel(bframe); immaturebalancelabel->move(20, 85); immaturebalancelabel->setFixedWidth(200); immaturebalancelabel->setText("Immature:"); //immaturebalancelabel->setStyleSheet("border: none"); labelImmature = new QLabel(bframe); labelImmature->move(250, 85); labelImmature->setFixedWidth(200); labelImmature->setText("Available Balance:"); labelImmature->setTextInteractionFlags(Qt::TextSelectableByMouse); //labelImmature->setStyleSheet("border: none;"); // QWidget *spacer = new QWidget(this); spacer->setFixedHeight(20); QTableView *view = new QTableView(this); vlayout->addWidget(bframe); vlayout->addWidget(spacer); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing #ifdef Q_OS_MAC hlayout->addSpacing(width+2); #else hlayout->addSpacing(width); #endif // Always show scroll bar view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); view->installEventFilter(this); transactionView = view; // Actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyAmountAction = new QAction(tr("Copy amount"), this); QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction *editLabelAction = new QAction(tr("Edit label"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addAction(editLabelAction); contextMenu->addAction(showDetailsAction); mapperThirdPartyTxUrls = new QSignalMapper(this); // Connect actions connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString))); connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); //connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex))); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); // Clicking on "Export" allows to export the transaction list connect(exportButton, SIGNAL(clicked()), this, SLOT(exportClicked())); }
WalletView::WalletView(QWidget *parent): QStackedWidget(parent), clientModel(0), walletModel(0) { // Create tabs overviewPage = new OverviewPage(); tradingPage = new tradingDialog(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); QPushButton *exportButton = new QPushButton(tr("&Export"), this); exportButton->setToolTip(tr("Export the data in the current tab to a file")); #ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac exportButton->setIcon(QIcon(":/icons/export")); #endif hbox_buttons->addStretch(); // Sum of selected transactions QLabel *transactionSumLabel = new QLabel(); // Label transactionSumLabel->setObjectName("transactionSumLabel"); // Label ID as CSS-reference transactionSumLabel->setText(tr("Selected amount:")); hbox_buttons->addWidget(transactionSumLabel); transactionSum = new QLabel(); // Amount transactionSum->setObjectName("transactionSum"); // Label ID as CSS-reference transactionSum->setMinimumSize(200, 8); transactionSum->setTextInteractionFlags(Qt::TextSelectableByMouse); hbox_buttons->addWidget(transactionSum); hbox_buttons->addWidget(exportButton); vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); receiveCoinsPage = new ReceiveCoinsDialog(); sendCoinsPage = new SendCoinsDialog(); addWidget(overviewPage); addWidget(transactionsPage); addWidget(receiveCoinsPage); addWidget(sendCoinsPage); addWidget(tradingPage); QSettings settings; if (settings.value("fShowMasternodesTab").toBool()) { masternodeListPage = new MasternodeList(); addWidget(masternodeListPage); } // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); // Update wallet with sum of selected transactions connect(transactionView, SIGNAL(trxAmount(QString)), this, SLOT(trxAmount(QString))); // Clicking on "Export" allows to export the transaction list connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); // Pass through messages from sendCoinsPage connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); // Pass through messages from transactionView connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int))); }