QFRDRImagingFCSCountrateDisplay::QFRDRImagingFCSCountrateDisplay(QWidget *parent) : QWidget(parent), ui(new Ui::QFRDRImagingFCSCountrateDisplay) { current=NULL; avgGraph=NULL; data=NULL; dataN=0; dataT=NULL; ui->setupUi(this); avgGraph=new JKQTPxyLineErrorGraph(ui->pltIntensity->get_plotter()); avgGraph->set_title(tr("Avg \\pm StdDev")); avgGraph->set_xErrorStyle(JKQTPnoError); avgGraph->set_yErrorStyle(JKQTPerrorPolygons); avgGraph->set_drawLine(true); QColor col=avgGraph->get_color(); col.setAlphaF(0.6); avgGraph->set_errorFillColor(col); avgGraph->set_symbol(JKQTPnoSymbol); minGraph=new JKQTPxyLineGraph(ui->pltIntensity->get_plotter()); minGraph->set_title(tr("Minimum")); minGraph->set_drawLine(true); minGraph->set_symbol(JKQTPnoSymbol); maxGraph=new JKQTPxyLineGraph(ui->pltIntensity->get_plotter()); maxGraph->set_title(tr("Minimum")); maxGraph->set_drawLine(true); maxGraph->set_symbol(JKQTPnoSymbol); rangeGraph=new JKQTPhorizontalRange(ui->pltIntensity->get_plotter()); QColor rfill=rangeGraph->get_color(); rfill.setAlphaF(0.3); rangeGraph->set_fillColor(rfill); rfill.setAlphaF(0.8); rangeGraph->set_color(rfill); rangeGraph->set_title(tr("avg \\pm stddev.")); avgFit=new JKQTPxFunctionLineGraph(ui->pltIntensity->get_plotter()); avgFit->set_title(tr("fit")); avgFit->set_drawLine(true); avgIndicator=new JKQTPoverlayVerticalLine(0, ui->pltIntensity->get_plotter()); ui->pltIntensity->addGraph(avgGraph); ui->pltIntensity->addGraph(minGraph); ui->pltIntensity->addGraph(maxGraph); ui->pltIntensity->addGraph(rangeGraph); ui->pltIntensity->addGraph(avgFit); ui->pltIntensity->get_plotter()->addOverlayElement(avgIndicator); ui->pltIntensity->getXAxis()->set_axisLabel(tr("time [seconds]")); ui->pltIntensity->getYAxis()->set_axisLabel(tr("intensity [A.U.]")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: average +/- stddev.")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: average +/- stddev., min, max")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: average")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: standard deviation")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: minimum")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("corrected intenisty: maximum")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: average +/- stddev.")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: average +/- stddev., min, max")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: average")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: standard deviation")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: minimum")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("background: maximum")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: average +/- stddev.")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: average +/- stddev., min, max")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: average")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: standard deviation")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: minimum")); ui->cmbGraph->addItem(QIcon(":/imaging_fcs/fcsplot_elines.png"), tr("uncorrected: maximum")); }
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) { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr("Horuscoin 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 and make it the central widget */ walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); } 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 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); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // prevents an oben debug window from becoming stuck/unusable on client shutdown connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); // 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(); }
// Constructor EditWindow::EditWindow(Screenshot* screenshot, QListWidget* listWidgetImage) : QMainWindow() { this->screenshot = screenshot; this->listWidgetImage = listWidgetImage; this->newDrawingsList = screenshot->getDrawings(); this->screenshotToShow = new QPixmap(screenshot->withDrawings()); this->painterScreenshot = new QPainter(screenshotToShow); painterScreenshot->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); // Settings settings = new QSettings(this); // Pen QColor drawColor; drawColor.setRed(settings->value("EditWindow/drawColorR", QColor(Qt::red).red()).toInt()); drawColor.setGreen(settings->value("EditWindow/drawColorG", QColor(Qt::red).green()).toInt()); drawColor.setBlue(settings->value("EditWindow/drawColorB", QColor(Qt::red).blue()).toInt()); drawPen.setColor(drawColor); drawPen.setWidth(settings->value("EditWindow/width", 2).toInt()); painterScreenshot->setPen(drawPen); // Creation of the toolbar toolBar = new QToolBar(this); toolBar->setMovable(false); toolBar->setContextMenuPolicy(Qt::PreventContextMenu); actionValidate = toolBar->addAction(QIcon("://images/editwindow/validate.ico"), tr("Validate (Enter)")); actionValidate->setShortcut(QKeySequence(Qt::Key_Return)); QObject::connect(actionValidate, SIGNAL(triggered()), this, SLOT(validate())); actionCancel = toolBar->addAction(QIcon("://images/editwindow/cancel.ico"), tr("Cancel (Escape)")); actionCancel->setShortcut(QKeySequence(Qt::Key_Escape)); QObject::connect(actionCancel, SIGNAL(triggered()), this, SLOT(cancel())); // If we edit a fresh new screenshot... if(this->listWidgetImage != 0) { // ... we add the possibility to retake it actionRetake = toolBar->addAction(QIcon("://images/editwindow/retakescreenshot.ico"), tr("Retake the screenshot (Ctrl+N)")); actionRetake->setShortcut(QKeySequence::New); QObject::connect(actionRetake, SIGNAL(triggered()), this, SLOT(retake())); } toolBar->addSeparator(); actionSave = toolBar->addAction(QIcon("://images/toolbar/save.ico"), tr("Save it (Ctrl+S)")); actionSave->setShortcut(QKeySequence::Save); QObject::connect(actionSave, SIGNAL(triggered()), this, SLOT(save())); actionCopyIntoClipboard = toolBar->addAction(QIcon("://images/editwindow/copytoclipboard.ico"), tr("Copy to clipboard (Ctrl+C)")); actionCopyIntoClipboard->setShortcut(QKeySequence::Copy); QObject::connect(actionCopyIntoClipboard, SIGNAL(triggered()), this, SLOT(copyIntoClipboard())); actionUpload = toolBar->addAction(QIcon("://images/toolbar/noelshack.ico"), tr("Upload to NoelShack (Ctrl+U)")); actionUpload->setShortcut(QKeySequence("Ctrl+U")); QObject::connect(actionUpload, SIGNAL(triggered()), this, SLOT(upload())); toolBar->addSeparator(); sliderPenWidth = new QSlider(Qt::Horizontal, toolBar); sliderPenWidth->setToolTip(tr("Size of the drawing tools")); sliderPenWidth->setValue(drawPen.width()); sliderPenWidth->setRange(1,10); sliderPenWidth->setFixedWidth(50); toolBar->addWidget(sliderPenWidth); spinBoxPenWidth = new QSpinBox(toolBar); spinBoxPenWidth->setToolTip(tr("Size of the drawing tools")); spinBoxPenWidth->setValue(sliderPenWidth->value()); spinBoxPenWidth->setRange(1,10); spinBoxPenWidth->setFixedWidth(35); QObject::connect(sliderPenWidth, SIGNAL(valueChanged(int)), spinBoxPenWidth, SLOT(setValue(int))); QObject::connect(spinBoxPenWidth, SIGNAL(valueChanged(int)), sliderPenWidth, SLOT(setValue(int))); QObject::connect(spinBoxPenWidth, SIGNAL(valueChanged(int)), this, SLOT(changePenWidth(int))); toolBar->addWidget(spinBoxPenWidth); actionColor = toolBar->addAction(QIcon("://images/editwindow/color.ico"), tr("Color of the drawing tools")); QObject::connect(actionColor, SIGNAL(triggered()), this, SLOT(changePenColor())); toolBar->addSeparator(); actionGroupDrawTool = new QActionGroup(toolBar); QObject::connect(actionGroupDrawTool, SIGNAL(triggered(QAction*)), this, SLOT(changeDrawingTool())); actionFreeLine = actionGroupDrawTool->addAction(QIcon("://images/editwindow/freeline.ico"), tr("Free line")); actionFreeLine->setCheckable(true); actionStraightLine = actionGroupDrawTool->addAction(QIcon("://images/editwindow/straightline.ico"), tr("Straight line")); actionStraightLine->setCheckable(true); actionFrame = actionGroupDrawTool->addAction(QIcon("://images/editwindow/frame.ico"), tr("Frame")); actionFrame->setCheckable(true); actionEraser = actionGroupDrawTool->addAction(QIcon("://images/editwindow/eraser.ico"), tr("Eraser")); actionEraser->setCheckable(true); // Activate the last drawing tool used by the user switch(settings->value("EditWindow/drawingTool", typeDrawTool(FREELINE)).toInt()) { case FREELINE : actionFreeLine->setChecked(true); break; case STRAIGHTLINE : actionStraightLine->setChecked(true); break; case FRAME : actionFrame->setChecked(true); break; case ERASER : actionEraser->setChecked(true); break; } toolBar->addActions(actionGroupDrawTool->actions()); this->addToolBar(toolBar); // Creation of the main widget widgetMain = new QWidget(this); this->setCentralWidget(widgetMain); // Creation of the layout of the window layout = new QHBoxLayout(widgetMain); layout->setContentsMargins(10,10,10,10); // If the screenshot is to big scrollArea = new QScrollArea(widgetMain); // Creation of the label which contain the image to display labelImage = new QLabel(scrollArea); labelImage->setPixmap(*this->screenshotToShow); labelImage->setFixedSize(this->screenshot->getImage().size()); scrollArea->setWidget(labelImage); scrollArea->setAlignment(Qt::AlignCenter); scrollArea->setMaximumSize(QApplication::desktop()->screenGeometry().size() - QSize(175,175)); QSize minimumSize(labelImage->size() + QSize(2,2)); if(minimumSize.width() > scrollArea->maximumSize().width()) { minimumSize.setWidth(scrollArea->maximumSize().width()); minimumSize.setHeight(minimumSize.height() + scrollArea->horizontalScrollBar()->sizeHint().height()); } if(minimumSize.height() > scrollArea->maximumSize().height()) { minimumSize.setHeight(scrollArea->maximumSize().height()); minimumSize.setWidth(minimumSize.width() + scrollArea->verticalScrollBar()->sizeHint().width()); } scrollArea->setMinimumSize(minimumSize); // Add the scroll area to the layout layout->addWidget(scrollArea, Qt::AlignCenter); // Configuration of the window this->setWindowTitle(tr("Edit your screenshot")); this->setFixedSize(this->sizeHint()); this->setWindowModality(Qt::ApplicationModal); this->setAttribute(Qt::WA_DeleteOnClose); this->setWindowFlags(Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint); this->show(); }
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("slugcoin") + " - " + tr("Wallet")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolslgOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolslg, menu slg and tray/dock icon createActions(); // Create application menu slg createMenuslg(); // Create the toolslgs createToolslgs(); // 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 slg statusslg(); // Status slg 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 slg and label for blocks download progressslgLabel = new QLabel(); progressslgLabel->setVisible(false); progressslg = new QProgressslg(); progressslg->setAlignment(Qt::AlignCenter); progressslg->setVisible(false); statusslg()->addWidget(progressslgLabel); statusslg()->addWidget(progressslg); statusslg()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
void Result::create_inf_1() { string inputCommand = "search*_*" + Connector::search_metric.toStdString(); int clientfd_str= client::Clie_SockEstablish(); string url = Connector::ip.toStdString(); client::Clie_ClientConnect(clientfd_str, (char *)url.c_str()); client::Clie_SendCommand(clientfd_str, inputCommand.c_str()); string n = client::Clie_GetResponse(clientfd_str); if (n == "Emtpy favourites") { cout << "Emtpy favourites" << endl; client::Clie_close(clientfd_str); message_favorite->setText("No matched result found."); return; } num_5 = atoi(n.c_str()); vector<vector<string> > entry; for(int i=0; i<num_5;i++){ cout << i << endl; int clientfdx = client::Clie_SockEstablish();; client::Clie_ClientConnect(clientfdx, (char *)url.c_str()); string re = client::Clie_GetResponse(clientfdx); vector<string> s = client::split(re, "||||"); assert(s.size() == 3); entry.push_back(s); Connector::result_entry[i] = s[0]; client::Clie_SaveContent(clientfdx, (char *)url.c_str(), s[2]); client::Clie_close(clientfdx); } client::Clie_close(clientfd_str); assert((int)entry.size() == num_5); vertical_images_5 = new QGroupBox(); QVBoxLayout *vertical_images_5_layout = new QVBoxLayout; if(num_5 <=5){ horizontal_images_5_1 = new QGroupBox(); QHBoxLayout *horizontal_images_5_1_layout = new QHBoxLayout; for(int i = 0; i < num_5; i++){ const char * button_3_str = entry[i][1].c_str(); QPushButton *button = new QPushButton(); button->setIcon(QIcon(entry[i][2].c_str())); button->setIconSize(QSize(120,200)); button->setToolTip(tr(button_3_str)); button->setFlat(true); result_buttons.push_back(button); horizontal_images_5_1_layout->addWidget(result_buttons[i]); } horizontal_images_5_1->setLayout(horizontal_images_5_1_layout); vertical_images_5_layout->addWidget(horizontal_images_5_1); vertical_images_5->setLayout(vertical_images_5_layout); }else{ horizontal_images_5_2 = new QGroupBox(); QHBoxLayout *horizontal_images_5_2_layout = new QHBoxLayout; horizontal_images_5_3 = new QGroupBox(); QHBoxLayout *horizontal_images_5_3_layout = new QHBoxLayout; for(int i = 0; i < 5; i++){ const char * button_3_str = entry[i][1].c_str(); QPushButton *button = new QPushButton(); button->setIcon(QIcon(entry[i][2].c_str())); button->setIconSize(QSize(120,200)); button->setToolTip(tr(button_3_str)); button->setFlat(true); result_buttons.push_back(button); horizontal_images_5_2_layout->addWidget(result_buttons[i]); } horizontal_images_5_2->setLayout(horizontal_images_5_2_layout); horizontal_images_5_2->setFixedHeight(220); for(int i = 5; i < num_5; i++){ const char * button_3_str = entry[i][1].c_str(); QPushButton *button = new QPushButton(); button->setIcon(QIcon(entry[i][2].c_str())); button->setIconSize(QSize(120,200)); button->setToolTip(tr(button_3_str)); button->setFlat(true); result_buttons.push_back(button); horizontal_images_5_3_layout->addWidget(result_buttons[i]); } horizontal_images_5_3->setLayout(horizontal_images_5_3_layout); horizontal_images_5_3->setFixedHeight(220); vertical_images_5_layout->addWidget(horizontal_images_5_2); vertical_images_5_layout->addWidget(horizontal_images_5_3); vertical_images_5->setLayout(vertical_images_5_layout); } if(num_5 == 1){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); } else if(num_5 == 2){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); } else if(num_5 == 3){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); } else if(num_5 == 4){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); } else if(num_5 == 5){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); } else if(num_5 == 6){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); QObject::connect(result_buttons[5], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_6())); } else if(num_5 == 7){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); QObject::connect(result_buttons[5], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_6())); QObject::connect(result_buttons[6], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_7())); } else if(num_5 == 8){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); QObject::connect(result_buttons[5], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_6())); QObject::connect(result_buttons[6], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_7())); QObject::connect(result_buttons[7], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_8())); } else if(num_5 == 9){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); QObject::connect(result_buttons[5], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_6())); QObject::connect(result_buttons[6], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_7())); QObject::connect(result_buttons[7], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_8())); QObject::connect(result_buttons[8], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_9())); } else if(num_5 == 10){ QObject::connect(result_buttons[0], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_1())); QObject::connect(result_buttons[1], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_2())); QObject::connect(result_buttons[2], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_3())); QObject::connect(result_buttons[3], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_4())); QObject::connect(result_buttons[4], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_5())); QObject::connect(result_buttons[5], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_6())); QObject::connect(result_buttons[6], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_7())); QObject::connect(result_buttons[7], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_8())); QObject::connect(result_buttons[8], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_9())); QObject::connect(result_buttons[9], SIGNAL(clicked()),this, SLOT(handleButton_5_pic_10())); } }
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(900, 650); setWindowTitle(tr("ANARCHISTS PRIME") + " - " + 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(); blockBrowser = new BlockBrowser; blockBrowser->setObjectName("BlockBrowser"); 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); 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(); 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(); applyTheme("default"); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); miningAction = new QAction(QIcon(":/icons/mining"), tr("&Mining"), this); miningAction->setToolTip(tr("Configure mining")); miningAction->setCheckable(true); tabGroup->addAction(miningAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a slugcoin address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address")); tabGroup->addAction(signMessageAction); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); tabGroup->addAction(verifyMessageAction); #ifdef FIRST_CLASS_MESSAGING firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this); firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString(".")); firstClassMessagingAction->setCheckable(true); tabGroup->addAction(firstClassMessagingAction); #endif connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(miningAction, SIGNAL(triggered()), this, SLOT(gotoMiningPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); #ifdef FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); // Always start with the sign message tab for FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); #endif quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About slugcoin"), this); aboutAction->setToolTip(tr("Show information about slugcoin")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for slugcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &slugcoin"), this); toggleHideAction->setToolTip(tr("Show or hide the slugcoin window")); exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a popcoin address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); messageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message"), this); messageAction->setToolTip(tr("Prove you control an address")); #ifdef FIRST_CLASS_MESSAGING messageAction->setCheckable(true); #endif tabGroup->addAction(messageAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/popcoin"), tr("&About %1").arg(qApp->applicationName()), this); aboutAction->setToolTip(tr("Show information about Popcoin")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for popcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/popcoin"), tr("Show/Hide &Popcoin"), this); toggleHideAction->setToolTip(tr("Show or hide the Popcoin window")); exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet"), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); openRPCConsoleAction = new QAction(tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); }
SwitchTextModePushButton::SwitchTextModePushButton(QWidget *parent) : QPushButton(parent) { setIcon(QIcon(":/images/code.png")); setCheckable(true); }
QIcon CoreInstanceObject::GetIcon () const { return QIcon ("lcicons:/resources/images/leechcraft.svg"); }
QIcon WinIconProvider::icon(const QFileInfo& info) const { QIcon retIcon; QString fileExtension = info.suffix().toLower(); if (fileExtension == "png" || fileExtension == "bmp" || fileExtension == "jpg" || fileExtension == "jpeg") { retIcon = QIcon(info.filePath()); } else if (fileExtension == "cpl") { HICON hIcon; QString filePath = QDir::toNativeSeparators(info.filePath()); ExtractIconEx((LPCWSTR)filePath.utf16(), 0, &hIcon, NULL, 1); retIcon = QIcon(QtWin::fromHICON(hIcon)); DestroyIcon(hIcon); } else { // This 64 bit mapping needs to go away if we produce a 64 bit build of launchy QString filePath = wicon_aliasTo64(QDir::toNativeSeparators(info.filePath())); // Get the icon index using SHGetFileInfo SHFILEINFO sfi = {0}; QRegExp re("\\\\\\\\([a-z0-9\\-]+\\\\?)?$", Qt::CaseInsensitive); if (re.exactMatch(filePath)) { // To avoid network hangs, explicitly fetch the My Computer icon for UNCs LPITEMIDLIST pidl; if (SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidl) == S_OK) { SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX); // Set the file path to the My Computer GUID for any later fetches filePath = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"; } } if (sfi.iIcon == 0) { SHGetFileInfo((LPCWSTR)filePath.utf16(), 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX); } // An icon index of 3 is the generic file icon if (sfi.iIcon > 0 && sfi.iIcon != 3) { // Retrieve the system image list. // To get the 48x48 icons, use SHIL_EXTRALARGE // To get the 256x256 icons (Vista only), use SHIL_JUMBO int imageListIndex; if (preferredSize <= 16) imageListIndex = SHIL_SMALL; else if (preferredSize <= 32) imageListIndex = SHIL_LARGE; else if (preferredSize <= 48) imageListIndex = SHIL_EXTRALARGE; else imageListIndex = SHIL_JUMBO; // If the OS supports SHCreateItemFromParsingName, get a 256x256 icon if (!addIconFromShellFactory(filePath, retIcon)) { // otherwise get the largest appropriate size if (!addIconFromImageList(imageListIndex, sfi.iIcon, retIcon) && imageListIndex == SHIL_JUMBO) addIconFromImageList(SHIL_EXTRALARGE, sfi.iIcon, retIcon); } // Ensure there's also a 32x32 icon - extralarge and above often only contain // a large frame with the 32x32 icon in the middle or looks blurry if (imageListIndex == SHIL_EXTRALARGE || imageListIndex == SHIL_JUMBO) addIconFromImageList(SHIL_LARGE, sfi.iIcon, retIcon); } else if (info.isSymLink() || fileExtension == "lnk") // isSymLink is case sensitive when it perhaps shouldn't be { QFileInfo targetInfo(info.symLinkTarget()); retIcon = icon(targetInfo); } else { retIcon = QFileIconProvider::icon(info); } } return retIcon; }
QIcon PlatformStyle::SingleColorIcon(const QString& filename) const { if (!colorizeIcons) return QIcon(filename); return ColorizeIcon(filename, SingleColor()); }
QVariant ccDBRoot::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); const ccHObject *item = static_cast<ccHObject*>(index.internalPointer()); assert(item); if (!item) return QVariant(); if (role == Qt::DisplayRole) { QString baseName(item->getName()); if (baseName.isEmpty()) baseName = QString("no name"); //specific case if (item->isA(CC_2D_LABEL)) baseName = QString("2D label: ")+baseName; else if (item->isA(CC_2D_VIEWPORT_LABEL)) baseName = QString("2D area label: ")+baseName; return QVariant(baseName); } if (role == Qt::EditRole) { return QVariant(item->getName()); } else if (role == Qt::DecorationRole) { bool locked = item->isLocked(); switch (item->getClassID()) { case CC_HIERARCHY_OBJECT: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/hObjectSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/hObjectSymbol.png")); case CC_POINT_CLOUD: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/cloudSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/cloudSymbol.png")); //all primitives case CC_PLANE: case CC_SPHERE: case CC_TORUS: case CC_CYLINDER: case CC_CONE: case CC_BOX: case CC_DISH: case CC_EXTRU: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/miscGeomSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/miscGeomSymbol.png")); case CC_MESH: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/meshSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/meshSymbol.png")); case CC_MESH_GROUP: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/meshGroupSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/meshGroupSymbol.png")); case CC_POINT_OCTREE: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/octreeSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/octreeSymbol.png")); case CC_CALIBRATED_IMAGE: return QIcon(QString::fromUtf8(":/CC/Tree/images/calibratedImageSymbol.png")); case CC_IMAGE: return QIcon(QString::fromUtf8(":/CC/Tree/images/imageSymbol.png")); case CC_SENSOR: case CC_GBL_SENSOR: return QIcon(QString::fromUtf8(":/CC/Tree/images/sensorSymbol.png")); case CC_MATERIAL_SET: return QIcon(QString::fromUtf8(":/CC/Tree/images/materialSymbol.png")); case CC_NORMALS_ARRAY: case CC_NORMAL_INDEXES_ARRAY: case CC_RGB_COLOR_ARRAY: case CC_TEX_COORDS_ARRAY: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/dbSymbolLocked.png")); else return QIcon(QString::fromUtf8(":/CC/Tree/images/dbSymbol.png")); case CC_2D_LABEL: return QIcon(QString::fromUtf8(":/CC/Tree/images/labelSymbol.png")); case CC_2D_VIEWPORT_OBJECT: return QIcon(QString::fromUtf8(":/CC/Tree/images/viewportSymbol.png")); case CC_2D_VIEWPORT_LABEL: return QIcon(QString::fromUtf8(":/CC/Comp/images/comp/rectangleSelect.png")); default: if (locked) return QIcon(QString::fromUtf8(":/CC/Tree/images/lock.png")); else return QVariant(); } } else if (role == Qt::CheckStateRole) { if (item->isEnabled()) return Qt::Checked; else return Qt::Unchecked; } return QVariant(); }
QVariant ScriptModel::data(const QModelIndex &index, int role) const { if(!index.isValid()) return QVariant(); ActionTools::ActionInstance *actionInstance = mScript->actionAt(index.row()); if(!actionInstance) return QVariant(); switch(role) { case ActionDataRole: return QVariant::fromValue(*actionInstance); case ActionIdRole: return actionInstance->definition()->id(); case Qt::BackgroundRole: { const QColor &color = actionInstance->color(); if(color.isValid()) return QBrush(color); return QBrush(); } case Qt::FontRole: { if(!actionInstance->definition()->worksUnderThisOS()) { QFont font = QApplication::font(); font.setItalic(true); return font; } return QFont(); } case Qt::ForegroundRole: { const QColor &color = actionInstance->color(); if(color.isValid()) { if(color.lightness() < 128) return QBrush(Qt::white); else return QBrush(Qt::black); } else { const QPalette &palette = QApplication::palette(); if(!actionInstance->isEnabled()) return QBrush(palette.color(QPalette::Disabled, QPalette::WindowText)); return QBrush(); } } } switch(index.column()) { case ColumnLabel: switch(role) { case Qt::CheckStateRole: return QVariant(actionInstance->isEnabled() ? Qt::Checked : Qt::Unchecked); case Qt::DisplayRole: { QString labelString = actionInstance->label(); if(!labelString.isNull() && !labelString.isEmpty()) return labelString; return QString("%1").arg(index.row() + 1, 3, 10, QChar('0')); } case Qt::EditRole: return actionInstance->label(); } break; case ColumnActionName: switch(role) { case Qt::ToolTipRole: return tr("Double-clic to edit the action"); case Qt::DisplayRole: return actionInstance->definition()->name(); case Qt::DecorationRole: return QIcon(actionInstance->definition()->icon()); case Qt::TextAlignmentRole: return Qt::AlignCenter; } break; case ColumnComment: switch(role) { case Qt::DisplayRole: case Qt::EditRole: return actionInstance->comment(); } break; } return QVariant(); }
QIcon QgsGlobeLayerPropertiesFactory::icon() const { return QIcon( ":/globe/icon.svg" ); }
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookPage), model(0), optionsModel(0), mode(mode), tab(tab) { ui->setupUi(this); #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac ui->newAddress->setIcon(QIcon()); ui->copyAddress->setIcon(QIcon()); ui->deleteAddress->setIcon(QIcon()); ui->verifyMessage->setIcon(QIcon()); ui->signMessage->setIcon(QIcon()); ui->exportButton->setIcon(QIcon()); #endif #ifndef USE_QRCODE ui->showQRCode->setVisible(false); #endif switch(mode) { case ForSending: connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); ui->exportButton->hide(); break; case ForEditing: ui->buttonBox->setVisible(false); break; } switch(tab) { case SendingTab: ui->labelExplanation->setText(tr("These are your FairQuark addresses for sending payments. Always check the amount and the receiving address before sending coins.")); ui->deleteAddress->setVisible(true); ui->signMessage->setVisible(false); break; case ReceivingTab: ui->labelExplanation->setText(tr("These are your FairQuark addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.")); ui->deleteAddress->setVisible(false); ui->signMessage->setVisible(true); break; } // Context menu actions QAction *copyAddressAction = new QAction(ui->copyAddress->text(), this); QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *editAction = new QAction(tr("&Edit"), this); QAction *sendCoinsAction = new QAction(tr("Send &Coins"), this); QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this); QAction *signMessageAction = new QAction(ui->signMessage->text(), this); QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this); deleteAction = new QAction(ui->deleteAddress->text(), this); // Build context menu contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(editAction); if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); if(tab == SendingTab) contextMenu->addAction(sendCoinsAction); #ifdef USE_QRCODE contextMenu->addAction(showQRCodeAction); #endif if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); else if(tab == SendingTab) contextMenu->addAction(verifyMessageAction); // Connect signals for context menu actions connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyAddress_clicked())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction())); connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction())); connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteAddress_clicked())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(onSendCoinsAction())); connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); // Pass through accept action from button box connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction( tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); overviewAction->setProperty("objectName","overviewAction"); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a ANARCHISTS PRIME address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); sendCoinsAction->setProperty("objectName","sendCoinsAction"); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction( tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); receiveCoinsAction->setProperty("objectName","receiveCoinsAction"); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction( tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); historyAction->setProperty("objectName","historyAction"); tabGroup->addAction(historyAction); addressBookAction = new QAction(tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); addressBookAction->setProperty("objectName","addressBookAction"); tabGroup->addAction(addressBookAction); blockAction = new QAction(tr("&Block Explorer"), this); blockAction->setToolTip(tr("Explore the BlockChain")); blockAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_9)); blockAction->setCheckable(true); blockAction->setProperty("objectName","blockAction"); tabGroup->addAction(blockAction); connect(blockAction, SIGNAL(triggered()), this, SLOT(gotoBlockBrowser())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); quitAction = new QAction(QIcon(":/default/res/themes/default/icons/light/sign-out.png"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About ANARCHISTS PRIME"), this); aboutAction->setToolTip(tr("Show information about ANARCHISTS PRIME")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/default/res/themes/default/icons/light/wrench.png"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for ANARCHISTS PRIME")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); encryptWalletAction = new QAction(QIcon(":/default/res/themes/default/icons/light/lock.png"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/default/res/themes/default/icons/light/save.png"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/default/res/themes/default/icons/light/key.png"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); unlockWalletAction = new QAction(QIcon(":/default/res/themes/default/icons/light/lock-open.png"), tr("&Unlock Wallet..."), this); unlockWalletAction->setToolTip(tr("Unlock wallet")); lockWalletAction = new QAction(QIcon(":/default/res/themes/default/icons/light/lock.png"), tr("&Lock Wallet"), this); lockWalletAction->setToolTip(tr("Lock wallet")); signMessageAction = new QAction(QIcon(":/default/res/themes/default/icons/light/sign-in.png"), tr("Sign &message..."), this); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); exportAction = new QAction(tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); exportAction->setProperty("objectName","exportAction"); openRPCConsoleAction = new QAction(QIcon(":/default/res/themes/default/icons/light/terminal.png"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(unlockWalletAction, SIGNAL(triggered()), this, SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), this, SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
QIcon TransmissivityBallestrinFactory::TTransmissivityIcon() const { return QIcon(":/icons/TransmissivityBallestrin.png"); }
void DialogEditTimeRange::addTreeItem(TimeRange &range) { QTreeWidgetItem *item = new QTreeWidgetItem(ui->treeRanges); bool same = range.isSameStartEnd(); string starttxt, subtxt; if (same) starttxt = tr("Execute at ").toUtf8().constData(); else starttxt = tr("Start at ").toUtf8().constData(); auto offsetString = [=](bool isstart) { if (isstart) { int h, m, s; from_string(range.shour, h); from_string(range.smin, m); from_string(range.ssec, s); int v = h * 3600 + m * 60 + s; if (range.start_offset == 1) return string(" +") + Utils::time2string_digit(v); else if (range.start_offset == -1) return string(" -") + Utils::time2string_digit(v); } else { int h, m, s; from_string(range.ehour, h); from_string(range.emin, m); from_string(range.esec, s); int v = h * 3600 + m * 60 + s; if (range.end_offset == 1) return string(" +") + Utils::time2string_digit(v); else if (range.end_offset == -1) return string(" -") + Utils::time2string_digit(v); } return string(); }; if (range.start_type == TimeRange::HTYPE_NORMAL) starttxt = starttxt + Utils::time2string_digit(range.getStartTimeSec()); else if (range.start_type == TimeRange::HTYPE_SUNRISE) starttxt = starttxt + tr("Sunrise").toUtf8().constData() + offsetString(true) + " (" + Utils::time2string_digit(range.getStartTimeSec()) + ")"; else if (range.start_type == TimeRange::HTYPE_SUNSET) starttxt = starttxt + tr("Sunset").toUtf8().constData() + offsetString(true) + " (" + Utils::time2string_digit(range.getStartTimeSec()) + ")"; else if (range.start_type == TimeRange::HTYPE_NOON) starttxt = starttxt + tr("Noon").toUtf8().constData() + offsetString(true) + " (" + Utils::time2string_digit(range.getStartTimeSec()) + ")"; item->setData(0, TwoLineItemDelegate::headerTextRole, QString::fromUtf8(starttxt.c_str())); if (!same) { subtxt = tr("Stop at ").toUtf8().constData(); if (range.end_type == TimeRange::HTYPE_NORMAL) subtxt += Utils::time2string_digit(range.getEndTimeSec()); else if (range.end_type == TimeRange::HTYPE_SUNRISE) subtxt += tr("Sunrise").toUtf8().constData() + offsetString(false) + " (" + Utils::time2string_digit(range.getEndTimeSec()) + ")"; else if (range.end_type == TimeRange::HTYPE_SUNSET) subtxt += tr("Sunset").toUtf8().constData() + offsetString(false) + " (" + Utils::time2string_digit(range.getEndTimeSec()) + ")"; else if (range.end_type == TimeRange::HTYPE_NOON) subtxt += tr("Noon").toUtf8().constData() + offsetString(false) + " (" + Utils::time2string_digit(range.getEndTimeSec()) + ")"; item->setData(0, TwoLineItemDelegate::subHeaderTextRole, QString::fromUtf8(subtxt.c_str())); } if (range.isNewRange) { item->setData(0, TwoLineItemDelegate::headerTextRole, tr("New empty range...")); item->setData(0, TwoLineItemDelegate::subHeaderTextRole, tr("Click to edit")); } QVariant uservalue = QVariant::fromValue<TimeRange>(range); item->setData(0, TimeRangeRole, uservalue); item->setIcon(0, QIcon(":/img/icon_clock.png")); }
/********************************************************************** * Speed control widget **********************************************************************/ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent ) : QFrame( _parent ), p_intf( _p_i ) { QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Maximum ); sizePolicy.setHorizontalStretch( 0 ); sizePolicy.setVerticalStretch( 0 ); speedSlider = new QSlider( this ); speedSlider->setSizePolicy( sizePolicy ); speedSlider->setMinimumSize( QSize( 140, 20 ) ); speedSlider->setOrientation( Qt::Horizontal ); speedSlider->setTickPosition( QSlider::TicksBelow ); speedSlider->setRange( -34, 34 ); speedSlider->setSingleStep( 1 ); speedSlider->setPageStep( 1 ); speedSlider->setTickInterval( 17 ); CONNECT( speedSlider, valueChanged( int ), this, updateRate( int ) ); QToolButton *normalSpeedButton = new QToolButton( this ); normalSpeedButton->setMaximumSize( QSize( 26, 16 ) ); normalSpeedButton->setAutoRaise( true ); normalSpeedButton->setText( "1x" ); normalSpeedButton->setToolTip( qtr( "Revert to normal play speed" ) ); CONNECT( normalSpeedButton, clicked(), this, resetRate() ); QToolButton *slowerButton = new QToolButton( this ); slowerButton->setMaximumSize( QSize( 26, 16 ) ); slowerButton->setAutoRaise( true ); slowerButton->setToolTip( tooltipL[SLOWER_BUTTON] ); slowerButton->setIcon( QIcon( iconL[SLOWER_BUTTON] ) ); CONNECT( slowerButton, clicked(), THEMIM->getIM(), slower() ); QToolButton *fasterButton = new QToolButton( this ); fasterButton->setMaximumSize( QSize( 26, 16 ) ); fasterButton->setAutoRaise( true ); fasterButton->setToolTip( tooltipL[FASTER_BUTTON] ); fasterButton->setIcon( QIcon( iconL[FASTER_BUTTON] ) ); CONNECT( fasterButton, clicked(), THEMIM->getIM(), faster() ); /* spinBox = new QDoubleSpinBox(); spinBox->setDecimals( 2 ); spinBox->setMaximum( 32 ); spinBox->setMinimum( 0.03F ); spinBox->setSingleStep( 0.10F ); spinBox->setAlignment( Qt::AlignRight ); CONNECT( spinBox, valueChanged( double ), this, updateSpinBoxRate( double ) ); */ QGridLayout* speedControlLayout = new QGridLayout( this ); speedControlLayout->addWidget( speedSlider, 0, 0, 1, 3 ); speedControlLayout->addWidget( slowerButton, 1, 0 ); speedControlLayout->addWidget( normalSpeedButton, 1, 1, 1, 1, Qt::AlignRight ); speedControlLayout->addWidget( fasterButton, 1, 2, 1, 1, Qt::AlignRight ); //speedControlLayout->addWidget( spinBox ); speedControlLayout->setContentsMargins( 0, 0, 0, 0 ); speedControlLayout->setSpacing( 0 ); lastValue = 0; activateOnState(); }
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) { // don't show / hide progressslg and it's label if we have no connection(s) to the network if (!clientModel || clientModel->getNumConnections() == 0) { progressslgLabel->setVisible(false); progressslg->setVisible(false); return; } QString tooltip; if(count < nTotalBlocks) { int nRemainingBlocks = nTotalBlocks - count; float nPercentageDone = count / (nTotalBlocks * 0.01f); if (clientModel->getStatusslgWarnings() == "") { progressslgLabel->setText(tr("Synchronizing with network...")); progressslgLabel->setVisible(true); progressslg->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks)); progressslg->setMaximum(nTotalBlocks); progressslg->setValue(count); progressslg->setVisible(true); } else { progressslgLabel->setText(clientModel->getStatusslgWarnings()); progressslgLabel->setVisible(true); progressslg->setVisible(false); } tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2); } else { if (clientModel->getStatusslgWarnings() == "") progressslgLabel->setVisible(false); else { progressslgLabel->setText(clientModel->getStatusslgWarnings()); progressslgLabel->setVisible(true); } progressslg->setVisible(false); tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); } tooltip = tr("Current difficulty is %1.").arg(clientModel->GetDifficulty()) + QString("<br>") + tooltip; QDateTime now = QDateTime::currentDateTime(); QDateTime lastBlockDate = clientModel->getLastBlockDate(); int secs = lastBlockDate.secsTo(now); QString text; // Represent time from last generated block in human readable text if(secs <= 0) { // Fully up to date. Leave text empty. } else if(secs < 60) { text = tr("%n second(s) ago","",secs); } else if(secs < 60*60) { text = tr("%n minute(s) ago","",secs/60); } else if(secs < 24*60*60) { text = tr("%n hour(s) ago","",secs/(60*60)); } else { text = tr("%n day(s) ago","",secs/(60*60*24)); } // Set icon state: spinning if catching up, tick otherwise if(secs < 90*60 && count >= nTotalBlocks) { tooltip = tr("Up to date") + QString(".<br>") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSslg_ICONSIZE, STATUSslg_ICONSIZE)); overviewPage->showOutOfSyncWarning(false); } else { tooltip = tr("Catching up...") + QString("<br>") + tooltip; labelBlocksIcon->setMovie(syncIconMovie); syncIconMovie->start(); overviewPage->showOutOfSyncWarning(true); } if(!text.isEmpty()) { tooltip += QString("<br>"); tooltip += tr("Last received block was generated %1.").arg(text); } // Don't word-wrap this (fixed-width) tooltip tooltip = QString("<nobr>") + tooltip + QString("</nobr>"); labelBlocksIcon->setToolTip(tooltip); progressslgLabel->setToolTip(tooltip); progressslg->setToolTip(tooltip); }
CreateGameDialog::CreateGameDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("Create game")); setWindowIcon(QIcon(":/res/hn_logo.png")); setMinimumWidth(300); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(buttonBox, SIGNAL(accepted()), this, SLOT(actionOk())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QGroupBox *groupGeneral = new QGroupBox(tr("General"), this); QLabel *labelName = new QLabel(tr("Game name"), this); editName = new QLineEdit(QString::fromStdString(config.get("player_name")) + "'s game", this); // FIXME: QLabel *labelGametype = new QLabel(tr("Game type"), this); QComboBox *comboGametype = new QComboBox(this); comboGametype->addItem("THNL"); comboGametype->setEnabled(false); // FIXME: QLabel *labelGamemode = new QLabel(tr("Game mode"), this); QComboBox *comboGamemode = new QComboBox(this); comboGamemode->addItem("Sit'n'Go"); comboGamemode->setEnabled(false); QGridLayout *layoutGeneral = new QGridLayout; layoutGeneral->addWidget(labelName, 0, 0); layoutGeneral->addWidget(editName, 0, 1); layoutGeneral->addWidget(labelGametype, 1, 0); layoutGeneral->addWidget(comboGametype, 1, 1); layoutGeneral->addWidget(labelGamemode, 2, 0); layoutGeneral->addWidget(comboGamemode, 2, 1); groupGeneral->setLayout(layoutGeneral); QGroupBox *groupPlayers = new QGroupBox(tr("Players"), this); QLabel *labelPlayers = new QLabel(tr("Max. players"), this); spinPlayers = new QSpinBox(this); spinPlayers->setMinimum(2); spinPlayers->setMaximum(10); spinPlayers->setSingleStep(1); spinPlayers->setValue(5); QLabel *labelTimeout = new QLabel(tr("Timeout"), this); spinTimeout = new QSpinBox(this); spinTimeout->setMinimum(5); spinTimeout->setMaximum(3*60); spinTimeout->setSingleStep(10); spinTimeout->setValue(30); QLabel *labelStake = new QLabel(tr("Initial stake"), this); spinStake = new QSpinBox(this); spinStake->setMinimum(500); spinStake->setMaximum(1000000); spinStake->setSingleStep(100); spinStake->setValue(1500); QGridLayout *layoutPlayers = new QGridLayout; layoutPlayers->addWidget(labelPlayers, 0, 0); layoutPlayers->addWidget(spinPlayers, 0, 1); layoutPlayers->addWidget(labelTimeout, 1, 0); layoutPlayers->addWidget(spinTimeout, 1, 1); layoutPlayers->addWidget(labelStake, 2, 0); layoutPlayers->addWidget(spinStake, 2, 1); groupPlayers->setLayout(layoutPlayers); QGroupBox *groupBlinds = new QGroupBox(tr("Blinds"), this); QLabel *labelBlindsStart = new QLabel(tr("Starting blinds"), this); spinBlindsStart = new QSpinBox(this); spinBlindsStart->setMinimum(5); spinBlindsStart->setMaximum(200); spinBlindsStart->setSingleStep(10); spinBlindsStart->setValue(20); QLabel *labelBlindsFactor = new QLabel(tr("Raise factor"), this); spinBlindsFactor = new QDoubleSpinBox(this); spinBlindsFactor->setDecimals(2); spinBlindsFactor->setMinimum(1.3); spinBlindsFactor->setMaximum(3.5); spinBlindsFactor->setSingleStep(0.1); spinBlindsFactor->setValue(2.0); QLabel *labelBlindsTime = new QLabel(tr("Raise time"), this); spinBlindsTime = new QSpinBox(this); spinBlindsTime->setMinimum(60); spinBlindsTime->setMaximum(10*60); spinBlindsTime->setSingleStep(60); spinBlindsTime->setValue(5*60); QGridLayout *layoutBlinds = new QGridLayout; layoutBlinds->addWidget(labelBlindsStart, 0, 0); layoutBlinds->addWidget(spinBlindsStart, 0, 1); layoutBlinds->addWidget(labelBlindsFactor, 1, 0); layoutBlinds->addWidget(spinBlindsFactor, 1, 1); layoutBlinds->addWidget(labelBlindsTime, 2, 0); layoutBlinds->addWidget(spinBlindsTime, 2, 1); groupBlinds->setLayout(layoutBlinds); QGroupBox *groupPrivate = new QGroupBox(tr("Private game"), this); QLabel *labelPrivate = new QLabel(tr("Password protected"), this); QCheckBox *checkPrivate = new QCheckBox(this); connect(checkPrivate, SIGNAL(stateChanged(int)), this, SLOT(slotCheckStatePrivate(int))); QLabel *labelPassword = new QLabel(tr("Password"), this); editPassword = new QLineEdit(this); editPassword->setEnabled(false); editPassword->setEchoMode(config.getBool("ui_echo_password") ? QLineEdit::Normal : QLineEdit::Password); QGridLayout *layoutPrivate = new QGridLayout; layoutPrivate->addWidget(labelPrivate, 0, 0); layoutPrivate->addWidget(checkPrivate, 0, 1); layoutPrivate->addWidget(labelPassword, 1, 0); layoutPrivate->addWidget(editPassword, 1, 1); groupPrivate->setLayout(layoutPrivate); QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(groupGeneral, 0, 0); mainLayout->addWidget(groupPlayers, 0, 1); mainLayout->addWidget(groupBlinds, 1, 1); mainLayout->addWidget(groupPrivate, 1, 0); mainLayout->addWidget(buttonBox, 2, 0, 1, 2); setLayout(mainLayout); }
QIcon QDagalEncoderPlugin::icon() const { return QIcon(); }
AirSpaceWindow::AirSpaceWindow(QWidget* parent, const QString &name, Qt::WindowFlags wflags, IDataBase::SourceType src) :TableWindow(parent, name, wflags) { QStringList nameList; QAction* pAction; QTableWidget *pTable; pTable = TableWindow::getTable(); m_pWebMapView = NULL; m_pAirSpaceView = NULL; m_externSelect = false; switch(src) { case IDataBase::SqlDB: m_pDb = ISql::pInstance(); connect(m_pDb, SIGNAL(airSpacesChanged()), this, SLOT(file_update())); pAction = new QAction(tr("&Edit"), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_edit())); MDIWindow::addAction(pAction, true); pAction = new QAction(tr("&Delete"), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_delete())); MDIWindow::addAction(pAction); pAction = new QAction(tr("&Add to GPS..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_AddToGPS())); MDIWindow::addAction(pAction, true); break; case IDataBase::GPSdevice: { m_pDb = IGPSDevice::pInstance(); connect(m_pDb, SIGNAL(airSpacesChanged()), this, SLOT(file_update())); pAction = new QAction(tr("&Delete"), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_delete())); MDIWindow::addAction(pAction); pAction = new QAction(tr("&Update"), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_update())); MDIWindow::addAction(pAction); } break; case IDataBase::File: { m_pDb = NULL; pAction = new QAction(tr("&Add to GPS..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_AddToGPS())); MDIWindow::addAction(pAction, true); } break; } if(src != IDataBase::SqlDB) { pAction = new QAction(tr("Add to DB..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_AddToSqlDB())); MDIWindow::addAction(pAction, true); pAction = new QAction(tr("&Update"), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_update())); MDIWindow::addAction(pAction); } // import/export pAction = new QAction(this); pAction->setSeparator(true); MDIWindow::addAction(pAction); if(src == IDataBase::File) { pAction = new QAction(tr("&Import..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_open())); MDIWindow::addAction(pAction); } pAction = new QAction(tr("&Export all..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(exportTable())); MDIWindow::addAction(pAction); // view pAction = new QAction(this); pAction->setSeparator(true); MDIWindow::addAction(pAction); pAction = new QAction(tr("&View..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_viewAirSpace())); MDIWindow::addAction(pAction); pAction = new QAction(tr("View &Web Map..."), this); connect(pAction, SIGNAL(triggered()), this, SLOT(file_viewWebMap())); MDIWindow::addAction(pAction, true); TableWindow::setWindowIcon(QIcon(":/document.xpm")); // configure the table pTable->setEditTriggers(QAbstractItemView::NoEditTriggers); pTable->setSelectionMode(QAbstractItemView::ExtendedSelection); // header nameList += tr("Name"); nameList += tr("Low [m]"); nameList += tr("High [m]"); nameList += tr("Class"); nameList += tr("Comment"); setupHeader(nameList); pTable->setColumnWidth(Name, 200); pTable->setColumnWidth(High, 100); pTable->setColumnWidth(Low, 100); pTable->setColumnWidth(Class, 80); pTable->setColumnWidth(Comment, 750); connect(m_pDb, SIGNAL(airSpacesChanged()), this, SLOT(file_update())); if(src == IDataBase::File) { file_open(); } else { file_update(); } }
void BitcoinGUI::createActions(bool fIsTestnet) { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Horuscoin address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and horuscoin: URIs)")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); if (!fIsTestnet) aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Horuscoin Core"), this); else aboutAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&About Horuscoin Core"), this); aboutAction->setStatusTip(tr("Show information about Horuscoin")); aboutAction->setMenuRole(QAction::AboutRole); #if QT_VERSION < 0x050000 aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #else aboutQtAction = new QAction(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #endif aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Horuscoin")); optionsAction->setMenuRole(QAction::PreferencesRole); if (!fIsTestnet) toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); else toggleHideAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Horuscoin addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Horuscoin addresses")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a horuscoin: URI or payment request")); showHelpMessageAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Command-line options"), this); showHelpMessageAction->setStatusTip(tr("Show the Horuscoin Core help message to get a list with possible Horuscoin command-line options")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); #ifdef ENABLE_WALLET if(walletFrame) { connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); } #endif }
void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Lightcoin address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Addresses"), this); addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setToolTip(addressBookAction->statusTip()); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Lightcoin"), this); aboutAction->setStatusTip(tr("Show information about Lightcoin")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Lightcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Lightcoin addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Lightcoin addresses")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); }
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) { // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text) statusBar()->clearMessage(); // Acquire current block source enum BlockSource blockSource = clientModel->getBlockSource(); switch (blockSource) { case BLOCK_SOURCE_NETWORK: progressBarLabel->setText(tr("Synchronizing with network...")); break; case BLOCK_SOURCE_DISK: progressBarLabel->setText(tr("Importing blocks from disk...")); break; case BLOCK_SOURCE_REINDEX: progressBarLabel->setText(tr("Reindexing blocks on disk...")); break; case BLOCK_SOURCE_NONE: // Case: not Importing, not Reindexing and no network connection progressBarLabel->setText(tr("No block source available...")); break; } QString tooltip; QDateTime lastBlockDate = clientModel->getLastBlockDate(); QDateTime currentDate = QDateTime::currentDateTime(); int secs = lastBlockDate.secsTo(currentDate); if(count < nTotalBlocks) { tooltip = tr("Processed %1 of %2 (estimated) blocks of transaction history.").arg(count).arg(nTotalBlocks); } else { tooltip = tr("Processed %1 blocks of transaction history.").arg(count); } // Set icon state: spinning if catching up, tick otherwise if(secs < 90*60 && count >= nTotalBlocks) { tooltip = tr("Up to date") + QString(".<br>") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); #ifdef ENABLE_WALLET if(walletFrame) walletFrame->showOutOfSyncWarning(false); #endif progressBarLabel->setVisible(false); progressBar->setVisible(false); } else { // Represent time from last generated block in human readable text QString timeBehindText; if(secs < 48*60*60) { timeBehindText = tr("%n hour(s)","",secs/(60*60)); } else if(secs < 14*24*60*60) { timeBehindText = tr("%n day(s)","",secs/(24*60*60)); } else { timeBehindText = tr("%n week(s)","",secs/(7*24*60*60)); } progressBarLabel->setVisible(true); progressBar->setFormat(tr("%1 behind").arg(timeBehindText)); progressBar->setMaximum(1000000000); progressBar->setValue(clientModel->getVerificationProgress() * 1000000000.0 + 0.5); progressBar->setVisible(true); tooltip = tr("Catching up...") + QString("<br>") + tooltip; if(count != prevBlocks) { labelBlocksIcon->setPixmap(QIcon(QString( ":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0'))) .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES; } prevBlocks = count; #ifdef ENABLE_WALLET if(walletFrame) walletFrame->showOutOfSyncWarning(true); #endif tooltip += QString("<br>"); tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText); tooltip += QString("<br>"); tooltip += tr("Transactions after this will not yet be visible."); } // Don't word-wrap this (fixed-width) tooltip tooltip = QString("<nobr>") + tooltip + QString("</nobr>"); labelBlocksIcon->setToolTip(tooltip); progressBarLabel->setToolTip(tooltip); progressBar->setToolTip(tooltip); }
BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), prevBlocks(0) { restoreWindowGeometry(); setWindowTitle(tr("Lightcoin") + " - " + tr("Wallet")); #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(); // 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())); // 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); }
TupCanvas::TupCanvas(QWidget *parent, Qt::WindowFlags flags, TupGraphicsScene *scene, const QPointF centerPoint, const QSize &screenSize, TupProject *project, double scaleFactor, int angle, TupBrushManager *brushManager) : QFrame(parent, flags), k(new Private) { setWindowTitle(tr("Tupi: 2D Magic")); setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons/animation_mode.png"))); k->scene = scene; k->size = project->dimension(); k->currentColor = brushManager->penColor(); k->brushManager = brushManager; k->project = project; graphicsView = new TupCanvasView(this, screenSize, k->size, project->bgColor()); graphicsView->setScene(scene); graphicsView->centerOn(centerPoint); graphicsView->scale(scaleFactor, scaleFactor); graphicsView->rotate(angle); TImageButton *pencil = new TImageButton(QPixmap(THEME_DIR + "icons/pencil_big.png"), 40, this, true); pencil->setToolTip(tr("Pencil")); connect(pencil, SIGNAL(clicked()), this, SLOT(wakeUpPencil())); TImageButton *ink = new TImageButton(QPixmap(THEME_DIR + "icons/ink_big.png"), 40, this, true); ink->setToolTip(tr("Ink")); connect(ink, SIGNAL(clicked()), this, SLOT(wakeUpInk())); /* TImageButton *polyline = new TImageButton(QPixmap(THEME_DIR + "icons/polyline_big.png"), 40, this, true); polyline->setToolTip(tr("Polyline")); connect(polyline, SIGNAL(clicked()), this, SLOT(wakeUpPolyline())); */ TImageButton *ellipse = new TImageButton(QPixmap(THEME_DIR + "icons/ellipse_big.png"), 40, this, true); ellipse->setToolTip(tr("Ellipse")); connect(ellipse, SIGNAL(clicked()), this, SLOT(wakeUpEllipse())); TImageButton *rectangle = new TImageButton(QPixmap(THEME_DIR + "icons/square_big.png"), 40, this, true); rectangle->setToolTip(tr("Rectangle")); connect(rectangle, SIGNAL(clicked()), this, SLOT(wakeUpRectangle())); TImageButton *images = new TImageButton(QPixmap(THEME_DIR + "icons/bitmap_big.png"), 40, this, true); images->setToolTip(tr("Images")); connect(images, SIGNAL(clicked()), this, SLOT(wakeUpLibrary())); TImageButton *objects = new TImageButton(QPixmap(THEME_DIR + "icons/selection_big.png"), 40, this, true); objects->setToolTip(tr("Object Selection")); connect(objects, SIGNAL(clicked()), this, SLOT(wakeUpObjectSelection())); TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 40, this, true); nodes->setToolTip(tr("Nodes Selection")); connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection())); TImageButton *trash = new TImageButton(QPixmap(THEME_DIR + "icons/delete_big.png"), 40, this, true); trash->setToolTip(tr("Delete Selection")); connect(trash, SIGNAL(clicked()), this, SLOT(wakeUpDeleteSelection())); TImageButton *zoomIn = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_in_big.png"), 40, this, true); zoomIn->setToolTip(tr("Zoom In")); connect(zoomIn, SIGNAL(clicked()), this, SLOT(wakeUpZoomIn())); TImageButton *zoomOut = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_out_big.png"), 40, this, true); zoomOut->setToolTip(tr("Zoom Out")); connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut())); TImageButton *shift = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); shift->setToolTip(tr("Shift")); connect(shift, SIGNAL(clicked()), this, SLOT(wakeUpShift())); TImageButton *undo = new TImageButton(QPixmap(THEME_DIR + "icons/undo_big.png"), 40, this, true); undo->setToolTip(tr("Undo")); connect(undo, SIGNAL(clicked()), this, SLOT(undo())); TImageButton *redo = new TImageButton(QPixmap(THEME_DIR + "icons/redo_big.png"), 40, this, true); redo->setToolTip(tr("Redo")); connect(redo, SIGNAL(clicked()), this, SLOT(redo())); TImageButton *colors = new TImageButton(QPixmap(THEME_DIR + "icons/color_palette_big.png"), 40, this, true); colors->setToolTip(tr("Color Palette")); connect(colors, SIGNAL(clicked()), this, SLOT(colorDialog())); TImageButton *pen = new TImageButton(QPixmap(THEME_DIR + "icons/pen_properties.png"), 40, this, true); pen->setToolTip(tr("Pen Size")); connect(pen, SIGNAL(clicked()), this, SLOT(penDialog())); TImageButton *exposure = new TImageButton(QPixmap(THEME_DIR + "icons/exposure_sheet_big.png"), 40, this, true); exposure->setToolTip(tr("Exposure Sheet")); connect(exposure, SIGNAL(clicked()), this, SLOT(exposureDialog())); QBoxLayout *controls = new QBoxLayout(QBoxLayout::TopToBottom); controls->setAlignment(Qt::AlignHCenter | Qt::AlignTop); controls->setContentsMargins(3, 3, 3, 3); controls->setSpacing(7); controls->addWidget(pencil); controls->addWidget(ink); // controls->addWidget(polyline); controls->addWidget(ellipse); controls->addWidget(rectangle); controls->addWidget(images); controls->addWidget(objects); controls->addWidget(nodes); controls->addWidget(trash); controls->addWidget(zoomIn); controls->addWidget(zoomOut); controls->addWidget(hand); controls->addWidget(undo); controls->addWidget(redo); controls->addWidget(colors); controls->addWidget(pen); controls->addWidget(exposure); QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(2); layout->addLayout(controls); layout->addWidget(graphicsView); setLayout(layout); }
void myPushButton::leaveEvent(QEvent *) { //setBkPalette(0); QPixmap pixmap(iconStatus.at(0)); setIcon(QIcon(pixmap)); }