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

Windows7 JumpList now also shows list of 6 most visited pages, added

variety of icons sizes, updated windows installer
This commit is contained in:
nowrep 2011-05-06 20:05:49 +02:00
parent 5fd9433d9c
commit 36dc77bea6
25 changed files with 494 additions and 445 deletions

View File

@ -30,6 +30,8 @@
#include <QWidget> #include <QWidget>
#include <QList> #include <QList>
#include <QPointer> #include <QPointer>
#include "historymodel.h"
#include "mainapplication.h"
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
#include <qt_windows.h> #include <qt_windows.h>
@ -132,7 +134,6 @@ bool QtWin::enableBlurBehindWindow(QWidget *widget, bool enable)
*/ */
bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom) bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom)
{ {
Q_ASSERT(widget); Q_ASSERT(widget);
Q_UNUSED(left); Q_UNUSED(left);
Q_UNUSED(top); Q_UNUSED(top);
@ -159,10 +160,9 @@ bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int ri
* *
* \a enable tells if the blur should be enabled or not * \a enable tells if the blur should be enabled or not
*/ */
QColor QtWin::colorizatinColor() QColor QtWin::colorizationColor()
{ {
QColor resultColor = QApplication::palette().window().color(); QColor resultColor = QApplication::palette().window().color();
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
DWORD color = 0; DWORD color = 0;
BOOL opaque = FALSE; BOOL opaque = FALSE;
@ -174,7 +174,7 @@ QColor QtWin::colorizatinColor()
return resultColor; return resultColor;
} }
#ifdef Q_WS_WIN #ifdef W7API
WindowNotifier *QtWin::windowNotifier() WindowNotifier *QtWin::windowNotifier()
{ {
static WindowNotifier *windowNotifierInstance = 0; static WindowNotifier *windowNotifierInstance = 0;
@ -251,6 +251,15 @@ IShellLink* QtWin::CreateShellLink(const QString &title, const QString &descript
return shell_link; return shell_link;
} }
void QtWin::populateFrequentSites(IObjectCollection* collection, const QString &appPath)
{
HistoryModel* historyModel = mApp->history();
QList<HistoryModel::HistoryEntry> mostList = historyModel->mostVisited(6);
foreach (HistoryModel::HistoryEntry entry, mostList)
collection->AddObject(CreateShellLink(entry.title, entry.url.toString(), appPath, " "+entry.url.toEncoded(), appPath, 1));
collection->AddObject(CreateShellLink("", "", "", "", "", 0)); //Spacer
}
void QtWin::AddTasksToList(ICustomDestinationList* destinationList) { void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
IObjectArray* object_array; IObjectArray* object_array;
@ -264,6 +273,8 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
QString icons_source = qApp->applicationFilePath(); QString icons_source = qApp->applicationFilePath();
QString app_path = qApp->applicationFilePath(); QString app_path = qApp->applicationFilePath();
populateFrequentSites(obj_collection, icons_source);
obj_collection->AddObject(CreateShellLink(tr("Open new tab"), tr("Opens a new tab if browser is running"), obj_collection->AddObject(CreateShellLink(tr("Open new tab"), tr("Opens a new tab if browser is running"),
app_path, "--new-tab", app_path, "--new-tab",
icons_source, 0)); icons_source, 0));
@ -284,7 +295,7 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
#endif #endif
void QtWin::setupJumpList() { void QtWin::setupJumpList() {
#ifdef Q_WS_WIN #ifdef W7API
if (!isRunningWindows7()) if (!isRunningWindows7())
return; return;

View File

@ -56,13 +56,15 @@ public:
int left = -1, int top = -1, int left = -1, int top = -1,
int right = -1, int bottom = -1); int right = -1, int bottom = -1);
static bool isCompositionEnabled(); static bool isCompositionEnabled();
static QColor colorizatinColor(); static QColor colorizationColor();
public slots:
static void setupJumpList(); static void setupJumpList();
private: private:
static WindowNotifier *windowNotifier(); static WindowNotifier *windowNotifier();
#ifdef Q_WS_WIN #ifdef W7API
static void populateFrequentSites(IObjectCollection* collection, const QString &appPath);
static void AddTasksToList(ICustomDestinationList* destinationList); static void AddTasksToList(ICustomDestinationList* destinationList);
static IShellLink* CreateShellLink(const QString &title, const QString &description, const QString &app_path, const QString &app_args, const QString &icon_path, int app_index); static IShellLink* CreateShellLink(const QString &title, const QString &description, const QString &app_path, const QString &app_args, const QString &icon_path, int app_index);
#endif #endif

View File

@ -157,8 +157,7 @@ MainApplication::MainApplication(int &argc, char **argv)
loadSettings(); loadSettings();
QTimer::singleShot(2000, this, SLOT(restoreCursor())); QTimer::singleShot(2000, this, SLOT(restoreCursor()));
QTimer::singleShot(10*1000, this, SLOT(setupJumpList()));
QtWin::setupJumpList();
} }
void MainApplication::loadSettings() void MainApplication::loadSettings()
@ -216,6 +215,11 @@ void MainApplication::loadSettings()
setWheelScrollLines(scrollingLines); setWheelScrollLines(scrollingLines);
} }
void MainApplication::setupJumpList()
{
QtWin::setupJumpList();
}
QupZilla* MainApplication::getWindow() QupZilla* MainApplication::getWindow()
{ {
for(int i=0; i<m_mainWindows.count(); i++) { for(int i=0; i<m_mainWindows.count(); i++) {

View File

@ -103,6 +103,7 @@ signals:
void message(MainApplication::MessageType mes, bool state); void message(MainApplication::MessageType mes, bool state);
private slots: private slots:
void setupJumpList();
void restoreCursor() { QApplication::restoreOverrideCursor(); } void restoreCursor() { QApplication::restoreOverrideCursor(); }
private: private:

View File

@ -19,7 +19,7 @@
#define QUPZILLA_H #define QUPZILLA_H
//Comment for release building //Comment for release building
#define DEVELOPING //#define DEVELOPING
#ifdef QT_NO_DEBUG #ifdef QT_NO_DEBUG
#ifdef DEVELOPING #ifdef DEVELOPING

View File

@ -1,6 +1,7 @@
#include "winver.h" #include "winver.h"
IDI_ICON1 ICON DISCARDABLE "icon.ico" IDI_ICON1 ICON DISCARDABLE "data\icons\exeicons\qupzilla.ico"
IDI_ICON2 ICON DISCARDABLE "data\icons\exeicons\page.ico"
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0 FILEVERSION 1,0,0,0

View File

@ -19,11 +19,13 @@
#include "qupzilla.h" #include "qupzilla.h"
#include "bookmarksmodel.h" #include "bookmarksmodel.h"
#include "iconprovider.h" #include "iconprovider.h"
#include "historymodel.h"
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) : BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
QToolBar(parent) QToolBar(parent)
,p_QupZilla(mainClass) ,p_QupZilla(mainClass)
,m_bookmarksModel(0) ,m_bookmarksModel(mApp->bookmarksModel())
,m_historyModel(mApp->history())
{ {
setObjectName("bookmarksToolbar"); setObjectName("bookmarksToolbar");
setWindowTitle(tr("Bookmarks")); setWindowTitle(tr("Bookmarks"));
@ -31,8 +33,6 @@ BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
setMovable(false); setMovable(false);
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
m_bookmarksModel = mApp->bookmarksModel();
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint))); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
@ -211,15 +211,24 @@ void BookmarksToolbar::refreshMostVisited()
{ {
m_menuMostVisited->clear(); m_menuMostVisited->clear();
QSqlQuery query; QList<HistoryModel::HistoryEntry> mostList = m_historyModel->mostVisited(10);
query.exec("SELECT title, url FROM history ORDER BY count DESC LIMIT 10"); foreach (HistoryModel::HistoryEntry entry, mostList) {
while(query.next()) { if (entry.title.length()>40) {
QUrl url = query.value(1).toUrl(); entry.title.truncate(40);
QString title = query.value(0).toString(); entry.title+="..";
if (title.length()>40) {
title.truncate(40);
title+="..";
} }
m_menuMostVisited->addAction(_iconForUrl(url), title, p_QupZilla, SLOT(loadActionUrl()))->setData(url); m_menuMostVisited->addAction(_iconForUrl(entry.url), entry.title, p_QupZilla, SLOT(loadActionUrl()))->setData(entry.url);
} }
// QSqlQuery query;
// query.exec("SELECT title, url FROM history ORDER BY count DESC LIMIT 10");
// while(query.next()) {
// QUrl url = query.value(1).toUrl();
// QString title = query.value(0).toString();
// if (title.length()>40) {
// title.truncate(40);
// title+="..";
// }
// m_menuMostVisited->addAction(_iconForUrl(url), title, p_QupZilla, SLOT(loadActionUrl()))->setData(url);
// }
} }

View File

@ -26,6 +26,7 @@
class QupZilla; class QupZilla;
class BookmarksModel; class BookmarksModel;
class HistoryModel;
class BookmarksToolbar : public QToolBar class BookmarksToolbar : public QToolBar
{ {
Q_OBJECT Q_OBJECT
@ -50,6 +51,7 @@ private slots:
private: private:
QupZilla* p_QupZilla; QupZilla* p_QupZilla;
BookmarksModel* m_bookmarksModel; BookmarksModel* m_bookmarksModel;
HistoryModel* m_historyModel;
QMenu* m_menuMostVisited; QMenu* m_menuMostVisited;
QToolButton* m_mostVis; QToolButton* m_mostVis;

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -121,6 +121,23 @@ bool HistoryModel::deleteHistoryEntry(const QString &url, const QString &title)
return false; return false;
} }
QList<HistoryModel::HistoryEntry> HistoryModel::mostVisited(int count)
{
QList<HistoryEntry> list;
QSqlQuery query;
query.exec(QString("SELECT count, date, id, title, url FROM history ORDER BY count DESC LIMIT %1").arg(count));
while(query.next()) {
HistoryEntry entry;
entry.count = query.value(0).toInt();
entry.date = query.value(1).toDateTime();
entry.id = query.value(2).toInt();
entry.title = query.value(3).toString();
entry.url = query.value(4).toUrl();
list.append(entry);
}
return list;
}
bool HistoryModel::optimizeHistory() bool HistoryModel::optimizeHistory()
{ {
QSqlQuery query; QSqlQuery query;

View File

@ -45,6 +45,8 @@ public:
bool deleteHistoryEntry(int index); bool deleteHistoryEntry(int index);
bool deleteHistoryEntry(const QString &url, const QString &title); bool deleteHistoryEntry(const QString &url, const QString &title);
QList<HistoryModel::HistoryEntry> mostVisited(int count);
bool clearHistory(); bool clearHistory();
bool optimizeHistory(); bool optimizeHistory();
bool isSaving(); bool isSaving();

View File

@ -638,12 +638,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>ClickToFlash</name> <name>ClickToFlash</name>
<message> <message>
<location filename="../src/plugins/clicktoflash.cpp" line="97"/> <location filename="../src/plugins/clicktoflash.cpp" line="95"/>
<source>Flash blocked by ClickToFlash</source> <source>Flash blocked by ClickToFlash</source>
<translation>Zablokováno pluginem ClickToFlash</translation> <translation>Zablokováno pluginem ClickToFlash</translation>
</message> </message>
<message> <message>
<location filename="../src/plugins/clicktoflash.cpp" line="99"/> <location filename="../src/plugins/clicktoflash.cpp" line="97"/>
<source>Add %1 to whitelist</source> <source>Add %1 to whitelist</source>
<translation>Přidat %1 na bílou listinu</translation> <translation>Přidat %1 na bílou listinu</translation>
</message> </message>
@ -2023,32 +2023,32 @@ nebyl nalezen!</translation>
<context> <context>
<name>QtWin</name> <name>QtWin</name>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="323"/> <location filename="../src/3rdparty/qtwin.cpp" line="267"/>
<source>Open new tab</source> <source>Open new tab</source>
<translation>Otevřít nový panel</translation> <translation>Otevřít nový panel</translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="323"/> <location filename="../src/3rdparty/qtwin.cpp" line="267"/>
<source>Opens a new tab if browser is running</source> <source>Opens a new tab if browser is running</source>
<translation>Otevře nový panel pokud je prohlížeč spuštěný</translation> <translation>Otevře nový panel pokud je prohlížeč spuštěný</translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="327"/> <location filename="../src/3rdparty/qtwin.cpp" line="271"/>
<source>Open new window</source> <source>Open new window</source>
<translation>Otevřít nové okno</translation> <translation>Otevřít nové okno</translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="327"/> <location filename="../src/3rdparty/qtwin.cpp" line="271"/>
<source>Opens a new window if browser is running</source> <source>Opens a new window if browser is running</source>
<translation>Otevře nové okno pokud je prohlížeč spuštěný</translation> <translation>Otevře nové okno pokud je prohlížeč spuštěný</translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="331"/> <location filename="../src/3rdparty/qtwin.cpp" line="275"/>
<source>Open download manager</source> <source>Open download manager</source>
<translation>Otevřít správce stahování</translation> <translation>Otevřít správce stahování</translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="331"/> <location filename="../src/3rdparty/qtwin.cpp" line="275"/>
<source>Opens a download manager if browser is running</source> <source>Opens a download manager if browser is running</source>
<translation>Otevře správce stahování pokud je prohlížeč spuštěný</translation> <translation>Otevře správce stahování pokud je prohlížeč spuštěný</translation>
</message> </message>

View File

@ -642,12 +642,12 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>ClickToFlash</name> <name>ClickToFlash</name>
<message> <message>
<location filename="../src/plugins/clicktoflash.cpp" line="97"/> <location filename="../src/plugins/clicktoflash.cpp" line="95"/>
<source>Flash blocked by ClickToFlash</source> <source>Flash blocked by ClickToFlash</source>
<translation>Zablokované pluginom ClickToFlash</translation> <translation>Zablokované pluginom ClickToFlash</translation>
</message> </message>
<message> <message>
<location filename="../src/plugins/clicktoflash.cpp" line="99"/> <location filename="../src/plugins/clicktoflash.cpp" line="97"/>
<source>Add %1 to whitelist</source> <source>Add %1 to whitelist</source>
<translation>Pridať %1 na bielu listinu</translation> <translation>Pridať %1 na bielu listinu</translation>
</message> </message>
@ -2025,32 +2025,32 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>QtWin</name> <name>QtWin</name>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="323"/> <location filename="../src/3rdparty/qtwin.cpp" line="267"/>
<source>Open new tab</source> <source>Open new tab</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="323"/> <location filename="../src/3rdparty/qtwin.cpp" line="267"/>
<source>Opens a new tab if browser is running</source> <source>Opens a new tab if browser is running</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="327"/> <location filename="../src/3rdparty/qtwin.cpp" line="271"/>
<source>Open new window</source> <source>Open new window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="327"/> <location filename="../src/3rdparty/qtwin.cpp" line="271"/>
<source>Opens a new window if browser is running</source> <source>Opens a new window if browser is running</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="331"/> <location filename="../src/3rdparty/qtwin.cpp" line="275"/>
<source>Open download manager</source> <source>Open download manager</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/3rdparty/qtwin.cpp" line="331"/> <location filename="../src/3rdparty/qtwin.cpp" line="275"/>
<source>Opens a download manager if browser is running</source> <source>Opens a download manager if browser is running</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -1,4 +1,4 @@
RequestExecutionLevel user RequestExecutionLevel admin
!include "FileAssociation.nsh" !include "FileAssociation.nsh"
SetCompressor /SOLID /FINAL lzma SetCompressor /SOLID /FINAL lzma