1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-21 03:06:34 +01:00

Added "broken page" image to speed dial when loading fails.

+ updated translations
This commit is contained in:
nowrep 2011-12-11 12:34:51 +01:00
parent 65f4bf1a1b
commit 4f8454a3d9
12 changed files with 27 additions and 15 deletions

View File

@ -19,5 +19,6 @@
<file>html/loading.gif</file> <file>html/loading.gif</file>
<file>html/reload.png</file> <file>html/reload.png</file>
<file>html/qupzilla.ico</file> <file>html/qupzilla.ico</file>
<file>html/broken-page.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -166,12 +166,18 @@ void SpeedDial::thumbnailCreated(const QPixmap &image)
QString url = thumbnailer->url().toString(); QString url = thumbnailer->url().toString();
QString fileName = m_thumbnailsDir + QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png"; QString fileName = m_thumbnailsDir + QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png";
if (!image.save(fileName)) { if (image.isNull()) {
qWarning() << "SpeedDial::thumbnailCreated Cannot save thumbnail to " << fileName; fileName = "qrc:/html/broken-page.png";
}
else {
if (!image.save(fileName)) {
qWarning() << "SpeedDial::thumbnailCreated Cannot save thumbnail to " << fileName;
}
fileName = QUrl::fromLocalFile(fileName).toString();
} }
m_regenerateScript = true; m_regenerateScript = true;
fileName = QUrl::fromLocalFile(fileName).toString();
for (int i = 0; i < m_webFrames.count(); i++) { for (int i = 0; i < m_webFrames.count(); i++) {
QWebFrame* frame = m_webFrames.at(i).data(); QWebFrame* frame = m_webFrames.at(i).data();

View File

@ -86,11 +86,16 @@ void PageThumbnailer::start()
{ {
m_page->mainFrame()->load(m_url); m_page->mainFrame()->load(m_url);
connect(m_page, SIGNAL(loadFinished(bool)), this, SLOT(createThumbnail())); connect(m_page, SIGNAL(loadFinished(bool)), this, SLOT(createThumbnail(bool)));
} }
void PageThumbnailer::createThumbnail() void PageThumbnailer::createThumbnail(bool status)
{ {
if (!status) {
emit thumbnailCreated(QPixmap());
return;
}
QImage image(m_page->viewportSize(), QImage::Format_ARGB32); QImage image(m_page->viewportSize(), QImage::Format_ARGB32);
QPainter painter(&image); QPainter painter(&image);
m_page->mainFrame()->render(&painter); m_page->mainFrame()->render(&painter);

View File

@ -56,7 +56,7 @@ signals:
public slots: public slots:
private slots: private slots:
void createThumbnail(); void createThumbnail(bool status);
private: private:
QWebPage* m_page; QWebPage* m_page;

View File

@ -4384,7 +4384,7 @@ Po přidání či odstranění cest k certifikátům je nutné k projevení změ
<translation>Hledat &quot;%1 ..&quot; s %2</translation> <translation>Hledat &quot;%1 ..&quot; s %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Bezejmenná stránka</translation> <translation>Bezejmenná stránka</translation>
</message> </message>

View File

@ -4380,7 +4380,7 @@ Nachdem Speicherpfade hinzugefügt oder gelöscht wurden, muss QupZilla neu gest
<translation>Suche &quot;%1 ..&quot; mit %2</translation> <translation>Suche &quot;%1 ..&quot; mit %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Unbekannte Seite</translation> <translation>Unbekannte Seite</translation>
</message> </message>

View File

@ -4398,7 +4398,7 @@ Después de añadir o quitar rutas de certificados, es necesario reiniciar QupZi
<translation>Buscar &quot;%1 ..&quot; con %2</translation> <translation>Buscar &quot;%1 ..&quot; con %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Página en blanco</translation> <translation>Página en blanco</translation>
</message> </message>

View File

@ -4402,7 +4402,7 @@ Dopo l&apos;aggiunta o la rimozione dei percorsi di certificazione, è necessari
<translation>Cerca &quot;%1 ..&quot; con %2</translation> <translation>Cerca &quot;%1 ..&quot; con %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Pagina Senza Nome</translation> <translation>Pagina Senza Nome</translation>
</message> </message>

View File

@ -4380,7 +4380,7 @@ Na het toevoegen of verwijderen van paden, is het noodzakelijk om de browser te
<translation>Zoek &quot;%1 ..&quot; met %2</translation> <translation>Zoek &quot;%1 ..&quot; met %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Niet benoemde pagina</translation> <translation>Niet benoemde pagina</translation>
</message> </message>

View File

@ -4467,7 +4467,7 @@ Nachdem Speicherpfade hinzugefügt oder gelöscht wurden, muss QupZilla neu gest
<translation>Suche &quot;%1 ..&quot; mit %2</translation> <translation>Suche &quot;%1 ..&quot; mit %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Unbekannte Seite</translation> <translation>Unbekannte Seite</translation>
</message> </message>

View File

@ -4377,7 +4377,7 @@ Po pridaní či odobratí ciest k certifikátom je nutné reštartovať prehliad
<translation>Hľadať &quot;%1 ..&quot; s %2</translation> <translation>Hľadať &quot;%1 ..&quot; s %2</translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation>Nepomenovaná stránka</translation> <translation>Nepomenovaná stránka</translation>
</message> </message>

View File

@ -4393,7 +4393,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
<translation>使 %2&quot;%1 ..&quot; </translation> <translation>使 %2&quot;%1 ..&quot; </translation>
</message> </message>
<message> <message>
<location filename="../src/webview/webview.cpp" line="887"/> <location filename="../src/webview/webview.cpp" line="890"/>
<source>No Named Page</source> <source>No Named Page</source>
<translation></translation> <translation></translation>
</message> </message>