aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-10-14 16:04:04 -0400
committerKen Moore <ken@pcbsd.org>2014-10-14 16:04:04 -0400
commitcbadbfe43ee63a09a4f915b055affe5b7b86c7ad (patch)
tree2526828e112c2b7cb83fbaa96b9d980242c866b0
parentFinish up the rest of the new Lumina Theme engine and the utilities for editi... (diff)
parentMerge pull request #19 from Nanolx/master (diff)
downloadlumina-cbadbfe43ee63a09a4f915b055affe5b7b86c7ad.tar.gz
lumina-cbadbfe43ee63a09a4f915b055affe5b7b86c7ad.tar.bz2
lumina-cbadbfe43ee63a09a4f915b055affe5b7b86c7ad.zip
Merge branch 'master' of github.com:pcbsd/lumina
Conflicts: lumina-screenshot/MainUI.cpp
-rw-r--r--lumina-screenshot/MainUI.cpp20
-rw-r--r--lumina-screenshot/MainUI.h4
2 files changed, 20 insertions, 4 deletions
diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp
index 5b67577b..5ff698bd 100644
--- a/lumina-screenshot/MainUI.cpp
+++ b/lumina-screenshot/MainUI.cpp
@@ -23,14 +23,24 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveScreenshot()) );
connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) );
connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(startScreenshot()) );
- ui->radio_window->setChecked(true);
+
+ QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
+ settings = new QSettings("LuminaDE", "lumina-screenshot",this);
+
+ if(settings->value("screenshot-target", "window").toString() == "window") {
+ ui->radio_window->setChecked(true);
+ } else {
+ ui->radio_all->setChecked(true);
+ }
+
+ ui->spin_delay->setValue(settings->value("screenshot-delay", 0).toInt());
this->show();
ui->label_screenshot->setPixmap( cpic.scaled(ui->label_screenshot->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
}
MainUI::~MainUI(){}
-
+
void MainUI::setupIcons(){
//Setup the icons
this->setWindowIcon( LXDG::findIcon("camera-web","") );
@@ -60,6 +70,7 @@ bool MainUI::getWindow(){
//Use this function to set cwin
cwin = 0;
if(ui->radio_window->isChecked()){
+ settings->setValue("screenshot-target", "window");
//Use xprop to get the desired window from the user
QList<WId> wins = LX11::WindowList();
wins.removeAll(this->winId()); //don't show this window
@@ -71,7 +82,10 @@ bool MainUI::getWindow(){
QString info = QInputDialog::getItem(this, tr("Select Window"), tr("Window:"), names, 0, false, &ok);
if(!ok || names.indexOf(info)<0){ return false; } //cancelled
cwin = wins[ names.indexOf(info) ];
+ } else {
+ settings->setValue("screenshot-target", "desktop");
}
+ settings->setValue("screenshot-delay", ui->spin_delay->value());
return true;
}
@@ -86,4 +100,4 @@ void MainUI::getPixmap(){
this->show();
//Now display the pixmap on the label as well
ui->label_screenshot->setPixmap( cpic.scaled(ui->label_screenshot->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
-} \ No newline at end of file
+}
diff --git a/lumina-screenshot/MainUI.h b/lumina-screenshot/MainUI.h
index 889e42e2..c350f366 100644
--- a/lumina-screenshot/MainUI.h
+++ b/lumina-screenshot/MainUI.h
@@ -15,6 +15,7 @@
#include <QDesktopWidget>
#include <QDir>
#include <QInputDialog>
+#include <QSettings>
#include <LuminaXDG.h>
#include <LuminaUtils.h>
@@ -37,6 +38,7 @@ private:
QPixmap cpic; //current picture
QString ppath; //previous file path
WId cwin; //current window to screenshot
+ QSettings *settings;
private slots:
//Button Slots
@@ -51,4 +53,4 @@ private slots:
void getPixmap(); //set the "cpic" variable to the new screenshot
};
-#endif \ No newline at end of file
+#endif
bgstack15