2016-03-21 07:54:14 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* gta5sync GRAND THEFT AUTO V SYNC
|
|
|
|
* Copyright (C) 2016 Syping Gaming Team
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2016-03-20 21:57:18 +01:00
|
|
|
#include "PictureDialog.h"
|
|
|
|
#include "ui_PictureDialog.h"
|
|
|
|
|
2016-03-21 20:44:07 +01:00
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QVariantMap>
|
|
|
|
#include <QJsonArray>
|
|
|
|
#include <QDebug>
|
|
|
|
|
2016-03-20 21:57:18 +01:00
|
|
|
PictureDialog::PictureDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::PictureDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2016-03-21 20:44:07 +01:00
|
|
|
jsonDrawString = ui->labJSON->text();
|
2016-03-20 21:57:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PictureDialog::~PictureDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2016-03-21 03:10:28 +01:00
|
|
|
|
|
|
|
void PictureDialog::setSnapmaticPicture(QPixmap pixmap)
|
|
|
|
{
|
|
|
|
ui->labPicture->setPixmap(pixmap);
|
|
|
|
}
|
2016-03-21 20:44:07 +01:00
|
|
|
|
2016-03-21 21:33:22 +01:00
|
|
|
void PictureDialog::setJsonString(SnapmaticPicture *picture)
|
2016-03-21 20:44:07 +01:00
|
|
|
{
|
2016-03-21 21:33:22 +01:00
|
|
|
QString locX = QString::number(picture->getLocationX());
|
|
|
|
QString locY = QString::number(picture->getLocationY());
|
|
|
|
QString locZ = QString::number(picture->getLocationZ());
|
2016-03-21 21:46:36 +01:00
|
|
|
QString crewID = QString::number(picture->getCrewNumber());
|
2016-03-21 21:33:22 +01:00
|
|
|
QStringList plyrsList = picture->getPlayers();
|
2016-03-21 20:44:07 +01:00
|
|
|
|
|
|
|
QString plyrsStr;
|
|
|
|
foreach (const QString &player, plyrsList)
|
|
|
|
{
|
|
|
|
plyrsStr.append(", ");
|
|
|
|
plyrsStr.append(player);
|
|
|
|
}
|
|
|
|
if (plyrsStr.length() >= 1) { plyrsStr.remove(0,2); }
|
|
|
|
|
2016-03-21 21:46:36 +01:00
|
|
|
ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, plyrsStr, crewID));
|
2016-03-21 20:44:07 +01:00
|
|
|
}
|