Пример #1
0
 public DlgGame( GameData data, Game game = null )
     : this()
 {
     this.Data = data;
     Game = game;
     editMode = Game != null;
 }
Пример #2
0
        public CDlgDataScrape( Queue<int> jobs, GameData data, bool fullGenre )
            : base(GlobalStrings.CDlgScrape_ScrapingGameInfo, true)
        {
            scrapeResults = new Dictionary<int, string>();
            this.data = data;
            this.jobs = jobs;
            this.totalJobs = jobs.Count;

            this.fullGenre = fullGenre;
        }
Пример #3
0
        public FormMain()
        {
            gameData = new GameData();
            InitializeComponent();
            // jpodadera. Changed combo to checkbox to set favorite value
            //combFavorite.SelectedIndex = 0;
            chkFavorite.Checked = false;

            listSorter.AddIntCol( 1 );
            lstGames.ListViewItemSorter = listSorter;
            // jpodadera. Save width of category column
            originalCatColumnWidth = lstGames.Columns[2].Width;
            colCategoryPointer = lstGames.Columns[2];

            FillCategoryList();
        }
Пример #4
0
        public FormMain() {
            gameData = new GameData();
            InitializeComponent();

            chkFavorite.Checked = false;
            chkGroupCategory.Checked = Settings.Instance().GroupView;

            // Set up list sorting
            listSorter.AddIntCol( 0 );
            listSorter.AddRevCol( 3 );
            listSorter.SetSortCol( 1, 1 );
            lstGames.ListViewItemSorter = listSorter;
            lstGames.SetSortIcon( listSorter.GetSortCol(), ( listSorter.GetSortDir() == 1 ) ? SortOrder.Ascending : SortOrder.Descending );

            // jpodadera. Save width of category column
            originalCatColumnWidth = lstGames.Columns[2].Width;
            colCategoryPointer = lstGames.Columns[2];

            FullListRefresh();
        }
        public CDlgUpdateProfile( GameData data, string customUrl, bool overwrite, SortedSet<int> ignore, bool ignoreDlc, bool ignoreExternal )
            : base(GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true)
        {
            custom = true;
            this.customUrl = customUrl;

            Added = 0;
            Fetched = 0;
            UseHtml = false;
            Failover = false;

            this.data = data;

            this.overwrite = overwrite;
            this.ignore = ignore;
            this.ignoreDlc = ignoreDlc;

            //jpodadera. Non-Steam games
            this.ignoreExternal = ignoreExternal;

            SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
        }
Пример #6
0
        /// <summary>
        /// Prompts user to create a new profile.
        /// </summary>
        void CreateProfile()
        {
            DlgProfile dlg = new DlgProfile();
            DialogResult res = dlg.ShowDialog();
            if( res == System.Windows.Forms.DialogResult.OK ) {
                Cursor = Cursors.WaitCursor;
                currentProfile = dlg.Profile;
                gameData = currentProfile.GameData;
                AddStatus(GlobalStrings.MainForm_ProfileCreated);
                if( dlg.DownloadNow ) {
                    UpdateProfileDownload( false );
                }

                if( dlg.ImportNow ) {
                    UpdateProfileImport( false );
                }
                if( dlg.SetStartup ) {
                    settings.StartupAction = StartupAction.Load;
                    settings.ProfileToLoad = currentProfile.FilePath;
                    settings.Save();
                }

                FillCategoryList();
                FillGameList();
                Cursor = Cursors.Default;
            }
            UpdateEnableStatesForProfileChange();
        }
Пример #7
0
 /// <summary>
 /// Gets a category based on a name. Creates the category if necessary. Displays error message on error.
 /// </summary>
 /// <param name="name">Name of the category to get</param>
 /// <param name="data">Game data object we're referencing</param>
 /// <param name="cat">Resulting category</param>
 /// <returns>True if successful, false otherwise</returns>
 public static bool StringToCategory( string name, GameData data, out Category cat )
 {
     cat = null;
     if( string.IsNullOrWhiteSpace( name ) ) {
         return true;
     }
     if( name == CAT_FAV_NAME || name == CAT_ALL_NAME ) {
         MessageBox.Show(string.Format(GlobalStrings.MainForm_CategoryNameReserved, name), GlobalStrings.DBEditDlg_Warning, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return false;
     }
     if( name != CAT_UNC_NAME ) {
         cat = data.GetCategory( name );
     }
     return true;
 }
Пример #8
0
        /// <summary>
        /// Unloads the current profile or game list, making sure the user gets the option to save any changes.
        /// </summary>
        /// <param name="updateUI">If true, will redraw the UI. Otherwise, will leave it up to the caller to do so.</param>
        /// <returns>True if there is now no loaded profile, false otherwise.</returns>
        void Unload( bool updateUI = true )
        {
            if( !CheckForUnsaved() ) {
                return;
            }

            AddStatus(GlobalStrings.MainForm_ClearedData);
            currentProfile = null;
            gameData = new GameData();
            MakeChange( false );
            UpdateEnableStatesForProfileChange();
            if( updateUI ) {
                FillCategoryList();
                FillGameList();
            }
        }
Пример #9
0
        /// <summary>
        /// Loads the given profile file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="checkForChanges"></param>
        void LoadProfile( string path, bool checkForChanges = true )
        {
            if( checkForChanges && !CheckForUnsaved() ) return;

            try {
                currentProfile = Profile.Load( path );
                AddStatus(GlobalStrings.MainForm_ProfileLoaded);
            } catch( ApplicationException e ) {
                MessageBox.Show(e.Message, GlobalStrings.MainForm_ErrorLoadingProfile, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AddStatus(GlobalStrings.MainForm_FailedLoadProfile);
                return;
            }

            gameData = currentProfile.GameData;

            if( currentProfile.AutoDownload ) {
                UpdateProfileDownload();
            }
            if( currentProfile.AutoImport ) {
                UpdateProfileImport();
            }

            FillCategoryList();
            FillGameList();
            UpdateEnableStatesForProfileChange();
        }
Пример #10
0
 /// <summary>
 /// Gets a category based on a name. Creates the category if necessary. Displays error message on error.
 /// </summary>
 /// <param name="name">Name of the category to get</param>
 /// <param name="data">Game data object we're referencing</param>
 /// <param name="cat">Resulting category</param>
 /// <returns>True if successful, false otherwise</returns>
 public static bool StringToCategory( string name, GameData data, out Category cat ) {
     cat = null;
     if( string.IsNullOrWhiteSpace( name ) ) {
         return true;
     }
     if( name != GlobalStrings.MainForm_Uncategorized ) {
         cat = data.GetCategory( name );
     }
     return true;
 }
Пример #11
0
 public int ImportSteamData()
 {
     return(GameData.ImportSteamConfig(SteamID64, IgnoreList, IncludeShortcuts));
 }
Пример #12
0
 public void ExportSteamData()
 {
     GameData.ExportSteamConfig(SteamID64, ExportDiscard, IncludeShortcuts);
 }