mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
- Started work on transfer list filters
This commit is contained in:
parent
9f9f6abec1
commit
2dddd2b24b
23
src/GUI.cpp
23
src/GUI.cpp
@ -62,6 +62,7 @@
|
||||
#include "console_imp.h"
|
||||
#include "httpserver.h"
|
||||
#include "torrentPersistentData.h"
|
||||
#include "TransferListFiltersWidget.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
@ -135,10 +136,16 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||
|
||||
qDebug("create tabWidget");
|
||||
tabs = new QTabWidget();
|
||||
vSplitter = new QSplitter(Qt::Horizontal);
|
||||
|
||||
// Transfer List tab
|
||||
transferList = new TransferListWidget(tabs, BTSession);
|
||||
int index_tab = tabs->addTab(transferList, tr("Transfers"));
|
||||
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/oxygen/folder-remote.png")));
|
||||
transferListFilters = new TransferListFiltersWidget(vSplitter);
|
||||
vSplitter->addWidget(transferListFilters);
|
||||
transferList = new TransferListWidget(vSplitter, BTSession);
|
||||
vSplitter->addWidget(transferList);
|
||||
|
||||
tabs->addTab(vSplitter, QIcon(QString::fromUtf8(":/Icons/oxygen/folder-remote.png")), tr("Transfers"));
|
||||
|
||||
vboxLayout->addWidget(tabs);
|
||||
|
||||
// Transfer list slots
|
||||
@ -155,8 +162,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||
//connect(downloadingTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool)));
|
||||
// Search engine tab
|
||||
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
|
||||
index_tab = tabs->addTab(searchEngine, tr("Search"));
|
||||
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")));
|
||||
tabs->addTab(searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
|
||||
readSettings();
|
||||
// RSS Tab
|
||||
rssWidget = 0;
|
||||
@ -233,6 +239,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||
if(settings.value(QString::fromUtf8("Preferences/General/StartMinimized"), false).toBool()) {
|
||||
this->setWindowState(Qt::WindowMinimized);
|
||||
}
|
||||
// Splitter size
|
||||
QList<int> sizes;
|
||||
sizes << 120;
|
||||
sizes << vSplitter->width()-120;
|
||||
vSplitter->setSizes(sizes);
|
||||
scrapeTimer = new QTimer(this);
|
||||
connect(scrapeTimer, SIGNAL(timeout()), this, SLOT(scrapeTrackers()));
|
||||
scrapeTimer->start(20000);
|
||||
@ -260,7 +271,9 @@ GUI::~GUI() {
|
||||
if(rssWidget != 0)
|
||||
delete rssWidget;
|
||||
delete searchEngine;
|
||||
delete transferListFilters;
|
||||
delete transferList;
|
||||
delete vSplitter;
|
||||
delete checkConnect;
|
||||
qDebug("1");
|
||||
if(systrayCreator) {
|
||||
|
@ -56,6 +56,8 @@ class QModelIndex;
|
||||
class HttpServer;
|
||||
class QFrame;
|
||||
class TransferListWidget;
|
||||
class TransferListFiltersWidget;
|
||||
class QSplitter;
|
||||
|
||||
class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
Q_OBJECT
|
||||
@ -73,6 +75,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||
QPointer<QTimer> systrayCreator;
|
||||
QMenu *myTrayIconMenu;
|
||||
TransferListWidget *transferList;
|
||||
TransferListFiltersWidget *transferListFilters;
|
||||
QSplitter *vSplitter;
|
||||
QLabel *connecStatusLblIcon;
|
||||
bool systrayIntegration;
|
||||
bool displaySpeedInTitle;
|
||||
|
BIN
src/Icons/oxygen/draw-rectangle.png
Normal file
BIN
src/Icons/oxygen/draw-rectangle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 389 B |
BIN
src/Icons/oxygen/draw-triangle2.png
Normal file
BIN
src/Icons/oxygen/draw-triangle2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 670 B |
BIN
src/Icons/oxygen/folder-remote16.png
Normal file
BIN
src/Icons/oxygen/folder-remote16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 675 B |
@ -1,4 +1,30 @@
|
||||
#ifndef TRANSFERLISTFILTERSWIDGET_H
|
||||
#define TRANSFERLISTFILTERSWIDGET_H
|
||||
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QIcon>
|
||||
|
||||
class TransferListFiltersWidget: public QListWidget {
|
||||
public:
|
||||
TransferListFiltersWidget(QWidget *parent): QListWidget(parent) {
|
||||
// Add filters
|
||||
QListWidgetItem *all = new QListWidgetItem(this);
|
||||
all->setData(Qt::DisplayRole, tr("All"));
|
||||
all->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/folder-remote16.png"));
|
||||
QListWidgetItem *downloading = new QListWidgetItem(this);
|
||||
downloading->setData(Qt::DisplayRole, tr("Downloading"));
|
||||
downloading->setData(Qt::DecorationRole, QIcon(":/Icons/skin/downloading.png"));
|
||||
QListWidgetItem *completed = new QListWidgetItem(this);
|
||||
completed->setData(Qt::DisplayRole, tr("Completed"));
|
||||
completed->setData(Qt::DecorationRole, QIcon(":/Icons/skin/seeding.png"));
|
||||
QListWidgetItem *active = new QListWidgetItem(this);
|
||||
active->setData(Qt::DisplayRole, tr("Active"));
|
||||
active->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-triangle2.png"));
|
||||
QListWidgetItem *inactive = new QListWidgetItem(this);
|
||||
inactive->setData(Qt::DisplayRole, tr("Inactive"));
|
||||
inactive->setData(Qt::DecorationRole, QIcon(":/Icons/oxygen/draw-rectangle.png"));
|
||||
}
|
||||
};
|
||||
|
||||
#endif // TRANSFERLISTFILTERSWIDGET_H
|
||||
|
@ -70,6 +70,7 @@
|
||||
<file>Icons/oxygen/mail-queue.png</file>
|
||||
<file>Icons/oxygen/view-refresh.png</file>
|
||||
<file>Icons/oxygen/file.png</file>
|
||||
<file>Icons/oxygen/folder-remote16.png</file>
|
||||
<file>Icons/oxygen/mail-folder-inbox.png</file>
|
||||
<file>Icons/oxygen/edit-find.png</file>
|
||||
<file>Icons/oxygen/folder-new.png</file>
|
||||
@ -88,6 +89,7 @@
|
||||
<file>Icons/oxygen/download.png</file>
|
||||
<file>Icons/oxygen/application-x-kgetlist-no.png</file>
|
||||
<file>Icons/oxygen/gear.png</file>
|
||||
<file>Icons/oxygen/draw-triangle2.png</file>
|
||||
<file>Icons/oxygen/remove.png</file>
|
||||
<file>Icons/oxygen/browse.png</file>
|
||||
<file>Icons/oxygen/unsubscribe16.png</file>
|
||||
@ -107,6 +109,7 @@
|
||||
<file>Icons/oxygen/folder.png</file>
|
||||
<file>Icons/oxygen/edit-cut.png</file>
|
||||
<file>Icons/oxygen/unsubscribe.png</file>
|
||||
<file>Icons/oxygen/draw-rectangle.png</file>
|
||||
<file>Icons/oxygen/subscribe16.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
x
Reference in New Issue
Block a user