Diffstat (limited to 'core/applets/screenshotapplet/screenshot.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index 1d88aa5..4ea81c8 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp | |||
@@ -10,22 +10,22 @@ | |||
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" | ||
17 | 16 | ||
18 | /* OPIE */ | 17 | /* OPIE */ |
19 | #include <opie2/odebug.h> | 18 | #include <opie2/odebug.h> |
19 | #include <opie2/ofiledialog.h> | ||
20 | #include <opie2/oresource.h> | ||
20 | #include <opie2/otaskbarapplet.h> | 21 | #include <opie2/otaskbarapplet.h> |
22 | |||
21 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/applnk.h> | 24 | #include <qpe/applnk.h> |
23 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
24 | #include <qpe/resource.h> | ||
25 | |||
26 | 26 | ||
27 | /* QT */ | 27 | /* QT */ |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qdir.h> | 29 | #include <qdir.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
@@ -108,28 +108,19 @@ void ScreenshotControl::slotGrab() | |||
108 | buttonPushed = 1; | 108 | buttonPushed = 1; |
109 | hide(); | 109 | hide(); |
110 | 110 | ||
111 | setFileName = FALSE; | 111 | setFileName = FALSE; |
112 | if ( saveNamedCheck->isChecked()) { | 112 | if ( saveNamedCheck->isChecked()) { |
113 | setFileName = TRUE; | 113 | setFileName = TRUE; |
114 | InputDialog *fileDlg; | ||
115 | 114 | ||
116 | fileDlg = new InputDialog( 0 , tr("Name of screenshot "), TRUE, 0); | 115 | MimeTypes types; |
117 | fileDlg->exec(); | 116 | QStringList list; |
118 | fileDlg->raise(); | 117 | list << "image/*"; |
119 | QString fileName, list; | 118 | types. insert ( "Images", list ); |
120 | if ( fileDlg->result() == 1 ) { | ||
121 | fileName = fileDlg->LineEdit1->text(); | ||
122 | 119 | ||
123 | if (fileName.find("/", 0, TRUE) == -1) | 120 | FileNamePath = Opie::Ui::OFileDialog::getSaveFileName( 1,"/","", types, 0 ); |
124 | FileNamePath = QDir::homeDirPath() + "/Documents/image/png/" + fileName; | ||
125 | else | ||
126 | FileNamePath = fileName; | ||
127 | |||
128 | } | ||
129 | delete fileDlg; | ||
130 | } | 121 | } |
131 | 122 | ||
132 | if ( delaySpin->value() ) | 123 | if ( delaySpin->value() ) |
133 | grabTimer->start( delaySpin->value() * 1000, true ); | 124 | grabTimer->start( delaySpin->value() * 1000, true ); |
134 | else | 125 | else |
135 | show(); | 126 | show(); |
@@ -301,13 +292,13 @@ void ScreenshotControl::performGrab() | |||
301 | 292 | ||
302 | ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name ) | 293 | ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name ) |
303 | : QWidget( parent, name ) | 294 | : QWidget( parent, name ) |
304 | { | 295 | { |
305 | setFixedHeight( AppLnk::smallIconSize() ); | 296 | setFixedHeight( AppLnk::smallIconSize() ); |
306 | setFixedWidth( AppLnk::smallIconSize() ); | 297 | setFixedWidth( AppLnk::smallIconSize() ); |
307 | m_icon.convertFromImage( Resource::loadImage( "screenshotapplet/screenshot" ).smoothScale( height(), width() ) ); | 298 | m_icon = Opie::Core::OResource::loadPixmap( "screenshotapplet/screenshot", Opie::Core::OResource::SmallIcon ); |
308 | } | 299 | } |
309 | 300 | ||
310 | ScreenshotApplet::~ScreenshotApplet() | 301 | ScreenshotApplet::~ScreenshotApplet() |
311 | { | 302 | { |
312 | } | 303 | } |
313 | 304 | ||