Icons in download mgr.

This commit is contained in:
Martin Rotter 2020-11-11 13:40:43 +01:00
parent 72b7182752
commit 89ebcf7382
4 changed files with 34 additions and 19 deletions

View File

@ -81,6 +81,9 @@
#define EXTERNAL_TOOL_SEPARATOR "###" #define EXTERNAL_TOOL_SEPARATOR "###"
#define EXTERNAL_TOOL_PARAM_SEPARATOR "|||" #define EXTERNAL_TOOL_PARAM_SEPARATOR "|||"
#define CLI_LOG_SHORT "l"
#define CLI_LOG_LONG "log"
#define HTTP_HEADERS_ACCEPT "Accept" #define HTTP_HEADERS_ACCEPT "Accept"
#define HTTP_HEADERS_CONTENT_TYPE "Content-Type" #define HTTP_HEADERS_CONTENT_TYPE "Content-Type"
#define HTTP_HEADERS_CONTENT_LENGTH "Content-Length" #define HTTP_HEADERS_CONTENT_LENGTH "Content-Length"

View File

@ -49,11 +49,17 @@ Application::Application(const QString& id, int& argc, char** argv)
m_feedReader(nullptr), m_feedReader(nullptr),
m_quitLogicDone(false), m_quitLogicDone(false),
m_updateFeedsLock(new Mutex()), m_mainForm(nullptr), m_updateFeedsLock(new Mutex()),
m_trayIcon(nullptr), m_settings(Settings::setupSettings(this)), m_webFactory(new WebFactory(this)), m_mainForm(nullptr),
m_system(new SystemFactory(this)), m_skins(new SkinFactory(this)), m_trayIcon(nullptr),
m_localization(new Localization(this)), m_icons(new IconFactory(this)), m_settings(Settings::setupSettings(this)),
m_database(new DatabaseFactory(this)), m_downloadManager(nullptr), m_shouldRestart(false) { m_webFactory(new WebFactory(this)),
m_system(new SystemFactory(this)),
m_skins(new SkinFactory(this)),
m_localization(new Localization(this)),
m_icons(new IconFactory(this)),
m_database(new DatabaseFactory(this)),
m_downloadManager(nullptr), m_shouldRestart(false) {
parseCmdArguments(); parseCmdArguments();
@ -556,7 +562,8 @@ void Application::determineFirstRuns() {
} }
void Application::parseCmdArguments() { void Application::parseCmdArguments() {
QCommandLineOption log_file(QStringList() << "l" << "log", "Write application debug log to file.", "log-file"); QCommandLineOption log_file(QStringList() << CLI_LOG_SHORT << CLI_LOG_LONG,
"Write application debug log to file.", "log-file");
m_cmdParser.addOption(log_file); m_cmdParser.addOption(log_file);
m_cmdParser.addHelpOption(); m_cmdParser.addHelpOption();
@ -565,5 +572,5 @@ void Application::parseCmdArguments() {
m_cmdParser.process(*this); m_cmdParser.process(*this);
s_customLogFile = m_cmdParser.value(QSL("l")); s_customLogFile = m_cmdParser.value(CLI_LOG_SHORT);
} }

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>413</width> <width>418</width>
<height>206</height> <height>206</height>
</rect> </rect>
</property> </property>
@ -19,9 +19,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text">
<string>Ico</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -81,7 +78,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QToolButton" name="m_btnTryAgain"> <widget class="QPushButton" name="m_btnTryAgain">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -91,21 +88,21 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="m_btnStopDownload"> <widget class="QPushButton" name="m_btnStopDownload">
<property name="text"> <property name="text">
<string>&amp;Stop</string> <string>&amp;Stop</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="m_btnOpenFile"> <widget class="QPushButton" name="m_btnOpenFile">
<property name="text"> <property name="text">
<string>&amp;Open file</string> <string>&amp;Open file</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="m_btnOpenFolder"> <widget class="QPushButton" name="m_btnOpenFolder">
<property name="text"> <property name="text">
<string>Open &amp;directory</string> <string>Open &amp;directory</string>
</property> </property>

View File

@ -31,10 +31,15 @@ DownloadItem::DownloadItem(QNetworkReply* reply, QWidget* parent) : QWidget(pare
m_ui->m_btnTryAgain->hide(); m_ui->m_btnTryAgain->hide();
m_requestFileName = qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::AlwaysPromptForFilename)).toBool(); m_requestFileName = qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::AlwaysPromptForFilename)).toBool();
connect(m_ui->m_btnStopDownload, &QToolButton::clicked, this, &DownloadItem::stop); m_ui->m_btnTryAgain->setIcon(qApp->icons()->fromTheme(QSL("view-refresh")));
connect(m_ui->m_btnOpenFile, &QToolButton::clicked, this, &DownloadItem::openFile); m_ui->m_btnOpenFile->setIcon(qApp->icons()->fromTheme(QSL("document-open")));
connect(m_ui->m_btnTryAgain, &QToolButton::clicked, this, &DownloadItem::tryAgain); m_ui->m_btnOpenFolder->setIcon(qApp->icons()->fromTheme(QSL("folder")));
connect(m_ui->m_btnOpenFolder, &QToolButton::clicked, this, &DownloadItem::openFolder); m_ui->m_btnStopDownload->setIcon(qApp->icons()->fromTheme(QSL("process-stop")));
connect(m_ui->m_btnStopDownload, &QPushButton::clicked, this, &DownloadItem::stop);
connect(m_ui->m_btnOpenFile, &QPushButton::clicked, this, &DownloadItem::openFile);
connect(m_ui->m_btnTryAgain, &QPushButton::clicked, this, &DownloadItem::tryAgain);
connect(m_ui->m_btnOpenFolder, &QPushButton::clicked, this, &DownloadItem::openFolder);
init(); init();
} }
@ -432,6 +437,9 @@ DownloadManager::DownloadManager(QWidget* parent) : TabContent(parent), m_ui(new
m_ui->m_viewDownloads->setAlternatingRowColors(true); m_ui->m_viewDownloads->setAlternatingRowColors(true);
m_ui->m_viewDownloads->horizontalHeader()->setStretchLastSection(true); m_ui->m_viewDownloads->horizontalHeader()->setStretchLastSection(true);
m_ui->m_viewDownloads->setModel(m_model); m_ui->m_viewDownloads->setModel(m_model);
m_ui->m_btnCleanup->setIcon(qApp->icons()->fromTheme(QSL("edit-clear")));
setDownloadDirectory(qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::TargetDirectory)).toString()); setDownloadDirectory(qApp->settings()->value(GROUP(Downloads), SETTING(Downloads::TargetDirectory)).toString());
connect(m_ui->m_btnCleanup, &QPushButton::clicked, this, &DownloadManager::cleanup); connect(m_ui->m_btnCleanup, &QPushButton::clicked, this, &DownloadManager::cleanup);
load(); load();