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

« back to all changes in this revision

Viewing changes to vcs/perforce/perforcepart.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 1999-2001 by Bernd Gehrmann                             *
 
3
 *   bernd@kdevelop.org                                                    *
 
4
 *   Extended to use perforce 2002 by Harald Fernengel <harry@kdevelop.org>*
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 ***************************************************************************/
 
12
 
 
13
#ifndef _PERFORCEPART_H_
 
14
#define _PERFORCEPART_H_
 
15
 
 
16
#include <kdevversioncontrol.h>
 
17
#include <klocale.h>
 
18
 
 
19
class Context;
 
20
class QPopupMenu;
 
21
class KAction;
 
22
 
 
23
class PerforcePart : public KDevVersionControl
 
24
{
 
25
    Q_OBJECT
 
26
 
 
27
public:
 
28
    PerforcePart( QObject *parent, const char *name, const QStringList & );
 
29
    ~PerforcePart();
 
30
 
 
31
    virtual QString shortDescription() const
 
32
    { return i18n( "Perforce is a version control system" ); }
 
33
 
 
34
    virtual void createNewProject(const QString& dir) {}
 
35
    virtual bool fetchFromRepository() { return true; }
 
36
    virtual KDevVCSFileInfoProvider *fileInfoProvider() const { return 0; }
 
37
    virtual bool isValidDirectory(const QString &dirPath) const { return true; }
 
38
    
 
39
private slots:
 
40
    void contextMenu(QPopupMenu *popup, const Context *context);
 
41
    void slotCommit();
 
42
    void slotUpdate();
 
43
    void slotAdd();
 
44
    void slotRemove();
 
45
    void slotEdit();
 
46
    void slotRevert();
 
47
    void slotDiff();
 
48
 
 
49
    void slotActionCommit();
 
50
    void slotActionUpdate();
 
51
    void slotActionAdd();
 
52
    void slotActionRemove();
 
53
    void slotActionEdit();
 
54
    void slotActionRevert();
 
55
    void slotActionDiff();
 
56
 
 
57
    void slotDiffFinished( const QString&, const QString& );
 
58
 
 
59
private:
 
60
    void commit( const QString& filename );
 
61
    void update( const QString& filename );
 
62
    void add( const QString& filename );
 
63
    void remove( const QString& filename );
 
64
    void edit( const QString& filename );
 
65
    void revert( const QString& filename );
 
66
    void diff( const QString& filename );
 
67
    QString currentFile();
 
68
 
 
69
    /** calls p4 with the command cmd and appends the filename */
 
70
    void execCommand( const QString& cmd, const QString& filename );
 
71
    void setupActions();
 
72
    QString popupfile;
 
73
    KAction *actionEdit, *actionRevert,
 
74
            *actionSubmit, *actionSync,
 
75
            *actionDiff, *actionAdd, *actionRemove;
 
76
};
 
77
 
 
78
#endif