aboutsummaryrefslogtreecommitdiff
path: root/notebookmodel.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2020-10-12 02:27:14 +0200
committerJavier <dev.git@javispedro.com>2020-10-12 02:27:14 +0200
commit55b5c88cf93d06629ba70eb7cddeb50a365b170a (patch)
tree49073a56b531898d27822812ba859bd26892f634 /notebookmodel.h
parenta22f3f54d9426c29220815f95dec574a11c43f69 (diff)
downloadscribiu-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.h14
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 &notebook) const;
- QIcon getNotebookIcon(const QString &pen, const QString &notebook) const;
+ QString penDisplayName(const QString &pen) const;
+ QString notebookDisplayName(const QString &pen, const QString &notebook) const;
+ QIcon penIcon(const QString &pen) const;
+ QIcon notebookIcon(const QString &pen, const QString &notebook) const;
+ bool isPenArchive(const QString &pen) const;
bool isPenLocked(const QString &pen) const;
bool isNotebookLocked(const QString &pen, const QString &notebook) const;
bool isPaperReplayLocked(const QString &pen) const;