X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdialogs%2FDomainSettingsDialog.cpp;h=32d61d09e4363401848c19eb39a1851d9cd7268f;hb=cba9a47f00b59f59f76f1b5195086285ca0cdb59;hp=b7f2c93416038293e5ff79a637a3987735238d5d;hpb=cca335d6b9751fbf0e87daa5f122a1b8770488c8;p=PrivacyBrowserPC.git diff --git a/src/dialogs/DomainSettingsDialog.cpp b/src/dialogs/DomainSettingsDialog.cpp index b7f2c93..32d61d0 100644 --- a/src/dialogs/DomainSettingsDialog.cpp +++ b/src/dialogs/DomainSettingsDialog.cpp @@ -36,7 +36,13 @@ const int DomainSettingsDialog::EDIT_DOMAIN = 2; DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &domainName) : QDialog(nullptr) { - // Instantiate the domain settings view UI. + // Set the window title. + setWindowTitle(i18nc("The domain settings dialog window title", "Domain Settings")); + + // Set the window modality. + setWindowModality(Qt::WindowModality::ApplicationModal);; + + // Instantiate the domain settings dialog UI. Ui::DomainSettingsDialog domainSettingsDialogUi; // Setup the UI. @@ -132,11 +138,11 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString & connect(customZoomFactorSpinBoxPointer, SIGNAL(valueChanged(double)), this, SLOT(customZoomFactorChanged(double))); // Connect the buttons. - connect(addDomainButtonPointer, SIGNAL(released()), this, SLOT(showAddMessageBox())); - connect(deleteDomainButtonPointer, SIGNAL(released()), this, SLOT(showDeleteMessageBox())); - connect(resetButtonPointer, SIGNAL(released()), this, SLOT(reset())); + connect(addDomainButtonPointer, SIGNAL(clicked()), this, SLOT(showAddMessageBox())); + connect(deleteDomainButtonPointer, SIGNAL(clicked()), this, SLOT(showDeleteMessageBox())); + connect(resetButtonPointer, SIGNAL(clicked()), this, SLOT(reset())); connect(dialogButtonBoxPointer, SIGNAL(accepted()), this, SLOT(ok())); - connect(applyButtonPointer, SIGNAL(released()), this, SLOT(apply())); + connect(applyButtonPointer, SIGNAL(clicked()), this, SLOT(apply())); connect(dialogButtonBoxPointer, SIGNAL(rejected()), this, SLOT(cancel())); // Update the UI. @@ -391,7 +397,7 @@ void DomainSettingsDialog::populateUserAgentLabel(const QString &userAgentName) if (userAgentName == UserAgentHelper::SYSTEM_DEFAULT_TRANSLATED) { // Display the system default user agent name. - userAgentLabelPointer->setText(UserAgentHelper::getTranslatedUserAgentName(Settings::userAgent())); + userAgentLabelPointer->setText(UserAgentHelper::getTranslatedUserAgentNameFromDatabaseName(Settings::userAgent())); } else { @@ -440,10 +446,10 @@ void DomainSettingsDialog::showDeleteMessageBox() const deleteDialogMessageBox.setWindowTitle(i18nc("Delete domain dialog title", "Delete Domain")); // Set the text. - deleteDialogMessageBox.setText(i18nc("Delete domain main message", "Delete the current domain?")); + deleteDialogMessageBox.setText(i18nc("Delete domain dialog main message", "Delete the current domain?")); // Set the informative text. - deleteDialogMessageBox.setInformativeText(i18nc("Delete domain secondary message", "Doing so will also save any pending changes that have been made to other domains.")); + deleteDialogMessageBox.setInformativeText(i18nc("Delete domain dialog secondary message", "Doing so will also save any pending changes that have been made to other domains.")); // Set the standard buttons. deleteDialogMessageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); @@ -454,6 +460,7 @@ void DomainSettingsDialog::showDeleteMessageBox() const // Display the dialog and capture the return value. int returnValue = deleteDialogMessageBox.exec(); + // Delete the domain if instructed. if (returnValue == QMessageBox::Yes) { // Get the current index. @@ -508,7 +515,7 @@ void DomainSettingsDialog::userAgentChanged(const QString &updatedUserAgent) con { // Update the domains table model. domainsTableModelPointer->setData(domainsListViewPointer->selectionModel()->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::USER_AGENT)), - UserAgentHelper::getDatabaseUserAgentName(updatedUserAgent)); + UserAgentHelper::getDatabaseUserAgentNameFromTranslatedName(updatedUserAgent)); // Populate the user agent label. populateUserAgentLabel(updatedUserAgent);