-
Notifications
You must be signed in to change notification settings - Fork 0
/
diskeditdialog.h
executable file
·84 lines (70 loc) · 2.62 KB
/
diskeditdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef DISKEDITDIALOG_H
#define DISKEDITDIALOG_H
#include <QtWidgets/QMainWindow>
namespace Ui {
class DiskEditDialog;
}
#include <QComboBox>
#include <QAbstractTableModel>
#include <QMimeData>
#include <QItemSelection>
#include "atarifilesystem.h"
class MyModel: public QAbstractTableModel
{
Q_OBJECT
public:
MyModel(QObject *parent);
~MyModel();
QList <AtariDirEntry> entries;
AtariFileSystem *fileSystem;
Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
void deleteFiles(QModelIndexList indexes);
QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
int rowCount (const QModelIndex & parent = QModelIndex()) const;
int columnCount (const QModelIndex & parent = QModelIndex()) const;
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void setDirectory(int row);
void toParent();
void setRoot();
void setFileSystem(AtariFileSystem *aFileSystem);
QMimeData* mimeData(const QModelIndexList &indexes) const;
QStringList mimeTypes() const;
void insertFiles(QStringList names);
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
inline bool isRoot() const {return dirs.count() == 1;}
inline QString currentPath() const {return m_currentPath;}
private:
QString m_currentPath;
QStringList paths;
QStringList *tempDirs;
QList <quint16> dirs;
};
class DiskEditDialog : public QMainWindow {
Q_OBJECT
public:
DiskEditDialog(QWidget *parent = 0);
~DiskEditDialog();
void go(SimpleDiskImage *image, int fileSystem = -1);
protected:
MyModel *model;
void changeEvent(QEvent *e);
private:
Ui::DiskEditDialog *m_ui;
SimpleDiskImage *m_disk;
QComboBox *m_fileSystemBox;
private slots:
void on_actionAddFiles_triggered();
void on_actionDeleteSelectedFiles_triggered();
void on_actionTextConversion_triggered();
void on_actionExtractFiles_triggered();
void on_actionToParent_triggered();
void on_actionPrint_triggered(); //
void on_aView_doubleClicked(QModelIndex index);
void onTopChanged();
void fileSystemChanged(int index);
void currentChanged (const QModelIndex & current, const QModelIndex & previous);
void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
};
#endif // DISKEDITDIALOG_H