示例#1
0
        private void FormMain_Load( object sender, EventArgs e ) {
            ttHelp.Ext_SetToolTip( helpAdvancedCategories, GlobalStrings.MainForm_Help_AdvancedCategories );

            LoadGameDB();

            // Save original width and height
            originalHeight = this.Height;
            originalWidth = this.Width;
            originalSplitDistanceMain = this.splitContainer.SplitterDistance;
            originalSplitDistanceSecondary = this.splitGame.SplitterDistance;

            ClearStatus();
            if( Settings.Instance.SteamPath == null ) {
                DlgSteamPath dlg = new DlgSteamPath();
                dlg.ShowDialog();
                Settings.Instance.SteamPath = dlg.Path;
                Settings.Instance.Save();
            }
            if( Settings.Instance.UpdateAppInfoOnStart ) {
                UpdateGameDBFromAppInfo();
            }
            int threePointFiveDaysInSecs = 84*60*60;
            if (Settings.Instance.UpdateHltbOnStart && Utility.GetCurrentUTime() > (Program.GameDB.LastHltbUpdate + threePointFiveDaysInSecs))
            {
                UpdateGameDBFromHltb();
            }

            if (Settings.Instance.CheckForDepressurizerUpdates)
            {
                CheckForDepressurizerUpdates();
            }

            switch( Settings.Instance.StartupAction ) {
                case StartupAction.Load:
                    LoadProfile( Settings.Instance.ProfileToLoad, false );
                    break;
                case StartupAction.Create:
                    CreateProfile();
                    break;
                default:
                    OnProfileChange();
                    break;
            }

            UpdateUIForSingleCat();
            UpdateEnabledStatesForGames();
            UpdateEnabledStatesForCategories();

            FlushStatus();
        }
示例#2
0
 private void FormMain_Shown( object sender, EventArgs e )
 {
     ClearStatus();
     if( settings.SteamPath == null ) {
         DlgSteamPath dlg = new DlgSteamPath();
         dlg.ShowDialog();
         settings.SteamPath = dlg.Path;
         settings.Save();
     }
     switch( settings.StartupAction ) {
         case StartupAction.Load:
             LoadProfile( settings.ProfileToLoad, false );
             break;
         case StartupAction.Create:
             CreateProfile();
             break;
     }
     FlushStatus();
 }
示例#3
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // allow mousewheel scrolling for Add Category submenu.  Send 10 UP/DOWN per wheel click.
            contextGame.MouseWheel += HandleMouseWheel;

            // Load saved forms settings
            Settings settings = Settings.Instance;
            this.Location = new Point(settings.X, settings.Y);
            if (!Utility.IsOnScreen(this))
            {
                //TopLeft corner is off screen, so reset location
                this.Location = new Point(0, 0);
            }
            this.Size = new Size(settings.Width, settings.Height);
            this.splitContainer.SplitterDistance = settings.SplitContainer;
            settings.SplitGameContainerHeight = splitGame.Height;
            this.splitGame.SplitterDistance = settings.SplitGame;
            settings.SplitBrowserContainerWidth = splitBrowser.Width;
            this.splitBrowser.SplitterDistance = settings.SplitBrowser;

            ttHelp.Ext_SetToolTip(mchkAdvancedCategories, GlobalStrings.MainForm_Help_AdvancedCategories);

            InitializeObjectListView();

            LoadGameDB();

            // Save original width and height
            originalHeight = this.Height;
            originalWidth = this.Width;
            originalSplitDistanceMain = this.splitContainer.SplitterDistance;
            originalSplitDistanceSecondary = this.splitGame.SplitterDistance;
            originalSplitDistanceBrowser = this.splitBrowser.SplitterDistance;

            ClearStatus();
            if (Settings.Instance.SteamPath == null)
            {
                DlgSteamPath dlg = new DlgSteamPath();
                dlg.ShowDialog();
                Settings.Instance.SteamPath = dlg.Path;
                Settings.Instance.Save();
            }
            if (Settings.Instance.UpdateAppInfoOnStart)
            {
                UpdateGameDBFromAppInfo();
            }
            int threePointFiveDaysInSecs = 84 * 60 * 60;
            if (Settings.Instance.UpdateHltbOnStart && Utility.GetCurrentUTime() > (Program.GameDB.LastHltbUpdate + threePointFiveDaysInSecs))
            {
                UpdateGameDBFromHltb();
            }

            if (Settings.Instance.CheckForDepressurizerUpdates)
            {
                CheckForDepressurizerUpdates();
            }

            switch (Settings.Instance.StartupAction)
            {
                case StartupAction.Load:
                    LoadProfile(Settings.Instance.ProfileToLoad, false);
                    break;
                case StartupAction.Create:
                    CreateProfile();
                    break;
                default:
                    OnProfileChange();
                    break;
            }

            UpdateUIForSingleCat();
            UpdateEnabledStatesForGames();
            UpdateEnabledStatesForCategories();

            FlushStatus();

            if (currentProfile != null)
            {
                // restore previous session
                SelectCategory(settings);
                SelectFilter(settings);
                SelectAutoCats(settings);
            }
        }