public Next30()
{
set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
- model = new Gtk.ListStore(2, typeof(string), typeof(string));
+ model = new Gtk.ListStore(5, typeof(string), typeof(string), typeof(int), typeof(int), typeof(int));
list = new Gtk.TreeView.with_model(model);
list.insert_column_with_attributes (-1, "Day", new Gtk.CellRendererText(), "text", 0);
list.insert_column_with_attributes (-1, "Notes", new Gtk.CellRendererText(), "text", 1);
model.clear();
}
- public void add_day(string day, string notes)
+ public void add_day(Date date, string notes)
{
+ var buffer = new char[64];
+ date.strftime(buffer, "%d %a");
Gtk.TreeIter iter;
model.append (out iter);
- model.set(iter, 0, day);
+ model.set(iter, 0, (string)buffer);
model.set(iter, 1, notes);
+ model.set(iter, 2, date.get_day());
+ model.set(iter, 3, date.get_month());
+ model.set(iter, 4, date.get_year());
}
}
notebook = new Gtk.Notebook();
+ next_30 = new Next30();
+ notebook.append_page(next_30, new Gtk.Label("Next 30"));
day_notes = new FileNotes();
notebook.append_page(day_notes, new Gtk.Label("Day"));
month_notes = new FileNotes();
general_notes = new FileNotes();
general_notes.load(zavai.config.homedir + "/cal/notes.txt");
notebook.append_page(general_notes, new Gtk.Label("General"));
- next_30 = new Next30();
- notebook.append_page(next_30, new Gtk.Label("Next 30"));
pack_start(notebook, true, true, 0);
next_30.clear();
Date date = Date();
date.set_dmy((DateDay)cur_day, cur_month, (DateYear)cur_year);
- var buffer = new char[64];
for (uint i = 0; i < 30; ++i)
{
path = day_path(date.get_year(), date.get_month(), date.get_day());
}
if (text != "")
{
- date.strftime(buffer, "%d %a");
- next_30.add_day((string)buffer, text);
+ next_30.add_day(date, text);
}
date.add_days(1);
}