2 /// \file CUI_KDEPim.cc
3 /// ConfigUI derived class to configure the KDEPim App
7 Copyright (C) 2009-2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #include "CUI_KDEPim.h"
23 #include "os22.h" // only for the dynamic_cast
25 #include <wx/process.h>
30 //////////////////////////////////////////////////////////////////////////////
31 // KDEPim config UI class
39 std::string
KDEPim::AppName() const
41 return OpenSync::Config::KDEPim::AppName();
44 bool KDEPim::Configure(wxWindow
*parent
, plugin_ptr old_plugin
)
48 // create our plugin config
49 m_kdepim
= dynamic_cast<OpenSync::Config::KDEPim
*> (old_plugin
.get());
51 m_kdepim
= m_kdepim
->Clone();
54 m_kdepim
= new OpenSync::Config::KDEPim
;
56 m_container
.reset( m_kdepim
);
58 // tell the user all went well
59 wxMessageBox(_W("KDEPim needs no configuration."), _W("KDEPim Config"), wxOK
| wxICON_INFORMATION
, m_parent
);
63 ConfigUI::plugin_ptr
KDEPim::GetPlugin()
69 bool KDEPim::RunApp(wxWindow
*parent
)
71 return Run(parent
, AppName(), _T("kontact"));
74 void KDEPim::PreSyncAppInit()
78 bool KDEPim::ZapData(wxWindow
*parent
,
80 OpenSync::API
*engine
)
84 if( IsAppRunning() ) {
85 wxMessageBox(_W("Kontact already running."),
86 _W("Oops..."), wxOK
| wxICON_INFORMATION
,
91 // tell the user what to do
93 if( dynamic_cast<OpenSync::OpenSync22
*>(engine
) ) {
95 "Starting Kontact. Delete all contacts and calendar "
100 "Starting Kontact. Delete all contacts and calendar "
101 "entries manually (as well as memos and tasks if you are "
105 int choice
= wxMessageBox(msg
, _W("Starting Kontact"),
106 wxOK
| wxCANCEL
| wxICON_QUESTION
, m_parent
);
112 // Kontact forks, so we just have to trust that the user did it :-(
116 } // namespace AppConfig