summaryrefslogtreecommitdiffstats
path: root/src/outputdirectory.h
blob: 85b523657905352288f4cb4e2a23df29aed2c980 (plain)
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


#ifndef OUTPUTDIRECTORY_H
#define OUTPUTDIRECTORY_H

#include <qwidget.h>
#include <kprocess.h>

class FileListItem;

class Config;
class KComboBox;
class KLineEdit;
class KToolBarButton;

/**
 * @short The input area for the output directory
 * @author Daniel Faust <[email protected]>
 * @version 0.3
 */
class OutputDirectory : public QWidget
{
    Q_OBJECT
public:
    enum Mode {
//         Default,
        MetaData,
        Source,
        Specify,
        CopyStructure
    };

    /**
     * Constructor
     */
    OutputDirectory( Config*, QWidget* parent = 0, const char* name = 0 );

    Mode mode();
    void setMode( Mode );
    QString directory();
    void setDirectory( const QString& );

    static QString calcPath( FileListItem* fileListItem, Config* config, QString extension = "" );
    static QString changeExtension( const QString& filename, const QString& extension );
    static QString uniqueFileName( const QString& filename );
    static QString makePath( const QString& path );
    static QString vfatPath( const QString& path );

    /**
     * Destructor
     */
    virtual ~OutputDirectory();

public slots:
    //void setActive( bool );
    void enable();
    void disable();

private slots:
    void modeChangedSlot( int );
    void directoryChangedSlot( const QString& );
    void selectDir();
    void gotoDir();
    //void modeInfo();
    //void dirInfo();
    //void savePaths();

private:
    KComboBox* cMode;
    //KToolBarButton* pModeInfo;
    KLineEdit* lDir;
    KToolBarButton* pDirSelect;
    KToolBarButton* pDirGoto;
    //KToolBarButton* pDirInfo;
    KToolBarButton* pClear;

    bool modeJustChanged;

    KProcess kfm;

    Config* config;

/*    QString sharedDirPath;
    QString metadataPath;
    QString copyStructurePath;
*/
signals:
    void modeChanged( OutputDirectory::Mode );
    void directoryChanged( const QString& );
};

#endif // OUTPUTDIRECTORY_H