summaryrefslogtreecommitdiffstats
path: root/krename/profiledlg.h
blob: 84280ed22513e5fc157004852e108257c3d84dbf (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
/***************************************************************************
                          profiledlg.h  -  description
                             -------------------
    begin                : Sat Nov 20 2004
    copyright            : (C) 2004 by Dominik Seichter
    email                : domseichter@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PROFILEDLG_H
#define PROFILEDLG_H

#include <kdialogbase.h>

class KListBox;
class KPushButton;
class KRenameImpl;
class TQCheckBox;

class ProfileManager {
 public: 
    ProfileManager( KRenameImpl* krename );

    static void loadDefaultProfile( KRenameImpl* krename );
    static void loadProfile( const TQString & name, KRenameImpl* krename );
    static bool hasDefaultProfile();

 protected:
    const TQString getProfilePath( const TQString & name );
    const TQString readProfilePath( const TQString & name );

    const TQString listToString( TQValueList<int> & list );
    const TQValueList<int> stringToList( const TQString & );
    
    void writeXML( const TQString & name );
    bool loadXML( const TQString & path );

 protected:
    KRenameImpl* m_krename;
};


/**
@author Dominik Seichter
*/
class ProfileDlg : public KDialogBase, public ProfileManager
{
    Q_OBJECT
  TQ_OBJECT
    
    public:
        ProfileDlg(KRenameImpl* krename, TQWidget *tqparent = 0, const char *name = 0);
        ~ProfileDlg();

    private slots:
        void enableControls();
        void slotLoadProfile();
        void slotCreateProfile();
        void slotDeleteProfile();
	void slotSetDefault();
	void slotHidden();

    private:
	KListBox* profiles;

        TQCheckBox* checkDefault;
        KPushButton* createProfile;
        KPushButton* loadProfile;
        KPushButton* deleteProfile;
};

#endif