mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Added qupzilla:start page, fixed maximising window issue on Windows
This commit is contained in:
parent
b526e99c0f
commit
afbc2b1a6b
Binary file not shown.
@ -165,8 +165,8 @@ void QupZilla::setupUi()
|
||||
QSettings settings(m_activeProfil+"settings.ini", QSettings::IniFormat);
|
||||
settings.beginGroup("Browser-View-Settings");
|
||||
if (settings.value("WindowMaximised", false).toBool()) {
|
||||
setWindowState(Qt::WindowMaximized);
|
||||
resize(800, 550);
|
||||
setWindowState(Qt::WindowMaximized);
|
||||
} else {
|
||||
setGeometry(settings.value("WindowGeometry", QRect(0, 0, 800, 550)).toRect());
|
||||
}
|
||||
@ -360,7 +360,7 @@ void QupZilla::loadSettings()
|
||||
|
||||
//Url settings
|
||||
settings.beginGroup("Web-URL-Settings");
|
||||
m_homepage = settings.value("homepage","http://qupzilla.ic.cz/search/").toUrl();
|
||||
m_homepage = settings.value("homepage","qupzilla:start").toUrl();
|
||||
m_newtab = settings.value("newTabUrl","").toUrl();
|
||||
settings.endGroup();
|
||||
|
||||
|
@ -179,7 +179,6 @@ private slots:
|
||||
|
||||
void copy() { QApplication::clipboard()->setText(weView()->selectedText()); }
|
||||
void selectAll() { weView()->selectAll(); }
|
||||
void reportBug() { m_tabWidget->addView(QUrl("http://qupzilla.ic.cz/bugzilla/?do=newtask&project=2")); }
|
||||
|
||||
void zoomIn() { weView()->zoomIn(); }
|
||||
void zoomOut() { weView()->zoomOut(); }
|
||||
|
@ -8,5 +8,6 @@
|
||||
<file>html/box-border.png</file>
|
||||
<file>html/copyright</file>
|
||||
<file>html/reportbug.html</file>
|
||||
<file>html/start.html</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
58
src/data/html/start.html
Normal file
58
src/data/html/start.html
Normal file
@ -0,0 +1,58 @@
|
||||
<html><head>
|
||||
<title>%TITLE%</title>
|
||||
<link rel="icon" href="data:image/png;base64,%FAVICON%" type="image/x-icon" />
|
||||
<style>
|
||||
html {
|
||||
background: #eeeeee;
|
||||
font: 13px/22px "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: #525c66;
|
||||
}
|
||||
|
||||
#box {
|
||||
max-width: 500px;
|
||||
margin: 25px auto 0px auto;
|
||||
padding: 0px 40px 0px 40px;
|
||||
border-width: 20px;
|
||||
-webkit-border-image: url(data:image/png;base64,%BOX-BORDER%) 25;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 400px;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
border: 1px solid #babcb8;
|
||||
}
|
||||
.line:focus{
|
||||
border-color: #579eea;
|
||||
}
|
||||
.submit
|
||||
{
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #1a4ba4;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="document.getElementById('inp').focus()">
|
||||
<div id="box">
|
||||
<center>
|
||||
|
||||
<img src="data:image/png;base64,%ABOUT-IMG%"">
|
||||
<form action="http://www.google.com/search?client=qupzilla" method="GET">
|
||||
<input class="line" id="inp" class="question" name="q"/> <br/>
|
||||
<input class="submit" type="submit" name="search" value="%BUTTON-LABEL%">
|
||||
</form>
|
||||
|
||||
<p class="bottom">%SEARCH-BY-GOOGLE% | <a href="%WWW%">%ABOUT-QUPZILLA%</a></p>
|
||||
</center>
|
||||
</div>
|
||||
</body></html>
|
Binary file not shown.
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 9.9 KiB |
@ -45,7 +45,7 @@ QupZillaSchemeReply::QupZillaSchemeReply(const QNetworkRequest &req, QObject *pa
|
||||
setUrl(req.url());
|
||||
|
||||
m_pageName = req.url().path();
|
||||
if (m_pageName == "about" || m_pageName == "reportbug") {
|
||||
if (m_pageName == "about" || m_pageName == "reportbug" || m_pageName == "start") {
|
||||
m_buffer.open(QIODevice::ReadWrite);
|
||||
setError(QNetworkReply::NoError, tr("No Error"));
|
||||
|
||||
@ -64,6 +64,8 @@ void QupZillaSchemeReply::loadPage()
|
||||
stream << aboutPage();
|
||||
else if (m_pageName == "reportbug")
|
||||
stream << reportbugPage();
|
||||
else if (m_pageName == "start")
|
||||
stream << startPage();
|
||||
|
||||
stream.flush();
|
||||
m_buffer.reset();
|
||||
@ -119,6 +121,23 @@ QString QupZillaSchemeReply::reportbugPage()
|
||||
return page;
|
||||
}
|
||||
|
||||
QString QupZillaSchemeReply::startPage()
|
||||
{
|
||||
QString page;
|
||||
page.append(qz_readAllFileContents(":html/start.html"));
|
||||
page.replace("%FAVICON%", qz_pixmapToByteArray(QPixmap(":icons/qupzilla.png")));
|
||||
page.replace("%BOX-BORDER%", qz_pixmapToByteArray(QPixmap(":html/box-border.png")));
|
||||
page.replace("%ABOUT-IMG%", qz_pixmapToByteArray(QPixmap(":icons/other/about.png")));
|
||||
|
||||
page.replace("%TITLE%", tr("Start Page"));
|
||||
page.replace("%BUTTON-LABEL%", tr("Google Search"));
|
||||
page.replace("%SEARCH-BY-GOOGLE%", tr("Search results provided by Google"));
|
||||
page.replace("%WWW%", QupZilla::WWWADDRESS);
|
||||
page.replace("%ABOUT-QUPZILLA%", tr("About QupZilla"));
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
QString QupZillaSchemeReply::aboutPage()
|
||||
{
|
||||
QString page;
|
||||
|
@ -58,6 +58,7 @@ private slots:
|
||||
private:
|
||||
QString aboutPage();
|
||||
QString reportbugPage();
|
||||
QString startPage();
|
||||
|
||||
QBuffer m_buffer;
|
||||
QString m_pageName;
|
||||
|
@ -78,7 +78,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) :
|
||||
QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat);
|
||||
//GENERAL URLs
|
||||
settings.beginGroup("Web-URL-Settings");
|
||||
m_homepage = settings.value("homepage","http://qupzilla.ic.cz/search/").toString();
|
||||
m_homepage = settings.value("homepage","qupzilla:start").toString();
|
||||
m_newTabUrl = settings.value("newTabUrl","").toString();
|
||||
ui->homepage->setText(m_homepage);
|
||||
ui->newTabUrl->setText(m_newTabUrl);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user