From 2dddd2b24bb0b06ecc598fa56f465a1ccd4f5519 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 8 Nov 2009 12:05:35 +0000 Subject: [PATCH] - Started work on transfer list filters --- src/GUI.cpp | 23 ++++++++++++++++++----- src/GUI.h | 4 ++++ src/Icons/oxygen/draw-rectangle.png | Bin 0 -> 389 bytes src/Icons/oxygen/draw-triangle2.png | Bin 0 -> 670 bytes src/Icons/oxygen/folder-remote16.png | Bin 0 -> 675 bytes src/TransferListFiltersWidget.h | 26 ++++++++++++++++++++++++++ src/icons.qrc | 3 +++ 7 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 src/Icons/oxygen/draw-rectangle.png create mode 100644 src/Icons/oxygen/draw-triangle2.png create mode 100644 src/Icons/oxygen/folder-remote16.png diff --git a/src/GUI.cpp b/src/GUI.cpp index 8ce15deb8..dc4d7848b 100644 --- a/src/GUI.cpp +++ b/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 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) { diff --git a/src/GUI.h b/src/GUI.h index 59fd72069..1cc7dee8d 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -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 systrayCreator; QMenu *myTrayIconMenu; TransferListWidget *transferList; + TransferListFiltersWidget *transferListFilters; + QSplitter *vSplitter; QLabel *connecStatusLblIcon; bool systrayIntegration; bool displaySpeedInTitle; diff --git a/src/Icons/oxygen/draw-rectangle.png b/src/Icons/oxygen/draw-rectangle.png new file mode 100644 index 0000000000000000000000000000000000000000..04e0937703be74e58472ea85b539aad47debd8ab GIT binary patch literal 389 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ zFzyCnMyofE9{~j=OI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kpik_@^oUEu{EW{S6Ch*+7Oj3uAnp}Xxiy_d<85^?#^ot$?mP3CpgiL;f8}timQ}M} zY0?h=z8h`|2~}0v#&>P{wZLniJ0kAr2o~+=-`KyYY|>sAmZLuAu5XjCM2Wwyo~fz& zSv`gSN4Bv&!)>Ob8^xEJ|1fgTe~DWM4fD7u`t literal 0 HcmV?d00001 diff --git a/src/Icons/oxygen/draw-triangle2.png b/src/Icons/oxygen/draw-triangle2.png new file mode 100644 index 0000000000000000000000000000000000000000..3c29299bb163e1ead6e00e720c96ebd9fee79f2e GIT binary patch literal 670 zcmV;P0%84$P)qr00)Nk$$@OWQ0gMT`*7Wy%U& zjKIBh>R1Hb?B1nFL>piHTVI9sq&07Ik$8(b?G^YHB)qiU>24lQScp7dyNwfSF;fg|!w94M(WE z`+TUe@mRz;c{x5lb#s1xzUrR<5y4suW`=W)g2A9|X*m(->gwEATf6^8I{ovN=Z*LO z74UsujWH-MYb_aLl!zo03Q9-E*-%^C>3Zj?9(dl9xzSPY%pVE10z?ENf~xxEYt`2u zLQl_yP;>L~HfHm5Z0zw}0N~9jfSDm8P*td^5)nj1%b=?MKG7JcLWxYV0yxKT&Ot=r z`#wYj0Mr^}X4PE=N1*lSHhN{9C0}+9UsH!59$s(D2mt9*+ zX9@-XPBeP;`PN5d0AS|I6s)!IeP8qW0+yFQmR43i6#+aV@<*c4!Q%EQY$kA(4I;wo z>K9#FdYco`1rawqIN1Mnr;k)g008Oqcf{j~Y%aI)SwwFQ3|x-y)VM7H>*C_lMk=+I zS1k?q^<9hs(El}8fIuJ+Utj<68YtfH?Y)%UO=G!!0kJ3Y7?T^G&;S4c07*qoM6N<$ Ef(L6T6#xJL literal 0 HcmV?d00001 diff --git a/src/Icons/oxygen/folder-remote16.png b/src/Icons/oxygen/folder-remote16.png new file mode 100644 index 0000000000000000000000000000000000000000..38465e5738143ad49e1ddd648e5bd9d53ca0b8a3 GIT binary patch literal 675 zcmV;U0$lxxP)FUgxb-}fCPPQm(t z@AiD2`|>_Vf*`>EKxgK++kA(H9t@4FdY$0r(u0v7=mWX-=o@=@BcZAafj|^m-fFU? z&qwI`pnV%~LD@g-f)M;+)Yd5v`tkU!1Ij&;TXb*|2oF^hAUhq$NqDhR;|oOh0N5yc z_!lP68sM&IKtL40GF5OS;%~1WCmrdE`wyrJZvcrEis8ejP2S)b5i^4Ew1o?{h7bjsu8rsKzKgcf5w5}m zLsMWGs!Uj8m>x^PZ83OlhT1_34cABYFhK2>2hWF?la6rZBO1EG1BtU=MRF*O+}#;$ zY!&%R0!k&vQKsb^zdankGa_^AWVZARFHeU21}=Cw!4_U zG=-ne0R~O_*UyyZNr{CJP=k)&TX=c>Y9>;5d=&X9kJ}xXx(>_K8?WwX=7M&U0q}Wt ziBNbn^l~~wr|vv`6E15Jke)p(Utu8JyhkPdX;%OM002ov JPDHLkV1fmBD#8E& literal 0 HcmV?d00001 diff --git a/src/TransferListFiltersWidget.h b/src/TransferListFiltersWidget.h index daed7e157..db05a423f 100644 --- a/src/TransferListFiltersWidget.h +++ b/src/TransferListFiltersWidget.h @@ -1,4 +1,30 @@ #ifndef TRANSFERLISTFILTERSWIDGET_H #define TRANSFERLISTFILTERSWIDGET_H +#include +#include +#include + +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 diff --git a/src/icons.qrc b/src/icons.qrc index dbe10243d..e014c332b 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -70,6 +70,7 @@ Icons/oxygen/mail-queue.png Icons/oxygen/view-refresh.png Icons/oxygen/file.png + Icons/oxygen/folder-remote16.png Icons/oxygen/mail-folder-inbox.png Icons/oxygen/edit-find.png Icons/oxygen/folder-new.png @@ -88,6 +89,7 @@ Icons/oxygen/download.png Icons/oxygen/application-x-kgetlist-no.png Icons/oxygen/gear.png + Icons/oxygen/draw-triangle2.png Icons/oxygen/remove.png Icons/oxygen/browse.png Icons/oxygen/unsubscribe16.png @@ -107,6 +109,7 @@ Icons/oxygen/folder.png Icons/oxygen/edit-cut.png Icons/oxygen/unsubscribe.png + Icons/oxygen/draw-rectangle.png Icons/oxygen/subscribe16.png \ No newline at end of file