void EditWidget::EditTasks() { setCurrentWidget(subtaskWidget); }
void WalletView::gotoHistoryPage() { gui->getHistoryAction()->setChecked(true); setCurrentWidget(transactionsPage); }
void WalletView::gotoMultiSigPage() { gui->getMultiSigAction()->setChecked(true); setCurrentWidget(multiSigPage); }
void WalletView::gotoNewsPage() { gui->getNewsAction()->setChecked(true); setCurrentWidget(newsPage); }
void DatabaseTabWidget::lockDatabases() { clipboard()->clearCopiedText(); for (int i = 0; i < count(); i++) { DatabaseWidget* dbWidget = static_cast<DatabaseWidget*>(widget(i)); Database* db = databaseFromDatabaseWidget(dbWidget); DatabaseWidget::Mode mode = dbWidget->currentMode(); if ((mode != DatabaseWidget::ViewMode && mode != DatabaseWidget::EditMode) || !dbWidget->dbHasKey()) { continue; } // show the correct tab widget before we are asking questions about it setCurrentWidget(dbWidget); if (mode == DatabaseWidget::EditMode) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("Can't lock the database as you are currently editing it.\nPlease press cancel to finish your changes or discard them."), QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Cancel) { continue; } } if (m_dbList[db].modified && !m_dbList[db].saveToFilename) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("This database has never been saved.\nYou can save the database or stop locking it."), QMessageBox::Save | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Save) { if (!saveDatabase(db)) { continue; } } else if (result == QMessageBox::Cancel) { continue; } } else if (m_dbList[db].modified) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("This database has been modified.\nDo you want to save the database before locking it?\nOtherwise your changes are lost."), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Save) { if (!saveDatabase(db)) { continue; } } else if (result == QMessageBox::Discard) { m_dbList[db].modified = false; } else if (result == QMessageBox::Cancel) { continue; } } dbWidget->lock(); // database has changed so we can't use the db variable anymore updateTabName(dbWidget->database()); } }
void CentralWin::setSendPage() { setCurrentWidget(sendp); }
void CentralWin::setSettingPage() { setCurrentWidget(settingp); }
void PlayQueueView::setMode(ItemView::Mode m) { if (m==mode || (ItemView::Mode_GroupedTree!=m && ItemView::Mode_Table!=m)) { return; } if (ItemView::Mode_Table==mode) { treeView->saveHeader(); } switch (m) { case ItemView::Mode_GroupedTree: if (!groupedView) { groupedView=new PlayQueueGroupedView(this); groupedView->setContextMenuPolicy(Qt::ActionsContextMenu); groupedView->setIndentation(0); groupedView->setItemsExpandable(false); groupedView->setExpandsOnDoubleClick(false); groupedView->installFilter(new KeyEventHandler(groupedView, removeFromAction)); addWidget(groupedView); connect(groupedView, SIGNAL(itemsSelected(bool)), SIGNAL(itemsSelected(bool))); connect(groupedView, SIGNAL(doubleClicked(const QModelIndex &)), SIGNAL(doubleClicked(const QModelIndex &))); updatePalette(); #ifdef Q_OS_MAC groupedView->setAttribute(Qt::WA_MacShowFocusRect, 0); #endif groupedView->setProperty(ProxyStyle::constModifyFrameProp, ProxyStyle::VF_Top); } break; case ItemView::Mode_Table: if (!treeView) { treeView=new PlayQueueTreeView(this); treeView->setContextMenuPolicy(Qt::ActionsContextMenu); treeView->installFilter(new KeyEventHandler(treeView, removeFromAction)); treeView->initHeader(); addWidget(treeView); connect(treeView, SIGNAL(itemsSelected(bool)), SIGNAL(itemsSelected(bool))); connect(treeView, SIGNAL(doubleClicked(const QModelIndex &)), SIGNAL(doubleClicked(const QModelIndex &))); updatePalette(); #ifdef Q_OS_MAC treeView->setAttribute(Qt::WA_MacShowFocusRect, 0); #endif treeView->setProperty(ProxyStyle::constModifyFrameProp, ProxyStyle::VF_Top); } default: break; } QAbstractItemModel *model=0; QList<QAction *> actions; if (ItemView::Mode_Count!=mode) { QAbstractItemView *v=view(); model=v->model(); v->setModel(0); actions=v->actions(); } mode=m; QAbstractItemView *v=view(); v->setModel(model); if (!actions.isEmpty() && v->actions().isEmpty()) { v->addActions(actions); } if (ItemView::Mode_Table==mode) { treeView->initHeader(); } setCurrentWidget(static_cast<QWidget *>(view())); if (spinner) { spinner->setWidget(view()); if (spinner->isActive()) { spinner->start(); } } if (msgOverlay) { msgOverlay->setWidget(view()); } }
void WalletView::gotoChartPage() { gui->getChartAction()->setChecked(true); setCurrentWidget(chartPage); }
void WalletView::gotoDecisionPage() { setCurrentWidget(decisionPage); }
void WalletView::gotoMarketPage() { setCurrentWidget(marketPage); }
void WalletView::gotoBallotPage() { setCurrentWidget(ballotPage); }
void WalletView::gotoBlockBrowser() { gui->getBlockAction()->setChecked(true); setCurrentWidget(blockBrowser); }
void WalletView::gotoMiningPage() { gui->getMiningAction()->setChecked(true); setCurrentWidget(miningPage); }
void WalletView::gotoReceiveCoinsPage() { setCurrentWidget(receiveCoinsPage); }
void KNEmptyStateWidget::showEmptyWidget() { //Display the empty state widget. setCurrentWidget(m_emptyWidget); }
void WalletView::gotoZerocoinPage() { gui->getZerocoinAction()->setChecked(true); setCurrentWidget(zerocoinPage); }
void KNEmptyStateWidget::showContentWidget() { //Display the content widget. setCurrentWidget(m_contentWidget); }
void CentralWin::setListenPage() { setCurrentWidget(listenp); }
DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) : QStackedWidget(parent) , m_db(db) , m_searchUi(new Ui::SearchWidget()) , m_searchWidget(new QWidget()) , m_newGroup(Q_NULLPTR) , m_newEntry(Q_NULLPTR) , m_newParent(Q_NULLPTR) { m_searchUi->setupUi(m_searchWidget); m_searchTimer = new QTimer(this); m_searchTimer->setSingleShot(true); m_mainWidget = new QWidget(this); QLayout* layout = new QHBoxLayout(m_mainWidget); m_splitter = new QSplitter(m_mainWidget); m_splitter->setChildrenCollapsible(false); QWidget* rightHandSideWidget = new QWidget(m_splitter); m_searchWidget->setParent(rightHandSideWidget); m_groupView = new GroupView(db, m_splitter); m_groupView->setObjectName("groupView"); m_groupView->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_groupView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(emitGroupContextMenuRequested(QPoint))); m_entryView = new EntryView(rightHandSideWidget); m_entryView->setObjectName("entryView"); m_entryView->setContextMenuPolicy(Qt::CustomContextMenu); m_entryView->setGroup(db->rootGroup()); connect(m_entryView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(emitEntryContextMenuRequested(QPoint))); QAction* closeAction = new QAction(m_searchWidget); QIcon closeIcon = filePath()->icon("actions", "dialog-close"); closeAction->setIcon(closeIcon); m_searchUi->closeSearchButton->setDefaultAction(closeAction); m_searchUi->closeSearchButton->setShortcut(Qt::Key_Escape); m_searchWidget->hide(); m_searchUi->caseSensitiveCheckBox->setVisible(false); QVBoxLayout* vLayout = new QVBoxLayout(rightHandSideWidget); vLayout->setMargin(0); vLayout->addWidget(m_searchWidget); vLayout->addWidget(m_entryView); rightHandSideWidget->setLayout(vLayout); setTabOrder(m_searchUi->searchRootRadioButton, m_entryView); setTabOrder(m_entryView, m_groupView); setTabOrder(m_groupView, m_searchWidget); m_splitter->addWidget(m_groupView); m_splitter->addWidget(rightHandSideWidget); m_splitter->setStretchFactor(0, 30); m_splitter->setStretchFactor(1, 70); layout->addWidget(m_splitter); m_mainWidget->setLayout(layout); m_editEntryWidget = new EditEntryWidget(); m_editEntryWidget->setObjectName("editEntryWidget"); m_historyEditEntryWidget = new EditEntryWidget(); m_editGroupWidget = new EditGroupWidget(); m_editGroupWidget->setObjectName("editGroupWidget"); m_changeMasterKeyWidget = new ChangeMasterKeyWidget(); m_changeMasterKeyWidget->headlineLabel()->setText(tr("Change master key")); QFont headlineLabelFont = m_changeMasterKeyWidget->headlineLabel()->font(); headlineLabelFont.setBold(true); headlineLabelFont.setPointSize(headlineLabelFont.pointSize() + 2); m_changeMasterKeyWidget->headlineLabel()->setFont(headlineLabelFont); m_databaseSettingsWidget = new DatabaseSettingsWidget(); m_databaseSettingsWidget->setObjectName("databaseSettingsWidget"); m_databaseOpenWidget = new DatabaseOpenWidget(); m_databaseOpenWidget->setObjectName("databaseOpenWidget"); m_keepass1OpenWidget = new KeePass1OpenWidget(); m_keepass1OpenWidget->setObjectName("keepass1OpenWidget"); m_unlockDatabaseWidget = new UnlockDatabaseWidget(); m_unlockDatabaseWidget->setObjectName("unlockDatabaseWidget"); addWidget(m_mainWidget); addWidget(m_editEntryWidget); addWidget(m_editGroupWidget); addWidget(m_changeMasterKeyWidget); addWidget(m_databaseSettingsWidget); addWidget(m_historyEditEntryWidget); addWidget(m_databaseOpenWidget); addWidget(m_keepass1OpenWidget); addWidget(m_unlockDatabaseWidget); connect(m_splitter, SIGNAL(splitterMoved(int,int)), SIGNAL(splitterSizesChanged())); connect(m_entryView->header(), SIGNAL(sectionResized(int,int,int)), SIGNAL(entryColumnSizesChanged())); connect(m_groupView, SIGNAL(groupChanged(Group*)), this, SLOT(clearLastGroup(Group*))); connect(m_groupView, SIGNAL(groupChanged(Group*)), SIGNAL(groupChanged())); connect(m_groupView, SIGNAL(groupChanged(Group*)), m_entryView, SLOT(setGroup(Group*))); connect(m_entryView, SIGNAL(entryActivated(Entry*, EntryModel::ModelColumn)), SLOT(entryActivationSignalReceived(Entry*, EntryModel::ModelColumn))); connect(m_entryView, SIGNAL(entrySelectionChanged()), SIGNAL(entrySelectionChanged())); connect(m_editEntryWidget, SIGNAL(editFinished(bool)), SLOT(switchToView(bool))); connect(m_editEntryWidget, SIGNAL(historyEntryActivated(Entry*)), SLOT(switchToHistoryView(Entry*))); connect(m_historyEditEntryWidget, SIGNAL(editFinished(bool)), SLOT(switchBackToEntryEdit())); connect(m_editGroupWidget, SIGNAL(editFinished(bool)), SLOT(switchToView(bool))); connect(m_changeMasterKeyWidget, SIGNAL(editFinished(bool)), SLOT(updateMasterKey(bool))); connect(m_databaseSettingsWidget, SIGNAL(editFinished(bool)), SLOT(switchToView(bool))); connect(m_databaseOpenWidget, SIGNAL(editFinished(bool)), SLOT(openDatabase(bool))); connect(m_keepass1OpenWidget, SIGNAL(editFinished(bool)), SLOT(openDatabase(bool))); connect(m_unlockDatabaseWidget, SIGNAL(editFinished(bool)), SLOT(unlockDatabase(bool))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(emitCurrentModeChanged())); connect(m_searchUi->searchEdit, SIGNAL(textChanged(QString)), this, SLOT(startSearchTimer())); connect(m_searchUi->caseSensitiveCheckBox, SIGNAL(toggled(bool)), this, SLOT(startSearch())); connect(m_searchUi->searchCurrentRadioButton, SIGNAL(toggled(bool)), this, SLOT(startSearch())); connect(m_searchUi->searchRootRadioButton, SIGNAL(toggled(bool)), this, SLOT(startSearch())); connect(m_searchUi->searchEdit, SIGNAL(returnPressed()), m_entryView, SLOT(setFocus())); connect(m_searchTimer, SIGNAL(timeout()), this, SLOT(search())); connect(closeAction, SIGNAL(triggered()), this, SLOT(closeSearch())); connect( &m_file_watcher, SIGNAL( fileChanged() ), this, SLOT( databaseModifedExternally() ) ); setCurrentWidget(m_mainWidget); }
void CentralWin::setHelpPage() { setCurrentWidget(helpp); }
bool TabWidget::eventFilter(QObject *obj, QEvent *event) { if (obj==tabBar()) { // this code handles the tab movement if (event->type() == QEvent::Leave) { QPoint point = cross->mapToGlobal( QPoint(0, 0) ); QRect rect(point.x(), point.y(), cross->width(), cross->height() ); if ( !rect.contains( QCursor::pos() ) ) cross->hide(); } else if (event->type() == QEvent::HoverMove && m_closeButtonInTabs ) { QHoverEvent *mouseEvent = static_cast<QHoverEvent *>(event); mousePos = mouseEvent->pos(); for (int i=0; i<tabBar()->count(); i++) { if ( tabBar()->tabRect(i).contains( mouseEvent->pos() ) ) { m_clickedItem= i; break; } } cross->setGeometry(tabBar()->tabRect(m_clickedItem).x()+tabBar()->tabRect(m_clickedItem).width()-cross->width()-5, //tabBar()->height()-(tabBar()->tabRect(m_clickedItem).height()/2), 5, cross->width(), cross->height()); cross->show(); } else if (event->type() == QEvent::MouseButtonRelease ) { qApp->restoreOverrideCursor(); } else if (event->type() == QEvent::MouseButtonPress ) { QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); for (int i=0; i<tabBar()->count(); i++) { if ( tabBar()->tabRect(i).contains( mouseEvent->pos() ) ) { m_clickedItem = i; break; } } if ( mouseEvent->button() == Qt::LeftButton ) qApp->setOverrideCursor( Qt::OpenHandCursor ); if ( mouseEvent->button() == Qt::RightButton ) { QMenu *menu = new QMenu(this); connect(menu->addAction(QIcon(":/images/cross.png"), tr("Close Tab")), SIGNAL(triggered()), this, SLOT(slotCloseTab()) ); connect(menu->addAction(QIcon(":/images/fileclose.png"), tr("Close Other Tabs")), SIGNAL(triggered()), this, SLOT(slotCloseOtherTab()) ); connect(menu->addAction(QIcon(":/images/fileclose.png"), tr("Close All Tabs")), SIGNAL(triggered()), this, SLOT(slotCloseAllTab()) ); menu->exec(mouseEvent->globalPos()); delete menu; } } else if (event->type() == QEvent::MouseMove ) { QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); for (int i=0; i<tabBar()->count(); i++) { if ( tabBar()->tabRect(i).contains( mouseEvent->pos() ) ) { if ( swapTabs(i, m_clickedItem) ) { setCurrentWidget(widget(i)); update(); int x; if ( !tabBar()->tabRect(i).contains( mouseEvent->pos() ) ) { if ( tabBar()->tabRect(m_clickedItem).x() < tabBar()->tabRect(i).x() ) x = tabBar()->tabRect(i).x(); else x = tabBar()->tabRect(i).x()+(tabBar()->tabRect(i).width()-(qAbs(tabBar()->tabRect(i).width()-tabBar()->tabRect(m_clickedItem).width()))); QPoint point = QPoint( x, mouseEvent->pos().y() ); point = widget(i)->mapToGlobal( point ); m_clickedItem = i; QCursor::setPos ( point.x(), QCursor::pos().y() ); } m_clickedItem = i; break; } } } } } return QTabWidget::eventFilter( obj, event); }
void WalletView::gotoVoteCoinsPage() { gui->getVoteCoinsAction()->setChecked(true); setCurrentWidget(voteCoinsPage); }
void SeparateTabWidget::setPreviousTab () { setCurrentWidget (PreviousWidget_); }
void WalletView::gotoOverviewPage() { gui->getOverviewAction()->setChecked(true); setCurrentWidget(overviewPage); }
void WalletView::gotoOverviewPage() { setCurrentWidget(overviewPage); }
void WalletView::gotoAddressBookPage() { gui->getAddressBookAction()->setChecked(true); setCurrentWidget(addressBookPage); }
void WalletView::gotoHistoryPage() { setCurrentWidget(transactionsPage); }
void WalletView::gotoReceiveCoinsPage() { gui->getReceiveCoinsAction()->setChecked(true); setCurrentWidget(receiveCoinsPage); }
void fluid_menu::switchToMenu() { setCurrentWidget(pictureFlowWidget); }