-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index fab4044..b987392 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp | |||
@@ -6,59 +6,43 @@ | |||
6 | ** GNU General Public License version 2 as published by the Free Software | 6 | ** GNU General Public License version 2 as published by the Free Software |
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | 7 | ** Foundation and appearing in the file LICENSE.GPL included in the |
8 | ** packaging of this file. | 8 | ** packaging of this file. |
9 | ** | 9 | ** |
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
12 | ** | 12 | ** |
13 | **********************************************************************/ | 13 | **********************************************************************/ |
14 | 14 | ||
15 | #include "screenshot.h" | 15 | #include "screenshot.h" |
16 | #include "inputDialog.h" | 16 | #include "inputDialog.h" |
17 | 17 | ||
18 | #include <qapplication.h> | ||
19 | #include <stdlib.h> | 18 | #include <stdlib.h> |
20 | #include <sys/socket.h> | 19 | #include <sys/socket.h> |
21 | #include <netinet/in.h> | 20 | #include <netinet/in.h> |
22 | #include <netdb.h> | 21 | #include <netdb.h> |
23 | #include <unistd.h> | 22 | #include <unistd.h> |
24 | 23 | ||
25 | #include <qpe/resource.h> | ||
26 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
27 | #include <qpe/timestring.h> | ||
28 | #include <qpe/resource.h> | ||
29 | #include <qpe/config.h> | ||
30 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
31 | #include <qpe/config.h> | ||
32 | 26 | ||
33 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
34 | #include <qdir.h> | 28 | #include <qdir.h> |
35 | #include <qfileinfo.h> | ||
36 | #include <qlabel.h> | 29 | #include <qlabel.h> |
37 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
38 | #include <qpainter.h> | 31 | #include <qpainter.h> |
39 | #include <qcombobox.h> | ||
40 | #include <qspinbox.h> | 32 | #include <qspinbox.h> |
41 | #include <qslider.h> | ||
42 | #include <qlayout.h> | 33 | #include <qlayout.h> |
43 | #include <qframe.h> | ||
44 | #include <qpixmap.h> | ||
45 | #include <qregexp.h> | ||
46 | #include <qstring.h> | ||
47 | #include <qfile.h> | ||
48 | #include <qtimer.h> | ||
49 | #include <qfile.h> | ||
50 | #include <qdatastream.h> | ||
51 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
52 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #include <qimage.h> | ||
53 | 37 | ||
54 | 38 | ||
55 | static char * snapshot_xpm[] = { | 39 | static char * snapshot_xpm[] = { |
56 | "16 16 10 1", | 40 | "16 16 10 1", |
57 | " c None", | 41 | " c None", |
58 | ". c #000000", | 42 | ". c #000000", |
59 | "+ c #00C000", | 43 | "+ c #00C000", |
60 | "@ c #585858", | 44 | "@ c #585858", |
61 | "# c #808080", | 45 | "# c #808080", |
62 | "$ c #00FF00", | 46 | "$ c #00FF00", |
63 | "% c #008000", | 47 | "% c #008000", |
64 | "& c #00FFFF", | 48 | "& c #00FFFF", |
@@ -192,25 +176,25 @@ void ScreenshotControl::savePixmap() | |||
192 | fileName = fileName + ".png"; | 176 | fileName = fileName + ".png"; |
193 | lnk.setFile(fileName); //sets File property | 177 | lnk.setFile(fileName); //sets File property |
194 | qDebug("saving file " + fileName); | 178 | qDebug("saving file " + fileName); |
195 | snapshot.save( fileName, "PNG"); | 179 | snapshot.save( fileName, "PNG"); |
196 | QFileInfo fi( fileName); | 180 | QFileInfo fi( fileName); |
197 | lnk.setName( fi.fileName()); //sets file name | 181 | lnk.setName( fi.fileName()); //sets file name |
198 | 182 | ||
199 | if (!lnk.writeLink()) | 183 | if (!lnk.writeLink()) |
200 | qDebug("Writing doclink did not work"); | 184 | qDebug("Writing doclink did not work"); |
201 | } | 185 | } |
202 | else { | 186 | else { |
203 | 187 | ||
204 | fileName = "sc_" + TimeString::dateString( QDateTime::currentDateTime(), false, true); | 188 | fileName = "sc_" + QDateTime::currentDateTime().toString(); |
205 | fileName.replace(QRegExp("'"), ""); | 189 | fileName.replace(QRegExp("'"), ""); |
206 | fileName.replace(QRegExp(" "), "_"); | 190 | fileName.replace(QRegExp(" "), "_"); |
207 | fileName.replace(QRegExp(":"), "."); | 191 | fileName.replace(QRegExp(":"), "."); |
208 | fileName.replace(QRegExp(","), ""); | 192 | fileName.replace(QRegExp(","), ""); |
209 | QString dirName = QDir::homeDirPath() + "/Documents/image/png/"; | 193 | QString dirName = QDir::homeDirPath() + "/Documents/image/png/"; |
210 | 194 | ||
211 | if ( !QDir( dirName).exists() ) { | 195 | if ( !QDir( dirName).exists() ) { |
212 | qDebug("making dir " + dirName); | 196 | qDebug("making dir " + dirName); |
213 | QString msg = "mkdir -p " + dirName; | 197 | QString msg = "mkdir -p " + dirName; |
214 | system(msg.latin1()); | 198 | system(msg.latin1()); |
215 | } | 199 | } |
216 | fileName = dirName + fileName; | 200 | fileName = dirName + fileName; |