diff options
author | daniel-Jones <daniel@danieljon.es> | 2016-07-23 13:36:10 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2016-07-23 13:36:10 +0930 |
commit | cdb03cae2c21c9a5ada496b92e705995334e9e9a (patch) | |
tree | a320a4c5177dd56d57a79c05f60739acee7e84b1 /user_select_dialog.cpp | |
parent | 0b6f9e4af8f1ab695a193fabdb32b6219223c455 (diff) | |
download | csgo_stats-cdb03cae2c21c9a5ada496b92e705995334e9e9a.tar.gz csgo_stats-cdb03cae2c21c9a5ada496b92e705995334e9e9a.zip |
Added images for all weapons, stats from each weapon appear in a table. thanks to csgo-stats.com for the images! Other small changes.
Diffstat (limited to 'user_select_dialog.cpp')
-rw-r--r-- | user_select_dialog.cpp | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/user_select_dialog.cpp b/user_select_dialog.cpp index 81c40f4..6a6f4b2 100644 --- a/user_select_dialog.cpp +++ b/user_select_dialog.cpp @@ -16,42 +16,52 @@ user_select_dialog::~user_select_dialog() void user_select_dialog::on_select_account_button_clicked() { /* - * we need to check if the user gave a steam id + * we need to check if the user gave a steam id or selected a user * 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."); - } + download_info(); + } +} +void user_select_dialog::download_info() +{ + 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->player_dropdown->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."); + } +} + +void user_select_dialog::load_players() +{ + } |