BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { setMinimumSize(1000,550); resize(1040, 650); //setFixedSize(970, 550); setWindowTitle(tr("WhiteCoin") + " " + tr("Wallet")); qApp->setStyleSheet( "QMainWindow { background:white url(:/images/wallet_logo_background) no-repeat right bottom; background-origin: border; font-family:'Open Sans,sans-serif'; } " "QLineEdit { border: 4px solid rgb(14,105,162); } " "#frame { } QToolBar QLabel { padding-top:15px; padding-bottom:10px; margin:0px; border: 0px; border-color: yellow;} " "#spacer { background: rgb(14,105,162); border:none; } " "#toolbar { height:100%; padding-top:20px; background: white; text-align: left; min-width:220px; max-width:220px; border: none;} " "QToolBar QToolButton { font-family:Open Sans; padding-left:0px; padding-top:10px; padding-bottom:10px; width:220px; color: white; text-align: left; background-color: rgb(14,105,162) } " "QToolBar QToolButton:hover { color: black; background-color: white; border: none; } " "QToolBar QToolButton:pressed {color: black; background-color: white; border: none; } " "QToolBar QToolButton:checked { color: black; background-color: white; border: none; } " "#labelMiningIcon { padding-left:5px; font-family:Open Sans; width:100%;font-size:10px; text-align:center; color:grey; } " "QMenu { background: rgb(255,255,255); color:black; padding-bottom:10px; } " "QMenu::item { color:grey; background-color: transparent; } " "QMenu::item:selected { color: white; background-color: rgb(14,105,162); } " "QMenuBar { background: rgb(255,255,255); color:black; } " "QMenuBar::item { font-size:12px; padding-bottom:12px; padding-top:12px; padding-left:15px; padding-right:15px; color:grey; background-color: transparent; border:none;} " "QMenuBar::item:selected { color: white; background-color:rgb(14,105,162); border:none;}" "QRadionButton::indicator { background-color: rgb(14,105,162); } " "QIcon {}" "QTabWidget { background-color: rbg(14,105,162); }" "#debug QLabel {color: white; }" "QLineEdit { border: 1px solid rbg(14,105,162); border-radius: 4px; }" "#scrollArea { border-color: transparent; } " "QPushButton {}" "QStackedWidget {}" "QDateTime {}" ); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); statisticsPage = new StatisticsPage(this); blockBrowser = new BlockBrowser(this); poolBrowser = new PoolBrowser(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); //QVBoxLayout *vboxcentral = new QVBoxLayout(); //QWidget *centralWidgetWrapper = new QWidget(this); //centralWidgetWrapper->setStyleSheet("QStackedWidget{border:1px solid #555;}"); //centralWidget = new QStackedWidget(centralWidgetWrapper); centralWidget = new QStackedWidget(this); centralWidget->setStyleSheet("QStackedWidget{border:0px solid #000;}"); centralWidget->addWidget(overviewPage); centralWidget->addWidget(statisticsPage); centralWidget->addWidget(blockBrowser); centralWidget->addWidget(poolBrowser); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); //vboxcentral->addWidget(centralWidget); //centralWidgetWrapper->setLayout(vboxcentral); // setCentralWidget(centralWidgetWrapper); setCentralWidget(centralWidget); // create status bar // statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setStyleSheet("frameBlocks { background: rgb(255,255,255); }"); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumHeight(26); frameBlocks->setMaximumHeight(26); frameBlocks->setMaximumWidth(96); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(0,1,0,1); frameBlocksLayout->setSpacing(-1); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (!GetBoolArg("-posmint", false)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); progressBar->setOrientation(Qt::Horizontal); progressBar->setObjectName("progress"); progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} " "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }"); frameBlocks->setObjectName("frame"); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} " "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("CryptoBuck") + " - " + tr("Wallet")); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("NobleCoin") + " - " + tr("Wallet")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); QPalette p; p.setColor(QPalette::Window, QColor(0x22, 0x22, 0x22)); p.setColor(QPalette::Button, QColor(0x22, 0x22, 0x22)); p.setColor(QPalette::Mid, QColor(0x22, 0x22, 0x22)); p.setColor(QPalette::Base, QColor(0x22, 0x22, 0x22)); p.setColor(QPalette::AlternateBase, QColor(0x22, 0x22, 0x22)); setPalette(p); QFile style(":/text/res/text/style.qss"); style.open(QFile::ReadOnly); setStyleSheet(QString::fromUtf8(style.readAll())); /* don't override the background color of the toolbar on mac os x due to the whole component it resides on not being paintable */ #ifdef Q_OS_MAC toolbar->setStyleSheet("QToolBar { background-color: transparent; border: 0px solid black; padding: 3px; }"); #endif // Create tabs overviewPage = new OverviewPage(); chatWindow = new ChatWindow(this); //Create Chat Window blockExplorer = new BlockExplorer(this); //Include Block Explorer transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(chatWindow); //Add Chat Window centralWidget->addWidget(blockExplorer); //Create Block Explorer centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(signVerifyMessageDialog); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(73); frameBlocks->setMaximumWidth(73); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), unlockWalletAction(0), lockWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(860, 600); setWindowTitle(tr("Truckcoin") + " - " + tr("Wallet ") + QString::fromStdString(FormatFullVersion())); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); blockBrowser = new BlockBrowser(this); chatWindow = new ChatWindow(this); // IRC transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(blockBrowser); centralWidget->addWidget(chatWindow); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new GUIUtil::ClickableLabel(); labelMintingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelMintingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Set minting pixmap labelMintingIcon->setPixmap(QIcon(":/icons/minting").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelMintingIcon->setEnabled(false); // Add timer to update minting info QTimer *timerMintingIcon = new QTimer(labelMintingIcon); timerMintingIcon->start(MODEL_UPDATE_DELAY); connect(timerMintingIcon, SIGNAL(timeout()), this, SLOT(updateMintingIcon())); // Add timer to update minting weights QTimer *timerMintingWeights = new QTimer(labelMintingIcon); timerMintingWeights->start(30 * 1000); connect(timerMintingWeights, SIGNAL(timeout()), this, SLOT(updateMintingWeights())); // Set initial values for user and network weights nWeight, nNetworkWeight = 0; // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // this->setStyleSheet("background-color: #effbef;"); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("SchillingCoin") + " - " + tr("Wallet")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif //specify a new font. QFont newFont("Arial", 10); //set font of application QApplication::setFont(newFont); // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); miningPage = new MiningPage(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(miningPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(signVerifyMessageDialog); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(73); frameBlocks->setMaximumWidth(73); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelMiningIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelMiningIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the Much receive page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
spincoinGUI::spincoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { setFixedSize(970, 550); setWindowTitle(tr("SpinCoin") + " " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(0,0,0);border:none; } #toolbar2 { border:none;width:10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(128,130,131), stop: 1 rgb(232,237,241)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(0,0,0); text-align: left; color: white;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(0,0,0), stop: 1 rgb(155,155,155),stop: 2 rgb(0,0,0));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:200px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(0,0,0) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: black; color: white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(60,60,60), stop: 1 rgb(155,155,155)); } QMenuBar { background: rgb(0,0,0); color:white; } QMenuBar::item { font-size:12px;padding-bottom:8px;padding-top:8px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(60,60,60), stop: 1 rgb(155,155,155)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/spincoin")); setWindowIcon(QIcon(":icons/spincoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); statisticsPage = new StatisticsPage(this); blockBrowser = new BlockBrowser(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(statisticsPage); centralWidget->addWidget(blockBrowser); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setStyleSheet("frameBlocks { background: rgb(127,154,131); }"); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(30); frameBlocks->setMaximumWidth(30); QVBoxLayout *frameBlocksLayout = new QVBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(1,0,1,0); frameBlocksLayout->setSpacing(-1); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); progressBar->setOrientation(Qt::Vertical); progressBar->setObjectName("progress"); progressBar->setStyleSheet("QProgressBar{" "border: 1px solid transparent;" "font-size:9px;" "text-align: center;" "color:rgba(0,0,0,100);" "border-radius: 5px;" "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(182, 182, 182, 100), stop:1 rgba(209, 209, 209, 100));" "}" "QProgressBar::chunk{" "background-color: rgba(0,255,0,100);" "}"); frameBlocks->setObjectName("frame"); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(25); toolbar2->addWidget(frameBlocks); toolbar2->addWidget(progressBarLabel); toolbar2->addWidget(progressBar); syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("Coin2.1") + " - " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background:rgb(200,200,200);font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background: rgb(35,35,35); border:none; } #toolbar2 { border:none;width:10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(255,167,61), stop: 2 rgb(255,127,4)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(35,35,35); text-align: left; color: white;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(35,35,35), stop: 1 rgb(255,167,61), stop: 2 rgb(255,127,4),stop: 3 rgb(35,35,35));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:200px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(35,35,35) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(35,35,35); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 0.5 rgb(255,167,61), stop: 1 rgb(255,127,4)); } QMenuBar { background: rgb(35,35,35); color:white; } QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(255,167,61), stop: 2 rgb(255,127,4)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); accessNxtInsideDialog = new AccessNxtInsideDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); //// Create status bar //statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setStyleSheet("frameBlocks { background: rgb(35,35,35); QToolbar { background:white;height:40px; } }"); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(30); frameBlocks->setMaximumWidth(30); QVBoxLayout *frameBlocksLayout = new QVBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(1,0,1,0); frameBlocksLayout->setSpacing(-1); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); //actionConvertIcon = new QAction(QIcon(":/icons/toolbar"), tr(""), this); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); //if (GetBoolArg("-staking", true)) //{ QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); //} /*frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); */ // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); progressBar->setOrientation(Qt::Vertical); progressBar->setObjectName("progress"); progressBar->setStyleSheet("QProgressBar{" "border: 1px solid transparent;" "font-size:9px;" "text-align: center;" "color:rgba(0,0,0,100);" "border-radius: 5px;" "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(182, 182, 182, 100), stop:1 rgba(209, 209, 209, 100));" "}" "QProgressBar::chunk{" "background-color: rgba(0,255,0,100);" "}"); frameBlocks->setObjectName("frame"); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(25); toolbar2->addWidget(frameBlocks); toolbar2->setStyleSheet("QToolBar QToolButton { background:none;padding-top:10px;padding-bottom:5px; }"); toolbar2->addWidget(progressBarLabel); toolbar2->addWidget(progressBar); /* // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); */ syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); // this->setStyleSheet("background-color: #ceffee;"); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); // Click on "Access Nxt Inside" in the receive coins page sends you to access Nxt inside tab connect(receiveCoinsPage, SIGNAL(accessNxt(QString)), this, SLOT(gotoAccessNxtInsideTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), nWeight(0) { setFixedSize(970, 550); QFontDatabase::addApplicationFont(":/fonts/Bebas"); setWindowTitle(tr("Pentacoin") + " - " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none; } #frame { } QToolBar QLabel { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} QToolBar QLabel:item { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} #spacer { background: transparent;border:none; } #toolbar2 { border:none;width:0px;hight:0px;padding-top:40px;padding-bottom:0px; background-color: transparent; } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:black; } QMenu { background-color: qlineargradient(spread:pad, x1:0.511, y1:1, x2:0.482909, y2:0, stop:0 rgba(232,232,232), stop:1 rgba(232,232,232)); color: black; padding-bottom:10px; } QMenu::item { color: black; background: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); } QMenuBar { background-color: white; color: white; } QMenuBar::item { font-size:12px;padding-bottom:3px;padding-top:3px;padding-left:15px;padding-right:15px;color: black; background-color: white; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); masternodeManagerPage = new MasternodeManager(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(masternodeManagerPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(28); toolbar2->setIconSize(QSize(28,54)); toolbar2->addWidget(labelEncryptionIcon); toolbar2->addWidget(labelStakingIcon); toolbar2->addWidget(labelConnectionsIcon); toolbar2->addWidget(labelBlocksIcon); toolbar2->setStyleSheet("#toolbar2 QToolButton { background: transparent;border:none;padding:0px;margin:0px;height:54px;width:28px; }"); syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
AccountWidget::AccountWidget( QWidget* parent ) : QWidget( parent ) { QHBoxLayout *mainLayout = new QHBoxLayout( this ); TomahawkUtils::unmarginLayout( mainLayout ); setLayout( mainLayout ); setContentsMargins( 0, 8, 0, 8 ); m_imageLabel = new QLabel( this ); mainLayout->addWidget( m_imageLabel ); mainLayout->setSpacing( 4 ); QGridLayout* vLayout = new QGridLayout( this ); vLayout->setSpacing( 8 ); mainLayout->addLayout( vLayout ); QFrame* idContainer = new QFrame( this ); idContainer->setAttribute( Qt::WA_TranslucentBackground, false ); vLayout->addWidget( idContainer, 0, 0 ); QHBoxLayout* idContLayout = new QHBoxLayout( idContainer ); idContainer->setLayout( idContLayout ); idContainer->setContentsMargins( 0, 0, 0, 0 ); idContLayout->setMargin( 2 ); m_idLabel = new ElidedLabel( idContainer ); m_idLabel->setElideMode( Qt::ElideRight ); m_idLabel->setContentsMargins( 3, 0, 3, 0 ); m_idLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); m_idLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter ); idContLayout->addWidget( m_idLabel ); m_spinnerWidget = new QWidget( idContainer ); QSize spinnerSize = 16 > TomahawkUtils::defaultFontHeight() ? QSize( 16, 16 ) : QSize( TomahawkUtils::defaultFontHeight(), TomahawkUtils::defaultFontHeight() ); m_spinnerWidget->setFixedSize( spinnerSize ); idContLayout->addWidget( m_spinnerWidget ); m_spinnerWidget->setContentsMargins( 0, 1, 0, 0 ); m_spinner = new AnimatedSpinner( m_spinnerWidget->size() - QSize( 2, 2 ), m_spinnerWidget ); idContainer->setStyleSheet( QString( "QFrame {" "border: 1px solid #e9e9e9;" "border-radius: %1px;" "background: #e9e9e9;" "}" ).arg( idContainer->sizeHint().height() / 2 + 1 ) ); idContainer->setMinimumHeight( spinnerSize.height() + 6 /*margins*/ ); m_statusToggle = new SlideSwitchButton( this ); m_statusToggle->setContentsMargins( 0, 0, 0, 0 ); m_statusToggle->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); m_statusToggle->setFixedSize( m_statusToggle->sizeHint() ); QHBoxLayout *statusToggleLayout = new QHBoxLayout( this ); vLayout->addLayout( statusToggleLayout, 0, 1, 1, 1 ); statusToggleLayout->addStretch(); statusToggleLayout->addWidget( m_statusToggle ); m_inviteContainer = new UnstyledFrame( this ); vLayout->addWidget( m_inviteContainer, 1, 0 ); m_inviteContainer->setFrameColor( TomahawkUtils::Colors::BORDER_LINE ); m_inviteContainer->setMinimumWidth( m_inviteContainer->logicalDpiX() * 2 ); m_inviteContainer->setContentsMargins( 1, 1, 1, 2 ); m_inviteContainer->setAttribute( Qt::WA_TranslucentBackground, false ); m_inviteContainer->setStyleSheet( "background: white" ); QHBoxLayout* containerLayout = new QHBoxLayout( m_inviteContainer ); m_inviteContainer->setLayout( containerLayout ); TomahawkUtils::unmarginLayout( containerLayout ); containerLayout->setContentsMargins( 1, 1, 0, 0 ); m_addAccountIcon = new QLabel( m_inviteContainer ); m_addAccountIcon->setContentsMargins( 1, 0, 0, 0 ); m_addAccountIcon->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::AddContact, TomahawkUtils::Original, QSize( 16, 16 ) ) ); m_addAccountIcon->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ); m_addAccountIcon->setAlignment( Qt::AlignCenter ); containerLayout->addWidget( m_addAccountIcon ); m_inviteEdit = new QLineEdit( m_inviteContainer ); m_inviteEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); containerLayout->addWidget( m_inviteEdit ); m_inviteEdit->setFrame( false ); m_inviteButton = new QPushButton( this ); m_inviteButton->setMinimumWidth( m_inviteButton->logicalDpiX() * 0.8 ); m_inviteButton->setText( tr( "Invite" ) ); m_inviteButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); vLayout->addWidget( m_inviteButton, 1, 1 ); vLayout->setColumnStretch( 0, 1 ); #ifdef Q_OS_MAC layout()->setContentsMargins( 0, 0, 0, 0 ); #endif setInviteWidgetsEnabled( false ); }
/****************************************************************************** * The constructor of the main window class. ******************************************************************************/ MainWindow::MainWindow() : _datasetContainer(this) { setWindowTitle(tr("Ovito (Open Visualization Tool)")); setAttribute(Qt::WA_DeleteOnClose); // Setup the layout of docking widgets. setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); // Disable context menus in toolbars. setContextMenuPolicy(Qt::NoContextMenu); // Create input manager. _viewportInputManager = new ViewportInputManager(this); // Create actions. _actionManager = new ActionManager(this); // Create the main menu createMainMenu(); // Create the main toolbar. createMainToolbar(); ViewportsPanel* viewportsPanel = new ViewportsPanel(this); setCentralWidget(viewportsPanel); // Create the animation panel below the viewports. QWidget* animationPanel = new QWidget(); QVBoxLayout* animationPanelLayout = new QVBoxLayout(); animationPanelLayout->setSpacing(0); animationPanelLayout->setContentsMargins(0, 1, 0, 0); animationPanel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); #if defined(Q_OS_LINUX) QHBoxLayout* animationPanelParentLayout = new QHBoxLayout(animationPanel); animationPanelParentLayout->setSpacing(0); animationPanelParentLayout->setContentsMargins(0, 0, 0, 0); animationPanelParentLayout->addLayout(animationPanelLayout, 1); QFrame* verticalRule = new QFrame(animationPanel); verticalRule->setContentsMargins(0,0,0,0); verticalRule->setFrameStyle(QFrame::VLine | QFrame::Sunken); verticalRule->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); animationPanelParentLayout->addWidget(verticalRule); #else animationPanel->setLayout(animationPanelLayout); #endif // Create animation time slider AnimationTimeSlider* timeSlider = new AnimationTimeSlider(this); animationPanelLayout->addWidget(timeSlider); AnimationTrackBar* trackBar = new AnimationTrackBar(this, timeSlider); animationPanelLayout->addWidget(trackBar); // Create status bar. _statusBarLayout = new QHBoxLayout(); _statusBarLayout->setContentsMargins(0,0,0,0); _statusBarLayout->setSpacing(0); animationPanelLayout->addLayout(_statusBarLayout, 1); _statusBar = new QStatusBar(animationPanel); _statusBar->setSizeGripEnabled(false); _statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); setStatusBar(_statusBar); _statusBarLayout->addWidget(_statusBar, 1); _coordinateDisplay = new CoordinateDisplayWidget(datasetContainer(), animationPanel); _statusBarLayout->addWidget(_coordinateDisplay); // Create the animation control toolbar. QToolBar* animationControlBar1 = new QToolBar(); animationControlBar1->addAction(actionManager()->getAction(ACTION_GOTO_START_OF_ANIMATION)); animationControlBar1->addSeparator(); animationControlBar1->addAction(actionManager()->getAction(ACTION_GOTO_PREVIOUS_FRAME)); animationControlBar1->addAction(actionManager()->getAction(ACTION_TOGGLE_ANIMATION_PLAYBACK)); animationControlBar1->addAction(actionManager()->getAction(ACTION_GOTO_NEXT_FRAME)); animationControlBar1->addSeparator(); animationControlBar1->addAction(actionManager()->getAction(ACTION_GOTO_END_OF_ANIMATION)); QToolBar* animationControlBar2 = new QToolBar(); #if 1 animationControlBar2->addAction(actionManager()->getAction(ACTION_AUTO_KEY_MODE_TOGGLE)); #else animationControlBar2->addWidget(new AnimationFramesToolButton(datasetContainer())); #endif QWidget* animationTimeSpinnerContainer = new QWidget(); QHBoxLayout* animationTimeSpinnerLayout = new QHBoxLayout(animationTimeSpinnerContainer); animationTimeSpinnerLayout->setContentsMargins(0,0,0,0); animationTimeSpinnerLayout->setSpacing(0); class TimeEditBox : public QLineEdit { public: virtual QSize sizeHint() const { return minimumSizeHint(); } }; QLineEdit* timeEditBox = new TimeEditBox(); timeEditBox->setToolTip(tr("Current Animation Time")); AnimationTimeSpinner* currentTimeSpinner = new AnimationTimeSpinner(this); currentTimeSpinner->setTextBox(timeEditBox); animationTimeSpinnerLayout->addWidget(timeEditBox, 1); animationTimeSpinnerLayout->addWidget(currentTimeSpinner); animationControlBar2->addWidget(animationTimeSpinnerContainer); animationControlBar2->addAction(actionManager()->getAction(ACTION_ANIMATION_SETTINGS)); animationControlBar2->addWidget(new QWidget()); QWidget* animationControlPanel = new QWidget(); QVBoxLayout* animationControlPanelLayout = new QVBoxLayout(animationControlPanel); animationControlPanelLayout->setSpacing(0); animationControlPanelLayout->setContentsMargins(0, 1, 0, 0); animationControlPanelLayout->addWidget(animationControlBar1); animationControlPanelLayout->addWidget(animationControlBar2); animationControlPanelLayout->addStretch(1); animationControlPanel->setStyleSheet("QToolBar { padding: 0px; margin: 0px; border: 0px none black; } QToolButton { padding: 0px; margin: 0px }"); animationControlPanel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); // Create the viewport control toolbar. QToolBar* viewportControlBar1 = new QToolBar(); viewportControlBar1->addAction(actionManager()->getAction(ACTION_VIEWPORT_ZOOM)); viewportControlBar1->addAction(actionManager()->getAction(ACTION_VIEWPORT_PAN)); viewportControlBar1->addAction(actionManager()->getAction(ACTION_VIEWPORT_ORBIT)); viewportControlBar1->addAction(actionManager()->getAction(ACTION_VIEWPORT_PICK_ORBIT_CENTER)); QToolBar* viewportControlBar2 = new QToolBar(); viewportControlBar2->addAction(actionManager()->getAction(ACTION_VIEWPORT_ZOOM_SCENE_EXTENTS)); viewportControlBar2->addAction(actionManager()->getAction(ACTION_VIEWPORT_ZOOM_SELECTION_EXTENTS)); viewportControlBar2->addAction(actionManager()->getAction(ACTION_VIEWPORT_FOV)); viewportControlBar2->addAction(actionManager()->getAction(ACTION_VIEWPORT_MAXIMIZE)); QWidget* viewportControlPanel = new QWidget(); QVBoxLayout* viewportControlPanelLayout = new QVBoxLayout(viewportControlPanel); viewportControlPanelLayout->setSpacing(0); viewportControlPanelLayout->setContentsMargins(0, 1, 0, 0); viewportControlPanelLayout->addWidget(viewportControlBar1); QHBoxLayout* sublayout = new QHBoxLayout(); sublayout->addStretch(1); sublayout->addWidget(viewportControlBar2); viewportControlPanelLayout->addLayout(sublayout); viewportControlPanelLayout->addStretch(1); viewportControlPanel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); viewportControlPanel->setStyleSheet("QToolBar { padding: 0px; margin: 0px; border: 0px none black; } QToolButton { padding: 0px; margin: 0px }"); // Create the command panel. _commandPanel = new CommandPanel(this, this); createDockPanel(tr("Animation Panel"), "AnimationPanel", Qt::BottomDockWidgetArea, Qt::BottomDockWidgetArea, animationPanel); createDockPanel(tr("Animation Control Panel"), "AnimationControlPanel", Qt::BottomDockWidgetArea, Qt::BottomDockWidgetArea, animationControlPanel); createDockPanel(tr("Viewport Control"), "ViewportControlPanel", Qt::BottomDockWidgetArea, Qt::BottomDockWidgetArea, viewportControlPanel); createDockPanel(tr("Command Panel"), "CommandPanel", Qt::RightDockWidgetArea, Qt::DockWidgetAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea), _commandPanel); // Create the frame buffer window. _frameBufferWindow = new FrameBufferWindow(this); }
TransactionView::TransactionView(const PlatformStyle* platformStyle, QWidget* parent) : QWidget(parent) , model(0) , transactionProxyModel(0) , transactionView(0) , abandonAction(0) { setContentsMargins(0, 0, 0, 0); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); /*if (platformStyle->getUseExtraSpacing()) { hlayout->setSpacing(5); hlayout->addSpacing(26); } else { hlayout->setSpacing(0); hlayout->addSpacing(23); }*/ watchOnlyWidget = new QComboBox(this); watchOnlyWidget->setFixedWidth(24); watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); hlayout->addWidget(watchOnlyWidget); dateWidget = new QComboBox(this); /*if (platformStyle->getUseExtraSpacing()) { dateWidget->setFixedWidth(121); } else { dateWidget->setFixedWidth(120); }*/ dateWidget->addItem(tr("All dates"), 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("Select range"), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); /*if (platformStyle->getUseExtraSpacing()) { typeWidget->setFixedWidth(121); } else { typeWidget->setFixedWidth(120); }*/ typeWidget->addItem(tr("All transaction types"), 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("Internal transfer"), TransactionFilterProxy::TYPE(TransactionRecord::InternalTransfer)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); hlayout->addWidget(typeWidget); QLabel* searchLabel = new QLabel(""); searchLabel->setObjectName("searchLabel1"); searchLabel->setContentsMargins(0, 0, 0, 0); hlayout->addWidget(searchLabel); addressWidget = new QLineEdit(this); addressWidget->setObjectName("searchBox1"); #if QT_VERSION >= 0x040700 addressWidget->setPlaceholderText(tr("Search label")); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); amountWidget->setObjectName("amountWidget"); amountWidget->setAlignment(Qt::AlignRight); #if QT_VERSION >= 0x040700 amountWidget->setPlaceholderText(tr("Min amount")); #endif amountWidget->setFixedWidth(120); 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); QFrame* topMargin = new QFrame(this); topMargin->setObjectName("topMargin"); topMargin->setContentsMargins(0, 0, 0, 0); vlayout->addWidget(topMargin); vlayout->addWidget(createDateRangeWidget()); QTableView* view = new QTableView(this); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); /*int width = view->verticalScrollBar()->sizeHint().width(); if (platformStyle->getUseExtraSpacing()) { hlayout->addSpacing(width+2); } else { hlayout->addSpacing(width); }*/ view->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); view->installEventFilter(this); transactionView = view; abandonAction = new QAction(tr("Abandon transaction"), this); 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* copyTxHexAction = new QAction(tr("Copy raw transaction"), this); QAction* copyTxPlainText = new QAction(tr("Copy full transaction details"), 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(copyTxHexAction); contextMenu->addAction(copyTxPlainText); contextMenu->addAction(showDetailsAction); contextMenu->addSeparator(); contextMenu->addAction(abandonAction); contextMenu->addAction(editLabelAction); mapperThirdPartyTxUrls = new QSignalMapper(this); 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(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx())); 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(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex())); connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("StarCoin") + " - " + tr("Wallet")); // Prevent resizing. setFixedSize(size()); // Remove "hand" cursor from status bar. this->statusBar()->setSizeGripEnabled(false); // this->setStyleSheet(".BitcoinGUI { background-image: url(:/images/background-no-logo); } \ // * { color: rgb(255, 255, 255); \ // background-color: rgba(255, 255, 255, 0); \ // selection-background-color: rgb(2, 6, 150); \ // } \ // QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; } \ // QTableView { background-color: rgb(2, 6, 15); alternate-background-color: rgb(2, 6, 50); } \ // QHeaderView::section { \ // background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, \ // stop:0 rgb(2, 6, 15), stop: 0.5 rgb(2, 6, 70), \ // stop: 0.6 rgb(2, 6, 70), stop:1 rgb(2, 6, 15)); \ // color: white; \ // padding-left: 4px; \ // border: 1px solid #6c6c6c; \ // } \ // QFrame#frameMain, QToolButton:on { \ // background-color: rgba(11, 38, 73, 210); \ // border: 1px solid rgb(0, 186, 255); \ // border-radius: 4px; \ // } \ // QValueComboBox, QLineEdit, QDoubleSpinBox { \ // border: 1px solid rgb(2, 6, 150) \ // }\ // "); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(this); { transactionsPage = new QWidget(this); QHBoxLayout* hl = new QHBoxLayout(transactionsPage); QFrame* frameMain = new QFrame(transactionsPage); hl->addWidget(frameMain); frameMain->setObjectName(QString("frameMain")); frameMain->setFrameShape(QFrame::NoFrame); QVBoxLayout *vbox = new QVBoxLayout(frameMain); transactionView = new TransactionView(transactionsPage); vbox->addWidget(transactionView); frameMain->setLayout(vbox); } addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog.reset(new SignVerifyMessageDialog); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole.reset(new RPCConsole); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole.data(), SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0), nAverageWeight(0), nTotalWeight(0) { setStyleSheet("font-weight:300; font-size:12px; font-family:'Roboto'"); QString ss("QMenuBar::item { background-color: transparent; color: #000000 }"); menuBar()->setStyleSheet(ss); restoreWindowGeometry(); setWindowTitle(tr("Guarany") + " - " + tr("Wallet")); qApp->setStyle(QStyleFactory::create("Fusion")); QPalette palette; palette.setColor(QPalette::Window, QColor(247,247,247)); palette.setColor(QPalette::WindowText, Qt::black); palette.setColor(QPalette::Base, QColor(247,247,247)); palette.setColor(QPalette::AlternateBase, QColor(207,220,226)); palette.setColor(QPalette::ToolTipBase, Qt::white); palette.setColor(QPalette::ToolTipText, Qt::white); palette.setColor(QPalette::Text, Qt::black); palette.setColor(QPalette::Button, QColor(13,80,111)); palette.setColor(QPalette::ButtonText, Qt::white); palette.setColor(QPalette::BrightText, Qt::red); palette.setColor(QPalette::Highlight, QColor(65,139,202).lighter()); palette.setColor(QPalette::HighlightedText, Qt::black); qApp->setPalette(palette); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Create wallet frame and make it the central widget walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(); // Create status bar statusBar(); statusBar()->setStyleSheet("border: none; background-color: #0d506f; color: #FFFFFF;"); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); // frameBlocks->setMinimumWidth(56); // frameBlocks->setMaximumWidth(56); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); frameBlocks->setStyleSheet("color: #FFFFFF;"); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(60 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // prevents an open debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); // Initially wallet actions should be disabled setWalletActionsEnabled(false); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(1000, 520); //setFixedSize(1040, 560); setWindowTitle(tr("Roscoin") + " - " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background:rgb(237,241,247);font-family:'Proxima Nova Rg'; }" "#toolbar2 { border:none;width:28px;background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,232,204)) }" "QMenu { background: rgb(35,35,35); color:white; padding-bottom:10px; } " "QMenu::item { color:white; background-color: transparent; } " "QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,232,204)); }" "QMenuBar { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,232,204)); color:white; }" "QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; }" "QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,232,204)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars // createToolBars(); createToolBars2(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); blockBrowser = new BlockBrowser(this); statisticsPage = new StatisticsPage(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(blockBrowser); centralWidget->addWidget(statisticsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); statusBar()->setStyleSheet( "QStatusBar{ background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,232,204)); }" ); // "QMenuBar { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(35,35,35), stop: 1 rgb(0,141,210)); color:white; }" //statusBar()->setStyleSheet("QStatusBar{ background:rgb(0,141,210);}"); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) : QMainWindow(parent), enableWallet(false), clientModel(0), walletFrame(0), unitDisplayControl(0), labelWalletEncryptionIcon(0), labelWalletHDStatusIcon(0), connectionsControl(0), labelBlocksIcon(0), progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), sendCoinsMenuAction(0), usedSendingAddressesAction(0), usedReceivingAddressesAction(0), signMessageAction(0), verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), receiveCoinsMenuAction(0), optionsAction(0), toggleHideAction(0), encryptWalletAction(0), backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), openRPCConsoleAction(0), openAction(0), showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), rpcConsole(0), helpMessageDialog(0), modalOverlay(0), prevBlocks(0), spinnerFrame(0), platformStyle(_platformStyle) { QSettings settings; if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) { // Restore failed (perhaps missing setting), center the window move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center()); } QString windowTitle = tr(PACKAGE_NAME) + " - "; #ifdef ENABLE_WALLET enableWallet = WalletModel::isWalletEnabled(); #endif // ENABLE_WALLET if(enableWallet) { windowTitle += tr("Wallet"); } else { windowTitle += tr("Node"); } windowTitle += " " + networkStyle->getTitleAddText(); #ifndef Q_OS_MAC QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon()); setWindowIcon(networkStyle->getTrayAndWindowIcon()); #else MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon()); #endif setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 // This property is not implemented in Qt 5. Setting it has no effect. // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras. setUnifiedTitleAndToolBarOnMac(true); #endif rpcConsole = new RPCConsole(_platformStyle, 0); helpMessageDialog = new HelpMessageDialog(this, false); #ifdef ENABLE_WALLET if(enableWallet) { /** Create wallet frame and make it the central widget */ walletFrame = new WalletFrame(_platformStyle, this); setCentralWidget(walletFrame); } else #endif // ENABLE_WALLET { /* When compiled without wallet or -disablewallet is provided, * the central widget is the rpc console. */ setCentralWidget(rpcConsole); } // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(networkStyle); // Create status bar statusBar(); // Disable size grip because it looks ugly and nobody needs it statusBar()->setSizeGripEnabled(false); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle); labelWalletEncryptionIcon = new QLabel(); labelWalletHDStatusIcon = new QLabel(); connectionsControl = new GUIUtil::ClickableLabel(); labelBlocksIcon = new GUIUtil::ClickableLabel(); if(enableWallet) { frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(unitDisplayControl); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelWalletEncryptionIcon); frameBlocksLayout->addWidget(labelWalletHDStatusIcon); } frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(connectionsControl); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); // Initially wallet actions should be disabled setWalletActionsEnabled(false); // Subscribe to notifications from core subscribeToCoreSignals(); connect(connectionsControl, SIGNAL(clicked(QPoint)), this, SLOT(toggleNetworkActive())); modalOverlay = new ModalOverlay(this->centralWidget()); #ifdef ENABLE_WALLET if(enableWallet) { connect(walletFrame, SIGNAL(requestedSyncWarningInfo()), this, SLOT(showModalOverlay())); connect(labelBlocksIcon, SIGNAL(clicked(QPoint)), this, SLOT(showModalOverlay())); connect(progressBar, SIGNAL(clicked(QPoint)), this, SLOT(showModalOverlay())); } #endif }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("BitBar")+" - "+tr("Wallet")+" "+QString::fromStdString(CLIENT_BUILD)); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); menuBar()->setNativeMenuBar(false);// menubar on form instead // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); skinsPage = new SkinsPage(this); connect(skinsPage, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); connect(skinsPage, SIGNAL(information(QString,QString)), this, SLOT(information(QString,QString))); connect(skinsPage, SIGNAL(status(QString)), this, SLOT(status(QString))); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(skinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelMintingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelMintingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Set minting pixmap labelMintingIcon->setPixmap(QIcon(":/icons/staking_on").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelMintingIcon->setEnabled(false); // Add timer to update minting icon QTimer *timerMintingIcon = new QTimer(labelMintingIcon); timerMintingIcon->start(MODEL_UPDATE_DELAY); connect(timerMintingIcon, SIGNAL(timeout()), this, SLOT(updateMintingIcon())); // Add timer to update minting weights QTimer *timerMintingWeights = new QTimer(labelMintingIcon); timerMintingWeights->start(30 * 1000); connect(timerMintingWeights, SIGNAL(timeout()), this, SLOT(updateMintingWeights())); // Set initial values for user and network weights nWeight=0; nNetworkWeight = 0; // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), unitDisplayControl(0), labelEncryptionIcon(0), labelConnectionsIcon(0), labelBlocksIcon(0), progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), usedSendingAddressesAction(0), usedReceivingAddressesAction(0), signMessageAction(0), verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), optionsAction(0), toggleHideAction(0), encryptWalletAction(0), backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), openRPCConsoleAction(0), openAction(0), showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), rpcConsole(0), prevBlocks(0), spinnerFrame(0) { /* Open CSS when configured */ this->setStyleSheet(GUIUtil::loadStyleSheet()); GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr("X11BaseCoin Core") + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ enableWallet = !GetBoolArg("-disablewallet", false); #else enableWallet = false; #endif // ENABLE_WALLET if(enableWallet) { windowTitle += tr("Wallet"); } else { windowTitle += tr("Node"); } QString userWindowTitle = QString::fromStdString(GetArg("-windowtitle", "")); if(!userWindowTitle.isEmpty()) windowTitle += " - " + userWindowTitle; windowTitle += " " + networkStyle->getTitleAddText(); #ifndef Q_OS_MAC QApplication::setWindowIcon(networkStyle->getAppIcon()); setWindowIcon(networkStyle->getAppIcon()); #else MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon()); #endif setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 // This property is not implemented in Qt 5. Setting it has no effect. // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras. setUnifiedTitleAndToolBarOnMac(true); #endif rpcConsole = new RPCConsole(enableWallet ? this : 0); #ifdef ENABLE_WALLET if(enableWallet) { /** Create wallet frame*/ walletFrame = new WalletFrame(this); } else #endif // ENABLE_WALLET { /* When compiled without wallet or -disablewallet is provided, * the central widget is the rpc console. */ setCentralWidget(rpcConsole); } // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(networkStyle); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(networkStyle); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); unitDisplayControl = new UnitDisplayStatusBarControl(); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QPushButton(); labelConnectionsIcon->setFlat(true); // Make the button look like a label, but clickable labelConnectionsIcon->setStyleSheet(".QPushButton { background-color: rgba(255, 255, 255, 0);}"); labelConnectionsIcon->setMaximumSize(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE); labelBlocksIcon = new QLabel(); if(enableWallet) { frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(unitDisplayControl); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); } frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(true); progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(true); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #F8F8F8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #00CCFF, stop: 1 #33CCFF); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); // Jump directly to tabs in RPC-console connect(openInfoAction, SIGNAL(triggered()), rpcConsole, SLOT(showInfo())); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(showConsole())); connect(openNetworkAction, SIGNAL(triggered()), rpcConsole, SLOT(showNetwork())); connect(openPeersAction, SIGNAL(triggered()), rpcConsole, SLOT(showPeers())); connect(openRepairAction, SIGNAL(triggered()), rpcConsole, SLOT(showRepair())); connect(openConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showConfEditor())); connect(showBackupsAction, SIGNAL(triggered()), rpcConsole, SLOT(showBackups())); connect(labelConnectionsIcon, SIGNAL(clicked()), rpcConsole, SLOT(showPeers())); // Get restart command-line parameters and handle restart connect(rpcConsole, SIGNAL(handleRestart(QStringList)), this, SLOT(handleRestart(QStringList))); // prevents an open debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); // Initially wallet actions should be disabled setWalletActionsEnabled(false); // Subscribe to notifications from core subscribeToCoreSignals(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(650, 550); // resize(530, 550); setWindowTitle(tr("LEOcoin") + " - " + tr("Wallet")); qApp->setStyleSheet( "QMainWindow { background: #e8e8e8;font-family:'Open Sans,sans-serif'; } " \ "QCheckBox { spacing: 5px; } "\ "QCheckBox::indicator { width: 24px; height: 24px; }" \ "QCheckBox::indicator:unchecked { image: url(:/images/checkbox_unchecked); }" \ "QCheckBox::indicator:checked { image: url(:/images/checkbox_checked); }" \ "QComboBox { border: 1px solid gray; border-radius: 3px; padding: 1px 18px 1px 3px; }" \ "QComboBox:editable { background: white; }" \ "QComboBox:!editable, QComboBox::drop-down:editable { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); } " \ "QComboBox:!editable:on, QComboBox::drop-down:editable:on { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3D3D3, stop: 0.4 #D8D8D8, stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1); } " \ "QComboBox:on { /* shift the text when the popup opens */ padding-top: 3px; padding-left: 4px; } " \ "QComboBox::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid; /* just a single line */ border-top-right-radius: 3px; /* same radius as the QComboBox */ border-bottom-right-radius: 3px; } " \ "QComboBox::down-arrow1 { image: url(/usr/share/icons/crystalsvg/16x16/actions/1downarrow.png); } " \ "QComboBox::down-arrow:on { /* shift the arrow when popup is open */ top: 1px; left: 1px; }" \ "QLineEdit { border: 0px; border-radius1: 10px; padding: 0 8px; background: #c7c8ca; selection-background-color: #eea734; margin: 6px; }" \ "QLabel { color: #404041; } " \ "QTableView { background: #c7c8ca; border-color: #e8e8e8; margin: 6px; } " \ "QTableView QHeaderView { } " \ "QTableView QAbstractItemView { margin: 4px; min-height: 28px; border: 3px; } " \ "QStatusBar { background: #a7aaac; } " \ "#frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; border: 0px; border-color: yellow;} " \ "#spacer { background:#a7aaac;border:none; } " \ "#toolbar { height:100%;padding-top:20px; background: #e8e8e8; text-align: left; min-width:200px;max-width:200px; border: none; margin: -2px; padding: -2px; } " \ "QToolBar QToolButton { font-family:Open Sans;padding-left:0px;padding-top:10px;padding-bottom:10px; width:200px; color: black; text-align: left; background-color: #a7aaac } " \ "QToolBar QToolButton:hover:!checked { color: #eea734; background-color: #a7aaac; border: none; } " \ "QToolBar QToolButton:pressed { color: #404041; background-color: #e8e8e8; border: none; } " \ "QToolBar QToolButton:checked { color: #eea734; background-color: #e8e8e8; border: none; } " \ "QToolBar QToolButton:disabled { color: grey; } " \ "QToolButton { color: black; background-color: #eea734; border: none; text-align: center; min-height: 24px; } " \ "#labelMiningIcon { padding-left:5px;font-family:Open Sans;width:100%;font-size:10px;text-align:center;color:grey; } " \ "QMenu { background: #a7aaac; color: #404041; padding-bottom:10px; border: 1px solid grey; } " \ "QMenu::item { color:#404041; background-color: transparent; } " \ "QMenu::item:selected { color: #282828; background-color: #e8e8e8; } " \ "QMenuBar { background: #a7aaac; color: #404041; } " \ "QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:#282828; background-color: transparent; } " \ "QMenuBar::item:selected { color: #e8e8e8; background-color: #282828); }" "QTabWidget {background-color: #e8e8e8; }" \ "#debug QLabel {color: white; }" \ "QDateTime {}" ); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 0px solid grey; border-radius: 7px; padding: 1px; text-align: center; } " \ "QProgressBar::chunk { background: #eea734; border-radius: 7px; margin: 0px; }"); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 0px solid grey; border-radius: 7px; padding: 1px; text-align: center; } " \ "QProgressBar::chunk { background: #eea734; border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); syncIconMovie->setScaledSize(QSize(24,24)); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0) { setFixedSize(970, 550); setWindowTitle(tr("Aiden") + " " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(40,107,165);border:none; } #toolbar2 { border:none;width:10px; background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(58,168,255), stop: 1 rgb(188,255,255)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(40,107,165); text-align: left; color: white;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(42,96,151), stop: 1 rgb(68,143,189),stop: 2 rgb(58,168,255));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:200px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(40,107,165) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(40,107,165); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(42,96,151), stop: 1 rgb(68,143,189)); } QMenuBar { background: rgb(40,107,165); color:white; } QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(42,96,151), stop: 1 rgb(68,143,189)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Create wallet frame and make it the central widget walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setStyleSheet("frameBlocks { background: rgb(244,87,94); }"); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(30); frameBlocks->setMaximumWidth(30); QVBoxLayout *frameBlocksLayout = new QVBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(1,0,1,0); frameBlocksLayout->setSpacing(15); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(28); toolbar2->addWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); }
DocumentMetaConfigurationPage::DocumentMetaConfigurationPage(RosegardenDocument *doc, QWidget *parent) : TabbedConfigurationPage(doc, parent) { m_headersPage = new HeadersConfigurationPage(this, doc); addTab(m_headersPage, tr("Headers")); Composition &comp = doc->getComposition(); std::set <TrackId> usedTracks; int audioSegments = 0, internalSegments = 0; for (Composition::iterator ci = comp.begin(); ci != comp.end(); ++ci) { usedTracks.insert((*ci)->getTrack()); if ((*ci)->getType() == Segment::Audio) ++audioSegments; else ++internalSegments; } QFrame *frame = new QFrame(m_tabWidget); frame->setContentsMargins(10, 10, 10, 10); QGridLayout *layout = new QGridLayout(frame); layout->setSpacing(5); layout->addWidget(new QLabel(tr("Filename:"), frame), 0, 0); layout->addWidget(new QLabel(doc->getTitle(), frame), 0, 1); layout->addWidget(new QLabel(tr("Formal duration (to end marker):"), frame), 1, 0); timeT d = comp.getEndMarker(); RealTime rtd = comp.getElapsedRealTime(d); layout->addWidget(new QLabel(durationToString(comp, 0, d, rtd), frame), 1, 1); layout->addWidget(new QLabel(tr("Playing duration:"), frame), 2, 0); d = comp.getDuration(); rtd = comp.getElapsedRealTime(d); layout->addWidget(new QLabel(durationToString(comp, 0, d, rtd), frame), 2, 1); layout->addWidget(new QLabel(tr("Tracks:"), frame), 3, 0); layout->addWidget(new QLabel(tr("%1 used, %2 total") .arg(usedTracks.size()) .arg(comp.getNbTracks()), frame), 3, 1); layout->addWidget(new QLabel(tr("Segments:"), frame), 4, 0); layout->addWidget(new QLabel(tr("%1 MIDI, %2 audio, %3 total") .arg(internalSegments) .arg(audioSegments) .arg(internalSegments + audioSegments), frame), 4, 1); layout->setRowStretch(5, 2); addTab(frame, tr("Statistics")); frame = new QFrame(m_tabWidget); frame->setContentsMargins(10, 10, 10, 10); layout = new QGridLayout(frame); layout->setSpacing(5); QTableWidget *table = new QTableWidget(1, 11, frame); // , "Segment Table" table->setObjectName("StyledTable"); table->setAlternatingRowColors(true); //table->setSelectionMode(QTableWidget::NoSelection); table->setSelectionBehavior( QAbstractItemView::SelectRows ); table->setSelectionMode( QAbstractItemView::SingleSelection ); table->setSortingEnabled(true); table->setHorizontalHeaderItem( 0, new QTableWidgetItem( tr("Type"))); // p1=column table->setHorizontalHeaderItem( 1, new QTableWidgetItem( tr("Track"))); table->setHorizontalHeaderItem( 2, new QTableWidgetItem( tr("Label"))); table->setHorizontalHeaderItem( 3, new QTableWidgetItem( tr("Time"))); table->setHorizontalHeaderItem( 4, new QTableWidgetItem( tr("Duration"))); table->setHorizontalHeaderItem( 5, new QTableWidgetItem( tr("Events"))); table->setHorizontalHeaderItem( 6, new QTableWidgetItem( tr("Polyphony"))); table->setHorizontalHeaderItem( 7, new QTableWidgetItem( tr("Repeat"))); table->setHorizontalHeaderItem( 8, new QTableWidgetItem( tr("Quantize"))); table->setHorizontalHeaderItem( 9, new QTableWidgetItem( tr("Transpose"))); table->setHorizontalHeaderItem( 10, new QTableWidgetItem( tr("Delay"))); //table->setNumRows(audioSegments + internalSegments); table->setRowCount(audioSegments + internalSegments); table->setColumnWidth(0, 50); table->setColumnWidth(1, 50); table->setColumnWidth(2, 150); table->setColumnWidth(3, 80); table->setColumnWidth(4, 80); table->setColumnWidth(5, 80); table->setColumnWidth(6, 80); table->setColumnWidth(7, 80); table->setColumnWidth(8, 80); table->setColumnWidth(9, 80); table->setColumnWidth(10, 80); int i = 0; for (Composition::iterator ci = comp.begin(); ci != comp.end(); ++ci) { Segment *s = *ci; table->setItem(i, 0, new SegmentDataItem (table, s->getType() == Segment::Audio ? tr("Audio") : tr("MIDI"))); table->setItem(i, 1, new SegmentDataItem (table, QString("%1").arg(s->getTrack() + 1))); QPixmap colourPixmap(16, 16); Colour colour = comp.getSegmentColourMap().getColourByIndex(s->getColourIndex()); colourPixmap.fill(GUIPalette::convertColour(colour)); table->setItem(i, 2, new QTableWidgetItem( colourPixmap, strtoqstr(s->getLabel())) ); // new QTableWidgetItem(table, QTableWidgetItem::Never, // strtoqstr(s->getLabel()), // colourPixmap)); table->setItem(i, 3, new SegmentDataItem (table, QString("%1").arg(s->getStartTime()))); table->setItem(i, 4, new SegmentDataItem (table, QString("%1").arg(s->getEndMarkerTime() - s->getStartTime()))); std::set<long> notesOn; std::multimap<timeT, long> noteOffs; int events = 0, notes = 0, poly = 0, maxPoly = 0; for (Segment::iterator si = s->begin(); s->isBeforeEndMarker(si); ++si) { ++events; if ((*si)->isa(Note::EventType)) { ++notes; timeT startTime = (*si)->getAbsoluteTime(); timeT endTime = startTime + (*si)->getDuration(); if (endTime == startTime) continue; while (!noteOffs.empty() && (startTime >= noteOffs.begin()->first)) { notesOn.erase(noteOffs.begin()->second); noteOffs.erase(noteOffs.begin()); } long pitch = 0; (*si)->get<Int>(BaseProperties::PITCH, pitch); notesOn.insert(pitch); noteOffs.insert(std::multimap<timeT, long>::value_type(endTime, pitch)); poly = notesOn.size(); if (poly > maxPoly) maxPoly = poly; } } table->setItem(i, 5, new SegmentDataItem (table, QString("%1").arg(events))); table->setItem(i, 6, new SegmentDataItem (table, QString("%1").arg(maxPoly))); table->setItem(i, 7, new SegmentDataItem (table, s->isRepeating() ? tr("Yes") : tr("No"))); timeT discard; if (s->getQuantizer() && s->hasQuantization()) { timeT unit = s->getQuantizer()->getUnit(); table->setItem(i, 8, new SegmentDataItem (table, NotationStrings::makeNoteMenuLabel (unit, true, discard, false))); } else { table->setItem(i, 8, new SegmentDataItem (table, tr("Off"))); } table->setItem(i, 9, new SegmentDataItem (table, QString("%1").arg(s->getTranspose()))); if (s->getDelay() != 0) { if (s->getRealTimeDelay() != RealTime::zeroTime) { table->setItem(i, 10, new SegmentDataItem (table, QString("%1 + %2 ms") .arg(NotationStrings::makeNoteMenuLabel (s->getDelay(), true, discard, false)) .arg(s->getRealTimeDelay().sec * 1000 + s->getRealTimeDelay().msec()))); } else { table->setItem(i, 10, new SegmentDataItem (table, NotationStrings::makeNoteMenuLabel (s->getDelay(), true, discard, false))); } } else if (s->getRealTimeDelay() != RealTime::zeroTime) { table->setItem(i, 10, new SegmentDataItem (table, QString("%2 ms") .arg(s->getRealTimeDelay().sec * 1000 + s->getRealTimeDelay().msec()))); } else { table->setItem(i, 10, new SegmentDataItem (table, tr("None"))); } ++i; } layout->addWidget(table, 0, 0); addTab(frame, tr("Segment Summary")); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("10k Wallet")); #ifndef Q_WS_MAC setWindowIcon(QIcon(":icons/toolbar")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); messagePage = new MessagePage(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(messagePage); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); //frameBlocks->setMinimumWidth(56); //frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); gotoOverviewPage(); }
QRibbonSection::QRibbonSection(QWidget *parent, const QString &_title, const QString &_name) : QWidget(parent) { action = NULL; col = 0; row = 0; colBase = 0; _index = -1; if (&_name) { this->setObjectName(_name); } QHBoxLayout *slayout = new QHBoxLayout(); slayout->setContentsMargins(2,0,2,0); slayout->setSpacing(2); this->setLayout(slayout); //QLabel *lab_line = new QLabel("X", this); QFrame *line = new QFrame(this); line->setFrameStyle(QFrame::VLine | QFrame::Plain); line->setFixedWidth(3); line->setContentsMargins(0,3,0,5); line->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QString sheet = line->styleSheet(); sheet.append("QFrame { color: #c0c0c0; }"); line->setStyleSheet(sheet); QWidget *wvbox = new QWidget(this); QVBoxLayout *layout = new QVBoxLayout(); layout->setContentsMargins(0,0,0,0); layout->setSpacing(0); wvbox->setLayout(layout); buttons = new QWidget(wvbox); QGridLayout *blayout = new QGridLayout(); blayout->setContentsMargins(0,0,0,0); blayout->setSpacing(2); buttons->setLayout(blayout); QHBoxLayout *lfooter = new QHBoxLayout(); lfooter->setContentsMargins(0,0,0,0); QWidget *footer = new QWidget(wvbox); footer->setLayout(lfooter); if (&title == 0) { title = new QLabel("", footer); } else { title = new QLabel(_title, footer); } title->setAlignment(Qt::AlignCenter); QFont titleFont = title->font(); titleFont.setPointSize(titleFont.pointSize()*0.98f); title->setFont(titleFont); { QIcon *dtl = new QIcon(":/icons/QRibbonDetails.svg"); details = new QRibbonButton(*dtl, "", footer); delete dtl; } details->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); QFont f; QFontMetrics metrics(f); QSize is = QSize(metrics.boundingRect("^").width(), metrics.boundingRect("X").height()); is = QSize(is.width()*2, is.height()); details->setIconSize(is); details->setMaximumSize(is); details->setVisible(false); QObject::connect(details, SIGNAL(clicked()), this, SLOT(activateDetails())); lfooter->addWidget(title, 1); lfooter->addWidget(details); layout->addWidget(buttons, 1); layout->addWidget(footer); slayout->addWidget(wvbox, 1); slayout->addWidget(line, 1); }
BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0), spinnerFrame(0) { /* Open CSS when configured */ this->setStyleSheet(GUIUtil::loadStyleSheet()); GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr("Mobicoin Core") + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ bool enableWallet = !GetBoolArg("-disablewallet", false); #else bool enableWallet = false; #endif if(enableWallet) { windowTitle += tr("Wallet"); } else { windowTitle += tr("Node"); } if (!fIsTestnet) { #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin")); #endif } else { windowTitle += " " + tr("[testnet]"); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); #else MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); #endif } setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 // This property is not implemented in Qt 5. Setting it has no effect. // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras. setUnifiedTitleAndToolBarOnMac(true); #endif rpcConsole = new RPCConsole(enableWallet ? this : 0); #ifdef ENABLE_WALLET if(enableWallet) { /** Create wallet frame*/ walletFrame = new WalletFrame(this); } else #endif { /* When compiled without wallet or -disablewallet is provided, * the central widget is the rpc console. */ setCentralWidget(rpcConsole); } // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(fIsTestnet); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(fIsTestnet); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #F8F8F8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #00CCFF, stop: 1 #33CCFF); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); connect(openInfoAction, SIGNAL(triggered()), rpcConsole, SLOT(showInfo())); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(showConsole())); connect(openNetworkAction, SIGNAL(triggered()), rpcConsole, SLOT(showNetwork())); connect(openConfEditorAction, SIGNAL(triggered()), rpcConsole, SLOT(showConfEditor())); connect(showBackupsAction, SIGNAL(triggered()), rpcConsole, SLOT(showBackups())); // prevents an oben debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); // Initially wallet actions should be disabled setWalletActionsEnabled(false); // Subscribe to notifications from core subscribeToCoreSignals(); }
LilyPondOptionsDialog::LilyPondOptionsDialog(QWidget *parent, RosegardenDocument *doc, QString windowCaption, QString /* heading */, bool createdFromNotationEditor): QDialog(parent), m_doc(doc), m_createdFromNotationEditor(createdFromNotationEditor) { setModal(true); setWindowTitle((windowCaption = "" ? tr("LilyPond Export/Preview") : windowCaption)); QGridLayout *metaGridLayout = new QGridLayout; QWidget *mainbox = new QWidget(this); QVBoxLayout *mainboxLayout = new QVBoxLayout; metaGridLayout->addWidget(mainbox, 0, 0); // // Arrange options in "Layout" and "Headers" tabs. // QTabWidget *tabWidget = new QTabWidget(mainbox); mainboxLayout->addWidget(tabWidget); QFrame *layoutFrame = new QFrame(); tabWidget->addTab(layoutFrame, tr("Layout")); layoutFrame->setContentsMargins(5, 5, 5, 5); QGridLayout *layoutGrid = new QGridLayout; layoutGrid->setSpacing(5); m_headersPage = new HeadersConfigurationPage(this, m_doc); tabWidget->addTab(m_headersPage, tr("Headers")); // m_headersPage->setSpacing(5); // m_headersPage->setMargin(5); // // LilyPond export: Basic options // QGroupBox *basicOptionsBox = new QGroupBox(tr("Basic options"), layoutFrame); QVBoxLayout *basicOptionsBoxLayout = new QVBoxLayout; layoutGrid->addWidget(basicOptionsBox, 0, 0); QFrame *frameBasic = new QFrame(basicOptionsBox); frameBasic->setContentsMargins(10, 10, 10, 10); QGridLayout *layoutBasic = new QGridLayout; layoutBasic->setSpacing(5); basicOptionsBoxLayout->addWidget(frameBasic); layoutBasic->addWidget(new QLabel( tr("Export content"), frameBasic), 0, 0); m_lilyExportSelection = new QComboBox(frameBasic); m_lilyExportSelection->setToolTip(tr("<qt>Choose which tracks or segments to export</qt>")); m_lilyExportSelection->addItem(tr("All tracks")); m_lilyExportSelection->addItem(tr("Non-muted tracks")); m_lilyExportSelection->addItem(tr("Selected track")); m_lilyExportSelection->addItem(tr("Selected segments")); if (m_createdFromNotationEditor) { // The following item is shown only when the dialog is opened // from the notation editor QString itemName = tr("Edited segments"); m_lilyExportSelection->addItem(itemName); m_editedSegmentsIndex = m_lilyExportSelection->findText(itemName); } layoutBasic->addWidget(m_lilyExportSelection, 0, 1); layoutBasic->addWidget(new QLabel( tr("Compatibility level"), frameBasic), 1, 0); m_lilyLanguage = new QComboBox(frameBasic); m_lilyLanguage->setToolTip(tr("<qt>Set the LilyPond version you have installed. If you have a newer version of LilyPond, choose the highest version Rosegarden supports.</qt>")); m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.6"))); m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.8"))); m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.10"))); m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.12"))); m_lilyLanguage->addItem(tr("LilyPond %1").arg(tr("2.14"))); layoutBasic->addWidget(m_lilyLanguage, 1, 1); layoutBasic->addWidget(new QLabel( tr("Paper size"), frameBasic), 2, 0); QHBoxLayout *hboxPaper = new QHBoxLayout; m_lilyPaperSize = new QComboBox(frameBasic); m_lilyPaperSize->setToolTip(tr("<qt>Set the paper size</qt>")); m_lilyPaperSize->addItem(tr("A3")); m_lilyPaperSize->addItem(tr("A4")); m_lilyPaperSize->addItem(tr("A5")); m_lilyPaperSize->addItem(tr("A6")); m_lilyPaperSize->addItem(tr("Legal")); m_lilyPaperSize->addItem(tr("US Letter")); m_lilyPaperSize->addItem(tr("Tabloid")); m_lilyPaperSize->addItem(tr("do not specify")); m_lilyPaperLandscape = new QCheckBox(tr("Landscape"), frameBasic); m_lilyPaperLandscape->setToolTip(tr("<qt>If checked, your score will print in landscape orientation instead of the default portrait orientation</qt>")); hboxPaper->addWidget(m_lilyPaperSize); hboxPaper->addWidget(new QLabel(" ", frameBasic)); // fixed-size spacer hboxPaper->addWidget(m_lilyPaperLandscape); layoutBasic->addLayout(hboxPaper, 2, 1); layoutBasic->addWidget(new QLabel( tr("Staff size"), frameBasic), 3, 0); m_lilyFontSize = new QComboBox(frameBasic); m_lilyFontSize->setToolTip(tr("<qt><p>Choose the staff size of the score. LilyPond will scale staff contents relative to this size.</p><p>Sizes marked * may provide the best rendering quality.</p></qt>")); for (unsigned int i = 0; i < MAX_POINTS; i++) { bool recommended = false; int printSize = i + FONT_OFFSET; switch (printSize) { case 11: case 13: case 14: case 19: case 20: case 23: case 26: recommended = true; break; default: recommended = false; } QString fontString = tr("%1 pt %2").arg(printSize).arg(recommended ? tr(" *") : ""); m_lilyFontSize->addItem(fontString); } layoutBasic->addWidget(m_lilyFontSize, 3, 1); // // LilyPond export: Notation options // QGroupBox *specificOptionsBox = new QGroupBox(tr("Advanced options"), layoutFrame); QVBoxLayout *specificOptionsBoxLayout = new QVBoxLayout; layoutGrid->addWidget(specificOptionsBox, 2, 0); QFrame *frameNotation = new QFrame(specificOptionsBox); frameNotation->setContentsMargins(10, 10, 10, 10); QGridLayout *layoutNotation = new QGridLayout; layoutNotation->setSpacing(5); specificOptionsBoxLayout->addWidget(frameNotation); m_lilyTempoMarks = new QComboBox(frameNotation); m_lilyTempoMarks->addItem(tr("None")); m_lilyTempoMarks->addItem(tr("First")); m_lilyTempoMarks->addItem(tr("All")); layoutNotation->addWidget(new QLabel( tr("Export tempo marks "), frameNotation), 0, 0); layoutNotation->addWidget(m_lilyTempoMarks, 0, 1); m_lilyTempoMarks->setToolTip(tr("<qt>Choose how often to show tempo marks in your score</qt>")); layoutNotation->addWidget(new QLabel( tr("Export lyrics"), frameNotation), 1, 0); m_lilyExportLyrics = new QComboBox(frameNotation); m_lilyExportLyrics->addItem(tr("None")); m_lilyExportLyrics->addItem(tr("Left")); m_lilyExportLyrics->addItem(tr("Center")); m_lilyExportLyrics->addItem(tr("Right")); layoutNotation->addWidget(m_lilyExportLyrics, 1, 1); m_lilyExportLyrics->setToolTip(tr("<qt>Set the position of the <b>lyrics</b> in relation to the notes</qt>")); m_lilyExportBeams = new QCheckBox( tr("Export beamings"), frameNotation); layoutNotation->addWidget(m_lilyExportBeams, 2, 0, 1, 2); m_lilyExportBeams->setToolTip(tr("<qt>If checked, Rosegarden's beamings will be exported. Otherwise, LilyPond will calculate beams automatically.</qt>")); // recycle this for a new option to ignore the track brackets (so it is less // obnoxious to print single parts where brackets are in place) m_lilyExportStaffGroup = new QCheckBox( tr("Export track staff brackets"), frameNotation); layoutNotation->addWidget(m_lilyExportStaffGroup, 3, 0, 1, 2); m_lilyExportStaffGroup->setToolTip(tr("<qt>Track staff brackets are found in the <b>Track Parameters</b> box, and may be used to group staffs in various ways</qt>")); m_useShortNames = new QCheckBox( tr("Print short staff names"), frameNotation); m_useShortNames->setToolTip(tr("<qt>Useful for large, complex scores, this prints the short name every time there is a line break in the score, making it easier to follow which line belongs to which instrument across pages</qt>")); layoutNotation->addWidget(m_useShortNames, 4, 0, 1, 2); layoutGrid->setRowStretch(4, 10); m_lilyChordNamesMode = new QCheckBox( tr("Interpret chord texts as lead sheet chord names"), frameNotation); layoutNotation->addWidget(m_lilyChordNamesMode, 5, 0, 1, 2); m_lilyChordNamesMode->setToolTip(tr("<qt><p>There is a tutorial on how to use this feature at http://www.rosegardenmusic.com/tutorials/supplemental/chordnames/index.html</p></qt>")); m_lilyRaggedBottom = new QCheckBox( tr("Ragged bottom (systems will not be spread vertically across the page)"), frameNotation); layoutNotation->addWidget(m_lilyRaggedBottom, 6, 0, 1, 2); m_lilyRaggedBottom->setToolTip(tr("<qt><p>Useful for multi-page scores: this may prevent ugly final pages</p></qt>")); m_lilyMarkerMode = new QComboBox(frameNotation); m_lilyMarkerMode->addItem(tr("No markers")); m_lilyMarkerMode->addItem(tr("Rehearsal marks")); m_lilyMarkerMode->addItem(tr("Marker text")); layoutNotation->addWidget(new QLabel( tr("Export markers"), frameNotation), 7, 0); layoutNotation->addWidget(m_lilyMarkerMode, 7, 1); m_lilyMarkerMode->setToolTip(tr("<qt>Markers are found on the <b>Marker Ruler</b>. They may be exported as text, or as rehearsal marks.</qt>")); m_lilyNoteLanguage = new QComboBox(frameNotation); // NB: language strings are specific to LilyPond so are not translated here m_lilyNoteLanguage->addItem("Arabic"); m_lilyNoteLanguage->addItem("Catalan"); m_lilyNoteLanguage->addItem("Deutsch"); m_lilyNoteLanguage->addItem("English"); m_lilyNoteLanguage->addItem("Espanol"); m_lilyNoteLanguage->addItem("Italiano"); m_lilyNoteLanguage->addItem("Nederlands"); m_lilyNoteLanguage->addItem("Norsk"); m_lilyNoteLanguage->addItem("Portugues"); m_lilyNoteLanguage->addItem("Suomi"); m_lilyNoteLanguage->addItem("Svenska"); m_lilyNoteLanguage->addItem("Vlaams"); layoutNotation->addWidget(new QLabel( tr("Notation language"), frameNotation), 8, 0); layoutNotation->addWidget(m_lilyNoteLanguage, 8, 1); m_lilyNoteLanguage->setToolTip(tr("<qt>Outputs note names and accidentals in any of LilyPond's supported languages</qt>")); // m_lilyRepeatMode = new QComboBox(frameNotation); // m_lilyRepeatMode->addItem(tr("Old mode")); // m_lilyRepeatMode->addItem(tr("Repeat when possible")); // m_lilyRepeatMode->addItem(tr("Always unfold")); // layoutNotation->addWidget(new QLabel( // tr("Repeat mode"), frameNotation),8, 0); // layoutNotation->addWidget(m_lilyRepeatMode, 8, 1); m_lilyRepeatMode = new QCheckBox( tr("Use repeat when possible"), frameNotation); m_lilyRepeatMode->setToolTip(tr("<qt>How to export repeating segments: When unchecked, " "repeating segments are always unfolded.</qt>")); layoutNotation->addWidget(m_lilyRepeatMode, 9, 0); m_lilyDrawBarAtVolta = new QCheckBox( tr("Draw bar line at volta"), frameNotation); m_lilyDrawBarAtVolta->setToolTip(tr("<qt>If checked a bar line is always " "drawn when a volta begins even if it " "begins in the middle of a bar.</qt>")); layoutNotation->addWidget(m_lilyDrawBarAtVolta, 10, 0); m_cancelAccidentals = new QCheckBox(tr("Cancel accidentals")); layoutNotation->addWidget(m_cancelAccidentals, 11, 0); m_cancelAccidentals->setToolTip(tr("<qt>When checked, natural signs are automatically printed to cancel any accidentals from previous key signatures. This cancelation behavior is separate from, and not related to how Rosegarden displays accidental cancelation in the notation editor.</qt>")); m_lilyExportEmptyStaves = new QCheckBox(tr("Export empty staves")); layoutNotation->addWidget(m_lilyExportEmptyStaves, 12, 0); m_lilyExportEmptyStaves->setToolTip(tr("<qt>When checked, LilyPond will print all staves, even if they are empty. Turning this option off may reduce clutter on scores that feature long silences for some instruments.</qt>")); // as of lucky 13 here, I'm seeing we really need to tidy up the layout soon m_fingeringsInStaff = new QCheckBox(tr("Allow fingerings inside staff")); layoutNotation->addWidget(m_fingeringsInStaff, 13, 0); m_fingeringsInStaff->setToolTip(tr("<qt>When checked, LilyPond is allowed print fingerings inside the staff. This can improve rendering in polyphonic scores with fingerings in different voices, and is on by default.</qt>")); basicOptionsBox->setLayout(basicOptionsBoxLayout); specificOptionsBox->setLayout(specificOptionsBoxLayout); layoutFrame->setLayout(layoutGrid); frameNotation->setLayout(layoutNotation); frameBasic->setLayout(layoutBasic); mainbox->setLayout(mainboxLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help); metaGridLayout->addWidget(buttonBox, 1, 0); metaGridLayout->setRowStretch(0, 10); setLayout(metaGridLayout); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help())); populateDefaultValues(); resize(minimumSizeHint()); }
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle &networkStyle, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), unitDisplayControl(0), labelEncryptionIcon(0), labelConnectionsIcon(0), labelBlocksIcon(0), progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), sendCoinsMenuAction(0), usedSendingAddressesAction(0), usedReceivingAddressesAction(0), signMessageAction(0), verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), receiveCoinsMenuAction(0), optionsAction(0), toggleHideAction(0), encryptWalletAction(0), backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), openRPCConsoleAction(0), openAction(0), showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), rpcConsole(0), helpMessageDialog(0), prevBlocks(0), spinnerFrame(0), platformStyle(platformStyle) { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr("Bitcoin Classic") + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ enableWallet = !GetBoolArg("-disablewallet", false); #else enableWallet = false; #endif // ENABLE_WALLET if(enableWallet) { windowTitle += tr("Wallet"); } else { windowTitle += tr("Node"); } windowTitle += " " + networkStyle.getTitleAddText(); #ifndef Q_OS_MAC QApplication::setWindowIcon(networkStyle.getTrayAndWindowIcon()); setWindowIcon(networkStyle.getTrayAndWindowIcon()); #else // TODO we convert a QImage to a pixmap, to an icon and in the MacDockIconHandler we // do it in the opposite directoin just go arrive at a QImage again. // A mac hacker should fix that so we just pass a QImage (networkStyle::getAppIcon()). MacDockIconHandler::instance()->setIcon(networkStyle.getTrayAndWindowIcon()); #endif setWindowTitle(windowTitle); #if defined(Q_OS_MAC) && QT_VERSION < 0x050000 // This property is not implemented in Qt 5. Setting it has no effect. // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras. setUnifiedTitleAndToolBarOnMac(true); #endif rpcConsole = new RPCConsole(platformStyle, 0); helpMessageDialog = new HelpMessageDialog(this, false); #ifdef ENABLE_WALLET if(enableWallet) { /** Create wallet frame and make it the central widget */ walletFrame = new WalletFrame(platformStyle, this); setCentralWidget(walletFrame); } else #endif // ENABLE_WALLET { /* When compiled without wallet or -disablewallet is provided, * the central widget is the rpc console. */ setCentralWidget(rpcConsole); } // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(networkStyle); // Create status bar statusBar(); // Disable size grip because it looks ugly and nobody needs it statusBar()->setSizeGripEnabled(false); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); if(enableWallet) { frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(unitDisplayControl); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); } frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new GUIUtil::ProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); // Initially wallet actions should be disabled setWalletActionsEnabled(false); // Subscribe to notifications from core subscribeToCoreSignals(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), dummyWidget(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0) { resize(850, 550); setWindowTitle(tr("Bitcoin Wallet")); #ifndef Q_WS_MAC setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Dummy widget used when restoring window state after minimization dummyWidget = new QWidget(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); messagePage = new MessagePage(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(messagePage); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar for blocks download progressBarLabel = new QLabel(tr("Synchronizing with network...")); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setToolTip(tr("Block chain synchronization in progress")); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); gotoOverviewPage(); }
BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0) { restoreWindowGeometry(); #ifndef Q_OS_MAC if (!fIsTestnet) { setWindowTitle(tr("megabyte") + " - " + tr("Wallet")); QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); } else { setWindowTitle(tr("megabyte") + " - " + tr("Wallet") + " " + tr("[testnet]")); QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); } #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); if (!fIsTestnet) MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin")); else MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); #endif // Create wallet frame and make it the central widget walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon // Needs walletFrame to be initialized createActions(fIsTestnet); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create system tray icon and notification createTrayIcon(fIsTestnet); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Install event filter to be able to catch status tip events (QEvent::StatusTip) this->installEventFilter(this); }
NoirSharesGUI::NoirSharesGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("NoirShares") + " - " + tr("Wallet")); // QPalette pal = this->palette(); // pal.setColor(QPalette::Window, Qt::black); // pal.setColor(QPalette::WindowText, Qt::white); // this->setPalette(pal); // this->setAutoFillBackground(true); this->setStyleSheet("QMainWindow {background-color: black; color: white;} " #ifndef Q_OS_MAC "QToolButton {background-color: black; color: white;} " "QToolButton:hover {background-color: black; color: #ffff77;} " "QToolButton:pressed {background-color: #0000bb; color: white;} " "QToolButton:checked {background-color: #000099; color: white;} " "QToolButton:disabled {background-color: #333333; color: white;} " #endif "QComboBox {border:1px solid white; border-radius: 3px; min-width: 5em; " " color:white; background-color:black;} " "QComboBox::drop-down {border: 0px;} " "QComboBox * {color: black;} " "QComboBox:on {color: black} " "QComboBox:on *:hover {background-color: blue} " "QMessageBox QLabel {color: black;} " "AddressBookPage {background-color: black; border-color: white;" " color: white; border-width: 1px;} " "TransactionView {background-color: black; color: white;} " "transactionView {background-color: black; color: white;} " "QLabel {color: white;} " "QHeaderView::section{background-color: black; border-color:white;" " color: white; font-weight:bold;" " border-width: 1px; border-style: solid;} " "QValidatedLineEdit {border-style: solid; border-width: 1px;" " border-color: white;}" "QDoubleSpinBox {color:white;background-color:#222222; " " border-color:white;border-width:1px;font-weight:bold;} " "QLineEdit {border-style: solid; border-width: 1px;" " border-color: white;}" // "SendCoinsEntry {background-color: black; color: white; " // " border-color: white; border-width: 1px;} " // "SendCoinsDialog {background-color: black; color: white; " // " border-color: white; border-width: 1px;} " // "QScrollArea {background-color: white; border-color: white; " // " color: white; border-width: 1px;} " // "scrollAreaWidgetContents {background-color: white; border-color: white; " // " color: white; border-width: 1px;} " ); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/NoirShares")); setWindowIcon(QIcon(":icons/NoirShares")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); #ifdef Q_OS_MAC progressBarLabel->setStyleSheet("color:black"); #endif // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }