diff options
author | Javier <dev.git@javispedro.com> | 2020-10-12 02:27:14 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2020-10-12 02:27:14 +0200 |
commit | 55b5c88cf93d06629ba70eb7cddeb50a365b170a (patch) | |
tree | 49073a56b531898d27822812ba859bd26892f634 /notebookmodel.h | |
parent | a22f3f54d9426c29220815f95dec574a11c43f69 (diff) | |
download | scribiu-55b5c88cf93d06629ba70eb7cddeb50a365b170a.tar.gz scribiu-55b5c88cf93d06629ba70eb7cddeb50a365b170a.zip |
minor UI refactor; allow reading ".archive" directories
Archives cannot be created from the UI yet.
Just copy a .pen directory to an .archive directory for now.
Diffstat (limited to 'notebookmodel.h')
-rw-r--r-- | notebookmodel.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/notebookmodel.h b/notebookmodel.h index f847c77..51148e5 100644 --- a/notebookmodel.h +++ b/notebookmodel.h @@ -24,6 +24,10 @@ #include <QtCore/QFileSystemWatcher> #include <QtGui/QIcon> +#define PEN_EXTENSION "pen" +#define ARCHIVE_EXTENSION "archive" +#define AFD_NOTEBOOK_EXTENSION "afd" + class NotebookModel : public QAbstractItemModel { Q_OBJECT @@ -31,6 +35,10 @@ class NotebookModel : public QAbstractItemModel public: explicit NotebookModel(QObject *parent = 0); + enum Roles { + FileNameRole = Qt::UserRole + }; + static QString defaultDataDirectory(); static QString userDataDirectory(); @@ -58,7 +66,11 @@ private: int indexOfPen(const QString &name); QDir penDir(const QString &pen) const; QDir notebookDir(const QString &pen, const QString ¬ebook) const; - QIcon getNotebookIcon(const QString &pen, const QString ¬ebook) const; + QString penDisplayName(const QString &pen) const; + QString notebookDisplayName(const QString &pen, const QString ¬ebook) const; + QIcon penIcon(const QString &pen) const; + QIcon notebookIcon(const QString &pen, const QString ¬ebook) const; + bool isPenArchive(const QString &pen) const; bool isPenLocked(const QString &pen) const; bool isNotebookLocked(const QString &pen, const QString ¬ebook) const; bool isPaperReplayLocked(const QString &pen) const; |