public void Initialize(TreeModel model, TaskView view, IPreferences preferences) { if (view == null) { throw new ArgumentNullException("view"); } this.view = view; if (model == null) { throw new ArgumentNullException("model"); } this.model = model; }
public void Initialize(TreeModel model, TaskView view, IPreferences preferences) { if (view == null) throw new ArgumentNullException ("view"); this.view = view; if (model == null) throw new ArgumentNullException ("model"); this.model = model; }
public void Initialize(TreeModel model, TaskView view, IPreferences preferences) { if (model == null) throw new ArgumentNullException ("model"); this.model = model; if (preferences == null) throw new ArgumentNullException ("preferences"); this.preferences = preferences; view.RowEditingStarted += (sender, e) => { var timer = GetTimer (e.ITask); if (timer != null && timer.State == TaskCompleteTimerState.Running) timer.Pause (); }; view.RowEditingFinished += (sender, e) => { var timer = GetTimer (e.ITask); if (timer != null && timer.State == TaskCompleteTimerState.Paused) timer.Resume (); }; }
public TaskGroup(string groupName, DateTime rangeStart, DateTime rangeEnd, ICollection<ITask> tasks, GtkApplicationBase application) { if (application == null) throw new ArgumentNullException ("application"); Application = application; hideWhenEmpty = true; // TODO: Add a date time event watcher so that when we rollover to // a new day, we can update the rangeStart and rangeEnd times. The // ranges will be used to determine whether tasks fit into certain // groups in the main TaskWindow. Reference Tomboy's NoteOfTheDay // add-in for code that reacts on day changes. treeModel = CreateModel (rangeStart, rangeEnd, tasks); // TODO: Add something to watch events so that the group will // automatically refilter and display/hide itself accordingly. // // Build the UI // // // Group Header // // Gtk.EventBox eb = new Gtk.EventBox(); // eb.Show(); // eb.BorderWidth = 0; // eb.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); // eb.ModifyBase(Gtk.StateType.Normal, new Gdk.Color(211,215,199)); Gtk.HBox headerHBox = new Gtk.HBox (false, 0); header = new Gtk.Label (); header.UseMarkup = true; header.UseUnderline = false; header.Markup = GetHeaderMarkup (groupName); header.Xalign = 0; header.Show (); // eb.Add(header); // PackStart (eb, false, false, 0); headerHBox.PackStart (header, false, false, 0); // spacer Gtk.Label spacerLabel = new Gtk.Label (string.Empty); spacerLabel.Show (); headerHBox.PackStart (spacerLabel, true, true, 0); extraWidgetHBox = new Gtk.HBox (false, 0); extraWidgetHBox.Show (); headerHBox.PackStart (extraWidgetHBox, false, false, 0); headerHBox.Show (); PackStart (headerHBox, false, false, 5); // // Group TreeView // taskView = new TaskView (treeModel, application.Preferences); taskView.TreeView.Show (); PackStart (taskView.TreeView, true, true, 0); taskView.NumberOfTasksChanged += OnNumberOfTasksChanged; taskView.TreeView.RowActivated += OnRowActivated; taskView.TreeView.ButtonPressEvent += OnButtonPressed; }