-
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.
add downloader speed display chart (from qv2ray)
- Loading branch information
1 parent
22a10c9
commit c7836e6
Showing
11 changed files
with
462 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
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,26 @@ | ||
#include "downloaderinfowidget.h" | ||
#include "ui_downloaderinfowidget.h" | ||
|
||
#include "download/abstractdownloader.h" | ||
#include "util/funcutil.h" | ||
|
||
DownloaderInfoWidget::DownloaderInfoWidget(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::DownloaderInfoWidget) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
DownloaderInfoWidget::~DownloaderInfoWidget() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void DownloaderInfoWidget::setDownloader(AbstractDownloader *downloader) | ||
{ | ||
downloader_ = downloader; | ||
emit downloaderChanged(); | ||
if(!downloader_) return; | ||
ui->name->setText(downloader->info().displayName()); | ||
ui->speedWidget->setDownloader(downloader); | ||
} |
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,29 @@ | ||
#ifndef DOWNLOADERINFOWIDGET_H | ||
#define DOWNLOADERINFOWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
class AbstractDownloader; | ||
namespace Ui { | ||
class DownloaderInfoWidget; | ||
} | ||
|
||
class DownloaderInfoWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DownloaderInfoWidget(QWidget *parent = nullptr); | ||
~DownloaderInfoWidget(); | ||
|
||
void setDownloader(AbstractDownloader *downloader); | ||
|
||
signals: | ||
void downloaderChanged(); | ||
|
||
private: | ||
Ui::DownloaderInfoWidget *ui; | ||
AbstractDownloader *downloader_; | ||
}; | ||
|
||
#endif // DOWNLOADERINFOWIDGET_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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>DownloaderInfoWidget</class> | ||
<widget class="QWidget" name="DownloaderInfoWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="name"/> | ||
</item> | ||
<item> | ||
<widget class="DownloaderSpeedWidget" name="speedWidget"/> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>DownloaderSpeedWidget</class> | ||
<extends>QGraphicsView</extends> | ||
<header>ui/download/downloaderspeedwidget.h</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.