~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/appwizard/appwizarddlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2001 by Bernd Gehrmann                                  *
3
 
 *   bernd@kdevelop.org                                                    *
4
 
 *   Copyright (C) 2001 by Sandy Meier                                     *
5
 
 *   smeier@kdevelop.org                                                   *
6
 
 *                                                                         *
7
 
 *   This program is free software; you can redistribute it and/or modify  *
8
 
 *   it under the terms of the GNU General Public License as published by  *
9
 
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 
 *   (at your option) any later version.                                   *
11
 
 *                                                                         *
12
 
 ***************************************************************************/
13
 
 
14
 
#ifndef _APPWIZARDDIALOG_H_
15
 
#define _APPWIZARDDIALOG_H_
16
 
 
17
 
class AppWizardPart;
18
 
class QMultiLineEdit;
19
 
class QRadioButton;
20
 
class KTempFile;
21
 
class QWidgetStack;
22
 
class QVBox;
23
 
class KPopupMenu;
24
 
class QHBoxLayout;
25
 
class KArchiveDirectory;
26
 
class KArchiveFile;
27
 
class ProfileSupport;
28
 
#include <qptrlist.h>
29
 
#include <qdict.h>
30
 
#include <klineedit.h>
31
 
#include <qlabel.h>
32
 
#include <qstringlist.h>
33
 
#include <klistview.h>
34
 
#include <kiconview.h>
35
 
#include "kdevversioncontrol.h"
36
 
#include "kdevvcsintegrator.h"
37
 
#include "appwizarddlgbase.h"
38
 
#include "vcs_form.h"
39
 
//#include "autoform.h"
40
 
#include "kdevlicense.h"
41
 
 
42
 
namespace PropertyLib {
43
 
        class PropertyList;
44
 
        class PropertyEditor;
45
 
}
46
 
 
47
 
struct installFile
48
 
{
49
 
        QString source;
50
 
        QString dest;
51
 
        QString option;
52
 
        bool process;
53
 
        bool isXML;
54
 
};
55
 
 
56
 
struct installArchive
57
 
{
58
 
        QString source;
59
 
        QString dest;
60
 
        QString option;
61
 
        bool process;
62
 
};
63
 
 
64
 
struct installDir
65
 
{
66
 
        QString dir;
67
 
        QString option;
68
 
        int perms;
69
 
};
70
 
 
71
 
struct ApplicationInfo
72
 
{
73
 
    QString templateName;
74
 
    QString name;
75
 
    QString comment;
76
 
    QString icon;
77
 
    QString category;
78
 
    QString defaultDestDir;
79
 
    QString fileTemplates;
80
 
    QStringList openFilesAfterGeneration;
81
 
    QString templateFile;
82
 
    QMap<QString,QString> subMap;
83
 
        QMap<QString,QString> subMapXML;
84
 
    QStringList includes;
85
 
 
86
 
        //QMap<autoKey,QVariant> subValues;
87
 
        PropertyLib::PropertyList *propValues;
88
 
 
89
 
    QValueList<installFile> fileList;
90
 
    QValueList<installArchive> archList;
91
 
    QValueList<installDir> dirList;
92
 
    QString customUI;
93
 
    QString message;
94
 
    QString finishCmd;
95
 
    QString finishCmdDir;
96
 
    QString sourceArchive;
97
 
 
98
 
    //! item pointer to the listview
99
 
    QListViewItem *item;
100
 
 
101
 
        //! pointer to favourite icon (NULL if there isn't one)
102
 
        QIconViewItem *favourite;
103
 
 
104
 
    ApplicationInfo()
105
 
    : item( 0 ), favourite( 0 )
106
 
    {}
107
 
};
108
 
 
109
 
struct AppWizardFileTemplate
110
 
{
111
 
    QString suffix;
112
 
    QString style;
113
 
    QMultiLineEdit *edit;
114
 
 
115
 
    AppWizardFileTemplate()
116
 
    : edit( 0 )
117
 
    {}
118
 
};
119
 
 
120
 
 
121
 
class AppWizardDialog : public AppWizardDialogBase
122
 
{
123
 
    Q_OBJECT
124
 
 
125
 
public:
126
 
    AppWizardDialog( AppWizardPart *part, QWidget *parent=0, const char *name=0 );
127
 
    ~AppWizardDialog();
128
 
    QString getProjectName() { return appname_edit->text(); }
129
 
    QString getProjectLocation() { return finalLoc_label->text(); }
130
 
 
131
 
protected:
132
 
    virtual void accept();
133
 
 
134
 
        virtual QDict<KDevLicense> licenses();
135
 
        void loadLicenses();
136
 
 
137
 
protected slots:
138
 
    virtual void templatesTreeViewClicked(QListViewItem*);
139
 
    virtual void textChanged();
140
 
    virtual void licenseChanged();
141
 
    virtual void destButtonClicked(const QString&);
142
 
    virtual void projectNameChanged();
143
 
    virtual void projectLocationChanged();
144
 
    virtual void favouritesIconViewClicked( QIconViewItem * );
145
 
        virtual void templatesContextMenu(QListViewItem*, const QPoint&, int);
146
 
        virtual void favouritesContextMenu(QIconViewItem* item, const QPoint& point);
147
 
        virtual void addTemplateToFavourites();
148
 
        virtual void done(int r);
149
 
        virtual void removeFavourite();
150
 
        virtual void pageChanged();
151
 
 
152
 
private: //methods
153
 
 
154
 
    ApplicationInfo *templateForItem(QListViewItem *item);
155
 
    void insertCategoryIntoTreeView(const QString &completeCategoryPath);
156
 
    void loadVcs();
157
 
        void updateNextButtons();
158
 
 
159
 
        void populateFavourites();
160
 
        void addFavourite(QListViewItem* item, QString favouriteName="");
161
 
        ApplicationInfo* findFavouriteInfo(QIconViewItem* item);
162
 
 
163
 
        void unpackArchive( const KArchiveDirectory *dir, const QString &dest, bool process );
164
 
        bool copyFile( const installFile& file );
165
 
        bool copyFile( const QString &source, const QString &dest, bool isXML, bool process );
166
 
        QString kdevRoot(const QString &templateName ) const;
167
 
        void openAfterGeneration();
168
 
 
169
 
        void setPermissions(const KArchiveFile *source, QString dest);
170
 
        void setPermissions(const installFile &file);
171
 
 
172
 
        void checkAndHideItems(QListView *view);
173
 
        bool checkAndHideItems(QListViewItem *item);
174
 
 
175
 
private: //data
176
 
 
177
 
    QPtrList<ApplicationInfo> m_appsInfo;
178
 
        QValueList<AppWizardFileTemplate> m_fileTemplates;
179
 
    //! Store the category name and the pointer in the treeview
180
 
    QDict<QListViewItem> m_categoryMap;
181
 
        QValueList<QListViewItem*> m_categoryItems;
182
 
    //! A list of currently available version control systems
183
 
//    QDict<KDevVersionControl> m_availVcs;
184
 
 
185
 
    QHBoxLayout *m_custom_options_layout;
186
 
        PropertyLib::PropertyEditor *m_customOptions;
187
 
    AppWizardPart *m_part;
188
 
    QWidget *m_lastPage;
189
 
    QPtrList<KTempFile> m_tempFiles;
190
 
    ApplicationInfo* m_pCurrentAppInfo;
191
 
    bool m_projectLocationWasChanged;
192
 
    VcsForm *m_vcsForm;
193
 
    bool m_pathIsValid;
194
 
        KPopupMenu* m_favouritesMenu;
195
 
        KPopupMenu* m_templatesMenu;
196
 
 
197
 
        QDict<KDevLicense> m_licenses;
198
 
        QDict<KDevVCSIntegrator> m_integrators;
199
 
        QMap<int, VCSDialog*> m_integratorDialogs;
200
 
 
201
 
        ProfileSupport *m_profileSupport;
202
 
 
203
 
public slots:
204
 
    virtual void showTemplates(bool all);
205
 
};
206
 
 
207
 
#endif
208
 
 
209
 
// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;