aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/downloaddialog.cpp9
-rw-r--r--src/forms/downloaddialog.ui30
2 files changed, 29 insertions, 10 deletions
diff --git a/src/forms/downloaddialog.cpp b/src/forms/downloaddialog.cpp
index 7d26c4b..950fa96 100644
--- a/src/forms/downloaddialog.cpp
+++ b/src/forms/downloaddialog.cpp
@@ -34,6 +34,7 @@ DownloadDialog::DownloadDialog(QWidget *parent) :
ui(new Ui::DownloadDialog)
{
ui->setupUi(this);
+ ui->filePath->setWordWrap(true);
connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(showItemDetails(int)));
}
@@ -47,10 +48,7 @@ void DownloadDialog::addDownload(QWebEngineDownloadItem *item)
{
Settings settings;
- qDebug("download item: %s", qUtf8Printable(item->url().toString()));
- qDebug("download path: %s", qUtf8Printable(settings.value("downloads/path").toString()));
-
- QString filepath = QFileDialog::getSaveFileName(this, tr("Save"), settings.value("downloads/path").toString());
+ QString filepath = QFileDialog::getSaveFileName(this, tr("Save"), settings.value("downloads/path").toString() + "/" + QFileInfo(item->path()).fileName());
if(filepath.isEmpty()) {
// user cancelled the save dialog
@@ -76,5 +74,6 @@ void DownloadDialog::showItemDetails(int index)
{
DownloadItemForm *form = qobject_cast<DownloadItemForm *>(ui->listWidget->itemWidget(ui->listWidget->item(index)));
ui->mimeType_label->setText(form->item()->mimeType());
- ui->path_label->setText(form->item()->path());
+ ui->filePath_label->setText(form->item()->path());
+ ui->fileSize_label->setText(QString("%1 bytes").arg(form->item()->totalBytes()));
}
diff --git a/src/forms/downloaddialog.ui b/src/forms/downloaddialog.ui
index f9bc307..2e21106 100644
--- a/src/forms/downloaddialog.ui
+++ b/src/forms/downloaddialog.ui
@@ -27,14 +27,20 @@
<height>0</height>
</size>
</property>
+ <property name="maximumSize">
+ <size>
+ <width>250</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="title">
<string>Details</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="mimeType">
<property name="text">
- <string>mime</string>
+ <string>Type</string>
</property>
</widget>
</item>
@@ -46,14 +52,28 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="label_2">
+ <widget class="QLabel" name="filePath">
<property name="text">
- <string>path</string>
+ <string>Path</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="fileSize">
+ <property name="text">
+ <string>Size</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="fileSize_label">
+ <property name="text">
+ <string/>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QLabel" name="path_label">
+ <widget class="QLabel" name="filePath_label">
<property name="text">
<string/>
</property>