Пример #1
0
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit) {
            old_settings_ = new log_settings_string(settings);
            settings_ = new log_settings_string(settings);
            edit_ = edit;
            InitializeComponent();

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left = -100;
            load_settings();
            if (edit == edit_type.add) {
                Text = "Open Log";
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => {
                    // 1.8.11+ I can preload a config after the constructor. In that case, I should not open the dropdown
                    // 1.8.7+ if it's anything else than file, we have preset some settings - just let the user see them 
                    //        (such as, when user drops an sqlite file, and we fill pretty much all details)
                    bool any_presets = settings_.type != log_type.file
                        // ... in this case, it's a file, with its name set
                        || settings_.name != "" ;
                    if ( !any_presets)
                        type.DroppedDown = true;
                    else 
                        util.bring_to_top(this);
                }, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
                util.postpone(() => remotePassword.Focus(), 1);

            new Thread(check_event_log_thread) {IsBackground = true}.Start();
        }
Пример #2
0
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit)
        {
            old_settings_ = new settings_as_string(settings);
            settings_     = new settings_as_string(settings);
            edit_         = edit;
            InitializeComponent();
            fileName.Text       = settings_.get("type") == "file" ? settings_.get("name") : "";
            type.Enabled        = edit == edit_type.add;
            browserFile.Enabled = edit == edit_type.add;

            if (edit == edit_type.add)
            {
                settings_.set("event.log_type", "Application|System");
            }

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left       = -100;
            friendlyName.Text = settings_.get("friendly_name");

            fileType.SelectedIndex = file_type_to_index(settings_.get("file_type"));

            update_syntax();
            ifLine.Checked = settings_.get("line.if_line", "0") != "0";

            partSeparator.Text = settings_.get("part.separator");

            xmlDelimeter.Text = settings_.get("xml.delimeter");

            csvHasHeader.Checked = settings_.get("csv.has_header", "1") != "0";
            csvSeparator.Text    = settings_.get("csv.separator", ",");

            remoteMachineName.Text = settings_.get("event.remote_machine_name");
            remoteDomain.Text      = settings_.get("event.remote_domain");
            remoteUserName.Text    = settings_.get("event.remote_user_name");
            remotePassword.Text    = settings_.get("event.remote_password");
            selectedEventLogs.Text = settings_.get("event.log_type").Replace("|", "\r\n");
            eventsReversed.Checked = settings_.get("event.reversed", "0") != "0";

            type.SelectedIndex = type_to_index();
            if (edit == edit_type.add)
            {
                Text = "Open Log";
                settings_.set("guid", Guid.NewGuid().ToString());
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => type.DroppedDown = true, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
            {
                util.postpone(() => remotePassword.Focus(), 1);
            }

            new Thread(check_event_log_thread)
            {
                IsBackground = true
            }.Start();
        }
Пример #3
0
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit)
        {
            old_settings_ = new log_settings_string(settings);
            settings_     = new log_settings_string(settings);
            edit_         = edit;
            InitializeComponent();
            fileName.Text       = settings_.type == log_type.file ? settings_.name : "";
            type.Enabled        = edit == edit_type.add;
            browserFile.Enabled = edit == edit_type.add;

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left            = -100;
            friendlyName.Text      = settings_.friendly_name;
            fileType.SelectedIndex = file_type_to_index(settings_.file_type);
            reversed.Checked       = settings_.reverse;

            update_syntax();
            ifLine.Checked = settings_.line_if_line;

            partSeparator.Text = settings_.part_separator;

            xmlDelimeter.Text = settings_.xml_delimiter;

            csvHasHeader.Checked = settings_.cvs_has_header;
            csvSeparator.Text    = settings_.cvs_separator_char;

            remoteMachineName.Text = settings_.event_remote_machine_name;
            remoteDomain.Text      = settings_.event_remote_domain;
            remoteUserName.Text    = settings_.event_remote_user_name;
            remotePassword.Text    = settings_.event_remote_password;
            selectedEventLogs.Text = settings_.event_log_type.get().Replace("|", "\r\n");

            type.SelectedIndex = type_to_index();
            if (edit == edit_type.add)
            {
                Text = "Open Log";
                settings_.guid.set(Guid.NewGuid().ToString());
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => type.DroppedDown = true, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
            {
                util.postpone(() => remotePassword.Focus(), 1);
            }

            new Thread(check_event_log_thread)
            {
                IsBackground = true
            }.Start();
        }
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit) {
            old_settings_ = new settings_as_string(settings);
            settings_ = new settings_as_string(settings);
            file_name_ =  settings_.get("type") == "file" ? settings_.get("name") : "" ;

            edit_ = edit;
            InitializeComponent();
            type.Enabled = edit == edit_type.add;

            if (edit == edit_type.add) {
                settings_.set("event.log_type", "Application|System");
            }

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left = -100;
            friendlyName.Text = settings_.get("friendly_name");

            fileType.SelectedIndex = file_type_to_index( settings_.get("file_type") );

            syntax.Text = settings_.get("syntax");
            syntax.ForeColor = syntax.Text == find_log_syntax.UNKNOWN_SYNTAX ? Color.Red : Color.Black;
            ifLine.Checked = settings_.get("line.if_line", "0") != "0";
            
            partSeparator.Text = settings_.get("part.separator");

            xmlDelimeter.Text = settings_.get("xml.delimeter");

            csvHasHeader.Checked = settings_.get("csv.has_header", "1") != "0";
            csvSeparator.Text = settings_.get("csv.separator", ",");

            remoteMachineName.Text = settings_.get("event.remote_machine_name");
            remoteDomain.Text = settings_.get("event.remote_domain");
            remoteUserName.Text = settings_.get("event.remote_user_name");
            remotePassword.Text = settings_.get("event.remote_password");
            selectedEventLogs.Text = settings_.get("event.log_type").Replace("|", "\r\n");

            type.SelectedIndex = type_to_index();
            if (edit == edit_type.add) {
                Text = "Open Log";
                settings_.set("guid", Guid.NewGuid().ToString());
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => type.DroppedDown = true, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
                util.postpone(() => remotePassword.Focus(), 1);

            new Thread(check_event_log_thread) {IsBackground = true}.Start();
        }
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit) {
            old_settings_ = new log_settings_string(settings);
            settings_ = new log_settings_string(settings);
            edit_ = edit;
            InitializeComponent();
            fileName.Text =  settings_.type == log_type.file ? settings_.name : "" ;
            type.Enabled = edit == edit_type.add;
            browserFile.Enabled = edit == edit_type.add;

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left = -100;
            friendlyName.Text = settings_.friendly_name;
            fileType.SelectedIndex = file_type_to_index( settings_.file_type );
            reversed.Checked = settings_.reverse;

            update_syntax();
            ifLine.Checked = settings_.line_if_line;
            
            partSeparator.Text = settings_.part_separator;

            xmlDelimeter.Text = settings_.xml_delimiter;

            csvHasHeader.Checked = settings_.cvs_has_header;
            csvSeparator.Text = settings_.cvs_separator_char;

            remoteMachineName.Text = settings_.event_remote_machine_name;
            remoteDomain.Text = settings_.event_remote_domain;
            remoteUserName.Text = settings_.event_remote_user_name;
            remotePassword.Text = settings_.event_remote_password;
            selectedEventLogs.Text = settings_.event_log_type.get() .Replace("|", "\r\n");

            type.SelectedIndex = type_to_index();
            if (edit == edit_type.add) {
                Text = "Open Log";
                settings_.guid .set( Guid.NewGuid().ToString());
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => type.DroppedDown = true, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
                util.postpone(() => remotePassword.Focus(), 1);

            new Thread(check_event_log_thread) {IsBackground = true}.Start();
        }
Пример #6
0
        // file name is set only if it's a file
        public edit_log_settings_form(string settings, edit_type edit = edit_type.edit)
        {
            old_settings_ = new log_settings_string(settings);
            settings_     = new log_settings_string(settings);
            edit_         = edit;
            InitializeComponent();

            hide_tabs(typeTab);
            hide_tabs(fileTypeTab);
            cancel.Left = -100;
            load_settings();
            if (edit == edit_type.add)
            {
                Text = "Open Log";
                util.postpone(() => type.Focus(), 1);
                util.postpone(() => {
                    // 1.8.11+ I can preload a config after the constructor. In that case, I should not open the dropdown
                    // 1.8.7+ if it's anything else than file, we have preset some settings - just let the user see them
                    //        (such as, when user drops an sqlite file, and we fill pretty much all details)
                    bool any_presets = settings_.type != log_type.file
                                       // ... in this case, it's a file, with its name set
                                       || settings_.name != "";
                    if (!any_presets)
                    {
                        type.DroppedDown = true;
                    }
                    else
                    {
                        util.bring_to_top(this);
                    }
                }, 200);
            }
            if (edit == edit_type.edit && typeTab.SelectedIndex == 1 && remoteMachineName.Text.Trim() != "")
            {
                util.postpone(() => remotePassword.Focus(), 1);
            }

            new Thread(check_event_log_thread)
            {
                IsBackground = true
            }.Start();
        }