X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwindows%2FBrowserWindow.cpp;h=fcca8e8f70351ef7c91b544ee524861b72ff9b1f;hb=16a3a29abcc083de8a46a0e6e2dbed8dd6d896a5;hp=f1dd59e3ea8b3bb8963130687c54d97e591df78e;hpb=dc74bf6bdf3d56e09465925a88a7328b8b71d746;p=PrivacyBrowserPC.git diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp index f1dd59e..fcca8e8 100644 --- a/src/windows/BrowserWindow.cpp +++ b/src/windows/BrowserWindow.cpp @@ -223,28 +223,28 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() QKeySequence ctrlSemicolonKeySequence = QKeySequence(i18nc("The cookies dialog key sequence.", "Ctrl+;")); // Set the action key sequences. - newTabActionPointer->setShortcut(ctrlTKeySequence); - newWindowActionPointer->setShortcut(ctrlNKeySequence); - printPreviewActionPointer->setShortcut(ctrlShiftPKeySequence); - userAgentPrivacyBrowserActionPointer->setShortcut(ctrlAltPKeySequence); - userAgentWebEngineDefaultActionPointer->setShortcut(ctrlAltWKeySequence); - userAgentFirefoxLinuxActionPointer->setShortcut(ctrlAltFKeySequence); - userAgentChromiumLinuxActionPointer->setShortcut(ctrlAltCKeySequence); - userAgentFirefoxWindowsActionPointer->setShortcut(ctrlAltShiftFKeySequence); - userAgentChromeWindowsActionPointer->setShortcut(ctrlAltShiftCKeySequence); - userAgentEdgeWindowsActionPointer->setShortcut(ctrlAltEKeySequence); - userAgentSafariMacosActionPointer->setShortcut(ctrlAltSKeySequence); - userAgentCustomActionPointer->setShortcut(altShiftCKeySequence); - zoomFactorActionPointer->setShortcut(ctrlAltZKeySequence); - searchEngineMojeekActionPointer->setShortcut(ctrlShiftMKeySequence); - searchEngineMonoclesActionPointer->setShortcut(ctrlShiftOKeySequence); - searchEngineMetagerActionPointer->setShortcut(ctrlShiftEKeySequence); - searchEngineGoogleActionPointer->setShortcut(ctrlShiftGKeySequence); - searchEngineBingActionPointer->setShortcut(ctrlShiftBKeySequence); - searchEngineYahooActionPointer->setShortcut(ctrlShiftYKeySequence); - searchEngineCustomActionPointer->setShortcut(ctrlShiftCKeySequence); - domainSettingsActionPointer->setShortcut(ctrlDKeySequence); - cookiesActionPointer->setShortcut(ctrlSemicolonKeySequence); + actionCollectionPointer->setDefaultShortcut(newTabActionPointer, ctrlTKeySequence); + actionCollectionPointer->setDefaultShortcut(newWindowActionPointer, ctrlNKeySequence); + actionCollectionPointer->setDefaultShortcut(printPreviewActionPointer, ctrlShiftPKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentPrivacyBrowserActionPointer, ctrlAltPKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentWebEngineDefaultActionPointer, ctrlAltWKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentFirefoxLinuxActionPointer, ctrlAltFKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentChromiumLinuxActionPointer, ctrlAltCKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentFirefoxWindowsActionPointer, ctrlAltShiftFKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentChromeWindowsActionPointer, ctrlAltShiftCKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentEdgeWindowsActionPointer, ctrlAltEKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentSafariMacosActionPointer, ctrlAltSKeySequence); + actionCollectionPointer->setDefaultShortcut(userAgentCustomActionPointer, altShiftCKeySequence); + actionCollectionPointer->setDefaultShortcut(zoomFactorActionPointer, ctrlAltZKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineMojeekActionPointer, ctrlShiftMKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineMonoclesActionPointer, ctrlShiftOKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineMetagerActionPointer, ctrlShiftEKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineGoogleActionPointer, ctrlShiftGKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineBingActionPointer, ctrlShiftBKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineYahooActionPointer, ctrlShiftYKeySequence); + actionCollectionPointer->setDefaultShortcut(searchEngineCustomActionPointer, ctrlShiftCKeySequence); + actionCollectionPointer->setDefaultShortcut(domainSettingsActionPointer, ctrlDKeySequence); + actionCollectionPointer->setDefaultShortcut(cookiesActionPointer, ctrlSemicolonKeySequence); // Execute the actions. connect(newTabActionPointer, SIGNAL(triggered()), tabWidgetPointer, SLOT(addTab())); @@ -763,20 +763,23 @@ void BrowserWindow::showSettingsDialog() // Add each dictionary to the spell check list widget. foreach(QString dictionaryString, dictionariesStringList) { - // Create a new list widget item pointer named after the dictionary string. - QListWidgetItem *listWidgetItemPointer = new QListWidgetItem(dictionaryString, spellCheckListWidgetPointer); + // Create a new list widget item pointer. + QListWidgetItem *listWidgetItemPointer = new QListWidgetItem(); - // Set the list widget item pointer to be checkable. - listWidgetItemPointer->setFlags(listWidgetItemPointer->flags() | Qt::ItemIsUserCheckable); + // Create a dictionary check box widget with the name of the dictionary string. + QCheckBox *dictionaryCheckBoxWidget = new QCheckBox(dictionaryString); // Check the language if it is currently enabled. if (enabledSpellCheckLanguagesList.contains(dictionaryString)) - listWidgetItemPointer->setCheckState(Qt::Checked); + dictionaryCheckBoxWidget->setCheckState(Qt::Checked); else - listWidgetItemPointer->setCheckState(Qt::Unchecked); + dictionaryCheckBoxWidget->setCheckState(Qt::Unchecked); - // Add the list widget item to the widget. + // Add the list widget item to the spell check list widget. spellCheckListWidgetPointer->addItem(listWidgetItemPointer); + + // Set the list widget item check box widget. + spellCheckListWidgetPointer->setItemWidget(listWidgetItemPointer, dictionaryCheckBoxWidget); } // Get a handle for the KConfig skeleton. @@ -823,9 +826,21 @@ void BrowserWindow::showSettingsDialog() // Get the language item. QListWidgetItem *languageItemPointer = spellCheckListWidgetPointer->item(i); + // Get the language check box. + QCheckBox *languageCheckBoxPointer = qobject_cast(spellCheckListWidgetPointer->itemWidget(languageItemPointer)); + // Add the item to the enabled languages if it is checked. - if (languageItemPointer->checkState() == Qt::Checked) - newSpellCheckLanguages.append(languageItemPointer->text()); + if (languageCheckBoxPointer->checkState() == Qt::Checked) + { + // Get the text. + QString languageString = languageCheckBoxPointer->text(); + + // Remove all instances of `&`, which may have been added automatically when creating the check box text. + languageString.remove(QChar('&')); + + // Add the language string to the list. + newSpellCheckLanguages.append(languageString); + } } // Update the spell check languages.