/// <summary> /// If the user has just clicked on the checkbutton, the standard /// behavior of the OnActivated should be suppressed. /// </summary> protected override void OnActivated() { // Open the option dialog if (!inhibit_activate) { TaskOptionsDialog dialog; if (options_dialogs.ContainsKey(task)) { dialog = options_dialogs [task]; } else { dialog = new TaskOptionsDialog( null, Gtk.DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.DeleteEvent += OnOptionsDialogDeleted; options_dialogs [task] = dialog; } dialog.Present(); dialog.GrabFocus(); } }
void OnOptionsDialogDeleted(object sender, Gtk.DeleteEventArgs args) { TaskOptionsDialog dialog = sender as TaskOptionsDialog; if (dialog == null) { return; } if (options_dialogs.ContainsKey(dialog.Task)) { options_dialogs.Remove(dialog.Task); } }
void OnOpenTask(object sender, EventArgs args) { Task task = GetSelectedTask(); if (task == null) { return; } TaskOptionsDialog dialog = new TaskOptionsDialog(this, DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.Run(); dialog.Destroy(); }
void OnOpenTaskOptions(object sender, EventArgs args) { TaskMenuItem item = sender as TaskMenuItem; if (item == null) { return; } Task task = TasksApplicationAddin.DefaultTaskManager.FindByUri( item.TaskUri); if (task == null) { return; } TaskOptionsDialog dialog; if (options_dialogs.ContainsKey(task)) { dialog = options_dialogs [task]; } else { dialog = new TaskOptionsDialog( Note.Window, Gtk.DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.DeleteEvent += OnOptionsDialogDeleted; options_dialogs [task] = dialog; } dialog.Show(); dialog.GrabFocus(); }
void OnOpenTaskOptions (object sender, EventArgs args) { TaskMenuItem item = sender as TaskMenuItem; if (item == null) return; Task task = TasksApplicationAddin.DefaultTaskManager.FindByUri ( item.TaskUri); if (task == null) return; TaskOptionsDialog dialog; if (options_dialogs.ContainsKey (task)) { dialog = options_dialogs [task]; } else { dialog = new TaskOptionsDialog ( Note.Window, Gtk.DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.DeleteEvent += OnOptionsDialogDeleted; options_dialogs [task] = dialog; } dialog.Show (); dialog.GrabFocus (); }
/// <summary> /// If the user has just clicked on the checkbutton, the standard /// behavior of the OnActivated should be suppressed. /// </summary> protected override void OnActivated () { // Open the option dialog if (!inhibit_activate) { TaskOptionsDialog dialog; if (options_dialogs.ContainsKey (task)) { dialog = options_dialogs [task]; } else { dialog = new TaskOptionsDialog ( null, Gtk.DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.DeleteEvent += OnOptionsDialogDeleted; options_dialogs [task] = dialog; } dialog.Present (); dialog.GrabFocus (); } }
void OnOpenTask (object sender, EventArgs args) { Task task = GetSelectedTask (); if (task == null) return; TaskOptionsDialog dialog = new TaskOptionsDialog (this, DialogFlags.DestroyWithParent, task); dialog.WindowPosition = Gtk.WindowPosition.CenterOnParent; dialog.Run (); dialog.Destroy (); }