Fixed issue #62.

--HG--
branch : develop
This commit is contained in:
dismine 2014-02-05 17:32:50 +02:00
parent bd4afb7000
commit 16cf055b4c
3 changed files with 13 additions and 2 deletions

View File

@ -612,7 +612,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
{
if (changeInFile == true)
{
QMessageBox msgBox;
QMessageBox msgBox(this);
msgBox.setText(tr("The pattern has been modified."));
msgBox.setInformativeText(tr("Do you want to save your changes?"));
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);

View File

@ -210,6 +210,16 @@ void VAbstractTool::DeleteTool(QGraphicsItem *tool)
{
if (_referens <= 1)
{
QMessageBox msgBox;
msgBox.setText(tr("Confirm the deletion."));
msgBox.setInformativeText(tr("Do you really want delete?"));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.setIcon(QMessageBox::Question);
if (msgBox.exec() == QMessageBox::Cancel)
{
return;
}
//remove from xml file
QDomElement domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())

View File

@ -31,6 +31,7 @@
#include "vdatatool.h"
#include "../xml/vdomdocument.h"
#include <QMessageBox>
/**
* @brief The VAbstractTool abstract class for all tools.
@ -47,7 +48,7 @@ public:
* @param parent parent object.
*/
VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
virtual ~VAbstractTool() {}
virtual ~VAbstractTool(){}
/**
* @brief NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view.
* @param sc scene.