Exemple #1
0
        /// <summary>
        /// This should be called after a new IBackend has been set
        /// </summary>
        public static void Reinitialize(bool show)
        {
            if (TaskWindow.taskWindow != null) {
                TaskWindow.taskWindow.Hide ();
                TaskWindow.taskWindow.Destroy ();
                TaskWindow.taskWindow = null;
            }

            if (show)
                TaskWindow.ShowWindow ();
        }
Exemple #2
0
        private static void ShowWindow(bool supportToggle)
        {
            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 (GtkApplication.Instance.Backend != null) {
                TaskWindow.taskWindow = new TaskWindow(GtkApplication.Instance.Backend);
                if(lastXPos == 0 || lastYPos == 0)
                {
                    lastXPos = GtkApplication.Instance.Preferences.GetInt("MainWindowLastXPos");
                    lastYPos = GtkApplication.Instance.Preferences.GetInt("MainWindowLastYPos");
                }

                int x = lastXPos;
                int y = lastYPos;

                if (x >= 0 && y >= 0)
                    taskWindow.Move(x, y);

                taskWindow.ShowAll();
            }
        }
Exemple #3
0
        private void WindowDeleted(object sender, DeleteEventArgs args)
        {
            int x;
            int y;
            int width;
            int height;

            this.GetPosition(out x, out y);
            this.GetSize(out width, out height);

            lastXPos = x;
            lastYPos = y;

            GtkApplication.Instance.Preferences.SetInt("MainWindowLastXPos", lastXPos);
            GtkApplication.Instance.Preferences.SetInt("MainWindowLastYPos", lastYPos);
            GtkApplication.Instance.Preferences.SetInt("MainWindowWidth", width);
            GtkApplication.Instance.Preferences.SetInt("MainWindowHeight", height);

            Debug.WriteLine("WindowDeleted was called");
            taskWindow = null;
        }