mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 09:55:55 +00:00
Use of system icon theme can now be disabled
This commit is contained in:
parent
5dfca9c685
commit
83ff66e0b1
@ -34,7 +34,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "ui_confirmdeletiondlg.h"
|
#include "ui_confirmdeletiondlg.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -43,9 +43,9 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
|||||||
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
lbl_warn->setPixmap(misc::getIcon("dialog-warning").pixmap(lbl_warn->height()));
|
lbl_warn->setPixmap(IconProvider::instance()->getIcon("dialog-warning").pixmap(lbl_warn->height()));
|
||||||
lbl_warn->setFixedWidth(lbl_warn->height());
|
lbl_warn->setFixedWidth(lbl_warn->height());
|
||||||
rememberBtn->setIcon(misc::getIcon("object-locked"));
|
rememberBtn->setIcon(IconProvider::instance()->getIcon("object-locked"));
|
||||||
|
|
||||||
move(misc::screenCenter(this));
|
move(misc::screenCenter(this));
|
||||||
checkPermDelete->setChecked(Preferences().deleteTorrentFilesAsDefault());
|
checkPermDelete->setChecked(Preferences().deleteTorrentFilesAsDefault());
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
#include "executionlog.h"
|
#include "executionlog.h"
|
||||||
#include "ui_executionlog.h"
|
#include "ui_executionlog.h"
|
||||||
#include "qbtsession.h"
|
#include "qbtsession.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
ExecutionLog::ExecutionLog(QWidget *parent) :
|
ExecutionLog::ExecutionLog(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::ExecutionLog)
|
ui(new Ui::ExecutionLog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tabConsole->setTabIcon(0, misc::getIcon("view-calendar-journal"));
|
ui->tabConsole->setTabIcon(0, IconProvider::instance()->getIcon("view-calendar-journal"));
|
||||||
ui->tabConsole->setTabIcon(1, misc::getIcon("view-filter"));
|
ui->tabConsole->setTabIcon(1, IconProvider::instance()->getIcon("view-filter"));
|
||||||
ui->textConsole->setHtml(QBtSession::instance()->getConsoleMessages().join("<br>"));
|
ui->textConsole->setHtml(QBtSession::instance()->getConsoleMessages().join("<br>"));
|
||||||
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), SLOT(addLogMessage(QString)));
|
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), SLOT(addLogMessage(QString)));
|
||||||
ui->textBannedPeers->setHtml(QBtSession::instance()->getPeerBanMessages().join("<br>"));
|
ui->textBannedPeers->setHtml(QBtSession::instance()->getPeerBanMessages().join("<br>"));
|
||||||
|
89
src/iconprovider.cpp
Normal file
89
src/iconprovider.cpp
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt4 and libtorrent.
|
||||||
|
* Copyright (C) 2011 Christophe Dumez
|
||||||
|
*
|
||||||
|
* 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 the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* In addition, as a special exception, the copyright holders give permission to
|
||||||
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||||
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||||
|
* and distribute the linked executables. You must obey the GNU General Public
|
||||||
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||||
|
* modify file(s), you may extend this exception to your version of the file(s),
|
||||||
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||||
|
* exception statement from your version.
|
||||||
|
*
|
||||||
|
* Contact : chris@qbittorrent.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "iconprovider.h"
|
||||||
|
#include "preferences.h"
|
||||||
|
|
||||||
|
IconProvider* IconProvider::m_instance = 0;
|
||||||
|
|
||||||
|
IconProvider::IconProvider()
|
||||||
|
{
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
m_useSystemTheme = Preferences().useSystemIconTheme();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
IconProvider * IconProvider::instance()
|
||||||
|
{
|
||||||
|
if(!m_instance)
|
||||||
|
m_instance = new IconProvider;
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IconProvider::drop()
|
||||||
|
{
|
||||||
|
if(m_instance) {
|
||||||
|
delete m_instance;
|
||||||
|
m_instance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QIcon IconProvider::getIcon(const QString &iconId)
|
||||||
|
{
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
if(m_useSystemTheme)
|
||||||
|
return QIcon::fromTheme(iconId, QIcon(":/Icons/oxygen/"+iconId+".png"));
|
||||||
|
#endif
|
||||||
|
return QIcon(":/Icons/oxygen/"+iconId+".png");
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
void IconProvider::useSystemIconTheme(bool enable)
|
||||||
|
{
|
||||||
|
m_useSystemTheme = enable;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QString IconProvider::getIconPath(const QString &iconId)
|
||||||
|
{
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
if(m_useSystemTheme) {
|
||||||
|
QString path = QDir::temp().absoluteFilePath(iconId+".png");
|
||||||
|
if(!QFile::exists(path)) {
|
||||||
|
const QIcon icon = QIcon::fromTheme(iconId);
|
||||||
|
if(icon.isNull()) return ":/Icons/oxygen/"+iconId+".png";
|
||||||
|
QPixmap px = icon.pixmap(32);
|
||||||
|
px.save(path);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return ":/Icons/oxygen/"+iconId+".png";
|
||||||
|
}
|
60
src/iconprovider.h
Normal file
60
src/iconprovider.h
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt4 and libtorrent.
|
||||||
|
* Copyright (C) 2011 Christophe Dumez
|
||||||
|
*
|
||||||
|
* 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 the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* In addition, as a special exception, the copyright holders give permission to
|
||||||
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||||
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||||
|
* and distribute the linked executables. You must obey the GNU General Public
|
||||||
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||||
|
* modify file(s), you may extend this exception to your version of the file(s),
|
||||||
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||||
|
* exception statement from your version.
|
||||||
|
*
|
||||||
|
* Contact : chris@qbittorrent.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ICONPROVIDER_H
|
||||||
|
#define ICONPROVIDER_H
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class IconProvider
|
||||||
|
{
|
||||||
|
Q_DISABLE_COPY(IconProvider);
|
||||||
|
|
||||||
|
private:
|
||||||
|
explicit IconProvider();
|
||||||
|
static IconProvider* m_instance;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static IconProvider* instance();
|
||||||
|
static void drop();
|
||||||
|
QIcon getIcon(const QString& iconId);
|
||||||
|
QString getIconPath(const QString &iconId);
|
||||||
|
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
public:
|
||||||
|
void useSystemIconTheme(bool enable);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_useSystemTheme;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ICONPROVIDER_H
|
@ -70,6 +70,7 @@
|
|||||||
#include "rsssettings.h"
|
#include "rsssettings.h"
|
||||||
#include "torrentmodel.h"
|
#include "torrentmodel.h"
|
||||||
#include "executionlog.h"
|
#include "executionlog.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
#include "qmacapplication.h"
|
#include "qmacapplication.h"
|
||||||
void qt_mac_set_dock_menu(QMenu *menu);
|
void qt_mac_set_dock_menu(QMenu *menu);
|
||||||
@ -102,29 +103,29 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
|
|||||||
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
|
||||||
actionOpen->setIcon(misc::getIcon("list-add"));
|
actionOpen->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
actionDownload_from_URL->setIcon(misc::getIcon("insert-link"));
|
actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link"));
|
||||||
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
||||||
actionSet_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
actionSet_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
||||||
actionSet_global_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
actionSet_global_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
|
||||||
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png")));
|
||||||
actionCreate_torrent->setIcon(misc::getIcon("document-edit"));
|
actionCreate_torrent->setIcon(IconProvider::instance()->getIcon("document-edit"));
|
||||||
actionAbout->setIcon(misc::getIcon("help-about"));
|
actionAbout->setIcon(IconProvider::instance()->getIcon("help-about"));
|
||||||
actionBugReport->setIcon(misc::getIcon("tools-report-bug"));
|
actionBugReport->setIcon(IconProvider::instance()->getIcon("tools-report-bug"));
|
||||||
actionDecreasePriority->setIcon(misc::getIcon("go-down"));
|
actionDecreasePriority->setIcon(IconProvider::instance()->getIcon("go-down"));
|
||||||
actionDelete->setIcon(misc::getIcon("list-remove"));
|
actionDelete->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
actionDocumentation->setIcon(misc::getIcon("help-contents"));
|
actionDocumentation->setIcon(IconProvider::instance()->getIcon("help-contents"));
|
||||||
actionDonate_money->setIcon(misc::getIcon("wallet-open"));
|
actionDonate_money->setIcon(IconProvider::instance()->getIcon("wallet-open"));
|
||||||
actionExit->setIcon(misc::getIcon("application-exit"));
|
actionExit->setIcon(IconProvider::instance()->getIcon("application-exit"));
|
||||||
actionIncreasePriority->setIcon(misc::getIcon("go-up"));
|
actionIncreasePriority->setIcon(IconProvider::instance()->getIcon("go-up"));
|
||||||
actionLock_qBittorrent->setIcon(misc::getIcon("object-locked"));
|
actionLock_qBittorrent->setIcon(IconProvider::instance()->getIcon("object-locked"));
|
||||||
actionOptions->setIcon(misc::getIcon("preferences-system"));
|
actionOptions->setIcon(IconProvider::instance()->getIcon("preferences-system"));
|
||||||
actionPause->setIcon(misc::getIcon("media-playback-pause"));
|
actionPause->setIcon(IconProvider::instance()->getIcon("media-playback-pause"));
|
||||||
actionPause_All->setIcon(misc::getIcon("media-playback-pause"));
|
actionPause_All->setIcon(IconProvider::instance()->getIcon("media-playback-pause"));
|
||||||
actionStart->setIcon(misc::getIcon("media-playback-start"));
|
actionStart->setIcon(IconProvider::instance()->getIcon("media-playback-start"));
|
||||||
actionStart_All->setIcon(misc::getIcon("media-playback-start"));
|
actionStart_All->setIcon(IconProvider::instance()->getIcon("media-playback-start"));
|
||||||
action_Import_Torrent->setIcon(misc::getIcon("document-import"));
|
action_Import_Torrent->setIcon(IconProvider::instance()->getIcon("document-import"));
|
||||||
menuAuto_Shutdown_on_downloads_completion->setIcon(misc::getIcon("application-exit"));
|
menuAuto_Shutdown_on_downloads_completion->setIcon(IconProvider::instance()->getIcon("application-exit"));
|
||||||
|
|
||||||
QMenu *startAllMenu = new QMenu(this);
|
QMenu *startAllMenu = new QMenu(this);
|
||||||
startAllMenu->addAction(actionStart_All);
|
startAllMenu->addAction(actionStart_All);
|
||||||
@ -168,7 +169,7 @@ MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindo
|
|||||||
vSplitter->addWidget(hSplitter);
|
vSplitter->addWidget(hSplitter);
|
||||||
vSplitter->setCollapsible(0, true);
|
vSplitter->setCollapsible(0, true);
|
||||||
vSplitter->setCollapsible(1, false);
|
vSplitter->setCollapsible(1, false);
|
||||||
tabs->addTab(vSplitter, misc::getIcon("folder-remote"), tr("Transfers"));
|
tabs->addTab(vSplitter, IconProvider::instance()->getIcon("folder-remote"), tr("Transfers"));
|
||||||
|
|
||||||
vboxLayout->addWidget(tabs);
|
vboxLayout->addWidget(tabs);
|
||||||
// Name filter
|
// Name filter
|
||||||
@ -355,6 +356,7 @@ MainWindow::~MainWindow() {
|
|||||||
delete switchSearchShortcut2;
|
delete switchSearchShortcut2;
|
||||||
delete switchTransferShortcut;
|
delete switchTransferShortcut;
|
||||||
delete switchRSSShortcut;
|
delete switchRSSShortcut;
|
||||||
|
IconProvider::drop();
|
||||||
// Delete QBtSession::instance() object
|
// Delete QBtSession::instance() object
|
||||||
qDebug("Deleting QBtSession::instance()");
|
qDebug("Deleting QBtSession::instance()");
|
||||||
QBtSession::drop();
|
QBtSession::drop();
|
||||||
@ -397,7 +399,7 @@ void MainWindow::displayRSSTab(bool enable) {
|
|||||||
if(!rssWidget) {
|
if(!rssWidget) {
|
||||||
rssWidget = new RSSImp(tabs);
|
rssWidget = new RSSImp(tabs);
|
||||||
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
||||||
tabs->setTabIcon(index_tab, misc::getIcon("application-rss+xml"));
|
tabs->setTabIcon(index_tab, IconProvider::instance()->getIcon("application-rss+xml"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(rssWidget) {
|
if(rssWidget) {
|
||||||
@ -411,7 +413,7 @@ void MainWindow::displaySearchTab(bool enable) {
|
|||||||
// RSS tab
|
// RSS tab
|
||||||
if(!searchEngine) {
|
if(!searchEngine) {
|
||||||
searchEngine = new SearchEngine(this);
|
searchEngine = new SearchEngine(this);
|
||||||
tabs->insertTab(1, searchEngine, misc::getIcon("edit-find"), tr("Search"));
|
tabs->insertTab(1, searchEngine, IconProvider::instance()->getIcon("edit-find"), tr("Search"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(searchEngine) {
|
if(searchEngine) {
|
||||||
@ -1004,6 +1006,11 @@ void MainWindow::loadPreferences(bool configure_session) {
|
|||||||
// Torrent properties
|
// Torrent properties
|
||||||
properties->reloadPreferences();
|
properties->reloadPreferences();
|
||||||
|
|
||||||
|
// Icon provider
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
IconProvider::instance()->useSystemIconTheme(pref.useSystemIconTheme());
|
||||||
|
#endif
|
||||||
|
|
||||||
if(configure_session)
|
if(configure_session)
|
||||||
QBtSession::instance()->configureSession();
|
QBtSession::instance()->configureSession();
|
||||||
|
|
||||||
@ -1274,7 +1281,7 @@ void MainWindow::on_actionExecution_Logs_triggered(bool checked)
|
|||||||
Q_ASSERT(!m_executionLog);
|
Q_ASSERT(!m_executionLog);
|
||||||
m_executionLog = new ExecutionLog(tabs);
|
m_executionLog = new ExecutionLog(tabs);
|
||||||
int index_tab = tabs->addTab(m_executionLog, tr("Execution Log"));
|
int index_tab = tabs->addTab(m_executionLog, tr("Execution Log"));
|
||||||
tabs->setTabIcon(index_tab, misc::getIcon("view-calendar-journal"));
|
tabs->setTabIcon(index_tab, IconProvider::instance()->getIcon("view-calendar-journal"));
|
||||||
} else {
|
} else {
|
||||||
if(m_executionLog)
|
if(m_executionLog)
|
||||||
delete m_executionLog;
|
delete m_executionLog;
|
||||||
|
27
src/misc.h
27
src/misc.h
@ -84,33 +84,6 @@ public:
|
|||||||
return libtorrent::sha1_hash(qPrintable(hash));
|
return libtorrent::sha1_hash(qPrintable(hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
|
||||||
static inline QIcon getIcon(const QString& iconId) {
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
|
||||||
const QIcon icon = QIcon::fromTheme(iconId, QIcon(":/Icons/oxygen/"+iconId+".png"));
|
|
||||||
#else
|
|
||||||
const QIcon icon(":/Icons/oxygen/"+iconId+".png");
|
|
||||||
#endif
|
|
||||||
Q_ASSERT(!icon.isNull());
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static QString getIconPath(const QString &iconId) {
|
|
||||||
#if !defined(DISABLE_GUI) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
|
||||||
QString path = QDir::temp().absoluteFilePath(iconId+".png");
|
|
||||||
if(!QFile::exists(path)) {
|
|
||||||
const QIcon icon = QIcon::fromTheme(iconId);
|
|
||||||
if(icon.isNull()) return ":/Icons/oxygen/"+iconId+".png";
|
|
||||||
QPixmap px = icon.pixmap(32);
|
|
||||||
px.save(path);
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
#else
|
|
||||||
return ":/Icons/oxygen/"+iconId+".png";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void chmod644(const QDir& folder);
|
static void chmod644(const QDir& folder);
|
||||||
|
|
||||||
static inline QString removeLastPathPart(QString path) {
|
static inline QString removeLastPathPart(QString path) {
|
||||||
|
@ -14,6 +14,9 @@ enum AdvSettingsCols {PROPERTY, VALUE};
|
|||||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
|
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
|
||||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||||
UPDATE_CHECK,
|
UPDATE_CHECK,
|
||||||
|
#endif
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
USE_ICON_THEME,
|
||||||
#endif
|
#endif
|
||||||
ROW_COUNT };
|
ROW_COUNT };
|
||||||
|
|
||||||
@ -27,6 +30,9 @@ private:
|
|||||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||||
QCheckBox *cb_update_check;
|
QCheckBox *cb_update_check;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
QCheckBox *cb_use_icon_theme;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AdvancedSettings(QWidget *parent=0): QTableWidget(parent) {
|
AdvancedSettings(QWidget *parent=0): QTableWidget(parent) {
|
||||||
@ -63,6 +69,9 @@ public:
|
|||||||
delete cb_tracker_status;
|
delete cb_tracker_status;
|
||||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||||
delete cb_update_check;
|
delete cb_update_check;
|
||||||
|
#endif
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
delete cb_use_icon_theme;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +114,10 @@ public slots:
|
|||||||
pref.setTrackerPort(spin_tracker_port->value());
|
pref.setTrackerPort(spin_tracker_port->value());
|
||||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||||
pref.setUpdateCheckEnabled(cb_update_check->isChecked());
|
pref.setUpdateCheckEnabled(cb_update_check->isChecked());
|
||||||
|
#endif
|
||||||
|
// Icon theme
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
pref.useSystemIconTheme(cb_use_icon_theme->isChecked());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,6 +247,13 @@ protected slots:
|
|||||||
connect(cb_update_check, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
connect(cb_update_check, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||||
cb_update_check->setChecked(pref.isUpdateCheckEnabled());
|
cb_update_check->setChecked(pref.isUpdateCheckEnabled());
|
||||||
setCellWidget(UPDATE_CHECK, VALUE, cb_update_check);
|
setCellWidget(UPDATE_CHECK, VALUE, cb_update_check);
|
||||||
|
#endif
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
setItem(USE_ICON_THEME, PROPERTY, new QTableWidgetItem(tr("Use system icon theme")));
|
||||||
|
cb_use_icon_theme = new QCheckBox();
|
||||||
|
connect(cb_use_icon_theme, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||||
|
cb_use_icon_theme->setChecked(pref.useSystemIconTheme());
|
||||||
|
setCellWidget(USE_ICON_THEME, VALUE, cb_use_icon_theme);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "scannedfoldersmodel.h"
|
#include "scannedfoldersmodel.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "qbtsession.h"
|
#include "qbtsession.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@ -61,14 +62,14 @@ options_imp::options_imp(QWidget *parent):
|
|||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
// Icons
|
// Icons
|
||||||
tabSelection->item(TAB_UI)->setIcon(misc::getIcon("preferences-desktop"));
|
tabSelection->item(TAB_UI)->setIcon(IconProvider::instance()->getIcon("preferences-desktop"));
|
||||||
tabSelection->item(TAB_BITTORRENT)->setIcon(misc::getIcon("preferences-system-network"));
|
tabSelection->item(TAB_BITTORRENT)->setIcon(IconProvider::instance()->getIcon("preferences-system-network"));
|
||||||
tabSelection->item(TAB_CONNECTION)->setIcon(misc::getIcon("network-wired"));
|
tabSelection->item(TAB_CONNECTION)->setIcon(IconProvider::instance()->getIcon("network-wired"));
|
||||||
tabSelection->item(TAB_DOWNLOADS)->setIcon(misc::getIcon("download"));
|
tabSelection->item(TAB_DOWNLOADS)->setIcon(IconProvider::instance()->getIcon("download"));
|
||||||
tabSelection->item(TAB_SPEED)->setIcon(misc::getIcon("chronometer"));
|
tabSelection->item(TAB_SPEED)->setIcon(IconProvider::instance()->getIcon("chronometer"));
|
||||||
tabSelection->item(TAB_WEBUI)->setIcon(misc::getIcon("network-server"));
|
tabSelection->item(TAB_WEBUI)->setIcon(IconProvider::instance()->getIcon("network-server"));
|
||||||
tabSelection->item(TAB_ADVANCED)->setIcon(misc::getIcon("preferences-other"));
|
tabSelection->item(TAB_ADVANCED)->setIcon(IconProvider::instance()->getIcon("preferences-other"));
|
||||||
IpFilterRefreshBtn->setIcon(misc::getIcon("view-refresh"));
|
IpFilterRefreshBtn->setIcon(IconProvider::instance()->getIcon("view-refresh"));
|
||||||
|
|
||||||
hsplitter->setCollapsible(0, false);
|
hsplitter->setCollapsible(0, false);
|
||||||
hsplitter->setCollapsible(1, false);
|
hsplitter->setCollapsible(1, false);
|
||||||
|
@ -856,6 +856,16 @@ public:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_WS_X11) && (QT_VERSION >= QT_VERSION_CHECK(4,6,0))
|
||||||
|
bool useSystemIconTheme() const {
|
||||||
|
return value(QString::fromUtf8("Preferences/Advanced/useSystemIconTheme"), true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void useSystemIconTheme(bool enabled) {
|
||||||
|
setValue(QString::fromUtf8("Preferences/Advanced/useSystemIconTheme"), enabled);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList getTorrentLabels() const {
|
QStringList getTorrentLabels() const {
|
||||||
return value("TransferListFilters/customLabels").toStringList();
|
return value("TransferListFilters/customLabels").toStringList();
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "geoipmanager.h"
|
#include "geoipmanager.h"
|
||||||
#include "peeraddition.h"
|
#include "peeraddition.h"
|
||||||
#include "speedlimitdlg.h"
|
#include "speedlimitdlg.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
@ -134,7 +135,7 @@ void PeerListWidget::showPeerListMenu(QPoint) {
|
|||||||
// Add Peer Action
|
// Add Peer Action
|
||||||
QAction *addPeerAct = 0;
|
QAction *addPeerAct = 0;
|
||||||
if(!h.is_queued() && !h.is_checking()) {
|
if(!h.is_queued() && !h.is_checking()) {
|
||||||
addPeerAct = menu.addAction(misc::getIcon("user-group-new"), tr("Add a new peer..."));
|
addPeerAct = menu.addAction(IconProvider::instance()->getIcon("user-group-new"), tr("Add a new peer..."));
|
||||||
empty_menu = false;
|
empty_menu = false;
|
||||||
}
|
}
|
||||||
// Per Peer Speed limiting actions
|
// Per Peer Speed limiting actions
|
||||||
@ -143,12 +144,12 @@ void PeerListWidget::showPeerListMenu(QPoint) {
|
|||||||
QAction *banAct = 0;
|
QAction *banAct = 0;
|
||||||
QAction *copyIPAct = 0;
|
QAction *copyIPAct = 0;
|
||||||
if(!selectedPeerIPs.isEmpty()) {
|
if(!selectedPeerIPs.isEmpty()) {
|
||||||
copyIPAct = menu.addAction(misc::getIcon("edit-copy"), tr("Copy IP"));
|
copyIPAct = menu.addAction(IconProvider::instance()->getIcon("edit-copy"), tr("Copy IP"));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
dlLimitAct = menu.addAction(QIcon(":/Icons/skin/download.png"), tr("Limit download rate..."));
|
dlLimitAct = menu.addAction(QIcon(":/Icons/skin/download.png"), tr("Limit download rate..."));
|
||||||
upLimitAct = menu.addAction(QIcon(":/Icons/skin/seeding.png"), tr("Limit upload rate..."));
|
upLimitAct = menu.addAction(QIcon(":/Icons/skin/seeding.png"), tr("Limit upload rate..."));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
banAct = menu.addAction(misc::getIcon("user-group-delete"), tr("Ban peer permanently"));
|
banAct = menu.addAction(IconProvider::instance()->getIcon("user-group-delete"), tr("Ban peer permanently"));
|
||||||
empty_menu = false;
|
empty_menu = false;
|
||||||
}
|
}
|
||||||
if(empty_menu) return;
|
if(empty_menu) return;
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "pieceavailabilitybar.h"
|
#include "pieceavailabilitybar.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "proptabbar.h"
|
#include "proptabbar.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@ -62,10 +63,10 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
|
|||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
deleteWS_button->setIcon(misc::getIcon("list-remove"));
|
deleteWS_button->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
addWS_button->setIcon(misc::getIcon("list-add"));
|
addWS_button->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
trackerUpButton->setIcon(misc::getIcon("go-up"));
|
trackerUpButton->setIcon(IconProvider::instance()->getIcon("go-up"));
|
||||||
trackerDownButton->setIcon(misc::getIcon("go-down"));
|
trackerDownButton->setIcon(IconProvider::instance()->getIcon("go-down"));
|
||||||
|
|
||||||
state = VISIBLE;
|
state = VISIBLE;
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
@ -485,7 +486,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&){
|
|||||||
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
|
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
|
||||||
QAction *actRename = 0;
|
QAction *actRename = 0;
|
||||||
if(selectedRows.size() == 1) {
|
if(selectedRows.size() == 1) {
|
||||||
actRename = myFilesLlistMenu.addAction(misc::getIcon("edit-rename"), tr("Rename..."));
|
actRename = myFilesLlistMenu.addAction(IconProvider::instance()->getIcon("edit-rename"), tr("Rename..."));
|
||||||
myFilesLlistMenu.addSeparator();
|
myFilesLlistMenu.addSeparator();
|
||||||
}
|
}
|
||||||
QMenu subMenu;
|
QMenu subMenu;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
|
|
||||||
#include "proptabbar.h"
|
#include "proptabbar.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
#define DEFAULT_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px; margin-left: 8px; margin-right: 8px;}"
|
#define DEFAULT_BUTTON_CSS "QPushButton {border: 1px solid rgb(85, 81, 91);border-radius: 3px;padding: 2px; margin-left: 8px; margin-right: 8px;}"
|
||||||
@ -52,32 +52,32 @@ PropTabBar::PropTabBar(QWidget *parent) :
|
|||||||
m_btnGroup = new QButtonGroup(this);
|
m_btnGroup = new QButtonGroup(this);
|
||||||
setContentsMargins(5, 4, 5, 2);
|
setContentsMargins(5, 4, 5, 2);
|
||||||
// General tab
|
// General tab
|
||||||
QPushButton *main_infos_button = new QPushButton(misc::getIcon("document-properties"), tr("General"), parent);
|
QPushButton *main_infos_button = new QPushButton(IconProvider::instance()->getIcon("document-properties"), tr("General"), parent);
|
||||||
main_infos_button->setShortcut(QKeySequence(QString::fromUtf8("Alt+P")));
|
main_infos_button->setShortcut(QKeySequence(QString::fromUtf8("Alt+P")));
|
||||||
main_infos_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
main_infos_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
||||||
main_infos_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
main_infos_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
||||||
addWidget(main_infos_button);
|
addWidget(main_infos_button);
|
||||||
m_btnGroup->addButton(main_infos_button, MAIN_TAB);
|
m_btnGroup->addButton(main_infos_button, MAIN_TAB);
|
||||||
// Trackers tab
|
// Trackers tab
|
||||||
QPushButton *trackers_button = new QPushButton(misc::getIcon("network-server"), tr("Trackers"), parent);
|
QPushButton *trackers_button = new QPushButton(IconProvider::instance()->getIcon("network-server"), tr("Trackers"), parent);
|
||||||
trackers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
trackers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
||||||
trackers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
trackers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
||||||
addWidget(trackers_button);
|
addWidget(trackers_button);
|
||||||
m_btnGroup->addButton(trackers_button, TRACKERS_TAB);
|
m_btnGroup->addButton(trackers_button, TRACKERS_TAB);
|
||||||
// Peers tab
|
// Peers tab
|
||||||
QPushButton *peers_button = new QPushButton(misc::getIcon("edit-find-user"), tr("Peers"), parent);
|
QPushButton *peers_button = new QPushButton(IconProvider::instance()->getIcon("edit-find-user"), tr("Peers"), parent);
|
||||||
peers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
peers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
||||||
peers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
peers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
||||||
addWidget(peers_button);
|
addWidget(peers_button);
|
||||||
m_btnGroup->addButton(peers_button, PEERS_TAB);
|
m_btnGroup->addButton(peers_button, PEERS_TAB);
|
||||||
// URL seeds tab
|
// URL seeds tab
|
||||||
QPushButton *urlseeds_button = new QPushButton(misc::getIcon("network-server"), tr("HTTP Sources"), parent);
|
QPushButton *urlseeds_button = new QPushButton(IconProvider::instance()->getIcon("network-server"), tr("HTTP Sources"), parent);
|
||||||
urlseeds_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
urlseeds_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
||||||
urlseeds_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
urlseeds_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
||||||
addWidget(urlseeds_button);
|
addWidget(urlseeds_button);
|
||||||
m_btnGroup->addButton(urlseeds_button, URLSEEDS_TAB);
|
m_btnGroup->addButton(urlseeds_button, URLSEEDS_TAB);
|
||||||
// Files tab
|
// Files tab
|
||||||
QPushButton *files_button = new QPushButton(misc::getIcon("inode-directory"), tr("Content"), parent);
|
QPushButton *files_button = new QPushButton(IconProvider::instance()->getIcon("inode-directory"), tr("Content"), parent);
|
||||||
files_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
files_button->setStyleSheet(DEFAULT_BUTTON_CSS);
|
||||||
files_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
files_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
|
||||||
addWidget(files_button);
|
addWidget(files_button);
|
||||||
|
@ -39,9 +39,10 @@
|
|||||||
#include "trackerlist.h"
|
#include "trackerlist.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
#include "trackersadditiondlg.h"
|
#include "trackersadditiondlg.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
#include "qbtsession.h"
|
#include "qbtsession.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@ -341,13 +342,13 @@ void TrackerList::showTrackerListMenu(QPoint) {
|
|||||||
//QList<QTreeWidgetItem*> selected_items = getSelectedTrackerItems();
|
//QList<QTreeWidgetItem*> selected_items = getSelectedTrackerItems();
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
// Add actions
|
// Add actions
|
||||||
QAction *addAct = menu.addAction(misc::getIcon("list-add"), tr("Add a new tracker..."));
|
QAction *addAct = menu.addAction(IconProvider::instance()->getIcon("list-add"), tr("Add a new tracker..."));
|
||||||
QAction *delAct = 0;
|
QAction *delAct = 0;
|
||||||
if(!getSelectedTrackerItems().isEmpty()) {
|
if(!getSelectedTrackerItems().isEmpty()) {
|
||||||
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Remove tracker"));
|
delAct = menu.addAction(IconProvider::instance()->getIcon("list-remove"), tr("Remove tracker"));
|
||||||
}
|
}
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction *reannounceAct = menu.addAction(misc::getIcon("view-refresh"), tr("Force reannounce"));
|
QAction *reannounceAct = menu.addAction(IconProvider::instance()->getIcon("view-refresh"), tr("Force reannounce"));
|
||||||
QAction *act = menu.exec(QCursor::pos());
|
QAction *act = menu.exec(QCursor::pos());
|
||||||
if(act == 0) return;
|
if(act == 0) return;
|
||||||
if(act == addAct) {
|
if(act == addAct) {
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include "iconprovider.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "ui_trackersadditiondlg.h"
|
#include "ui_trackersadditiondlg.h"
|
||||||
#include "downloadthread.h"
|
#include "downloadthread.h"
|
||||||
@ -51,7 +52,7 @@ public:
|
|||||||
TrackersAdditionDlg(QTorrentHandle h, QWidget *parent=0): QDialog(parent), h(h) {
|
TrackersAdditionDlg(QTorrentHandle h, QWidget *parent=0): QDialog(parent), h(h) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
uTorrentListButton->setIcon(misc::getIcon("download"));
|
uTorrentListButton->setIcon(IconProvider::instance()->getIcon("download"));
|
||||||
// As a default, use torrentz.com link
|
// As a default, use torrentz.com link
|
||||||
list_url->setText("http://www.torrentz.com/announce_"+h.hash());
|
list_url->setText("http://www.torrentz.com/announce_"+h.hash());
|
||||||
list_url->setCursorPosition(0);
|
list_url->setCursorPosition(0);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "rssmanager.h"
|
#include "rssmanager.h"
|
||||||
#include "rssfeed.h"
|
#include "rssfeed.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
|
AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@ -52,8 +52,8 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
ui->removeRuleBtn->setIcon(misc::getIcon("list-remove"));
|
ui->removeRuleBtn->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
ui->addRuleBtn->setIcon(misc::getIcon("list-add"));
|
ui->addRuleBtn->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
|
|
||||||
// Ui Settings
|
// Ui Settings
|
||||||
ui->listRules->setSortingEnabled(true);
|
ui->listRules->setSortingEnabled(true);
|
||||||
@ -361,17 +361,17 @@ void AutomatedRssDownloader::displayRulesListMenu(const QPoint &pos)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(pos);
|
Q_UNUSED(pos);
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *addAct = menu.addAction(misc::getIcon("list-add"), tr("Add new rule..."));
|
QAction *addAct = menu.addAction(IconProvider::instance()->getIcon("list-add"), tr("Add new rule..."));
|
||||||
QAction *delAct = 0;
|
QAction *delAct = 0;
|
||||||
QAction *renameAct = 0;
|
QAction *renameAct = 0;
|
||||||
const QList<QListWidgetItem*> selection = ui->listRules->selectedItems();
|
const QList<QListWidgetItem*> selection = ui->listRules->selectedItems();
|
||||||
if(!selection.isEmpty()) {
|
if(!selection.isEmpty()) {
|
||||||
if(selection.count() == 1) {
|
if(selection.count() == 1) {
|
||||||
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Delete rule"));
|
delAct = menu.addAction(IconProvider::instance()->getIcon("list-remove"), tr("Delete rule"));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
renameAct = menu.addAction(misc::getIcon("edit-rename"), tr("Rename rule..."));
|
renameAct = menu.addAction(IconProvider::instance()->getIcon("edit-rename"), tr("Rename rule..."));
|
||||||
} else {
|
} else {
|
||||||
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Delete selected rules"));
|
delAct = menu.addAction(IconProvider::instance()->getIcon("list-remove"), tr("Delete selected rules"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QAction *act = menu.exec(QCursor::pos());
|
QAction *act = menu.exec(QCursor::pos());
|
||||||
@ -480,7 +480,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS
|
|||||||
QFont f = treeFeedItem->font(0);
|
QFont f = treeFeedItem->font(0);
|
||||||
f.setBold(true);
|
f.setBold(true);
|
||||||
treeFeedItem->setFont(0, f);
|
treeFeedItem->setFont(0, f);
|
||||||
treeFeedItem->setData(0, Qt::DecorationRole, misc::getIcon("inode-directory"));
|
treeFeedItem->setData(0, Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory"));
|
||||||
treeFeedItem->setData(0, Qt::UserRole, feed->getUrl());
|
treeFeedItem->setData(0, Qt::UserRole, feed->getUrl());
|
||||||
ui->treeMatchingArticles->addTopLevelItem(treeFeedItem);
|
ui->treeMatchingArticles->addTopLevelItem(treeFeedItem);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "cookiesdlg.h"
|
#include "cookiesdlg.h"
|
||||||
#include "ui_cookiesdlg.h"
|
#include "ui_cookiesdlg.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
#include <QNetworkCookie>
|
#include <QNetworkCookie>
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ CookiesDlg::CookiesDlg(QWidget *parent, const QList<QByteArray> &raw_cookies) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
ui->add_btn->setIcon(misc::getIcon("list-add"));
|
ui->add_btn->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
ui->del_btn->setIcon(misc::getIcon("list-remove"));
|
ui->del_btn->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
|
|
||||||
ui->infos_lbl->setText(tr("Common keys for cookies are : '%1', '%2'.\nYou should get this information from your Web browser preferences.").arg("uid").arg("pass"));
|
ui->infos_lbl->setText(tr("Common keys for cookies are : '%1', '%2'.\nYou should get this information from your Web browser preferences.").arg("uid").arg("pass"));
|
||||||
foreach(const QByteArray &raw_cookie, raw_cookies) {
|
foreach(const QByteArray &raw_cookie, raw_cookies) {
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "feedlistwidget.h"
|
#include "feedlistwidget.h"
|
||||||
#include "rssmanager.h"
|
#include "rssmanager.h"
|
||||||
#include "rssfeed.h"
|
#include "rssfeed.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
FeedListWidget::FeedListWidget(QWidget *parent, RssManager *rssmanager): QTreeWidget(parent), rssmanager(rssmanager) {
|
FeedListWidget::FeedListWidget(QWidget *parent, RssManager *rssmanager): QTreeWidget(parent), rssmanager(rssmanager) {
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
@ -41,7 +41,7 @@ FeedListWidget::FeedListWidget(QWidget *parent, RssManager *rssmanager): QTreeWi
|
|||||||
headerItem()->setText(0, tr("RSS feeds"));
|
headerItem()->setText(0, tr("RSS feeds"));
|
||||||
unread_item = new QTreeWidgetItem(this);
|
unread_item = new QTreeWidgetItem(this);
|
||||||
unread_item->setText(0, tr("Unread") + QString::fromUtf8(" (") + QString::number(rssmanager->getNbUnRead(), 10)+ QString(")"));
|
unread_item->setText(0, tr("Unread") + QString::fromUtf8(" (") + QString::number(rssmanager->getNbUnRead(), 10)+ QString(")"));
|
||||||
unread_item->setData(0,Qt::DecorationRole, misc::getIcon("mail-folder-inbox"));
|
unread_item->setData(0,Qt::DecorationRole, IconProvider::instance()->getIcon("mail-folder-inbox"));
|
||||||
itemAdded(unread_item, rssmanager);
|
itemAdded(unread_item, rssmanager);
|
||||||
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
|
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
|
||||||
setCurrentItem(unread_item);
|
setCurrentItem(unread_item);
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
#include "searchengine.h"
|
#include "searchengine.h"
|
||||||
#include "pluginsource.h"
|
#include "pluginsource.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -52,7 +53,7 @@ engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_en
|
|||||||
pluginsTree->header()->resizeSection(0, 170);
|
pluginsTree->header()->resizeSection(0, 170);
|
||||||
pluginsTree->header()->resizeSection(1, 220);
|
pluginsTree->header()->resizeSection(1, 220);
|
||||||
pluginsTree->hideColumn(ENGINE_ID);
|
pluginsTree->hideColumn(ENGINE_ID);
|
||||||
actionUninstall->setIcon(misc::getIcon("list-remove"));
|
actionUninstall->setIcon(IconProvider::instance()->getIcon("list-remove"));
|
||||||
connect(actionEnable, SIGNAL(toggled(bool)), this, SLOT(enableSelection(bool)));
|
connect(actionEnable, SIGNAL(toggled(bool)), this, SLOT(enableSelection(bool)));
|
||||||
connect(pluginsTree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayContextMenu(const QPoint&)));
|
connect(pluginsTree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayContextMenu(const QPoint&)));
|
||||||
downloader = new downloadThread(this);
|
downloader = new downloadThread(this);
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
#include "searchlistdelegate.h"
|
#include "searchlistdelegate.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
#define SEARCHHISTORY_MAXSIZE 50
|
#define SEARCHHISTORY_MAXSIZE 50
|
||||||
|
|
||||||
@ -63,10 +64,10 @@
|
|||||||
SearchEngine::SearchEngine(MainWindow *parent) : QWidget(parent), mp_mainWindow(parent) {
|
SearchEngine::SearchEngine(MainWindow *parent) : QWidget(parent), mp_mainWindow(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
search_button->setIcon(misc::getIcon("edit-find"));
|
search_button->setIcon(IconProvider::instance()->getIcon("edit-find"));
|
||||||
download_button->setIcon(misc::getIcon("download"));
|
download_button->setIcon(IconProvider::instance()->getIcon("download"));
|
||||||
goToDescBtn->setIcon(misc::getIcon("application-x-mswinurl"));
|
goToDescBtn->setIcon(IconProvider::instance()->getIcon("application-x-mswinurl"));
|
||||||
enginesButton->setIcon(misc::getIcon("preferences-system-network"));
|
enginesButton->setIcon(IconProvider::instance()->getIcon("preferences-system-network"));
|
||||||
// new qCompleter to the search pattern
|
// new qCompleter to the search pattern
|
||||||
startSearchHistory();
|
startSearchHistory();
|
||||||
createCompleter();
|
createCompleter();
|
||||||
@ -76,7 +77,7 @@ SearchEngine::SearchEngine(MainWindow *parent) : QWidget(parent), mp_mainWindow(
|
|||||||
#else
|
#else
|
||||||
// Add close tab button
|
// Add close tab button
|
||||||
closeTab_button = new QPushButton();
|
closeTab_button = new QPushButton();
|
||||||
closeTab_button->setIcon(misc::getIcon("tab-close"));
|
closeTab_button->setIcon(IconProvider::instance()->getIcon("tab-close"));
|
||||||
closeTab_button->setFlat(true);
|
closeTab_button->setFlat(true);
|
||||||
tabWidget->setCornerWidget(closeTab_button);
|
tabWidget->setCornerWidget(closeTab_button);
|
||||||
connect(closeTab_button, SIGNAL(clicked()), this, SLOT(closeTab_button_clicked()));
|
connect(closeTab_button, SIGNAL(clicked()), this, SLOT(closeTab_button_clicked()));
|
||||||
@ -205,11 +206,11 @@ SearchEngine::~SearchEngine(){
|
|||||||
|
|
||||||
void SearchEngine::displayPatternContextMenu(QPoint) {
|
void SearchEngine::displayPatternContextMenu(QPoint) {
|
||||||
QMenu myMenu(this);
|
QMenu myMenu(this);
|
||||||
QAction cutAct(misc::getIcon("edit-cut"), tr("Cut"), &myMenu);
|
QAction cutAct(IconProvider::instance()->getIcon("edit-cut"), tr("Cut"), &myMenu);
|
||||||
QAction copyAct(misc::getIcon("edit-copy"), tr("Copy"), &myMenu);
|
QAction copyAct(IconProvider::instance()->getIcon("edit-copy"), tr("Copy"), &myMenu);
|
||||||
QAction pasteAct(misc::getIcon("edit-paste"), tr("Paste"), &myMenu);
|
QAction pasteAct(IconProvider::instance()->getIcon("edit-paste"), tr("Paste"), &myMenu);
|
||||||
QAction clearAct(misc::getIcon("edit-clear"), tr("Clear field"), &myMenu);
|
QAction clearAct(IconProvider::instance()->getIcon("edit-clear"), tr("Clear field"), &myMenu);
|
||||||
QAction clearHistoryAct(misc::getIcon("edit-clear-history"), tr("Clear completion history"), &myMenu);
|
QAction clearHistoryAct(IconProvider::instance()->getIcon("edit-clear-history"), tr("Clear completion history"), &myMenu);
|
||||||
bool hasCopyAct = false;
|
bool hasCopyAct = false;
|
||||||
if(search_pattern->hasSelectedText()) {
|
if(search_pattern->hasSelectedText()) {
|
||||||
myMenu.addAction(&cutAct);
|
myMenu.addAction(&cutAct);
|
||||||
|
@ -131,7 +131,8 @@ nox {
|
|||||||
hidabletabwidget.h \
|
hidabletabwidget.h \
|
||||||
sessionapplication.h \
|
sessionapplication.h \
|
||||||
torrentimportdlg.h \
|
torrentimportdlg.h \
|
||||||
executionlog.h
|
executionlog.h \
|
||||||
|
iconprovider.h
|
||||||
|
|
||||||
SOURCES += mainwindow.cpp \
|
SOURCES += mainwindow.cpp \
|
||||||
ico.cpp \
|
ico.cpp \
|
||||||
@ -140,7 +141,8 @@ nox {
|
|||||||
sessionapplication.cpp \
|
sessionapplication.cpp \
|
||||||
torrentimportdlg.cpp \
|
torrentimportdlg.cpp \
|
||||||
executionlog.cpp \
|
executionlog.cpp \
|
||||||
previewselect.cpp
|
previewselect.cpp \
|
||||||
|
iconprovider.cpp
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
HEADERS += programupdater.h
|
HEADERS += programupdater.h
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "proplistdelegate.h"
|
#include "proplistdelegate.h"
|
||||||
#include "torrentpersistentdata.h"
|
#include "torrentpersistentdata.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
#include "torrentadditiondlg.h"
|
#include "torrentadditiondlg.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
@ -63,8 +63,8 @@ torrentAdditionDialog::torrentAdditionDialog(QWidget *parent) :
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
// Icons
|
// Icons
|
||||||
CancelButton->setIcon(misc::getIcon("dialog-cancel"));
|
CancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
||||||
OkButton->setIcon(misc::getIcon("list-add"));
|
OkButton->setIcon(IconProvider::instance()->getIcon("list-add"));
|
||||||
// Set Properties list model
|
// Set Properties list model
|
||||||
PropListModel = new TorrentFilesModel();
|
PropListModel = new TorrentFilesModel();
|
||||||
connect(PropListModel, SIGNAL(filteredFilesChanged()), SLOT(updateDiskSpaceLabels()));
|
connect(PropListModel, SIGNAL(filteredFilesChanged()), SLOT(updateDiskSpaceLabels()));
|
||||||
@ -326,7 +326,7 @@ void torrentAdditionDialog::displayContentListMenu(const QPoint&) {
|
|||||||
const QModelIndexList selectedRows = torrentContentList->selectionModel()->selectedRows(0);
|
const QModelIndexList selectedRows = torrentContentList->selectionModel()->selectedRows(0);
|
||||||
QAction *actRename = 0;
|
QAction *actRename = 0;
|
||||||
if(selectedRows.size() == 1 && t->num_files() > 1) {
|
if(selectedRows.size() == 1 && t->num_files() > 1) {
|
||||||
actRename = myFilesLlistMenu.addAction(misc::getIcon("edit-rename"), tr("Rename..."));
|
actRename = myFilesLlistMenu.addAction(IconProvider::instance()->getIcon("edit-rename"), tr("Rename..."));
|
||||||
myFilesLlistMenu.addSeparator();
|
myFilesLlistMenu.addSeparator();
|
||||||
}
|
}
|
||||||
QMenu subMenu;
|
QMenu subMenu;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "torrentcreatorthread.h"
|
#include "torrentcreatorthread.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
const uint NB_PIECES_MIN = 1200;
|
const uint NB_PIECES_MIN = 1200;
|
||||||
const uint NB_PIECES_MAX = 2200;
|
const uint NB_PIECES_MAX = 2200;
|
||||||
@ -46,10 +47,10 @@ using namespace libtorrent;
|
|||||||
TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent): QDialog(parent), creatorThread(0) {
|
TorrentCreatorDlg::TorrentCreatorDlg(QWidget *parent): QDialog(parent), creatorThread(0) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
addFile_button->setIcon(misc::getIcon("document-new"));
|
addFile_button->setIcon(IconProvider::instance()->getIcon("document-new"));
|
||||||
addFolder_button->setIcon(misc::getIcon("folder-new"));
|
addFolder_button->setIcon(IconProvider::instance()->getIcon("folder-new"));
|
||||||
createButton->setIcon(misc::getIcon("document-save"));
|
createButton->setIcon(IconProvider::instance()->getIcon("document-save"));
|
||||||
cancelButton->setIcon(misc::getIcon("dialog-cancel"));
|
cancelButton->setIcon(IconProvider::instance()->getIcon("dialog-cancel"));
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <libtorrent/torrent_info.hpp>
|
#include <libtorrent/torrent_info.hpp>
|
||||||
#include "proplistdelegate.h"
|
#include "proplistdelegate.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
enum FilePriority {IGNORED=0, NORMAL=1, HIGH=2, MAXIMUM=7, PARTIAL=-1};
|
enum FilePriority {IGNORED=0, NORMAL=1, HIGH=2, MAXIMUM=7, PARTIAL=-1};
|
||||||
enum TreeItemType {TFILE, FOLDER, ROOT};
|
enum TreeItemType {TFILE, FOLDER, ROOT};
|
||||||
@ -434,9 +434,9 @@ public:
|
|||||||
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
|
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
|
||||||
if(index.column() == 0 && role == Qt::DecorationRole) {
|
if(index.column() == 0 && role == Qt::DecorationRole) {
|
||||||
if(item->isFolder())
|
if(item->isFolder())
|
||||||
return misc::getIcon("inode-directory");
|
return IconProvider::instance()->getIcon("inode-directory");
|
||||||
else
|
else
|
||||||
return misc::getIcon("text-plain");
|
return IconProvider::instance()->getIcon("text-plain");
|
||||||
}
|
}
|
||||||
if(index.column() == 0 && role == Qt::CheckStateRole) {
|
if(index.column() == 0 && role == Qt::CheckStateRole) {
|
||||||
if(item->data(TreeItem::COL_PRIO).toInt() == IGNORED)
|
if(item->data(TreeItem::COL_PRIO).toInt() == IGNORED)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "qbtsession.h"
|
#include "qbtsession.h"
|
||||||
#include "torrentpersistentdata.h"
|
#include "torrentpersistentdata.h"
|
||||||
#include "misc.h"
|
#include "iconprovider.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@ -47,9 +47,9 @@ TorrentImportDlg::TorrentImportDlg(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// Icons
|
// Icons
|
||||||
ui->lbl_info->setPixmap(misc::getIcon("dialog-information").pixmap(ui->lbl_info->height()));
|
ui->lbl_info->setPixmap(IconProvider::instance()->getIcon("dialog-information").pixmap(ui->lbl_info->height()));
|
||||||
ui->lbl_info->setFixedWidth(ui->lbl_info->height());
|
ui->lbl_info->setFixedWidth(ui->lbl_info->height());
|
||||||
ui->importBtn->setIcon(misc::getIcon("document-import"));
|
ui->importBtn->setIcon(IconProvider::instance()->getIcon("document-import"));
|
||||||
// Libtorrent < 0.15 does not support skipping file checking
|
// Libtorrent < 0.15 does not support skipping file checking
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
#if LIBTORRENT_VERSION_MINOR < 15
|
||||||
ui->checkSkipCheck->setVisible(false);
|
ui->checkSkipCheck->setVisible(false);
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
#include "torrentmodel.h"
|
#include "torrentmodel.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
class LabelFiltersList: public QListWidget {
|
class LabelFiltersList: public QListWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -137,11 +138,11 @@ protected:
|
|||||||
void setItemHover(bool hover) {
|
void setItemHover(bool hover) {
|
||||||
Q_ASSERT(itemHover);
|
Q_ASSERT(itemHover);
|
||||||
if(hover) {
|
if(hover) {
|
||||||
itemHover->setData(Qt::DecorationRole, misc::getIcon("folder-documents.png"));
|
itemHover->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("folder-documents.png"));
|
||||||
itemHover->setSelected(true);
|
itemHover->setSelected(true);
|
||||||
//setCurrentItem(itemHover);
|
//setCurrentItem(itemHover);
|
||||||
} else {
|
} else {
|
||||||
itemHover->setData(Qt::DecorationRole, misc::getIcon("inode-directory.png"));
|
itemHover->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory.png"));
|
||||||
//itemHover->setSelected(false);
|
//itemHover->setSelected(false);
|
||||||
itemHover = 0;
|
itemHover = 0;
|
||||||
}
|
}
|
||||||
@ -247,10 +248,10 @@ public:
|
|||||||
// Add Label filters
|
// Add Label filters
|
||||||
QListWidgetItem *allLabels = new QListWidgetItem(labelFilters);
|
QListWidgetItem *allLabels = new QListWidgetItem(labelFilters);
|
||||||
allLabels->setData(Qt::DisplayRole, QVariant(tr("All labels") + " (0)"));
|
allLabels->setData(Qt::DisplayRole, QVariant(tr("All labels") + " (0)"));
|
||||||
allLabels->setData(Qt::DecorationRole, misc::getIcon("inode-directory"));
|
allLabels->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory"));
|
||||||
QListWidgetItem *noLabel = new QListWidgetItem(labelFilters);
|
QListWidgetItem *noLabel = new QListWidgetItem(labelFilters);
|
||||||
noLabel->setData(Qt::DisplayRole, QVariant(tr("Unlabeled") + " (0)"));
|
noLabel->setData(Qt::DisplayRole, QVariant(tr("Unlabeled") + " (0)"));
|
||||||
noLabel->setData(Qt::DecorationRole, misc::getIcon("inode-directory"));
|
noLabel->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory"));
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
loadSettings();
|
loadSettings();
|
||||||
@ -291,7 +292,7 @@ public:
|
|||||||
qDebug("Creating label QListWidgetItem: %s", qPrintable(label));
|
qDebug("Creating label QListWidgetItem: %s", qPrintable(label));
|
||||||
QListWidgetItem *newLabel = new QListWidgetItem();
|
QListWidgetItem *newLabel = new QListWidgetItem();
|
||||||
newLabel->setText(label + " (0)");
|
newLabel->setText(label + " (0)");
|
||||||
newLabel->setData(Qt::DecorationRole, misc::getIcon("inode-directory"));
|
newLabel->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory"));
|
||||||
labelFilters->addItem(newLabel);
|
labelFilters->addItem(newLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,7 +322,7 @@ protected slots:
|
|||||||
if(label.isEmpty() || customLabels.contains(label)) return;
|
if(label.isEmpty() || customLabels.contains(label)) return;
|
||||||
QListWidgetItem *newLabel = new QListWidgetItem();
|
QListWidgetItem *newLabel = new QListWidgetItem();
|
||||||
newLabel->setText(label + " (0)");
|
newLabel->setText(label + " (0)");
|
||||||
newLabel->setData(Qt::DecorationRole, misc::getIcon("inode-directory"));
|
newLabel->setData(Qt::DecorationRole, IconProvider::instance()->getIcon("inode-directory"));
|
||||||
labelFilters->addItem(newLabel);
|
labelFilters->addItem(newLabel);
|
||||||
customLabels.insert(label, 0);
|
customLabels.insert(label, 0);
|
||||||
Preferences().addTorrentLabel(label);
|
Preferences().addTorrentLabel(label);
|
||||||
@ -331,12 +332,12 @@ protected slots:
|
|||||||
QMenu labelMenu(labelFilters);
|
QMenu labelMenu(labelFilters);
|
||||||
QAction *removeAct = 0;
|
QAction *removeAct = 0;
|
||||||
if(!labelFilters->selectedItems().empty() && labelFilters->row(labelFilters->selectedItems().first()) > 1)
|
if(!labelFilters->selectedItems().empty() && labelFilters->row(labelFilters->selectedItems().first()) > 1)
|
||||||
removeAct = labelMenu.addAction(misc::getIcon("list-remove"), tr("Remove label"));
|
removeAct = labelMenu.addAction(IconProvider::instance()->getIcon("list-remove"), tr("Remove label"));
|
||||||
QAction *addAct = labelMenu.addAction(misc::getIcon("list-add"), tr("Add label..."));
|
QAction *addAct = labelMenu.addAction(IconProvider::instance()->getIcon("list-add"), tr("Add label..."));
|
||||||
labelMenu.addSeparator();
|
labelMenu.addSeparator();
|
||||||
QAction *startAct = labelMenu.addAction(misc::getIcon("media-playback-start"), tr("Resume torrents"));
|
QAction *startAct = labelMenu.addAction(IconProvider::instance()->getIcon("media-playback-start"), tr("Resume torrents"));
|
||||||
QAction *pauseAct = labelMenu.addAction(misc::getIcon("media-playback-pause"), tr("Pause torrents"));
|
QAction *pauseAct = labelMenu.addAction(IconProvider::instance()->getIcon("media-playback-pause"), tr("Pause torrents"));
|
||||||
QAction *deleteTorrentsAct = labelMenu.addAction(misc::getIcon("edit-delete"), tr("Delete torrents"));
|
QAction *deleteTorrentsAct = labelMenu.addAction(IconProvider::instance()->getIcon("edit-delete"), tr("Delete torrents"));
|
||||||
QAction *act = 0;
|
QAction *act = 0;
|
||||||
act = labelMenu.exec(QCursor::pos());
|
act = labelMenu.exec(QCursor::pos());
|
||||||
if(act) {
|
if(act) {
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#include "deletionconfirmationdlg.h"
|
#include "deletionconfirmationdlg.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
|
#include "iconprovider.h"
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@ -617,31 +618,31 @@ void TransferListWidget::removeLabelFromRows(QString label) {
|
|||||||
|
|
||||||
void TransferListWidget::displayListMenu(const QPoint&) {
|
void TransferListWidget::displayListMenu(const QPoint&) {
|
||||||
// Create actions
|
// Create actions
|
||||||
QAction actionStart(misc::getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0);
|
QAction actionStart(IconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0);
|
||||||
connect(&actionStart, SIGNAL(triggered()), this, SLOT(startSelectedTorrents()));
|
connect(&actionStart, SIGNAL(triggered()), this, SLOT(startSelectedTorrents()));
|
||||||
QAction actionPause(misc::getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), 0);
|
QAction actionPause(IconProvider::instance()->getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), 0);
|
||||||
connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents()));
|
connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents()));
|
||||||
QAction actionDelete(misc::getIcon("edit-delete"), tr("Delete", "Delete the torrent"), 0);
|
QAction actionDelete(IconProvider::instance()->getIcon("edit-delete"), tr("Delete", "Delete the torrent"), 0);
|
||||||
connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents()));
|
connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents()));
|
||||||
QAction actionPreview_file(misc::getIcon("view-preview"), tr("Preview file..."), 0);
|
QAction actionPreview_file(IconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0);
|
||||||
connect(&actionPreview_file, SIGNAL(triggered()), this, SLOT(previewSelectedTorrents()));
|
connect(&actionPreview_file, SIGNAL(triggered()), this, SLOT(previewSelectedTorrents()));
|
||||||
QAction actionSet_upload_limit(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")), tr("Limit upload rate..."), 0);
|
QAction actionSet_upload_limit(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")), tr("Limit upload rate..."), 0);
|
||||||
connect(&actionSet_upload_limit, SIGNAL(triggered()), this, SLOT(setUpLimitSelectedTorrents()));
|
connect(&actionSet_upload_limit, SIGNAL(triggered()), this, SLOT(setUpLimitSelectedTorrents()));
|
||||||
QAction actionSet_download_limit(QIcon(QString::fromUtf8(":/Icons/skin/download.png")), tr("Limit download rate..."), 0);
|
QAction actionSet_download_limit(QIcon(QString::fromUtf8(":/Icons/skin/download.png")), tr("Limit download rate..."), 0);
|
||||||
connect(&actionSet_download_limit, SIGNAL(triggered()), this, SLOT(setDlLimitSelectedTorrents()));
|
connect(&actionSet_download_limit, SIGNAL(triggered()), this, SLOT(setDlLimitSelectedTorrents()));
|
||||||
QAction actionOpen_destination_folder(misc::getIcon("inode-directory"), tr("Open destination folder"), 0);
|
QAction actionOpen_destination_folder(IconProvider::instance()->getIcon("inode-directory"), tr("Open destination folder"), 0);
|
||||||
connect(&actionOpen_destination_folder, SIGNAL(triggered()), this, SLOT(openSelectedTorrentsFolder()));
|
connect(&actionOpen_destination_folder, SIGNAL(triggered()), this, SLOT(openSelectedTorrentsFolder()));
|
||||||
QAction actionIncreasePriority(misc::getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), 0);
|
QAction actionIncreasePriority(IconProvider::instance()->getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), 0);
|
||||||
connect(&actionIncreasePriority, SIGNAL(triggered()), this, SLOT(increasePrioSelectedTorrents()));
|
connect(&actionIncreasePriority, SIGNAL(triggered()), this, SLOT(increasePrioSelectedTorrents()));
|
||||||
QAction actionDecreasePriority(misc::getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), 0);
|
QAction actionDecreasePriority(IconProvider::instance()->getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), 0);
|
||||||
connect(&actionDecreasePriority, SIGNAL(triggered()), this, SLOT(decreasePrioSelectedTorrents()));
|
connect(&actionDecreasePriority, SIGNAL(triggered()), this, SLOT(decreasePrioSelectedTorrents()));
|
||||||
QAction actionTopPriority(misc::getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), 0);
|
QAction actionTopPriority(IconProvider::instance()->getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), 0);
|
||||||
connect(&actionTopPriority, SIGNAL(triggered()), this, SLOT(topPrioSelectedTorrents()));
|
connect(&actionTopPriority, SIGNAL(triggered()), this, SLOT(topPrioSelectedTorrents()));
|
||||||
QAction actionBottomPriority(misc::getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), 0);
|
QAction actionBottomPriority(IconProvider::instance()->getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), 0);
|
||||||
connect(&actionBottomPriority, SIGNAL(triggered()), this, SLOT(bottomPrioSelectedTorrents()));
|
connect(&actionBottomPriority, SIGNAL(triggered()), this, SLOT(bottomPrioSelectedTorrents()));
|
||||||
QAction actionSetTorrentPath(misc::getIcon("inode-directory"), tr("Set location..."), 0);
|
QAction actionSetTorrentPath(IconProvider::instance()->getIcon("inode-directory"), tr("Set location..."), 0);
|
||||||
connect(&actionSetTorrentPath, SIGNAL(triggered()), this, SLOT(setSelectedTorrentsLocation()));
|
connect(&actionSetTorrentPath, SIGNAL(triggered()), this, SLOT(setSelectedTorrentsLocation()));
|
||||||
QAction actionForce_recheck(misc::getIcon("document-edit-verify"), tr("Force recheck"), 0);
|
QAction actionForce_recheck(IconProvider::instance()->getIcon("document-edit-verify"), tr("Force recheck"), 0);
|
||||||
connect(&actionForce_recheck, SIGNAL(triggered()), this, SLOT(recheckSelectedTorrents()));
|
connect(&actionForce_recheck, SIGNAL(triggered()), this, SLOT(recheckSelectedTorrents()));
|
||||||
QAction actionCopy_magnet_link(QIcon(":/Icons/magnet.png"), tr("Copy magnet link"), 0);
|
QAction actionCopy_magnet_link(QIcon(":/Icons/magnet.png"), tr("Copy magnet link"), 0);
|
||||||
connect(&actionCopy_magnet_link, SIGNAL(triggered()), this, SLOT(copySelectedMagnetURIs()));
|
connect(&actionCopy_magnet_link, SIGNAL(triggered()), this, SLOT(copySelectedMagnetURIs()));
|
||||||
@ -650,7 +651,7 @@ void TransferListWidget::displayListMenu(const QPoint&) {
|
|||||||
actionSuper_seeding_mode.setCheckable(true);
|
actionSuper_seeding_mode.setCheckable(true);
|
||||||
connect(&actionSuper_seeding_mode, SIGNAL(triggered()), this, SLOT(toggleSelectedTorrentsSuperSeeding()));
|
connect(&actionSuper_seeding_mode, SIGNAL(triggered()), this, SLOT(toggleSelectedTorrentsSuperSeeding()));
|
||||||
#endif
|
#endif
|
||||||
QAction actionRename(misc::getIcon("edit-rename"), tr("Rename..."), 0);
|
QAction actionRename(IconProvider::instance()->getIcon("edit-rename"), tr("Rename..."), 0);
|
||||||
connect(&actionRename, SIGNAL(triggered()), this, SLOT(renameSelectedTorrent()));
|
connect(&actionRename, SIGNAL(triggered()), this, SLOT(renameSelectedTorrent()));
|
||||||
QAction actionSequential_download(tr("Download in sequential order"), 0);
|
QAction actionSequential_download(tr("Download in sequential order"), 0);
|
||||||
actionSequential_download.setCheckable(true);
|
actionSequential_download.setCheckable(true);
|
||||||
@ -737,12 +738,12 @@ void TransferListWidget::displayListMenu(const QPoint&) {
|
|||||||
QStringList customLabels = getCustomLabels();
|
QStringList customLabels = getCustomLabels();
|
||||||
customLabels.sort();
|
customLabels.sort();
|
||||||
QList<QAction*> labelActions;
|
QList<QAction*> labelActions;
|
||||||
QMenu *labelMenu = listMenu.addMenu(misc::getIcon("view-categories"), tr("Label"));
|
QMenu *labelMenu = listMenu.addMenu(IconProvider::instance()->getIcon("view-categories"), tr("Label"));
|
||||||
labelActions << labelMenu->addAction(misc::getIcon("list-add"), tr("New...", "New label..."));
|
labelActions << labelMenu->addAction(IconProvider::instance()->getIcon("list-add"), tr("New...", "New label..."));
|
||||||
labelActions << labelMenu->addAction(misc::getIcon("edit-clear"), tr("Reset", "Reset label"));
|
labelActions << labelMenu->addAction(IconProvider::instance()->getIcon("edit-clear"), tr("Reset", "Reset label"));
|
||||||
labelMenu->addSeparator();
|
labelMenu->addSeparator();
|
||||||
foreach(const QString &label, customLabels) {
|
foreach(const QString &label, customLabels) {
|
||||||
labelActions << labelMenu->addAction(misc::getIcon("inode-directory"), label);
|
labelActions << labelMenu->addAction(IconProvider::instance()->getIcon("inode-directory"), label);
|
||||||
}
|
}
|
||||||
listMenu.addSeparator();
|
listMenu.addSeparator();
|
||||||
if(one_not_seed)
|
if(one_not_seed)
|
||||||
|
@ -36,6 +36,9 @@
|
|||||||
#include "json.h"
|
#include "json.h"
|
||||||
#include "qbtsession.h"
|
#include "qbtsession.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#ifndef DISABLE_GUI
|
||||||
|
#include "iconprovider.h"
|
||||||
|
#endif
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -240,7 +243,11 @@ void HttpConnection::respond() {
|
|||||||
// Icons from theme
|
// Icons from theme
|
||||||
qDebug() << "list[0]" << list[0];
|
qDebug() << "list[0]" << list[0];
|
||||||
if(list[0] == "theme" && list.size() == 2) {
|
if(list[0] == "theme" && list.size() == 2) {
|
||||||
url = misc::getIconPath(list[1]);
|
#ifdef DISABLE_GUI
|
||||||
|
url = ":/Icons/oxygen/"+list[1]+".png";
|
||||||
|
#else
|
||||||
|
url = IconProvider::instance()->getIconPath(list[1]);
|
||||||
|
#endif
|
||||||
qDebug() << "There icon:" << url;
|
qDebug() << "There icon:" << url;
|
||||||
} else {
|
} else {
|
||||||
if (list[0] == "images") {
|
if (list[0] == "images") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user