private void OpenSettings(int tabToOpen)
        {
            SettingsDialog dlg = new SettingsDialog(ConfigManager.Settings.preferences, this, tabToOpen);

            dlg.TopMost = TopMost;
            if (DialogResult.OK == dlg.ShowDialog())
            {
                ConfigManager.Settings.preferences = dlg.Preferences;
                ConfigManager.Save(SettingsFlags.Settings);
                NotifyWindowsForChangedPrefs(SettingsFlags.Settings);
            }
        }
Exemple #2
0
 private void logWindow_FilterListChanged(object sender, FilterListChangedEventArgs e)
 {
     lock (logWindowList)
     {
         foreach (LogWindow logWindow in logWindowList)
         {
             if (logWindow != e.LogWindow)
             {
                 logWindow.HandleChangedFilterList();
             }
         }
     }
     ConfigManager.Save(SettingsFlags.FilterList);
 }
Exemple #3
0
        private void openURIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenUriDialog dlg = new OpenUriDialog();

            dlg.UriHistory = ConfigManager.Settings.uriHistoryList;

            if (DialogResult.OK == dlg.ShowDialog())
            {
                if (dlg.Uri.Trim().Length > 0)
                {
                    ConfigManager.Settings.uriHistoryList = dlg.UriHistory;
                    ConfigManager.Save(SettingsFlags.FileHistory);
                    LoadFiles(new string[] { dlg.Uri }, false);
                }
            }
        }
        private void OpenFileDialog()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (CurrentLogWindow != null)
            {
                FileInfo info = new FileInfo(CurrentLogWindow.FileName);
                openFileDialog.InitialDirectory = info.DirectoryName;
            }
            else
            {
                if (ConfigManager.Settings.lastDirectory != null && ConfigManager.Settings.lastDirectory.Length > 0)
                {
                    openFileDialog.InitialDirectory = ConfigManager.Settings.lastDirectory;
                }
                else
                {
                    try
                    {
                        openFileDialog.InitialDirectory =
                            Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    }
                    catch (SecurityException e)
                    {
                        _logger.Warn(e, "Insufficient rights for GetFolderPath(): ");
                        // no initial directory if insufficient rights
                    }
                }
            }

            openFileDialog.Multiselect = true;

            if (DialogResult.OK == openFileDialog.ShowDialog(this))
            {
                FileInfo info = new FileInfo(openFileDialog.FileName);
                if (info.Directory.Exists)
                {
                    ConfigManager.Settings.lastDirectory = info.DirectoryName;
                    ConfigManager.Save(SettingsFlags.FileHistory);
                }

                if (info.Exists)
                {
                    LoadFiles(openFileDialog.FileNames, false);
                }
            }
        }
Exemple #5
0
        private void AddToFileHistory(string fileName)
        {
            Predicate <string> findName = delegate(string s) { return(s.ToLower().Equals(fileName.ToLower())); };
            int index = ConfigManager.Settings.fileHistoryList.FindIndex(findName);

            if (index != -1)
            {
                ConfigManager.Settings.fileHistoryList.RemoveAt(index);
            }
            ConfigManager.Settings.fileHistoryList.Insert(0, fileName);
            while (ConfigManager.Settings.fileHistoryList.Count > MAX_FILE_HISTORY)
            {
                ConfigManager.Settings.fileHistoryList.RemoveAt(ConfigManager.Settings.fileHistoryList.Count - 1);
            }
            ConfigManager.Save(SettingsFlags.FileHistory);

            FillHistoryMenu();
        }
        private void LogTabWindow_Closing(object sender, CancelEventArgs e)
        {
            try
            {
                shouldStop = true;
                statusLineEventHandle.Set();
                statusLineEventWakeupHandle.Set();
                ledThread.Join();
                statusLineThread.Join();

                IList <LogWindow> deleteLogWindowList = new List <LogWindow>();
                ConfigManager.Settings.alwaysOnTop = TopMost && ConfigManager.Settings.preferences.allowOnlyOneInstance;
                SaveLastOpenFilesList();

                foreach (LogWindow logWindow in logWindowList)
                {
                    deleteLogWindowList.Add(logWindow);
                }

                foreach (LogWindow logWindow in deleteLogWindowList)
                {
                    RemoveAndDisposeLogWindow(logWindow, true);
                }

                DestroyBookmarkWindow();

                ConfigManager.Instance.ConfigChanged -= ConfigChanged;

                SaveWindowPosition();
                ConfigManager.Save(SettingsFlags.WindowPosition | SettingsFlags.FileHistory);
            }
            catch (Exception)
            {
                // ignore error (can occur then multipe instances are closed simultaneously or if the
                // window was not constructed completely because of errors)
            }
            finally
            {
                if (LogExpertProxy != null)
                {
                    LogExpertProxy.WindowClosed(this);
                }
            }
        }
        private void ShowHighlightSettingsDialog()
        {
            HilightDialog dlg = new HilightDialog();

            dlg.KeywordActionList    = PluginRegistry.GetInstance().RegisteredKeywordActions;
            dlg.Owner                = this;
            dlg.TopMost              = TopMost;
            dlg.HilightGroupList     = HilightGroupList;
            dlg.PreSelectedGroupName = highlightGroupsComboBox.Text;
            DialogResult res = dlg.ShowDialog();

            if (res == DialogResult.OK)
            {
                HilightGroupList = dlg.HilightGroupList;
                FillHighlightComboBox();
                ConfigManager.Settings.hilightGroupList = HilightGroupList;
                ConfigManager.Save(SettingsFlags.HighlightSettings);
                OnHighlightSettingsChanged();
            }
        }
Exemple #8
0
 public static void Save(SettingsFlags flags)
 {
     Instance.Save(Settings, flags);
 }
Exemple #9
0
 private void logWindow_CurrentHighlightGroupChanged(object sender, CurrentHighlightGroupChangedEventArgs e)
 {
     OnHighlightSettingsChanged();
     ConfigManager.Settings.hilightGroupList = HilightGroupList;
     ConfigManager.Save(SettingsFlags.HighlightSettings);
 }