first development version of 1.4.x
This commit is contained in:
parent
1ff4f353e3
commit
24b1f32bbe
63 changed files with 4792 additions and 4350 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "DatabaseThread.h"
|
||||
#include "PictureDialog.h"
|
||||
#include "PictureExport.h"
|
||||
#include "StringParser.h"
|
||||
#include "config.h"
|
||||
#include <QMessageBox>
|
||||
#include <QPixmap>
|
||||
|
|
@ -84,6 +85,7 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
|
|||
picPath = picture->getPictureFilePath();
|
||||
picTitl = picture->getPictureTitl();
|
||||
picStr = picture->getPictureStr();
|
||||
QObject::connect(picture, SIGNAL(updated()), this, SLOT(snapmaticUpdated()));
|
||||
|
||||
QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getImage().scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::AutoColor);
|
||||
ui->labPicStr->setText(picStr + "\n" + picTitl + "");
|
||||
|
|
@ -94,6 +96,15 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
|
|||
adjustTextColor();
|
||||
}
|
||||
|
||||
void SnapmaticWidget::snapmaticUpdated()
|
||||
{
|
||||
// Current only strings get updated
|
||||
picPath = smpic->getPictureFilePath();
|
||||
picTitl = smpic->getPictureTitl();
|
||||
picStr = smpic->getPictureStr();
|
||||
ui->labPicStr->setText(picStr + "\n" + picTitl + "");
|
||||
}
|
||||
|
||||
void SnapmaticWidget::on_cmdView_clicked()
|
||||
{
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
|
|
@ -102,7 +113,6 @@ void SnapmaticWidget::on_cmdView_clicked()
|
|||
settings.endGroup();
|
||||
|
||||
PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, this);
|
||||
picDialog->setWindowFlags(picDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
|
||||
picDialog->setSnapmaticPicture(smpic, true);
|
||||
picDialog->setModal(true);
|
||||
|
||||
|
|
@ -135,23 +145,25 @@ void SnapmaticWidget::on_cmdExport_clicked()
|
|||
}
|
||||
|
||||
void SnapmaticWidget::on_cmdDelete_clicked()
|
||||
{
|
||||
if (deletePicture()) emit pictureDeleted();
|
||||
}
|
||||
|
||||
bool SnapmaticWidget::deletePicture()
|
||||
{
|
||||
int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("Are you sure to delete %1 from your Snapmatic pictures?").arg("\""+picStr+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
if (uchoice == QMessageBox::Yes)
|
||||
{
|
||||
if (!QFile::exists(picPath))
|
||||
if (smpic->deletePicFile())
|
||||
{
|
||||
emit pictureDeleted();
|
||||
}
|
||||
else if(QFile::remove(picPath))
|
||||
{
|
||||
emit pictureDeleted();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg("\""+picStr+"\""));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SnapmaticWidget::mousePressEvent(QMouseEvent *ev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue