summaryrefslogtreecommitdiffabout
path: root/src
Unidiff
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/napkin.cc2
-rw-r--r--src/widgets.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/napkin.cc b/src/napkin.cc
index d9ba0c9..78f44f8 100644
--- a/src/napkin.cc
+++ b/src/napkin.cc
@@ -28,49 +28,49 @@ using std::string;
28#include <napkin/util.h> 28#include <napkin/util.h>
29#include <napkin/st/decode.h> 29#include <napkin/st/decode.h>
30#include <napkin/st/download.h> 30#include <napkin/st/download.h>
31 31
32#include "db.h" 32#include "db.h"
33#include "sleep_timeline.h" 33#include "sleep_timeline.h"
34#include "dialogs.h" 34#include "dialogs.h"
35#include "sleep_history.h" 35#include "sleep_history.h"
36 36
37#include "config.h" 37#include "config.h"
38 38
39class napkin_ui : public Gtk::Window { 39class napkin_ui : public Gtk::Window {
40 public: 40 public:
41 Gtk::VBox w_outer_box; 41 Gtk::VBox w_outer_box;
42 Gtk::Statusbar w_status_bar; 42 Gtk::Statusbar w_status_bar;
43 napkin::gtk::sleep_history_t w_history; 43 napkin::gtk::sleep_history_t w_history;
44 Glib::RefPtr<Gtk::UIManager> uiman; 44 Glib::RefPtr<Gtk::UIManager> uiman;
45 Glib::RefPtr<Gtk::ActionGroup> agroup; 45 Glib::RefPtr<Gtk::ActionGroup> agroup;
46 napkin::db_t db; 46 napkin::db_t db;
47 Glib::RefPtr<Gtk::Action> a_remove; 47 Glib::RefPtr<Gtk::Action> a_remove;
48 48
49 napkin_ui() 49 napkin_ui()
50 : w_history(db) 50 : w_history(db)
51 { 51 {
52 static char *ui_info = 52 static const char *ui_info =
53 "<ui>" 53 "<ui>"
54 "<menubar name='menu_bar'>" 54 "<menubar name='menu_bar'>"
55 "<menu action='menu_sleep'>" 55 "<menu action='menu_sleep'>"
56#ifndef NDEBUG 56#ifndef NDEBUG
57 "<menu action='menu_sleep_add'>" 57 "<menu action='menu_sleep_add'>"
58#endif 58#endif
59 "<menuitem action='sleep_add_from_sleeptracker'/>" 59 "<menuitem action='sleep_add_from_sleeptracker'/>"
60#ifndef NDEBUG 60#ifndef NDEBUG
61 "<menuitem action='sleep_add_from_datafile'/>" 61 "<menuitem action='sleep_add_from_datafile'/>"
62 "</menu>" 62 "</menu>"
63#endif 63#endif
64 "<menuitem action='sleep_remove'/>" 64 "<menuitem action='sleep_remove'/>"
65 "<menuitem action='exit'/>" 65 "<menuitem action='exit'/>"
66 "</menu>" 66 "</menu>"
67 "<menu action='menu_help'>" 67 "<menu action='menu_help'>"
68 "<menuitem action='help_about'/>" 68 "<menuitem action='help_about'/>"
69 "</menu>" 69 "</menu>"
70 "</menubar>" 70 "</menubar>"
71 "<toolbar action='tool_bar'>" 71 "<toolbar action='tool_bar'>"
72 "<toolitem action='sleep_add_from_sleeptracker'/>" 72 "<toolitem action='sleep_add_from_sleeptracker'/>"
73 "<toolitem action='sleep_remove'/>" 73 "<toolitem action='sleep_remove'/>"
74 "<separator expand='true'/>" 74 "<separator expand='true'/>"
75#ifndef NDEBUG 75#ifndef NDEBUG
76 "<toolitem action='debug'/>" 76 "<toolitem action='debug'/>"
diff --git a/src/widgets.cc b/src/widgets.cc
index ea85bc8..61c7da9 100644
--- a/src/widgets.cc
+++ b/src/widgets.cc
@@ -1,36 +1,36 @@
1#include <napkin/util.h> 1#include <napkin/util.h>
2#include "widgets.h" 2#include "widgets.h"
3 3
4namespace napkin { 4namespace napkin {
5 namespace gtk { 5 namespace gtk {
6 6
7 hypnoinfo_t::hypnoinfo_t() 7 hypnoinfo_t::hypnoinfo_t()
8 : w_upper(4,3,false/*homogeneous*/), 8 : w_upper(4,3,false/*homogeneous*/),
9 lc_tobed("To bed:",0.5,0.5), 9 lc_tobed("To bed:",0.5f,0.5f),
10 lc_timeline("Sleep timeline:",0.5,0.5), 10 lc_timeline("Sleep timeline:",0.5f,0.5f),
11 lc_alarm("Alarm:",0.5,0.5), lc_window("Window:",0.5,0.5), 11 lc_alarm("Alarm:",0.5f,0.5f), lc_window("Window:",0.5f,0.5f),
12 l_data_a("",0.9,0.5) 12 l_data_a("",0.9f,0.5f)
13 { 13 {
14 add(l_date); 14 add(l_date);
15 add(l_hseparator); 15 add(l_hseparator);
16 w_upper.set_col_spacings(5); 16 w_upper.set_col_spacings(5);
17 w_upper.attach(lc_tobed,0,1,0,1, Gtk::SHRINK); 17 w_upper.attach(lc_tobed,0,1,0,1, Gtk::SHRINK);
18 w_upper.attach(lc_timeline,1,2,0,1, Gtk::SHRINK); 18 w_upper.attach(lc_timeline,1,2,0,1, Gtk::SHRINK);
19 w_upper.attach(lc_alarm,2,3,0,1, Gtk::SHRINK); 19 w_upper.attach(lc_alarm,2,3,0,1, Gtk::SHRINK);
20 w_upper.attach(lf_tobed,0,1,1,4, Gtk::SHRINK); 20 w_upper.attach(lf_tobed,0,1,1,4, Gtk::SHRINK);
21 w_upper.attach(st_timeline,1,2,1,4, 21 w_upper.attach(st_timeline,1,2,1,4,
22 Gtk::FILL|Gtk::EXPAND,Gtk::FILL|Gtk::EXPAND,0,0); 22 Gtk::FILL|Gtk::EXPAND,Gtk::FILL|Gtk::EXPAND,0,0);
23 w_upper.attach(lf_alarm,2,3,1,2, Gtk::SHRINK); 23 w_upper.attach(lf_alarm,2,3,1,2, Gtk::SHRINK);
24 w_upper.attach(lc_window,2,3,2,3, Gtk::SHRINK); 24 w_upper.attach(lc_window,2,3,2,3, Gtk::SHRINK);
25 w_upper.attach(lf_window,2,3,3,4, Gtk::SHRINK); 25 w_upper.attach(lf_window,2,3,3,4, Gtk::SHRINK);
26 add(w_upper); 26 add(w_upper);
27 add(lc_almost_awakes); 27 add(lc_almost_awakes);
28 add(lf_almost_awakes); 28 add(lf_almost_awakes);
29 add(l_data_a); 29 add(l_data_a);
30 show_all(); 30 show_all();
31 } 31 }
32 32
33 void hypnoinfo_t::update_data(const hypnodata_ptr_t& hd) { 33 void hypnoinfo_t::update_data(const hypnodata_ptr_t& hd) {
34 l_date.set_use_markup(true); 34 l_date.set_use_markup(true);
35 l_date.set_markup("<b>"+hd->str_date()+"</b>"); 35 l_date.set_markup("<b>"+hd->str_date()+"</b>");
36 lf_tobed.set_use_markup(true); 36 lf_tobed.set_use_markup(true);