void MediaView::initialize() { QBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); splitter = new MiniSplitter(); playlistView = new PlaylistView(this); // respond to the user doubleclicking a playlist item connect(playlistView, SIGNAL(activated(const QModelIndex &)), SLOT(itemActivated(const QModelIndex &))); playlistModel = new PlaylistModel(); connect(playlistModel, SIGNAL(activeRowChanged(int)), SLOT(activeRowChanged(int))); // needed to restore the selection after dragndrop connect(playlistModel, SIGNAL(needSelectionFor(QList<Video*>)), SLOT(selectVideos(QList<Video*>))); playlistView->setModel(playlistModel); connect(playlistView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); connect(playlistView, SIGNAL(authorPushed(QModelIndex)), SLOT(authorPushed(QModelIndex))); sidebar = new SidebarWidget(this); sidebar->setPlaylist(playlistView); connect(sidebar->getRefineSearchWidget(), SIGNAL(searchRefined()), SLOT(searchAgain())); connect(playlistModel, SIGNAL(haveSuggestions(const QStringList &)), sidebar, SLOT(showSuggestions(const QStringList &))); connect(sidebar, SIGNAL(suggestionAccepted(QString)), MainWindow::instance(), SLOT(search(QString))); splitter->addWidget(sidebar); videoAreaWidget = new VideoAreaWidget(this); // videoAreaWidget->setMinimumSize(320,240); #ifdef APP_PHONON videoWidget = new Phonon::VideoWidget(this); videoAreaWidget->setVideoWidget(videoWidget); #endif videoAreaWidget->setListModel(playlistModel); loadingWidget = new LoadingWidget(this); videoAreaWidget->setLoadingWidget(loadingWidget); splitter->addWidget(videoAreaWidget); splitter->setStretchFactor(0, 0); splitter->setStretchFactor(1, 8); // restore splitter state QSettings settings; splitter->restoreState(settings.value("splitter").toByteArray()); splitter->setChildrenCollapsible(false); connect(splitter, SIGNAL(splitterMoved(int,int)), SLOT(maybeAdjustWindowSize())); layout->addWidget(splitter); errorTimer = new QTimer(this); errorTimer->setSingleShot(true); errorTimer->setInterval(3000); connect(errorTimer, SIGNAL(timeout()), SLOT(skipVideo())); #ifdef APP_ACTIVATION demoTimer = new QTimer(this); demoTimer->setSingleShot(true); connect(demoTimer, SIGNAL(timeout()), SLOT(demoMessage())); #endif connect(videoAreaWidget, SIGNAL(doubleClicked()), The::globalActions()->value("fullscreen"), SLOT(trigger())); QAction* refineSearchAction = The::globalActions()->value("refine-search"); connect(refineSearchAction, SIGNAL(toggled(bool)), sidebar, SLOT(toggleRefineSearch(bool))); currentVideoActions << The::globalActions()->value("webpage") << The::globalActions()->value("pagelink") << The::globalActions()->value("videolink") << The::globalActions()->value("open-in-browser") #ifdef APP_SNAPSHOT << The::globalActions()->value("snapshot") #endif << The::globalActions()->value("findVideoParts") << The::globalActions()->value("skip") << The::globalActions()->value("previous") << The::globalActions()->value("stopafterthis") << The::globalActions()->value("related-videos") << The::globalActions()->value("refine-search") << The::globalActions()->value("twitter") << The::globalActions()->value("facebook") << The::globalActions()->value("buffer") << The::globalActions()->value("email"); #ifndef APP_PHONON_SEEK QSlider *slider = MainWindow::instance()->getSlider(); connect(slider, SIGNAL(valueChanged(int)), SLOT(sliderMoved(int))); #endif }
int Q3ListBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = Q3ScrollView::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: selected((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: highlighted((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 3: selected((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 4: highlighted((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 5: selected((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 6: selectionChanged(); break; case 7: selectionChanged((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 8: currentChanged((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 9: clicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 10: clicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 11: pressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 12: pressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 13: doubleClicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 14: returnPressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 15: rightButtonClicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 16: rightButtonPressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 17: mouseButtonPressed((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3ListBoxItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break; case 18: mouseButtonClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3ListBoxItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break; case 19: contextMenuRequested((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 20: onItem((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break; case 21: onViewport(); break; case 22: clear(); break; case 23: ensureCurrentVisible(); break; case 24: clearSelection(); break; case 25: selectAll((*reinterpret_cast< bool(*)>(_a[1]))); break; case 26: invertSelection(); break; case 27: clearInputString(); break; case 28: refreshSlot(); break; case 29: doAutoScroll(); break; case 30: adjustItems(); break; } _id -= 31; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< uint*>(_v) = count(); break; case 1: *reinterpret_cast< int*>(_v) = numItemsVisible(); break; case 2: *reinterpret_cast< int*>(_v) = currentItem(); break; case 3: *reinterpret_cast< QString*>(_v) = currentText(); break; case 4: *reinterpret_cast< int*>(_v) = topItem(); break; case 5: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break; case 6: *reinterpret_cast< bool*>(_v) = isMultiSelection(); break; case 7: *reinterpret_cast< LayoutMode*>(_v) = columnMode(); break; case 8: *reinterpret_cast< LayoutMode*>(_v) = rowMode(); break; case 9: *reinterpret_cast< int*>(_v) = numColumns(); break; case 10: *reinterpret_cast< int*>(_v) = numRows(); break; case 11: *reinterpret_cast< bool*>(_v) = variableWidth(); break; case 12: *reinterpret_cast< bool*>(_v) = variableHeight(); break; } _id -= 13; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 2: setCurrentItem(*reinterpret_cast< int*>(_v)); break; case 4: setTopItem(*reinterpret_cast< int*>(_v)); break; case 5: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break; case 6: setMultiSelection(*reinterpret_cast< bool*>(_v)); break; case 7: setColumnMode(*reinterpret_cast< LayoutMode*>(_v)); break; case 8: setRowMode(*reinterpret_cast< LayoutMode*>(_v)); break; case 11: setVariableWidth(*reinterpret_cast< bool*>(_v)); break; case 12: setVariableHeight(*reinterpret_cast< bool*>(_v)); break; } _id -= 13; } else if (_c == QMetaObject::ResetProperty) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 13; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 13; } #endif // QT_NO_PROPERTIES return _id; }
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 ColoradoPayCertificates 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 ColoradoPayCertificates 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())); }
ImageFileDialog::ImageFileDialog(const QVariantList &old, QString imgpath, QWidget *parent) :QDialog(parent), sellist(new QListWidget()), flistview(new QListWidget()), treefile(new QTreeView()), statusBar(new QLabel(this)), okbtn(new QPushButton("确定",this)) { mWindow = (MainWindow*)parent; setWindowFlags(Qt::Widget | Qt::FramelessWindowHint); setModal(true); treefile->header()->setHidden(true); flistview->setProperty(DKEY_EXTMAP,extMap); /* 填弃上一次的数据 */ dirModel = new QFileSystemModel(this); fileModel = new QFileSystemModel(this); this->setFixedSize(1000,600); sellist->setSelectionMode(QAbstractItemView::ExtendedSelection); sellist->setAlternatingRowColors(true); flistview->setSelectionMode(QAbstractItemView::ExtendedSelection); flistview->setAlternatingRowColors(true); flistview->setIconSize(QSize(80,60)); sellist->setIconSize(QSize(80,60)); QMap<QString,QString> navigator; navigator[UP] = ":/icon/icons/go-up.png"; navigator[DOWN] = ":/icon/icons/go-down.png"; navigator[LEFT] = ":/icon/icons/go-previous.png"; navigator[RIGHT] = ":/icon/icons/go-next.png"; QVBoxLayout *mainLayout = new QVBoxLayout(); QHBoxLayout *mh = new QHBoxLayout(); this->setLayout(mainLayout); mainLayout->addLayout(mh); this->setWindowTitle(tr("图片编辑")); QVBoxLayout *v = new QVBoxLayout(); v->setSizeConstraint(QLayout::SetFixedSize); QMapIterator<QString,QString> itmap(navigator); while(itmap.hasNext()) { itmap.next(); QPushButton *btn = new QPushButton(); QPixmap p(itmap.value()); btn->setIconSize(p.size()); p.setMask(p.createMaskFromColor(Qt::white)); btn->setIcon(QIcon(p)); btn->setObjectName(itmap.key()); btn->setFixedSize(btn->iconSize()); v->addWidget(btn); if(!LEFT.compare(itmap.key())) { connect(btn,SIGNAL(clicked(bool)),SLOT(onAddSelectedItems())); }else if(!UP.compare(itmap.key())) { connect(btn,SIGNAL(clicked(bool)),SLOT(onUp())); }else if(!DOWN.compare(itmap.key())) { connect(btn,SIGNAL(clicked(bool)),SLOT(onDown())); }else if(!RIGHT.compare(itmap.key())) { connect(btn,SIGNAL(clicked(bool)),SLOT(onDelSelectedItems())); } } dirModel->setRootPath(imgpath); dirModel->removeColumn(3); dirModel->removeColumn(2); dirModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs); filters << "*.bmp" << "*.png" << "*.jpg"; dirModel->setNameFilters(filters); treefile->setModel(dirModel); treefile->setRootIndex(dirModel->index(imgpath)); treefile->setAlternatingRowColors(true); treefile->hideColumn(3); treefile->hideColumn(2); treefile->hideColumn(1); fileModel->setRootPath(imgpath); fileModel->setNameFilters(filters); fileModel->setFilter(QDir::Files); connect(sellist,&QListWidget::clicked, [=](QModelIndex index){ sellist->clearSelection(); sellist->setCurrentIndex(index); findChild<QPushButton*>(UP)->setEnabled(index.row() == 0 ? false : true); findChild<QPushButton*>(DOWN)->setEnabled(index.row() == sellist->count() -1 ? false : true); }); connect(flistview,SIGNAL(doubleClicked(QModelIndex)), SLOT(onListViewDoubleClicked(QModelIndex))); connect(treefile,SIGNAL(clicked(QModelIndex)), SLOT(onTreeViewClicked(QModelIndex))); /* 主布局是水平布局,左(QListWidget),中(垂直布局),右(文件系统) */ mh->addWidget(sellist); mh->addLayout(v); mh->addWidget(flistview); mh->addWidget(treefile); QHBoxLayout *mlayout = new QHBoxLayout(); mlayout->setSizeConstraint(QLayout::SetMaximumSize); QLabel *msg = new QLabel("已经添加的图片数:"); statusBar->setText("0"); mlayout->addWidget(msg); mlayout->addWidget(statusBar); mlayout->addWidget(okbtn); statusBar->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); mainLayout->addLayout(mlayout); foreach (QVariant v, old) { // example for v "config/images/digital-0.png" QString str = v.toString(); QString fpath = QDir::currentPath() + BACKSLASH + str; QPixmap pic = mWindow->mImgMap[fpath]; if(pic.isNull()) { pic = mWindow->mImgMap[fpath] = QPixmap(fpath); } QString sname = str.mid(str.lastIndexOf(BACKSLASH)+1); QListWidgetItem *nitem = new QListWidgetItem(pic,sname); sellist->addItem(nitem); selectedMap[sname] = fpath; }
void DockWnd::mouseDoubleClickEvent( QMouseEvent*) { needToggle = false; emit doubleClicked(); }
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(840, 550); setWindowTitle(tr("Global ") + tr("Wallet")); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif QApplication::setStyle(QStyleFactory::create("Fusion")); // 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(); // QFile style(":/styles/styles"); // style.open(QFile::ReadOnly); // qApp->setStyleSheet(QString::fromUtf8(style.readAll())); // setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(210,192,123);border:none; } #toolbar3 { border:none;width:1px; background-color: rgb(63,109,186); } #toolbar2 { border:none;width:28px; background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195),stop: 2 rgb(59,62,65)); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(210,192,123); text-align: left; color: white;min-width:150px;max-width:150px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195),stop: 2 rgb(59,62,65));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:150px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(210,192,123) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(210,192,123); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195)); } QMenuBar { background: rgb(210,192,123); color:white; } QMenuBar::item { font-size:12px;padding-bottom:8px;padding-top:8px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(210,192,123), stop: 1 rgb(227,213,195)); }"); qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none;font-family:'Open Sans,sans-serif'; } #frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; } #spacer { background:rgb(63,109,186);border:none; } #toolbar3 { border:none;width:1px; background-color: rgb(63,109,186); } #toolbar2 { border:none;width:28px; background-color:rgb(63,109,186); } #toolbar { border:none;height:100%;padding-top:20px; background: rgb(63,109,186); text-align: left; color: white;min-width:150px;max-width:150px;} QToolBar QToolButton:hover {background-color:qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,stop: 0 rgb(63,109,186), stop: 1 rgb(216,252,251),stop: 2 rgb(59,62,65));} QToolBar QToolButton { font-family:Century Gothic;padding-left:20px;padding-right:150px;padding-top:10px;padding-bottom:10px; width:100%; color: white; text-align: left; background-color: rgb(63,109,186) } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:white; } QMenu { background: rgb(63,109,186); color:white; padding-bottom:10px; } QMenu::item { color:white; background-color: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(63,109,186), stop: 1 rgb(149,204,244)); } QMenuBar { background: rgb(63,109,186); color:white; } QMenuBar::item { font-size:12px;padding-bottom:8px;padding-top:8px;padding-left:15px;padding-right:15px;color:white; background-color: transparent; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgb(63,109,186), stop: 1 rgb(149,204,244)); }"); //#ifdef Q_OS_MAC // toolbar->setStyleSheet("QToolBar { background-color: transparent; border: 0px solid black; padding: 3px; }"); //#endif // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #007FFF, stop: 1 #3B5998); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(28); toolbar2->setIconSize(QSize(28,28)); toolbar2->addWidget(labelEncryptionIcon); toolbar2->addWidget(labelStakingIcon); toolbar2->addWidget(labelConnectionsIcon); toolbar2->addWidget(labelBlocksIcon); toolbar2->setStyleSheet("#toolbar2 QToolButton { border:none;padding:0px;margin:0px;height:20px;width:28px;margin-top:36px; }"); // toolbar2->setStyleSheet(QString::fromUtf8(style.readAll())); addToolBarBreak(Qt::TopToolBarArea); QToolBar *toolbar3 = addToolBar(tr("Green bar")); addToolBar(Qt::TopToolBarArea,toolbar3); toolbar3->setOrientation(Qt::Horizontal); toolbar3->setMovable( false ); toolbar3->setObjectName("toolbar3"); toolbar3->setFixedHeight(2); 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(); }
LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent ) : ControllerDialog( _model, _parent ) { QString title = tr( "LFO" ); title.append( " (" ); title.append( _model->name() ); title.append( ")" ); setWindowTitle( title ); setWindowIcon( embed::getIconPixmap( "controller" ) ); setFixedSize( 240, 80 ); ToolTip::add( this, tr( "LFO Controller" ) ); m_baseKnob = new Knob( knobBright_26, this ); m_baseKnob->setLabel( tr( "BASE" ) ); m_baseKnob->move( CD_LFO_BASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_baseKnob->setHintText( tr( "Base amount:" ), "" ); m_baseKnob->setWhatsThis( tr("todo") ); m_speedKnob = new TempoSyncKnob( knobBright_26, this ); m_speedKnob->setLabel( tr( "SPD" ) ); m_speedKnob->move( CD_LFO_SPEED_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_speedKnob->setHintText( tr( "LFO-speed:" ), "" ); m_speedKnob->setWhatsThis( tr( "Use this knob for setting speed of the LFO. The " "bigger this value the faster the LFO oscillates and " "the faster the effect." ) ); m_amountKnob = new Knob( knobBright_26, this ); m_amountKnob->setLabel( tr( "AMT" ) ); m_amountKnob->move( CD_LFO_AMOUNT_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_amountKnob->setHintText( tr( "Modulation amount:" ), "" ); m_amountKnob->setWhatsThis( tr( "Use this knob for setting modulation amount of the " "LFO. The bigger this value, the more the connected " "control (e.g. volume or cutoff-frequency) will " "be influenced by the LFO." ) ); m_phaseKnob = new Knob( knobBright_26, this ); m_phaseKnob->setLabel( tr( "PHS" ) ); m_phaseKnob->move( CD_LFO_PHASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_phaseKnob->setHintText( tr( "Phase offset:" ) , "" + tr( "degrees" ) ); m_phaseKnob->setWhatsThis( tr( "With this knob you can set the phase offset of " "the LFO. That means you can move the " "point within an oscillation where the " "oscillator begins to oscillate. For example " "if you have a sine-wave and have a phase-" "offset of 180 degrees the wave will first go " "down. It's the same with a square-wave." ) ); PixmapButton * sin_wave_btn = new PixmapButton( this, NULL ); sin_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y ); sin_wave_btn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); sin_wave_btn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); ToolTip::add( sin_wave_btn, tr( "Click here for a sine-wave." ) ); PixmapButton * triangle_wave_btn = new PixmapButton( this, NULL ); triangle_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y ); triangle_wave_btn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); triangle_wave_btn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); ToolTip::add( triangle_wave_btn, tr( "Click here for a triangle-wave." ) ); PixmapButton * saw_wave_btn = new PixmapButton( this, NULL ); saw_wave_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y ); saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); saw_wave_btn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); ToolTip::add( saw_wave_btn, tr( "Click here for a saw-wave." ) ); PixmapButton * sqr_wave_btn = new PixmapButton( this, NULL ); sqr_wave_btn->move( CD_LFO_SHAPES_X + 45, CD_LFO_SHAPES_Y ); sqr_wave_btn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); sqr_wave_btn->setInactiveGraphic( embed::getIconPixmap( "square_wave_inactive" ) ); ToolTip::add( sqr_wave_btn, tr( "Click here for a square-wave." ) ); PixmapButton * moog_saw_wave_btn = new PixmapButton( this, NULL ); moog_saw_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y + 15 ); moog_saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "moog_saw_wave_active" ) ); moog_saw_wave_btn->setInactiveGraphic( embed::getIconPixmap( "moog_saw_wave_inactive" ) ); ToolTip::add( moog_saw_wave_btn, tr( "Click here for a moog saw-wave." ) ); PixmapButton * exp_wave_btn = new PixmapButton( this, NULL ); exp_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y + 15 ); exp_wave_btn->setActiveGraphic( embed::getIconPixmap( "exp_wave_active" ) ); exp_wave_btn->setInactiveGraphic( embed::getIconPixmap( "exp_wave_inactive" ) ); ToolTip::add( exp_wave_btn, tr( "Click here for an exponential wave." ) ); PixmapButton * white_noise_btn = new PixmapButton( this, NULL ); white_noise_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y + 15 ); white_noise_btn->setActiveGraphic( embed::getIconPixmap( "white_noise_wave_active" ) ); white_noise_btn->setInactiveGraphic( embed::getIconPixmap( "white_noise_wave_inactive" ) ); ToolTip::add( white_noise_btn, tr( "Click here for white-noise." ) ); m_userWaveBtn = new PixmapButton( this, NULL ); m_userWaveBtn->move( CD_LFO_SHAPES_X + 45, CD_LFO_SHAPES_Y + 15 ); m_userWaveBtn->setActiveGraphic( embed::getIconPixmap( "usr_wave_active" ) ); m_userWaveBtn->setInactiveGraphic( embed::getIconPixmap( "usr_wave_inactive" ) ); connect( m_userWaveBtn, SIGNAL( doubleClicked() ), this, SLOT( askUserDefWave() ) ); ToolTip::add( m_userWaveBtn, tr( "Click here for a user-defined shape.\nDouble click to pick a file." ) ); m_waveBtnGrp = new automatableButtonGroup( this ); m_waveBtnGrp->addButton( sin_wave_btn ); m_waveBtnGrp->addButton( triangle_wave_btn ); m_waveBtnGrp->addButton( saw_wave_btn ); m_waveBtnGrp->addButton( sqr_wave_btn ); m_waveBtnGrp->addButton( moog_saw_wave_btn ); m_waveBtnGrp->addButton( exp_wave_btn ); m_waveBtnGrp->addButton( white_noise_btn ); m_waveBtnGrp->addButton( m_userWaveBtn ); PixmapButton * x1 = new PixmapButton( this, NULL ); x1->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y ); x1->setActiveGraphic( embed::getIconPixmap( "lfo_x1_active" ) ); x1->setInactiveGraphic( embed::getIconPixmap( "lfo_x1_inactive" ) ); PixmapButton * x100 = new PixmapButton( this, NULL ); x100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 15 ); x100->setActiveGraphic( embed::getIconPixmap( "lfo_x100_active" ) ); x100->setInactiveGraphic( embed::getIconPixmap( "lfo_x100_inactive" ) ); PixmapButton * d100 = new PixmapButton( this, NULL ); d100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 15 ); d100->setActiveGraphic( embed::getIconPixmap( "lfo_d100_active" ) ); d100->setInactiveGraphic( embed::getIconPixmap( "lfo_d100_inactive" ) ); m_multiplierBtnGrp = new automatableButtonGroup( this ); m_multiplierBtnGrp->addButton( x1 ); m_multiplierBtnGrp->addButton( x100 ); m_multiplierBtnGrp->addButton( d100 ); setModel( _model ); setAutoFillBackground( true ); QPalette pal; pal.setBrush( backgroundRole(), embed::getIconPixmap( "lfo_controller_artwork" ) ); setPalette( pal ); }
void SessionStateWidget::mouseDoubleClickEvent(QMouseEvent *e) { emit doubleClicked(); QWidget::mouseDoubleClickEvent(e); }
void CMainWindow::connectSignals() { CChatManager *Manager = CChatManager::instance(); CNetworkClient *Network = CNetworkClient::instance(); CBattleManager *BattleManager = CBattleManager::instance(); connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabCloseRequested(int)), Manager, SLOT(closeChannel(int))); connect(ui->ChatTabWidget->tabBar(), SIGNAL(currentChanged(int)), Manager, SLOT(changeCurrentChannel(int))); connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabMoved(int,int)), Manager, SLOT(moveChannel(int,int))); connect(Manager, SIGNAL(joined(CChannel*)), this, SLOT(createTab(CChannel*))); connect(Manager, SIGNAL(closeTab(int)), this, SLOT(removeTab(int))); connect(Manager, SIGNAL(currentChanged(CChannel*)), ui->ChatTabWidget->chatView(), SLOT(loadChannel(CChannel*))); connect(ui->ChannelsView, SIGNAL(doubleClicked(QModelIndex)), CChatManager::instance(), SLOT(doubleClicked(QModelIndex))); connect(ui->ChannelUserView, SIGNAL(doubleClicked(QModelIndex)), CUserManager::instance()->chatModel(), SLOT(doubleClicked(QModelIndex))); connect(ui->actionChatSend, SIGNAL(triggered()), this, SLOT(sendChat())); connect(ui->actionBattleSend, SIGNAL(triggered()), this, SLOT(sendBattle())); connect(Manager, SIGNAL(currentChanged(int)), ui->ChatTabWidget->tabBar(), SLOT(setCurrentIndex(int))); connect(ui->BattleListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), CBattleManager::instance(), SLOT(battleSelected(QModelIndex))); connect(ui->BattleListView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance(), SLOT(doubleClicked(QModelIndex))); connect(ui->BattlePreviewView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance()->battlePreviewModel(), SLOT(doubleClicked(QModelIndex))); connect(ui->actionConnect, SIGNAL(triggered()), this, SLOT(showConnectDialog())); connect(&ConnectDialog, SIGNAL(connect(QString,int,QString,QString)), Network, SLOT(connectToServer(QString,int,QString,QString))); connect(Network, SIGNAL(disconnected()), this, SLOT(networkDisconnected())); connect(Network, SIGNAL(connected()), this, SLOT(networkConnected())); connect(Network, SIGNAL(multiplayerDisabled()), this, SLOT(disableMultiplayerGUI())); connect(Network, SIGNAL(multiplayerEnabled()), this, SLOT(enableMultiplayerGUI())); connect(ui->actionDisconnect, SIGNAL(triggered()), Network, SLOT(disconnect())); connect(CBattleManager::instance(), SIGNAL(currentMapChanged(CMap*)), ui->MapInfo, SLOT(setMap(CMap*))); connect(CBattleroomManager::instance(), SIGNAL(mapChanged(CMap*)), ui->BattleMapInfo, SLOT(setMap(CMap*))); connect(CBattleroomManager::instance(), SIGNAL(updateChat(CChannel*)), ui->BattleChatText, SLOT(loadChannel(CChannel*))); connect(CBattleroomManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(ui->LeaveBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(leaveBattle())); connect(ui->DownloadButton, SIGNAL(clicked()), this, SLOT(execDownload())); connect(ui->actionDeleteDownload, SIGNAL(triggered()), this, SLOT(removeDownload())); connect(ui->actionDownloadMap, SIGNAL(triggered()), BattleManager, SLOT(downloadMapForBattle())); connect(ui->actionDownloadMod, SIGNAL(triggered()), BattleManager, SLOT(downloadModForBattle())); connect(ui->DownloadView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDownloadContextMenu(QPoint))); connect(ui->BattleListView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showBattleContextMenu(QPoint))); connect(Network, SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(Manager, SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(Network, SIGNAL(agreement(QString)), this, SLOT(showAgreement(QString))); connect(ui->actionReloadUnitSync, SIGNAL(triggered()), CUnitSync::instance(), SLOT(reload())); connect(CUnitSync::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CUserManager::instance(), SIGNAL(lobbyUserBattleStatusChanged(CBattleStatus*)), this, SLOT(updateBattleStatus(CBattleStatus*))); connect(CUnitSync::instance(), SIGNAL(loaded()), this, SLOT(unitsyncLoaded())); connect(CUnitSync::instance(), SIGNAL(unloaded()), this, SLOT(unitsyncUnloaded())); connect(ui->actionUpdateStatus, SIGNAL(triggered()), this, SLOT(changeBattleStatus())); connect(CBattleroomManager::instance(), SIGNAL(battleJoined(CBattle*)), this, SLOT(enableBattleroom(CBattle*))); connect(CBattleroomManager::instance(), SIGNAL(battleClosed()), this, SLOT(disableBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(gameStarted()), this, SLOT(lockBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(gameEnded()), this, SLOT(unlockBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(battleStarted()), this, SLOT(onBattleStarted())); connect(CBattleroomManager::instance(), SIGNAL(battleEnded()), this, SLOT(onBattleEnded())); connect(ui->SelectColorButton, SIGNAL(clicked()), this, SLOT(selectColor())); connect(ui->StartBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(startGame())); connect(&ColorDialog, SIGNAL(colorSelected(QColor)), this, SLOT(colorSelected(QColor))); }
/** This event handler can be reimplemented in a subclass to receive mouse double click events for the system tray entry. Note that the system tray entry gets a mousePressEvent() and a mouseReleaseEvent() before the mouseDoubleClickEvent(). \sa mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent(), QMouseEvent */ void TrayIcon::mouseDoubleClickEvent( QMouseEvent *e ) { if ( e->button() == Qt::LeftButton ) emit doubleClicked( e->globalPos() ); e->accept(); }
TransactionView::TransactionView(const PlatformStyle* platformStyle, QWidget* parent) : QWidget(parent) , model(0) , transactionProxyModel(0) , transactionView(0) , abandonAction(0) { setContentsMargins(0, 0, 0, 0); QHBoxLayout* hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); /*if (platformStyle->getUseExtraSpacing()) { hlayout->setSpacing(5); hlayout->addSpacing(26); } else { hlayout->setSpacing(0); hlayout->addSpacing(23); }*/ watchOnlyWidget = new QComboBox(this); watchOnlyWidget->setFixedWidth(24); watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); hlayout->addWidget(watchOnlyWidget); dateWidget = new QComboBox(this); /*if (platformStyle->getUseExtraSpacing()) { dateWidget->setFixedWidth(121); } else { dateWidget->setFixedWidth(120); }*/ dateWidget->addItem(tr("All dates"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); dateWidget->addItem(tr("Select range"), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); /*if (platformStyle->getUseExtraSpacing()) { typeWidget->setFixedWidth(121); } else { typeWidget->setFixedWidth(120); }*/ typeWidget->addItem(tr("All transaction types"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther)); typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) | TransactionFilterProxy::TYPE(TransactionRecord::SendToOther)); typeWidget->addItem(tr("Internal transfer"), TransactionFilterProxy::TYPE(TransactionRecord::InternalTransfer)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); hlayout->addWidget(typeWidget); QLabel* searchLabel = new QLabel(""); searchLabel->setObjectName("searchLabel1"); searchLabel->setContentsMargins(0, 0, 0, 0); hlayout->addWidget(searchLabel); addressWidget = new QLineEdit(this); addressWidget->setObjectName("searchBox1"); #if QT_VERSION >= 0x040700 addressWidget->setPlaceholderText(tr("Search label")); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); amountWidget->setObjectName("amountWidget"); amountWidget->setAlignment(Qt::AlignRight); #if QT_VERSION >= 0x040700 amountWidget->setPlaceholderText(tr("Min amount")); #endif amountWidget->setFixedWidth(120); amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); QVBoxLayout* vlayout = new QVBoxLayout(this); vlayout->setContentsMargins(0, 0, 0, 0); vlayout->setSpacing(0); QFrame* topMargin = new QFrame(this); topMargin->setObjectName("topMargin"); topMargin->setContentsMargins(0, 0, 0, 0); vlayout->addWidget(topMargin); vlayout->addWidget(createDateRangeWidget()); QTableView* view = new QTableView(this); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); /*int width = view->verticalScrollBar()->sizeHint().width(); if (platformStyle->getUseExtraSpacing()) { hlayout->addSpacing(width+2); } else { hlayout->addSpacing(width); }*/ view->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); view->installEventFilter(this); transactionView = view; abandonAction = new QAction(tr("Abandon transaction"), this); QAction* copyAddressAction = new QAction(tr("Copy address"), this); QAction* copyLabelAction = new QAction(tr("Copy label"), this); QAction* copyAmountAction = new QAction(tr("Copy amount"), this); QAction* copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction* copyTxHexAction = new QAction(tr("Copy raw transaction"), this); QAction* copyTxPlainText = new QAction(tr("Copy full transaction details"), this); QAction* editLabelAction = new QAction(tr("Edit label"), this); QAction* showDetailsAction = new QAction(tr("Show transaction details"), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addAction(copyTxHexAction); contextMenu->addAction(copyTxPlainText); contextMenu->addAction(showDetailsAction); contextMenu->addSeparator(); contextMenu->addAction(abandonAction); contextMenu->addAction(editLabelAction); mapperThirdPartyTxUrls = new QSignalMapper(this); connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString))); connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex))); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx())); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex())); connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); }
void SmallDeviceView::onRestoreMainViewAction() { emit doubleClicked(); }
void SmallDeviceView::mouseDoubleClickEvent(QMouseEvent *) { emit doubleClicked(); }
slm_machine::slm_machine(QWidget *parent) : QMainWindow(parent), ui(new Ui::slm_machineClass) { /************************** UI and Buddy Management *******************************/ ui->setupUi(this); setProgressBarVisibility(false); //Buddy Management buddies = new buddyManager(); buddies->loadBuddiesAndIPs(); buddyModel = new QStringListModel(); buddyModel->setStringList(buddies->AliasBuddyList); ui->buddyList->setModel(buddyModel); ui->buddyList->setEditTriggers(QAbstractItemView::NoEditTriggers); this->setWindowTitle("SLM"); //UI connections connect(ui->addBuddyButton, SIGNAL(clicked()),this, SLOT(addBuddyPressed())); connect(ui->removeBuddyButton, SIGNAL(clicked()), this, SLOT(removeBuddypressed())); connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(closeApplication())); connect(ui->buddyList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(buddyPressed(QModelIndex))); connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQTPressed())); connect(ui->actionAbout_SLM, SIGNAL(triggered()), this, SLOT(aboutSLMPressed())); connect(ui->actionEncryption_Key, SIGNAL(triggered()), this, SLOT(encryptionKeyPressed())); /************************************************************************************/ /************************** Message Server Management *******************************/ messageServer = slm_server::getInstance(); connect(messageServer, SIGNAL(sendtoUI(QByteArray,QHostAddress)),this,SLOT(messageHandler(QByteArray,QHostAddress))); /************************************************************************************/ /***************************** File Server Management *******************************/ onGoingFileTransfer = false; FServer = new fileServer(); //File Server Connections connect(FServer,SIGNAL(newDocumentArrived(QString,QString,quint32,quint8)),this,SLOT(incomingFileSlot(QString,QString,quint32,quint8)),Qt::QueuedConnection); connect(FServer,SIGNAL(transferCompleted(QString)),this,SLOT(incomingFileTransferCompleted(QString)),Qt::QueuedConnection); connect(FServer,SIGNAL(transferCanceled()),this,SLOT(transferIsCancelled()),Qt::QueuedConnection); connect(FServer,SIGNAL(ongoingTransfer()),this,SLOT(ongoingTransferExists()),Qt::QueuedConnection); connect(FServer,SIGNAL(receivingProgress(quint32)),this,SLOT(updateReceivingProgress(quint32)),Qt::QueuedConnection); //Start the File Server Thread FServer->start(); /***********************************************************************************/ /***************************** Buddy List Right Click *******************************/ checkOnline = new QAction(tr("&Check Online"), this); checkOnline->setIcon(QIcon(":/icons/CheckOnline")); rightClickUserMenu = new QMenu(); rightClickUserMenu->addAction(checkOnline); connect(checkOnline,SIGNAL(triggered()),this,SLOT(checkUserOnline())); ui->buddyList->installEventFilter(this); /***********************************************************************************/ /***************************** Tray Icon Management ********************************/ //Create tray icon and contex menu actions this->createActions(); this->createTrayIcon(); //Tray Icon Connections connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); connect(this, SIGNAL(signalPlaceToTray()),this, SLOT(slotPlaceToTray()),Qt::QueuedConnection); //Show application icon in the tray trayIcon->setIcon(QIcon(":/icons/SLM_Logo")); trayIcon->setToolTip("SLM (SMG Lan Messenger)"); trayIcon->show(); /**********************************************************************************/ }
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookPage), model(0), optionsModel(0), mode(mode), tab(tab) { ui->setupUi(this); #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac ui->newAddressButton->setIcon(QIcon()); ui->copyToClipboard->setIcon(QIcon()); ui->deleteButton->setIcon(QIcon()); #endif #ifndef USE_QRCODE ui->showQRCode->setVisible(false); #endif switch(mode) { case ForSending: connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); break; case ForEditing: ui->buttonBox->setVisible(false); break; } switch(tab) { case SendingTab: ui->labelExplanation->setVisible(false); ui->deleteButton->setVisible(true); ui->signMessage->setVisible(false); break; case ReceivingTab: ui->deleteButton->setVisible(false); ui->signMessage->setVisible(true); break; } // Context menu actions QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *copyAddressAction = new QAction(ui->copyToClipboard->text(), this); QAction *editAction = new QAction(tr("&Edit"), this); QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this); QAction *signMessageAction = new QAction(ui->signMessage->text(), this); QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this); deleteAction = new QAction(ui->deleteButton->text(), this); // Build context menu contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(editAction); if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); contextMenu->addAction(showQRCodeAction); if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); else if(tab == SendingTab) contextMenu->addAction(verifyMessageAction); // Connect signals for context menu actions connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboard_clicked())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction())); connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction())); connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked())); connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); // Pass through accept action from button box connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); }
ProcessListView::ProcessListView(QWidget *parent) : QTreeView(parent) { queueMode = false; //Model model = new ProcessListModel(this); proxyModel = new QSortFilterProxyModel(); proxyModel->setDynamicSortFilter(true); proxyModel->setSourceModel(model); proxyModel->setFilterKeyColumn(Name); proxyModel->setFilterRole(Qt::DisplayRole); setModel(proxyModel); delegate = new ProcessListDelegate(this, model); setItemDelegate(delegate); //View Settings setRootIsDecorated(false); setAllColumnsShowFocus(true); setSortingEnabled(false); setSelectionMode(QAbstractItemView::SingleSelection); setItemsExpandable(false); setAutoScroll(true); setContextMenuPolicy(Qt::CustomContextMenu); setAcceptDrops(true); // setDragDropOverwriteMode(true); setDropIndicatorShown(true); // setDragEnabled(true); setDragEnabled(true); // setDragDropMode(QAbstractItemView::DragDrop); //Actions actionRemove = new QAction(this); actionRemove->setText(tr("&Remove")); actionStart = new QAction(this); actionStart->setText(tr("&Start")); actionCancel = new QAction(this); actionCancel->setText(tr("&Cancel")); actionResult = new QAction(this); actionResult->setText(tr("show R&esult")); //Connections //context menu connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); //start selected process connect(actionStart, SIGNAL(triggered(bool)), this, SLOT(start())); //remove selected process connect(actionRemove, SIGNAL(triggered(bool)), this, SLOT(remove())); connect(actionCancel, SIGNAL(triggered(bool)), this, SLOT(cancel())); connect(actionResult, SIGNAL(triggered(bool)), this, SLOT(showResult())); connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(showProcessTooltip(QModelIndex))); connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(showResult(QModelIndex))); connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(displaySelected(QModelIndex))); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0), nWeight(0) { setFixedSize(970, 550); QFontDatabase::addApplicationFont(":/fonts/Bebas"); setWindowTitle(tr("Pentacoin") + " - " + tr("Wallet")); qApp->setStyleSheet("QMainWindow { background-image:url(:images/bkg);border:none; } #frame { } QToolBar QLabel { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} QToolBar QLabel:item { padding-top: 0px;padding-bottom: 0px;spacing: 10px;} #spacer { background: transparent;border:none; } #toolbar2 { border:none;width:0px;hight:0px;padding-top:40px;padding-bottom:0px; background-color: transparent; } #labelMiningIcon { padding-left:5px;font-family:Century Gothic;width:100%;font-size:10px;text-align:center;color:black; } QMenu { background-color: qlineargradient(spread:pad, x1:0.511, y1:1, x2:0.482909, y2:0, stop:0 rgba(232,232,232), stop:1 rgba(232,232,232)); color: black; padding-bottom:10px; } QMenu::item { color: black; background: transparent; } QMenu::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); } QMenuBar { background-color: white; color: white; } QMenuBar::item { font-size:12px;padding-bottom:3px;padding-top:3px;padding-left:15px;padding-right:15px;color: black; background-color: white; } QMenuBar::item:selected { background-color:qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5,stop: 0 rgba(99,99,99,45), stop: 1 rgba(99,99,99,45)); }"); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); masternodeManagerPage = new MasternodeManager(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(masternodeManagerPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); addToolBarBreak(Qt::LeftToolBarArea); QToolBar *toolbar2 = addToolBar(tr("Tabs toolbar")); addToolBar(Qt::LeftToolBarArea,toolbar2); toolbar2->setOrientation(Qt::Vertical); toolbar2->setMovable( false ); toolbar2->setObjectName("toolbar2"); toolbar2->setFixedWidth(28); toolbar2->setIconSize(QSize(28,54)); toolbar2->addWidget(labelEncryptionIcon); toolbar2->addWidget(labelStakingIcon); toolbar2->addWidget(labelConnectionsIcon); toolbar2->addWidget(labelBlocksIcon); toolbar2->setStyleSheet("#toolbar2 QToolButton { background: transparent;border:none;padding:0px;margin:0px;height:54px;width:28px; }"); syncIconMovie = new QMovie(":/movies/update_spinner", "gif", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), copyView(NULL) { ui->setupUi(this); //model.setFilter(QDir::AllDirs); model.setNameFilters( QStringList() << "*.xml");// << "*.lua" model.setNameFilterDisables(false); ui->fileTreeView->setModel(&model); ui->fileTreeView->setColumnHidden( 0, true); ui->fileTreeView->setColumnHidden( 1, true); ui->fileTreeView->setColumnHidden( 2, true); ui->fileTreeView->setColumnHidden( 3, true); connect(ui->fileTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(treeViewClicked(const QModelIndex &))); connect(ui->fileTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(treeViewContextMenu(QPoint))); loadIni(); PropertyWidget *propertybrowser = PropertyWidget::getInstance(); ui->dockWidget_2->setWidget(propertybrowser); connect( propertybrowser->variantManager, SIGNAL(valueChanged(QtProperty*,QVariant)), this, SLOT(propertyChanged(QtProperty*,QVariant))); connect( propertybrowser->variantManager, SIGNAL(attributeChanged(QtProperty *, const QString, const QVariant)), this, SLOT(attributeChanged(QtProperty *, const QString, const QVariant))); //控制台输出 PrintfDockWidget *dockWidget = PrintfDockWidget::getInstance(); addDockWidget(Qt::BottomDockWidgetArea, dockWidget); //初始化大纲 QStringList header; header << "对象" << "类型"; ui->treeWidget->setColumnCount(2); ui->treeWidget->setAlternatingRowColors(true); ui->treeWidget->setHeaderLabels(header); ui->treeWidget->setColumnWidth( 0, 200); connect( ui->treeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedOutlineTreeItem(QModelIndex))); connect( ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(treeWidgetContextMenu(QPoint))); connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(treeItemChanged(QTreeWidgetItem*, int))); ui->listWidget->setIconSize(QSize(60,60)); ui->listWidget->setDragEnabled(true); QSetIterator<QtProperty *> itr(propertybrowser->group->properties()); QStringList list; while(itr.hasNext()){ QtProperty *pro = itr.next(); list << pro->propertyName(); } list.sort(); for( int i = 0; i < list.count(); i++){ QString str = list.at(i); QListWidgetItem *item = new QListWidgetItem(); ui->listWidget->addItem(item); ControlsPaintWidget *widget = new ControlsPaintWidget(ui->listWidget, "", str, "描述"); ui->listWidget->setItemWidget(item, widget); item->setSizeHint (QSize(widget->rect().width(),widget->rect().height())); } setWindowState(Qt::WindowMaximized); ui->tabWidget->clear(); connect( ui->tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(tabCloseRequested(int))); connect( ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); ui->actionShowPrint->setChecked(true); ui->actionShowPrint->setCheckable(true); connect( ui->actionShowPrint, SIGNAL(triggered(bool)), this, SLOT(showPrint(bool))); ui->actionShowProperty->setChecked(true); ui->actionShowProperty->setCheckable(true); connect( ui->actionShowProperty, SIGNAL(triggered(bool)), this, SLOT(showProperty(bool))); ui->actionShowControls->setChecked(true); ui->actionShowControls->setCheckable(true); connect( ui->actionShowControls, SIGNAL(triggered(bool)), this, SLOT(showControls(bool))); setUnifiedTitleAndToolBarOnMac(true); }
PrefsWages::PrefsWages(QWidget* parent) : QWidget(parent) { QVBoxLayout *vboxLay = new QVBoxLayout; mWagesModel = new QSqlTableModel(this); mWagesModel->setTable("stdSaetze"); mWagesModel->setSort(3, Qt::AscendingOrder); mWagesModel->setEditStrategy(QSqlTableModel::OnManualSubmit); mWagesModel->select(); mWagesModel->setHeaderData(0, Qt::Horizontal, tr("ID")); mWagesModel->setHeaderData(1, Qt::Horizontal, tr("Code")); mWagesModel->setHeaderData(2, Qt::Horizontal, tr("Price")); mWagesModel->setHeaderData(3, Qt::Horizontal, tr("Sortkey")); mProxyModel = new QSortFilterProxyModel(this); mProxyModel->setSourceModel(mWagesModel); mWagesTreeView = new ImpTreeView; vboxLay->addWidget( mWagesTreeView ); mWagesTreeView->setModel(mProxyModel); mWagesTreeView->setItemDelegate(new WagesItemDelegate()); mWagesTreeView->hideColumn(0); mWagesTreeView->hideColumn(3); mWagesTreeView->header()->stretchLastSection(); mWagesTreeView->setColumnWidth(1, 200); mWagesTreeView->resizeColumnToContents(2); mWagesTreeView->resizeColumnToContents(1); mWagesTreeView->setEditTriggers(ImpTreeView::NoEditTriggers); connect( mWagesTreeView, SIGNAL(clicked(QModelIndex)), SLOT( slotWageSelected(QModelIndex) ) ); connect( mWagesTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(slotEditWage(QModelIndex))); QHBoxLayout *butLay = new QHBoxLayout; butLay->addStretch( 1 ); mUp = new KPushButton( KIcon("arrow-up"), i18n( "Up" )); connect( mUp, SIGNAL( clicked() ), SLOT( slotUp() ) ); butLay->addWidget( mUp ); mUp->setEnabled(false); mDown = new KPushButton( KIcon("arrow-down"), i18n( "Down" )); connect( mDown, SIGNAL( clicked() ), SLOT( slotDown() ) ); butLay->addWidget( mDown ); mDown->setEnabled(false); KPushButton *but = new KPushButton( KIcon("list-add"), i18n( "Add" )); connect( but, SIGNAL( clicked() ), SLOT( slotAddWage() ) ); butLay->addWidget( but ); mEditWage = new KPushButton( KIcon("document-edit"), i18n( "Edit" )); connect( mEditWage, SIGNAL( clicked() ), SLOT( slotEditWage() ) ); butLay->addWidget( mEditWage ); mEditWage->setEnabled(false); mDelWage = new KPushButton( KIcon("list-remove"), i18n( "Remove" ) ); connect( mDelWage, SIGNAL( clicked() ), SLOT( slotDeleteWage() ) ); butLay->addWidget( mDelWage ); mDelWage->setEnabled( false ); vboxLay->addLayout( butLay ); this->setLayout( vboxLay ); }
void PlayListWidget::doubleClicked(const QModelIndex & index) { MediaFileRef file = play_list->fileForIndex(proxy_model->mapToSource(index)); if (!file.path().isEmpty()) doubleClicked(file); }
void QFieldContainerView::fillTable(const FieldContainerPtr &pFC, UInt32 uiAspect) { UInt32 uiNumFields = pFC->getType().getNumFieldDescs(); _pTable->setNumRows(uiNumFields); for(UInt32 i = 0; i < uiNumFields; ++i) { if(pFC->getField(i+1)->getCardinality() == FieldType::SINGLE_FIELD) { QSFieldView *pSFView = new QSFieldView(pFC, i+1, uiAspect, this); _pTable->setCellWidget(i, ValueColumn, pSFView ); #if (QT_VERSION < 0x030301) || (QT_VERSION < 304) _pTable->setItem (i, ValueColumn, new QWidgetTableItem(_pTable)); #endif connect(pSFView, SIGNAL(clicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState)), this, SLOT (onClicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState))); connect(pSFView, SIGNAL(doubleClicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState)), this, SLOT (onDoubleClicked(FieldContainerPtr, UInt32, UInt32, Qt::ButtonState))); _pTable->setText(i, NameColumn, pFC->getType().getFieldDescription(i+1)->getCName()); } else { QMFieldView *pMFView = new QMFieldView(pFC, i+1, uiAspect, this); _pTable->setCellWidget(i, ValueColumn, pMFView ); #if (QT_VERSION < 0x030302) || (QT_VERSION < 304) _pTable->setItem (i, ValueColumn, new QWidgetTableItem(_pTable)); #endif connect(pMFView, SIGNAL(clicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState)), this, SLOT (onClicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState))); connect(pMFView, SIGNAL(doubleClicked (FieldContainerPtr, UInt32, UInt32, Qt::ButtonState)), this, SLOT (onDoubleClicked(FieldContainerPtr, UInt32, UInt32, Qt::ButtonState))); QString s(pFC->getType().getFieldDescription(i+1)->getCName()); if(pMFView->getFieldPtr()->getSize() >= 2) { s += "\n"; QString num; num.setNum(pMFView->getFieldPtr()->getSize()); s += num; } _pTable->setText(i, NameColumn, s); } _pTable->setText(i, TypeColumn, pFC->getField(i+1)->getType().getCName()); } for(UInt32 i=0; i<uiNumFields; ++i) _pTable->adjustRow(i); _pTable->adjustColumn(NameColumn ); _pTable->adjustColumn(ValueColumn); if(_bShowTypeColumn) { _pTable->showColumn (TypeColumn); _pTable->adjustColumn(TypeColumn); } else { _pTable->hideColumn(TypeColumn); } }
void XLineEdit::mouseDoubleClickEvent(QMouseEvent *event) { emit doubleClicked(); QLineEdit::mouseDoubleClickEvent(event); }
// Initialize the dialog widgets and connect the signals/slots void SatellitesDialog::createDialogContent() { ui->setupUi(dialog); ui->tabs->setCurrentIndex(0); ui->labelAutoAdd->setVisible(false); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); Satellites* plugin = GETSTELMODULE(Satellites); // Settings tab / updates group // These controls are refreshed by updateSettingsPage(), which in // turn is triggered by setting any of these values. Because // clicked() is issued only by user input, there's no endless loop. connect(ui->internetUpdatesCheckbox, SIGNAL(clicked(bool)), plugin, SLOT(enableInternetUpdates(bool))); connect(ui->checkBoxAutoAdd, SIGNAL(clicked(bool)), plugin, SLOT(enableAutoAdd(bool))); connect(ui->checkBoxAutoRemove, SIGNAL(clicked(bool)), plugin, SLOT(enableAutoRemove(bool))); connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), plugin, SLOT(setUpdateFrequencyHours(int))); connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateTLEs())); connect(ui->jumpToSourcesButton, SIGNAL(clicked()), this, SLOT(jumpToSourcesTab())); connect(plugin, SIGNAL(updateStateChanged(Satellites::UpdateState)), this, SLOT(showUpdateState(Satellites::UpdateState))); connect(plugin, SIGNAL(tleUpdateComplete(int, int, int, int)), this, SLOT(showUpdateCompleted(int, int, int, int))); updateTimer = new QTimer(this); connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateCountdown())); updateTimer->start(7000); // Settings tab / General settings group // This does call Satellites::setFlagLabels() indirectly. QAction* action = dynamic_cast<StelGui*>(StelApp::getInstance().getGui())->getGuiAction("actionShow_Satellite_Labels"); connect(ui->labelsGroup, SIGNAL(clicked(bool)), action, SLOT(setChecked(bool))); connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), plugin, SLOT(setLabelFontSize(int))); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings())); // Settings tab / orbit lines group connect(ui->orbitLinesGroup, SIGNAL(clicked(bool)), plugin, SLOT(setOrbitLinesFlag(bool))); connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams())); // Settings tab - populate all values updateSettingsPage(); // Satellites tab filterModel = new SatellitesListFilterModel(this); filterModel->setSourceModel(GETSTELMODULE(Satellites)->getSatellitesListModel()); filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); ui->satellitesList->setModel(filterModel); connect(ui->lineEditSearch, SIGNAL(textEdited(QString)), filterModel, SLOT(setFilterWildcard(QString))); QItemSelectionModel* selectionModel = ui->satellitesList->selectionModel(); connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateSatelliteData())); connect(ui->satellitesList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(trackSatellite(QModelIndex))); // Two-state input, three-state display connect(ui->displayedCheckbox, SIGNAL(clicked(bool)), ui->displayedCheckbox, SLOT(setChecked(bool))); connect(ui->orbitCheckbox, SIGNAL(clicked(bool)), ui->orbitCheckbox, SLOT(setChecked(bool))); connect(ui->userCheckBox, SIGNAL(clicked(bool)), ui->userCheckBox, SLOT(setChecked(bool))); // Because the previous signals and slots were connected first, // they will be executed before these. connect(ui->displayedCheckbox, SIGNAL(clicked()), this, SLOT(setFlags())); connect(ui->orbitCheckbox, SIGNAL(clicked()), this, SLOT(setFlags())); connect(ui->userCheckBox, SIGNAL(clicked()), this, SLOT(setFlags())); connect(ui->groupsListWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(handleGroupChanges(QListWidgetItem*))); connect(ui->groupFilterCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(filterListByGroup(int))); connect(ui->saveSatellitesButton, SIGNAL(clicked()), this, SLOT(saveSatellites())); connect(ui->removeSatellitesButton, SIGNAL(clicked()), this, SLOT(removeSatellites())); importWindow = new SatellitesImportDialog(); connect(ui->addSatellitesButton, SIGNAL(clicked()), importWindow, SLOT(setVisible())); connect(importWindow, SIGNAL(satellitesAccepted(TleDataList)), this, SLOT(addSatellites(TleDataList))); // Sources tab connect(ui->sourceList, SIGNAL(currentTextChanged(const QString&)), ui->sourceEdit, SLOT(setText(const QString&))); connect(ui->sourceList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(saveSourceList())); connect(ui->sourceEdit, SIGNAL(editingFinished()), this, SLOT(saveEditedSource())); connect(ui->deleteSourceButton, SIGNAL(clicked()), this, SLOT(deleteSourceRow())); connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow())); connect(plugin, SIGNAL(settingsChanged()), this, SLOT(toggleCheckableSources())); // About tab populateAboutPage(); populateFilterMenu(); populateSourcesList(); }
TransactionView::TransactionView(QWidget *parent) : QWidget(parent), model(0), transactionProxyModel(0), transactionView(0) { // Build filter row setContentsMargins(0,0,0,0); QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); #ifdef Q_OS_MAC hlayout->setSpacing(5); hlayout->addSpacing(0); #else hlayout->setSpacing(0); hlayout->addSpacing(0); #endif dateWidget = new QComboBox(this); dateWidget->setContentsMargins(1,1,1,1); #ifdef Q_OS_MAC dateWidget->setFixedWidth(121); #else dateWidget->setFixedWidth(120); #endif dateWidget->setContentsMargins(1,1,1,1); dateWidget->addItem(tr("All"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); dateWidget->addItem(tr("Range..."), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); #ifdef Q_OS_MAC typeWidget->setFixedWidth(121); #else typeWidget->setFixedWidth(120); #endif typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther)); typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) | TransactionFilterProxy::TYPE(TransactionRecord::SendToOther)); typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); typeWidget->setContentsMargins(1,1,1,1); hlayout->addWidget(typeWidget); addressWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 /* Do not move this to the XML file, Qt before 4.7 will choke on it */ addressWidget->setPlaceholderText(tr("Enter address or label to search")); addressWidget->setContentsMargins(1,1,1,1); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 /* Do not move this to the XML file, Qt before 4.7 will choke on it */ amountWidget->setPlaceholderText(tr("Min amount")); amountWidget->setContentsMargins(1,1,1,1); #endif #ifdef Q_OS_MAC amountWidget->setFixedWidth(97); #else amountWidget->setFixedWidth(100); #endif amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setContentsMargins(0,0,0,0); vlayout->setSpacing(0); QTableView *view = new QTableView(this); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); view->setAlternatingRowColors(false); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing #ifdef Q_OS_MAC hlayout->addSpacing(width+2); #else hlayout->addSpacing(width); #endif // Always show scroll bar view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); transactionView = view; // Actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyAmountAction = new QAction(tr("Copy amount"), this); QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction *editLabelAction = new QAction(tr("Edit label"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); QAction *viewOnPandachain = new QAction(tr("Show transaction on the Netcoin Block Explorer"), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addSeparator(); contextMenu->addAction(editLabelAction); contextMenu->addAction(showDetailsAction); contextMenu->addSeparator(); contextMenu->addAction(viewOnPandachain); // Connect actions connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex))); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); connect(viewOnPandachain, SIGNAL(triggered()), this, SLOT(viewOnPandachain())); }
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("AndroidsToken") + " - " + tr("Wallet")); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
TransactionView::TransactionView(QWidget *parent) : QWidget(parent), model(0), transactionProxyModel(0), transactionView(0) { // Build filter row setContentsMargins(0,0,0,0); QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); #ifdef Q_OS_MAC hlayout->setSpacing(5); hlayout->addSpacing(26); #else hlayout->setSpacing(0); hlayout->addSpacing(23); #endif watchOnlyWidget = new QComboBox(this); watchOnlyWidget->setFixedWidth(24); watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All); watchOnlyWidget->addItem(SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes); watchOnlyWidget->addItem(SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No); hlayout->addWidget(watchOnlyWidget); dateWidget = new QComboBox(this); #ifdef Q_OS_MAC dateWidget->setFixedWidth(121); #else dateWidget->setFixedWidth(120); #endif dateWidget->addItem(tr("All"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); dateWidget->addItem(tr("This month"), ThisMonth); dateWidget->addItem(tr("Last month"), LastMonth); dateWidget->addItem(tr("This year"), ThisYear); dateWidget->addItem(tr("Range..."), Range); hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); #ifdef Q_OS_MAC typeWidget->setFixedWidth(121); #else typeWidget->setFixedWidth(120); #endif typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther)); typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) | TransactionFilterProxy::TYPE(TransactionRecord::SendToOther)); typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf)); typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated)); typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other)); hlayout->addWidget(typeWidget); addressWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 addressWidget->setPlaceholderText(tr("Enter address or label to search")); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 amountWidget->setPlaceholderText(tr("Min amount")); #endif #ifdef Q_OS_MAC amountWidget->setFixedWidth(97); #else amountWidget->setFixedWidth(100); #endif amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setContentsMargins(0,0,0,0); vlayout->setSpacing(0); QTableView *view = new QTableView(this); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); vlayout->addWidget(view); vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing #ifdef Q_OS_MAC hlayout->addSpacing(width+2); #else hlayout->addSpacing(width); #endif // Always show scroll bar view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view->setTabKeyNavigation(false); view->setContextMenuPolicy(Qt::CustomContextMenu); view->installEventFilter(this); transactionView = view; // Actions QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyAmountAction = new QAction(tr("Copy amount"), this); QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); QAction *editLabelAction = new QAction(tr("Edit label"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyTxIDAction); contextMenu->addAction(editLabelAction); contextMenu->addAction(showDetailsAction); mapperThirdPartyTxUrls = new QSignalMapper(this); // Connect actions connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString))); connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int))); connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString))); connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString))); connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex))); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("Zimstake") + " - " + tr("Wallet")); #ifndef Q_OS_MAC qApp->setWindowIcon(QIcon(":icons/zimstake")); setWindowIcon(QIcon(":icons/zimstake")); #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(); blockExplorer = new BlockExplorer(this); chatWindow = new ChatWindow(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(blockExplorer); centralWidget->addWidget(chatWindow); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (GetBoolArg("-staking", true)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = qApp->style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { //statusBar()->setObjectName("QProgressBar"); } 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(); }
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QDialog(parent), ui(new Ui::AddressBookPage), model(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->exportButton->setIcon(QIcon()); #endif switch(mode) { case ForSelection: switch(tab) { case SendingTab: setWindowTitle(tr("Choose the address to send coins to")); break; case ReceivingTab: setWindowTitle(tr("Choose the address to receive coins with")); break; } connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); ui->closeButton->setText(tr("C&hoose")); ui->exportButton->hide(); break; case ForEditing: switch(tab) { case SendingTab: setWindowTitle(tr("Sending addresses")); break; case ReceivingTab: setWindowTitle(tr("Receiving addresses")); break; } break; } switch(tab) { case SendingTab: ui->labelExplanation->setText(tr("These are your JMAGcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.")); ui->deleteAddress->setVisible(true); break; case ReceivingTab: ui->labelExplanation->setText(tr("These are your JMAGcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.")); ui->deleteAddress->setVisible(false); break; } // Context menu actions QAction *copyAddressAction = new QAction(tr("&Copy Address"), this); QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *editAction = new QAction(tr("&Edit"), 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(); // 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(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(accept())); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), unlockForMintingAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("DigiCube Wallet")); #ifndef Q_WS_MAC setWindowIcon(QIcon(":icons/DigiCube_icon")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); mintingPage = new QWidget(this); QVBoxLayout *vboxMinting = new QVBoxLayout(); mintingView = new MintingView(this); vboxMinting->addWidget(mintingView); mintingPage->setLayout(vboxMinting); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); onthewebPage = new Ontheweb(this); messagePage = new SignVerifyMessageDialog(this); multisigPage = new MultisigDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(mintingPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); centralWidget->addWidget(onthewebPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(messagePage); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(56); frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); gotoOverviewPage(); }
int Q3IconView::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = Q3ScrollView::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: selectionChanged(); break; case 1: selectionChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 2: currentChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 3: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 4: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 5: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 6: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 7: doubleClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 8: returnPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 9: rightButtonClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 10: rightButtonPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 11: mouseButtonPressed((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break; case 12: mouseButtonClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break; case 13: contextMenuRequested((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break; case 14: dropped((*reinterpret_cast< QDropEvent*(*)>(_a[1])),(*reinterpret_cast< const Q3ValueList<Q3IconDragItem>(*)>(_a[2]))); break; case 15: moved(); break; case 16: onItem((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 17: onViewport(); break; case 18: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break; case 19: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break; case 20: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 21: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1]))); break; case 22: arrangeItemsInGrid((*reinterpret_cast< bool(*)>(_a[1]))); break; case 23: arrangeItemsInGrid(); break; case 24: setContentsPos((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 25: updateContents(); break; case 26: doAutoScroll(); break; case 27: adjustItems(); break; case 28: slotUpdate(); break; case 29: movedContents((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; } _id -= 30; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = sorting(); break; case 1: *reinterpret_cast< bool*>(_v) = sortDirection(); break; case 2: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break; case 3: *reinterpret_cast< int*>(_v) = gridX(); break; case 4: *reinterpret_cast< int*>(_v) = gridY(); break; case 5: *reinterpret_cast< int*>(_v) = spacing(); break; case 6: *reinterpret_cast< ItemTextPos*>(_v) = itemTextPos(); break; case 7: *reinterpret_cast< QBrush*>(_v) = itemTextBackground(); break; case 8: *reinterpret_cast< Arrangement*>(_v) = arrangement(); break; case 9: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break; case 10: *reinterpret_cast< int*>(_v) = maxItemWidth(); break; case 11: *reinterpret_cast< int*>(_v) = maxItemTextLength(); break; case 12: *reinterpret_cast< bool*>(_v) = autoArrange(); break; case 13: *reinterpret_cast< bool*>(_v) = itemsMovable(); break; case 14: *reinterpret_cast< bool*>(_v) = wordWrapIconText(); break; case 15: *reinterpret_cast< bool*>(_v) = showToolTips(); break; case 16: *reinterpret_cast< uint*>(_v) = count(); break; } _id -= 17; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 2: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break; case 3: setGridX(*reinterpret_cast< int*>(_v)); break; case 4: setGridY(*reinterpret_cast< int*>(_v)); break; case 5: setSpacing(*reinterpret_cast< int*>(_v)); break; case 6: setItemTextPos(*reinterpret_cast< ItemTextPos*>(_v)); break; case 7: setItemTextBackground(*reinterpret_cast< QBrush*>(_v)); break; case 8: setArrangement(*reinterpret_cast< Arrangement*>(_v)); break; case 9: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break; case 10: setMaxItemWidth(*reinterpret_cast< int*>(_v)); break; case 11: setMaxItemTextLength(*reinterpret_cast< int*>(_v)); break; case 12: setAutoArrange(*reinterpret_cast< bool*>(_v)); break; case 13: setItemsMovable(*reinterpret_cast< bool*>(_v)); break; case 14: setWordWrapIconText(*reinterpret_cast< bool*>(_v)); break; case 15: setShowToolTips(*reinterpret_cast< bool*>(_v)); break; } _id -= 17; } else if (_c == QMetaObject::ResetProperty) { _id -= 17; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 17; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 17; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 17; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 17; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 17; } #endif // QT_NO_PROPERTIES return _id; }