simplified usage of RsCollectionDialog in shared files (removed duplicate functionality)

This commit is contained in:
csoler 2024-02-29 22:07:52 +01:00
parent 2ed72a146b
commit 31c390aa27
4 changed files with 86 additions and 43 deletions

View file

@ -34,15 +34,24 @@ public:
virtual ~RsCollectionDialog();
// Open new collection
static bool openNewCollection(const RsFileTree &tree, const QString &proposed_file_name = QString());
static bool openNewCollection(const RsFileTree &tree = RsFileTree());
// Open existing collection
static bool openExistingCollection(const QString& fileName, bool readOnly = false, bool showError = true);
// Edit existing collection
static bool editExistingCollection(const QString& fileName, bool showError = true);
// Open existing collection for download
static bool openExistingCollection(const QString& fileName, bool showError = true);
protected:
//bool eventFilter(QObject *obj, QEvent *ev);
RsCollectionDialog(const QString& filename, const bool& creation, const bool& readOnly = false) ;
enum RsCollectionDialogMode {
UNKNOWN = 0x00,
EDIT = 0x01,
DOWNLOAD = 0x02,
};
RsCollectionDialog(const QString& filename, RsCollectionDialogMode mode) ;
private slots:
void directoryLoaded(QString dirLoaded);
@ -90,8 +99,8 @@ private:
Ui::RsCollectionDialog ui;
QString _fileName ;
const bool _creationMode ;
const bool _readOnly;
RsCollectionDialogMode _mode;
QFileSystemModel *_dirModel;
QSortFilterProxyModel *_tree_proxyModel;