1 #include <gtkmm.h>
2 #include "common.h"
3 #include "color.h"
4 
5 #include "uilib/ColorCellRenderer.h"
6 
7 class OptionsDialog : public Gtk::Dialog {
8   class WildTree : public Gtk::TreeView{
9   public:
10     struct WildColumns : public Gtk::TreeModelColumnRecord{
11       Gtk::TreeModelColumn<Glib::ustring> name;
12       Gtk::TreeModelColumn<Glib::ustring> color;
13       //Gtk::TreeModelColumn<bool> visible;
WildColumnsWildColumns14       WildColumns(){
15         add(name);
16         add(color);
17       }
18     } records;
19   protected:
20     ColorCellRenderer colrend;
21     Gtk::TreeViewColumn colcolor,colpattern;
22     //virtual bool on_button_press_event(GdkEventButton* event);
23   public:
24     Glib::RefPtr<Gtk::TreeStore> model;
25     WildTree(OptionsDialog*);
26     void fill_tree(const ColorConfig&);
27   };
28 
29   struct ColorConfig ccfg;
30   Gtk::Notebook ntb;
31   Gtk::Table tbl_file_type,tbl_timestamp,tbl_wildcard;
32   Gtk::ColorButton btn[8];
33   void on_file_type_color(int i);
34   Gtk::HBox bxs[8];
35   Gtk::Label lbls[8];
36 
37   Gtk::Label lbl_oldest,lbl_newest;
38   Gtk::Entry ent_new_date,ent_old_date;
39   Gtk::Entry ent_new_time,ent_old_time;
40   //Gtk::Button
41   Gtk::ComboBoxText cbx_timestamp_type;
42   Gtk::ColorButton btn_older,btn_newer;
43   Gtk::Label lbl_colorby,lbl_older,lbl_newer;
44   Gtk::ComboBoxText cbx_spectrum_type;
45   //
46   Gtk::Button bt_add,bt_remove;
47   Gtk::ScrolledWindow scr_wild;
48   WildTree tree_wild;
49   void on_timestamp_type_changed();
50   void on_spectrum_type_changed();
51   void on_timestamp_color(int i);
52 protected:
53   void set_old_time(time_t);
54   void set_new_time(time_t);
55   void on_old_editing_done();
56   void on_new_editing_done();
57   //wp
58   void on_color_edited(const Glib::ustring& path,const Glib::ustring& newval);
59   void on_wp_edited(const Glib::ustring& path,const Glib::ustring& newval);
60   void on_bt_add();
61   void on_bt_remove();
62 
63   void on_apply();
64   void on_response(int response_id);
65 public:
66   OptionsDialog();
67 };
68 
69