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 | |
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
-rw-r--r-- | core/applets/screenshotapplet/inputDialog.cpp | 65 | ||||
-rw-r--r-- | core/applets/screenshotapplet/inputDialog.h | 30 | ||||
-rw-r--r-- | core/applets/screenshotapplet/opie-screenshotapplet.control | 2 | ||||
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 27 | ||||
-rw-r--r-- | core/applets/screenshotapplet/screenshotapplet.pro | 6 |
5 files changed, 13 insertions, 117 deletions
diff --git a/core/applets/screenshotapplet/inputDialog.cpp b/core/applets/screenshotapplet/inputDialog.cpp deleted file mode 100644 index ce03ec0..0000000 --- a/core/applets/screenshotapplet/inputDialog.cpp +++ b/dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'inputDialog.ui' | ||
3 | ** | ||
4 | ** Created: Sat Mar 2 07:55:03 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "inputDialog.h" | ||
10 | |||
11 | #include <qpe/resource.h> | ||
12 | |||
13 | #include <opie2/ofiledialog.h> | ||
14 | |||
15 | #include <qlineedit.h> | ||
16 | #include <qpushbutton.h> | ||
17 | |||
18 | using namespace Opie::Ui; | ||
19 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
20 | : QDialog( parent, name, modal, fl ) | ||
21 | { | ||
22 | if ( !name ) | ||
23 | setName( "InputDialog" ); | ||
24 | resize( 234, 115); | ||
25 | setMaximumSize( QSize( 240, 40)); | ||
26 | setCaption( tr(name ) ); | ||
27 | |||
28 | QPushButton *browserButton; | ||
29 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | ||
30 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | ||
31 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | ||
32 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | ||
33 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | * Destroys the object and frees any allocated resources | ||
38 | */ | ||
39 | InputDialog::~InputDialog() | ||
40 | { | ||
41 | inputText= LineEdit1->text(); | ||
42 | |||
43 | } | ||
44 | |||
45 | void InputDialog::browse() { | ||
46 | |||
47 | MimeTypes types; | ||
48 | QStringList audio, video, all; | ||
49 | audio << "audio/*"; | ||
50 | audio << "playlist/plain"; | ||
51 | audio << "audio/x-mpegurl"; | ||
52 | |||
53 | video << "video/*"; | ||
54 | video << "playlist/plain"; | ||
55 | |||
56 | all += audio; | ||
57 | all += video; | ||
58 | types.insert("All Media Files", all ); | ||
59 | types.insert("Audio", audio ); | ||
60 | types.insert("Video", video ); | ||
61 | |||
62 | QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); | ||
63 | LineEdit1->setText(str); | ||
64 | } | ||
65 | |||
diff --git a/core/applets/screenshotapplet/inputDialog.h b/core/applets/screenshotapplet/inputDialog.h deleted file mode 100644 index 3e3e36f..0000000 --- a/core/applets/screenshotapplet/inputDialog.h +++ b/dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form interface generated from reading ui file 'inputDialog.ui' | ||
3 | ** | ||
4 | ** Created: Sat Mar 2 07:54:46 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #ifndef INPUTDIALOG_H | ||
10 | #define INPUTDIALOG_H | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qdialog.h> | ||
14 | |||
15 | class QLineEdit; | ||
16 | |||
17 | class InputDialog : public QDialog | ||
18 | { | ||
19 | Q_OBJECT | ||
20 | |||
21 | public: | ||
22 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | ||
23 | ~InputDialog(); | ||
24 | QString inputText; | ||
25 | QLineEdit* LineEdit1; | ||
26 | protected slots: | ||
27 | void browse(); | ||
28 | }; | ||
29 | |||
30 | #endif // INPUTDIALOG_H | ||
diff --git a/core/applets/screenshotapplet/opie-screenshotapplet.control b/core/applets/screenshotapplet/opie-screenshotapplet.control index b0b9466..c08953b 100644 --- a/core/applets/screenshotapplet/opie-screenshotapplet.control +++ b/core/applets/screenshotapplet/opie-screenshotapplet.control | |||
@@ -4,7 +4,7 @@ Priority: optional | |||
4 | Section: opie/applets | 4 | Section: opie/applets |
5 | Maintainer: L. J. Potter <lpotter@trolltech.com> | 5 | Maintainer: L. J. Potter <lpotter@trolltech.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal, libopiecore2, libopieui2 |
8 | Description: Screenshot Applet | 8 | Description: Screenshot Applet |
9 | A screenshot taskbar applet for the Opie environment | 9 | A screenshot taskbar applet for the Opie environment |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
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 | |||
@@ -13,16 +13,16 @@ | |||
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> |
@@ -111,22 +111,13 @@ void ScreenshotControl::slotGrab() | |||
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() ) |
@@ -304,7 +295,7 @@ ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *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() |
diff --git a/core/applets/screenshotapplet/screenshotapplet.pro b/core/applets/screenshotapplet/screenshotapplet.pro index fe8299e..1e4d6a4 100644 --- a/core/applets/screenshotapplet/screenshotapplet.pro +++ b/core/applets/screenshotapplet/screenshotapplet.pro | |||
@@ -1,12 +1,12 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on | 2 | CONFIG += qt plugin warn_on |
3 | HEADERS = screenshot.h inputDialog.h | 3 | HEADERS = screenshot.h |
4 | SOURCES = screenshot.cpp inputDialog.cpp | 4 | SOURCES = screenshot.cpp |
5 | TARGET = screenshotapplet | 5 | TARGET = screenshotapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += | 8 | DEPENDPATH += |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopiecore2 -lopieui2 |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | 11 | ||
12 | include( $(OPIEDIR)/include.pro ) | 12 | include( $(OPIEDIR)/include.pro ) |