mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Rename interface
This commit is contained in:
parent
4fd5037c10
commit
f7ae010274
@ -70,14 +70,14 @@ class FileSystemPathEdit::FileSystemPathEditPrivate
|
|||||||
Q_DECLARE_PUBLIC(FileSystemPathEdit)
|
Q_DECLARE_PUBLIC(FileSystemPathEdit)
|
||||||
Q_DISABLE_COPY_MOVE(FileSystemPathEditPrivate)
|
Q_DISABLE_COPY_MOVE(FileSystemPathEditPrivate)
|
||||||
|
|
||||||
FileSystemPathEditPrivate(FileSystemPathEdit *q, Private::FileEditorWithCompletion *editor);
|
FileSystemPathEditPrivate(FileSystemPathEdit *q, Private::IFileEditorWithCompletion *editor);
|
||||||
|
|
||||||
void modeChanged();
|
void modeChanged();
|
||||||
void browseActionTriggered();
|
void browseActionTriggered();
|
||||||
QString dialogCaptionOrDefault() const;
|
QString dialogCaptionOrDefault() const;
|
||||||
|
|
||||||
FileSystemPathEdit *q_ptr = nullptr;
|
FileSystemPathEdit *q_ptr = nullptr;
|
||||||
std::unique_ptr<Private::FileEditorWithCompletion> m_editor;
|
std::unique_ptr<Private::IFileEditorWithCompletion> m_editor;
|
||||||
QAction *m_browseAction = nullptr;
|
QAction *m_browseAction = nullptr;
|
||||||
QToolButton *m_browseBtn = nullptr;
|
QToolButton *m_browseBtn = nullptr;
|
||||||
QString m_fileNameFilter;
|
QString m_fileNameFilter;
|
||||||
@ -88,7 +88,7 @@ class FileSystemPathEdit::FileSystemPathEditPrivate
|
|||||||
};
|
};
|
||||||
|
|
||||||
FileSystemPathEdit::FileSystemPathEditPrivate::FileSystemPathEditPrivate(
|
FileSystemPathEdit::FileSystemPathEditPrivate::FileSystemPathEditPrivate(
|
||||||
FileSystemPathEdit *q, Private::FileEditorWithCompletion *editor)
|
FileSystemPathEdit *q, Private::IFileEditorWithCompletion *editor)
|
||||||
: q_ptr {q}
|
: q_ptr {q}
|
||||||
, m_editor {editor}
|
, m_editor {editor}
|
||||||
, m_browseAction {new QAction(q)}
|
, m_browseAction {new QAction(q)}
|
||||||
@ -183,7 +183,7 @@ void FileSystemPathEdit::FileSystemPathEditPrivate::modeChanged()
|
|||||||
m_validator->setCheckWritePermission((m_mode == FileSystemPathEdit::Mode::FileSave) || (m_mode == FileSystemPathEdit::Mode::DirectorySave));
|
m_validator->setCheckWritePermission((m_mode == FileSystemPathEdit::Mode::FileSave) || (m_mode == FileSystemPathEdit::Mode::DirectorySave));
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemPathEdit::FileSystemPathEdit(Private::FileEditorWithCompletion *editor, QWidget *parent)
|
FileSystemPathEdit::FileSystemPathEdit(Private::IFileEditorWithCompletion *editor, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, d_ptr(new FileSystemPathEditPrivate(this, editor))
|
, d_ptr(new FileSystemPathEditPrivate(this, editor))
|
||||||
{
|
{
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
namespace Private
|
namespace Private
|
||||||
{
|
{
|
||||||
class FileComboEdit;
|
class FileComboEdit;
|
||||||
class FileEditorWithCompletion;
|
|
||||||
class FileLineEdit;
|
class FileLineEdit;
|
||||||
|
class IFileEditorWithCompletion;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -92,7 +92,7 @@ signals:
|
|||||||
void selectedPathChanged(const Path &path);
|
void selectedPathChanged(const Path &path);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit FileSystemPathEdit(Private::FileEditorWithCompletion *editor, QWidget *parent);
|
explicit FileSystemPathEdit(Private::IFileEditorWithCompletion *editor, QWidget *parent);
|
||||||
|
|
||||||
template <class Widget>
|
template <class Widget>
|
||||||
Widget *editWidget() const
|
Widget *editWidget() const
|
||||||
|
@ -95,10 +95,10 @@ namespace Private
|
|||||||
mutable QValidator::State m_lastValidationState = QValidator::Invalid;
|
mutable QValidator::State m_lastValidationState = QValidator::Invalid;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileEditorWithCompletion
|
class IFileEditorWithCompletion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~FileEditorWithCompletion() = default;
|
virtual ~IFileEditorWithCompletion() = default;
|
||||||
virtual void completeDirectoriesOnly(bool completeDirsOnly) = 0;
|
virtual void completeDirectoriesOnly(bool completeDirsOnly) = 0;
|
||||||
virtual void setFilenameFilters(const QStringList &filters) = 0;
|
virtual void setFilenameFilters(const QStringList &filters) = 0;
|
||||||
virtual void setBrowseAction(QAction *action) = 0;
|
virtual void setBrowseAction(QAction *action) = 0;
|
||||||
@ -108,7 +108,7 @@ namespace Private
|
|||||||
virtual QWidget *widget() = 0;
|
virtual QWidget *widget() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileLineEdit final : public QLineEdit, public FileEditorWithCompletion
|
class FileLineEdit final : public QLineEdit, public IFileEditorWithCompletion
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY_MOVE(FileLineEdit)
|
Q_DISABLE_COPY_MOVE(FileLineEdit)
|
||||||
@ -140,7 +140,7 @@ namespace Private
|
|||||||
QFileIconProvider m_iconProvider;
|
QFileIconProvider m_iconProvider;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileComboEdit final : public QComboBox, public FileEditorWithCompletion
|
class FileComboEdit final : public QComboBox, public IFileEditorWithCompletion
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY_MOVE(FileComboEdit)
|
Q_DISABLE_COPY_MOVE(FileComboEdit)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user