summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/releaseinputdialog.h
blob: 5de2c3e69250b74cd5a96a9949465ecde2919656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/***************************************************************************
 *   Copyright (C) 2003 by Mario Scalas                                    *
 *   mario.scalas@libero.it                                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef RELEASEINPUTDIALOG_H
#define RELEASEINPUTDIALOG_H

#include "releaseinputdialogbase.h"

/**
* Every time an operation needs to prompt the user about a release name,
* it can use this class: just customize the message to display
*/
class ReleaseInputDialog : public ReleaseInputDialogBase
{
  Q_OBJECT

public:
    /**
    * C-tor
    * @param parent
    */
    ReleaseInputDialog( QWidget* parent = 0 );
    /**
    * Destructor
    */
    virtual ~ReleaseInputDialog();

    /**
    * @return a QString formatted as "-r <RELEASE-TAG> " or "-D <RELEASE-DATE> "
    *         so it can be embedded in the command line.
    */
    QString release() const;

    /**
    * @return true if the user has checked "rever": enforce operation then even
    * if the files have been locally modified.
    */
    bool isRevert() const;

private:
    enum ReleaseType { byHead, byDate, byRevision };

    ReleaseType type() const;
};

#endif