diff options
-rw-r--r-- | lumina-screenshot/MainUI.cpp | 18 | ||||
-rw-r--r-- | lumina-screenshot/MainUI.ui | 36 |
2 files changed, 44 insertions, 10 deletions
diff --git a/lumina-screenshot/MainUI.cpp b/lumina-screenshot/MainUI.cpp index 9abe93a2..22d18169 100644 --- a/lumina-screenshot/MainUI.cpp +++ b/lumina-screenshot/MainUI.cpp @@ -18,7 +18,12 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->toolBar->insertWidget(ui->actionNew, spacer); setupIcons(); - + ui->spin_monitor->setMaximum(QApplication::desktop()->screenCount()); + if(ui->spin_monitor->maximum()<2){ + ui->spin_monitor->setEnabled(false); + ui->radio_monitor->setEnabled(false); + } + //Setup the connections connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveScreenshot()) ); connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(closeApplication()) ); @@ -29,7 +34,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ if(settings->value("screenshot-target", "window").toString() == "window") { ui->radio_window->setChecked(true); - } else { + }else{ ui->radio_all->setChecked(true); } @@ -82,7 +87,9 @@ 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 { + }else if(ui->radio_monitor->isChecked()){ + + }else{ settings->setValue("screenshot-target", "desktop"); } settings->setValue("screenshot-delay", ui->spin_delay->value()); @@ -91,9 +98,12 @@ bool MainUI::getWindow(){ void MainUI::getPixmap(){ QScreen *scrn = QApplication::screens().at(0); - if(cwin==0){ + if(cwin==0 && ui->radio_window->isChecked() ){ //Grab the whole screen cpic = scrn->grabWindow(QApplication::desktop()->winId()); + }else if(cwin==0 && ui->radio_monitor->isChecked()){ + QRect geom = QApplication::desktop()->screenGeometry(ui->spin_monitor->value()-1); + cpic = scrn->grabWindow(QApplication::desktop()->winId(), geom.x(), geom.y(), geom.width(), geom.height() ); }else{ //Grab just the designated window cpic = scrn->grabWindow(cwin); diff --git a/lumina-screenshot/MainUI.ui b/lumina-screenshot/MainUI.ui index 7edf1a44..a4fe849c 100644 --- a/lumina-screenshot/MainUI.ui +++ b/lumina-screenshot/MainUI.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>333</width> - <height>277</height> + <width>349</width> + <height>283</height> </rect> </property> <property name="windowTitle"> @@ -49,7 +49,7 @@ <property name="bottomMargin"> <number>1</number> </property> - <item row="0" column="2"> + <item row="0" column="3"> <widget class="QSpinBox" name="spin_delay"> <property name="suffix"> <string> Seconds</string> @@ -62,17 +62,27 @@ </property> </widget> </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="spin_monitor"> + <property name="prefix"> + <string notr="true"># </string> + </property> + <property name="minimum"> + <number>1</number> + </property> + </widget> + </item> <item row="0" column="0"> <widget class="QRadioButton" name="radio_all"> <property name="text"> - <string>Entire Screen</string> + <string>Entire Session</string> </property> </widget> </item> - <item row="1" column="0"> + <item row="2" column="0"> <widget class="QRadioButton" name="radio_window"> <property name="text"> - <string>Select Window</string> + <string>Single Window</string> </property> </widget> </item> @@ -89,6 +99,20 @@ </property> </spacer> </item> + <item row="1" column="0"> + <widget class="QRadioButton" name="radio_monitor"> + <property name="text"> + <string>Single Screen</string> + </property> + </widget> + </item> + <item row="0" column="2" rowspan="3"> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> </layout> </widget> </item> |