Exemple #1
0
        void RegisterUIManager()
        {
            var newTaskAction = new ActionEntry("NewTaskAction", Stock.New,
                                                Catalog.GetString("New Task ..."), null, null, delegate {
                // Show the TaskWindow and then cause a new task to be created
                TaskWindow.ShowWindow(application);
                TaskWindow.GrabNewTaskEntryFocus(application);
            });

            var refreshAction = new ActionEntry("RefreshAction", Stock.Execute,
                                                Catalog.GetString("Refresh Tasks ..."), null, null,
                                                delegate { application.BackendManager.ReInitializeBackend(); });


            var trayActionGroup = new ActionGroup("Tray");

            trayActionGroup.Add(new ActionEntry [] {
                newTaskAction,
                new ActionEntry("AboutAction", Stock.About, OnAbout),
                new ActionEntry("PreferencesAction", Stock.Preferences,
                                delegate { application.ShowPreferences(); }),
                refreshAction,
                new ActionEntry("QuitAction", Stock.Quit,
                                delegate { application.Exit(); })
            });

            ToggleTaskWindowAction             = new Gtk.Action("ToggleTaskWindowAction", Catalog.GetString("Toggle Task Window"));
            ToggleTaskWindowAction.ActionGroup = trayActionGroup;
            ToggleTaskWindowAction.Activated  += delegate { TaskWindow.ToggleWindowVisible(application); };

            uiManager = new UIManager();
            uiManager.AddUiFromString(MenuXml);
            uiManager.InsertActionGroup(trayActionGroup, 0);

            SwitchBackendItems(false);
        }
Exemple #2
0
 private void OnNewTask(object sender, EventArgs args)
 {
     // Show the TaskWindow and then cause a new task to be created
     TaskWindow.ShowWindow();
     TaskWindow.GrabNewTaskEntryFocus();
 }