Bumped copyright dates for 2013
[barry.git] / desktop / src / EvoCfgDlg.h
blob9c986c5d7b955dff8314028c1fd1d30467bd144b
1 ///
2 /// \file EvoCfgDlg.h
3 /// The configuration dialog used to configure Evolution sources
4 ///
6 /*
7 Copyright (C) 2011-2013, 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 #ifndef __BARRYDESKTOP_EVOCFGDLG_H__
23 #define __BARRYDESKTOP_EVOCFGDLG_H__
25 #include <wx/wx.h>
26 #include "EvoSources.h"
27 #include "ostypes.h"
29 // forward declarations
30 namespace OpenSync {
31 namespace Config {
32 class Evolution;
36 class EvoCfgDlg : public wxDialog
38 // configuration settings
39 std::string m_address_path;
40 std::string m_calendar_path;
41 std::string m_tasks_path;
42 std::string m_memos_path;
43 bool m_empty_config; // true if all paths are empty, and
44 // therefore the first time this
45 // is running, and defaults my be
46 // attempted
48 // external data
49 const EvoSources &m_sources;
51 // dialog controls
52 wxSizer *m_topsizer;
53 wxComboBox *m_address_combo;
54 wxComboBox *m_calendar_combo;
55 wxComboBox *m_tasks_combo;
56 wxComboBox *m_memos_combo;
58 protected:
59 void CreateLayout();
60 void AddCombo(wxComboBox **combo, int id,
61 const std::string &current_path,
62 const EvoSources::List &list);
63 wxString CheckPath(const wxString &name, const std::string &path) const;
64 /// returns error message string on error, otherwise empty string
65 wxString ValidatePaths() const;
67 public:
68 EvoCfgDlg(wxWindow *parent, const OpenSync::Config::Evolution &ec,
69 const EvoSources &es);
71 // results
72 void SetPaths(OpenSync::Config::Evolution &ec) const;
74 // event handlers
76 // overrides
77 virtual bool TransferDataFromWindow();
78 int ShowModal();
81 #endif