Fawkes API  Fawkes Development Version
config_edit_dialog.h
1 
2 /***************************************************************************
3  * config_edit_dialog.h - Edit config entries
4  *
5  * Created: Wed Sep 24 15:41:27 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __TOOLS_CONFIG_EDITOR_CONFIG_EDIT_DIALOG_H_
24 #define __TOOLS_CONFIG_EDITOR_CONFIG_EDIT_DIALOG_H_
25 
26 #include <gtkmm.h>
27 
28 class ConfigEditDialog : public Gtk::Dialog
29 {
30  public:
31  ConfigEditDialog(Gtk::Entry *ent_value, Gtk::ComboBox *cob_bool_value,
32  Gtk::Notebook *type_pages, Gtk::CheckButton *chb_is_default);
33  ConfigEditDialog(BaseObjectType* cobject,
34  const Glib::RefPtr<Gtk::Builder> &builder);
35  virtual ~ConfigEditDialog();
36 
37  void init( const Glib::ustring& path, const Glib::ustring& type,
38  const Glib::ustring& value );
39 
40  Glib::ustring get_value() const;
41  bool get_is_default() const;
42 
43  protected:
44  bool is_bool;
45  Gtk::Entry *m_ent_value;
46  Gtk::ComboBox *m_cob_bool_value;
47  Gtk::Notebook *m_type_pages;
48  Gtk::CheckButton *m_chb_is_default;
49 };
50 
51 #endif /* __TOOLS_CONFIG_EDITOR_CONFIG_EDIT_DIALOG_H_ */
virtual ~ConfigEditDialog()
Destructor.
Gtk::Entry * m_ent_value
An entry field to edit the config value.
Dialog to edit a config value.
Glib::ustring get_value() const
Get the value of the entry widget.
Gtk::ComboBox * m_cob_bool_value
A combo box to select TRUE or FALSE.
Gtk::Notebook * m_type_pages
A Gtk::Notebook element to switch between boolean values and the rest.
ConfigEditDialog(Gtk::Entry *ent_value, Gtk::ComboBox *cob_bool_value, Gtk::Notebook *type_pages, Gtk::CheckButton *chb_is_default)
Constructor.
bool is_bool
A flag to store wether the config value is boolean.
void init(const Glib::ustring &path, const Glib::ustring &type, const Glib::ustring &value)
Initialize the dialog.
bool get_is_default() const
Get the default flag of the new entry.
Gtk::CheckButton * m_chb_is_default
The Gtk::CheckButton to set the default flag.