-
Notifications
You must be signed in to change notification settings - Fork 4
/
importhandler.h
93 lines (72 loc) · 2.37 KB
/
importhandler.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
85
86
87
88
89
90
91
92
93
#ifndef IMPORTHANDLER_H
#define IMPORTHANDLER_H
#include <QDialog>
#include <QDir>
#include <QFutureWatcher>
#include <QTime>
#include <QCloseEvent>
#include "ui_importhandler.h"
#include "importthread.h"
#define TAB_INDEX_ITEMS 0
#define TAB_INDEX_SPRITES 1
#define TAB_INDEX_PICTURES 2
#define IMPORT_TYPE_INSERT 0
#define IMPORT_TYPE_APPEND 1
#define IMPORT_TYPE_REPLACE 2
class ItemModel;
class SpriteModel;
class ImportHandler : public QDialog
{
Q_OBJECT
public:
ImportHandler( QWidget *parent = 0 );
virtual ~ImportHandler( void );
void selectItems( void );
void selectOutfits( void );
void selectEffects( void );
void selectProjectiles( void );
void selectSprites( void );
void selectPictures( void );
void processFiles( const QStringList& selectedFiles );
bool processFile( const QString& filePath, QObject *destination );
void pathSearch( QStringList& validFiles, const QString& path );
void recursiveSearch( QStringList& validFiles, const QDir& dir );
void performImport( ObjectVector objects, qint8 importDestination );
void importItems( ItemList& items, qint8 importDestination );
void importSprites( const ResourceList& resources, quint8 resourceType, quint32 count );
ImportThread *getThread( void ) const {
return importThread;
};
DropFileThread *getAltThread( void ) const {
return dropThread;
};
void dropFiles(const QStringList& strings, const QUrlList& urls, DropMode_t dropMode );
private:
ImportThread *importThread;
DropFileThread *dropThread;
QAction *actionDelete;
QAction *destItems;
QAction *destOutfits;
QAction *destEffects;
QAction *destProjectiles;
ItemModel *itemModel;
SpriteModel *spriteModel;
SpriteModel *pictureModel;
QList<QFile *> fileList;
Ui::ImportHandlerClass *ui;
private slots:
void onDropTibiaFile( QFile * );
void onDropItems( ItemList );
void onDropSprites( quint8, ResourceList );
void onDropSuccess( int );
void onImportStarted( void );
void onImportComplete( void );
void onImportSuccess( int );
void onTreeViewContextMenu( const QPoint& );
void onDelete( void );
void onDropFiles( const QMimeData *, int, const QModelIndex& );
void onButtonClicked( QAbstractButton * );
protected:
virtual void closeEvent( QCloseEvent *event );
};
#endif // IMPORTHANDLER_H