diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 3eed81615..6a05eed94 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -286,14 +286,6 @@ MainApplication::MainApplication(int &argc, char** argv) int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt(); settings.setValue("SessionRestore/isRunning", true); -#ifndef PORTABLE_BUILD - bool alwaysCheckDefaultBrowser = settings.value("Web-Browser-Settings/CheckDefaultBrowser", DEFAULT_CHECK_DEFAULTBROWSER).toBool(); - if (alwaysCheckDefaultBrowser) { - alwaysCheckDefaultBrowser = checkDefaultWebBrowser(); - settings.setValue("Web-Browser-Settings/CheckDefaultBrowser", alwaysCheckDefaultBrowser); - } -#endif - if (checkUpdates) { new Updater(qupzilla); } @@ -329,6 +321,15 @@ void MainApplication::postLaunch() connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString))); connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings())); + +#ifndef PORTABLE_BUILD + Settings settings; + bool alwaysCheckDefaultBrowser = settings.value("Web-Browser-Settings/CheckDefaultBrowser", DEFAULT_CHECK_DEFAULTBROWSER).toBool(); + if (alwaysCheckDefaultBrowser) { + alwaysCheckDefaultBrowser = checkDefaultWebBrowser(); + settings.setValue("Web-Browser-Settings/CheckDefaultBrowser", alwaysCheckDefaultBrowser); + } +#endif } void MainApplication::loadSettings() @@ -951,9 +952,10 @@ bool MainApplication::checkDefaultWebBrowser() #ifdef Q_OS_WIN bool showAgain = true; if (!associationManager()->isDefaultForAllCapabilities()) { - CheckBoxDialog dialog(QDialogButtonBox::Yes | QDialogButtonBox::No); + CheckBoxDialog dialog(QDialogButtonBox::Yes | QDialogButtonBox::No, getWindow()); dialog.setText(tr("QupZilla is not currently your default browser. Would you like to make it your default browser?")); dialog.setCheckBoxText(tr("Always perform this check when starting QupZilla.")); + dialog.setDefaultCheckState(Qt::Checked); dialog.setWindowTitle(tr("Default Browser")); dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning)); diff --git a/src/lib/app/qupzilla.h b/src/lib/app/qupzilla.h index f6fbf00d1..051fd1c5e 100644 --- a/src/lib/app/qupzilla.h +++ b/src/lib/app/qupzilla.h @@ -235,12 +235,12 @@ private: #if (QT_VERSION < 0x050000) bool winEvent(MSG* message, long* result); #else + void paintEvent(QPaintEvent* event); bool nativeEvent(const QByteArray &eventType, void* _message, long* result); #endif void applyBlurToMainWindow(bool force = false); - void paintEvent(QPaintEvent* event); bool eventFilter(QObject* object, QEvent* event); #endif diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index 48650b541..0a34a6bb7 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -279,7 +279,7 @@ void NetworkManager::authentication(QNetworkReply* reply, QAuthenticator* auth) connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); label->setText(tr("A username and password are being requested by %1. " - "The site says: \"%2\"").arg(reply->url().toEncoded(), QzTools::escape(auth->realm()))); + "The site says: \"%2\"").arg(reply->url().host(), QzTools::escape(auth->realm()))); formLa->addRow(label); formLa->addRow(userLab, user); diff --git a/src/lib/other/checkboxdialog.cpp b/src/lib/other/checkboxdialog.cpp index 30bbce5af..d891f67e6 100644 --- a/src/lib/other/checkboxdialog.cpp +++ b/src/lib/other/checkboxdialog.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,6 +48,11 @@ bool CheckBoxDialog::isChecked() const return ui->checkBox->isChecked(); } +void CheckBoxDialog::setDefaultCheckState(Qt::CheckState state) +{ + ui->checkBox->setChecked(state == Qt::Checked); +} + int CheckBoxDialog::exec() { ui->buttonBox->setFocus(); diff --git a/src/lib/other/checkboxdialog.h b/src/lib/other/checkboxdialog.h index 44996d845..c0e1b730d 100644 --- a/src/lib/other/checkboxdialog.h +++ b/src/lib/other/checkboxdialog.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ public: void setCheckBoxText(const QString &text); bool isChecked() const; + void setDefaultCheckState(Qt::CheckState state); public slots: int exec();