summaryrefslogtreecommitdiff
path: root/ui/switch_to_gui.h
blob: 70ef90d3f03b160ff8b732d1eb93dbc2fece97b3 (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
// **************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl.html       *
// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de)                    *
// **************************************************************************

#ifndef SWITCHTOGUI_H_INCLUDED
#define SWITCHTOGUI_H_INCLUDED

#include "../lib/process_xml.h"
#include "main_dlg.h" //in "application.cpp" we have this dependency anyway!

namespace zen
{
//switch from FreeFileSync Batch to GUI modus: opens a new FreeFileSync GUI session asynchronously
class SwitchToGui
{
public:
    SwitchToGui(const wxString& referenceFile,
                const xmlAccess::XmlBatchConfig& batchCfg,
                xmlAccess::XmlGlobalSettings& globalSettings) :
        guiCfg(xmlAccess::convertBatchToGui(batchCfg)),
        globalSettings_(globalSettings)
    {
        referenceFiles.push_back(referenceFile);
    }

    void execute() const
    {

        MainDialog* frame = new MainDialog(referenceFiles, guiCfg, globalSettings_, true); //toplevel window
        frame->Show();
    }

private:
    std::vector<wxString> referenceFiles;
    const xmlAccess::XmlGuiConfig guiCfg;
    xmlAccess::XmlGlobalSettings& globalSettings_;
};
}

#endif // SWITCHTOGUI_H_INCLUDED
bgstack15