1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2010 Hugues Delorme
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef BAZAARPLUGIN_H
34 #define BAZAARPLUGIN_H
36 #include "bazaarsettings.h"
38 #include <vcsbase/vcsbaseclientsettings.h>
39 #include <vcsbase/vcsbaseplugin.h>
40 #include <coreplugin/icontext.h>
42 #include <QtCore/QFileInfo>
43 #include <QtCore/QHash>
44 #include <QtCore/qglobal.h>
53 class ActionContainer;
56 class IVersionControl;
62 class ParameterAction;
66 class VCSBaseSubmitEditor;
81 class BazaarPlugin : public VCSBase::VCSBasePlugin
87 virtual ~BazaarPlugin();
88 bool initialize(const QStringList &arguments, QString *errorMessage);
90 static BazaarPlugin *instance();
91 BazaarClient *client() const;
93 const BazaarSettings &settings() const;
94 void setSettings(const BazaarSettings &settings);
97 // File menu action slots
98 void addCurrentFile();
99 void annotateCurrentFile();
100 void diffCurrentFile();
101 void logCurrentFile();
102 void revertCurrentFile();
103 void statusCurrentFile();
105 // Directory menu action slots
106 void diffRepository();
107 void logRepository();
111 // Repository menu action slots
116 void showCommitWidget(const QList<QPair<QString, QString> > &status);
117 void commitFromEditor();
118 void diffFromEditorSelected(const QStringList &files);
121 virtual void updateActions(VCSBase::VCSBasePlugin::ActionState);
122 virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor);
127 void createSubmitEditorActions();
128 void createSeparator(const Core::Context &context, const Core::Id &id);
129 void createFileActions(const Core::Context &context);
130 void createDirectoryActions(const Core::Context &context);
131 void createRepositoryActions(const Core::Context &context);
132 void deleteCommitLog();
135 static BazaarPlugin *m_instance;
136 BazaarSettings m_bazaarSettings;
137 OptionsPage *m_optionsPage;
138 BazaarClient *m_client;
141 Locator::CommandLocator *m_commandLocator;
142 Core::ActionManager *m_actionManager;
143 Core::ActionContainer *m_bazaarContainer;
145 QList<QAction *> m_repositoryActionList;
146 QTemporaryFile *m_changeLog;
148 // Menu Items (file actions)
149 Utils::ParameterAction *m_addAction;
150 Utils::ParameterAction *m_deleteAction;
151 Utils::ParameterAction *m_annotateFile;
152 Utils::ParameterAction *m_diffFile;
153 Utils::ParameterAction *m_logFile;
154 Utils::ParameterAction *m_renameFile;
155 Utils::ParameterAction *m_revertFile;
156 Utils::ParameterAction *m_statusFile;
158 // Submit editor actions
159 QAction *m_editorCommit;
160 QAction *m_editorDiff;
161 QAction *m_editorUndo;
162 QAction *m_editorRedo;
163 QAction *m_menuAction;
165 QString m_submitRepository;
168 } //namespace Internal
171 #endif // BAZAARPLUGIN_H