├── .gitattributes
├── .gitignore
├── LICENSE.txt
├── README.md
├── readme.txt
└── src
├── Depressurizer.sln
└── Depressurizer
├── AppInfo.cs
├── AutoCat
├── AutoCat.cs
├── AutoCatConfigPanel.cs
├── AutoCatConfigPanel_Curator.Designer.cs
├── AutoCatConfigPanel_Curator.cs
├── AutoCatConfigPanel_Curator.resx
├── AutoCatConfigPanel_DevPub.Designer.cs
├── AutoCatConfigPanel_DevPub.cs
├── AutoCatConfigPanel_DevPub.resx
├── AutoCatConfigPanel_Flags.Designer.cs
├── AutoCatConfigPanel_Flags.cs
├── AutoCatConfigPanel_Flags.resx
├── AutoCatConfigPanel_Genre.Designer.cs
├── AutoCatConfigPanel_Genre.cs
├── AutoCatConfigPanel_Genre.resx
├── AutoCatConfigPanel_Group.Designer.cs
├── AutoCatConfigPanel_Group.cs
├── AutoCatConfigPanel_Group.resx
├── AutoCatConfigPanel_Hltb.Designer.cs
├── AutoCatConfigPanel_Hltb.cs
├── AutoCatConfigPanel_Hltb.resx
├── AutoCatConfigPanel_Language.Designer.cs
├── AutoCatConfigPanel_Language.cs
├── AutoCatConfigPanel_Language.resx
├── AutoCatConfigPanel_Manual.Designer.cs
├── AutoCatConfigPanel_Manual.cs
├── AutoCatConfigPanel_Manual.resx
├── AutoCatConfigPanel_Name.Designer.cs
├── AutoCatConfigPanel_Name.cs
├── AutoCatConfigPanel_Name.resx
├── AutoCatConfigPanel_Platform.Designer.cs
├── AutoCatConfigPanel_Platform.cs
├── AutoCatConfigPanel_Platform.resx
├── AutoCatConfigPanel_Tags.Designer.cs
├── AutoCatConfigPanel_Tags.cs
├── AutoCatConfigPanel_Tags.resx
├── AutoCatConfigPanel_UserScore.Designer.cs
├── AutoCatConfigPanel_UserScore.cs
├── AutoCatConfigPanel_UserScore.resx
├── AutoCatConfigPanel_VRSupport.Designer.cs
├── AutoCatConfigPanel_VRSupport.cs
├── AutoCatConfigPanel_VRSupport.resx
├── AutoCatConfigPanel_Year.Designer.cs
├── AutoCatConfigPanel_Year.cs
├── AutoCatConfigPanel_Year.resx
├── AutoCatCurator.cs
├── AutoCatDevPub.cs
├── AutoCatFlags.cs
├── AutoCatGenre.cs
├── AutoCatGroup.cs
├── AutoCatHltb.cs
├── AutoCatLanguage.cs
├── AutoCatManual.cs
├── AutoCatName.cs
├── AutoCatPlatform.cs
├── AutoCatTags.cs
├── AutoCatUserScore.cs
├── AutoCatVrSupport.cs
├── AutoCatYear.cs
└── CDlgCurator.cs
├── AutomaticModeForm.Designer.cs
├── AutomaticModeForm.cs
├── AutomaticModeForm.resx
├── CDlgGetSteamID.cs
├── CDlgHltb.cs
├── CDlgUpdateProfile.cs
├── DBEdit
├── CDlgFetch.cs
├── CDlgScrape.cs
├── DBEditDlg.Designer.cs
├── DBEditDlg.cs
├── DBEditDlg.es.resx
├── DBEditDlg.resx
├── DBEditDlg.ru.resx
├── DBEditDlg.uk.resx
├── DlgGameDBEntry.Designer.cs
├── DlgGameDBEntry.cs
├── DlgGameDBEntry.es.resx
├── DlgGameDBEntry.resx
├── DlgGameDBEntry.ru.resx
└── DlgGameDBEntry.uk.resx
├── Depressurizer.csproj
├── Depressurizer.csproj.DotSettings
├── DlgAbout.Designer.cs
├── DlgAbout.cs
├── DlgAbout.resx
├── DlgAutoCat.Designer.cs
├── DlgAutoCat.cs
├── DlgAutoCat.resx
├── DlgAutoCatCreate.Designer.cs
├── DlgAutoCatCreate.cs
├── DlgAutoCatCreate.resx
├── DlgAutoCatSelect.Designer.cs
├── DlgAutoCatSelect.cs
├── DlgAutoCatSelect.resx
├── DlgAutomaticModeHelper.Designer.cs
├── DlgAutomaticModeHelper.cs
├── DlgAutomaticModeHelper.nl.resx
├── DlgAutomaticModeHelper.resx
├── DlgAutomaticModeHelper.ru.resx
├── DlgAutomaticModeHelper.uk.resx
├── DlgClose.Designer.cs
├── DlgClose.cs
├── DlgClose.es.resx
├── DlgClose.nl.resx
├── DlgClose.resx
├── DlgClose.ru.resx
├── DlgClose.uk.resx
├── DlgGame.Designer.cs
├── DlgGame.cs
├── DlgGame.es.resx
├── DlgGame.nl.resx
├── DlgGame.resx
├── DlgGame.ru.resx
├── DlgGame.uk.resx
├── DlgManualDownload.Designer.cs
├── DlgManualDownload.cs
├── DlgManualDownload.es.resx
├── DlgManualDownload.nl.resx
├── DlgManualDownload.resx
├── DlgManualDownload.ru.resx
├── DlgManualDownload.uk.resx
├── DlgOptions.Designer.cs
├── DlgOptions.cs
├── DlgOptions.es.resx
├── DlgOptions.nl.resx
├── DlgOptions.resx
├── DlgOptions.ru.resx
├── DlgOptions.uk.resx
├── DlgProfile.Designer.cs
├── DlgProfile.cs
├── DlgProfile.es.resx
├── DlgProfile.nl.resx
├── DlgProfile.resx
├── DlgProfile.ru.resx
├── DlgProfile.uk.resx
├── DlgRestore.Designer.cs
├── DlgRestore.cs
├── DlgRestore.es.resx
├── DlgRestore.nl.resx
├── DlgRestore.resx
├── DlgRestore.ru.resx
├── DlgRestore.uk.resx
├── DlgSteamPath.Designer.cs
├── DlgSteamPath.cs
├── DlgSteamPath.es.resx
├── DlgSteamPath.nl.resx
├── DlgSteamPath.resx
├── DlgSteamPath.ru.resx
├── DlgSteamPath.uk.resx
├── Filter.cs
├── FodyWeavers.xml
├── GameBanners.cs
├── GameDB.cs
├── GameData.cs
├── GlobalStrings.Designer.cs
├── GlobalStrings.es.Designer.cs
├── GlobalStrings.es.resx
├── GlobalStrings.nl.Designer.cs
├── GlobalStrings.nl.resx
├── GlobalStrings.resx
├── GlobalStrings.ru.resx
├── GlobalStrings.uk.resx
├── Lib
├── AppLogger.cs
├── AppSettings.cs
├── CancelableDlg.Designer.cs
├── CancelableDlg.cs
├── CancelableDlg.es.resx
├── CancelableDlg.resx
├── CancelableDlg.ru.resx
├── CancelableDlg.uk.resx
├── DlgFatalError.cs
├── DlgFatalError.designer.cs
├── DlgFatalError.es.resx
├── DlgFatalError.resx
├── DlgFatalError.ru.resx
├── DlgFatalError.uk.resx
├── DlgGetString.Designer.cs
├── DlgGetString.cs
├── DlgGetString.es.resx
├── DlgGetString.resx
├── DlgGetString.ru.resx
├── DlgGetString.uk.resx
├── ExtListView.cs
├── ExtToolTip.cs
├── MultiColumnListViewComparer.cs
├── Options.cs
└── XmlUtil.cs
├── ListViewComparer.cs
├── MainForm.Designer.cs
├── MainForm.cs
├── MainForm.es.resx
├── MainForm.nl.resx
├── MainForm.resx
├── MainForm.ru.resx
├── MainForm.uk.resx
├── OLD prgm2.ico
├── PackageInfo.cs
├── Profile.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Resources.ru.resx
├── Resources.uk.resx
└── app.manifest
├── Settings.cs
├── Utility.cs
├── VdfFile
└── VdfFileNode.cs
├── app.config
├── depressurizer_icon.ico
├── packages.config
└── res
├── early_access_banner_english.png
├── early_access_banner_russian.png
├── early_access_banner_spanish.png
├── filterAll.png
├── filterAny.png
├── filterNone.png
├── tscbChecked.png
├── tscbIndeterminate.png
└── tscbUnchecked.png
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 | *.vcxproj.filters
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # .NET Core
47 | project.lock.json
48 | project.fragment.lock.json
49 | artifacts/
50 | **/Properties/launchSettings.json
51 |
52 | *_i.c
53 | *_p.c
54 | *_i.h
55 | *.ilk
56 | *.meta
57 | *.obj
58 | *.pch
59 | *.pdb
60 | *.pgc
61 | *.pgd
62 | *.rsp
63 | *.sbr
64 | *.tlb
65 | *.tli
66 | *.tlh
67 | *.tmp
68 | *.tmp_proj
69 | *.log
70 | *.vspscc
71 | *.vssscc
72 | .builds
73 | *.pidb
74 | *.svclog
75 | *.scc
76 |
77 | # Chutzpah Test files
78 | _Chutzpah*
79 |
80 | # Visual C++ cache files
81 | ipch/
82 | *.aps
83 | *.ncb
84 | *.opendb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 | *.VC.db
89 | *.VC.VC.opendb
90 |
91 | # Visual Studio profiler
92 | *.psess
93 | *.vsp
94 | *.vspx
95 | *.sap
96 |
97 | # TFS 2012 Local Workspace
98 | $tf/
99 |
100 | # Guidance Automation Toolkit
101 | *.gpState
102 |
103 | # ReSharper is a .NET coding add-in
104 | _ReSharper*/
105 | *.[Rr]e[Ss]harper
106 | *.DotSettings.user
107 |
108 | # JustCode is a .NET coding add-in
109 | .JustCode
110 |
111 | # TeamCity is a build add-in
112 | _TeamCity*
113 |
114 | # DotCover is a Code Coverage Tool
115 | *.dotCover
116 |
117 | # Visual Studio code coverage results
118 | *.coverage
119 | *.coveragexml
120 |
121 | # NCrunch
122 | _NCrunch_*
123 | .*crunch*.local.xml
124 | nCrunchTemp_*
125 |
126 | # MightyMoose
127 | *.mm.*
128 | AutoTest.Net/
129 |
130 | # Web workbench (sass)
131 | .sass-cache/
132 |
133 | # Installshield output folder
134 | [Ee]xpress/
135 |
136 | # DocProject is a documentation generator add-in
137 | DocProject/buildhelp/
138 | DocProject/Help/*.HxT
139 | DocProject/Help/*.HxC
140 | DocProject/Help/*.hhc
141 | DocProject/Help/*.hhk
142 | DocProject/Help/*.hhp
143 | DocProject/Help/Html2
144 | DocProject/Help/html
145 |
146 | # Click-Once directory
147 | publish/
148 |
149 | # Publish Web Output
150 | *.[Pp]ublish.xml
151 | *.azurePubxml
152 | # TODO: Comment the next line if you want to checkin your web deploy settings
153 | # but database connection strings (with potential passwords) will be unencrypted
154 | *.pubxml
155 | *.publishproj
156 |
157 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
158 | # checkin your Azure Web App publish settings, but sensitive information contained
159 | # in these scripts will be unencrypted
160 | PublishScripts/
161 |
162 | # NuGet Packages
163 | *.nupkg
164 | # The packages folder can be ignored because of Package Restore
165 | **/packages/*
166 | # except build/, which is used as an MSBuild target.
167 | !**/packages/build/
168 | # Uncomment if necessary however generally it will be regenerated when needed
169 | #!**/packages/repositories.config
170 | # NuGet v3's project.json files produces more ignoreable files
171 | *.nuget.props
172 | *.nuget.targets
173 |
174 | # Microsoft Azure Build Output
175 | csx/
176 | *.build.csdef
177 |
178 | # Microsoft Azure Emulator
179 | ecf/
180 | rcf/
181 |
182 | # Windows Store app package directories and files
183 | AppPackages/
184 | BundleArtifacts/
185 | Package.StoreAssociation.xml
186 | _pkginfo.txt
187 |
188 | # Visual Studio cache files
189 | # files ending in .cache can be ignored
190 | *.[Cc]ache
191 | # but keep track of directories ending in .cache
192 | !*.[Cc]ache/
193 |
194 | # Others
195 | ClientBin/
196 | ~$*
197 | *~
198 | *.dbmdl
199 | *.dbproj.schemaview
200 | *.jfm
201 | *.pfx
202 | *.publishsettings
203 | node_modules/
204 | orleans.codegen.cs
205 |
206 | # Since there are multiple workflows, uncomment next line to ignore bower_components
207 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
208 | #bower_components/
209 |
210 | # RIA/Silverlight projects
211 | Generated_Code/
212 |
213 | # Backup & report files from converting an old project file
214 | # to a newer Visual Studio version. Backup files are not needed,
215 | # because we have git ;-)
216 | _UpgradeReport_Files/
217 | Backup*/
218 | UpgradeLog*.XML
219 | UpgradeLog*.htm
220 |
221 | # SQL Server files
222 | *.mdf
223 | *.ldf
224 |
225 | # Business Intelligence projects
226 | *.rdl.data
227 | *.bim.layout
228 | *.bim_*.settings
229 |
230 | # Microsoft Fakes
231 | FakesAssemblies/
232 |
233 | # GhostDoc plugin setting file
234 | *.GhostDoc.xml
235 |
236 | # Node.js Tools for Visual Studio
237 | .ntvs_analysis.dat
238 |
239 | # Visual Studio 6 build log
240 | *.plg
241 |
242 | # Visual Studio 6 workspace options file
243 | *.opt
244 |
245 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
246 | *.vbw
247 |
248 | # Visual Studio LightSwitch build output
249 | **/*.HTMLClient/GeneratedArtifacts
250 | **/*.DesktopClient/GeneratedArtifacts
251 | **/*.DesktopClient/ModelManifest.xml
252 | **/*.Server/GeneratedArtifacts
253 | **/*.Server/ModelManifest.xml
254 | _Pvt_Extensions
255 |
256 | # Paket dependency manager
257 | .paket/paket.exe
258 | paket-files/
259 |
260 | # FAKE - F# Make
261 | .fake/
262 |
263 | # JetBrains Rider
264 | .idea/
265 | *.sln.iml
266 |
267 | # CodeRush
268 | .cr/
269 |
270 | # Python Tools for Visual Studio (PTVS)
271 | __pycache__/
272 | *.pyc
273 |
274 | # Cake - Uncomment if you are using it
275 | # tools/
276 |
--------------------------------------------------------------------------------
/src/Depressurizer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Depressurizer", "Depressurizer\Depressurizer.csproj", "{9E36EFA4-82E9-44B8-ABCE-BD73B8A6CD21}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x86 = Debug|x86
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9E36EFA4-82E9-44B8-ABCE-BD73B8A6CD21}.Debug|x86.ActiveCfg = Debug|x86
15 | {9E36EFA4-82E9-44B8-ABCE-BD73B8A6CD21}.Debug|x86.Build.0 = Debug|x86
16 | {9E36EFA4-82E9-44B8-ABCE-BD73B8A6CD21}.Release|x86.ActiveCfg = Release|x86
17 | {9E36EFA4-82E9-44B8-ABCE-BD73B8A6CD21}.Release|x86.Build.0 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.ComponentModel;
22 | using System.Windows.Forms;
23 |
24 | namespace Depressurizer
25 | {
26 | [TypeDescriptionProvider(typeof(InstantiableClassProvider))]
27 | public class AutoCatConfigPanel : UserControl
28 | {
29 | public virtual void SaveToAutoCat(AutoCat ac) { }
30 |
31 | public virtual void LoadFromAutoCat(AutoCat ac) { }
32 |
33 | public static AutoCatConfigPanel CreatePanel(AutoCat ac, GameList ownedGames, List autocats)
34 | {
35 | AutoCatType t = ac.AutoCatType;
36 | switch (t)
37 | {
38 | case AutoCatType.Genre:
39 | return new AutoCatConfigPanel_Genre();
40 | case AutoCatType.Flags:
41 | return new AutoCatConfigPanel_Flags();
42 | case AutoCatType.Tags:
43 | return new AutoCatConfigPanel_Tags(ownedGames);
44 | case AutoCatType.Year:
45 | return new AutoCatConfigPanel_Year();
46 | case AutoCatType.UserScore:
47 | return new AutoCatConfigPanel_UserScore();
48 | case AutoCatType.Hltb:
49 | return new AutoCatConfigPanel_Hltb();
50 | case AutoCatType.Manual:
51 | return new AutoCatConfigPanel_Manual(ownedGames);
52 | case AutoCatType.DevPub:
53 | return new AutoCatConfigPanel_DevPub(ownedGames);
54 | case AutoCatType.Group:
55 | return new AutoCatConfigPanel_Group(autocats);
56 | case AutoCatType.Name:
57 | return new AutoCatConfigPanel_Name();
58 | case AutoCatType.VrSupport:
59 | return new AutoCatConfigPanel_VrSupport();
60 | case AutoCatType.Language:
61 | return new AutoCatConfigPanel_Language();
62 | case AutoCatType.Curator:
63 | return new AutoCatConfigPanel_Curator();
64 | case AutoCatType.Platform:
65 | return new AutoCatConfigPanel_Platform();
66 | default:
67 | return null;
68 | }
69 | }
70 | }
71 |
72 | internal class InstantiableClassProvider : TypeDescriptionProvider
73 | {
74 | public InstantiableClassProvider() : base(TypeDescriptor.GetProvider(typeof(TAbstract))) { }
75 |
76 | public override Type GetReflectionType(Type objectType, object instance)
77 | {
78 | if (objectType == typeof(TAbstract))
79 | {
80 | return typeof(TInstantiable);
81 | }
82 | return base.GetReflectionType(objectType, instance);
83 | }
84 |
85 | public override object CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes,
86 | object[] args)
87 | {
88 | if (objectType == typeof(TAbstract))
89 | {
90 | objectType = typeof(TInstantiable);
91 | }
92 | return base.CreateInstance(provider, objectType, argTypes, args);
93 | }
94 | }
95 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Curator.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Original Work Copyright 2011, 2012, 2013 Steve Labbe.
4 | Modified Work Copyright 2017 Theodoros Dimos.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Windows.Forms;
23 |
24 | namespace Depressurizer
25 | {
26 | public partial class AutoCatConfigPanel_Curator : AutoCatConfigPanel
27 | {
28 | public AutoCatConfigPanel_Curator()
29 | {
30 | InitializeComponent();
31 |
32 | // Set up help tooltips
33 | ttHelp.Ext_SetToolTip(helpCategoryName, GlobalStrings.AutoCatCurator_Help_CategoryName);
34 | ttHelp.Ext_SetToolTip(helpCuratorUrl, "e.g http://store.steampowered.com/curator/6090344-depressurizer/");
35 |
36 | FillRecommendationsList();
37 | }
38 |
39 | public void FillRecommendationsList()
40 | {
41 | lstIncluded.Items.Clear();
42 | lstIncluded.Items.Add(Utility.GetEnumDescription(CuratorRecommendation.Recommended));
43 | lstIncluded.Items[0].Tag = Enum.GetName(typeof(CuratorRecommendation), CuratorRecommendation.Recommended);
44 | lstIncluded.Items.Add(Utility.GetEnumDescription(CuratorRecommendation.NotRecommended));
45 | lstIncluded.Items[1].Tag = Enum.GetName(typeof(CuratorRecommendation), CuratorRecommendation.NotRecommended);
46 | lstIncluded.Items.Add(Utility.GetEnumDescription(CuratorRecommendation.Informational));
47 | lstIncluded.Items[2].Tag = Enum.GetName(typeof(CuratorRecommendation), CuratorRecommendation.Informational);
48 | }
49 |
50 | public override void LoadFromAutoCat(AutoCat autocat)
51 | {
52 | AutoCatCurator ac = autocat as AutoCatCurator;
53 | if (ac == null)
54 | {
55 | return;
56 | }
57 |
58 | txtCategoryName.Text = ac.CategoryName;
59 | txtCuratorUrl.Text = ac.CuratorUrl;
60 |
61 | foreach (CuratorRecommendation rec in ac.IncludedRecommendations)
62 | {
63 | lstIncluded.Items[rec.GetHashCode()-1].Checked = true;
64 | }
65 | }
66 |
67 | public override void SaveToAutoCat(AutoCat autocat)
68 | {
69 | AutoCatCurator ac = autocat as AutoCatCurator;
70 | if (ac == null)
71 | {
72 | return;
73 | }
74 |
75 | ac.CategoryName = txtCategoryName.Text;
76 | ac.CuratorUrl = txtCuratorUrl.Text;
77 |
78 | ac.IncludedRecommendations.Clear();
79 | foreach (ListViewItem i in lstIncluded.Items)
80 | {
81 | if (i.Checked)
82 | {
83 | ac.IncludedRecommendations.Add((CuratorRecommendation)Enum.Parse(typeof(CuratorRecommendation), i.Tag.ToString()));
84 | }
85 | }
86 | }
87 |
88 | private void SetAllListCheckStates(ListView list, bool to)
89 | {
90 | foreach (ListViewItem item in list.Items)
91 | {
92 | item.Checked = to;
93 | }
94 | }
95 |
96 | private void cmdCheckAll_Click(object sender, EventArgs e)
97 | {
98 | SetAllListCheckStates(lstIncluded, true);
99 | }
100 |
101 | private void cmdUncheckAll_Click(object sender, EventArgs e)
102 | {
103 | SetAllListCheckStates(lstIncluded, false);
104 | }
105 | }
106 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Flags.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class AutoCatConfigPanel_Flags : AutoCatConfigPanel
26 | {
27 | public AutoCatConfigPanel_Flags()
28 | {
29 | InitializeComponent();
30 |
31 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
32 |
33 | FillFlagsList();
34 | }
35 |
36 | public void FillFlagsList()
37 | {
38 | lstIncluded.Items.Clear();
39 |
40 | if (Program.GameDB != null)
41 | {
42 | SortedSet flagsList = Program.GameDB.GetAllStoreFlags();
43 |
44 | foreach (string s in flagsList)
45 | {
46 | lstIncluded.Items.Add(s);
47 | }
48 | }
49 | }
50 |
51 | public override void LoadFromAutoCat(AutoCat autocat)
52 | {
53 | AutoCatFlags ac = autocat as AutoCatFlags;
54 | if (ac == null) return;
55 |
56 | txtPrefix.Text = ac.Prefix;
57 |
58 | foreach (ListViewItem item in lstIncluded.Items)
59 | {
60 | item.Checked = ac.IncludedFlags.Contains(item.Text);
61 | }
62 | }
63 |
64 | public override void SaveToAutoCat(AutoCat autocat)
65 | {
66 | AutoCatFlags ac = autocat as AutoCatFlags;
67 | if (ac == null) return;
68 | ac.Prefix = txtPrefix.Text;
69 |
70 | ac.IncludedFlags.Clear();
71 | foreach (ListViewItem i in lstIncluded.Items)
72 | {
73 | if (i.Checked)
74 | {
75 | ac.IncludedFlags.Add(i.Text);
76 | }
77 | }
78 | }
79 |
80 | private void SetAllListCheckStates(ListView list, bool to)
81 | {
82 | foreach (ListViewItem item in list.Items)
83 | {
84 | item.Checked = to;
85 | }
86 | }
87 |
88 | private void cmdCheckAll_Click(object sender, EventArgs e)
89 | {
90 | SetAllListCheckStates(lstIncluded, true);
91 | }
92 |
93 | private void cmdUncheckAll_Click(object sender, EventArgs e)
94 | {
95 | SetAllListCheckStates(lstIncluded, false);
96 | }
97 | }
98 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Genre.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class AutoCatConfigPanel_Genre : AutoCatConfigPanel
26 | {
27 | public AutoCatConfigPanel_Genre()
28 | {
29 | InitializeComponent();
30 |
31 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
32 | ttHelp.Ext_SetToolTip(helpRemoveExisting, GlobalStrings.DlgAutoCat_Help_Genre_RemoveExisting);
33 | ttHelp.Ext_SetToolTip(helpTagFallback, GlobalStrings.AutoCatGenrePanel_Help_TagFallback);
34 |
35 | FillGenreList();
36 | }
37 |
38 | public void FillGenreList()
39 | {
40 | lstIgnore.Items.Clear();
41 |
42 | if (Program.GameDB != null)
43 | {
44 | SortedSet genreList = Program.GameDB.GetAllGenres();
45 |
46 | foreach (string s in genreList)
47 | {
48 | ListViewItem l = new ListViewItem();
49 | l.Text = s;
50 | l.Checked = true;
51 | lstIgnore.Items.Add(l);
52 | }
53 | }
54 | }
55 |
56 | public override void LoadFromAutoCat(AutoCat autocat)
57 | {
58 | AutoCatGenre ac = autocat as AutoCatGenre;
59 | if (ac == null) return;
60 | chkRemoveExisting.Checked = ac.RemoveOtherGenres;
61 | chkTagFallback.Checked = ac.TagFallback;
62 | numMaxCats.Value = ac.MaxCategories;
63 | txtPrefix.Text = ac.Prefix;
64 |
65 | foreach (ListViewItem item in lstIgnore.Items)
66 | {
67 | item.Checked = !ac.IgnoredGenres.Contains(item.Text);
68 | }
69 | }
70 |
71 | public override void SaveToAutoCat(AutoCat autocat)
72 | {
73 | AutoCatGenre ac = autocat as AutoCatGenre;
74 | if (ac == null) return;
75 | ac.Prefix = txtPrefix.Text;
76 | ac.MaxCategories = (int) numMaxCats.Value;
77 | ac.RemoveOtherGenres = chkRemoveExisting.Checked;
78 | ac.TagFallback = chkTagFallback.Checked;
79 |
80 | ac.IgnoredGenres.Clear();
81 | foreach (ListViewItem i in lstIgnore.Items)
82 | {
83 | if (!i.Checked)
84 | {
85 | ac.IgnoredGenres.Add(i.Text);
86 | }
87 | }
88 | }
89 |
90 | private void SetAllListCheckStates(ListView list, bool to)
91 | {
92 | foreach (ListViewItem item in list.Items)
93 | {
94 | item.Checked = to;
95 | }
96 | }
97 |
98 | private void cmdCheckAll_Click(object sender, EventArgs e)
99 | {
100 | SetAllListCheckStates(lstIgnore, true);
101 | }
102 |
103 | private void cmdUncheckAll_Click(object sender, EventArgs e)
104 | {
105 | SetAllListCheckStates(lstIgnore, false);
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Group.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class AutoCatConfigPanel_Group : AutoCatConfigPanel
26 | {
27 | //private List stringAutocats;
28 | private List Autocats;
29 |
30 | private AutoCat current;
31 |
32 | public AutoCatConfigPanel_Group(List autocats)
33 | {
34 | InitializeComponent();
35 |
36 | Autocats = autocats;
37 | }
38 |
39 | #region Data modifiers
40 |
41 | public override void LoadFromAutoCat(AutoCat autocat)
42 | {
43 | AutoCatGroup ac = autocat as AutoCatGroup;
44 | current = autocat;
45 | if (ac == null) return;
46 | FillAutocatList(ac.Autocats);
47 | }
48 |
49 | public override void SaveToAutoCat(AutoCat autocat)
50 | {
51 | AutoCatGroup ac = autocat as AutoCatGroup;
52 | if (ac == null) return;
53 | ac.Autocats = GetGroup();
54 | }
55 |
56 | #endregion
57 |
58 | #region Event Handlers
59 |
60 | private void btnUp_Click(object sender, EventArgs e)
61 | {
62 | Utility.MoveItem(lbAutocats, -1);
63 | }
64 |
65 | private void btnDown_Click(object sender, EventArgs e)
66 | {
67 | Utility.MoveItem(lbAutocats, 1);
68 | }
69 |
70 | private void btnAdd_Click(object sender, EventArgs e)
71 | {
72 | DlgAutoCatSelect dlg = new DlgAutoCatSelect(Autocats, current.Name);
73 |
74 | DialogResult res = dlg.ShowDialog();
75 |
76 | if (res == DialogResult.OK)
77 | {
78 | foreach (AutoCat ac in dlg.AutoCatList)
79 | {
80 | if (ac.Selected && !InGroup(ac.Name))
81 | {
82 | lbAutocats.Items.Add(ac.Name);
83 | }
84 | }
85 | }
86 | }
87 |
88 | private void btnRemove_Click(object sender, EventArgs e)
89 | {
90 | if (lbAutocats.SelectedItems.Count > 1)
91 | {
92 | foreach (string s in lbAutocats.SelectedItems)
93 | {
94 | lbAutocats.Items.Remove(s);
95 | }
96 | }
97 | else if (lbAutocats.SelectedItem != null)
98 | {
99 | lbAutocats.Items.Remove(lbAutocats.SelectedItem);
100 | }
101 | }
102 |
103 | private void lbAutocats_SelectedIndexChanged(object sender, EventArgs e)
104 | {
105 | if (lbAutocats.SelectedItems.Count > 1)
106 | {
107 | btnRemove.Enabled = true;
108 | btnUp.Enabled = false;
109 | btnDown.Enabled = false;
110 | }
111 | else if (lbAutocats.SelectedItem != null)
112 | {
113 | btnRemove.Enabled = true;
114 | btnUp.Enabled = (lbAutocats.SelectedIndex == 0) ? false : true;
115 | btnDown.Enabled = (lbAutocats.SelectedIndex == (lbAutocats.Items.Count - 1)) ? false : true;
116 | }
117 | else
118 | {
119 | btnRemove.Enabled = false;
120 | btnUp.Enabled = false;
121 | btnDown.Enabled = false;
122 | }
123 | }
124 |
125 | #endregion
126 |
127 | #region UI Updaters
128 |
129 | private void FillAutocatList(List group)
130 | {
131 | if (group != null)
132 | lbAutocats.Items.Clear();
133 | {
134 | foreach (string name in group)
135 | {
136 | lbAutocats.Items.Add(name);
137 | }
138 | }
139 | }
140 |
141 | #endregion
142 |
143 | #region Utility
144 |
145 | private bool InGroup(string find)
146 | {
147 | foreach (string name in lbAutocats.Items)
148 | {
149 | if (name == find) return true;
150 | }
151 | return false;
152 | }
153 |
154 | public List GetGroup()
155 | {
156 | List group = new List();
157 | foreach (string name in lbAutocats.Items)
158 | {
159 | group.Add(name);
160 | }
161 | return group;
162 | }
163 |
164 | #endregion
165 | }
166 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Language.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Original work Copyright 2011, 2012, 2013 Steve Labbe.
4 | Modified work Copyright 2017 Theodoros Dimos.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 |
20 | using System;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class AutoCatConfigPanel_Language : AutoCatConfigPanel
26 | {
27 | public AutoCatConfigPanel_Language()
28 | {
29 | InitializeComponent();
30 |
31 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
32 |
33 | FillLanguageLists();
34 | }
35 |
36 | public void FillLanguageLists()
37 | {
38 | lstInterface.Items.Clear();
39 | lstSubtitles.Items.Clear();
40 | lstFullAudio.Items.Clear();
41 |
42 | if (Program.GameDB != null)
43 | {
44 | LanguageSupport language = Program.GameDB.GetAllLanguages();
45 |
46 | foreach (string s in language.Interface)
47 | {
48 | lstInterface.Items.Add(s);
49 | }
50 |
51 | foreach (string s in language.Subtitles)
52 | {
53 | lstSubtitles.Items.Add(s);
54 | }
55 |
56 | foreach (string s in language.FullAudio)
57 | {
58 | lstFullAudio.Items.Add(s);
59 | }
60 | }
61 | }
62 |
63 | public override void LoadFromAutoCat(AutoCat autocat)
64 | {
65 | AutoCatLanguage ac = autocat as AutoCatLanguage;
66 | if (ac == null)
67 | {
68 | return;
69 | }
70 |
71 | txtPrefix.Text = ac.Prefix;
72 |
73 | chkIncludeTypePrefix.Checked = ac.IncludeTypePrefix;
74 | chkTypeFallback.Checked = ac.TypeFallback;
75 |
76 | foreach (ListViewItem item in lstInterface.Items)
77 | {
78 | item.Checked = ac.IncludedLanguages.Interface.Contains(item.Text);
79 | }
80 |
81 | foreach (ListViewItem item in lstSubtitles.Items)
82 | {
83 | item.Checked = ac.IncludedLanguages.Subtitles.Contains(item.Text);
84 | }
85 |
86 | foreach (ListViewItem item in lstFullAudio.Items)
87 | {
88 | item.Checked = ac.IncludedLanguages.FullAudio.Contains(item.Text);
89 | }
90 | }
91 |
92 | public override void SaveToAutoCat(AutoCat autocat)
93 | {
94 | AutoCatLanguage ac = autocat as AutoCatLanguage;
95 | if (ac == null)
96 | {
97 | return;
98 | }
99 |
100 | ac.Prefix = txtPrefix.Text;
101 |
102 | ac.IncludeTypePrefix = chkIncludeTypePrefix.Checked;
103 | ac.TypeFallback = chkTypeFallback.Checked;
104 |
105 | ac.IncludedLanguages.Interface.Clear();
106 | ac.IncludedLanguages.Subtitles.Clear();
107 | ac.IncludedLanguages.FullAudio.Clear();
108 |
109 | foreach (ListViewItem i in lstInterface.Items)
110 | {
111 | if (i.Checked)
112 | {
113 | ac.IncludedLanguages.Interface.Add(i.Text);
114 | }
115 | }
116 |
117 | foreach (ListViewItem i in lstSubtitles.Items)
118 | {
119 | if (i.Checked)
120 | {
121 | ac.IncludedLanguages.Subtitles.Add(i.Text);
122 | }
123 | }
124 |
125 | foreach (ListViewItem i in lstFullAudio.Items)
126 | {
127 | if (i.Checked)
128 | {
129 | ac.IncludedLanguages.FullAudio.Add(i.Text);
130 | }
131 | }
132 | }
133 |
134 | private void SetAllListCheckStates(ListView list, bool to)
135 | {
136 | foreach (ListViewItem item in list.Items)
137 | {
138 | item.Checked = to;
139 | }
140 | }
141 |
142 | private void cmdCheckAll_Click(object sender, EventArgs e)
143 | {
144 | SetAllListCheckStates(lstInterface, true);
145 | SetAllListCheckStates(lstSubtitles, true);
146 | SetAllListCheckStates(lstFullAudio, true);
147 | }
148 |
149 | private void cmdUncheckAll_Click(object sender, EventArgs e)
150 | {
151 | SetAllListCheckStates(lstInterface, false);
152 | SetAllListCheckStates(lstSubtitles, false);
153 | SetAllListCheckStates(lstFullAudio, false);
154 | }
155 | }
156 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Name.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | namespace Depressurizer
20 | {
21 | public partial class AutoCatConfigPanel_Name : AutoCatConfigPanel
22 | {
23 | public AutoCatConfigPanel_Name()
24 | {
25 | InitializeComponent();
26 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
27 | }
28 |
29 | public override void LoadFromAutoCat(AutoCat ac)
30 | {
31 | AutoCatName acName = ac as AutoCatName;
32 | if (acName == null) return;
33 | txtPrefix.Text = (acName.Prefix == null) ? string.Empty : acName.Prefix;
34 | cbSkipThe.Checked = acName.SkipThe;
35 | cbGroupNumbers.Checked = acName.GroupNumbers;
36 | chkgroupNonEnglishCharacters.Checked = acName.GroupNonEnglishCharacters;
37 | txtGroupNonEnglishCharactersText.Text = acName.GroupNonEnglishCharactersText;
38 | }
39 |
40 | public override void SaveToAutoCat(AutoCat autocat)
41 | {
42 | AutoCatName ac = autocat as AutoCatName;
43 | if (ac == null) return;
44 | ac.Prefix = txtPrefix.Text;
45 | ac.GroupNumbers = cbGroupNumbers.Checked;
46 | ac.SkipThe = cbSkipThe.Checked;
47 | ac.GroupNonEnglishCharacters = chkgroupNonEnglishCharacters.Checked;
48 | ac.GroupNonEnglishCharactersText = txtGroupNonEnglishCharactersText.Text;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Platform.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 |
21 | namespace Depressurizer
22 | {
23 | public partial class AutoCatConfigPanel_Platform : AutoCatConfigPanel
24 | {
25 | public AutoCatConfigPanel_Platform()
26 | {
27 | InitializeComponent();
28 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
29 | }
30 |
31 | public override void LoadFromAutoCat(AutoCat ac)
32 | {
33 | AutoCatPlatform acPlatform = ac as AutoCatPlatform;
34 | if (acPlatform == null) return;
35 | txtPrefix.Text = acPlatform.Prefix == null ? string.Empty : acPlatform.Prefix;
36 | chkboxPlatforms.SetItemChecked(0, acPlatform.Windows);
37 | chkboxPlatforms.SetItemChecked(1, acPlatform.Mac);
38 | chkboxPlatforms.SetItemChecked(2, acPlatform.Linux);
39 | chkboxPlatforms.SetItemChecked(3, acPlatform.SteamOS);
40 | }
41 |
42 | public override void SaveToAutoCat(AutoCat autocat)
43 | {
44 | AutoCatPlatform ac = autocat as AutoCatPlatform;
45 | if (ac == null) return;
46 | ac.Prefix = txtPrefix.Text;
47 | ac.Windows = chkboxPlatforms.GetItemChecked(0);
48 | ac.Mac = chkboxPlatforms.GetItemChecked(1);
49 | ac.Linux = chkboxPlatforms.GetItemChecked(2);
50 | ac.SteamOS = chkboxPlatforms.GetItemChecked(3);
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_VRSupport.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Original work Copyright 2011, 2012, 2013 Steve Labbe.
4 | Modified work Copyright 2017 Theodoros Dimos.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 |
20 | using System;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class AutoCatConfigPanel_VrSupport : AutoCatConfigPanel
26 | {
27 | public AutoCatConfigPanel_VrSupport()
28 | {
29 | InitializeComponent();
30 |
31 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
32 |
33 | FillVrSupportLists();
34 | }
35 |
36 | public void FillVrSupportLists()
37 | {
38 | lstVrHeadsets.Items.Clear();
39 | lstVrInput.Items.Clear();
40 | lstVrPlayArea.Items.Clear();
41 |
42 | if (Program.GameDB != null)
43 | {
44 | VrSupport vrSupport = Program.GameDB.GetAllVrSupportFlags();
45 |
46 | foreach (string s in vrSupport.Headsets)
47 | {
48 | lstVrHeadsets.Items.Add(s);
49 | }
50 |
51 | foreach (string s in vrSupport.Input)
52 | {
53 | lstVrInput.Items.Add(s);
54 | }
55 |
56 | foreach (string s in vrSupport.PlayArea)
57 | {
58 | lstVrPlayArea.Items.Add(s);
59 | }
60 | }
61 | }
62 |
63 | public override void LoadFromAutoCat(AutoCat autocat)
64 | {
65 | AutoCatVrSupport ac = autocat as AutoCatVrSupport;
66 | if (ac == null)
67 | {
68 | return;
69 | }
70 |
71 | txtPrefix.Text = ac.Prefix;
72 |
73 | foreach (ListViewItem item in lstVrHeadsets.Items)
74 | {
75 | item.Checked = ac.IncludedVrSupportFlags.Headsets.Contains(item.Text);
76 | }
77 |
78 | foreach (ListViewItem item in lstVrInput.Items)
79 | {
80 | item.Checked = ac.IncludedVrSupportFlags.Input.Contains(item.Text);
81 | }
82 |
83 | foreach (ListViewItem item in lstVrPlayArea.Items)
84 | {
85 | item.Checked = ac.IncludedVrSupportFlags.PlayArea.Contains(item.Text);
86 | }
87 | }
88 |
89 | public override void SaveToAutoCat(AutoCat autocat)
90 | {
91 | AutoCatVrSupport ac = autocat as AutoCatVrSupport;
92 | if (ac == null)
93 | {
94 | return;
95 | }
96 |
97 | ac.Prefix = txtPrefix.Text;
98 |
99 | ac.IncludedVrSupportFlags.Headsets.Clear();
100 | ac.IncludedVrSupportFlags.Input.Clear();
101 | ac.IncludedVrSupportFlags.PlayArea.Clear();
102 |
103 | foreach (ListViewItem i in lstVrHeadsets.Items)
104 | {
105 | if (i.Checked)
106 | {
107 | ac.IncludedVrSupportFlags.Headsets.Add(i.Text);
108 | }
109 | }
110 |
111 | foreach (ListViewItem i in lstVrInput.Items)
112 | {
113 | if (i.Checked)
114 | {
115 | ac.IncludedVrSupportFlags.Input.Add(i.Text);
116 | }
117 | }
118 |
119 | foreach (ListViewItem i in lstVrPlayArea.Items)
120 | {
121 | if (i.Checked)
122 | {
123 | ac.IncludedVrSupportFlags.PlayArea.Add(i.Text);
124 | }
125 | }
126 | }
127 |
128 | private void SetAllListCheckStates(ListView list, bool to)
129 | {
130 | foreach (ListViewItem item in list.Items)
131 | {
132 | item.Checked = to;
133 | }
134 | }
135 |
136 | private void cmdCheckAll_Click(object sender, EventArgs e)
137 | {
138 | SetAllListCheckStates(lstVrHeadsets, true);
139 | SetAllListCheckStates(lstVrInput, true);
140 | SetAllListCheckStates(lstVrPlayArea, true);
141 | }
142 |
143 | private void cmdUncheckAll_Click(object sender, EventArgs e)
144 | {
145 | SetAllListCheckStates(lstVrHeadsets, false);
146 | SetAllListCheckStates(lstVrInput, false);
147 | SetAllListCheckStates(lstVrPlayArea, false);
148 | }
149 | }
150 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatConfigPanel_Year.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | namespace Depressurizer
20 | {
21 | public partial class AutoCatConfigPanel_Year : AutoCatConfigPanel
22 | {
23 | public AutoCatConfigPanel_Year()
24 | {
25 | InitializeComponent();
26 | ttHelp.Ext_SetToolTip(helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix);
27 | ttHelp.Ext_SetToolTip(helpUnknown, GlobalStrings.AutoCatYearPanel_Help_Unknown);
28 | }
29 |
30 | public override void LoadFromAutoCat(AutoCat ac)
31 | {
32 | AutoCatYear acYear = ac as AutoCatYear;
33 | if (acYear == null) return;
34 | txtPrefix.Text = (acYear.Prefix == null) ? string.Empty : acYear.Prefix;
35 | chkIncludeUnknown.Checked = acYear.IncludeUnknown;
36 | txtUnknownText.Text = (acYear.UnknownText == null) ? string.Empty : acYear.UnknownText;
37 | switch (acYear.GroupingMode)
38 | {
39 | case AutoCatYear_Grouping.Decade:
40 | radGroupDec.Checked = true;
41 | break;
42 | case AutoCatYear_Grouping.HalfDecade:
43 | radGroupHalf.Checked = true;
44 | break;
45 | default:
46 | radGroupNone.Checked = true;
47 | break;
48 | }
49 | }
50 |
51 | public override void SaveToAutoCat(AutoCat autocat)
52 | {
53 | AutoCatYear ac = autocat as AutoCatYear;
54 | if (ac == null) return;
55 | ac.Prefix = txtPrefix.Text;
56 | ac.IncludeUnknown = chkIncludeUnknown.Checked;
57 | ac.UnknownText = txtUnknownText.Text;
58 | if (radGroupNone.Checked)
59 | {
60 | ac.GroupingMode = AutoCatYear_Grouping.None;
61 | }
62 | else if (radGroupHalf.Checked)
63 | {
64 | ac.GroupingMode = AutoCatYear_Grouping.HalfDecade;
65 | }
66 | else if (radGroupDec.Checked)
67 | {
68 | ac.GroupingMode = AutoCatYear_Grouping.Decade;
69 | }
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatGroup.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Xml;
22 | using System.Xml.Serialization;
23 | using Rallion;
24 |
25 | namespace Depressurizer
26 | {
27 | public class AutoCatGroup : AutoCat
28 | {
29 | #region Properties
30 |
31 | // Autocat configuration properties
32 | [XmlArrayItem("Autocat")]
33 | public List Autocats { get; set; }
34 |
35 | // Meta properies
36 | public override AutoCatType AutoCatType
37 | {
38 | get { return AutoCatType.Group; }
39 | }
40 |
41 | public override string DisplayName
42 | {
43 | get
44 | {
45 | string displayName = Name + "[" + Autocats.Count + "]";
46 | if (Filter != null) displayName += "*";
47 | return displayName;
48 | }
49 | }
50 |
51 | // Serialization strings
52 | public const string TypeIdString = "AutoCatGroup";
53 |
54 | public const string
55 | XmlName_Name = "Name",
56 | XmlName_Filter = "Filter",
57 | XmlName_Autocats = "Autocats",
58 | XmlName_Autocat = "Autocat";
59 |
60 | #endregion
61 |
62 | #region Construction
63 |
64 | public AutoCatGroup(string name, string filter = null, List autocats = null, bool selected = false)
65 | : base(name)
66 | {
67 | Filter = filter;
68 | Autocats = (autocats == null) ? new List() : autocats;
69 | Selected = selected;
70 | }
71 |
72 | //XmlSerializer requires a parameterless constructor
73 | private AutoCatGroup() { }
74 |
75 | protected AutoCatGroup(AutoCatGroup other)
76 | : base(other)
77 | {
78 | Filter = other.Filter;
79 | Autocats = new List(other.Autocats);
80 | Selected = other.Selected;
81 | }
82 |
83 | public override AutoCat Clone()
84 | {
85 | return new AutoCatGroup(this);
86 | }
87 |
88 | #endregion
89 |
90 | #region Autocategorization Methods
91 |
92 | public override AutoCatResult CategorizeGame(GameInfo game, Filter filter)
93 | {
94 | if (games == null)
95 | {
96 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GamelistNull);
97 | throw new ApplicationException(GlobalStrings.AutoCatGenre_Exception_NoGameList);
98 | }
99 | if (db == null)
100 | {
101 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_DBNull);
102 | throw new ApplicationException(GlobalStrings.AutoCatGenre_Exception_NoGameDB);
103 | }
104 | if (game == null)
105 | {
106 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GameNull);
107 | return AutoCatResult.Failure;
108 | }
109 |
110 | if (!db.Contains(game.Id)) return AutoCatResult.NotInDatabase;
111 |
112 | if (!game.IncludeGame(filter)) return AutoCatResult.Filtered;
113 |
114 | return AutoCatResult.Success;
115 | }
116 |
117 | #endregion
118 |
119 | #region Serialization methods
120 |
121 | public override void WriteToXml(XmlWriter writer)
122 | {
123 | writer.WriteStartElement(TypeIdString);
124 |
125 | writer.WriteElementString(XmlName_Name, Name);
126 | if (Filter != null) writer.WriteElementString(XmlName_Filter, Filter);
127 |
128 | if (Autocats != null && Autocats.Count > 0)
129 | {
130 | writer.WriteStartElement(XmlName_Autocats);
131 | foreach (string name in Autocats)
132 | {
133 | writer.WriteElementString(XmlName_Autocat, name);
134 | }
135 | writer.WriteEndElement();
136 | }
137 |
138 | writer.WriteEndElement(); // type ID string
139 | }
140 |
141 | public static AutoCatGroup LoadFromXmlElement(XmlElement xElement)
142 | {
143 | string name = XmlUtil.GetStringFromNode(xElement[XmlName_Name], TypeIdString);
144 | string filter = XmlUtil.GetStringFromNode(xElement[XmlName_Filter], null);
145 | List autocats =
146 | XmlUtil.GetStringsFromNodeList(xElement.SelectNodes(XmlName_Autocats + "/" + XmlName_Autocat));
147 |
148 | return new AutoCatGroup(name, filter, autocats);
149 | }
150 |
151 | #endregion
152 | }
153 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.RegularExpressions;
3 | using System.Xml;
4 | using Rallion;
5 |
6 | namespace Depressurizer
7 | {
8 | public class AutoCatName : AutoCat
9 | {
10 | public string Prefix { get; set; }
11 | public bool SkipThe { get; set; }
12 | public bool GroupNumbers { get; set; }
13 | public bool GroupNonEnglishCharacters { get; set; }
14 | public string GroupNonEnglishCharactersText { get; set; }
15 |
16 |
17 | public override AutoCatType AutoCatType
18 | {
19 | get { return AutoCatType.Name; }
20 | }
21 |
22 | public const string TypeIdString = "AutoCatName";
23 | public const string XmlName_Prefix = "Prefix";
24 | public const string XmlName_Name = "Name";
25 | public const string XmlName_SkipThe = "SkipThe";
26 | public const string XmlName_GroupNumbers = "GroupNumbers";
27 | public const string XmlName_GroupNonEnglishCharacters = "GroupNonEnglishCharacters";
28 | public const string XmlName_GroupNonEnglishCharactersText = "GroupNonEnglishCharactersText";
29 |
30 | public AutoCatName(string name, string prefix = "", bool skipThe = true, bool groupNumbers = false, bool groupNonEnglishCharacters = false, string groupNonEnglishCharactersText = "") : base(name)
31 | {
32 | Name = name;
33 | Prefix = prefix;
34 | SkipThe = skipThe;
35 | GroupNumbers = groupNumbers;
36 | GroupNonEnglishCharacters = groupNonEnglishCharacters;
37 | GroupNonEnglishCharactersText = groupNonEnglishCharactersText;
38 | }
39 |
40 | //XmlSerializer requires a parameterless constructor
41 | private AutoCatName() { }
42 |
43 | public override AutoCatResult CategorizeGame(GameInfo game, Filter filter)
44 | {
45 | if (games == null)
46 | {
47 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GamelistNull);
48 | throw new ApplicationException(GlobalStrings.AutoCatGenre_Exception_NoGameList);
49 | }
50 | if (db == null)
51 | {
52 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_DBNull);
53 | throw new ApplicationException(GlobalStrings.AutoCatGenre_Exception_NoGameDB);
54 | }
55 | if (game == null)
56 | {
57 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GameNull);
58 | return AutoCatResult.Failure;
59 | }
60 |
61 | if (!db.Contains(game.Id)) return AutoCatResult.NotInDatabase;
62 |
63 |
64 | string cat = game.Name.Substring(0, 1);
65 | cat = cat.ToUpper();
66 | if (SkipThe && cat == "T" && game.Name.Substring(0, 4).ToUpper() == "THE ")
67 | cat = game.Name.Substring(4, 1).ToUpper();
68 | if (GroupNumbers && Char.IsDigit(cat[0])) cat = "#";
69 | else if (GroupNonEnglishCharacters && !string.IsNullOrEmpty(GroupNonEnglishCharactersText) &&
70 | Regex.IsMatch(cat, "[^a-z0-9]", RegexOptions.IgnoreCase))
71 | cat = GroupNonEnglishCharactersText;
72 | if (Prefix != null) cat = Prefix + cat;
73 |
74 | game.AddCategory(games.GetCategory(cat));
75 |
76 | return AutoCatResult.Success;
77 | }
78 |
79 | public override AutoCat Clone()
80 | {
81 | return new AutoCatName(Name, Prefix, SkipThe, GroupNumbers, GroupNonEnglishCharacters, GroupNonEnglishCharactersText);
82 | }
83 |
84 | public override void WriteToXml(XmlWriter writer)
85 | {
86 | writer.WriteStartElement(TypeIdString);
87 |
88 | writer.WriteElementString(XmlName_Name, Name);
89 | writer.WriteElementString(XmlName_Prefix, Prefix);
90 | writer.WriteElementString(XmlName_SkipThe, SkipThe.ToString().ToLowerInvariant());
91 | writer.WriteElementString(XmlName_GroupNumbers, GroupNumbers.ToString().ToLowerInvariant());
92 | writer.WriteElementString(XmlName_GroupNonEnglishCharacters, GroupNonEnglishCharacters.ToString().ToLowerInvariant());
93 | writer.WriteElementString(XmlName_GroupNonEnglishCharactersText, GroupNonEnglishCharactersText);
94 |
95 | writer.WriteEndElement(); // type ID string
96 | }
97 |
98 | public static AutoCatName LoadFromXmlElement(XmlElement xElement)
99 | {
100 | string name = XmlUtil.GetStringFromNode(xElement[XmlName_Name], null);
101 | string prefix = XmlUtil.GetStringFromNode(xElement[XmlName_Prefix], null);
102 | bool skipThe = XmlUtil.GetBoolFromNode(xElement[XmlName_SkipThe], true);
103 | bool groupNumbers = XmlUtil.GetBoolFromNode(xElement[XmlName_GroupNumbers], true);
104 | bool groupNonEnglishCharacters = XmlUtil.GetBoolFromNode(xElement[XmlName_GroupNonEnglishCharacters], false);
105 | string groupNonEnglishCharactersText = XmlUtil.GetStringFromNode(xElement[XmlName_GroupNonEnglishCharactersText], null);
106 |
107 | return new AutoCatName(name, prefix, skipThe, groupNumbers, groupNonEnglishCharacters, groupNonEnglishCharactersText);
108 | }
109 | }
110 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutoCat/AutoCatPlatform.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Original Work Copyright 2011, 2012, 2013 Steve Labbe.
4 | Modified Work Copyright 2017 Theodoros Dimos.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Text.RegularExpressions;
24 | using System.Windows.Forms;
25 | using System.Xml;
26 | using System.Xml.Serialization;
27 | using Depressurizer;
28 | using Rallion;
29 |
30 | namespace Depressurizer
31 | {
32 | public class AutoCatPlatform : AutoCat
33 | {
34 | public override AutoCatType AutoCatType
35 | {
36 | get { return AutoCatType.Platform; }
37 | }
38 |
39 | // AutoCat configuration
40 | public string Prefix { get; set; }
41 |
42 | public bool Windows { get; set; }
43 | public bool Mac { get; set; }
44 | public bool Linux { get; set; }
45 | public bool SteamOS { get; set; }
46 |
47 | // Serialization constants
48 | public const string TypeIdString = "AutoCatPlatform";
49 |
50 | public AutoCatPlatform(string name, string filter = null, string prefix = null, bool windows = false, bool mac = false, bool linux = false, bool steamOS = false,
51 | bool selected = false)
52 | : base(name)
53 | {
54 | Filter = filter;
55 | Prefix = prefix;
56 | Windows = windows;
57 | Mac = mac;
58 | Linux = linux;
59 | SteamOS = steamOS;
60 | Selected = selected;
61 | }
62 |
63 | //XmlSerializer requires a parameterless constructor
64 | private AutoCatPlatform() { }
65 |
66 | protected AutoCatPlatform(AutoCatPlatform other)
67 | : base(other)
68 | {
69 | Filter = other.Filter;
70 | Prefix = other.Prefix;
71 | Windows = other.Windows;
72 | Mac = other.Mac;
73 | Linux = other.Linux;
74 | SteamOS = other.SteamOS;
75 | Selected = other.Selected;
76 | }
77 |
78 | public override AutoCat Clone()
79 | {
80 | return new AutoCatPlatform(this);
81 | }
82 | public override AutoCatResult CategorizeGame(GameInfo game, Filter filter)
83 | {
84 | if (games == null)
85 | {
86 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GamelistNull);
87 | throw new ApplicationException(GlobalStrings.AutoCatGenre_Exception_NoGameList);
88 | }
89 | if (game == null)
90 | {
91 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.Log_AutoCat_GameNull);
92 | return AutoCatResult.Failure;
93 | }
94 |
95 | if (!game.IncludeGame(filter))
96 | {
97 | return AutoCatResult.Filtered;
98 | }
99 |
100 | if (!db.Contains(game.Id) || db.Games[game.Id].LastStoreScrape == 0) return AutoCatResult.NotInDatabase;
101 |
102 | AppPlatforms platforms = db.Games[game.Id].Platforms;
103 | if (Windows && (platforms & AppPlatforms.Windows) != 0)
104 | {
105 | game.AddCategory(games.GetCategory(GetProcessedString("Windows")));
106 | }
107 | if (Windows && (platforms & AppPlatforms.Mac) != 0)
108 | {
109 | game.AddCategory(games.GetCategory(GetProcessedString("Mac")));
110 | }
111 | if (Windows && (platforms & AppPlatforms.Linux) != 0)
112 | {
113 | game.AddCategory(games.GetCategory(GetProcessedString("Linux")));
114 | }
115 | if (Windows && (platforms & AppPlatforms.Linux) != 0)
116 | {
117 | game.AddCategory(games.GetCategory(GetProcessedString("SteamOS")));
118 | }
119 | return AutoCatResult.Success;
120 | }
121 |
122 | public string GetProcessedString(string s)
123 | {
124 | if (string.IsNullOrEmpty(Prefix))
125 | {
126 | return s;
127 | }
128 | return Prefix + s;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/src/Depressurizer/AutomaticModeForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Depressurizer {
2 | partial class AutomaticModeForm {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose( bool disposing ) {
13 | if( disposing && ( components != null ) ) {
14 | components.Dispose();
15 | }
16 | base.Dispose( disposing );
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutomaticModeForm));
27 | this.txtOutput = new System.Windows.Forms.TextBox();
28 | this.cmdClose = new System.Windows.Forms.Button();
29 | this.SuspendLayout();
30 | //
31 | // txtOutput
32 | //
33 | this.txtOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
34 | | System.Windows.Forms.AnchorStyles.Left)
35 | | System.Windows.Forms.AnchorStyles.Right)));
36 | this.txtOutput.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
37 | this.txtOutput.Location = new System.Drawing.Point(7, 7);
38 | this.txtOutput.Multiline = true;
39 | this.txtOutput.Name = "txtOutput";
40 | this.txtOutput.ReadOnly = true;
41 | this.txtOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
42 | this.txtOutput.Size = new System.Drawing.Size(706, 299);
43 | this.txtOutput.TabIndex = 0;
44 | //
45 | // cmdClose
46 | //
47 | this.cmdClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
48 | this.cmdClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
49 | this.cmdClose.Location = new System.Drawing.Point(7, 307);
50 | this.cmdClose.Name = "cmdClose";
51 | this.cmdClose.Size = new System.Drawing.Size(706, 23);
52 | this.cmdClose.TabIndex = 1;
53 | this.cmdClose.Text = "Close";
54 | this.cmdClose.UseVisualStyleBackColor = true;
55 | this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click);
56 | //
57 | // AutomaticModeForm
58 | //
59 | this.AcceptButton = this.cmdClose;
60 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
61 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
62 | this.CancelButton = this.cmdClose;
63 | this.ClientSize = new System.Drawing.Size(720, 336);
64 | this.ControlBox = false;
65 | this.Controls.Add(this.cmdClose);
66 | this.Controls.Add(this.txtOutput);
67 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
68 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
69 | this.Name = "AutomaticModeForm";
70 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
71 | this.Text = "Depressurizer Automatic Mode";
72 | this.Load += new System.EventHandler(this.AutomaticModeForm_Load);
73 | this.Shown += new System.EventHandler(this.AutomaticModeForm_Shown);
74 | this.ResumeLayout(false);
75 | this.PerformLayout();
76 |
77 | }
78 |
79 | #endregion
80 |
81 | private System.Windows.Forms.TextBox txtOutput;
82 | private System.Windows.Forms.Button cmdClose;
83 | }
84 | }
--------------------------------------------------------------------------------
/src/Depressurizer/CDlgGetSteamID.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Net;
21 | using System.Xml;
22 | using Rallion;
23 |
24 | namespace Depressurizer
25 | {
26 | class CDlgGetSteamID : CancelableDlg
27 | {
28 | public Int64 SteamID { get; private set; }
29 | private string customUrlName;
30 | public bool Success { get; private set; }
31 |
32 | public CDlgGetSteamID(string customUrl)
33 | : base(GlobalStrings.CDlgGetSteamID_GettingSteamID, false)
34 | {
35 | SteamID = 0;
36 | Success = false;
37 | customUrlName = customUrl;
38 |
39 | SetText(GlobalStrings.CDlgGetSteamID_GettingIDFromURL);
40 | }
41 |
42 | protected override void RunProcess()
43 | {
44 | XmlDocument doc = new XmlDocument();
45 |
46 | try
47 | {
48 | string url = string.Format(Properties.Resources.UrlCustomProfileXml, customUrlName);
49 | Program.Logger.Write(LoggerLevel.Info, GlobalStrings.CDlgGetSteamID_AttemptingDownloadXMLProfile,
50 | customUrlName, url);
51 | WebRequest req = HttpWebRequest.Create(url);
52 | WebResponse response = req.GetResponse();
53 | doc.Load(response.GetResponseStream());
54 | response.Close();
55 | Program.Logger.Write(LoggerLevel.Info, GlobalStrings.CDlgGetSteamID_XMLProfileDownloaded);
56 | }
57 | catch (Exception e)
58 | {
59 | Program.Logger.Write(LoggerLevel.Error, GlobalStrings.CDlgGetSteamID_ExceptionDownloadingXMLProfile,
60 | e.Message);
61 | throw new ApplicationException(GlobalStrings.CDlgGetSteamID_FailedToDownloadProfile + e.Message, e);
62 | }
63 |
64 | XmlNode idNode = doc.SelectSingleNode("/profile/steamID64");
65 | if (idNode != null)
66 | {
67 | Int64 tmp;
68 | Success = Int64.TryParse(idNode.InnerText, out tmp);
69 | if (Success)
70 | {
71 | SteamID = tmp;
72 | }
73 | }
74 |
75 | OnThreadCompletion();
76 | }
77 |
78 | protected override void Finish()
79 | {
80 | if (!Canceled)
81 | {
82 | OnJobCompletion();
83 | }
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/src/Depressurizer/CDlgHltb.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using Rallion;
20 |
21 | namespace Depressurizer
22 | {
23 | class HltbPrcDlg : CancelableDlg
24 | {
25 | public int Updated { get; private set; }
26 |
27 | public HltbPrcDlg()
28 | : base(GlobalStrings.CDlgHltb_Title, false)
29 | {
30 | SetText(GlobalStrings.CDlgHltb_UpdateHltb);
31 | Updated = 0;
32 | }
33 |
34 | protected override void RunProcess()
35 | {
36 | Updated = Program.GameDB.UpdateFromHltb(Settings.Instance.IncludeImputedTimes);
37 | OnThreadCompletion();
38 | }
39 |
40 | protected override void Finish()
41 | {
42 | if (!Canceled && Error == null)
43 | {
44 | OnJobCompletion();
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/src/Depressurizer/CDlgUpdateProfile.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Xml;
22 | using Rallion;
23 |
24 | namespace Depressurizer
25 | {
26 | class CDlgUpdateProfile : CancelableDlg
27 | {
28 | public int Fetched { get; private set; }
29 | public int Added { get; private set; }
30 | public int Removed { get; private set; }
31 |
32 | public bool UseHtml { get; private set; }
33 | public bool Failover { get; private set; }
34 |
35 | private Int64 SteamId;
36 | private string customUrl;
37 | private bool custom;
38 | private GameList data;
39 |
40 | XmlDocument doc;
41 | string htmlDoc;
42 |
43 | private bool overwrite;
44 | private SortedSet ignore;
45 | private bool includeUnknown;
46 |
47 | public CDlgUpdateProfile(GameList data, Int64 accountId, bool overwrite, SortedSet ignore,
48 | bool inclUnknown)
49 | : base(GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true)
50 | {
51 | custom = false;
52 | SteamId = accountId;
53 |
54 | Added = 0;
55 | Fetched = 0;
56 | UseHtml = false;
57 | Failover = false;
58 |
59 | this.data = data;
60 |
61 | this.overwrite = overwrite;
62 | this.ignore = ignore;
63 |
64 | includeUnknown = inclUnknown;
65 |
66 | SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
67 | }
68 |
69 | public CDlgUpdateProfile(GameList data, string customUrl, bool overwrite, SortedSet ignore,
70 | bool inclUnknown)
71 | : base(GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true)
72 | {
73 | custom = true;
74 | this.customUrl = customUrl;
75 |
76 | Added = 0;
77 | Fetched = 0;
78 | UseHtml = false;
79 | Failover = false;
80 |
81 | this.data = data;
82 |
83 | this.overwrite = overwrite;
84 | this.ignore = ignore;
85 |
86 | includeUnknown = inclUnknown;
87 |
88 | SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
89 | }
90 |
91 | protected override void RunProcess()
92 | {
93 | Added = 0;
94 | Fetched = 0;
95 | switch (Settings.Instance.ListSource)
96 | {
97 | case GameListSource.XmlPreferred:
98 | FetchXmlPref();
99 | break;
100 | case GameListSource.XmlOnly:
101 | FetchXml();
102 | break;
103 | case GameListSource.WebsiteOnly:
104 | FetchHtml();
105 | break;
106 | }
107 |
108 | OnThreadCompletion();
109 | }
110 |
111 | protected void FetchXml()
112 | {
113 | UseHtml = false;
114 | doc = custom ? GameList.FetchXmlGameList(customUrl) : GameList.FetchXmlGameList(SteamId);
115 | }
116 |
117 | protected void FetchHtml()
118 | {
119 | UseHtml = true;
120 | htmlDoc = custom ? GameList.FetchHtmlGameList(customUrl) : GameList.FetchHtmlGameList(SteamId);
121 | }
122 |
123 | protected void FetchXmlPref()
124 | {
125 | try
126 | {
127 | FetchXml();
128 | return;
129 | }
130 | catch (Exception) { }
131 | Failover = true;
132 | FetchHtml();
133 | }
134 |
135 | protected override void Finish()
136 | {
137 | if (!Canceled && Error == null && (UseHtml ? (htmlDoc != null) : (doc != null)))
138 | {
139 | SetText(GlobalStrings.CDlgFetch_FinishingDownload);
140 | if (UseHtml)
141 | {
142 | int newItems;
143 | Fetched = data.IntegrateHtmlGameList(htmlDoc, overwrite, ignore,
144 | includeUnknown ? AppTypes.InclusionUnknown : AppTypes.InclusionNormal, out newItems);
145 | Added = newItems;
146 | }
147 | else
148 | {
149 | int newItems;
150 | Fetched = data.IntegrateXmlGameList(doc, overwrite, ignore,
151 | includeUnknown ? AppTypes.InclusionUnknown : AppTypes.InclusionNormal, out newItems);
152 | Added = newItems;
153 | }
154 | OnJobCompletion();
155 | }
156 | }
157 | }
158 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DBEdit/CDlgFetch.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System.Xml;
20 | using Rallion;
21 |
22 | namespace Depressurizer
23 | {
24 | class FetchPrcDlg : CancelableDlg
25 | {
26 | public int Added { get; private set; }
27 | XmlDocument doc;
28 |
29 | public FetchPrcDlg()
30 | : base(GlobalStrings.CDlgFetch_UpdatingGameList, false)
31 | {
32 | SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
33 | Added = 0;
34 | }
35 |
36 | protected override void RunProcess()
37 | {
38 | Added = 0;
39 | doc = GameDB.FetchAppListFromWeb();
40 | OnThreadCompletion();
41 | }
42 |
43 | protected override void Finish()
44 | {
45 | if (!Canceled && doc != null && Error == null)
46 | {
47 | SetText(GlobalStrings.CDlgFetch_FinishingDownload);
48 | Added = Program.GameDB.IntegrateAppList(doc);
49 | OnJobCompletion();
50 | }
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DBEdit/CDlgScrape.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Text;
22 | using Rallion;
23 |
24 | namespace Depressurizer
25 | {
26 | class DbScrapeDlg : CancelableDlg
27 | {
28 | Queue jobs;
29 | List results;
30 |
31 | DateTime start;
32 |
33 | public DbScrapeDlg(Queue jobs)
34 | : base(GlobalStrings.CDlgScrape_ScrapingGameInfo, true)
35 | {
36 | this.jobs = jobs;
37 | totalJobs = jobs.Count;
38 |
39 | results = new List();
40 | }
41 |
42 | protected override void UpdateForm_Load(object sender, EventArgs e)
43 | {
44 | start = DateTime.Now;
45 | base.UpdateForm_Load(sender, e);
46 | }
47 |
48 | private int GetNextGameId()
49 | {
50 | lock (jobs)
51 | {
52 | if (jobs.Count > 0)
53 | {
54 | return jobs.Dequeue();
55 | }
56 | return 0;
57 | }
58 | }
59 |
60 | protected override void RunProcess()
61 | {
62 | bool stillRunning = true;
63 | while (!Stopped && stillRunning)
64 | {
65 | stillRunning = RunNextJob();
66 | }
67 | OnThreadCompletion();
68 | }
69 |
70 | ///
71 | /// Runs the next job in the queue, in a thread-safe manner. Aborts ASAP if the form is closed.
72 | ///
73 | /// True if a job was run, false if it was aborted first
74 | private bool RunNextJob()
75 | {
76 | int id = GetNextGameId();
77 | if (id == 0)
78 | {
79 | return false;
80 | }
81 | if (Stopped) return false;
82 |
83 | GameDBEntry newGame = new GameDBEntry();
84 | newGame.Id = id;
85 | newGame.ScrapeStore();
86 |
87 | // This lock is critical, as it makes sure that the abort check and the actual game update funtion essentially atomically with reference to form-closing.
88 | // If this isn't the case, the form could successfully close before this happens, but then it could still go through, and that's no good.
89 | lock (abortLock)
90 | {
91 | if (!Stopped)
92 | {
93 | results.Add(newGame);
94 | OnJobCompletion();
95 | return true;
96 | }
97 | return false;
98 | }
99 | }
100 |
101 | protected override void Finish()
102 | {
103 | if (!Canceled)
104 | {
105 | SetText(GlobalStrings.CDlgScrape_ApplyingData);
106 |
107 | if (results != null)
108 | {
109 | foreach (GameDBEntry g in results)
110 | {
111 | if (Program.GameDB.Contains(g.Id))
112 | {
113 | Program.GameDB.Games[g.Id].MergeIn(g);
114 | }
115 | else
116 | {
117 | Program.GameDB.Games.Add(g.Id, g);
118 | }
119 | }
120 | }
121 | }
122 | }
123 |
124 | protected override void UpdateText()
125 | {
126 | TimeSpan timeRemaining = TimeSpan.Zero;
127 | if (jobsCompleted > 0)
128 | {
129 | double msElapsed = (DateTime.Now - start).TotalMilliseconds;
130 | double msPerItem = msElapsed / jobsCompleted;
131 | double msRemaining = msPerItem * (totalJobs - jobsCompleted);
132 | timeRemaining = TimeSpan.FromMilliseconds(msRemaining);
133 | }
134 |
135 | StringBuilder sb = new StringBuilder();
136 | sb.Append(string.Format(GlobalStrings.CDlgDataScrape_UpdatingComplete, jobsCompleted, totalJobs));
137 |
138 | sb.Append(GlobalStrings.CDlgDataScrape_TimeRemaining);
139 | if (timeRemaining == TimeSpan.Zero)
140 | {
141 | sb.Append(GlobalStrings.CDlgScrape_Unknown);
142 | }
143 | else if (timeRemaining.TotalMinutes < 1.0)
144 | {
145 | sb.Append(GlobalStrings.CDlgScrape_1minute);
146 | }
147 | else
148 | {
149 | double hours = timeRemaining.TotalHours;
150 | if (hours >= 1.0)
151 | {
152 | sb.Append(string.Format("{0:F0}h", hours));
153 | }
154 | sb.Append(string.Format("{0:D2}m", timeRemaining.Minutes));
155 | }
156 | SetText(sb.ToString());
157 | }
158 | }
159 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Depressurizer.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
5 | True
6 | True
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAbout.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011 - 2014 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Diagnostics;
21 | using System.Reflection;
22 | using System.Windows.Forms;
23 |
24 | namespace Depressurizer
25 | {
26 | public partial class DlgAbout : Form
27 | {
28 | public DlgAbout()
29 | {
30 | InitializeComponent();
31 | }
32 |
33 | private void DlgAbout_Load(object sender, EventArgs e)
34 | {
35 | lblVersion.Text += Assembly.GetExecutingAssembly().GetName().Version.ToString();
36 |
37 | int oldLen = lnkHomepage.Text.Length;
38 | lnkHomepage.Text += Properties.Resources.DepressurizerHomepage;
39 | lnkHomepage.LinkArea = new LinkArea(oldLen, lnkHomepage.Text.Length - oldLen);
40 | }
41 |
42 | private void lnkHomepage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
43 | {
44 | Process.Start(Properties.Resources.DepressurizerHomepage);
45 | }
46 |
47 | private void lnkLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
48 | {
49 | Process.Start("http://www.gnu.org/licenses/");
50 | }
51 |
52 | private void lnkNDesk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
53 | {
54 | Process.Start("http://www.novell.com");
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAbout.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAutoCat.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAutoCatCreate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Windows.Forms;
21 |
22 | namespace Depressurizer
23 | {
24 | public partial class DlgAutoCatCreate : Form
25 | {
26 | public string SelectedName { get; set; }
27 | public AutoCatType SelectedType { get; set; }
28 |
29 | private string[] typeNames;
30 | private AutoCatType[] types;
31 |
32 | public DlgAutoCatCreate(string name = null, AutoCatType type = AutoCatType.None)
33 | {
34 | InitializeComponent();
35 |
36 | // To add new types to this dialog, add the name and type to these arrays. The indexes must line up.
37 | // This method allows adding new types in one place AND allows localization to work properly
38 | typeNames = new[]
39 | {
40 | GlobalStrings.AutoCat_Name_Genre,
41 | GlobalStrings.AutoCat_Name_Flags,
42 | GlobalStrings.AutoCat_Name_Tags,
43 | GlobalStrings.AutoCat_Name_Year,
44 | GlobalStrings.AutoCat_Name_UserScore,
45 | GlobalStrings.AutoCat_Name_Hltb,
46 | GlobalStrings.AutoCat_Name_Manual,
47 | GlobalStrings.AutoCat_Name_DevPub,
48 | GlobalStrings.AutoCat_Name_Group,
49 | GlobalStrings.AutoCat_Name_Name,
50 | GlobalStrings.AutoCat_Name_VrSupport,
51 | GlobalStrings.AutoCat_Name_Language,
52 | GlobalStrings.AutoCat_Name_Curator,
53 | GlobalStrings.AutoCat_Name_Platform
54 |
55 | };
56 | types = new[]
57 | {
58 | AutoCatType.Genre,
59 | AutoCatType.Flags,
60 | AutoCatType.Tags,
61 | AutoCatType.Year,
62 | AutoCatType.UserScore,
63 | AutoCatType.Hltb,
64 | AutoCatType.Manual,
65 | AutoCatType.DevPub,
66 | AutoCatType.Group,
67 | AutoCatType.Name,
68 | AutoCatType.VrSupport,
69 | AutoCatType.Language,
70 | AutoCatType.Curator,
71 | AutoCatType.Platform
72 | };
73 |
74 | SelectedName = name;
75 | SelectedType = type;
76 | }
77 |
78 | private string TypeToString(AutoCatType t)
79 | {
80 | if (t == AutoCatType.None) return null;
81 | int index = Array.IndexOf(types, t);
82 | if (index >= 0 && index < typeNames.Length) return typeNames[index];
83 | return null;
84 | }
85 |
86 | private AutoCatType StringToType(string s)
87 | {
88 | if (s == null) return AutoCatType.None;
89 | int index = Array.IndexOf(typeNames, s);
90 | if (index >= 0 && index < types.Length) return types[index];
91 | return AutoCatType.None;
92 | }
93 |
94 | private void SaveUIToFields()
95 | {
96 | SelectedName = txtName.Text;
97 | SelectedType = StringToType(cmbType.SelectedItem as string);
98 | }
99 |
100 | private void LoadUIFromFields()
101 | {
102 | if (SelectedName == null)
103 | {
104 | txtName.Clear();
105 | }
106 | else
107 | {
108 | txtName.Text = SelectedName;
109 | }
110 |
111 | string selString = TypeToString(SelectedType);
112 | if (selString == null)
113 | {
114 | cmbType.SelectedIndex = 0;
115 | }
116 | else
117 | {
118 | cmbType.SelectedItem = selString;
119 | }
120 | }
121 |
122 | private void DlgAutoCatCreate_Load(object sender, EventArgs e)
123 | {
124 | foreach (string s in typeNames)
125 | {
126 | cmbType.Items.Add(s);
127 | }
128 | LoadUIFromFields();
129 | }
130 |
131 | private void cmdCreate_Click(object sender, EventArgs e)
132 | {
133 | SaveUIToFields();
134 | }
135 | }
136 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAutoCatSelect.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Depressurizer
2 | {
3 | partial class DlgAutoCatSelect
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.clbAutocats = new System.Windows.Forms.CheckedListBox();
32 | this.btnCancel = new System.Windows.Forms.Button();
33 | this.btnOK = new System.Windows.Forms.Button();
34 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
35 | this.tableLayoutPanel1.SuspendLayout();
36 | this.SuspendLayout();
37 | //
38 | // clbAutocats
39 | //
40 | this.clbAutocats.Dock = System.Windows.Forms.DockStyle.Fill;
41 | this.clbAutocats.FormattingEnabled = true;
42 | this.clbAutocats.Location = new System.Drawing.Point(0, 0);
43 | this.clbAutocats.Name = "clbAutocats";
44 | this.clbAutocats.Size = new System.Drawing.Size(288, 296);
45 | this.clbAutocats.TabIndex = 0;
46 | this.clbAutocats.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.clbAutocats_ItemCheck);
47 | //
48 | // btnCancel
49 | //
50 | this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Left;
51 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
52 | this.btnCancel.Location = new System.Drawing.Point(3, 6);
53 | this.btnCancel.Name = "btnCancel";
54 | this.btnCancel.Size = new System.Drawing.Size(75, 23);
55 | this.btnCancel.TabIndex = 1;
56 | this.btnCancel.Text = "Cancel";
57 | this.btnCancel.UseVisualStyleBackColor = true;
58 | //
59 | // btnOK
60 | //
61 | this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Right;
62 | this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
63 | this.btnOK.Location = new System.Drawing.Point(210, 6);
64 | this.btnOK.Name = "btnOK";
65 | this.btnOK.Size = new System.Drawing.Size(75, 23);
66 | this.btnOK.TabIndex = 0;
67 | this.btnOK.Text = "OK";
68 | this.btnOK.UseVisualStyleBackColor = true;
69 | //
70 | // tableLayoutPanel1
71 | //
72 | this.tableLayoutPanel1.AutoSize = true;
73 | this.tableLayoutPanel1.ColumnCount = 2;
74 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
75 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
76 | this.tableLayoutPanel1.Controls.Add(this.btnCancel, 0, 0);
77 | this.tableLayoutPanel1.Controls.Add(this.btnOK, 1, 0);
78 | this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
79 | this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 296);
80 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
81 | this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
82 | this.tableLayoutPanel1.RowCount = 1;
83 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
84 | this.tableLayoutPanel1.Size = new System.Drawing.Size(288, 32);
85 | this.tableLayoutPanel1.TabIndex = 2;
86 | //
87 | // DlgAutoCatSelect
88 | //
89 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
90 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
91 | this.ClientSize = new System.Drawing.Size(288, 328);
92 | this.ControlBox = false;
93 | this.Controls.Add(this.clbAutocats);
94 | this.Controls.Add(this.tableLayoutPanel1);
95 | this.MinimumSize = new System.Drawing.Size(228, 240);
96 | this.Name = "DlgAutoCatSelect";
97 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
98 | this.Text = "Select AutoCats";
99 | this.Load += new System.EventHandler(this.DlgAutoCat_Load);
100 | this.tableLayoutPanel1.ResumeLayout(false);
101 | this.ResumeLayout(false);
102 | this.PerformLayout();
103 |
104 | }
105 |
106 | #endregion
107 | private System.Windows.Forms.CheckedListBox clbAutocats;
108 | private System.Windows.Forms.Button btnCancel;
109 | private System.Windows.Forms.Button btnOK;
110 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
111 | }
112 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgAutoCatSelect.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class DlgAutoCatSelect : Form
26 | {
27 | public List AutoCatList;
28 | public string originalGroup;
29 |
30 | public DlgAutoCatSelect(List autoCats, string name)
31 | {
32 | InitializeComponent();
33 |
34 | AutoCatList = new List();
35 | originalGroup = name;
36 |
37 | foreach (AutoCat c in autoCats)
38 | {
39 | AutoCat clone = c.Clone();
40 | clone.Selected = false;
41 | AutoCatList.Add(clone);
42 | }
43 | }
44 |
45 | #region UI Uptaters
46 |
47 | private void FillAutocatList()
48 | {
49 | clbAutocats.Items.Clear();
50 | foreach (AutoCat ac in AutoCatList)
51 | {
52 | if (ac.Name != originalGroup)
53 | {
54 | bool addAC = true;
55 | if (ac.AutoCatType == AutoCatType.Group)
56 | {
57 | addAC = SafeGroup(((AutoCatGroup) ac).Autocats, new List(new[] {originalGroup}));
58 | }
59 | if (addAC) clbAutocats.Items.Add(ac);
60 | }
61 | }
62 | clbAutocats.DisplayMember = "DisplayName";
63 | }
64 |
65 | #endregion
66 |
67 | #region Event Handlers
68 |
69 | private void DlgAutoCat_Load(object sender, EventArgs e)
70 | {
71 | FillAutocatList();
72 | }
73 |
74 | private void clbAutocats_ItemCheck(object sender, ItemCheckEventArgs e)
75 | {
76 | ((AutoCat) clbAutocats.Items[e.Index]).Selected = e.NewValue == CheckState.Checked ? true : false;
77 | }
78 |
79 | #endregion
80 |
81 | #region Utility
82 |
83 | private bool SafeGroup(List autocats, List groups)
84 | {
85 | foreach (string ac in autocats)
86 | {
87 | // is AutoCat a group?
88 | if (IsGroup(ac))
89 | {
90 | // if group list already contains the group then we are stuck in an infinite loop. RETURN FALSE.
91 | if (groups.Contains(ac))
92 | {
93 | return false;
94 | }
95 | // add new group to group list
96 | groups.Add(ac);
97 | // get AutoCat from group name
98 | AutoCatGroup group = GetAutoCat(ac) as AutoCatGroup;
99 | // send new group to SafeGroup to continue testing
100 | return SafeGroup(group.Autocats, groups);
101 | }
102 | }
103 | // no duplicate group found. All good! RETURN TRUE.
104 | return true;
105 | }
106 |
107 | // find and return AutoCat using the name
108 | public AutoCat GetAutoCat(string name)
109 | {
110 | if (string.IsNullOrEmpty(name)) return null;
111 |
112 | foreach (AutoCat ac in AutoCatList)
113 | {
114 | if (String.Equals(ac.Name, name, StringComparison.OrdinalIgnoreCase)) return ac;
115 | }
116 |
117 | return null;
118 | }
119 |
120 | private bool IsGroup(string find)
121 | {
122 | AutoCat test = GetAutoCat(find);
123 | return (test.AutoCatType == AutoCatType.Group) ? true : false;
124 | }
125 |
126 | #endregion
127 | }
128 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgClose.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Depressurizer
20 | {
21 | partial class DlgClose
22 | {
23 | ///
24 | /// Required designer variable.
25 | ///
26 | private System.ComponentModel.IContainer components = null;
27 |
28 | ///
29 | /// Clean up any resources being used.
30 | ///
31 | /// true if managed resources should be disposed; otherwise, false.
32 | protected override void Dispose(bool disposing)
33 | {
34 | if (disposing && (components != null))
35 | {
36 | components.Dispose();
37 | }
38 | base.Dispose(disposing);
39 | }
40 |
41 | #region Windows Form Designer generated code
42 |
43 | ///
44 | /// Required method for Designer support - do not modify
45 | /// the contents of this method with the code editor.
46 | ///
47 | private void InitializeComponent()
48 | {
49 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgClose));
50 | this.btnCancel = new System.Windows.Forms.Button();
51 | this.btnYes = new System.Windows.Forms.Button();
52 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
53 | this.lblMessage = new System.Windows.Forms.Label();
54 | this.btnNo = new System.Windows.Forms.Button();
55 | this.chkSaveSteam = new System.Windows.Forms.CheckBox();
56 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
57 | this.SuspendLayout();
58 | //
59 | // btnCancel
60 | //
61 | resources.ApplyResources(this.btnCancel, "btnCancel");
62 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
63 | this.btnCancel.Name = "btnCancel";
64 | this.btnCancel.UseVisualStyleBackColor = true;
65 | //
66 | // btnYes
67 | //
68 | resources.ApplyResources(this.btnYes, "btnYes");
69 | this.btnYes.DialogResult = System.Windows.Forms.DialogResult.Yes;
70 | this.btnYes.Name = "btnYes";
71 | this.btnYes.UseVisualStyleBackColor = true;
72 | //
73 | // pictureBox1
74 | //
75 | resources.ApplyResources(this.pictureBox1, "pictureBox1");
76 | this.pictureBox1.Name = "pictureBox1";
77 | this.pictureBox1.TabStop = false;
78 | //
79 | // lblMessage
80 | //
81 | resources.ApplyResources(this.lblMessage, "lblMessage");
82 | this.lblMessage.Name = "lblMessage";
83 | //
84 | // btnNo
85 | //
86 | resources.ApplyResources(this.btnNo, "btnNo");
87 | this.btnNo.DialogResult = System.Windows.Forms.DialogResult.No;
88 | this.btnNo.Name = "btnNo";
89 | this.btnNo.UseVisualStyleBackColor = true;
90 | //
91 | // chkSaveSteam
92 | //
93 | resources.ApplyResources(this.chkSaveSteam, "chkSaveSteam");
94 | this.chkSaveSteam.Name = "chkSaveSteam";
95 | this.chkSaveSteam.UseVisualStyleBackColor = true;
96 | this.chkSaveSteam.CheckedChanged += new System.EventHandler(this.chkSaveSteam_CheckedChanged);
97 | //
98 | // DlgClose
99 | //
100 | this.AcceptButton = this.btnYes;
101 | resources.ApplyResources(this, "$this");
102 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
103 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
104 | this.CancelButton = this.btnCancel;
105 | this.ControlBox = false;
106 | this.Controls.Add(this.chkSaveSteam);
107 | this.Controls.Add(this.btnNo);
108 | this.Controls.Add(this.lblMessage);
109 | this.Controls.Add(this.pictureBox1);
110 | this.Controls.Add(this.btnYes);
111 | this.Controls.Add(this.btnCancel);
112 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
113 | this.MaximizeBox = false;
114 | this.MinimizeBox = false;
115 | this.Name = "DlgClose";
116 | this.ShowInTaskbar = false;
117 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
118 | this.ResumeLayout(false);
119 | this.PerformLayout();
120 |
121 | }
122 |
123 | #endregion
124 | private System.Windows.Forms.Button btnCancel;
125 | private System.Windows.Forms.Button btnYes;
126 | private System.Windows.Forms.PictureBox pictureBox1;
127 | private System.Windows.Forms.Label lblMessage;
128 | private System.Windows.Forms.Button btnNo;
129 | private System.Windows.Forms.CheckBox chkSaveSteam;
130 | }
131 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgClose.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Drawing;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class DlgClose : Form
26 | {
27 | public bool Export;
28 |
29 | public DlgClose(string message, string title, Image picture, bool cancel, bool exportSteam)
30 | {
31 | InitializeComponent();
32 |
33 | lblMessage.Text = message;
34 | Text = title;
35 | pictureBox1.Image = picture;
36 | btnCancel.Visible = cancel;
37 | chkSaveSteam.Checked = exportSteam;
38 | }
39 |
40 | private void chkSaveSteam_CheckedChanged(object sender, EventArgs e)
41 | {
42 | Export = chkSaveSteam.Checked;
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgClose.ru.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgClose.uk.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgGame.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.IO;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer
24 | {
25 | public partial class DlgGame : Form
26 | {
27 | GameList Data;
28 | public GameInfo Game;
29 |
30 | bool editMode;
31 |
32 | private DlgGame()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | public DlgGame(GameList data, GameInfo game = null)
38 | : this()
39 | {
40 | Data = data;
41 | Game = game;
42 | editMode = Game != null;
43 | }
44 |
45 | private void GameDlg_Load(object sender, EventArgs e)
46 | {
47 | if (editMode)
48 | {
49 | Text = GlobalStrings.DlgGame_EditGame;
50 | txtId.Text = Game.Id.ToString();
51 | txtName.Text = Game.Name;
52 | txtCategory.Text = Game.GetCatString();
53 | txtExecutable.Text = Game.Executable;
54 | chkFavorite.Checked = Game.IsFavorite();
55 | chkHidden.Checked = Game.Hidden;
56 | txtId.ReadOnly = true;
57 | }
58 | else
59 | {
60 | Text = GlobalStrings.DlgGame_CreateGame;
61 | }
62 | }
63 |
64 | private void cmdCancel_Click(object sender, EventArgs e)
65 | {
66 | DialogResult = DialogResult.Cancel;
67 | Close();
68 | }
69 |
70 | private void cmdOk_Click(object sender, EventArgs e)
71 | {
72 | if (editMode)
73 | {
74 | Game.Name = txtName.Text;
75 | Game.Executable = txtExecutable.Text;
76 | }
77 | else
78 | {
79 | int id;
80 | if (!int.TryParse(txtId.Text, out id))
81 | {
82 | MessageBox.Show(GlobalStrings.DlgGameDBEntry_IDMustBeInteger, GlobalStrings.Gen_Warning,
83 | MessageBoxButtons.OK, MessageBoxIcon.Warning);
84 | return;
85 | }
86 | if (Data.Games.ContainsKey(id))
87 | {
88 | MessageBox.Show(GlobalStrings.DBEditDlg_GameIdAlreadyExists, GlobalStrings.DBEditDlg_Error,
89 | MessageBoxButtons.OK, MessageBoxIcon.Error);
90 | return;
91 | }
92 | Game = new GameInfo(id, txtName.Text, Data, txtExecutable.Text);
93 | Game.ApplySource(GameListingSource.Manual);
94 | Data.Games.Add(id, Game);
95 | }
96 |
97 | Game.SetFavorite(chkFavorite.Checked);
98 |
99 | Game.Hidden = chkHidden.Checked;
100 |
101 | DialogResult = DialogResult.OK;
102 | Close();
103 | }
104 |
105 | private void btnBrowse_Click(object sender, EventArgs e)
106 | {
107 | OpenFileDialog dlg = new OpenFileDialog();
108 |
109 | try
110 | {
111 | FileInfo f = new FileInfo(txtExecutable.Text);
112 | dlg.InitialDirectory = f.DirectoryName;
113 | dlg.FileName = f.Name;
114 | }
115 | catch (ArgumentException) { }
116 |
117 | DialogResult res = dlg.ShowDialog();
118 | if (res == DialogResult.OK)
119 | {
120 | txtExecutable.Text = dlg.FileName;
121 | }
122 | }
123 | }
124 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgGame.ru.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgGame.uk.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgManualDownload.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Depressurizer {
20 | partial class DlgManualDownload {
21 | ///
22 | /// Required designer variable.
23 | ///
24 | private System.ComponentModel.IContainer components = null;
25 |
26 | ///
27 | /// Clean up any resources being used.
28 | ///
29 | /// true if managed resources should be disposed; otherwise, false.
30 | protected override void Dispose( bool disposing ) {
31 | if( disposing && ( components != null ) ) {
32 | components.Dispose();
33 | }
34 | base.Dispose( disposing );
35 | }
36 |
37 | #region Windows Form Designer generated code
38 |
39 | ///
40 | /// Required method for Designer support - do not modify
41 | /// the contents of this method with the code editor.
42 | ///
43 | private void InitializeComponent() {
44 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgManualDownload));
45 | this.radId = new System.Windows.Forms.RadioButton();
46 | this.radUrl = new System.Windows.Forms.RadioButton();
47 | this.cmdCancel = new System.Windows.Forms.Button();
48 | this.cmdOk = new System.Windows.Forms.Button();
49 | this.txtEntry = new System.Windows.Forms.TextBox();
50 | this.lblEnter = new System.Windows.Forms.Label();
51 | this.SuspendLayout();
52 | //
53 | // radId
54 | //
55 | resources.ApplyResources(this.radId, "radId");
56 | this.radId.Name = "radId";
57 | this.radId.UseVisualStyleBackColor = true;
58 | //
59 | // radUrl
60 | //
61 | resources.ApplyResources(this.radUrl, "radUrl");
62 | this.radUrl.Checked = true;
63 | this.radUrl.Name = "radUrl";
64 | this.radUrl.TabStop = true;
65 | this.radUrl.UseVisualStyleBackColor = true;
66 | //
67 | // cmdCancel
68 | //
69 | resources.ApplyResources(this.cmdCancel, "cmdCancel");
70 | this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
71 | this.cmdCancel.Name = "cmdCancel";
72 | this.cmdCancel.UseVisualStyleBackColor = true;
73 | //
74 | // cmdOk
75 | //
76 | resources.ApplyResources(this.cmdOk, "cmdOk");
77 | this.cmdOk.Name = "cmdOk";
78 | this.cmdOk.UseVisualStyleBackColor = true;
79 | this.cmdOk.Click += new System.EventHandler(this.cmdOk_Click);
80 | //
81 | // txtEntry
82 | //
83 | resources.ApplyResources(this.txtEntry, "txtEntry");
84 | this.txtEntry.Name = "txtEntry";
85 | //
86 | // lblEnter
87 | //
88 | resources.ApplyResources(this.lblEnter, "lblEnter");
89 | this.lblEnter.Name = "lblEnter";
90 | //
91 | // DlgManualDownload
92 | //
93 | this.AcceptButton = this.cmdOk;
94 | resources.ApplyResources(this, "$this");
95 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
96 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
97 | this.CancelButton = this.cmdCancel;
98 | this.ControlBox = false;
99 | this.Controls.Add(this.lblEnter);
100 | this.Controls.Add(this.txtEntry);
101 | this.Controls.Add(this.cmdOk);
102 | this.Controls.Add(this.cmdCancel);
103 | this.Controls.Add(this.radUrl);
104 | this.Controls.Add(this.radId);
105 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
106 | this.MaximizeBox = false;
107 | this.MinimizeBox = false;
108 | this.Name = "DlgManualDownload";
109 | this.ShowInTaskbar = false;
110 | this.ResumeLayout(false);
111 | this.PerformLayout();
112 |
113 | }
114 |
115 | #endregion
116 |
117 | private System.Windows.Forms.RadioButton radId;
118 | private System.Windows.Forms.RadioButton radUrl;
119 | private System.Windows.Forms.Button cmdCancel;
120 | private System.Windows.Forms.Button cmdOk;
121 | private System.Windows.Forms.TextBox txtEntry;
122 | private System.Windows.Forms.Label lblEnter;
123 | }
124 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgManualDownload.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Windows.Forms;
21 |
22 | namespace Depressurizer
23 | {
24 | public partial class DlgManualDownload : Form
25 | {
26 | public Int64 IdVal;
27 | public string UrlVal;
28 | public bool Custom;
29 |
30 | public DlgManualDownload()
31 | {
32 | InitializeComponent();
33 | }
34 |
35 | private void cmdOk_Click(object sender, EventArgs e)
36 | {
37 | if (radId.Checked)
38 | {
39 | if (Int64.TryParse(txtEntry.Text, out IdVal))
40 | {
41 | Custom = false;
42 | DialogResult = DialogResult.OK;
43 | Close();
44 | }
45 | else
46 | {
47 | MessageBox.Show(this, GlobalStrings.DlgManualDownload_IfIDSelectedMustBeNumber);
48 | }
49 | }
50 | else
51 | {
52 | Custom = true;
53 | UrlVal = txtEntry.Text;
54 | DialogResult = DialogResult.OK;
55 | Close();
56 | }
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgOptions.ru.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/src/Depressurizer/DlgRestore.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Depressurizer {
20 | partial class DlgRestore {
21 | ///
22 | /// Required designer variable.
23 | ///
24 | private System.ComponentModel.IContainer components = null;
25 |
26 | ///
27 | /// Clean up any resources being used.
28 | ///
29 | /// true if managed resources should be disposed; otherwise, false.
30 | protected override void Dispose( bool disposing ) {
31 | if( disposing && ( components != null ) ) {
32 | components.Dispose();
33 | }
34 | base.Dispose( disposing );
35 | }
36 |
37 | #region Windows Form Designer generated code
38 |
39 | ///
40 | /// Required method for Designer support - do not modify
41 | /// the contents of this method with the code editor.
42 | ///
43 | private void InitializeComponent() {
44 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgRestore));
45 | this.cboRestore = new System.Windows.Forms.ComboBox();
46 | this.btnRestore = new System.Windows.Forms.Button();
47 | this.lblProfile = new System.Windows.Forms.Label();
48 | this.rtbRestore = new System.Windows.Forms.RichTextBox();
49 | this.btnCancel = new System.Windows.Forms.Button();
50 | this.label1 = new System.Windows.Forms.Label();
51 | this.lblDateStamp = new System.Windows.Forms.Label();
52 | this.lblSize = new System.Windows.Forms.Label();
53 | this.SuspendLayout();
54 | //
55 | // cboRestore
56 | //
57 | resources.ApplyResources(this.cboRestore, "cboRestore");
58 | this.cboRestore.FormattingEnabled = true;
59 | this.cboRestore.Name = "cboRestore";
60 | this.cboRestore.SelectedIndexChanged += new System.EventHandler(this.cboRestore_SelectedIndexChanged);
61 | //
62 | // btnRestore
63 | //
64 | resources.ApplyResources(this.btnRestore, "btnRestore");
65 | this.btnRestore.Name = "btnRestore";
66 | this.btnRestore.UseVisualStyleBackColor = true;
67 | this.btnRestore.Click += new System.EventHandler(this.btnRestore_Click);
68 | //
69 | // lblProfile
70 | //
71 | resources.ApplyResources(this.lblProfile, "lblProfile");
72 | this.lblProfile.Name = "lblProfile";
73 | //
74 | // rtbRestore
75 | //
76 | resources.ApplyResources(this.rtbRestore, "rtbRestore");
77 | this.rtbRestore.Name = "rtbRestore";
78 | this.rtbRestore.ReadOnly = true;
79 | //
80 | // btnCancel
81 | //
82 | resources.ApplyResources(this.btnCancel, "btnCancel");
83 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
84 | this.btnCancel.Name = "btnCancel";
85 | this.btnCancel.UseVisualStyleBackColor = true;
86 | //
87 | // label1
88 | //
89 | resources.ApplyResources(this.label1, "label1");
90 | this.label1.Name = "label1";
91 | //
92 | // lblDateStamp
93 | //
94 | resources.ApplyResources(this.lblDateStamp, "lblDateStamp");
95 | this.lblDateStamp.Name = "lblDateStamp";
96 | //
97 | // lblSize
98 | //
99 | resources.ApplyResources(this.lblSize, "lblSize");
100 | this.lblSize.Name = "lblSize";
101 | //
102 | // DlgRestore
103 | //
104 | resources.ApplyResources(this, "$this");
105 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
106 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
107 | this.ControlBox = false;
108 | this.Controls.Add(this.lblSize);
109 | this.Controls.Add(this.lblDateStamp);
110 | this.Controls.Add(this.label1);
111 | this.Controls.Add(this.btnCancel);
112 | this.Controls.Add(this.rtbRestore);
113 | this.Controls.Add(this.lblProfile);
114 | this.Controls.Add(this.btnRestore);
115 | this.Controls.Add(this.cboRestore);
116 | this.Name = "DlgRestore";
117 | this.ShowInTaskbar = false;
118 | this.ResumeLayout(false);
119 | this.PerformLayout();
120 |
121 | }
122 |
123 | #endregion
124 | private System.Windows.Forms.ComboBox cboRestore;
125 | private System.Windows.Forms.Button btnRestore;
126 | private System.Windows.Forms.Label lblProfile;
127 | private System.Windows.Forms.RichTextBox rtbRestore;
128 | private System.Windows.Forms.Button btnCancel;
129 | private System.Windows.Forms.Label label1;
130 | private System.Windows.Forms.Label lblDateStamp;
131 | private System.Windows.Forms.Label lblSize;
132 | }
133 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgRestore.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.IO;
21 | using System.Linq;
22 | using System.Windows.Forms;
23 |
24 | namespace Depressurizer
25 | {
26 | public partial class DlgRestore : Form
27 | {
28 | public bool Restored;
29 |
30 | public DlgRestore(string path)
31 | {
32 | InitializeComponent();
33 |
34 | var files = Directory.EnumerateFiles(path, "*.*", SearchOption.TopDirectoryOnly)
35 | .Where(s => s.EndsWith(".bak_1") || s.EndsWith(".bak_2") || s.EndsWith(".bak_3"));
36 |
37 | foreach (string f in files)
38 | {
39 | cboRestore.Items.Add(new ComboItem(Path.GetFileName(f), f));
40 | }
41 | }
42 |
43 | private void cboRestore_SelectedIndexChanged(object sender, EventArgs e)
44 | {
45 | if (File.Exists(((ComboItem) cboRestore.SelectedItem).Path))
46 | {
47 | rtbRestore.Text = "";
48 | string path = ((ComboItem) cboRestore.SelectedItem).Path;
49 | rtbRestore.Text = File.ReadAllText(path);
50 | DateTime dt = File.GetLastWriteTime(path);
51 | long length = new FileInfo(path).Length;
52 | length = length / 1024;
53 | lblDateStamp.Text = dt.ToString();
54 | lblSize.Text = length + " KB";
55 | btnRestore.Enabled = true;
56 | }
57 | else
58 | {
59 | btnRestore.Enabled = false;
60 | }
61 | }
62 |
63 | private void btnRestore_Click(object sender, EventArgs e)
64 | {
65 | string name = ((ComboItem) cboRestore.SelectedItem).Name;
66 | string message = name.Contains("vdf")
67 | ? String.Format(GlobalStrings.DlgRestore_ConfigConfirm, name)
68 | : String.Format(GlobalStrings.DlgRestore_ProfileConfirm, name);
69 | DialogResult result = MessageBox.Show(message, GlobalStrings.MainForm_Overwrite, MessageBoxButtons.YesNo,
70 | MessageBoxIcon.Warning);
71 |
72 | if (result == DialogResult.Yes)
73 | {
74 | if (((ComboItem) cboRestore.SelectedItem).Restore())
75 | {
76 | Restored = true;
77 | Close();
78 | }
79 | }
80 | }
81 |
82 | private void btnCancel_Click(object sender, EventArgs e)
83 | {
84 | Close();
85 | }
86 | }
87 |
88 | class ComboItem
89 | {
90 | public string Name { get; set; }
91 | public string Path { get; set; }
92 |
93 | public ComboItem(string name, string path)
94 | {
95 | Name = name;
96 | Path = path;
97 | }
98 |
99 | public override string ToString()
100 | {
101 | return Name;
102 | }
103 |
104 | public bool Restore()
105 | {
106 | string file = System.IO.Path.GetFileNameWithoutExtension(Path);
107 | string path = System.IO.Path.GetDirectoryName(Path);
108 | file = System.IO.Path.Combine(path, file);
109 | try
110 | {
111 | File.Copy(Path, file, true);
112 | return true;
113 | }
114 | catch
115 | {
116 | return false;
117 | }
118 | }
119 | }
120 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgSteamPath.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Depressurizer {
20 | partial class DlgSteamPath {
21 | ///
22 | /// Required designer variable.
23 | ///
24 | private System.ComponentModel.IContainer components = null;
25 |
26 | ///
27 | /// Clean up any resources being used.
28 | ///
29 | /// true if managed resources should be disposed; otherwise, false.
30 | protected override void Dispose( bool disposing ) {
31 | if( disposing && ( components != null ) ) {
32 | components.Dispose();
33 | }
34 | base.Dispose( disposing );
35 | }
36 |
37 | #region Windows Form Designer generated code
38 |
39 | ///
40 | /// Required method for Designer support - do not modify
41 | /// the contents of this method with the code editor.
42 | ///
43 | private void InitializeComponent() {
44 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgSteamPath));
45 | this.txtPath = new System.Windows.Forms.TextBox();
46 | this.cmdBrowse = new System.Windows.Forms.Button();
47 | this.cmdOk = new System.Windows.Forms.Button();
48 | this.lblPathLabel = new System.Windows.Forms.Label();
49 | this.SuspendLayout();
50 | //
51 | // txtPath
52 | //
53 | resources.ApplyResources(this.txtPath, "txtPath");
54 | this.txtPath.Name = "txtPath";
55 | //
56 | // cmdBrowse
57 | //
58 | resources.ApplyResources(this.cmdBrowse, "cmdBrowse");
59 | this.cmdBrowse.Name = "cmdBrowse";
60 | this.cmdBrowse.UseVisualStyleBackColor = true;
61 | this.cmdBrowse.Click += new System.EventHandler(this.cmdBrowse_Click);
62 | //
63 | // cmdOk
64 | //
65 | resources.ApplyResources(this.cmdOk, "cmdOk");
66 | this.cmdOk.Name = "cmdOk";
67 | this.cmdOk.UseVisualStyleBackColor = true;
68 | this.cmdOk.Click += new System.EventHandler(this.cmdOk_Click);
69 | //
70 | // lblPathLabel
71 | //
72 | resources.ApplyResources(this.lblPathLabel, "lblPathLabel");
73 | this.lblPathLabel.Name = "lblPathLabel";
74 | //
75 | // DlgSteamPath
76 | //
77 | this.AcceptButton = this.cmdOk;
78 | resources.ApplyResources(this, "$this");
79 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
80 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
81 | this.ControlBox = false;
82 | this.Controls.Add(this.lblPathLabel);
83 | this.Controls.Add(this.cmdOk);
84 | this.Controls.Add(this.cmdBrowse);
85 | this.Controls.Add(this.txtPath);
86 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
87 | this.Name = "DlgSteamPath";
88 | this.ShowInTaskbar = false;
89 | this.ResumeLayout(false);
90 | this.PerformLayout();
91 |
92 | }
93 |
94 | #endregion
95 |
96 | private System.Windows.Forms.TextBox txtPath;
97 | private System.Windows.Forms.Button cmdBrowse;
98 | private System.Windows.Forms.Button cmdOk;
99 | private System.Windows.Forms.Label lblPathLabel;
100 | }
101 | }
--------------------------------------------------------------------------------
/src/Depressurizer/DlgSteamPath.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.IO;
21 | using System.Windows.Forms;
22 | using Microsoft.Win32;
23 |
24 | namespace Depressurizer
25 | {
26 | public partial class DlgSteamPath : Form
27 | {
28 | public string Path
29 | {
30 | get { return txtPath.Text.Trim().TrimEnd('\\'); }
31 | }
32 |
33 | public DlgSteamPath()
34 | {
35 | InitializeComponent();
36 | txtPath.Text = GetSteamPath();
37 | }
38 |
39 | private void cmdOk_Click(object sender, EventArgs e)
40 | {
41 | if (!Directory.Exists(Path))
42 | {
43 | DialogResult res = MessageBox.Show(GlobalStrings.DlgSteamPath_ThatPathDoesNotExist,
44 | GlobalStrings.Gen_Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
45 | MessageBoxDefaultButton.Button2);
46 | if (res == DialogResult.No)
47 | {
48 | return;
49 | }
50 | }
51 | Close();
52 | }
53 |
54 | private void cmdBrowse_Click(object sender, EventArgs e)
55 | {
56 | FolderBrowserDialog dlg = new FolderBrowserDialog();
57 | DialogResult res = dlg.ShowDialog();
58 | if (res == DialogResult.OK)
59 | {
60 | txtPath.Text = dlg.SelectedPath;
61 | }
62 | }
63 |
64 | private string GetSteamPath()
65 | {
66 | try
67 | {
68 | string s = Registry.GetValue(@"HKEY_CURRENT_USER\Software\Valve\Steam", "steamPath", null) as string;
69 | if (s == null) s = string.Empty;
70 | return s.Replace('/', '\\');
71 | }
72 | catch
73 | {
74 | return string.Empty;
75 | }
76 | }
77 | }
78 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Filter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Xml;
4 | using Rallion;
5 |
6 | namespace Depressurizer
7 | {
8 | public class Filter : IComparable
9 | {
10 | // Serialization strings
11 | private const string TypeIdString = "Filter";
12 |
13 | private const string
14 | XmlName_Name = "Name",
15 | XmlName_Uncategorized = "Uncategorized",
16 | XmlName_Hidden = "Hidden",
17 | XmlName_VR = "VR",
18 | XmlName_Allow = "Allow",
19 | XmlName_Require = "Require",
20 | XmlName_Exclude = "Exclude";
21 |
22 | public Filter(string name)
23 | {
24 | Name = name;
25 | Uncategorized = -1;
26 | Hidden = -1;
27 | VR = -1;
28 | Allow = new SortedSet();
29 | Require = new SortedSet();
30 | Exclude = new SortedSet();
31 | }
32 |
33 | public override string ToString()
34 | {
35 | return Name;
36 | }
37 |
38 | public string Name;
39 | public int Uncategorized;
40 | public int Hidden;
41 | public int VR;
42 |
43 | private SortedSet _allow;
44 |
45 | public SortedSet Allow
46 | {
47 | get { return _allow; }
48 | set
49 | {
50 | _allow = new SortedSet(value);
51 | //foreach (Category c in value)
52 | //{
53 | // _allow.Add(c);
54 | //}
55 | }
56 | }
57 |
58 | private SortedSet _require;
59 |
60 | public SortedSet Require
61 | {
62 | get { return _require; }
63 | set
64 | {
65 | _require = new SortedSet(value);
66 | //foreach (Category c in value)
67 | //{
68 | // _require.Add(c);
69 | //}
70 | }
71 | }
72 |
73 | private SortedSet _exclude;
74 |
75 | public SortedSet Exclude
76 | {
77 | get { return _exclude; }
78 | set
79 | {
80 | _exclude = new SortedSet(value);
81 | //foreach (Category c in value)
82 | //{
83 | // _exclude.Add(c);
84 | //}
85 | }
86 | }
87 |
88 | public int CompareTo(object o)
89 | {
90 | if (o == null) return 1;
91 |
92 | Filter otherFilter = o as Filter;
93 | if (o == null) throw new ArgumentException(GlobalStrings.Category_Exception_ObjectNotCategory);
94 |
95 | int comp = String.Compare(Name, otherFilter.Name, StringComparison.OrdinalIgnoreCase);
96 |
97 | if (comp == 0) return 0;
98 |
99 | return comp;
100 | }
101 |
102 | public void WriteToXml(XmlWriter writer)
103 | {
104 | Program.Logger.Write(LoggerLevel.Info, GlobalStrings.Filter_SavingFilter, Name);
105 |
106 | writer.WriteStartElement(TypeIdString);
107 |
108 | writer.WriteElementString(XmlName_Name, Name);
109 | writer.WriteElementString(XmlName_Uncategorized, Uncategorized.ToString());
110 | writer.WriteElementString(XmlName_Hidden, Hidden.ToString());
111 | writer.WriteElementString(XmlName_VR, VR.ToString());
112 |
113 | foreach (Category c in Allow)
114 | {
115 | writer.WriteElementString(XmlName_Allow, c.Name);
116 | }
117 |
118 | foreach (Category c in Require)
119 | {
120 | writer.WriteElementString(XmlName_Require, c.Name);
121 | }
122 |
123 | foreach (Category c in Exclude)
124 | {
125 | writer.WriteElementString(XmlName_Exclude, c.Name);
126 | }
127 |
128 | writer.WriteEndElement(); // Filter
129 |
130 | Program.Logger.Write(LoggerLevel.Info, GlobalStrings.Filter_FilterSaveComplete);
131 | }
132 | }
133 | }
--------------------------------------------------------------------------------
/src/Depressurizer/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Depressurizer/GameBanners.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Windows.Forms;
4 |
5 | namespace Depressurizer
6 | {
7 | class GameBanners
8 | {
9 | private volatile bool _shouldStop;
10 | private List _games;
11 |
12 | public GameBanners(List games)
13 | {
14 | _games = games;
15 | }
16 |
17 | public void Grab()
18 | {
19 | foreach (GameInfo g in _games)
20 | {
21 | if (_shouldStop)
22 | {
23 | return;
24 | }
25 |
26 | if (g.Id < 0) continue; //external game
27 | string bannerFile = string.Format(Properties.Resources.GameBannerPath,
28 | Path.GetDirectoryName(Application.ExecutablePath), g.Id);
29 | if (!File.Exists(bannerFile))
30 | {
31 | Utility.GrabBanner(g.Id);
32 | }
33 | }
34 | }
35 |
36 | public void Stop()
37 | {
38 | _shouldStop = true;
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/src/Depressurizer/GlobalStrings.es.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/GlobalStrings.es.Designer.cs
--------------------------------------------------------------------------------
/src/Depressurizer/GlobalStrings.nl.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/GlobalStrings.nl.Designer.cs
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/AppSettings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.IO;
21 | using System.Reflection;
22 | using System.Xml;
23 |
24 | namespace Rallion
25 | {
26 | ///
27 | /// Base class for a settings object. Capable of loading and saving values of all public properties.
28 | ///
29 | abstract class AppSettings
30 | {
31 | protected readonly object threadLock = new object();
32 |
33 | protected bool outOfDate;
34 |
35 | public string FilePath;
36 |
37 | protected AppSettings()
38 | {
39 | FilePath = "Settings.xml";
40 | }
41 |
42 | ///
43 | /// Saves the contents of this instance to the defined config file.
44 | ///
45 | /// If false, will only save if the flag indicates that changes have been made. If true, always saves.
46 | public void Save(bool force = false)
47 | {
48 | if (force || outOfDate)
49 | {
50 | Type t = GetType();
51 |
52 | PropertyInfo[] properties = t.GetProperties();
53 | XmlDocument doc = new XmlDocument();
54 | XmlElement config = doc.CreateElement("config");
55 | lock (threadLock)
56 | {
57 | foreach (PropertyInfo pi in properties)
58 | {
59 | object val = pi.GetValue(this, null);
60 | if (val != null)
61 | {
62 | XmlElement element = doc.CreateElement(pi.Name);
63 | element.InnerText = val.ToString();
64 | config.AppendChild(element);
65 | }
66 | }
67 | }
68 | doc.AppendChild(config);
69 | try
70 | {
71 | doc.Save(FilePath);
72 | }
73 | catch (IOException) { }
74 | outOfDate = false;
75 | }
76 | }
77 |
78 | ///
79 | /// Loads settings from the defined config file.
80 | ///
81 | public virtual void Load()
82 | {
83 | Type type = GetType();
84 | if (File.Exists(FilePath))
85 | {
86 | XmlDocument doc = new XmlDocument();
87 | try
88 | {
89 | doc.Load(FilePath);
90 | XmlNode configNode = doc.SelectSingleNode("/config");
91 | lock (threadLock)
92 | {
93 | foreach (XmlNode node in configNode.ChildNodes)
94 | {
95 | string name = node.Name;
96 | string value = node.InnerText;
97 | PropertyInfo pi = type.GetProperty(name);
98 | if (pi != null)
99 | {
100 | SetProperty(pi, value);
101 | }
102 | }
103 | }
104 | }
105 | catch (XmlException) { }
106 | catch (IOException) { }
107 | outOfDate = false;
108 | }
109 | }
110 |
111 | private void SetProperty(PropertyInfo propertyInfo, string value)
112 | {
113 | try
114 | {
115 | if (propertyInfo.PropertyType.IsEnum)
116 | {
117 | object eVal = Enum.Parse(propertyInfo.PropertyType, value, true);
118 | propertyInfo.SetValue(this, eVal, null);
119 | }
120 | else if (propertyInfo.PropertyType == typeof(string))
121 | {
122 | propertyInfo.SetValue(this, value, null);
123 | }
124 | else if (propertyInfo.PropertyType == typeof(bool))
125 | {
126 | propertyInfo.SetValue(this, bool.Parse(value), null);
127 | }
128 | else if (propertyInfo.PropertyType == typeof(int))
129 | {
130 | propertyInfo.SetValue(this, int.Parse(value), null);
131 | }
132 | }
133 | catch { }
134 | }
135 | }
136 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/CancelableDlg.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Rallion {
20 | partial class CancelableDlg {
21 | ///
22 | /// Required designer variable.
23 | ///
24 | private System.ComponentModel.IContainer components = null;
25 |
26 | ///
27 | /// Clean up any resources being used.
28 | ///
29 | /// true if managed resources should be disposed; otherwise, false.
30 | protected override void Dispose( bool disposing ) {
31 | if( disposing && ( components != null ) ) {
32 | components.Dispose();
33 | }
34 | base.Dispose( disposing );
35 | }
36 |
37 | #region Windows Form Designer generated code
38 |
39 | ///
40 | /// Required method for Designer support - do not modify
41 | /// the contents of this method with the code editor.
42 | ///
43 | private void InitializeComponent() {
44 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CancelableDlg));
45 | this.lblText = new System.Windows.Forms.Label();
46 | this.cmdStop = new System.Windows.Forms.Button();
47 | this.cmdCancel = new System.Windows.Forms.Button();
48 | this.SuspendLayout();
49 | //
50 | // lblText
51 | //
52 | resources.ApplyResources(this.lblText, "lblText");
53 | this.lblText.Name = "lblText";
54 | //
55 | // cmdStop
56 | //
57 | resources.ApplyResources(this.cmdStop, "cmdStop");
58 | this.cmdStop.Name = "cmdStop";
59 | this.cmdStop.UseVisualStyleBackColor = true;
60 | this.cmdStop.Click += new System.EventHandler(this.cmdStop_Click);
61 | //
62 | // cmdCancel
63 | //
64 | resources.ApplyResources(this.cmdCancel, "cmdCancel");
65 | this.cmdCancel.Name = "cmdCancel";
66 | this.cmdCancel.UseVisualStyleBackColor = true;
67 | this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
68 | //
69 | // CancelableDlg
70 | //
71 | resources.ApplyResources(this, "$this");
72 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
73 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
74 | this.ControlBox = false;
75 | this.Controls.Add(this.cmdCancel);
76 | this.Controls.Add(this.cmdStop);
77 | this.Controls.Add(this.lblText);
78 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
79 | this.Name = "CancelableDlg";
80 | this.ShowInTaskbar = false;
81 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdateForm_FormClosing);
82 | this.Load += new System.EventHandler(this.UpdateForm_Load);
83 | this.ResumeLayout(false);
84 | this.PerformLayout();
85 |
86 | }
87 |
88 | #endregion
89 |
90 | private System.Windows.Forms.Label lblText;
91 | private System.Windows.Forms.Button cmdStop;
92 | private System.Windows.Forms.Button cmdCancel;
93 | }
94 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/DlgGetString.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 | namespace Rallion {
20 | partial class GetStringDlg {
21 | ///
22 | /// Required designer variable.
23 | ///
24 | private System.ComponentModel.IContainer components = null;
25 |
26 | ///
27 | /// Clean up any resources being used.
28 | ///
29 | /// true if managed resources should be disposed; otherwise, false.
30 | protected override void Dispose( bool disposing ) {
31 | if( disposing && ( components != null ) ) {
32 | components.Dispose();
33 | }
34 | base.Dispose( disposing );
35 | }
36 |
37 | #region Windows Form Designer generated code
38 |
39 | ///
40 | /// Required method for Designer support - do not modify
41 | /// the contents of this method with the code editor.
42 | ///
43 | private void InitializeComponent() {
44 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GetStringDlg));
45 | this.lblValue = new System.Windows.Forms.Label();
46 | this.txtValue = new System.Windows.Forms.TextBox();
47 | this.cmdCancel = new System.Windows.Forms.Button();
48 | this.cmdOk = new System.Windows.Forms.Button();
49 | this.SuspendLayout();
50 | //
51 | // lblValue
52 | //
53 | resources.ApplyResources(this.lblValue, "lblValue");
54 | this.lblValue.Name = "lblValue";
55 | //
56 | // txtValue
57 | //
58 | resources.ApplyResources(this.txtValue, "txtValue");
59 | this.txtValue.Name = "txtValue";
60 | //
61 | // cmdCancel
62 | //
63 | resources.ApplyResources(this.cmdCancel, "cmdCancel");
64 | this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
65 | this.cmdCancel.Name = "cmdCancel";
66 | this.cmdCancel.UseVisualStyleBackColor = true;
67 | //
68 | // cmdOk
69 | //
70 | resources.ApplyResources(this.cmdOk, "cmdOk");
71 | this.cmdOk.DialogResult = System.Windows.Forms.DialogResult.OK;
72 | this.cmdOk.Name = "cmdOk";
73 | this.cmdOk.UseVisualStyleBackColor = true;
74 | //
75 | // GetStringDlg
76 | //
77 | this.AcceptButton = this.cmdOk;
78 | resources.ApplyResources(this, "$this");
79 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
80 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
81 | this.CancelButton = this.cmdCancel;
82 | this.ControlBox = false;
83 | this.Controls.Add(this.cmdOk);
84 | this.Controls.Add(this.cmdCancel);
85 | this.Controls.Add(this.txtValue);
86 | this.Controls.Add(this.lblValue);
87 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
88 | this.Name = "GetStringDlg";
89 | this.ShowInTaskbar = false;
90 | this.ResumeLayout(false);
91 | this.PerformLayout();
92 |
93 | }
94 |
95 | #endregion
96 |
97 | private System.Windows.Forms.Label lblValue;
98 | private System.Windows.Forms.TextBox txtValue;
99 | private System.Windows.Forms.Button cmdCancel;
100 | private System.Windows.Forms.Button cmdOk;
101 | }
102 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/DlgGetString.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System.Windows.Forms;
20 |
21 | namespace Rallion
22 | {
23 | public partial class GetStringDlg : Form
24 | {
25 | public string Value
26 | {
27 | get { return txtValue.Text; }
28 | set { txtValue.Text = (value == null) ? string.Empty : value; }
29 | }
30 |
31 | public string LabelText
32 | {
33 | set { lblValue.Text = (value == null) ? string.Empty : value; }
34 | }
35 |
36 | public string AcceptButtonText
37 | {
38 | set { cmdOk.Text = (value == null) ? string.Empty : value; }
39 | }
40 |
41 | public GetStringDlg(string initialValue = "", string title = "Enter value", string label = "Enter value:",
42 | string accept = "OK")
43 | {
44 | InitializeComponent();
45 | Value = initialValue;
46 | Text = title;
47 | LabelText = label;
48 | AcceptButtonText = accept;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/ExtListView.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer.Lib
24 | {
25 | class ExtListView : ListView
26 | {
27 | public event EventHandler SelectionChanged;
28 |
29 | private bool isSelecting;
30 | private IComparer suspendedComparer;
31 | private int suspendSortDepth;
32 |
33 | public ExtListView()
34 | {
35 | SelectedIndexChanged += ExtListView_SelectedIndexChanged;
36 | }
37 |
38 | public void ExtBeginUpdate()
39 | {
40 | BeginUpdate();
41 | SuspendSorting();
42 | }
43 |
44 | public void ExtEndUpdate()
45 | {
46 | EndUpdate();
47 | ResumeSorting(true);
48 | }
49 |
50 | ///
51 | /// Suspends sorting until ResumeSorting is called. Does so by clearing the ListViewItemSorter property.
52 | ///
53 | public void SuspendSorting()
54 | {
55 | if (suspendSortDepth == 0)
56 | {
57 | suspendedComparer = ListViewItemSorter;
58 | ListViewItemSorter = null;
59 | }
60 | suspendSortDepth++;
61 | }
62 |
63 | ///
64 | /// Resumes sorting after SuspendSorting has been called.
65 | ///
66 | /// If true, will sort immediately.
67 | public void ResumeSorting(bool sortNow = false)
68 | {
69 | if (suspendSortDepth == 0) return;
70 | if (suspendSortDepth == 1)
71 | {
72 | ListViewItemSorter = suspendedComparer;
73 | suspendedComparer = null;
74 | if (sortNow) Sort();
75 | }
76 | suspendSortDepth--;
77 | }
78 |
79 | void ExtListView_SelectedIndexChanged(object sender, EventArgs e)
80 | {
81 | if (!isSelecting)
82 | {
83 | isSelecting = true;
84 | Application.Idle += Application_Idle;
85 | }
86 | }
87 |
88 | void Application_Idle(object sender, EventArgs e)
89 | {
90 | isSelecting = false;
91 | Application.Idle -= Application_Idle;
92 | if (SelectionChanged != null)
93 | {
94 | SelectionChanged(this, new EventArgs());
95 | }
96 | }
97 | }
98 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Lib/ExtToolTip.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Windows.Forms;
22 |
23 | namespace Depressurizer.Lib
24 | {
25 | ///
26 | /// ToolTip extension that allows you to bypass timers and have the tooltip always show when the mouse is over a particular control.
27 | ///
28 | public class ExtToolTip : ToolTip
29 | {
30 | private Dictionary bindings = new Dictionary();
31 |
32 | ///
33 | /// Sets the tooltip text associated with a given control. The ToolTip will always show when the mouse is over this control.
34 | ///
35 | /// Control to apply the tooltip to
36 | /// String to show in the tooltip
37 | public void Ext_SetToolTip(Control c, string s)
38 | {
39 | bindings[c] = s;
40 | c.MouseEnter += Ext_Control_MouseEnter;
41 | c.MouseLeave += Ext_Control_MouseLeave;
42 | }
43 |
44 | private void Ext_Control_MouseLeave(object sender, EventArgs e)
45 | {
46 | Control c = sender as Control;
47 | if (c != null)
48 | {
49 | Hide(c);
50 | }
51 | }
52 |
53 | private void Ext_Control_MouseEnter(object sender, EventArgs e)
54 | {
55 | Control c = sender as Control;
56 | if (c != null)
57 | {
58 | if (bindings.ContainsKey(c))
59 | {
60 | string s = bindings[c];
61 | if (s != null)
62 | {
63 | Show(s, c, c.Width, c.Height);
64 | }
65 | }
66 | }
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/src/Depressurizer/ListViewComparer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace Depressurizer
6 | {
7 | // Compares two ListView items based on a selected column.
8 | public class ListViewComparer : System.Collections.IComparer
9 | {
10 | private int ColumnNumber;
11 | private SortOrder SortOrder;
12 |
13 | public ListViewComparer(int column_number,
14 | SortOrder sort_order)
15 | {
16 | ColumnNumber = column_number;
17 | SortOrder = sort_order;
18 | }
19 |
20 | // Compare two ListViewItems.
21 | public int Compare(object object_x, object object_y)
22 | {
23 | // Get the objects as ListViewItems.
24 | ListViewItem item_x = object_x as ListViewItem;
25 | ListViewItem item_y = object_y as ListViewItem;
26 |
27 | // Get the corresponding sub-item values.
28 | string string_x;
29 | string_x = item_x.SubItems.Count <= ColumnNumber ? "" : item_x.SubItems[ColumnNumber].Text;
30 |
31 | string string_y;
32 | string_y = item_y.SubItems.Count <= ColumnNumber ? "" : item_y.SubItems[ColumnNumber].Text;
33 |
34 | // Compare them.
35 | int result;
36 | double double_x, double_y;
37 | if (double.TryParse(string_x, out double_x) &&
38 | double.TryParse(string_y, out double_y))
39 | {
40 | // Treat as a number.
41 | result = double_x.CompareTo(double_y);
42 | }
43 | else
44 | {
45 | DateTime date_x, date_y;
46 | if (DateTime.TryParse(string_x, out date_x) &&
47 | DateTime.TryParse(string_y, out date_y))
48 | {
49 | // Treat as a date.
50 | result = date_x.CompareTo(date_y);
51 | }
52 | else
53 | {
54 | // Treat as a string.
55 | result = string_x.CompareTo(string_y);
56 | }
57 | }
58 |
59 | // Return the correct result depending on whether
60 | // we're sorting ascending or descending.
61 | if (SortOrder == SortOrder.Ascending)
62 | {
63 | return result;
64 | }
65 | return -result;
66 | }
67 | }
68 |
69 | // Compares two lstCategories items based on a selected column.
70 | public class lstCategoriesComparer : System.Collections.IComparer
71 | {
72 | public enum categorySortMode
73 | {
74 | Name,
75 | Count
76 | }
77 |
78 | private categorySortMode SortMode;
79 | private SortOrder SortOrder;
80 |
81 | public lstCategoriesComparer(categorySortMode sortMode,
82 | SortOrder sortOrder)
83 | {
84 | SortMode = sortMode;
85 | SortOrder = sortOrder;
86 | }
87 |
88 | // Compare two ListViewItems.
89 | public int Compare(object object_x, object object_y)
90 | {
91 | // Get the objects as ListViewItems.
92 | ListViewItem item_x = object_x as ListViewItem;
93 | ListViewItem item_y = object_y as ListViewItem;
94 |
95 | if (item_x == null) return 1;
96 | if (item_y == null) return -1;
97 |
98 | // Handle special categories
99 | List specialCategories = new List();
100 | specialCategories.Add(GlobalStrings.MainForm_All);
101 | specialCategories.Add(GlobalStrings.MainForm_Uncategorized);
102 | specialCategories.Add(GlobalStrings.MainForm_Hidden);
103 | specialCategories.Add(GlobalStrings.MainForm_Favorite);
104 | specialCategories.Add(GlobalStrings.MainForm_VR);
105 |
106 | foreach (string s in specialCategories)
107 | {
108 | if (item_x.Tag.ToString() == s) return -1;
109 | if (item_y.Tag.ToString() == s) return 1;
110 | }
111 |
112 | Category cat_x = item_x.Tag as Category;
113 | Category cat_y = item_y.Tag as Category;
114 |
115 | // Compare categories.
116 | int result;
117 |
118 | if (SortMode == categorySortMode.Count)
119 | {
120 | result = cat_x.Count.CompareTo(cat_y.Count);
121 | }
122 | else result = string.Compare(cat_x.Name, cat_y.Name, StringComparison.CurrentCultureIgnoreCase);
123 |
124 | // Return the correct result depending on whether
125 | // we're sorting ascending or descending.
126 | if (SortOrder == SortOrder.Ascending)
127 | {
128 | return result;
129 | }
130 | return -result;
131 | }
132 | }
133 | }
--------------------------------------------------------------------------------
/src/Depressurizer/OLD prgm2.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/OLD prgm2.ico
--------------------------------------------------------------------------------
/src/Depressurizer/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This file is part of Depressurizer.
3 | Copyright 2011, 2012, 2013 Steve Labbe.
4 |
5 | Depressurizer is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | Depressurizer is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with Depressurizer. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Windows.Forms;
21 | using NDesk.Options;
22 | using Rallion;
23 |
24 | namespace Depressurizer
25 | {
26 | static class Program
27 | {
28 | public static AppLogger Logger;
29 | public static GameDB GameDB;
30 |
31 | ///
32 | /// The main entry point for the application.
33 | ///
34 | [STAThread]
35 | static void Main(string[] args)
36 | {
37 | Application.EnableVisualStyles();
38 | Application.SetCompatibleTextRenderingDefault(false);
39 |
40 | FatalError.InitializeHandler();
41 |
42 | Logger = new AppLogger();
43 | Logger.Level = LoggerLevel.None;
44 | Logger.DateFormat = "HH:mm:ss'.'ffffff";
45 |
46 | Logger.MaxFileSize = 2000000;
47 | Logger.MaxBackup = 1;
48 | Logger.FileNameTemplate = "Depressurizer.log";
49 |
50 | Settings.Instance.Load();
51 |
52 | Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramInitialized, Logger.Level);
53 |
54 | AutomaticModeOptions autoOpts = ParseAutoOptions(args);
55 |
56 | if (autoOpts != null)
57 | {
58 | Logger.Write(LoggerLevel.Info, "Automatic mode set, loading automatic mode form.");
59 | Logger.WriteObject(LoggerLevel.Verbose, autoOpts, "Automatic Mode Options:");
60 | Application.Run(new AutomaticModeForm(autoOpts));
61 | }
62 | else
63 | {
64 | Logger.Write(LoggerLevel.Info, "Automatic mode not set, loading main form.");
65 | Application.Run(new FormMain());
66 | }
67 | Settings.Instance.Save();
68 |
69 | Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramClosing);
70 | Logger.EndSession();
71 | }
72 |
73 | static AutomaticModeOptions ParseAutoOptions(string[] args)
74 | {
75 | AutomaticModeOptions config = new AutomaticModeOptions();
76 | bool auto = false;
77 |
78 | var opts = new OptionSet
79 | {
80 | {"auto", v => auto = true},
81 | {"p|profile=", v => config.CustomProfile = v},
82 | {"checksteam", v => config.CheckSteam = (v != null)},
83 | {"closesteam", v => config.CloseSteam = (v != null)},
84 | {"updatelib", v => config.UpdateGameList = (v != null)},
85 | {"import", v => config.ImportSteamCategories = (v != null)},
86 | {"updatedblocal", v => config.UpdateAppInfo = (v != null)},
87 | {"updatedbhltb", v => config.UpdateHltb = (v != null)},
88 | {"updatedbweb", v => config.ScrapeUnscrapedGames = (v != null)},
89 | {"savedb", v => config.SaveDBChanges = (v != null)},
90 | {"saveprofile", v => config.SaveProfile = (v != null)},
91 | {"export", v => config.ExportToSteam = (v != null)},
92 | {"launch", v => config.SteamLaunch = SteamLaunchType.Normal},
93 | {"launchbp", v => config.SteamLaunch = SteamLaunchType.BigPicture},
94 | {"tolerant", v => config.TolerateMinorErrors = (v != null)},
95 | {"quiet", v => config.AutoClose = AutoCloseType.UnlessError},
96 | {"silent", v => config.AutoClose = AutoCloseType.Always},
97 | {"all", v => config.ApplyAllAutoCats = (v != null)},
98 | {"<>", v => config.AutoCats.Add(v)}
99 | };
100 |
101 | opts.Parse(args);
102 |
103 | return auto ? config : null;
104 | }
105 | }
106 | }
--------------------------------------------------------------------------------
/src/Depressurizer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011, 2012, 2013 Steve Labbe.
3 |
4 | This file is part of Depressurizer.
5 |
6 | Depressurizer is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | Depressurizer is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with Depressurizer. If not, see .
18 | */
19 |
20 | using System.Reflection;
21 | using System.Runtime.InteropServices;
22 |
23 | // General Information about an assembly is controlled through the following
24 | // set of attributes. Change these attribute values to modify the information
25 | // associated with an assembly.
26 | [assembly: AssemblyTitle("Depressurizer")]
27 | [assembly: AssemblyDescription("Steam Category Tool")]
28 | [assembly: AssemblyConfiguration("")]
29 | [assembly: AssemblyCompany("")]
30 | [assembly: AssemblyProduct("Depressurizer")]
31 | [assembly: AssemblyCopyright("Copyright © 2011–2017")]
32 | [assembly: AssemblyTrademark("")]
33 | [assembly: AssemblyCulture("")]
34 |
35 | // Setting ComVisible to false makes the types in this assembly not visible
36 | // to COM components. If you need to access a type in this assembly from
37 | // COM, set the ComVisible attribute to true on that type.
38 | [assembly: ComVisible(false)]
39 |
40 | // The following GUID is for the ID of the typelib if this project is exposed to COM
41 | [assembly: Guid("fba05c1b-8310-4c4a-853b-f691685cba25")]
42 |
43 | // Version information for an assembly consists of the following four values:
44 | //
45 | // Major Version
46 | // Minor Version
47 | // Build Number
48 | // Revision
49 | //
50 | // You can specify all the values or you can default the Build and Revision Numbers
51 | // by using the '*' as shown below:
52 | // [assembly: AssemblyVersion("1.0.*")]
53 | [assembly: AssemblyVersion("0.7.4.2")]
54 | [assembly: AssemblyFileVersion("0.7.4.2")]
--------------------------------------------------------------------------------
/src/Depressurizer/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
54 |
--------------------------------------------------------------------------------
/src/Depressurizer/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Depressurizer/depressurizer_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/depressurizer_icon.ico
--------------------------------------------------------------------------------
/src/Depressurizer/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Depressurizer/res/early_access_banner_english.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/early_access_banner_english.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/early_access_banner_russian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/early_access_banner_russian.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/early_access_banner_spanish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/early_access_banner_spanish.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/filterAll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/filterAll.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/filterAny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/filterAny.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/filterNone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/filterNone.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/tscbChecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/tscbChecked.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/tscbIndeterminate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/tscbIndeterminate.png
--------------------------------------------------------------------------------
/src/Depressurizer/res/tscbUnchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Theo47/Depressurizer/def604f88d8ddb969ead503b98cd6c0e090e4e06/src/Depressurizer/res/tscbUnchecked.png
--------------------------------------------------------------------------------