model.set(cur_iter, 2, cur_log.acked, -1);
update_read_unread(cur_log.acked);
+
+ Value vname;
+ model.get_value(cur_iter, 1, out vname);
+ zavai.log.log.set_acknowledged(vname.get_string(), cur_log.acked);
}
private void update_read_unread(bool acked)
return parser.result;
}
- public delegate bool EntriesVisitor(string dir, string name);
+ public void set_acknowledged(string name, bool acked)
+ {
+ string from, to;
+ if (acked)
+ {
+ from = config.homedir + "/log/" + name;
+ to = config.homedir + "/archive/" + name;
+ DirUtils.create(config.homedir + "/archive", 0777);
+ } else {
+ from = config.homedir + "/archive/" + name;
+ to = config.homedir + "/log/" + name;
+ DirUtils.create(config.homedir + "/log", 0777);
+ }
+ if (FileUtils.test(from, FileTest.EXISTS))
+ {
+ FileUtils.rename(from, to);
+ entries_changed();
+ }
+ }
+ public delegate bool EntriesVisitor(string dir, string name);
protected void list_dir(string dir, EntriesVisitor visitor)
{