summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/dialogs/overwritedialogue.h
blob: 78f512c00599e119415b5723ebb0f14ce9936e24 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   copyright (C) 2002-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef OVERWRITEDIALOGUE_H
#define OVERWRITEDIALOGUE_H

#include <kdialogbase.h>

class TQCheckBox;

/**
 * Used by CodeGenerator::findFileName when it needs to ask
 * the user if they want to overwrite and existing file, generate a similar name
 * or cancel.  Gives an option to apply the choice to all remaining files.
 *
 * Uses OK and Apply buttons but overrides their text and behaviour, probably
 * better to use user defined buttons but I couldn't work out how.  KDialogBase guru needed.
 *
 * @author Jonathan Riddell <jr@jriddell.org>
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 */
class OverwriteDialogue: public KDialogBase {
    Q_OBJECT
  

public:
    /**
     * constructor sets up the dialog, adding checkbox and label
     */
    OverwriteDialogue(const TQString& fileName, const TQString& outputDirectory,
                      bool applyToAllRemaining, TQWidget* parent=0, const char* name=0);

    /**
     * destrictor doesn't do anything
     */
    ~OverwriteDialogue();

    /**
     * @return the value of the Apply To All Remaining Files checkbox
     */
    bool applyToAllRemaining();

protected slots:
    /**
     * Overrides standard operation to call TQDialog::done(Yes).
     *  This is a kludge, see note in class description.
     */
    virtual void slotOk();

    /**
    * Overrides standard operation to call TQDialog::done(No).
    */
    virtual void slotApply();


    /**
    * Overrides standard operation to call TQDialog::done(Cancel).
    */
    virtual void slotCancel();

private:
    TQCheckBox* m_applyToAllRemaining;
};

#endif