Example #1
0
        private void BtnAddTask_Click(object sender, RoutedEventArgs e)
        {
            var taskWindow = new TaskWindow();

            taskWindow.Closing += TaskWindow_Closing;
            taskWindow.ShowDialog();
        }
Example #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var win = new TaskWindow();

            Application.Current.MainWindow = win;
            Application.Current.MainWindow.Show();
        }
Example #3
0
        void OnTaskToggled(object o, ToggledArgs args)
        {
            Logger.Debug("OnTaskToggled");
            TreeIter iter;
            var      path = new TreePath(args.Path);

            if (!model.GetIter(out iter, path))
            {
                return;                 // Do nothing
            }
            var task = model.GetValue(iter, 0) as ITask;

            if (task == null)
            {
                return;
            }

            string statusMsg;

            if (task.State == TaskState.Active)
            {
                task.Complete();
                statusMsg = Catalog.GetString("Task Completed");
            }
            else
            {
                statusMsg = Catalog.GetString("Action Canceled");
                task.Activate();
            }
            TaskWindow.ShowStatus(statusMsg, 5);
        }
Example #4
0
        private void EditJob(Job job)
        {
            if (job != null)
            {
                Job tempjob = new Job();
                tempjob.Active       = job.Active;
                tempjob.DeleteFiles  = job.DeleteFiles;
                tempjob.ExternalPath = job.ExternalPath;
                tempjob.Filter       = job.Filter;
                tempjob.ID           = job.ID;
                tempjob.LocalPath    = job.LocalPath;
                tempjob.Type         = job.Type;

                TaskWindow addtask = new TaskWindow(job);

                if (addtask != null)
                {
                    addtask.Owner = this;
                    if (addtask.ShowDialog() != true)
                    {
                        int selectedindex = db_ToYandex.SelectedIndex;
                        MainJob.Jobs[selectedindex] = tempjob;
                    }
                }
            }
        }
Example #5
0
        public static void LoadRegexJob(String path)
        {
            TaskWindow taskWindow = new TaskWindow
                                    (
                delegate(Object argument)
            {
                return(RegexHelper.Match(AppState.Current.Input));
            },
                path
                                    )
            {
                Owner = App.MainWindow
            };

            taskWindow.ShowDialog();

            if (taskWindow.Exception == null)
            {
                RegexInput regexInput = taskWindow.Result as RegexInput;

                if (regexInput != null)
                {
                    AppState.Current.Input = regexInput;
                    AppState.Current.Update(path);
                }
            }
            else
            {
                ExceptionMessageBox.Show(App.MainWindow, App.Metadata.AssemblyTitle,
                                         "Invalid job file format.", taskWindow.Exception.InnerException);
            }
        }
Example #6
0
        private void ShowTask(object sender, MouseButtonEventArgs e)
        {
            var listBox = sender as ListBox;

            if (!(listBox?.SelectedItem is TaskModel taskModel))
            {
                return;
            }
            foreach (var window in Application.Current.Windows)
            {
                if (!(window is TaskWindow taskWindow) || taskWindow.Id != taskModel.Id)
                {
                    continue;
                }
                taskWindow.Focus();
                return;
            }
            var task = new TaskWindow(_controller, taskModel.Id);

            task.DeleteTask.Click   += DeleteTask;
            task.ShowTaskList.Click += ShowTaskList;
            task.AddTask.Click      += AddTask;
            task.Show();
            listBox.UnselectAll();
        }
Example #7
0
        public static void SaveRegexJob(String path)
        {
            TaskWindow taskWindow = new TaskWindow
                                    (
                delegate(Object argument)
            {
                FileHelper.SaveRegexInput(argument.ToString(), AppState.Current.Input);

                return(null);
            },
                path
                                    )
            {
                Owner = App.MainWindow
            };

            taskWindow.ShowDialog();

            if (taskWindow.Exception == null)
            {
                AppState.Current.Update(path);
            }
            else
            {
                ExceptionMessageBox.Show(App.MainWindow, App.Metadata.AssemblyTitle,
                                         "Unexpected exception happened.", taskWindow.Exception.InnerException);
            }
        }
Example #8
0
        /// <summary>
        /// Открыть задачу
        /// </summary>
        /// <param name="banRepeat">запрет изменения данных документа</param>
        public static void OpenTaskWindow(ref bool banRepeat)
        {
            Presenter.SelectedObject = null;
            banRepeat = true;
            TaskWindow window = new TaskWindow();

            window.ShowDialog();
        }
Example #9
0
    public void access(int sid, TaskWindow window, CallBack callback)
    {
        this.window   = window;
        this.callback = callback;
        ErlKVMessage message = new ErlKVMessage(FrontPort.TASK_COMPLETE);

        message.addValue("sid", new ErlInt(sid));          //任务sid
        access(message);
    }
Example #10
0
 public void OpenTask() //open task window for selected task
 {
     if (Task != null)
     {
         var taskwindow = new TaskWindow(Controller, Email, Task);
         taskwindow.ShowDialog();
         ReLoad();
     }
 }
Example #11
0
        void OnTaskToggled(object sender, Gtk.ToggledArgs args)
        {
            Logger.Debug("OnTaskToggled");
            Gtk.TreeIter iter;
            Gtk.TreePath path = new Gtk.TreePath(args.Path);
            if (!Model.GetIter(out iter, path))
            {
                return;                 // Do nothing
            }
            ITask task = Model.GetValue(iter, 0) as ITask;

            if (task == null)
            {
                return;
            }

            // remove any timer set up on this task
            InactivateTimer.CancelTimer(task);

            if (task.State == TaskState.Active)
            {
                bool showCompletedTasks =
                    Application.Preferences.GetBool(
                        Preferences.ShowCompletedTasksKey);

                // When showCompletedTasks is true, complete the tasks right
                // away.  Otherwise, set a timer and show the timer animation
                // before marking the task completed.
                if (showCompletedTasks)
                {
                    task.Complete();
                    ShowCompletedTaskStatus();
                }
                else
                {
                    task.Inactivate();

                    // Read the inactivate timeout from a preference
                    int timeout =
                        Application.Preferences.GetInt(Preferences.InactivateTimeoutKey);
                    Logger.Debug("Read timeout from prefs: {0}", timeout);
                    InactivateTimer timer =
                        new InactivateTimer(this, iter, task, (uint)timeout);
                    timer.StartTimer();
                    toggled = true;
                }
            }
            else
            {
                status = Catalog.GetString("Action Canceled");
                TaskWindow.ShowStatus(status);
                task.Activate();
            }
        }
Example #12
0
    public void initialize(Task _task)
    {
        win = fatherWindow as TaskWindow;
        prizeIcon.fatherWindow = win;
        updateTask(_task);

        UI_GoBtn.fatherWindow      = fatherWindow;
        UI_GoBtn.onClickEvent      = onClickGo;
        receiveButton.fatherWindow = fatherWindow;
        receiveButton.onClickEvent = onClickReceiveButton;
    }
Example #13
0
        public void Quit()
        {
            Logger.Info("Quit called - terminating application");
            if (backend != null)
            {
                UnhookFromTooltipTaskGroupModels();
                backend.Cleanup();
            }
            TaskWindow.SavePosition();

            nativeApp.QuitMainLoop();
        }
Example #14
0
        private void ListView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            //Open a new window with more information about the task! =D
            var s          = jiraTaskList.SelectedItem as JiraIssue;
            var taskWindow = new TaskWindow();

            taskWindow.taskWindowLabel.Content = s.DevTask;
            var taskInfo = jc.GetIssue(s.DevTask);

            taskWindow.taskWindowTextBlock.Text = taskInfo.Assignee + " " + taskInfo.Description; // TextBox() { Text = "All sorts of stuff" }};
            taskWindow.Show();
        }
Example #15
0
        public WorkspaceSetter(TaskWindow taskWindow, MenuWindow menu, Desktop desktop)
        {
            this.taskWindow = taskWindow;
            this.menu = menu;
            this.desktop = desktop;
            settings = SharedSettings.GetInstance();
            if (settings.TaskbarAlwaysVisible)
                taskWindow.SizeChanged += TaskWindowSizeChanged;
            menu.SizeChanged += TaskWindowSizeChanged;

            DrawWorkSpace();
        }
Example #16
0
        private void OnQuit(object sender, EventArgs args)
        {
            Logger.Info("OnQuit called - terminating application");
            if (backend != null)
            {
                UnhookFromTooltipTaskGroupModels();
                backend.Cleanup();
            }
            TaskWindow.SavePosition();

            nativeApp.QuitMainLoop();
        }
Example #17
0
        public override void InitializeIdle()
        {
            ActionGroup mainMenuActionGroup = new ActionGroup("Main");

            mainMenuActionGroup.Add(new ActionEntry [] {
                new ActionEntry("FileMenuAction",
                                null,
                                Catalog.GetString("_File"),
                                null,
                                null,
                                null),
                new ActionEntry("WindowMenuAction",
                                null,
                                Catalog.GetString("_Window"),
                                null,
                                null,
                                null)
            });

            UIManager uiManager = Application.Instance.UIManager;

            uiManager.AddUiFromString(osxMenuXml);
            uiManager.InsertActionGroup(mainMenuActionGroup, 1);

            // This totally doesn't work...is my lib too old?
            IgeMacDock dock = new IgeMacDock();

            dock.Clicked      += delegate(object sender, EventArgs args) { TaskWindow.ShowWindow(); };
            dock.QuitActivate += delegate(object sender, EventArgs args) { Application.Instance.Quit(); };

            MenuShell mainMenu = uiManager.GetWidget("/MainMenu") as MenuShell;

            mainMenu.Show();
            IgeMacMenu.MenuBar = mainMenu;


            MenuItem about_item = uiManager.GetWidget("/TrayIconMenu/AboutAction") as MenuItem;
            MenuItem prefs_item = uiManager.GetWidget("/TrayIconMenu/PreferencesAction") as MenuItem;
            MenuItem quit_item  = uiManager.GetWidget("/TrayIconMenu/QuitAction") as MenuItem;


            IgeMacMenuGroup about_group = IgeMacMenu.AddAppMenuGroup();
            IgeMacMenuGroup prefs_group = IgeMacMenu.AddAppMenuGroup();

            about_group.AddMenuItem(about_item, null);
            prefs_group.AddMenuItem(prefs_item, null);

            IgeMacMenu.QuitMenuItem = quit_item;

            // Hide StatusIcon
            Application.Instance.Tray.Visible = false;
        }
Example #18
0
        public Workbench(DockPanel dockPanel)
        {
            this.dockPanel = dockPanel;
            this.deserializeDockContent = new DeserializeDockContent(getContentFromPersistString);

            this.toolWorkplaceWindow = new WorkplaceExplorer(this);
            this.toolPropertyWindow  = new PropertyWindow(this);
            this.toolHistoryWindow   = new HistoryWindow(this);
            this.toolTaskWindow      = new TaskWindow(this);

            workplaceOpenDialog = new OpenFileDialog();
            documentOpenDialog  = new OpenFileDialog();
        }
Example #19
0
        protected GtkApplicationBase(string[] args)
        {
            AddinManager.Initialize();
            AddinManager.Registry.Update();

            Catalog.Init("tasque", Defines.LocaleDir);

            ConfDir = Path.Combine(Environment.GetFolderPath(
                                       Environment.SpecialFolder.ApplicationData), "tasque");
            if (!Directory.Exists(ConfDir))
            {
                Directory.CreateDirectory(ConfDir);
            }

            if (IsRemoteInstanceRunning())
            {
                Logger.Info("Another instance of Tasque is already running.");
                Exit(0);
            }

            RemoteInstanceKnocked += delegate {
                TaskWindow.ShowWindow(this);
            };

            preferences = new Preferences(ConfDir);

            ParseArgs(args);

            backendManager = new BackendManager(preferences);
            backendManager.BackendConfigurationRequested += delegate {
                ShowPreferences();
            };

            Gtk.Application.Init();

            // add package icon path to default icon theme search paths
            IconTheme.Default.PrependSearchPath(Defines.IconsDir);

            Gtk.Application.Init();
            GLib.Idle.Add(delegate {
                InitializeIdle();
                return(false);
            });

            GLib.Timeout.Add(60000, delegate {
                CheckForDaySwitch();
                return(true);
            });

            Gtk.Application.Run();
        }
Example #20
0
    public override void InitSys()
    {
        base.InitSys();

        NETCommon.Log("Init MainCitySys");

        mainCityWindow = GetWindow <MainCityWindow>("MainCityWindow");
        infoWindow     = GetWindow <InfoWindow>("InfoWindow");
        guidWindow     = GetWindow <GuidWindow>("GuidWindow");
        strongWindow   = GetWindow <StrongWindow>("StrongWindow");
        chatWindow     = GetWindow <ChatWindow>("ChatWindow");
        buyWindow      = GetWindow <BuyWindow>("BuyWindow");
        taskWindow     = GetWindow <TaskWindow>("TaskWindow");
    }
Example #21
0
        public TaskBase(TaskDBEntry _taskDBEntry, Character _parentChar)
        {
            this._taskDBEntry = _taskDBEntry;
            this._parentChar  = _parentChar;

            _taskWindow = new TaskWindow();
            _taskWindow.labelPlay.Click   += PauseTaskFromGui;
            _taskWindow.labelRemove.Click += RemoveTask;
            _taskWindow.SetPause(TaskPause);
            _taskWindow.SetSkill(_taskDBEntry.Name);
            _taskWindow.SetStatus(0);

            _parentChar.CharWindow.AddTaskWindow(_taskWindow);
        }
Example #22
0
        public WorkspaceSetter(TaskWindow taskWindow, MenuWindow menu, Desktop desktop)
        {
            this.taskWindow = taskWindow;
            this.menu       = menu;
            this.desktop    = desktop;
            settings        = SharedSettings.GetInstance();
            if (settings.TaskbarAlwaysVisible)
            {
                taskWindow.SizeChanged += TaskWindowSizeChanged;
            }
            menu.SizeChanged += TaskWindowSizeChanged;

            DrawWorkSpace();
        }
Example #23
0
        protected override void UpdateItem()
        {
            var dialog = new TaskWindow(SelectedItem);

            dialog.ShowDialog();

            var vm = dialog.DataContext as TaskVM;

            if (vm.Saved)
            {
                NewItem = SelectedItem.Name;
                Status  = "Tarea actualizada correctamente";
            }
        }
Example #24
0
        private void SetBackend(IBackend value)
        {
            bool changingBackend = false;

            if (this.backend != null)
            {
                UnhookFromTooltipTaskGroupModels();
                changingBackend = true;
                // Cleanup the old backend
                try {
                    Logger.Debug("Cleaning up backend: {0}",
                                 this.backend.Name);
                    this.backend.Cleanup();
                } catch (Exception e) {
                    Logger.Warn("Exception cleaning up '{0}': {1}",
                                this.backend.Name,
                                e);
                }
            }

            // Initialize the new backend
            this.backend = value;
            if (this.backend == null)
            {
                RefreshTrayIconTooltip();
                return;
            }

            Logger.Info("Using backend: {0} ({1})",
                        this.backend.Name,
                        this.backend.GetType().ToString());
            this.backend.Initialize();

            if (!changingBackend)
            {
                TaskWindow.Reinitialize(!this.quietStart);
            }
            else
            {
                TaskWindow.Reinitialize(true);
            }

            RebuildTooltipTaskGroupModels();
            RefreshTrayIconTooltip();

            Logger.Debug("Configuration status: {0}",
                         this.backend.Configured.ToString());
        }
Example #25
0
        /// <summary>
        /// Открыть объект
        /// </summary>
        /// <param name="index">Индекс объекта</param>
        /// <param name="banRepeat">Запрет изменения данных документа</param>
        public static void OpenObject(ref int index, ref bool banRepeat)
        {
            if (Presenter.SelectedObject != null || index != -1)
            {
                if (Presenter.SelectedObject != null)
                {
                    index = Presenter.CompositeCollection.IndexOf(Presenter.SelectedObject);
                }
                banRepeat = true;

                // объект является документом
                if (Presenter.CompositeCollection[index].GetType().GetProperty("Uuid") != null)
                {
                    // в случае наличия uuid запретим изменять данные
                    if (((Document)Presenter.CompositeCollection[index]).Uuid != "")
                    {
                        banRepeat = false;
                    }

                    do
                    {
                        var documentWindow = new DocumentWindow();
                        documentWindow.ShowDialog();

                        // при закрытии диалогового окна производим выход из метода
                        if (!documentWindow.DialogResult.GetValueOrDefault(true))
                        {
                            banRepeat = true;
                            return;
                        }
                    } while (true);
                }

                // объект является задачей
                do
                {
                    var taskWindow = new TaskWindow();
                    taskWindow.ShowDialog();

                    // при закрытии диалогового окна производим выход из метода
                    if (!taskWindow.DialogResult.GetValueOrDefault(true))
                    {
                        return;
                    }
                } while (true);
            }
        }
Example #26
0
        private void Addtask_mi_Click(object sender, RoutedEventArgs e)
        {
            // Добавить задание
            Job job = new Job();

            job.ID     = Guid.NewGuid();
            job.Filter = "*.*";
            TaskWindow addtask = new TaskWindow(job);

            if (addtask != null)
            {
                addtask.Owner = this;
                if (addtask.ShowDialog() == true)
                {
                    MainJob.Jobs.Add(job);
                }
            }
        }
Example #27
0
        public void Exit(int exitcode = 0)
        {
            Logger.Info("Exit called - terminating application");

            if (backendManager != null)
            {
                backendManager.Dispose();
            }

            TaskWindow.SavePosition(Preferences);
            Application.Quit();

            if (Exiting != null)
            {
                Exiting(this, EventArgs.Empty);
            }

            Environment.Exit(exitcode);
        }
Example #28
0
        private bool CheckForDaySwitch()
        {
            if (DateTime.Today != currentDay)
            {
                Logger.Debug("Day has changed, reloading tasks");
                currentDay = DateTime.Today;
                // Reinitialize window according to new date
                if (TaskWindow.IsOpen)
                {
                    TaskWindow.Reinitialize(true);
                }

                UnhookFromTooltipTaskGroupModels();
                RebuildTooltipTaskGroupModels();
                RefreshTrayIconTooltip();
            }

            return(true);
        }
Example #29
0
        private async void AddTask(object sender, RoutedEventArgs e)
        {
            var id = Guid.NewGuid().ToString("N");
            await _controller.AddTask(new TaskModel
            {
                Id      = id,
                Color   = new SolidColorBrush(Colors.OrangeRed),
                List    = new List <TaskText>(),
                Name    = "Default Name",
                Opacity = 0.9
            });

            var task = new TaskWindow(_controller, id);

            task.DeleteTask.Click   += DeleteTask;
            task.ShowTaskList.Click += ShowTaskList;
            task.AddTask.Click      += AddTask;
            task.Show();
            ShowTaskList();
        }
Example #30
0
        private bool InitializeIdle()
        {
            if (customBackend != null)
            {
                Application.Backend = customBackend;
            }
            else
            {
                // Check to see if the user has a preference of which backend
                // to use.  If so, use it, otherwise, pop open the preferences
                // dialog so they can choose one.
                string backendTypeString = Preferences.Get(Preferences.CurrentBackend);
                Logger.Debug("CurrentBackend specified in Preferences: {0}", backendTypeString);
                if (backendTypeString != null &&
                    availableBackends.ContainsKey(backendTypeString))
                {
                    Application.Backend = availableBackends [backendTypeString];
                }
            }

            trayIcon = GtkTray.CreateTray();

            if (backend == null)
            {
                // Pop open the preferences dialog so the user can choose a
                // backend service to use.
                Application.ShowPreferences();
            }
            else if (!quietStart)
            {
                TaskWindow.ShowWindow();
            }
            if (backend == null || !backend.Configured)
            {
                GLib.Timeout.Add(1000, new GLib.TimeoutHandler(RetryBackend));
            }

            nativeApp.InitializeIdle();

            return(false);
        }
Example #31
0
        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();
            }
        }
        /// <summary>
        /// Configures the application when the form has been initialized.
        /// </summary>
        /// <returns></returns>
        private void ConfigureApplication()
        {
            // Form designer code initialization.
            InitializeComponent();

            // Make sure certain field members get initialized.
            m_nImageBoxKeyPressed = Keys.None;
            m_nCurrentTool = Tool.None;
            m_nSelectedWindow = Window.None;
            m_nSelectedTaskWindow = IViewSettings.Default.SelectedTaskWindow;
            m_nImageScale = IViewSettings.Default.AutoScale;
            m_nImageListViewType = IViewSettings.Default.ImageListViewType;
            m_oUndoRedo = new ImageEditManagement(IViewSettings.Default.MaxUndos);
            m_oFavourites = new FavouritesCollection(IViewSettings.Default.Favourites);
            m_oNewWindows = new List<NewWindow>();

            // Initialize a new instance of the ImageBrowser class.
            m_oImageBrowser = new ImageBrowser();
            m_oImageBrowser.MaxFiles = IViewSettings.Default.MaxFiles;
            m_oImageBrowser.MaxFileLength = IViewSettings.Default.MaxFileLength;
            m_oImageBrowser.HighQualityThumbnails = IViewSettings.Default.HighQualityThumbnails;
            m_oImageBrowser.Effect = IViewSettings.Default.ThumbnailEffect;
            m_oImageBrowser.FileRenamed +=
                new EventHandler<ImageBrowserRenameEventArgs>(ImageBrowser_FileRenamed);
            m_oImageBrowser.ItemRemoved +=
                new EventHandler<ImageBrowserItemEventArgs>(ImageBrowser_ItemRemoved);

            // Initialize a new docking window for the explorer.
            Rectangle WndRect = IViewSettings.Default.ExplorerWindowRect;
            m_oExplorerDockWindow = new DockingWindow(WndRect, ExplorerSplitterPanel,
                new Control[] { etvw_Directorys, ts_etvw_Tools });
            m_oExplorerDockWindow.Name = "ExplorerDockingWindow";
            m_oExplorerDockWindow.Text = "Explorer";
            m_oExplorerDockWindow.DockChanged +=
                new EventHandler<DockChangedEventArgs>(DockingWindow_DockChanged);

            // Initialize a new docking window for the image list.
            WndRect = IViewSettings.Default.ImageListWindowRect;
            m_oImageListDockWindow = new DockingWindow(WndRect, ImageListSplitterPanel,
                new Control[] { elvw_Images, ts_elvw_Tools });
            m_oImageListDockWindow.Name = "ImageListDockingWindow";
            m_oImageListDockWindow.Text = "Image List";
            m_oImageListDockWindow.DockChanged +=
                new EventHandler<DockChangedEventArgs>(DockingWindow_DockChanged);

            // Initialize a new docking window for the task panel.
            WndRect = IViewSettings.Default.TasksWindowRect;
            m_oTaskDockWindow = new DockingWindow(WndRect, TaskSplitterPanel,
                new Control[] { pan_TasksContainer, ts_task_Tools });
            m_oTaskDockWindow.Name = "TaskDockingWindow";
            m_oTaskDockWindow.Text = "Tasks";
            m_oTaskDockWindow.DockChanged +=
                new EventHandler<DockChangedEventArgs>(DockingWindow_DockChanged);

            // Initialize the PropertiesPanel.
            m_oPropertiesPanel = new PropertiesPanel();
            m_oPropertiesPanel.Dock = DockStyle.Fill;
            m_oPropertiesPanel.HistogramAutoRefresh = IViewSettings.Default.AutoRefreshHistogram;
            m_oPropertiesPanel.HistogramVisible = IViewSettings.Default.HistogramVisible;
            m_oPropertiesPanel.PropertiesToolbarVisible = IViewSettings.Default.PropertiesToolbarVisible;
            m_oPropertiesPanel.PropertiesHelpVisible = IViewSettings.Default.PropertiesHelpVisible;
            int nDist = m_oPropertiesPanel.Height - IViewSettings.Default.HistogramHeight;
            m_oPropertiesPanel.SplitterDistance = (nDist > 0 && nDist < m_oPropertiesPanel.Height) ? nDist : 100;
            m_oPropertiesPanel.HistogramUpdateRequested += delegate(object sender, EventArgs e)
            {
                if (imgbx_MainImage.IsImageLoaded)
                    m_oPropertiesPanel.ProcessImage((Bitmap)imgbx_MainImage.ImageBoxImage);
            };

            // Initialize the ResizePanel.
            m_oResizePanel = new ResizePanel();
            m_oResizePanel.Dock = DockStyle.Fill;
            m_oResizePanel.Enabled = false;
            m_oResizePanel.ApplyButtonClicked += delegate(object sender, EventArgs e)
            {
                SubResizeImage();
            };

            // Initialize the ShearPanel.
            m_oShearPanel = new ShearPanel();
            m_oShearPanel.Dock = DockStyle.Fill;
            m_oShearPanel.Enabled = false;
            m_oShearPanel.ApplyButtonClicked += delegate(object sender, EventArgs e)
            {
                SubShearImage();
            };

            // Initialize the RedEyePanel.
            m_oRedEyePanel = new RedEyePanel();
            m_oRedEyePanel.Dock = DockStyle.Fill;
            m_oRedEyePanel.Enabled = false;
            m_oRedEyePanel.PupilSizeMinimum = 1;
            m_oRedEyePanel.PupilSizeMaximium = 64;
            m_oRedEyePanel.PupilSize = 32;
            m_oRedEyePanel.ActivateClick += delegate(object sender, EventArgs e)
            {
                m_nCurrentTool = Tool.RedEyeCorrection;
            };

            ProfessionalColorTable oColourTable = new ProfessionalColorTable();

            // Assign a custom colour table if specified.
            if (IViewSettings.Default.ColourTable == ColourTable.ArcticSilver)
                oColourTable = new ArcticSilverColourTable();
            else if (IViewSettings.Default.ColourTable == ColourTable.SkyBlue)
                oColourTable = new SkyBlueColourTable();

            // Create and assign a toolstrip renderer with the specified colour table to the toolstrip manager.
            ToolStripProfessionalRenderer oRenderer = new ToolStripProfessionalRenderer(oColourTable);
            ToolStripManager.Renderer = oRenderer;

            // Create another toolstrip renderer but remove the rounded edges.
            oRenderer = new ToolStripProfessionalRenderer(oColourTable);
            oRenderer.RoundedEdges = false;

            // Apply the toolstrip renderer without rounded edges to the smaller toolstrips.
            ts_elvw_Tools.Renderer = oRenderer;
            ts_etvw_Tools.Renderer = oRenderer;
            ts_task_Tools.Renderer = oRenderer;
            ts_imgbx_Tools.Renderer = oRenderer;

            // Set the toolstrip overflow button properties.
            ts_Toolbar.OverflowButton.AutoToolTip = true;
            ts_Toolbar.OverflowButton.DropDownDirection = ToolStripDropDownDirection.BelowRight;
            ts_Toolbar.OverflowButton.ToolTipText = "Toolbar Options";

            // Put the add or remove button on the overflow. VS will cash if implemented at design time.
            tsddb_tb_AddRemove.Overflow = ToolStripItemOverflow.Always;

            // Set the main toolbar and status bar visibility.
            ts_Toolbar.Visible = IViewSettings.Default.ToolbarVisible;
            ss_Main.Visible = IViewSettings.Default.StatusStripVisible;

            // Send the main toolstrip to the specified parent container.
            if (IViewSettings.Default.ToolBarPanel == ToolBarPanel.Top)
                ts_Toolbar.Parent = tsc_Main.TopToolStripPanel;
            else if (IViewSettings.Default.ToolBarPanel == ToolBarPanel.Bottom)
                ts_Toolbar.Parent = tsc_Main.BottomToolStripPanel;
            else if (IViewSettings.Default.ToolBarPanel == ToolBarPanel.Left)
                ts_Toolbar.Parent = tsc_Main.LeftToolStripPanel;
            else if (IViewSettings.Default.ToolBarPanel == ToolBarPanel.Right)
                ts_Toolbar.Parent = tsc_Main.RightToolStripPanel;

            // Configure the forms DesktopBounds property.
            this.DesktopBounds = IViewSettings.Default.MainWindowRect;

            // Configure the state of the main window.
            if (IViewSettings.Default.MainWindowState == MainWindowState.FullScreen)
                SubToggleFullScreenMode();
            else if (IViewSettings.Default.MainWindowState == MainWindowState.Maximized)
                this.WindowState = FormWindowState.Maximized;

            // Set the explorer splitter bar distance.
            nDist = IViewSettings.Default.ExplorerSplitterDist;
            sc_Explorer.SplitterDistance = (nDist > 0 && nDist < (sc_Explorer.Width - sc_Explorer.Panel2MinSize))
                ? nDist : sc_Explorer.Width / 2;

            // Set the image list splitter bar distance.
            nDist = sc_ImageList.Height - IViewSettings.Default.ImageListSplitterDist;
            sc_ImageList.SplitterDistance = (nDist > 0 && nDist < (sc_ImageList.Height - sc_ImageList.Panel2MinSize))
                ? nDist : sc_ImageList.Height / 2;

            // Set the tasks splitter bar distance.
            nDist = sc_Tasks.Width - IViewSettings.Default.TasksSplitterDist;
            sc_Tasks.SplitterDistance = (nDist > 0 && nDist < (sc_Tasks.Width - sc_Tasks.Panel2MinSize))
                ? nDist : sc_Tasks.Width / 2;

            // Configure the dock or collapse state of the explorer window.
            if (!IViewSettings.Default.ExplorerDocked)
                m_oExplorerDockWindow.UnDock(this);
            else
                ExplorerSplitterPanelCollapsed = IViewSettings.Default.ExplorerCollapsed;

            // Configure the dock or collapse state of the image list window.
            if (!IViewSettings.Default.ImageListDocked)
                m_oImageListDockWindow.UnDock(this);
            else
                ImageListSplitterPanelCollapsed = IViewSettings.Default.ImageListCollapsed;

            // Configure the dock or collapse state of the tasks window.
            if (!IViewSettings.Default.TasksDocked)
                m_oTaskDockWindow.UnDock(this);
            else
                TaskSplitterPanelCollapsed = IViewSettings.Default.TasksCollapsed;

            // Configure the explorerlistview, view.
            switch (IViewSettings.Default.ImageListViewType)
            {
                case ImageListViewType.LargeIcons:
                case ImageListViewType.MediumIcons:
                case ImageListViewType.SmallIcons:
                    elvw_Images.View = View.LargeIcon;
                    break;
                case ImageListViewType.List:
                    elvw_Images.View = View.List;
                    break;
                case ImageListViewType.Details:
                    elvw_Images.View = View.Details;
                    break;
            }

            // Set the width of the explorer listview column headers.
            ch_FileName.Width = IViewSettings.Default.NameColumnWidth;
            ch_Date.Width = IViewSettings.Default.DateColumnWidth;
            ch_FileType.Width = IViewSettings.Default.TypeColumnWidth;
            ch_FileSize.Width = IViewSettings.Default.SizeColumnWidth;

            // Update the imagebox back colour.
            imgbx_MainImage.BackColor = IViewSettings.Default.MainDisplayColour;

            // Add the explorer treeview parent nodes.
            etvw_Directorys.AddBaseNodes();

            // Add the favourite nodes to the treeview.
            SubLoadFavourites();

            // Show the last selected task window.
            SubShowTaskWindow(m_nSelectedTaskWindow, false);

            // Check for updates if specified.
            if (IViewSettings.Default.AutomaticUpdates)
                SubCheckForUpdates(false, false);
        }
        /// <summary>
        /// iView.NET subroutine. Shows the specified task window.
        /// </summary>
        /// <param name="nWindow">Specifies the task window to show.</param>
        /// <param name="bExpandTaskPanel">Specifies whether to open the task panel if it's currently collapsed.</param>
        /// <returns></returns>
        private SResult SubShowTaskWindow(TaskWindow nWindow, bool bExpandTaskPanel)
        {
            Image oImage = null;
            string sText = string.Empty;

            // Update field members.
            m_nSelectedTaskWindow = nWindow;

            // Clear the tasks container of all controls.
            if (pan_TasksContainer.Controls != null)
                pan_TasksContainer.Controls.Clear();

            switch (nWindow)
            {
                case TaskWindow.Properties:
                    oImage = tsmi_task_Properties.Image;
                    sText = tsmi_task_Properties.Text;
                    pan_TasksContainer.Controls.Add(m_oPropertiesPanel);
                    break;
                case TaskWindow.RedEyeCorrection:
                    oImage = tsmi_task_RedEyeCorrection.Image;
                    sText = tsmi_task_RedEyeCorrection.Text;
                    pan_TasksContainer.Controls.Add(m_oRedEyePanel);
                    break;
                case TaskWindow.Resize:
                    oImage = tsmi_task_Resize.Image;
                    sText = tsmi_task_Resize.Text;
                    pan_TasksContainer.Controls.Add(m_oResizePanel);
                    break;
                case TaskWindow.Shear:
                    oImage = tsmi_task_Shear.Image;
                    sText = tsmi_task_Shear.Text;
                    pan_TasksContainer.Controls.Add(m_oShearPanel);
                    break;
            }

            // Update the text for the drodown button.
            tsddb_task_Tasks.Text = sText;

            // Update the Image and Text property of the dropdown button.
            if (oImage != null)
                tsddb_task_Tasks.Image = new Bitmap(oImage, oImage.Size);

            // Expand the task panel if specified.
            if ((bExpandTaskPanel) && (m_oTaskDockWindow.IsDocked))
            {
                if (TaskSplitterPanelCollapsed)
                    TaskSplitterPanelCollapsed = false;
            }

            //
            if (CurrentTool == Tool.RedEyeCorrection)
            {
                if (nWindow != TaskWindow.RedEyeCorrection)
                    CurrentTool = Tool.None;
            }

            return SResult.Completed;
        }
Example #34
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;

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

            Logger.Debug("WindowDeleted was called");
            taskWindow = null;
        }
Example #35
0
        /// <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);
        }
Example #36
-6
        public static void LoadTextDocument(String path)
        {
            TaskWindow taskWindow = new TaskWindow
                                    (
                delegate(Object argument)
            {
                // Use Encoding.Default to eliminate incorrect characters
                return(File.ReadAllText(argument.ToString(), Encoding.Default));
            },
                path
                                    )
            {
                Owner = App.MainWindow
            };

            taskWindow.ShowDialog();

            if (taskWindow.Exception == null)
            {
                String text = taskWindow.Result as String;

                if (text != null)
                {
                    AppState.Current.Input.Text = text;
                }
            }
            else
            {
                ExceptionMessageBox.Show(App.MainWindow, App.Metadata.AssemblyTitle,
                                         "Invalid job file format.", taskWindow.Exception.InnerException);
            }
        }