Beispiel #1
0
        public EDDiscoveryForm()
        {
            InitializeComponent();

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");

            string logpath = "";

            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);

            SystemNames = new AutoCompleteStringCollection();
            Map         = new EDDiscovery2._3DMap.MapManager();
        }
Beispiel #2
0
        private void SaveSettings()
        {
            _db.PutSettingBool("NetlogDirAutoMode", radioButton_Auto.Checked);
            _db.PutSettingString("Netlogdir", textBoxNetLogDir.Text);

            _db.PutSettingInt("FormWidth", this.Width);
            _db.PutSettingInt("FormHeight", this.Height);
            _db.PutSettingInt("FormTop", this.Top);
            _db.PutSettingInt("FormLeft", this.Left);
            _db.PutSettingString("DefaultMapCenter", textBoxHomeSystem.Text);
            _db.PutSettingDouble("DefaultMapZoom", Double.Parse(textBoxDefaultZoom.Text));
            _db.PutSettingBool("CentreMapOnSelection", radioButtonHistorySelection.Checked);
            routeControl1.SaveSettings();
            _db.PutSettingBool("EDSMPushOnly", travelHistoryControl1.EDSMPushOnly);
            EDDConfig.UseDistances       = checkBox_Distances.Checked;
            EDDConfig.EDSMLog            = checkBoxEDSMLog.Checked;
            EDDConfig.CanSkipSlowUpdates = checkboxSkipSlowUpdates.Checked;

            List <EDCommander> edcommanders = (List <EDCommander>)dataGridViewCommanders.DataSource;

            EDDConfig.StoreCommanders(edcommanders);
            dataGridViewCommanders.DataSource = null;
            dataGridViewCommanders.DataSource = EDDConfig.listCommanders;
            dataGridViewCommanders.Update();
        }
Beispiel #3
0
        private void buttonAddCommander_Click(object sender, EventArgs e)
        {
            EDCommander cmdr = EDDConfig.GetNewCommander();

            //List<EDCommander> dlist = (List < EDCommander > )dataGridViewCommanders.DataSource;
            //dlist.Add(cmdr);
            //dataGridViewCommanders.DataSource = dlist;
            //dataGridViewCommanders.Invalidate();

            //dataGridViewCommanders.Update();

            EDDConfig.listCommanders.Add(cmdr);
            dataGridViewCommanders.DataSource = null;
            dataGridViewCommanders.DataSource = EDDConfig.listCommanders;
            dataGridViewCommanders.Update();
            //string[] row = new string[] { cmdr.Nr.ToString(), cmdr.Name, cmdr.APIKey, cmdr.NetLogPath };
            //dataGridViewCommanders.Rows.Add(row);
        }
Beispiel #4
0
        public EDDiscoveryForm()
        {
            InitializeComponent();
            panel_close.Enabled = false;                            // no closing until we are ready for it..
            tabControl1.Enabled = false;

            EDDConfig = new EDDConfig();

            //_fileTgcSystems = Path.Combine(Tools.GetAppDataDirectory(), "tgcsystems.json");
            _fileEDSMDistances = Path.Combine(Tools.GetAppDataDirectory(), "EDSMDistances.json");

            string logpath = "";

            try
            {
                logpath = Path.Combine(Tools.GetAppDataDirectory(), "Log");
                if (!Directory.Exists(logpath))
                {
                    Directory.CreateDirectory(logpath);
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Unable to create the folder '{logpath}'");
                Trace.WriteLine($"Exception: {ex.Message}");
            }
            _edsmSync = new EDSMSync(this);

            ToolStripManager.Renderer = theme.toolstripRenderer;
            theme.LoadThemes();                                         // default themes and ones on disk loaded
            theme.RestoreSettings();                                    // theme, remember your saved settings

            trilaterationControl.InitControl(this);
            travelHistoryControl1.InitControl(this);
            imageHandler1.InitControl(this);
            settings.InitControl(this);
            routeControl1.InitControl(this);

            SystemNames = new AutoCompleteStringCollection();
            Map         = new EDDiscovery2._3DMap.MapManager();

            ApplyTheme(false);
        }
Beispiel #5
0
        private void EDDiscoveryForm_Load(object sender, EventArgs e)
        {
            try
            {
                EliteDangerous.CheckED();
                EDDConfig.Update();
                RepositionForm();
                InitFormControls();
                InitSettingsTab();
                CheckIfEliteDangerousIsRunning();
                CheckIfVerboseLoggingIsTurnedOn();

                if (File.Exists("test.txt"))
                {
                    button1.Visible = true;
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("EDDiscoveryForm_Load exception: " + ex.Message);
                System.Windows.Forms.MessageBox.Show("Trace: " + ex.StackTrace);
            }
        }