From a025ab5da53c3b51ba69c6afb7a107b06743b06d Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 11:41:52 +0100 Subject: [PATCH 1/9] Removed comment cause it ain't --- src/GUI/IntelliPhotoGui.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index a25999b..c2cae43 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -16,7 +16,6 @@ IntelliPhotoGui::IntelliPhotoGui(){ createMenus(); //set style of the gui setIntelliStyle(); - // Size the app showMaximized(); } @@ -28,7 +27,6 @@ void IntelliPhotoGui::closeEvent(QCloseEvent *event){ if (maybeSave()) { event->accept(); } else { - // If there have been changes ignore the event event->ignore(); } @@ -234,7 +232,7 @@ void IntelliPhotoGui::slotCreateLineTool(){ void IntelliPhotoGui::slotAboutDialog(){ // Window title and text to display QMessageBox::about(this, tr("About Painting"), - tr("

IntelliPhoto Some nice ass looking software

")); + tr("

IntelliPhotoPretty basic editor.

")); } // Define menu actions that call functions From 9e4cf9a07f21fef3d484d594bd0720030ef3cd30 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 12:44:00 +0100 Subject: [PATCH 2/9] Removed blank lines --- src/Layer/PaintingArea.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Layer/PaintingArea.h b/src/Layer/PaintingArea.h index fa85425..b6cebc1 100644 --- a/src/Layer/PaintingArea.h +++ b/src/Layer/PaintingArea.h @@ -21,8 +21,6 @@ struct LayerObject{ int widthOffset; int hightOffset; int alpha=255; - - }; class PaintingArea : public QWidget @@ -83,7 +81,6 @@ private: void activateUpperLayer(); void activateLowerLayer(); - QImage* Canvas; int maxWidth; int maxHeight; @@ -104,4 +101,3 @@ private: }; #endif - From a0f1203fb1465ee9a0e6b6d3ef3dd3b524e10a50 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 13:02:25 +0100 Subject: [PATCH 3/9] Fixed a bug where the system dialogs wouldn't show up on linux Thx to @Jan for this contribution and testing --- src/GUI/IntelliPhotoGui.cpp | 2 +- src/Layer/PaintingArea.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index c2cae43..4be552e 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -460,7 +460,7 @@ bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){ initialPath, tr("%1 Files (*.%2);;All Files (*)") .arg(QString::fromLatin1(fileFormat.toUpper())) - .arg(QString::fromLatin1(fileFormat))); + .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog); // If no file do nothing if (fileName.isEmpty()) { diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 1783a40..2009465 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -164,12 +164,12 @@ void PaintingArea::slotActivateLayer(int a){ } void PaintingArea::colorPickerSetFirstColor(){ - QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color"); + QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color", QColorDialog::DontUseNativeDialog); this->colorPicker.setFirstColor(clr); } void PaintingArea::colorPickerSetSecondColor(){ - QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color"); + QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color", QColorDialog::DontUseNativeDialog); this->colorPicker.setSecondColor(clr); } From 325d1925aca738b8025c07e05a2b2cfe9ee02037 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 13:08:21 +0100 Subject: [PATCH 4/9] Fixed a bug where the File Dialog wouldn't show up correctly on linux --- src/GUI/IntelliPhotoGui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 4be552e..a5dde2f 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -43,7 +43,7 @@ void IntelliPhotoGui::slotOpen(){ // tr sets the window title to Open File // QDir opens the current dirctory QString fileName = QFileDialog::getOpenFileName(this, - tr("Open File"), QDir::currentPath()); + tr("Open File"), QDir::currentPath(), "", nullptr, QFileDialog::DontUseNativeDialog); // If we have a file name load the image and place // it in the paintingArea From bbc733a8b5733c69e83748a74774cfa95f776eda Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 13:11:50 +0100 Subject: [PATCH 5/9] Replaced empty string with nullpointer to dodge warning --- src/GUI/IntelliPhotoGui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index a5dde2f..1de336a 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -43,7 +43,7 @@ void IntelliPhotoGui::slotOpen(){ // tr sets the window title to Open File // QDir opens the current dirctory QString fileName = QFileDialog::getOpenFileName(this, - tr("Open File"), QDir::currentPath(), "", nullptr, QFileDialog::DontUseNativeDialog); + tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog); // If we have a file name load the image and place // it in the paintingArea From 56dfdcc5339f87ba9a6e7c751f579052b8348552 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Wed, 18 Dec 2019 12:16:37 +0100 Subject: [PATCH 6/9] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e431211..a86d544 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Build folders +src/build-*/ /build-*/ # QT Creator Files From d193dc3b978e494fde94f3920beae0b5e9a24148 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Wed, 18 Dec 2019 12:31:03 +0100 Subject: [PATCH 7/9] Edited the dialogs to work as intendet on linux and also fixed set second color --- src/GUI/IntelliPhotoGui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 1de336a..283170c 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -43,7 +43,7 @@ void IntelliPhotoGui::slotOpen(){ // tr sets the window title to Open File // QDir opens the current dirctory QString fileName = QFileDialog::getOpenFileName(this, - tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog); + tr("Open File"), QDir::currentPath(),"", nullptr, QFileDialog::DontUseNativeDialog); // If we have a file name load the image and place // it in the paintingArea @@ -274,6 +274,7 @@ void IntelliPhotoGui::createActions(){ // Create New Layer action and tie to IntelliPhotoGui::newLayer() actionCreateNewLayer = new QAction(tr("&New Layer..."), this); + actionCreateNewLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N)); connect(actionCreateNewLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewLayer())); // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer() @@ -315,7 +316,7 @@ void IntelliPhotoGui::createActions(){ connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor())); actionColorPickerSecondColor = new QAction(tr("&Secondary"), this); - connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor())); + connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor())); actionColorSwitch = new QAction(tr("&Switch"), this); actionColorSwitch->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S)); From d1d3599daa74e3b6a2f1f1e786db420c611ebf26 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 13:28:41 +0100 Subject: [PATCH 8/9] Merged gitignore statements --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a86d544..e8e6a7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Build folders -src/build-*/ -/build-*/ +build-*/ # QT Creator Files *.creator.user* From 3ad975a297c84d4d3c00c0af04eea067541deee8 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 18 Dec 2019 13:48:53 +0100 Subject: [PATCH 9/9] Changed empty string to nullpointer for file options --- src/GUI/IntelliPhotoGui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 283170c..16c8074 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -43,7 +43,7 @@ void IntelliPhotoGui::slotOpen(){ // tr sets the window title to Open File // QDir opens the current dirctory QString fileName = QFileDialog::getOpenFileName(this, - tr("Open File"), QDir::currentPath(),"", nullptr, QFileDialog::DontUseNativeDialog); + tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog); // If we have a file name load the image and place // it in the paintingArea