Initial support for system Icons (incomplete but good progress)

This commit is contained in:
Christophe Dumez
2010-12-12 19:37:59 +00:00
parent e72d9de34a
commit 052825e5c4
82 changed files with 299 additions and 433 deletions

View File

@@ -134,7 +134,7 @@ void PeerListWidget::showPeerListMenu(QPoint) {
// Add Peer Action
QAction *addPeerAct = 0;
if(!h.is_queued() && !h.is_checking()) {
addPeerAct = menu.addAction(QIcon(":/Icons/oxygen/user-group-new.png"), tr("Add a new peer..."));
addPeerAct = menu.addAction(misc::getIcon("user-group-new"), tr("Add a new peer..."));
empty_menu = false;
}
// Per Peer Speed limiting actions
@@ -143,12 +143,12 @@ void PeerListWidget::showPeerListMenu(QPoint) {
QAction *banAct = 0;
QAction *copyIPAct = 0;
if(!selectedPeerIPs.isEmpty()) {
copyIPAct = menu.addAction(QIcon(":/Icons/oxygen/edit-copy.png"), tr("Copy IP"));
copyIPAct = menu.addAction(misc::getIcon("edit-copy"), tr("Copy IP"));
menu.addSeparator();
dlLimitAct = menu.addAction(QIcon(":/Icons/skin/download.png"), tr("Limit download rate..."));
upLimitAct = menu.addAction(QIcon(":/Icons/skin/seeding.png"), tr("Limit upload rate..."));
menu.addSeparator();
banAct = menu.addAction(QIcon(":/Icons/oxygen/user-group-delete.png"), tr("Ban peer permanently"));
banAct = menu.addAction(misc::getIcon("user-group-delete"), tr("Ban peer permanently"));
empty_menu = false;
}
if(empty_menu) return;

View File

@@ -61,6 +61,12 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
QWidget(parent), transferList(transferList), main_window(main_window) {
setupUi(this);
// Icons
deleteWS_button->setIcon(misc::getIcon("list-remove"));
addWS_button->setIcon(misc::getIcon("list-add"));
trackerUpButton->setIcon(misc::getIcon("go-up"));
trackerDownButton->setIcon(misc::getIcon("go-down"));
state = VISIBLE;
setEnabled(false);
@@ -486,7 +492,7 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&){
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
QAction *actRename = 0;
if(selectedRows.size() == 1) {
actRename = myFilesLlistMenu.addAction(QIcon(QString::fromUtf8(":/Icons/oxygen/edit_clear.png")), tr("Rename..."));
actRename = myFilesLlistMenu.addAction(misc::getIcon("edit-rename"), tr("Rename..."));
myFilesLlistMenu.addSeparator();
}
QMenu subMenu;

View File

@@ -54,8 +54,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>534</width>
<height>314</height>
<width>520</width>
<height>355</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -515,9 +515,10 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
@@ -579,10 +580,6 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/uparrow.png</normaloff>:/Icons/uparrow.png</iconset>
</property>
</widget>
</item>
<item>
@@ -624,10 +621,6 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/downarrow.png</normaloff>:/Icons/downarrow.png</iconset>
</property>
</widget>
</item>
<item>
@@ -680,34 +673,26 @@ p, li { white-space: pre-wrap; }
<widget class="QPushButton" name="deleteWS_button">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
<width>32</width>
<height>32</height>
</size>
</property>
<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>
</widget>
</item>
<item>
<widget class="QPushButton" name="addWS_button">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
<width>32</width>
<height>32</height>
</size>
</property>
<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>
</widget>
</item>
<item>
@@ -841,8 +826,6 @@ p, li { white-space: pre-wrap; }
</property>
</action>
</widget>
<resources>
<include location="../icons.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

View File

@@ -34,6 +34,7 @@
#include <QKeySequence>
#include "proptabbar.h"
#include "misc.h"
#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;}"
@@ -51,32 +52,32 @@ PropTabBar::PropTabBar(QWidget *parent) :
m_btnGroup = new QButtonGroup(this);
setContentsMargins(5, 4, 5, 2);
// General tab
QPushButton *main_infos_button = new QPushButton(QIcon(":/Icons/oxygen/help-about.png"), tr("General"), parent);
QPushButton *main_infos_button = new QPushButton(misc::getIcon("document-properties"), tr("General"), parent);
main_infos_button->setShortcut(QKeySequence(QString::fromUtf8("Alt+P")));
main_infos_button->setStyleSheet(DEFAULT_BUTTON_CSS);
main_infos_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
addWidget(main_infos_button);
m_btnGroup->addButton(main_infos_button, MAIN_TAB);
// Trackers tab
QPushButton *trackers_button = new QPushButton(QIcon(":/Icons/oxygen/network-server.png"), tr("Trackers"), parent);
QPushButton *trackers_button = new QPushButton(misc::getIcon("network-server"), tr("Trackers"), parent);
trackers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
trackers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
addWidget(trackers_button);
m_btnGroup->addButton(trackers_button, TRACKERS_TAB);
// Peers tab
QPushButton *peers_button = new QPushButton(QIcon(":/Icons/oxygen/peer.png"), tr("Peers"), parent);
QPushButton *peers_button = new QPushButton(misc::getIcon("edit-find-user"), tr("Peers"), parent);
peers_button->setStyleSheet(DEFAULT_BUTTON_CSS);
peers_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
addWidget(peers_button);
m_btnGroup->addButton(peers_button, PEERS_TAB);
// URL seeds tab
QPushButton *urlseeds_button = new QPushButton(QIcon(":/Icons/oxygen/urlseed.png"), tr("URL Seeds"), parent);
QPushButton *urlseeds_button = new QPushButton(misc::getIcon("network-server"), tr("HTTP Sources"), parent);
urlseeds_button->setStyleSheet(DEFAULT_BUTTON_CSS);
urlseeds_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
addWidget(urlseeds_button);
m_btnGroup->addButton(urlseeds_button, URLSEEDS_TAB);
// Files tab
QPushButton *files_button = new QPushButton(QIcon(":/Icons/oxygen/folder.png"), tr("Files"), parent);
QPushButton *files_button = new QPushButton(misc::getIcon("inode-directory"), tr("Content"), parent);
files_button->setStyleSheet(DEFAULT_BUTTON_CSS);
files_button->setIconSize(QSize(BTN_ICON_SIZE, BTN_ICON_SIZE));
addWidget(files_button);

View File

@@ -344,13 +344,13 @@ void TrackerList::showTrackerListMenu(QPoint) {
//QList<QTreeWidgetItem*> selected_items = getSelectedTrackerItems();
QMenu menu;
// Add actions
QAction *addAct = menu.addAction(QIcon(":/Icons/oxygen/list-add.png"), tr("Add a new tracker..."));
QAction *addAct = menu.addAction(misc::getIcon("list-add"), tr("Add a new tracker..."));
QAction *delAct = 0;
if(!getSelectedTrackerItems().isEmpty()) {
delAct = menu.addAction(QIcon(":/Icons/oxygen/list-remove.png"), tr("Remove tracker"));
delAct = menu.addAction(misc::getIcon("list-remove"), tr("Remove tracker"));
}
menu.addSeparator();
QAction *reannounceAct = menu.addAction(QIcon(":/Icons/oxygen/run-build.png"), tr("Force reannounce"));
QAction *reannounceAct = menu.addAction(misc::getIcon("view-refresh"), tr("Force reannounce"));
QAction *act = menu.exec(QCursor::pos());
if(act == 0) return;
if(act == addAct) {

View File

@@ -50,6 +50,8 @@ private:
public:
TrackersAdditionDlg(QTorrentHandle h, QWidget *parent=0): QDialog(parent), h(h) {
setupUi(this);
// Icons
uTorrentListButton->setIcon(misc::getIcon("download"));
// As a default, use torrentz.com link
list_url->setText("http://www.torrentz.com/announce_"+h.hash());
list_url->setCursorPosition(0);

View File

@@ -30,8 +30,8 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="acceptRichText">
<bool>false</bool>
@@ -67,10 +67,6 @@ p, li { white-space: pre-wrap; }
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/oxygen/download.png</normaloff>:/Icons/oxygen/download.png</iconset>
</property>
</widget>
</item>
</layout>
@@ -87,9 +83,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<resources>
<include location="../icons.qrc"/>
</resources>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>