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>
29 //////////////////////////////////////////////////////////////////////////////
30 // KDEPim config UI class
38 std::string
KDEPim::AppName() const
40 return OpenSync::Config::KDEPim::AppName();
43 bool KDEPim::Configure(wxWindow
*parent
, plugin_ptr old_plugin
)
47 // create our plugin config
48 m_kdepim
= dynamic_cast<OpenSync::Config::KDEPim
*> (old_plugin
.get());
50 m_kdepim
= m_kdepim
->Clone();
53 m_kdepim
= new OpenSync::Config::KDEPim
;
55 m_container
.reset( m_kdepim
);
57 // tell the user all went well
58 wxMessageBox(_T("KDEPim needs no configuration."), _T("KDEPim Config"), wxOK
| wxICON_INFORMATION
, m_parent
);
62 ConfigUI::plugin_ptr
KDEPim::GetPlugin()
68 bool KDEPim::RunApp(wxWindow
*parent
)
70 return Run(parent
, AppName(), _T("kontact"));
73 void KDEPim::PreSyncAppInit()
77 bool KDEPim::ZapData(wxWindow
*parent
,
79 OpenSync::API
*engine
)
83 if( IsAppRunning() ) {
84 wxMessageBox(_T("Kontact already running."),
85 _T("No Biscuit"), wxOK
| wxICON_INFORMATION
,
90 // tell the user what to do
92 if( dynamic_cast<OpenSync::OpenSync22
*>(engine
) ) {
94 "Starting Kontact. Delete all contacts and calendar "
99 "Starting Kontact. Delete all contacts and calendar "
100 "entries manually (as well as memos and tasks if you are "
104 int choice
= wxMessageBox(msg
, _T("Starting Kontact"),
105 wxOK
| wxCANCEL
| wxICON_QUESTION
, m_parent
);
111 // Kontact forks, so we just have to trust that the user did it :-(
115 } // namespace AppConfig