author | drw <drw> | 2005-04-29 00:41:53 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-29 00:41:53 (UTC) |
commit | 7e13110d8d0c7cf0d7566484aae9a0664340a69e (patch) (unidiff) | |
tree | d042f58fc9352eac332d73886633c70fc7b06510 /core/applets/screenshotapplet/screenshot.cpp | |
parent | caedcea372fd99c7fae116ac3d0d1625f88bf138 (diff) | |
download | opie-7e13110d8d0c7cf0d7566484aae9a0664340a69e.zip opie-7e13110d8d0c7cf0d7566484aae9a0664340a69e.tar.gz opie-7e13110d8d0c7cf0d7566484aae9a0664340a69e.tar.bz2 |
Resource -> OResource, simplified saving of image using name and used the correct MIME types for save dialog
Diffstat (limited to 'core/applets/screenshotapplet/screenshot.cpp') (more/less context) (ignore 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 | |||
@@ -15,3 +15,2 @@ | |||
15 | #include "screenshot.h" | 15 | #include "screenshot.h" |
16 | #include "inputDialog.h" | ||
17 | 16 | ||
@@ -19,3 +18,6 @@ | |||
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> |
@@ -23,4 +25,2 @@ | |||
23 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
24 | #include <qpe/resource.h> | ||
25 | |||
26 | 26 | ||
@@ -113,18 +113,9 @@ void ScreenshotControl::slotGrab() | |||
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 | } |
@@ -306,3 +297,3 @@ ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name ) | |||
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 | } |