mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-07 20:34:14 +00:00
- COSMETIC: Global UP/DL speeds and ratio are displayed above tabs
This commit is contained in:
parent
d32813ed1f
commit
f143596b91
@ -21,6 +21,7 @@
|
|||||||
- COSMETIC: Display tracker errors in a cleaner way
|
- COSMETIC: Display tracker errors in a cleaner way
|
||||||
- COSMETIC: Display "unpaused/total_torrent" in download/upload tabs
|
- COSMETIC: Display "unpaused/total_torrent" in download/upload tabs
|
||||||
- COSMETIC: Allow to resize RSS column
|
- COSMETIC: Allow to resize RSS column
|
||||||
|
- COSMETIC: Global UP/DL speeds and ratio are displayed above tabs
|
||||||
|
|
||||||
* Fri Apr 11 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.0.0
|
* Fri Apr 11 2008 - Christophe Dumez <chris@qbittorrent.org> - v1.0.0
|
||||||
- FEATURE: Based on new libtorrent v0.13
|
- FEATURE: Based on new libtorrent v0.13
|
||||||
|
36
src/GUI.cpp
36
src/GUI.cpp
@ -107,6 +107,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
||||||
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
||||||
actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png")));
|
actionCreate_torrent->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/new.png")));
|
||||||
|
// Set default ratio
|
||||||
|
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png")));
|
||||||
// Fix Tool bar layout
|
// Fix Tool bar layout
|
||||||
toolBar->layout()->setSpacing(7);
|
toolBar->layout()->setSpacing(7);
|
||||||
// creating options
|
// creating options
|
||||||
@ -129,7 +131,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
downloadingTorrentTab = new DownloadingTorrents(this, BTSession);
|
downloadingTorrentTab = new DownloadingTorrents(this, BTSession);
|
||||||
tabs->addTab(downloadingTorrentTab, tr("Downloads") + QString::fromUtf8(" (0/0)"));
|
tabs->addTab(downloadingTorrentTab, tr("Downloads") + QString::fromUtf8(" (0/0)"));
|
||||||
tabs->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/skin/downloading.png")));
|
tabs->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/skin/downloading.png")));
|
||||||
vboxLayout->addWidget(tabs);
|
verticalLayout->addWidget(tabs);
|
||||||
connect(downloadingTorrentTab, SIGNAL(unfinishedTorrentsNumberChanged(unsigned int)), this, SLOT(updateUnfinishedTorrentNumber(unsigned int)));
|
connect(downloadingTorrentTab, SIGNAL(unfinishedTorrentsNumberChanged(unsigned int)), this, SLOT(updateUnfinishedTorrentNumber(unsigned int)));
|
||||||
connect(downloadingTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool)));
|
connect(downloadingTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool)));
|
||||||
// Finished torrents tab
|
// Finished torrents tab
|
||||||
@ -225,6 +227,32 @@ GUI::~GUI() {
|
|||||||
qDebug("5");
|
qDebug("5");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::updateRatio() {
|
||||||
|
// Update ratio info
|
||||||
|
float ratio = 1.;
|
||||||
|
session_status sessionStatus = BTSession->getSessionStatus();
|
||||||
|
if(sessionStatus.total_payload_download == 0) {
|
||||||
|
if(sessionStatus.total_payload_upload == 0)
|
||||||
|
ratio = 1.;
|
||||||
|
else
|
||||||
|
ratio = 10.;
|
||||||
|
}else{
|
||||||
|
ratio = (double)sessionStatus.total_payload_upload / (double)sessionStatus.total_payload_download;
|
||||||
|
if(ratio > 10.)
|
||||||
|
ratio = 10.;
|
||||||
|
}
|
||||||
|
LCD_Ratio->display(QString(QByteArray::number(ratio, 'f', 1)));
|
||||||
|
if(ratio < 0.5) {
|
||||||
|
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/unhappy.png")));
|
||||||
|
}else{
|
||||||
|
if(ratio > 1.0) {
|
||||||
|
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/smile.png")));
|
||||||
|
}else{
|
||||||
|
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GUI::on_actionWebsite_triggered() const {
|
void GUI::on_actionWebsite_triggered() const {
|
||||||
QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://www.qbittorrent.org")));
|
QDesktopServices::openUrl(QUrl(QString::fromUtf8("http://www.qbittorrent.org")));
|
||||||
}
|
}
|
||||||
@ -1232,6 +1260,9 @@ void GUI::on_actionTorrent_Properties_triggered() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::updateLists() {
|
void GUI::updateLists() {
|
||||||
|
// update global informations
|
||||||
|
LCD_UpSpeed->display(QString(QByteArray::number(BTSession->getPayloadUploadRate()/1024., 'f', 1))); // UP LCD
|
||||||
|
LCD_DownSpeed->display(QString(QByteArray::number(BTSession->getPayloadDownloadRate()/1024., 'f', 1))); // DL LCD
|
||||||
switch(getCurrentTabIndex()){
|
switch(getCurrentTabIndex()){
|
||||||
case 0:
|
case 0:
|
||||||
downloadingTorrentTab->updateDlList();
|
downloadingTorrentTab->updateDlList();
|
||||||
@ -1261,8 +1292,7 @@ void GUI::trackerAuthenticationRequired(QTorrentHandle& h) {
|
|||||||
void GUI::checkConnectionStatus() {
|
void GUI::checkConnectionStatus() {
|
||||||
// qDebug("Checking connection status");
|
// qDebug("Checking connection status");
|
||||||
// Update Ratio
|
// Update Ratio
|
||||||
if(getCurrentTabIndex() == 0)
|
updateRatio();
|
||||||
downloadingTorrentTab->updateRatio();
|
|
||||||
// update global informations
|
// update global informations
|
||||||
if(systrayIntegration) {
|
if(systrayIntegration) {
|
||||||
QString html = "<div style='background-color: #678db2; color: #fff;height: 18px; font-weight: bold; margin-bottom: 5px;'>";
|
QString html = "<div style='background-color: #678db2; color: #fff;height: 18px; font-weight: bold; margin-bottom: 5px;'>";
|
||||||
|
@ -156,6 +156,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
void setTabText(int index, QString text) const;
|
void setTabText(int index, QString text) const;
|
||||||
void openDestinationFolder() const;
|
void openDestinationFolder() const;
|
||||||
void goBuyPage() const;
|
void goBuyPage() const;
|
||||||
|
void updateRatio();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *);
|
||||||
|
@ -16,13 +16,194 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget" >
|
<widget class="QWidget" name="centralwidget" >
|
||||||
<layout class="QVBoxLayout" >
|
<property name="geometry" >
|
||||||
<property name="spacing" >
|
<rect>
|
||||||
<number>6</number>
|
<x>0</x>
|
||||||
</property>
|
<y>58</y>
|
||||||
<property name="margin" >
|
<width>849</width>
|
||||||
<number>9</number>
|
<height>505</height>
|
||||||
</property>
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="_3" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_DLSpeed_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Total DL Speed:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLCDNumber" name="LCD_DownSpeed" >
|
||||||
|
<property name="autoFillBackground" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow" >
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<property name="smallDecimalPoint" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="numDigits" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="segmentStyle" >
|
||||||
|
<enum>QLCDNumber::Flat</enum>
|
||||||
|
</property>
|
||||||
|
<property name="value" stdset="0" >
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="intValue" stdset="0" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="unitDL_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>KiB/s</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Session ratio: </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLCDNumber" name="LCD_Ratio" >
|
||||||
|
<property name="autoFillBackground" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="numDigits" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="segmentStyle" >
|
||||||
|
<enum>QLCDNumber::Flat</enum>
|
||||||
|
</property>
|
||||||
|
<property name="value" stdset="0" >
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ratio_icon" >
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_UPSpeed_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Total UP Speed:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLCDNumber" name="LCD_UpSpeed" >
|
||||||
|
<property name="autoFillBackground" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="smallDecimalPoint" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="numDigits" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="segmentStyle" >
|
||||||
|
<enum>QLCDNumber::Flat</enum>
|
||||||
|
</property>
|
||||||
|
<property name="value" stdset="0" >
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="unitUP_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>KiB/s</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment" >
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar" >
|
<widget class="QMenuBar" name="menubar" >
|
||||||
@ -31,7 +212,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>849</width>
|
<width>849</width>
|
||||||
<height>29</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu_Edit" >
|
<widget class="QMenu" name="menu_Edit" >
|
||||||
@ -82,6 +263,14 @@
|
|||||||
<property name="enabled" >
|
<property name="enabled" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>26</y>
|
||||||
|
<width>849</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="contextMenuPolicy" >
|
<property name="contextMenuPolicy" >
|
||||||
<enum>Qt::NoContextMenu</enum>
|
<enum>Qt::NoContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -98,7 +287,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="toolBarArea" >
|
<attribute name="toolBarArea" >
|
||||||
<number>4</number>
|
<enum>TopToolBarArea</enum>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="toolBarBreak" >
|
<attribute name="toolBarBreak" >
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
245
src/download.ui
245
src/download.ui
@ -18,206 +18,9 @@
|
|||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin" >
|
<property name="margin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_DLSpeed" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Total DL Speed:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLCDNumber" name="LCD_DownSpeed" >
|
|
||||||
<property name="autoFillBackground" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow" >
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<property name="smallDecimalPoint" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="numDigits" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="segmentStyle" >
|
|
||||||
<enum>QLCDNumber::Flat</enum>
|
|
||||||
</property>
|
|
||||||
<property name="value" stdset="0" >
|
|
||||||
<double>0.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="intValue" stdset="0" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="unitDL" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>KiB/s</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Session ratio: </string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLCDNumber" name="LCD_Ratio" >
|
|
||||||
<property name="autoFillBackground" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="numDigits" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="segmentStyle" >
|
|
||||||
<enum>QLCDNumber::Flat</enum>
|
|
||||||
</property>
|
|
||||||
<property name="value" stdset="0" >
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_ratio_icon" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_UPSpeed" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Total UP Speed:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLCDNumber" name="LCD_UpSpeed" >
|
|
||||||
<property name="autoFillBackground" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="smallDecimalPoint" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="numDigits" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="segmentStyle" >
|
|
||||||
<enum>QLCDNumber::Flat</enum>
|
|
||||||
</property>
|
|
||||||
<property name="value" stdset="0" >
|
|
||||||
<double>0.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="unitUP" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>KiB/s</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeView" name="downloadList" >
|
<widget class="QTreeView" name="downloadList" >
|
||||||
<property name="minimumSize" >
|
<property name="minimumSize" >
|
||||||
@ -260,6 +63,14 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="log_tab" >
|
<widget class="QWidget" name="log_tab" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>765</width>
|
||||||
|
<height>138</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
<string>Log</string>
|
<string>Log</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@ -267,16 +78,7 @@
|
|||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin" >
|
<property name="margin" >
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -301,6 +103,14 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="filter_tab" >
|
<widget class="QWidget" name="filter_tab" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>765</width>
|
||||||
|
<height>138</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
<string>IP filter</string>
|
<string>IP filter</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@ -308,16 +118,7 @@
|
|||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin" >
|
<property name="margin" >
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -382,7 +183,8 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionOpen_destination_folder" >
|
<action name="actionOpen_destination_folder" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="icons.qrc" >:/Icons/folder.png</iconset>
|
<iconset resource="icons.qrc" >
|
||||||
|
<normaloff>:/Icons/folder.png</normaloff>:/Icons/folder.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Open destination folder</string>
|
<string>Open destination folder</string>
|
||||||
@ -430,12 +232,15 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionBuy_it" >
|
<action name="actionBuy_it" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="icons.qrc" >:/Icons/money.png</iconset>
|
<iconset resource="icons.qrc" >
|
||||||
|
<normaloff>:/Icons/money.png</normaloff>:/Icons/money.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Buy it</string>
|
<string>Buy it</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<zorder>tabBottom</zorder>
|
||||||
|
<zorder></zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="icons.qrc" />
|
<include location="icons.qrc" />
|
||||||
|
@ -47,8 +47,6 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
|
|||||||
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
||||||
// tabBottom->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/log.png")));
|
// tabBottom->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/log.png")));
|
||||||
// tabBottom->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/filter.png")));
|
// tabBottom->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/filter.png")));
|
||||||
// Set default ratio
|
|
||||||
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png")));
|
|
||||||
|
|
||||||
// Set Download list model
|
// Set Download list model
|
||||||
DLListModel = new QStandardItemModel(0,9);
|
DLListModel = new QStandardItemModel(0,9);
|
||||||
@ -490,32 +488,6 @@ QStringList DownloadingTorrents::getSelectedTorrents(bool only_one) const{
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadingTorrents::updateRatio() {
|
|
||||||
// Update ratio info
|
|
||||||
float ratio = 1.;
|
|
||||||
session_status sessionStatus = BTSession->getSessionStatus();
|
|
||||||
if(sessionStatus.total_payload_download == 0) {
|
|
||||||
if(sessionStatus.total_payload_upload == 0)
|
|
||||||
ratio = 1.;
|
|
||||||
else
|
|
||||||
ratio = 10.;
|
|
||||||
}else{
|
|
||||||
ratio = (double)sessionStatus.total_payload_upload / (double)sessionStatus.total_payload_download;
|
|
||||||
if(ratio > 10.)
|
|
||||||
ratio = 10.;
|
|
||||||
}
|
|
||||||
LCD_Ratio->display(QString(QByteArray::number(ratio, 'f', 1)));
|
|
||||||
if(ratio < 0.5) {
|
|
||||||
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/unhappy.png")));
|
|
||||||
}else{
|
|
||||||
if(ratio > 1.0) {
|
|
||||||
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/smile.png")));
|
|
||||||
}else{
|
|
||||||
lbl_ratio_icon->setPixmap(QPixmap(QString::fromUtf8(":/Icons/stare.png")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DownloadingTorrents::displayInfoBarMenu(const QPoint& pos) {
|
void DownloadingTorrents::displayInfoBarMenu(const QPoint& pos) {
|
||||||
// Log Menu
|
// Log Menu
|
||||||
QMenu myLogMenu(this);
|
QMenu myLogMenu(this);
|
||||||
@ -534,9 +506,6 @@ void DownloadingTorrents::sortProgressColumnDelayed() {
|
|||||||
// get information from torrent handles and
|
// get information from torrent handles and
|
||||||
// update download list accordingly
|
// update download list accordingly
|
||||||
void DownloadingTorrents::updateDlList() {
|
void DownloadingTorrents::updateDlList() {
|
||||||
// update global informations
|
|
||||||
LCD_UpSpeed->display(QString(QByteArray::number(BTSession->getPayloadUploadRate()/1024., 'f', 1))); // UP LCD
|
|
||||||
LCD_DownSpeed->display(QString(QByteArray::number(BTSession->getPayloadDownloadRate()/1024., 'f', 1))); // DL LCD
|
|
||||||
// browse handles
|
// browse handles
|
||||||
QStringList unfinishedTorrents = BTSession->getUnfinishedTorrents();
|
QStringList unfinishedTorrents = BTSession->getUnfinishedTorrents();
|
||||||
QString hash;
|
QString hash;
|
||||||
|
@ -100,7 +100,6 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
|||||||
void setInfoBar(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
void setInfoBar(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
void pauseTorrent(QString hash);
|
void pauseTorrent(QString hash);
|
||||||
void resumeTorrent(QString hash);
|
void resumeTorrent(QString hash);
|
||||||
void updateRatio();
|
|
||||||
void deleteTorrent(QString hash);
|
void deleteTorrent(QString hash);
|
||||||
void setBottomTabEnabled(unsigned int index, bool b);
|
void setBottomTabEnabled(unsigned int index, bool b);
|
||||||
void propertiesSelection();
|
void propertiesSelection();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user