1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Fixed some little issues.

-show default browser dialog after application window completely rendered and correct default checked state
-show host instead URL in authentication dialog
This commit is contained in:
S. Razi Alavizadeh 2013-03-16 18:14:06 +03:30
parent d75ab566ef
commit 45830b1917
5 changed files with 21 additions and 13 deletions

View File

@ -286,14 +286,6 @@ MainApplication::MainApplication(int &argc, char** argv)
int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt(); int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 1).toInt();
settings.setValue("SessionRestore/isRunning", true); 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) { if (checkUpdates) {
new Updater(qupzilla); new Updater(qupzilla);
} }
@ -329,6 +321,15 @@ void MainApplication::postLaunch()
connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString))); connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString)));
connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings())); 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() void MainApplication::loadSettings()
@ -951,9 +952,10 @@ bool MainApplication::checkDefaultWebBrowser()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool showAgain = true; bool showAgain = true;
if (!associationManager()->isDefaultForAllCapabilities()) { 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.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.setCheckBoxText(tr("Always perform this check when starting QupZilla."));
dialog.setDefaultCheckState(Qt::Checked);
dialog.setWindowTitle(tr("Default Browser")); dialog.setWindowTitle(tr("Default Browser"));
dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning)); dialog.setIcon(qIconProvider->standardIcon(QStyle::SP_MessageBoxWarning));

View File

@ -235,12 +235,12 @@ private:
#if (QT_VERSION < 0x050000) #if (QT_VERSION < 0x050000)
bool winEvent(MSG* message, long* result); bool winEvent(MSG* message, long* result);
#else #else
void paintEvent(QPaintEvent* event);
bool nativeEvent(const QByteArray &eventType, void* _message, long* result); bool nativeEvent(const QByteArray &eventType, void* _message, long* result);
#endif #endif
void applyBlurToMainWindow(bool force = false); void applyBlurToMainWindow(bool force = false);
void paintEvent(QPaintEvent* event);
bool eventFilter(QObject* object, QEvent* event); bool eventFilter(QObject* object, QEvent* event);
#endif #endif

View File

@ -279,7 +279,7 @@ void NetworkManager::authentication(QNetworkReply* reply, QAuthenticator* auth)
connect(box, SIGNAL(accepted()), dialog, SLOT(accept())); connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
label->setText(tr("A username and password are being requested by %1. " 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(label);
formLa->addRow(userLab, user); formLa->addRow(userLab, user);

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * 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(); return ui->checkBox->isChecked();
} }
void CheckBoxDialog::setDefaultCheckState(Qt::CheckState state)
{
ui->checkBox->setChecked(state == Qt::Checked);
}
int CheckBoxDialog::exec() int CheckBoxDialog::exec()
{ {
ui->buttonBox->setFocus(); ui->buttonBox->setFocus();

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -40,6 +40,7 @@ public:
void setCheckBoxText(const QString &text); void setCheckBoxText(const QString &text);
bool isChecked() const; bool isChecked() const;
void setDefaultCheckState(Qt::CheckState state);
public slots: public slots:
int exec(); int exec();