summaryrefslogtreecommitdiff
path: root/plugins/CopyEngine/Ultracopier-Spec/FolderExistsDialog.h
blob: 8681ba64a564498c220e5a75755fc094269453c5 (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
/** \file folderExistsDialog.h
\brief Define the dialog when file exists
\author alpha_one_x86
\licence GPL3, see the file COPYING */

#ifndef FOLDERISSAMEDIALOG_H
#define FOLDERISSAMEDIALOG_H

#include <QDialog>
#include <string>

#include "Environment.h"

namespace Ui {
    class folderExistsDialog;
}

#ifdef WIDESTRING
#define INTERNALTYPEPATH std::wstring
#else
#define INTERNALTYPEPATH std::string
#endif

/// \brief to show file exists dialog, and ask what do
class FolderExistsDialog : public QDialog
{
    Q_OBJECT

public:
    /// \brief create the object and pass all the informations to it
    explicit FolderExistsDialog(QWidget *parent,INTERNALTYPEPATH source,bool isSame,INTERNALTYPEPATH destination,std::string firstRenamingRule,std::string otherRenamingRule);
    ~FolderExistsDialog();
    /// \brief return the the always checkbox is checked
    bool getAlways();
    /// \brief return the action clicked
    FolderExistsAction getAction();
    /// \brief return the new rename is case in manual renaming
    std::string getNewName();
protected:
    void changeEvent(QEvent *e);
private slots:
    void updateRenameButton();
    void on_SuggestNewName_clicked();
    void on_Rename_clicked();
    void on_Skip_clicked();
    void on_Cancel_clicked();
    void on_Merge_clicked();
    void on_lineEditNewName_editingFinished();
    void on_lineEditNewName_returnPressed();
    void on_lineEditNewName_textChanged(const QString &arg1);
private:
    Ui::folderExistsDialog *ui;
    FolderExistsAction action;
    std::string oldName;
    std::string firstRenamingRule;
    std::string otherRenamingRule;
    std::string destinationInfo;
};

#endif // FOLDERISSAMEDIALOG_H