-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5216045
commit 054414b
Showing
6 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "downloadstatusbarwidget.h" | ||
#include "ui_downloadstatusbarwidget.h" | ||
|
||
#include "util/funcutil.h" | ||
|
||
DownloadStatusBarWidget::DownloadStatusBarWidget(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::DownloadStatusBarWidget) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
DownloadStatusBarWidget::~DownloadStatusBarWidget() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void DownloadStatusBarWidget::setDownloadSpeed(qint64 download, qint64 upload) | ||
{ | ||
ui->downloadSpeed->setText(tr("Download: %1").arg(speedConvert(download))); | ||
ui->uploadSpeed->setText(tr("Upload: %1").arg(speedConvert(upload))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef DOWNLOADSTATUSBARWIDGET_H | ||
#define DOWNLOADSTATUSBARWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui { | ||
class DownloadStatusBarWidget; | ||
} | ||
|
||
class DownloadStatusBarWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DownloadStatusBarWidget(QWidget *parent = nullptr); | ||
~DownloadStatusBarWidget(); | ||
|
||
public slots: | ||
void setDownloadSpeed(qint64 download, qint64 upload); | ||
|
||
private: | ||
Ui::DownloadStatusBarWidget *ui; | ||
}; | ||
|
||
#endif // DOWNLOADSTATUSBARWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>DownloadStatusBarWidget</class> | ||
<widget class="QWidget" name="DownloadStatusBarWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>24</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<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 name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>363</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="Line" name="line_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="downloadSpeed"/> | ||
</item> | ||
<item> | ||
<widget class="Line" name="line"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="uploadSpeed"/> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |