mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Initial support for system Icons (incomplete but good progress)
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "qinisettings.h"
|
||||
#include "rssmanager.h"
|
||||
#include "rssfeed.h"
|
||||
#include "misc.h"
|
||||
|
||||
AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -50,6 +51,10 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) :
|
||||
m_editedRule(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// Icons
|
||||
ui->removeRuleBtn->setIcon(misc::getIcon("list-remove"));
|
||||
ui->addRuleBtn->setIcon(misc::getIcon("list-add"));
|
||||
|
||||
// Ui Settings
|
||||
ui->listRules->setSortingEnabled(true);
|
||||
ui->listRules->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
@@ -350,17 +355,17 @@ void AutomatedRssDownloader::displayRulesListMenu(const QPoint &pos)
|
||||
{
|
||||
Q_UNUSED(pos);
|
||||
QMenu menu;
|
||||
QAction *addAct = menu.addAction(QIcon(":/Icons/oxygen/list-add.png"), tr("Add new rule..."));
|
||||
QAction *addAct = menu.addAction(misc::getIcon("list-add"), tr("Add new rule..."));
|
||||
QAction *delAct = 0;
|
||||
QAction *renameAct = 0;
|
||||
const QList<QListWidgetItem*> selection = ui->listRules->selectedItems();
|
||||
if(!selection.isEmpty()) {
|
||||
if(selection.count() == 1) {
|
||||
delAct = menu.addAction(QIcon(":/Icons/oxygen/list-remove.png"), tr("Delete rule"));
|
||||
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Delete rule"));
|
||||
menu.addSeparator();
|
||||
renameAct = menu.addAction(QIcon(":/Icons/oxygen/edit_clear.png"), tr("Rename rule..."));
|
||||
renameAct = menu.addAction(misc::getIcon("edit-rename"), tr("Rename rule..."));
|
||||
} else {
|
||||
delAct = menu.addAction(QIcon(":/Icons/oxygen/list-remove.png"), tr("Delete selected rules"));
|
||||
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Delete selected rules"));
|
||||
}
|
||||
}
|
||||
QAction *act = menu.exec(QCursor::pos());
|
||||
@@ -465,7 +470,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(const RssFeed *feed, const QS
|
||||
QFont f = treeFeedItem->font(0);
|
||||
f.setBold(true);
|
||||
treeFeedItem->setFont(0, f);
|
||||
treeFeedItem->setData(0, Qt::DecorationRole, QIcon(":/Icons/oxygen/folder.png"));
|
||||
treeFeedItem->setData(0, Qt::DecorationRole, misc::getIcon("inode-directory"));
|
||||
treeFeedItem->setData(0, Qt::UserRole, feed->getUrl());
|
||||
ui->treeMatchingArticles->addTopLevelItem(treeFeedItem);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
@@ -70,10 +70,6 @@
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/list-remove.png</normaloff>:/Icons/oxygen/list-remove.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
@@ -87,10 +83,6 @@
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/list-add.png</normaloff>:/Icons/oxygen/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
@@ -123,7 +115,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="ruleDefBox">
|
||||
@@ -246,7 +238,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
@@ -320,9 +312,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "cookiesdlg.h"
|
||||
#include "ui_cookiesdlg.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include <QNetworkCookie>
|
||||
|
||||
@@ -40,6 +41,10 @@ CookiesDlg::CookiesDlg(QWidget *parent, const QList<QByteArray> &raw_cookies) :
|
||||
ui(new Ui::CookiesDlg)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// Icons
|
||||
ui->add_btn->setIcon(misc::getIcon("list-add"));
|
||||
ui->del_btn->setIcon(misc::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"));
|
||||
foreach(const QByteArray &raw_cookie, raw_cookies) {
|
||||
QList<QByteArray> cookie_parts = raw_cookie.split('=');
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Key</string>
|
||||
<string extracomment="As in Key/Value pair">Key</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Value</string>
|
||||
<string extracomment="As in Key/Value pair">Value</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
@@ -63,10 +63,6 @@
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/list-add.png</normaloff>:/Icons/oxygen/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
@@ -96,10 +92,6 @@
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/list-remove.png</normaloff>:/Icons/oxygen/list-remove.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
@@ -142,9 +134,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
* Contact: chris@qbittorrent.org, arnaud@qbittorrent.org
|
||||
*/
|
||||
|
||||
#
|
||||
#include "feedlistwidget.h"
|
||||
#include "rssmanager.h"
|
||||
#include "rssfeed.h"
|
||||
#include "misc.h"
|
||||
|
||||
FeedListWidget::FeedListWidget(QWidget *parent, RssManager *rssmanager): QTreeWidget(parent), rssmanager(rssmanager) {
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
@@ -41,7 +41,7 @@ FeedListWidget::FeedListWidget(QWidget *parent, RssManager *rssmanager): QTreeWi
|
||||
headerItem()->setText(0, tr("RSS feeds"));
|
||||
unread_item = new QTreeWidgetItem(this);
|
||||
unread_item->setText(0, tr("Unread") + QString::fromUtf8(" (") + QString::number(rssmanager->getNbUnRead(), 10)+ QString(")"));
|
||||
unread_item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/oxygen/mail-folder-inbox.png")));
|
||||
unread_item->setData(0,Qt::DecorationRole, misc::getIcon("mail-folder-inbox"));
|
||||
itemAdded(unread_item, rssmanager);
|
||||
connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(updateCurrentFeed(QTreeWidgetItem*)));
|
||||
setCurrentItem(unread_item);
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
<property name="text">
|
||||
<string>New subscription</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/subscribe.png</normaloff>:/Icons/oxygen/subscribe.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
@@ -38,10 +34,6 @@
|
||||
<property name="text">
|
||||
<string>Mark items read</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/button_ok.png</normaloff>:/Icons/oxygen/button_ok.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
@@ -61,10 +53,6 @@
|
||||
<property name="text">
|
||||
<string>Update all</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/view-refresh.png</normaloff>:/Icons/oxygen/view-refresh.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
@@ -187,10 +175,6 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionDelete">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/remove.png</normaloff>:/Icons/oxygen/remove.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
@@ -199,10 +183,6 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRename">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/edit_clear.png</normaloff>:/Icons/oxygen/edit_clear.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rename...</string>
|
||||
</property>
|
||||
@@ -211,10 +191,6 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUpdate">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/view-refresh.png</normaloff>:/Icons/oxygen/view-refresh.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update</string>
|
||||
</property>
|
||||
@@ -223,19 +199,11 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew_subscription">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/subscribe16.png</normaloff>:/Icons/oxygen/subscribe16.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New subscription...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUpdate_all_feeds">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/view-refresh.png</normaloff>:/Icons/oxygen/view-refresh.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update all feeds</string>
|
||||
</property>
|
||||
@@ -244,10 +212,6 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMark_items_read">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/button_ok.png</normaloff>:/Icons/oxygen/button_ok.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mark items read</string>
|
||||
</property>
|
||||
@@ -256,53 +220,31 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDownload_torrent">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/download.png</normaloff>:/Icons/oxygen/download.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Download torrent</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen_news_URL">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/url.png</normaloff>:/Icons/url.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open news URL</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy_feed_URL">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/edit-copy.png</normaloff>:/Icons/oxygen/edit-copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy feed URL</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew_folder">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/folder-new.png</normaloff>:/Icons/oxygen/folder-new.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New folder...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionManage_cookies">
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/Icons/oxygen/cookies.png</normaloff>:/Icons/oxygen/cookies.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage cookies...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -148,7 +148,7 @@ void RSSImp::askNewFolder() {
|
||||
listStreams->itemAdded(folder_item, new_folder);
|
||||
// Set Text
|
||||
folder_item->setText(0, new_folder->getName() + QString::fromUtf8(" (0)"));
|
||||
folder_item->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/oxygen/folder.png")));
|
||||
folder_item->setData(0,Qt::DecorationRole, QVariant(misc::getIcon("inode-directory")));
|
||||
// Expand parent folder to display new folder
|
||||
if(parent_item)
|
||||
parent_item->setExpanded(true);
|
||||
@@ -423,7 +423,7 @@ void RSSImp::fillFeedsList(QTreeWidgetItem *parent, RssFolder *rss_parent) {
|
||||
if(rss_child->getType() == RssFile::FEED) {
|
||||
item->setData(0,Qt::DecorationRole, QVariant(QIcon(QString::fromUtf8(":/Icons/loading.png"))));
|
||||
} else {
|
||||
item->setData(0,Qt::DecorationRole, QVariant(QIcon(QString::fromUtf8(":/Icons/oxygen/folder.png"))));
|
||||
item->setData(0,Qt::DecorationRole, QVariant(misc::getIcon("inode-directory")));
|
||||
// Recurvive call to load sub folders/files
|
||||
fillFeedsList(item, (RssFolder*)rss_child);
|
||||
}
|
||||
@@ -581,6 +581,23 @@ void RSSImp::updateRefreshInterval(unsigned int val) {
|
||||
|
||||
RSSImp::RSSImp(QWidget *parent) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
// Icons
|
||||
actionCopy_feed_URL->setIcon(misc::getIcon("edit-copy"));
|
||||
actionDelete->setIcon(misc::getIcon("edit-delete"));
|
||||
actionDownload_torrent->setIcon(misc::getIcon("download"));
|
||||
actionManage_cookies->setIcon(misc::getIcon("preferences-web-browser-cookies"));
|
||||
actionMark_items_read->setIcon(misc::getIcon("mail-mark-read"));
|
||||
actionNew_folder->setIcon(misc::getIcon("folder-new"));
|
||||
actionNew_subscription->setIcon(misc::getIcon("list-add"));
|
||||
actionOpen_news_URL->setIcon(misc::getIcon("application-x-mswinurl"));
|
||||
actionRename->setIcon(misc::getIcon("edit-rename"));
|
||||
actionUpdate->setIcon(misc::getIcon("view-refresh"));
|
||||
actionUpdate_all_feeds->setIcon(misc::getIcon("view-refresh"));
|
||||
newFeedButton->setIcon(misc::getIcon("list-add"));
|
||||
markReadButton->setIcon(misc::getIcon("mail-mark-read"));
|
||||
updateAllButton->setIcon(misc::getIcon("view-refresh"));
|
||||
rssDownloaderBtn->setIcon(misc::getIcon("download"));
|
||||
settingsButton->setIcon(misc::getIcon("preferences-system"));
|
||||
|
||||
rssmanager = RssManager::instance();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "misc.h"
|
||||
#include "rssdownloadrulelist.h"
|
||||
|
||||
RssFeed::RssFeed(RssFolder* parent, QString _url): parent(parent), alias(""), iconPath(":/Icons/rss16.png"), refreshed(false), downloadFailure(false), currently_loading(false) {
|
||||
RssFeed::RssFeed(RssFolder* parent, QString _url): parent(parent), alias(""), iconPath(":/Icons/oxygen/application-rss+xml.png"), refreshed(false), downloadFailure(false), currently_loading(false) {
|
||||
qDebug("RSSStream constructed");
|
||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||
url = QUrl(_url).toString();
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../icons.qrc">:/Icons/rss32.png</pixmap>
|
||||
<pixmap resource="../icons.qrc">:/Icons/oxygen/application-rss+xml.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
|
||||
Reference in New Issue
Block a user