public void DeleteSelectedEntries() { TreeSelection tSelect = EntryTreeView.Selection; if(tSelect.CountSelectedRows() == 1) { TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); if(tModel != null) tModel = null; curSlogEntry = (SlogEntry) EntryTreeStore.GetValue(iter,0); curSlog.Commit(curSlog.Delete(curSlogEntry)); EntryTreeStore.Remove(ref iter); } }
public void on_entry_selection_changed(object o, EventArgs args) { TreeSelection tSelect = EntryTreeView.Selection; if(tSelect.CountSelectedRows() == 1) { TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); if(tModel != null) tModel = null; curSlogEntry = (SlogEntry) EntryTreeStore.GetValue(iter,0); TitleEntry.Text = curSlogEntry.Title; DateEntry.Text = curSlogEntry.PublishDate; SlogTextView.Buffer.Text = curSlogEntry.Description; DeleteButton.Sensitive = true; } else { curSlogEntry = null; DeleteButton.Sensitive = false; } }
public void on_new_entry(object o, EventArgs eventArgs) { EntryEditor ee = new EntryEditor(); ee.TransientFor = SloggerApp; if(ee.Run() == -5) { SlogEntry se = new SlogEntry(curSlog, ee.Date.ToLongDateString()); se.Title = ee.Title; se.Description = ee.Message; se.UserID = curSlog.GetCurrentMember().UserID; curSlog.Commit(se); EntryTreeStore.AppendValues(se); } }
public static void ProcessItem(HttpContext ctx, SlogEntry entry) { Console.WriteLine("ProcessItem entered"); if (entry.Description == "" && entry.Title == "") { return; } ctx.Response.Write("<item>"); if (entry.Title != "") { ctx.Response.Write("<title>"); ctx.Response.Write(entry.Title); ctx.Response.Write("</title>"); } if (entry.Name != "") { ctx.Response.Write("<pubDate>"); ctx.Response.Write(entry.Name); ctx.Response.Write("</pubDate>"); } if (entry.Description != "") { ctx.Response.Write("<description>"); ctx.Response.Write(entry.Description); ctx.Response.Write("</description>"); } try { if (entry.Author != "") { ctx.Response.Write("<author>"); ctx.Response.Write(entry.Author); ctx.Response.Write("</author>"); } } catch{} try { if (entry.Category != "") { ctx.Response.Write("<category>"); ctx.Response.Write(entry.Category); ctx.Response.Write("</category>"); } } catch{} try { if (entry.Comments != "") { ctx.Response.Write("<comments>"); ctx.Response.Write(entry.Comments); ctx.Response.Write("</comments>"); } } catch{} try { ctx.Response.Write("<guid>"); ctx.Response.Write(ctx.Request.Url); ctx.Response.Write("?node="); ctx.Response.Write(entry.ID); ctx.Response.Write("</guid>"); } catch{} ctx.Response.Write("</item>"); Console.WriteLine("ProcessItem exit"); }