@@ -4425,7 +4425,7 @@ void MainWindow::searchInNoteTextEdit(QString str) {
44254425 QList<QTextEdit::ExtraSelection> extraSelections2;
44264426 QList<QTextEdit::ExtraSelection> extraSelections3;
44274427
4428- if (str.count () >= 2 ) {
4428+ if (str.size () >= 2 ) {
44294429 // do an in-note search
44304430 doSearchInNote (str);
44314431 ui->noteTextEdit ->moveCursor (QTextCursor::Start);
@@ -5545,12 +5545,19 @@ void MainWindow::showAppMetricsNotificationIfNeeded() {
55455545 if (showDialog) {
55465546 settings.setValue (QStringLiteral (" appMetrics/notificationShown" ), true );
55475547
5548- if (QMessageBox::information (this , QStringLiteral (" QOwnNotes" ),
5549- tr (" QOwnNotes will track anonymous usage data, that helps to "
5550- " decide what parts of QOwnNotes to improve next "
5551- " and to find and fix bugs. You can disable that "
5552- " behaviour in the settings." ),
5553- tr (" &Ok" ), tr (" Open &settings" ), QString (), 0 , 1 ) == 1 ) {
5548+ QMessageBox msgBox (QMessageBox::Information, QStringLiteral (" QOwnNotes" ),
5549+ tr (" QOwnNotes will track anonymous usage data, that helps to "
5550+ " decide what parts of QOwnNotes to improve next "
5551+ " and to find and fix bugs. You can disable that "
5552+ " behaviour in the settings." ),
5553+ QMessageBox::NoButton, this );
5554+ QPushButton *okButton = msgBox.addButton (tr (" &Ok" ), QMessageBox::AcceptRole);
5555+ QPushButton *settingsButton =
5556+ msgBox.addButton (tr (" Open &settings" ), QMessageBox::ActionRole);
5557+ msgBox.setDefaultButton (settingsButton);
5558+ msgBox.exec ();
5559+
5560+ if (msgBox.clickedButton () == settingsButton) {
55545561 openSettingsDialog (SettingsDialog::NetworkPage);
55555562 }
55565563 }
@@ -5561,11 +5568,18 @@ void MainWindow::showAppMetricsNotificationIfNeeded() {
55615568 */
55625569void MainWindow::openTodoDialog (const QString &taskUid) {
55635570 if (!OwnCloudService::isTodoCalendarSupportEnabled ()) {
5564- if (QMessageBox::warning (nullptr , tr (" Todo lists disabled!" ),
5565- tr (" You have disabled the todo lists.<br />"
5566- " Please check your <strong>Todo</strong> "
5567- " configuration in the settings!" ),
5568- tr (" Open &settings" ), tr (" &Cancel" ), QString (), 0 , 1 ) == 0 ) {
5571+ QMessageBox msgBox (QMessageBox::Warning, tr (" Todo lists disabled!" ),
5572+ tr (" You have disabled the todo lists.<br />"
5573+ " Please check your <strong>Todo</strong> "
5574+ " configuration in the settings!" ),
5575+ QMessageBox::NoButton, nullptr );
5576+ QPushButton *settingsButton =
5577+ msgBox.addButton (tr (" Open &settings" ), QMessageBox::AcceptRole);
5578+ msgBox.addButton (tr (" &Cancel" ), QMessageBox::RejectRole);
5579+ msgBox.setDefaultButton (settingsButton);
5580+ msgBox.exec ();
5581+
5582+ if (msgBox.clickedButton () == settingsButton) {
55695583 openSettingsDialog (SettingsDialog::TodoPage);
55705584 }
55715585
@@ -5581,11 +5595,18 @@ void MainWindow::openTodoDialog(const QString &taskUid) {
55815595
55825596 // check if we have got any task list enabled
55835597 if (todoCalendarEnabledUrlList.count () == 0 ) {
5584- if (QMessageBox::warning (nullptr , tr (" No selected todo lists!" ),
5585- tr (" You have not selected any todo lists.<br />"
5586- " Please check your <strong>Todo</strong> "
5587- " configuration in the settings!" ),
5588- tr (" Open &settings" ), tr (" &Cancel" ), QString (), 0 , 1 ) == 0 ) {
5598+ QMessageBox msgBox (QMessageBox::Warning, tr (" No selected todo lists!" ),
5599+ tr (" You have not selected any todo lists.<br />"
5600+ " Please check your <strong>Todo</strong> "
5601+ " configuration in the settings!" ),
5602+ QMessageBox::NoButton, nullptr );
5603+ QPushButton *settingsButton =
5604+ msgBox.addButton (tr (" Open &settings" ), QMessageBox::AcceptRole);
5605+ msgBox.addButton (tr (" &Cancel" ), QMessageBox::RejectRole);
5606+ msgBox.setDefaultButton (settingsButton);
5607+ msgBox.exec ();
5608+
5609+ if (msgBox.clickedButton () == settingsButton) {
55895610 openSettingsDialog (SettingsDialog::TodoPage);
55905611 }
55915612
@@ -6950,12 +6971,18 @@ void MainWindow::on_actionDecrypt_note_triggered() {
69506971 return ;
69516972 }
69526973
6953- if (QMessageBox::warning (this , tr (" Decrypt note and store it as plain text" ),
6954- tr (" Your note will be decrypted and stored as plain text again. "
6955- " Keep in mind that the unencrypted note will possibly be "
6956- " synced to your server and sensitive text may be exposed!"
6957- " <br />Do you want to decrypt your note?" ),
6958- tr (" &Decrypt" ), tr (" &Cancel" ), QString (), 0 , 1 ) == 1 ) {
6974+ QMessageBox msgBox (QMessageBox::Warning, tr (" Decrypt note and store it as plain text" ),
6975+ tr (" Your note will be decrypted and stored as plain text again. "
6976+ " Keep in mind that the unencrypted note will possibly be "
6977+ " synced to your server and sensitive text may be exposed!"
6978+ " <br />Do you want to decrypt your note?" ),
6979+ QMessageBox::NoButton, this );
6980+ QPushButton *decryptButton = msgBox.addButton (tr (" &Decrypt" ), QMessageBox::AcceptRole);
6981+ QPushButton *cancelButton = msgBox.addButton (tr (" &Cancel" ), QMessageBox::RejectRole);
6982+ msgBox.setDefaultButton (cancelButton);
6983+ msgBox.exec ();
6984+
6985+ if (msgBox.clickedButton () == cancelButton) {
69596986 return ;
69606987 }
69616988
@@ -9957,12 +9984,18 @@ void MainWindow::openNotesContextMenu(const QPoint globalPos, bool multiNoteMenu
99579984 ui->noteTreeWidget ->editItem (item);
99589985 }
99599986 } else {
9960- if (QMessageBox::warning (this , tr (" Note renaming not enabled!" ),
9961- tr (" If you want to rename your note you have to enable "
9962- " the option to allow the note filename to be "
9963- " different from the headline." ),
9964- tr (" Open &settings" ), tr (" &Cancel" ), QString (), 0 ,
9965- 1 ) == 0 ) {
9987+ QMessageBox msgBox (QMessageBox::Warning, tr (" Note renaming not enabled!" ),
9988+ tr (" If you want to rename your note you have to enable "
9989+ " the option to allow the note filename to be "
9990+ " different from the headline." ),
9991+ QMessageBox::NoButton, this );
9992+ QPushButton *settingsButton =
9993+ msgBox.addButton (tr (" Open &settings" ), QMessageBox::AcceptRole);
9994+ msgBox.addButton (tr (" &Cancel" ), QMessageBox::RejectRole);
9995+ msgBox.setDefaultButton (settingsButton);
9996+ msgBox.exec ();
9997+
9998+ if (msgBox.clickedButton () == settingsButton) {
99669999 openSettingsDialog (SettingsDialog::NoteFolderPage);
996710000 }
996810001 }
@@ -11329,10 +11362,17 @@ void MainWindow::gitCommitCurrentNoteFolder() { Utils::Git::commitCurrentNoteFol
1132911362 */
1133011363void MainWindow::on_actionShow_note_git_versions_triggered () {
1133111364 if (!Utils::Git::isCurrentNoteFolderUseGit ()) {
11332- if (QMessageBox::information (this , QStringLiteral (" Git support" ),
11333- tr (" Git support is not enabled for the current note folder, "
11334- " do you want to enable it in the settings?" ),
11335- tr (" Open &settings" ), tr (" &Cancel" ), QString (), 0 , 1 ) == 0 ) {
11365+ QMessageBox msgBox (QMessageBox::Information, QStringLiteral (" Git support" ),
11366+ tr (" Git support is not enabled for the current note folder, "
11367+ " do you want to enable it in the settings?" ),
11368+ QMessageBox::NoButton, this );
11369+ QPushButton *settingsButton =
11370+ msgBox.addButton (tr (" Open &settings" ), QMessageBox::AcceptRole);
11371+ QPushButton *cancelButton = msgBox.addButton (tr (" &Cancel" ), QMessageBox::RejectRole);
11372+ msgBox.setDefaultButton (settingsButton);
11373+ msgBox.exec ();
11374+
11375+ if (msgBox.clickedButton () == settingsButton) {
1133611376 openSettingsDialog (SettingsDialog::NoteFolderPage);
1133711377 } else {
1133811378 // User doesn't want to enable git support
0 commit comments