aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-03-25 11:39:11 -0400
committerKen Moore <moorekou@gmail.com>2016-03-25 11:39:11 -0400
commite7e747ddf3a701c2488acdb4aa4e8b16cd350945 (patch)
treec9bc778c7e32251d1587e5ac531eeb358653fdd9
parentMerge pull request #208 from rubin55/master (diff)
parentUpdate MainUI.cpp (diff)
downloadlumina-e7e747ddf3a701c2488acdb4aa4e8b16cd350945.tar.gz
lumina-e7e747ddf3a701c2488acdb4aa4e8b16cd350945.tar.bz2
lumina-e7e747ddf3a701c2488acdb4aa4e8b16cd350945.zip
Merge pull request #209 from q5sys/master
Quicksave and Crop Functions
-rw-r--r--lumina-screenshot/MainUI.cpp16
-rw-r--r--lumina-screenshot/MainUI.h3
-rw-r--r--lumina-screenshot/MainUI.ui25
3 files changed, 41 insertions, 3 deletions
diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp
index cd33666b..69c2bfb6 100644
--- a/lumina-screenshot/MainUI.cpp
+++ b/lumina-screenshot/MainUI.cpp
@@ -27,8 +27,10 @@ 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()) );
+ connect(ui->actionEdit, SIGNAL(triggered()), this, SLOT(editScreenshot()) );
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","") );
+ ui->actionEdit->setIcon( LXDG::findIcon("edit-cut","") );
}
//==============
@@ -65,6 +68,17 @@ void MainUI::saveScreenshot(){
cpic.save(filepath, "png");
ppath = filepath;
}
+void MainUI::quicksave(){
+ QString savedir = QDir::homePath() + "/Pictures/";
+ QString path = savedir + QString( "Screenshot-%1.png" ).arg( QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss") );
+ cpic.save(path, "png");
+}
+
+void MainUI::editScreenshot(){
+ QString tmppath = QString("/tmp/screenshot.png");
+ cpic.save(tmppath, "png");
+ QProcess::startDetached("lumina-open /tmp/screenshot.png");
+}
void MainUI::startScreenshot(){
if( !getWindow() ){ return; }
diff --git a/lumina-screenshot/MainUI.h b/lumina-screenshot/MainUI.h
index 0640f89b..db0672da 100644
--- a/lumina-screenshot/MainUI.h
+++ b/lumina-screenshot/MainUI.h
@@ -50,8 +50,11 @@ private slots:
this->close();
}
void saveScreenshot();
+ void quicksave();
+ void editScreenshot();
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
diff --git a/lumina-screenshot/MainUI.ui b/lumina-screenshot/MainUI.ui
index 1ad2f0ff..233b4574 100644
--- a/lumina-screenshot/MainUI.ui
+++ b/lumina-screenshot/MainUI.ui
@@ -156,8 +156,10 @@
</attribute>
<addaction name="actionQuit"/>
<addaction name="actionSave"/>
+ <addaction name="actionquicksave"/>
+ <addaction name="actionEdit"/>
<addaction name="actionNew"/>
- </widget>
+ </widget>
<action name="actionSave">
<property name="text">
<string>Save</string>
@@ -172,6 +174,25 @@
<string>Ctrl+S</string>
</property>
</action>
+ <action name="actionquicksave">
+ <property name="text">
+ <string>Quick Save</string>
+ </property>
+ <property name="toolTip">
+ <string>Quick Save Screenshot</string>
+ </property>
+ <property name="statusTip">
+ <string>Quick Save Screenshot</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action name="actionEdit">
+ <property name="text">
+ <string>Crop</string>
+ </property>
+ </action>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
@@ -187,7 +208,7 @@
<property name="statusTip">
<string>Take new snapshot</string>
</property>
- </action>
+</action>
</widget>
<resources/>
<connections/>
bgstack15