Merge branch 'Dev' into 'MuckeMachtSachen'

# Conflicts:
#   IntelliPhoto/Painting/GUI/IntelliPhotoGui.h
#   IntelliPhoto/Painting/Image/IntelliShapedImage.cpp
#   IntelliPhoto/Painting/IntelliPhoto.pro.user
#   IntelliPhoto/Painting/Layer/PaintingArea.cpp
#   IntelliPhoto/Painting/Layer/PaintingArea.h
This commit is contained in:
Jonas Mucke
2019-12-05 13:47:52 +00:00
13 changed files with 66 additions and 448 deletions

View File

@@ -61,12 +61,14 @@ void IntelliPhotoGui::open()
// Called when the user clicks Save As in the menu
void IntelliPhotoGui::save()
{
// A QAction represents the action of the user clicking
QAction *action = qobject_cast<QAction *>(sender());
// Stores the array of bytes of the users data
QByteArray fileFormat = action->data().toByteArray();
// Pass it to be saved
saveFile(fileFormat);
}
@@ -216,9 +218,21 @@ void IntelliPhotoGui::createActions()
saveAsActs.append(action);
}
QAction *action = new QAction("PNG-8", this);
// Set an action for each file format
action->setData("PNG");
// When clicked call IntelliPhotoGui::save()
connect(action, SIGNAL(triggered()), this, SLOT(save()));
// Attach each file format option menu item to Save As
saveAsActs.append(action);
// Create exit action and tie to IntelliPhotoGui::close()
exitAct = new QAction(tr("&Exit"), this);
exitAct = new QAction(tr("E&xit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
@@ -392,6 +406,10 @@ bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat)
// Define path, name and default file type
QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
// Get selected file from dialog
// Add the proper file formats and extensions
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),