diff options
author | daniel-Jones <daniel@danieljon.es> | 2016-07-21 19:10:18 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2016-07-21 19:10:18 +0930 |
commit | b9224cb9de71995b9f89787d47b98f9bbb188d58 (patch) | |
tree | 8d45602c26d6ffc959da8df57d05dbf00bd1e9d5 | |
download | csgo_stats-b9224cb9de71995b9f89787d47b98f9bbb188d58.tar.gz csgo_stats-b9224cb9de71995b9f89787d47b98f9bbb188d58.zip |
first commit, basic program currently
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | csgo_stats.pro | 25 | ||||
-rw-r--r-- | csgo_stats.pro.user | 333 | ||||
-rw-r--r-- | file_download.cpp | 28 | ||||
-rw-r--r-- | file_download.h | 19 | ||||
-rw-r--r-- | main.cpp | 11 | ||||
-rw-r--r-- | stats_display_window.cpp | 49 | ||||
-rw-r--r-- | stats_display_window.h | 45 | ||||
-rw-r--r-- | stats_display_window.ui | 53 | ||||
-rw-r--r-- | user_select_dialog.cpp | 57 | ||||
-rw-r--r-- | user_select_dialog.h | 30 | ||||
-rw-r--r-- | user_select_dialog.ui | 72 |
12 files changed, 723 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..449efa3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# CS-GO-Qt-C-Statistics diff --git a/csgo_stats.pro b/csgo_stats.pro new file mode 100644 index 0000000..ef1f61c --- /dev/null +++ b/csgo_stats.pro @@ -0,0 +1,25 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-07-21T13:21:39 +# +#------------------------------------------------- + +QT += core gui network + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = csgo_stats +TEMPLATE = app + + +SOURCES += main.cpp\ + user_select_dialog.cpp \ + file_download.cpp \ + stats_display_window.cpp + +HEADERS += user_select_dialog.h \ + file_download.h \ + stats_display_window.h + +FORMS += user_select_dialog.ui \ + stats_display_window.ui diff --git a/csgo_stats.pro.user b/csgo_stats.pro.user new file mode 100644 index 0000000..5349ab4 --- /dev/null +++ b/csgo_stats.pro.user @@ -0,0 +1,333 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by QtCreator 4.0.3, 2016-07-21T13:21:40. --> +<qtcreator> + <data> + <variable>EnvironmentId</variable> + <value type="QByteArray">{c148e485-3cf0-4847-b5fd-56246b2688e8}</value> + </data> + <data> + <variable>ProjectExplorer.Project.ActiveTarget</variable> + <value type="int">0</value> + </data> + <data> + <variable>ProjectExplorer.Project.EditorSettings</variable> + <valuemap type="QVariantMap"> + <value type="bool" key="EditorConfiguration.AutoIndent">true</value> + <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> + <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> + <value type="QString" key="language">Cpp</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> + </valuemap> + </valuemap> + <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> + <value type="QString" key="language">QmlJS</value> + <valuemap type="QVariantMap" key="value"> + <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> + </valuemap> + </valuemap> + <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> + <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> + <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> + <value type="int" key="EditorConfiguration.IndentSize">4</value> + <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> + <value type="int" key="EditorConfiguration.MarginColumn">80</value> + <value type="bool" key="EditorConfiguration.MouseHiding">true</value> + <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> + <value type="int" key="EditorConfiguration.PaddingMode">1</value> + <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> + <value type="bool" key="EditorConfiguration.ShowMargin">false</value> + <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> + <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> + <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> + <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> + <value type="int" key="EditorConfiguration.TabSize">8</value> + <value type="bool" key="EditorConfiguration.UseGlobal">true</value> + <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> + <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> + <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> + <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> + <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.PluginSettings</variable> + <valuemap type="QVariantMap"/> + </data> + <data> + <variable>ProjectExplorer.Project.Target.0</variable> + <valuemap type="QVariantMap"> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{a6071b8b-a567-46c9-babb-33312c5773b5}</value> + <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> + <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/daniel_j/programming/c++/csgo_stats/build-csgo_stats-Desktop-Debug</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/daniel_j/programming/c++/csgo_stats/build-csgo_stats-Desktop-Release</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> + <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/daniel_j/programming/c++/csgo_stats/build-csgo_stats-Desktop-Profile</value> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> + <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> + <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> + </valuemap> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> + <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> + <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> + <value type="QString">-w</value> + <value type="QString">-r</value> + </valuelist> + <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> + <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> + <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> + <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> + <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> + <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> + <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> + <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> + </valuemap> + <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> + <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> + <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> + <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> + <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> + <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> + <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> + <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> + <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> + <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> + <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> + <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> + <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> + <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> + <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> + <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> + <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> + <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> + <value type="int">0</value> + <value type="int">1</value> + <value type="int">2</value> + <value type="int">3</value> + <value type="int">4</value> + <value type="int">5</value> + <value type="int">6</value> + <value type="int">7</value> + <value type="int">8</value> + <value type="int">9</value> + <value type="int">10</value> + <value type="int">11</value> + <value type="int">12</value> + <value type="int">13</value> + <value type="int">14</value> + </valuelist> + <value type="int" key="PE.EnvironmentAspect.Base">-1</value> + <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value> + <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> + <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> + <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> + <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> + <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> + <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> + <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> + </valuemap> + <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> + </valuemap> + </data> + <data> + <variable>ProjectExplorer.Project.TargetCount</variable> + <value type="int">1</value> + </data> + <data> + <variable>ProjectExplorer.Project.Updater.FileVersion</variable> + <value type="int">18</value> + </data> + <data> + <variable>Version</variable> + <value type="int">18</value> + </data> +</qtcreator> diff --git a/file_download.cpp b/file_download.cpp new file mode 100644 index 0000000..c155f8b --- /dev/null +++ b/file_download.cpp @@ -0,0 +1,28 @@ +#include "file_download.h" + +file_download::file_download() +{ + +} + +int file_download::file_download::download_file(QString url, QString save_location) +{ + /* + * this function will download a given url/file to a location + * no file location will be interpreted as . (current directory) + */ + qDebug() << "downloading to " + save_location + " from " + url; + if (QFile::exists(save_location)) + QFile::remove(save_location); + QNetworkReply *reply = http.get(QNetworkRequest(url)); + QObject::connect(reply, SIGNAL(finished()),&loop, SLOT(quit())); + loop.exec(); + QFile file(save_location); + file.open(QIODevice::WriteOnly); + file.write(reply->readAll()); + delete reply; + if (QFile::exists(save_location) && file.size() > 0) + return 1; /* file downloaded - could just be a blank file at this point */ + else + return 0; /* file did not download */ +} diff --git a/file_download.h b/file_download.h new file mode 100644 index 0000000..f8e1a94 --- /dev/null +++ b/file_download.h @@ -0,0 +1,19 @@ +#ifndef FILE_DOWNLOAD_H +#define FILE_DOWNLOAD_H +#include <QString> +#include <QEventLoop> +#include <QNetworkAccessManager> +#include <QNetworkReply> +#include <QFile> + +class file_download +{ +public: + file_download(); + int download_file(QString url, QString save_location); +private: + QNetworkAccessManager http; + QEventLoop loop; +}; + +#endif // FILE_DOWNLOAD_H diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..dffe85e --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "user_select_dialog.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + user_select_dialog w; + w.show(); + + return a.exec(); +} diff --git a/stats_display_window.cpp b/stats_display_window.cpp new file mode 100644 index 0000000..1dee284 --- /dev/null +++ b/stats_display_window.cpp @@ -0,0 +1,49 @@ +#include "stats_display_window.h" +#include "ui_stats_display_window.h" + +stats_display_window::stats_display_window(QWidget *parent) : + QWidget(parent), + ui(new Ui::stats_display_window) +{ + ui->setupUi(this); + connect(this, SIGNAL(window_loaded()), this, SLOT(test()), Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection)); +} + +stats_display_window::~stats_display_window() +{ + delete ui; +} + +void stats_display_window::showEvent(QShowEvent *ev) +{ + emit window_loaded(); +} + +void stats_display_window::test() +{ + QFile file("userdata.dat"); + if (file.open(QIODevice::ReadOnly)) + { + QTextStream in(&file); + while (!in.atEnd()) + { + QString line = in.readLine(); + if (line.contains("\"personaname\":")) + user.username = line.split(": ")[1].replace("\"", "").replace(",", ""); + if (line.contains("\"realname\":")) + user.realname = line.split(": ")[1].replace("\"", "").replace(",", ""); + if (line.contains("\"avatarfull\":")) + user.avatar_url = line.split(": ")[1].replace("\"", "").replace(",", ""); + } + file.close(); + } + download.download_file(user.avatar_url, "avatar.jpg"); + ui->username_label->setText(user.username); + if (user.realname == NULL) + ui->realname_label->setText("Realname not set"); + else + ui->realname_label->setText(user.realname); + QPixmap image("avatar.jpg"); + ui->avatar_label->setPixmap(image); + +} diff --git a/stats_display_window.h b/stats_display_window.h new file mode 100644 index 0000000..887c550 --- /dev/null +++ b/stats_display_window.h @@ -0,0 +1,45 @@ +#ifndef STATS_DISPLAY_WINDOW_H +#define STATS_DISPLAY_WINDOW_H + +#include <QWidget> +#include <QDebug> +#include <QByteArray> +#include <QFile> +#include <QJsonObject> +#include <QJsonDocument> +#include "file_download.h" + +namespace Ui { +class stats_display_window; +} + +class stats_display_window : public QWidget +{ + Q_OBJECT + + +protected: + void showEvent(QShowEvent *ev); + +public: + explicit stats_display_window(QWidget *parent = 0); + ~stats_display_window(); + +private: + Ui::stats_display_window *ui; + + struct user_info { + QString username; + QString realname; + QString avatar_url; + } user; + + file_download download; +signals: + void window_loaded(); + +private slots: + void test(); +}; + +#endif // STATS_DISPLAY_WINDOW_H diff --git a/stats_display_window.ui b/stats_display_window.ui new file mode 100644 index 0000000..bf6d27e --- /dev/null +++ b/stats_display_window.ui @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>stats_display_window</class> + <widget class="QWidget" name="stats_display_window"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>740</width> + <height>479</height> + </rect> + </property> + <property name="windowTitle"> + <string>CS:GO Statistics</string> + </property> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0" colspan="2"> + <widget class="QLabel" name="username_label"> + <property name="font"> + <font> + <family>Arial [Mono]</family> + <pointsize>14</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>username</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="realname_label"> + <property name="text"> + <string>realname</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="avatar_label"> + <property name="text"> + <string>avatar</string> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/user_select_dialog.cpp b/user_select_dialog.cpp new file mode 100644 index 0000000..81c40f4 --- /dev/null +++ b/user_select_dialog.cpp @@ -0,0 +1,57 @@ +#include "user_select_dialog.h" +#include "ui_user_select_dialog.h" + +user_select_dialog::user_select_dialog(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::user_select_dialog) +{ + ui->setupUi(this); +} + +user_select_dialog::~user_select_dialog() +{ + delete ui; +} + +void user_select_dialog::on_select_account_button_clicked() +{ + /* + * we need to check if the user gave a steam id + * if they did, proceed + */ + if (ui->steam_url_text->text() == NULL) + { + qDebug() << "No profile provided."; + } else { + qDebug() << "Profile selected:" << ui->steam_url_text->text(); + ui->close_button->setEnabled(false); + ui->select_account_button->setEnabled(false); + ui->steam_url_text->setEnabled(false); + ui->info_label->setText("Downloading data.."); + /* user data was a last second thought when designing this fucntion, clean it up one day, error checking etc */ + qDebug() << "Attempting to download user data"; + QString file_loc = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=FEBFDE46520663091143F867FEE39BFF&steamids=" + ui->steam_url_text->text(); + int success = download.download_file(file_loc, "userdata.dat"); + if (success == 1) + { + qDebug() << "Attempting to download cs:go data"; + file_loc = "http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=FEBFDE46520663091143F867FEE39BFF&steamid=" + ui->steam_url_text->text(); + success = download.download_file(file_loc, "csgodata.dat"); + } + if (success == 1) + { + qDebug() << "Downloaded everything"; /* file could be ANYTHING or empty! */ + n_window.show(); + this->hide(); + } + else + { + qDebug() << "Failed"; + ui->close_button->setEnabled(true); + ui->select_account_button->setEnabled(true); + ui->steam_url_text->setEnabled(true); + ui->info_label->setText("Failed to download, try again."); + } + + } +} diff --git a/user_select_dialog.h b/user_select_dialog.h new file mode 100644 index 0000000..98b3503 --- /dev/null +++ b/user_select_dialog.h @@ -0,0 +1,30 @@ +#ifndef USER_SELECT_DIALOG_H +#define USER_SELECT_DIALOG_H + +#include <QMainWindow> +#include <QDebug> +#include "file_download.h" +#include "stats_display_window.h" + +namespace Ui { +class user_select_dialog; +} + +class user_select_dialog : public QMainWindow +{ + Q_OBJECT + +public: + explicit user_select_dialog(QWidget *parent = 0); + ~user_select_dialog(); + +private slots: + void on_select_account_button_clicked(); + +private: + Ui::user_select_dialog *ui; + file_download download; + stats_display_window n_window; +}; + +#endif // USER_SELECT_DIALOG_H diff --git a/user_select_dialog.ui b/user_select_dialog.ui new file mode 100644 index 0000000..75a5e7d --- /dev/null +++ b/user_select_dialog.ui @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>user_select_dialog</class> + <widget class="QMainWindow" name="user_select_dialog"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>181</width> + <height>115</height> + </rect> + </property> + <property name="windowTitle"> + <string>Select a Steam account</string> + </property> + <widget class="QWidget" name="centralWidget"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="info_label"> + <property name="text"> + <string>Enter a Steam account ID</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="steam_url_text"> + <property name="text"> + <string>76561198055087665</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="select_account_button"> + <property name="text"> + <string>Select</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="close_button"> + <property name="text"> + <string>Close</string> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <layoutdefault spacing="6" margin="11"/> + <resources/> + <connections> + <connection> + <sender>close_button</sender> + <signal>clicked()</signal> + <receiver>user_select_dialog</receiver> + <slot>close()</slot> + <hints> + <hint type="sourcelabel"> + <x>348</x> + <y>403</y> + </hint> + <hint type="destinationlabel"> + <x>418</x> + <y>566</y> + </hint> + </hints> + </connection> + </connections> +</ui> |