| /* PC GO Screen Shooter |
| Copyright 2007-2014 PC GO Ld. |
| |
| Original are from Qt Demos |
| |
| This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
| This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| */ |
| |
| #include "screenshot.h" |
| #include <string.h> |
| #include <unistd.h> |
| #include <QtGui/QApplication> |
| #include <QtGui/QSpinBox> |
| |
| int main(int argc, char *argv[]) { |
| for(int i=1; i<argc; i++) if(strcmp(argv[i], "--style") == 0) { |
| QApplication::setStyle(argv[i+1]); |
| for(int j=i; j<argc-1; j++) argv[j] = argv[j+2]; |
| argc -= 2; |
| } |
| QApplication a(argc, argv); |
| ScreenShot screenshot; |
| for(int i=1; i<argc; i++) if(strcmp(argv[i], "--delay") == 0) { |
| int s = atoi(argv[i+1]); |
| screenshot.delaySpinBox->setValue(s); |
| //screenshot.NewScreenShot(); |
| sleep(s); |
| for(int j=i; j<argc-1; j++) argv[j] = argv[j+2]; |
| argc -= 2; |
| } |
| screenshot.show(); |
| screenshot.move(screenshot.center()); |
| return a.exec(); |
| } |