diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-27 17:06:33 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-27 17:06:33 +0100 |
commit | bdc239d1f827308c0fc1e4c202ed0e3f5c71da0b (patch) | |
tree | e743885fcdfc92a85eb46b075cf65e6b7c0c8a8e /src/lib/downloads/widgets/downloaditemwidget.cpp | |
parent | UrlRequestInterceptor fixes (diff) | |
download | smolbote-bdc239d1f827308c0fc1e4c202ed0e3f5c71da0b.tar.xz |
Download manager fixes
DownloadsWidget
- Download widget now in landscape
- Download widget no longer docks in the main window, but is a dialog
DownloadItemWidget
- Download item widget looks more compact
- Download details are now a part of the item widgets instead
- Download details: save path
Diffstat (limited to 'src/lib/downloads/widgets/downloaditemwidget.cpp')
-rw-r--r-- | src/lib/downloads/widgets/downloaditemwidget.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/downloads/widgets/downloaditemwidget.cpp b/src/lib/downloads/widgets/downloaditemwidget.cpp index df0b6fc..6145a6e 100644 --- a/src/lib/downloads/widgets/downloaditemwidget.cpp +++ b/src/lib/downloads/widgets/downloaditemwidget.cpp @@ -20,10 +20,13 @@ DownloadItemWidget::DownloadItemWidget(QWebEngineDownloadItem *item, QWidget *pa ui->setupUi(this); ui->url_label->setText(item->url().toString()); + ui->detailsWidget->hide(); - connect(item, SIGNAL(stateChanged(QWebEngineDownloadItem::DownloadState)), this, SLOT(updateState(QWebEngineDownloadItem::DownloadState))); - connect(item, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64))); - connect(item, SIGNAL(finished()), this, SLOT(updateFinished())); + ui->path_label->setText(item->path()); + + connect(item, &QWebEngineDownloadItem::stateChanged, this, &DownloadItemWidget::updateState); + connect(item, &QWebEngineDownloadItem::downloadProgress, this, &DownloadItemWidget::updateProgress); + connect(item, &QWebEngineDownloadItem::finished, this, &DownloadItemWidget::updateFinished); } DownloadItemWidget::~DownloadItemWidget() @@ -31,6 +34,16 @@ DownloadItemWidget::~DownloadItemWidget() delete ui; } +void DownloadItemWidget::showDetails() +{ + ui->detailsWidget->show(); +} + +void DownloadItemWidget::hideDetails() +{ + ui->detailsWidget->hide(); +} + QWebEngineDownloadItem *DownloadItemWidget::item() const { return m_item; |