*
* You should have received a copy of the GNU General Public License
* along with Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
- */
+ // */
// Application headers.
#include "DomainSettingsDialog.h"
#include <QInputDialog>
#include <QMessageBox>
#include <QPushButton>
+#include <QTimer>
// Define the public static int constants.
const int DomainSettingsDialog::SHOW_ALL_DOMAINS = 0;
// Add the new domain.
addDomain(domainName);
+ // Emit the domain settings updated signal after 100 milliseconds. This is necessary because the browser window takes time to process the connect command to receive the signal.
+ QTimer::singleShot(100, [this] () { emit domainSettingsUpdated();});
+
break;
}
// Set the values for the new domain.
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::DOMAIN_NAME), domainName);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::JAVASCRIPT), DomainsDatabase::SYSTEM_DEFAULT);
+ newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::LOCAL_STORAGE), DomainsDatabase::SYSTEM_DEFAULT);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::DOM_STORAGE), DomainsDatabase::SYSTEM_DEFAULT);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::USER_AGENT), UserAgentHelper::SYSTEM_DEFAULT_DATABASE);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabase::ZOOM_FACTOR), DomainsDatabase::SYSTEM_DEFAULT);
// Update the UI.
updateUi();
+
+ // Emit the domain settings updated signal.
+ emit domainSettingsUpdated();
}
void DomainSettingsDialog::apply() const
{
// Display the default zoom factor.
customZoomFactorSpinBoxPointer->setValue(Settings::zoomFactor());
+
+ // Use the default palette.
+ zoomFactorWidgetPointer->setPalette(defaultPalette);
}
else // Custom zoom factor is selected.
{
// Display the custom zoom factor from the domain settings.
customZoomFactorSpinBoxPointer->setValue(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabase::CUSTOM_ZOOM_FACTOR)).data().toDouble());
+
+ // Use the highlighted palette.
+ zoomFactorWidgetPointer->setPalette(highlightedPalette);
}
// Set the initial status of the custom zoom factor spin box.
// Update the domains table model.
domainsTableModelPointer->setData(domainsSelectionModelPointer->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabase::LOCAL_STORAGE)), newIndex);
- // Poplate the local storage label.
+ // Populate the local storage label.
populateLocalStorageLabel();
// Update the UI.
domainsTableModelPointer->submitAll();
// Emit the domain settings updated signal.
- domainSettingsUpdated();
+ emit domainSettingsUpdated();
// Close the dialog.
accept();
// Update the Ui.
updateUi();
+
+ // Emit the domain settings updated signal.
+ emit domainSettingsUpdated();
}
}
// Display the custom zoom factor from the domain settings.
customZoomFactorSpinBoxPointer->setValue(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabase::CUSTOM_ZOOM_FACTOR)).data().toDouble());
- // Set the palette.
+ // Use the highlighted palette.
zoomFactorWidgetPointer->setPalette(highlightedPalette);
}