mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-06 14:07:38 +03:00
Replace MessageBox with MessageWidget in remaining classes.
Chnage to one method to set MessageWidget text passing type as parameter. Only messages with questions requiring user input reamin using MessageBox dialog. Use signal/slots to set message in MessageWidget and hide message, signal/slots only used when required.Maybe need to change all calls to signals/slots in the future.
This commit is contained in:
parent
c2826bb1af
commit
13c85cdfcb
20 changed files with 169 additions and 77 deletions
|
@ -104,6 +104,7 @@ MainWindow::MainWindow()
|
|||
#endif
|
||||
|
||||
setWindowIcon(filePath()->applicationIcon());
|
||||
m_ui->globalMessageWidget->setHidden(true);
|
||||
QAction* toggleViewAction = m_ui->toolBar->toggleViewAction();
|
||||
toggleViewAction->setText(tr("Show toolbar"));
|
||||
m_ui->menuView->addAction(toggleViewAction);
|
||||
|
@ -277,6 +278,11 @@ MainWindow::MainWindow()
|
|||
|
||||
connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog()));
|
||||
|
||||
connect(m_ui->tabWidget, SIGNAL(messageGlobal(QString,MessageWidget::MessageType)), this, SLOT(displayGlobalMessage(QString, MessageWidget::MessageType)));
|
||||
connect(m_ui->tabWidget, SIGNAL(messageDismissGlobal()), this, SLOT(hideGlobalMessage()));
|
||||
connect(m_ui->tabWidget, SIGNAL(messageTab(QString,MessageWidget::MessageType)), this, SLOT(displayTabMessage(QString, MessageWidget::MessageType)));
|
||||
connect(m_ui->tabWidget, SIGNAL(messageDismissTab()), this, SLOT(hideTabMessage()));
|
||||
|
||||
updateTrayIcon();
|
||||
}
|
||||
|
||||
|
@ -787,3 +793,28 @@ bool MainWindow::isTrayIconEnabled() const
|
|||
&& QSystemTrayIcon::isSystemTrayAvailable();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::displayGlobalMessage(const QString& text, MessageWidget::MessageType type)
|
||||
{
|
||||
m_ui->globalMessageWidget->showMessage(text, type);
|
||||
}
|
||||
|
||||
void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type)
|
||||
{
|
||||
//if (m_ui->stackedWidget->currentIndex() == 0) {
|
||||
m_ui->tabWidget->currentDatabaseWidget()->showMessage(text, type);
|
||||
//}
|
||||
}
|
||||
|
||||
void MainWindow::hideGlobalMessage()
|
||||
{
|
||||
m_ui->globalMessageWidget->hideMessage();
|
||||
}
|
||||
|
||||
void MainWindow::hideTabMessage()
|
||||
{
|
||||
if (m_ui->stackedWidget->currentIndex() == 0) {
|
||||
m_ui->tabWidget->currentDatabaseWidget()->hideMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue