@@ -180,8 +180,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
180180 &MainWindow::showNoteEditTabWidgetContextMenu);
181181
182182 // Set the two shortcuts for the "increase note text size" action
183- const QList<QKeySequence> shortcuts = {QKeySequence (Qt::CTRL + Qt::Key_Plus),
184- QKeySequence (Qt::CTRL + Qt::Key_Equal)};
183+ const QList<QKeySequence> shortcuts = {QKeySequence (Qt::CTRL | Qt::Key_Plus),
184+ QKeySequence (Qt::CTRL | Qt::Key_Equal)};
185185 ui->action_Increase_note_text_size ->setShortcuts (shortcuts);
186186
187187 initTreeWidgets ();
@@ -3808,22 +3808,19 @@ QString MainWindow::selectOwnCloudNotesFolder() {
38083808 updateCurrentFolderTooltip ();
38093809 } else {
38103810 if (this ->notesPath .isEmpty ()) {
3811- switch (QMessageBox::information (
3812- this , tr (" No folder was selected" ),
3813- Utils::Misc::replaceOwnCloudText (tr (" You have to select your ownCloud notes "
3814- " folder to make this software work!" )),
3815- tr (" &Retry" ), tr (" &Exit" ), QString (), 0 , 1 )) {
3816- case 0 :
3817- selectOwnCloudNotesFolder ();
3818- break ;
3819- case 1 :
3820- default :
3821- // No other way to quit the application worked
3822- // in the constructor
3823- // Waqar144: this doesn't seem very wise...
3824- QTimer::singleShot (0 , this , SLOT (quitApp ()));
3825- QTimer::singleShot (100 , this , SLOT (quitApp ()));
3826- break ;
3811+ if (QMessageBox::question (
3812+ this , tr (" No folder was selected" ),
3813+ Utils::Misc::replaceOwnCloudText (tr (" You have to select your ownCloud notes "
3814+ " folder to make this software work!" )),
3815+ QMessageBox::Retry | QMessageBox::Close,
3816+ QMessageBox::Retry) == QMessageBox::Retry) {
3817+ selectOwnCloudNotesFolder ();
3818+ } else {
3819+ // No other way to quit the application worked
3820+ // in the constructor
3821+ // Waqar144: this doesn't seem very wise...
3822+ QTimer::singleShot (0 , this , SLOT (quitApp ()));
3823+ QTimer::singleShot (100 , this , SLOT (quitApp ()));
38273824 }
38283825 }
38293826 }
@@ -5281,11 +5278,12 @@ bool MainWindow::showRestartNotificationIfNeeded(bool force) {
52815278
52825279 qApp->setProperty (" needsRestart" , false );
52835280
5284- if (QMessageBox::information (this , tr (" Restart application" ),
5285- tr (" You may need to restart the application to let the "
5286- " changes take effect." ) +
5287- Utils::Misc::appendSingleAppInstanceTextIfNeeded (),
5288- tr (" Restart" ), tr (" Cancel" ), QString (), 0 , 1 ) == 0 ) {
5281+ if (QMessageBox::question (this , tr (" Restart application" ),
5282+ tr (" You may need to restart the application to let the "
5283+ " changes take effect." ) +
5284+ Utils::Misc::appendSingleAppInstanceTextIfNeeded (),
5285+ QMessageBox::Yes | QMessageBox::Cancel,
5286+ QMessageBox::Yes) == QMessageBox::Yes) {
52895287 storeSettings ();
52905288 Utils::Misc::restartApplication ();
52915289
@@ -5759,7 +5757,7 @@ void MainWindow::filterNotesBySearchLineEditText(bool searchInNote) {
57595757 ui->noteTreeWidget ->setColumnCount (1 );
57605758
57615759 // search notes when at least 2 characters were entered
5762- if (searchText.count () >= 2 ) {
5760+ if (searchText.size () >= 2 ) {
57635761 if (searchInNote) {
57645762 // open search dialog
57655763 doSearchInNote (searchText);
@@ -7155,7 +7153,7 @@ void MainWindow::gotoNextNote() {
71557153 * Activate the context menu in the currently focused widget
71567154 */
71577155void MainWindow::activateContextMenu () {
7158- auto *event = new QContextMenuEvent (QContextMenuEvent::Keyboard, QPoint ());
7156+ auto *event = new QContextMenuEvent (QContextMenuEvent::Keyboard, QPoint (), QPoint () );
71597157 QApplication::postEvent (focusWidget (), event);
71607158}
71617159
@@ -11190,7 +11188,7 @@ void MainWindow::noteEditCursorPositionChanged() {
1119011188
1119111189 if (!selectedText.isEmpty ()) {
1119211190 const QString textAdd = QStringLiteral (" (" ) +
11193- tr (" %n selected" , " Characters selected" , selectedText.count ()) +
11191+ tr (" %n selected" , " Characters selected" , selectedText.size ()) +
1119411192 QStringLiteral (" )" );
1119511193 text += textAdd;
1119611194 toolTip += textAdd;
@@ -12379,12 +12377,12 @@ bool MainWindow::nextCloudDeckCheck() {
1237912377 NextcloudDeckService nextcloudDeckService (this );
1238012378
1238112379 if (!nextcloudDeckService.isEnabled ()) {
12382- if (QMessageBox::warning (
12380+ if (QMessageBox::question (
1238312381 nullptr , QObject::tr (" Nextcloud Deck support disabled!" ),
1238412382 QObject::tr (
1238512383 " Nextcloud Deck support is not enabled or the settings are invalid.<br />"
1238612384 " Please check your <strong>Nextcloud</strong> configuration in the settings!" ),
12387- QObject::tr ( " Open &settings " ), QObject::tr ( " & Cancel" ), QString (), 0 , 1 ) == 0 ) {
12385+ QMessageBox:: Open | QMessageBox:: Cancel, QMessageBox::Open) == QMessageBox::Open ) {
1238812386 openSettingsDialog (SettingsDialog::OwnCloudPage);
1238912387 }
1239012388
0 commit comments