KDevelop API Documentation

appwizarddlg.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Bernd Gehrmann                                  *
00003  *   bernd@kdevelop.org                                                    *
00004  *   Copyright (C) 2001 by Sandy Meier                                     *
00005  *   smeier@kdevelop.org                                                   *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #ifndef _APPWIZARDDIALOG_H_
00015 #define _APPWIZARDDIALOG_H_
00016 
00017 class AppWizardPart;
00018 class QMultiLineEdit;
00019 class QRadioButton;
00020 class KTempFile;
00021 class QWidgetStack;
00022 class QVBox;
00023 class KPopupMenu;
00024 class QHBoxLayout;
00025 class KArchiveDirectory;
00026 class KArchiveFile;
00027 #include <qptrlist.h>
00028 #include <qdict.h>
00029 #include <qlineedit.h>
00030 #include <qlabel.h>
00031 #include <qstringlist.h>
00032 #include <klistview.h>
00033 #include <kiconview.h>
00034 #include "kdevversioncontrol.h"
00035 #include "appwizarddlgbase.h"
00036 //#include "vcs_form.h"
00037 #include "autoform.h"
00038 
00039 struct installFile
00040 {
00041     QString source;
00042     QString dest;
00043     QString option;
00044     bool process;
00045     bool isXML;
00046 };
00047 
00048 struct installArchive
00049 {
00050     QString source;
00051     QString dest;
00052     QString option;
00053     bool process;
00054 };
00055 
00056 struct installDir
00057 {
00058     QString dir;
00059     QString option;
00060     int perms;
00061 };
00062 
00063 struct ApplicationInfo
00064 {
00065     QString templateName;
00066     QString name;
00067     QString comment;
00068     QString icon;
00069     QString category;
00070     QString defaultDestDir;
00071     QString fileTemplates;
00072     QStringList openFilesAfterGeneration;
00073     QString templateFile;
00074     QMap<QString,QString> subMap;
00075     QMap<QString,QString> subMapXML;
00076     QStringList includes;
00077     
00078     AutoPropertyMap subValues;
00079     QValueList<installFile> fileList;
00080     QValueList<installArchive> archList;
00081     QValueList<installDir> dirList;
00082     QString customUI;
00083     QString message;
00084     QString sourceArchive;
00085 
00087     QListViewItem *item;
00088     
00090     QIconViewItem *favourite;   
00091 
00092     ApplicationInfo()
00093     : item( 0 ), favourite( 0 )
00094     {}
00095 };
00096 
00097 struct AppWizardFileTemplate
00098 {
00099     QString suffix;
00100     QString style;
00101     QMultiLineEdit *edit;
00102 
00103     AppWizardFileTemplate()
00104     : edit( 0 )
00105     {}
00106 };
00107 
00108 
00109 class AppWizardDialog : public AppWizardDialogBase
00110 {
00111     Q_OBJECT
00112 
00113 public:
00114     AppWizardDialog( AppWizardPart *part, QWidget *parent=0, const char *name=0 );
00115     ~AppWizardDialog();
00116     QString getProjectName() { return appname_edit->text(); }
00117     QString getProjectLocation() { return finalLoc_label->text(); }
00118 
00119 protected:
00120     virtual void accept();
00121 
00122 protected slots:
00123     virtual void templatesTreeViewClicked(QListViewItem*);
00124     virtual void textChanged();
00125     virtual void licenseChanged();
00126     virtual void destButtonClicked(const QString&);
00127     virtual void projectNameChanged();
00128     virtual void projectLocationChanged();
00129     virtual void favouritesIconViewClicked( QIconViewItem * );
00130     virtual void templatesContextMenu(QListViewItem*, const QPoint&, int);
00131     virtual void favouritesContextMenu(QIconViewItem* item, const QPoint& point);
00132     virtual void addTemplateToFavourites();
00133     virtual void done(int r);
00134     virtual void removeFavourite();
00135     virtual void pageChanged();
00136     
00137 private: //methods
00138 
00139     ApplicationInfo *templateForItem(QListViewItem *item);
00140     void insertCategoryIntoTreeView(const QString &completeCategoryPath);
00141 //    void loadVcs();
00142     void updateNextButtons();
00143 
00144     void populateFavourites();
00145     void addFavourite(QListViewItem* item, QString favouriteName="");
00146     ApplicationInfo* findFavouriteInfo(QIconViewItem* item);
00147     
00148     void unpackArchive( const KArchiveDirectory *dir, const QString &dest, bool process );
00149     bool copyFile( const installFile& file );
00150     bool copyFile( const QString &source, const QString &dest, bool isXML, bool process );
00151     QString kdevRoot(const QString &templateName ) const;
00152     void openAfterGeneration();
00153     
00154     void setPermissions(const KArchiveFile *source, QString dest);
00155     void setPermissions(const installFile &file);
00156     
00157 private: //data
00158 
00159     QPtrList<ApplicationInfo> m_appsInfo;
00160     QValueList<AppWizardFileTemplate> m_fileTemplates;
00162     QDict<QListViewItem> m_categoryMap;
00164 //    QDict<KDevVersionControl> m_availVcs;
00165     
00166     QHBoxLayout *m_custom_options_layout;
00167     AutoForm *m_customOptions;
00168     AppWizardPart *m_part;
00169     QWidget *m_lastPage;
00170     QPtrList<KTempFile> m_tempFiles;
00171     ApplicationInfo* m_pCurrentAppInfo;
00172     bool m_projectLocationWasChanged;
00173 //    VcsForm *m_vcsForm;
00174     bool m_pathIsValid;
00175     KPopupMenu* m_favouritesMenu;
00176     KPopupMenu* m_templatesMenu;
00177 };
00178 
00179 #endif
00180 
00181 // kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:53 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003