summaryrefslogtreecommitdiff
path: root/RealtimeSync/mainDialog.h
blob: 8a5e87bf73ff1c02deb42b9987999d18e7c2850b (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
74
75
76
77
78
/***************************************************************
 * Purpose:   Defines Application Frame
 * Author:    ZenJu (zhnmju123@gmx.de)
 * Created:   2009-07-06
 * Copyright: ZenJu (http://sourceforge.net/projects/freefilesync/)
 **************************************************************/

#ifndef REALTIMESYNCMAIN_H
#define REALTIMESYNCMAIN_H

#include "guiGenerated.h"
#include <vector>
#include <memory>
#include "../shared/dragAndDrop.h"
#include <wx/help.h>

namespace xmlAccess
{
struct XmlRealConfig;
}


class FolderPanel : public FolderGenerated
{
public:
    FolderPanel(wxWindow* parent) :
        FolderGenerated(parent),
        dragDropOnFolder(new FreeFileSync::DragDropOnDlg(this, m_dirPicker, m_txtCtrlDirectory)) {}

private:
    //support for drag and drop
    std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnFolder;
};



class MainDialog: public MainDlgGenerated
{
public:
    MainDialog(wxDialog *dlg, const wxString& cfgFilename, wxHelpController& helpController);
    ~MainDialog();

    void loadConfig(const wxString& filename);

private:
    virtual void OnClose(           wxCloseEvent& event);
    virtual void OnQuit(            wxCommandEvent& event);
    virtual void OnShowHelp(        wxCommandEvent& event);
    virtual void OnMenuAbout(       wxCommandEvent& event);
    virtual void OnAddFolder(       wxCommandEvent& event);
    virtual void OnRemoveFolder(    wxCommandEvent& event);
    virtual void OnRemoveTopFolder( wxCommandEvent& event);
    virtual void OnKeyPressed(      wxKeyEvent& event);
    virtual void OnStart(           wxCommandEvent& event);
    virtual void OnSaveConfig(      wxCommandEvent& event);
    virtual void OnLoadConfig(      wxCommandEvent& event);

    void setConfiguration(const xmlAccess::XmlRealConfig& cfg);
    xmlAccess::XmlRealConfig getConfiguration();

    void layoutAsync(); //call Layout() asynchronously

    void addFolder(const wxString& dirname, bool addFront = false);
    void addFolder(const std::vector<wxString>& newFolders, bool addFront = false);
    void removeAddFolder(const int pos); //keep it an int, allow negative values!
    void clearAddFolders();

    static const wxString& lastConfigFileName();

    //additional folders
    std::vector<FolderPanel*> additionalFolders; //additional pairs to the standard pair

    wxHelpController& helpController_;
    //support for drag and drop on main folder
    std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnFolder;
};

#endif // REALTIMESYNCMAIN_H
bgstack15