|
|
|
#ifndef __PROJECTMANAGER_H__
|
|
|
|
#define __PROJECTMANAGER_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <tqstring.h>
|
|
|
|
#include <tqobject.h>
|
|
|
|
#include <tqdict.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <kxmlguiclient.h>
|
|
|
|
#include <kservice.h>
|
|
|
|
#include <kurl.h>
|
|
|
|
|
|
|
|
class KAction;
|
|
|
|
class KSelectAction;
|
|
|
|
class KService;
|
|
|
|
class ProjectInfo;
|
|
|
|
class ProjectSession;
|
|
|
|
class KRecentFilesAction;
|
|
|
|
class KDevPlugin;
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KURL m_projectURL;
|
|
|
|
TQDomDocument m_document;
|
|
|
|
TQString m_profileName;
|
|
|
|
TQString m_projectName;
|
|
|
|
TQString m_projectPlugin, m_language, m_activeLanguage, m_vcsPlugin;
|
|
|
|
TQStringList m_ignoreParts, m_keywords;
|
|
|
|
|
|
|
|
TQString sessionFile() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
Project manager.
|
|
|
|
Loads and unloads projects.
|
|
|
|
*/
|
|
|
|
class ProjectManager : public TQObject, public KXMLGUIClient
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
TQ_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
~ProjectManager();
|
|
|
|
|
|
|
|
static TQString projectDirectory( const TQString& path, bool absolute );
|
|
|
|
|
|
|
|
static ProjectManager *getInstance();
|
|
|
|
|
|
|
|
void loadSettings();
|
|
|
|
void saveSettings();
|
|
|
|
void loadDefaultProject();
|
|
|
|
|
|
|
|
bool projectLoaded() const;
|
|
|
|
|
|
|
|
KURL projectFile() const;
|
|
|
|
TQString projectName() const;
|
|
|
|
|
|
|
|
void createActions( KActionCollection* ac );
|
|
|
|
|
|
|
|
ProjectSession* projectSession() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
bool loadProject( const KURL& url);
|
|
|
|
bool loadKDevelop2Project( const KURL& url);
|
|
|
|
bool closeProject( bool exiting = false );
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotOpenProject();
|
|
|
|
void slotProjectOptions();
|
|
|
|
|
|
|
|
void slotLoadProject();
|
|
|
|
|
|
|
|
void loadLocalParts();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ProjectManager();
|
|
|
|
|
|
|
|
void setupActions();
|
|
|
|
void getGeneralInfo();
|
|
|
|
|
|
|
|
bool loadProjectFile();
|
|
|
|
bool saveProjectFile();
|
|
|
|
|
|
|
|
bool loadProjectPart();
|
|
|
|
void unloadProjectPart();
|
|
|
|
|
|
|
|
bool loadLanguageSupport(const TQString& lang);
|
|
|
|
void unloadLanguageSupport();
|
|
|
|
|
|
|
|
// TQString profileByAttributes(const TQString &language, const TQStringList &keywords);
|
|
|
|
|
|
|
|
ProjectInfo *m_info;
|
|
|
|
|
|
|
|
KAction *m_closeProjectAction, *m_projectOptionsAction;
|
|
|
|
KRecentFilesAction *m_openRecentProjectAction;
|
|
|
|
|
|
|
|
static ProjectManager *s_instance;
|
|
|
|
|
|
|
|
ProjectSession* m_pProjectSession;
|
|
|
|
|
|
|
|
KDevPlugin *m_vcsPlugin;
|
|
|
|
TQString m_vcsName;
|
|
|
|
|
|
|
|
TQString m_oldProfileName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|