Windows7 JumpList now also shows list of 6 most visited pages, added
variety of icons sizes, updated windows installer
21
src/3rdparty/qtwin.cpp
vendored
@ -30,6 +30,8 @@
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
#include "historymodel.h"
|
||||
#include "mainapplication.h"
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#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)
|
||||
{
|
||||
|
||||
Q_ASSERT(widget);
|
||||
Q_UNUSED(left);
|
||||
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
|
||||
*/
|
||||
QColor QtWin::colorizatinColor()
|
||||
QColor QtWin::colorizationColor()
|
||||
{
|
||||
QColor resultColor = QApplication::palette().window().color();
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
DWORD color = 0;
|
||||
BOOL opaque = FALSE;
|
||||
@ -174,7 +174,7 @@ QColor QtWin::colorizatinColor()
|
||||
return resultColor;
|
||||
}
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
WindowNotifier *QtWin::windowNotifier()
|
||||
{
|
||||
static WindowNotifier *windowNotifierInstance = 0;
|
||||
@ -251,6 +251,15 @@ IShellLink* QtWin::CreateShellLink(const QString &title, const QString &descript
|
||||
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) {
|
||||
IObjectArray* object_array;
|
||||
@ -264,6 +273,8 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
|
||||
QString icons_source = 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"),
|
||||
app_path, "--new-tab",
|
||||
icons_source, 0));
|
||||
@ -284,7 +295,7 @@ void QtWin::AddTasksToList(ICustomDestinationList* destinationList) {
|
||||
#endif
|
||||
|
||||
void QtWin::setupJumpList() {
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
if (!isRunningWindows7())
|
||||
return;
|
||||
|
||||
|
6
src/3rdparty/qtwin.h
vendored
@ -56,13 +56,15 @@ public:
|
||||
int left = -1, int top = -1,
|
||||
int right = -1, int bottom = -1);
|
||||
static bool isCompositionEnabled();
|
||||
static QColor colorizatinColor();
|
||||
static QColor colorizationColor();
|
||||
|
||||
public slots:
|
||||
static void setupJumpList();
|
||||
|
||||
private:
|
||||
static WindowNotifier *windowNotifier();
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef W7API
|
||||
static void populateFrequentSites(IObjectCollection* collection, const QString &appPath);
|
||||
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);
|
||||
#endif
|
||||
|
@ -157,8 +157,7 @@ MainApplication::MainApplication(int &argc, char **argv)
|
||||
loadSettings();
|
||||
|
||||
QTimer::singleShot(2000, this, SLOT(restoreCursor()));
|
||||
|
||||
QtWin::setupJumpList();
|
||||
QTimer::singleShot(10*1000, this, SLOT(setupJumpList()));
|
||||
}
|
||||
|
||||
void MainApplication::loadSettings()
|
||||
@ -216,6 +215,11 @@ void MainApplication::loadSettings()
|
||||
setWheelScrollLines(scrollingLines);
|
||||
}
|
||||
|
||||
void MainApplication::setupJumpList()
|
||||
{
|
||||
QtWin::setupJumpList();
|
||||
}
|
||||
|
||||
QupZilla* MainApplication::getWindow()
|
||||
{
|
||||
for(int i=0; i<m_mainWindows.count(); i++) {
|
||||
|
@ -103,6 +103,7 @@ signals:
|
||||
void message(MainApplication::MessageType mes, bool state);
|
||||
|
||||
private slots:
|
||||
void setupJumpList();
|
||||
void restoreCursor() { QApplication::restoreOverrideCursor(); }
|
||||
|
||||
private:
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define QUPZILLA_H
|
||||
|
||||
//Comment for release building
|
||||
#define DEVELOPING
|
||||
//#define DEVELOPING
|
||||
|
||||
#ifdef QT_NO_DEBUG
|
||||
#ifdef DEVELOPING
|
||||
|
@ -1,6 +1,7 @@
|
||||
#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
|
||||
FILEVERSION 1,0,0,0
|
||||
|
@ -19,11 +19,13 @@
|
||||
#include "qupzilla.h"
|
||||
#include "bookmarksmodel.h"
|
||||
#include "iconprovider.h"
|
||||
#include "historymodel.h"
|
||||
|
||||
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
|
||||
QToolBar(parent)
|
||||
,p_QupZilla(mainClass)
|
||||
,m_bookmarksModel(0)
|
||||
,m_bookmarksModel(mApp->bookmarksModel())
|
||||
,m_historyModel(mApp->history())
|
||||
{
|
||||
setObjectName("bookmarksToolbar");
|
||||
setWindowTitle(tr("Bookmarks"));
|
||||
@ -31,8 +33,6 @@ BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
|
||||
setMovable(false);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
m_bookmarksModel = mApp->bookmarksModel();
|
||||
|
||||
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
|
||||
|
||||
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
|
||||
@ -211,15 +211,24 @@ void BookmarksToolbar::refreshMostVisited()
|
||||
{
|
||||
m_menuMostVisited->clear();
|
||||
|
||||
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+="..";
|
||||
QList<HistoryModel::HistoryEntry> mostList = m_historyModel->mostVisited(10);
|
||||
foreach (HistoryModel::HistoryEntry entry, mostList) {
|
||||
if (entry.title.length()>40) {
|
||||
entry.title.truncate(40);
|
||||
entry.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);
|
||||
// }
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
class QupZilla;
|
||||
class BookmarksModel;
|
||||
class HistoryModel;
|
||||
class BookmarksToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -50,6 +51,7 @@ private slots:
|
||||
private:
|
||||
QupZilla* p_QupZilla;
|
||||
BookmarksModel* m_bookmarksModel;
|
||||
HistoryModel* m_historyModel;
|
||||
QMenu* m_menuMostVisited;
|
||||
QToolButton* m_mostVis;
|
||||
|
||||
|
BIN
src/data/icons/exeicons/page.ico
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
src/data/icons/exeicons/page16.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
src/data/icons/exeicons/page32.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
src/data/icons/exeicons/page48.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
src/data/icons/exeicons/qupzilla.ico
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
src/data/icons/exeicons/qupzilla128.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/data/icons/exeicons/qupzilla16.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
src/data/icons/exeicons/qupzilla256.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
src/data/icons/exeicons/qupzilla32.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
src/data/icons/exeicons/qupzilla48.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
src/data/icons/exeicons/qupzilla64.png
Normal file
After Width: | Height: | Size: 10 KiB |
@ -121,6 +121,23 @@ bool HistoryModel::deleteHistoryEntry(const QString &url, const QString &title)
|
||||
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()
|
||||
{
|
||||
QSqlQuery query;
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
bool deleteHistoryEntry(int index);
|
||||
bool deleteHistoryEntry(const QString &url, const QString &title);
|
||||
|
||||
QList<HistoryModel::HistoryEntry> mostVisited(int count);
|
||||
|
||||
bool clearHistory();
|
||||
bool optimizeHistory();
|
||||
bool isSaving();
|
||||
|
@ -638,12 +638,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>ClickToFlash</name>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="95"/>
|
||||
<source>Flash blocked by ClickToFlash</source>
|
||||
<translation>Zablokováno pluginem ClickToFlash</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="99"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<source>Add %1 to whitelist</source>
|
||||
<translation>Přidat %1 na bílou listinu</translation>
|
||||
</message>
|
||||
@ -2023,32 +2023,32 @@ nebyl nalezen!</translation>
|
||||
<context>
|
||||
<name>QtWin</name>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Open new tab</source>
|
||||
<translation>Otevřít nový panel</translation>
|
||||
</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>
|
||||
<translation>Otevře nový panel pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Open new window</source>
|
||||
<translation>Otevřít nové okno</translation>
|
||||
</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>
|
||||
<translation>Otevře nové okno pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Open download manager</source>
|
||||
<translation>Otevřít správce stahování</translation>
|
||||
</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>
|
||||
<translation>Otevře správce stahování pokud je prohlížeč spuštěný</translation>
|
||||
</message>
|
||||
|
@ -642,12 +642,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>ClickToFlash</name>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="95"/>
|
||||
<source>Flash blocked by ClickToFlash</source>
|
||||
<translation>Zablokované pluginom ClickToFlash</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="99"/>
|
||||
<location filename="../src/plugins/clicktoflash.cpp" line="97"/>
|
||||
<source>Add %1 to whitelist</source>
|
||||
<translation>Pridať %1 na bielu listinu</translation>
|
||||
</message>
|
||||
@ -2025,32 +2025,32 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>QtWin</name>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="323"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="267"/>
|
||||
<source>Open new tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</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>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="327"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="271"/>
|
||||
<source>Open new window</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</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>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="331"/>
|
||||
<location filename="../src/3rdparty/qtwin.cpp" line="275"/>
|
||||
<source>Open download manager</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</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>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1,4 +1,4 @@
|
||||
RequestExecutionLevel user
|
||||
RequestExecutionLevel admin
|
||||
!include "FileAssociation.nsh"
|
||||
SetCompressor /SOLID /FINAL lzma
|
||||
|
||||
|