static void Main(string[] args) { try { lock (lockObject) { if (application != null) return; // Fix process name not set on Unix SetProcessName ("Tasque"); #if WIN application = new GtkWinApplication (args); #else application = new GtkLinuxApplication (args); #endif } } catch (Exception e) { Logger.Debug ("Exception is: {0}", e); application.Exit (-1); } finally { lock (lockObject) { if (application != null) application.Dispose (); } } }
RemoteControl(GtkApplicationBase application) { if (application == null) { throw new ArgumentNullException("application"); } this.application = application; }
public StatusIconTray(GtkApplicationBase application) : base(application) { tray = new StatusIcon(Utilities.GetIcon(IconName, 24)); tray.Visible = true; tray.Activate += delegate { ToggleTaskWindowAction.Activate(); }; tray.PopupMenu += (sender, e) => { var popupMenu = Menu; popupMenu.ShowAll(); // shows everything tray.PresentMenu(popupMenu, (uint)e.Args [0], (uint)e.Args [1]); }; }
public StatusIconTray(GtkApplicationBase application) : base(application) { tray = new StatusIcon (Utilities.GetIcon (IconName, 24)); tray.Visible = true; tray.Activate += delegate { ToggleTaskWindowAction.Activate (); }; tray.PopupMenu += (sender, e) => { var popupMenu = Menu; popupMenu.ShowAll (); // shows everything tray.PresentMenu (popupMenu, (uint)e.Args [0], (uint)e.Args [1]); }; }
public static RemoteControl Register(GtkApplicationBase application) { BusG.Init (); var remoteControl = new RemoteControl (application); Bus.Session.Register (new ObjectPath (Path), remoteControl); if (Bus.Session.RequestName (Namespace) != RequestNameReply.PrimaryOwner) return null; return remoteControl; }
public static RemoteControl Register(GtkApplicationBase application) { BusG.Init(); var remoteControl = new RemoteControl(application); Bus.Session.Register(new ObjectPath(Path), remoteControl); if (Bus.Session.RequestName(Namespace) != RequestNameReply.PrimaryOwner) { return(null); } return(remoteControl); }
public PreferencesDialog(GtkApplicationBase application) : base() { if (application == null) throw new ArgumentNullException ("application"); this.application = application; LoadPreferences(); Init(); ConnectEvents(); Shown += OnShown; this.WidthRequest = 400; this.HeightRequest = 350; }
protected GtkTray(GtkApplicationBase application) { if (application == null) throw new ArgumentNullException ("application"); this.application = application; RegisterUIManager (); application.BackendManager.BackendChanging += delegate { SwitchBackendItems (false); }; application.BackendManager.BackendInitialized += delegate { SwitchBackendItems (true); }; ((INotifyCollectionChanged)application.BackendManager.Tasks).CollectionChanged += delegate { RefreshTrayIconTooltip (); }; RefreshTrayIconTooltip (); }
public PreferencesDialog(GtkApplicationBase application) : base() { if (application == null) { throw new ArgumentNullException("application"); } this.application = application; LoadPreferences(); Init(); ConnectEvents(); Shown += OnShown; this.WidthRequest = 400; this.HeightRequest = 350; }
protected GtkTray(GtkApplicationBase application) { if (application == null) { throw new ArgumentNullException("application"); } this.application = application; RegisterUIManager(); application.BackendManager.BackendChanging += delegate { SwitchBackendItems(false); }; application.BackendManager.BackendInitialized += delegate { SwitchBackendItems(true); }; ((INotifyCollectionChanged)application.BackendManager.Tasks).CollectionChanged += delegate { RefreshTrayIconTooltip(); }; RefreshTrayIconTooltip(); }
public AppIndicatorTray (GtkApplicationBase application) : base (application) { appIndicator = new ApplicationIndicator ("TasqueTray", IconName, Category.ApplicationStatus); appIndicator.Status = Status.Active; var menu = Menu; var toggleTaskWindowMenuItem = new MenuItem (); ToggleTaskWindowAction.ConnectProxy (toggleTaskWindowMenuItem); menu.Insert (toggleTaskWindowMenuItem, 0); menu.Insert (new SeparatorMenuItem (), 1); tooltipProxyMenuItem = new MenuItem (Tooltip); tooltipProxyMenuItem.Sensitive = false; menu.Insert (tooltipProxyMenuItem, 2); menu.Insert (new SeparatorMenuItem (), 3); menu.ShowAll (); appIndicator.Menu = menu; }
public AppIndicatorTray(GtkApplicationBase application) : base(application) { appIndicator = new ApplicationIndicator ("TasqueTray", IconName, Category.ApplicationStatus); appIndicator.Status = Status.Active; var menu = Menu; var toggleTaskWindowMenuItem = new MenuItem (); ToggleTaskWindowAction.ConnectProxy (toggleTaskWindowMenuItem); menu.Insert (toggleTaskWindowMenuItem, 0); menu.Insert (new SeparatorMenuItem (), 1); tooltipProxyMenuItem = new MenuItem (Tooltip); tooltipProxyMenuItem.Sensitive = false; menu.Insert (tooltipProxyMenuItem, 2); menu.Insert (new SeparatorMenuItem (), 3); menu.ShowAll (); appIndicator.Menu = menu; }
public static GtkTray CreateTray(GtkApplicationBase application) { var desktopSession = Environment.GetEnvironmentVariable("DESKTOP_SESSION"); GtkTray tray; switch (desktopSession) { case "ubuntu": case "ubuntu-2d": case "gnome-classic": case "gnome-fallback": #if APPINDICATOR tray = new AppIndicatorTray(application); break; #endif default: tray = new StatusIconTray(application); break; } return(tray); }
public TaskWindow(GtkApplicationBase application) : base(Gtk.WindowType.Toplevel) { if (application == null) throw new ArgumentNullException ("application"); this.application = application; taskGroups = new List<TaskGroup> (); noteDialogs = new Dictionary<ITask, NoteDialog> (); InitWindow(); Realized += OnRealized; }
public static void ToggleWindowVisible(GtkApplicationBase application) { ShowWindow (true, application); }
/// <summary> /// Method to allow other classes to "click" on the "Add ITask" button. /// </summary> public static void AddTask(GtkApplicationBase application) { if (taskWindow == null) TaskWindow.ShowWindow (application); taskWindow.OnAddTask (null, EventArgs.Empty); }
public static GtkTray CreateTray(GtkApplicationBase application) { var desktopSession = Environment.GetEnvironmentVariable ("DESKTOP_SESSION"); GtkTray tray; switch (desktopSession) { case "ubuntu": case "ubuntu-2d": case "gnome-classic": case "gnome-fallback": #if APPINDICATOR tray = new AppIndicatorTray (application); break; #endif default: tray = new StatusIconTray (application); break; } return tray; }
RemoteControl(GtkApplicationBase application) { if (application == null) throw new ArgumentNullException ("application"); this.application = application; }
public static void GrabNewTaskEntryFocus(GtkApplicationBase application) { if (taskWindow == null) TaskWindow.ShowWindow (application); taskWindow.addTaskEntry.GrabFocus (); }
/// <summary> /// This should be called after a new IBackend has been set /// </summary> public static void Reinitialize(bool show, GtkApplicationBase application) { if (TaskWindow.taskWindow != null) { TaskWindow.taskWindow.Hide (); TaskWindow.taskWindow.Destroy (); TaskWindow.taskWindow = null; } if (show) TaskWindow.ShowWindow (application); }
public static void SelectAndEdit(ITask task, GtkApplicationBase application) { ShowWindow (application); taskWindow.EnterEditMode (task, true); taskWindow.Present (); }
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; }
public static void ShowWindow(GtkApplicationBase application) { ShowWindow (false, application); }
private static void ShowWindow(bool supportToggle, GtkApplicationBase application) { if(taskWindow != null) { if(taskWindow.IsActive && supportToggle) { int x; int y; taskWindow.GetPosition(out x, out y); lastXPos = x; lastYPos = y; taskWindow.Hide(); } else { if(!taskWindow.Visible) { int x = lastXPos; int y = lastYPos; if (x >= 0 && y >= 0) taskWindow.Move(x, y); } taskWindow.Present(); } } else if (application.BackendManager.CurrentBackend != null) { taskWindow = new TaskWindow (application); if(lastXPos == 0 || lastYPos == 0) { lastXPos = application.Preferences.GetInt("MainWindowLastXPos"); lastYPos = application.Preferences.GetInt("MainWindowLastYPos"); } int x = lastXPos; int y = lastYPos; if (x >= 0 && y >= 0) taskWindow.Move(x, y); taskWindow.ShowAll(); } }