{
protected Gtk.Calendar calendar;
protected Gtk.Notebook notebook;
+ protected FileNotes month_notes;
protected FileNotes day_notes;
protected int cur_year;
protected int cur_month;
day_notes = new FileNotes();
notebook.append_page(day_notes, new Gtk.Label("Day notes"));
+ month_notes = new FileNotes();
+ notebook.append_page(month_notes, new Gtk.Label("Month notes"));
pack_start(notebook, true, true, 0);
flush();
calendar.clear_marks();
string mpath = month_path(calendar.year, calendar.month + 1);
+ month_notes.load(mpath + "/00.txt");
Dir dir;
try {
dir = Dir.open(mpath);
private void on_day_selected()
{
- flush();
- cur_year = calendar.year; cur_month = calendar.month + 1; cur_day = calendar.day;
+ cur_year = calendar.year;
+ cur_month = calendar.month + 1;
+ cur_day = calendar.day;
+
string path = day_path(cur_year, cur_month, cur_day);
day_notes.load(path);
+
+ string mpath = month_path(cur_year, cur_month);
+ month_notes.load(mpath + "/00.txt");
}
public void flush()
{
day_notes.save();
+ month_notes.save();
}
public void show_today()