From 1b381b17ca7dfa273d1c16afbb1e2a8dde1b25c1 Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 02:59:08 -0400 Subject: Update MainUI.ui added actionquicksave --- lumina-screenshot/MainUI.ui | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lumina-screenshot/MainUI.ui b/lumina-screenshot/MainUI.ui index 1ad2f0ff..26ea282c 100644 --- a/lumina-screenshot/MainUI.ui +++ b/lumina-screenshot/MainUI.ui @@ -156,8 +156,10 @@ + + - + Save @@ -172,6 +174,21 @@ Ctrl+S + + + Quick Save + + + Quick Save Screenshot + + + Quick Save Screenshot + + + Ctrl+S + + + Quit @@ -187,7 +204,7 @@ Take new snapshot - + -- cgit From 7944ae94d6e1fcabef11fe4eeec28dbcb18cf41d Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 02:59:27 -0400 Subject: Update MainUI.ui added actionEdit --- lumina-screenshot/MainUI.ui | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lumina-screenshot/MainUI.ui b/lumina-screenshot/MainUI.ui index 26ea282c..233b4574 100644 --- a/lumina-screenshot/MainUI.ui +++ b/lumina-screenshot/MainUI.ui @@ -188,7 +188,11 @@ Ctrl+S - + + + Crop + + Quit -- cgit From b4ea414942eed25044a316bb38dad31d95e91628 Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 03:00:06 -0400 Subject: Update MainUI.h added quicksave --- lumina-screenshot/MainUI.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lumina-screenshot/MainUI.h b/lumina-screenshot/MainUI.h index 0640f89b..884b33bf 100644 --- a/lumina-screenshot/MainUI.h +++ b/lumina-screenshot/MainUI.h @@ -50,8 +50,11 @@ private slots: this->close(); } void saveScreenshot(); + void quicksave(); + void startScreenshot(); + //Utility functions to perform a screenshot bool getWindow(); //set the "cwin" variable as appropriate void getPixmap(); //set the "cpic" variable to the new screenshot -- cgit From fe464ed18fae32a612388ac839c1f3473c2554d1 Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 03:00:23 -0400 Subject: Update MainUI.h added editScreenshot --- lumina-screenshot/MainUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lumina-screenshot/MainUI.h b/lumina-screenshot/MainUI.h index 884b33bf..db0672da 100644 --- a/lumina-screenshot/MainUI.h +++ b/lumina-screenshot/MainUI.h @@ -51,7 +51,7 @@ private slots: } void saveScreenshot(); void quicksave(); - + void editScreenshot(); void startScreenshot(); -- cgit From d110efb5e12c8301d4b6c420d7a59e0d7ee0673b Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 03:01:40 -0400 Subject: Update MainUI.cpp added quicksave --- lumina-screenshot/MainUI.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp index cd33666b..cd6e87e4 100644 --- a/lumina-screenshot/MainUI.cpp +++ b/lumina-screenshot/MainUI.cpp @@ -27,9 +27,11 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ //Setup the connections connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveScreenshot()) ); + connect(ui->actionquicksave, SIGNAL(triggered()), this, SLOT(quicksave()) ); connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) ); connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(startScreenshot()) ); + QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); settings = new QSettings("LuminaDE", "lumina-screenshot",this); @@ -49,10 +51,11 @@ MainUI::~MainUI(){} void MainUI::setupIcons(){ //Setup the icons - this->setWindowIcon( LXDG::findIcon("camera-web","") ); ui->actionSave->setIcon( LXDG::findIcon("document-save","") ); + ui->actionquicksave->setIcon( LXDG::findIcon("document-save","") ); ui->actionQuit->setIcon( LXDG::findIcon("application-exit","") ); ui->actionNew->setIcon( LXDG::findIcon("camera-web","") ); + } //============== @@ -65,6 +68,17 @@ void MainUI::saveScreenshot(){ cpic.save(filepath, "png"); ppath = filepath; } +void MainUI::quicksave(){ + QString savedir = QDir::homePath() + "/Pictures/"; + QDate date = QDate::currentDate(); + QString dateString = date.toString(); + QTime time = QTime::currentTime(); + QString timeString = time.toString(); + QString path = savedir + QString("Screenshot-[%1 - %2].png").arg(dateString).arg(timeString); + cpic.save(path, "png"); +} + + void MainUI::startScreenshot(){ if( !getWindow() ){ return; } -- cgit From 623aae51c33ad3d3ac8a3f7b3f948ea1b472f95b Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 03:02:21 -0400 Subject: Update MainUI.cpp added editScreenshot --- lumina-screenshot/MainUI.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp index cd6e87e4..d1522202 100644 --- a/lumina-screenshot/MainUI.cpp +++ b/lumina-screenshot/MainUI.cpp @@ -30,7 +30,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ connect(ui->actionquicksave, SIGNAL(triggered()), this, SLOT(quicksave()) ); connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) ); connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(startScreenshot()) ); - + connect(ui->actionEdit, SIGNAL(triggered()), this, SLOT(editScreenshot()) ); QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); settings = new QSettings("LuminaDE", "lumina-screenshot",this); @@ -55,7 +55,7 @@ void MainUI::setupIcons(){ ui->actionquicksave->setIcon( LXDG::findIcon("document-save","") ); ui->actionQuit->setIcon( LXDG::findIcon("application-exit","") ); ui->actionNew->setIcon( LXDG::findIcon("camera-web","") ); - + ui->actionEdit->setIcon( LXDG::findIcon("edit-cut","") ); } //============== @@ -78,7 +78,11 @@ void MainUI::quicksave(){ cpic.save(path, "png"); } - +void MainUI::editScreenshot(){ + QString tmppath = QString("/tmp/screenshot.png"); + cpic.save(tmppath, "png"); + QProcess::startDetached("gimp /tmp/screenshot.png "); +} void MainUI::startScreenshot(){ if( !getWindow() ){ return; } -- cgit From 9f8df4426f0b010786f20c7aa4172d156995982b Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 11:15:28 -0400 Subject: Update MainUI.cpp condensed quicksave file name function --- lumina-screenshot/MainUI.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp index d1522202..ced5193f 100644 --- a/lumina-screenshot/MainUI.cpp +++ b/lumina-screenshot/MainUI.cpp @@ -70,12 +70,8 @@ void MainUI::saveScreenshot(){ } void MainUI::quicksave(){ QString savedir = QDir::homePath() + "/Pictures/"; - QDate date = QDate::currentDate(); - QString dateString = date.toString(); - QTime time = QTime::currentTime(); - QString timeString = time.toString(); - QString path = savedir + QString("Screenshot-[%1 - %2].png").arg(dateString).arg(timeString); - cpic.save(path, "png"); + QString path = savedir + QString( "Screenshot-%1.png" ).arg( QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss") ); + cpic.save(path, "png"); } void MainUI::editScreenshot(){ -- cgit From 3218f7a95d8b37e8f0b68b7b7faade94bc2666ec Mon Sep 17 00:00:00 2001 From: q5sys Date: Fri, 25 Mar 2016 11:22:45 -0400 Subject: Update MainUI.cpp replaced hardcode for GIMP as the editor to Lumina-open --- lumina-screenshot/MainUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp index ced5193f..69c2bfb6 100644 --- a/lumina-screenshot/MainUI.cpp +++ b/lumina-screenshot/MainUI.cpp @@ -77,7 +77,7 @@ void MainUI::quicksave(){ void MainUI::editScreenshot(){ QString tmppath = QString("/tmp/screenshot.png"); cpic.save(tmppath, "png"); - QProcess::startDetached("gimp /tmp/screenshot.png "); + QProcess::startDetached("lumina-open /tmp/screenshot.png"); } void MainUI::startScreenshot(){ -- cgit