videodownloader/gui/adddownloaddialog.h

53 lines
1.0 KiB
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef ADDDOWNLOADDIALOG_H
#define ADDDOWNLOADDIALOG_H
#include <QDialog>
#include <QInputDialog>
#include <memory>
namespace Network {
class Download;
}
namespace QtGui {
namespace Ui {
class AddDownloadDialog;
}
2017-05-01 03:22:50 +02:00
class AddDownloadDialog : public QDialog {
2015-04-22 19:32:04 +02:00
Q_OBJECT
2017-05-01 03:22:50 +02:00
2015-04-22 19:32:04 +02:00
public:
explicit AddDownloadDialog(QWidget *parent = nullptr);
~AddDownloadDialog();
Network::Download *result() const;
void reset();
bool hasValidInput() const;
2020-03-09 18:46:29 +01:00
Q_SIGNALS:
2015-04-22 19:32:04 +02:00
void addDownloadClicked();
2020-03-08 14:06:45 +01:00
private Q_SLOTS:
2015-04-22 19:32:04 +02:00
void textChanged(const QString &text);
void adjustDetectedDownloadType();
void setLastUrl();
void back();
void returnPressed();
void insertTextFromClipboard();
private:
std::unique_ptr<Ui::AddDownloadDialog> m_ui;
static QStringList s_knownDownloadTypeNames;
2015-04-22 19:32:04 +02:00
int m_downloadTypeIndex;
bool m_downloadTypeIndexAdjustedManually;
bool m_validInput;
QInputDialog *m_selectDownloadTypeInputDialog;
QString m_lastUrl;
};
2019-07-20 20:20:58 +02:00
} // namespace QtGui
2015-04-22 19:32:04 +02:00
#endif // ADDDOWNLOADDIALOG_H