author | drw <drw> | 2005-05-24 21:07:23 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-24 21:07:23 (UTC) |
commit | 7b809e61a3ec2afe898dd9d721efb981abffb0ca (patch) (unidiff) | |
tree | 780a542f961fb3b7e743b3c9593b1839f0e6ddb7 | |
parent | 82a7658f6ff0c82cdba2088b70bd2a05aeb85fd6 (diff) | |
download | opie-7b809e61a3ec2afe898dd9d721efb981abffb0ca.zip opie-7b809e61a3ec2afe898dd9d721efb981abffb0ca.tar.gz opie-7b809e61a3ec2afe898dd9d721efb981abffb0ca.tar.bz2 |
Resource -> OResource and .cvsignore updates
-rw-r--r-- | noncore/multimedia/camera/cmd/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/multimedia/camera/gui/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/multimedia/camera/gui/mainwindow.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/camera/lib/.cvsignore | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/noncore/multimedia/camera/cmd/.cvsignore b/noncore/multimedia/camera/cmd/.cvsignore index 737c5b2..e5aacf6 100644 --- a/noncore/multimedia/camera/cmd/.cvsignore +++ b/noncore/multimedia/camera/cmd/.cvsignore | |||
@@ -1,5 +1,5 @@ | |||
1 | moc | 1 | *moc |
2 | obj | 2 | *obj |
3 | config.in | 3 | config.in |
4 | Makefile | 4 | Makefile |
5 | 5 | ||
diff --git a/noncore/multimedia/camera/gui/.cvsignore b/noncore/multimedia/camera/gui/.cvsignore index 2a3a7a8..8e95df7 100644 --- a/noncore/multimedia/camera/gui/.cvsignore +++ b/noncore/multimedia/camera/gui/.cvsignore | |||
@@ -1,6 +1,6 @@ | |||
1 | *.pro | 1 | *.pro |
2 | moc | 2 | *moc |
3 | obj | 3 | *obj |
4 | config.in | 4 | config.in |
5 | Makefile | 5 | Makefile |
6 | 6 | ||
diff --git a/noncore/multimedia/camera/gui/mainwindow.cpp b/noncore/multimedia/camera/gui/mainwindow.cpp index bde448d..b2fcc6c 100644 --- a/noncore/multimedia/camera/gui/mainwindow.cpp +++ b/noncore/multimedia/camera/gui/mainwindow.cpp | |||
@@ -4,50 +4,50 @@ | |||
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | #include "previewwidget.h" | 17 | #include "previewwidget.h" |
18 | #include "zcameraio.h" | 18 | #include "zcameraio.h" |
19 | #include "imageio.h" | 19 | #include "imageio.h" |
20 | #include "avi.h" | 20 | #include "avi.h" |
21 | 21 | ||
22 | /* OPIE */ | 22 | /* OPIE */ |
23 | #include <opie2/ofiledialog.h> | 23 | #include <opie2/ofiledialog.h> |
24 | #include <opie2/odevice.h> | 24 | #include <opie2/odevice.h> |
25 | #include <opie2/oapplication.h> | 25 | #include <opie2/oapplication.h> |
26 | #include <opie2/oconfig.h> | 26 | #include <opie2/oconfig.h> |
27 | #include <opie2/odebug.h> | 27 | #include <opie2/odebug.h> |
28 | #include <opie2/oresource.h> | ||
28 | #include <qpe/global.h> | 29 | #include <qpe/global.h> |
29 | #include <qpe/resource.h> | ||
30 | #include <qpe/qcopenvelope_qws.h> | 30 | #include <qpe/qcopenvelope_qws.h> |
31 | 31 | ||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qaction.h> | 34 | #include <qaction.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <qcombobox.h> | 36 | #include <qcombobox.h> |
37 | #include <qcursor.h> | 37 | #include <qcursor.h> |
38 | #include <qdatastream.h> | 38 | #include <qdatastream.h> |
39 | #include <qdir.h> | 39 | #include <qdir.h> |
40 | #include <qfile.h> | 40 | #include <qfile.h> |
41 | #include <qimage.h> | 41 | #include <qimage.h> |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | #include <qlineedit.h> | 43 | #include <qlineedit.h> |
44 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
45 | #include <qprogressbar.h> | 45 | #include <qprogressbar.h> |
46 | #include <qpushbutton.h> | 46 | #include <qpushbutton.h> |
47 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qdirectpainter_qws.h> | 49 | #include <qdirectpainter_qws.h> |
50 | 50 | ||
51 | /* STD */ | 51 | /* STD */ |
52 | #include <assert.h> | 52 | #include <assert.h> |
53 | #include <sys/types.h> | 53 | #include <sys/types.h> |
@@ -58,49 +58,49 @@ | |||
58 | #include <unistd.h> | 58 | #include <unistd.h> |
59 | 59 | ||
60 | #define CAPTUREFILE "/tmp/capture.dat" | 60 | #define CAPTUREFILE "/tmp/capture.dat" |
61 | #define OUTPUTFILE "/tmp/output.avi" | 61 | #define OUTPUTFILE "/tmp/output.avi" |
62 | 62 | ||
63 | #define OUTPUT_TO_CUSTOM 250 | 63 | #define OUTPUT_TO_CUSTOM 250 |
64 | #define OUTPUT_TO_DOCFOLDER 251 | 64 | #define OUTPUT_TO_DOCFOLDER 251 |
65 | 65 | ||
66 | 66 | ||
67 | using namespace Opie::Ui; | 67 | using namespace Opie::Ui; |
68 | using namespace Opie::Core; | 68 | using namespace Opie::Core; |
69 | 69 | ||
70 | CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f ) | 70 | CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f ) |
71 | :QMainWindow( parent, name, f ), | 71 | :QMainWindow( parent, name, f ), |
72 | _rotation( 270 ), // FIXME: get this from current settings (ODevice?) | 72 | _rotation( 270 ), // FIXME: get this from current settings (ODevice?) |
73 | _capturing( false ), | 73 | _capturing( false ), |
74 | _pics( 1 ), _videos( 1 ) | 74 | _pics( 1 ), _videos( 1 ) |
75 | { | 75 | { |
76 | #ifdef QT_NO_DEBUG | 76 | #ifdef QT_NO_DEBUG |
77 | if ( !ZCameraIO::instance()->isOpen() ) | 77 | if ( !ZCameraIO::instance()->isOpen() ) |
78 | { | 78 | { |
79 | QVBox* v = new QVBox( this ); | 79 | QVBox* v = new QVBox( this ); |
80 | v->setMargin( 10 ); | 80 | v->setMargin( 10 ); |
81 | QLabel* l1 = new QLabel( v ); | 81 | QLabel* l1 = new QLabel( v ); |
82 | l1->setPixmap( Resource::loadPixmap( "camera/error" ) ); | 82 | l1->setPixmap( Opie::Core::OResource::loadPixmap( "camera/error", Opie::Core::OResource::SmallIcon ) ); |
83 | QLabel* l2 = new QLabel( v ); | 83 | QLabel* l2 = new QLabel( v ); |
84 | l2->setText( "<b>Sorry. could not detect your camera :-(</b><p>" | 84 | l2->setText( "<b>Sorry. could not detect your camera :-(</b><p>" |
85 | "* Is the sharpzdc_cs module loaded ?<br>" | 85 | "* Is the sharpzdc_cs module loaded ?<br>" |
86 | "* Is /dev/sharpzdc read/writable ?<p>" ); | 86 | "* Is /dev/sharpzdc read/writable ?<p>" ); |
87 | connect( new QPushButton( "Exit", v ), SIGNAL( clicked() ), this, SLOT( close() ) ); | 87 | connect( new QPushButton( "Exit", v ), SIGNAL( clicked() ), this, SLOT( close() ) ); |
88 | setCentralWidget( v ); | 88 | setCentralWidget( v ); |
89 | return; | 89 | return; |
90 | } | 90 | } |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | init(); | 93 | init(); |
94 | 94 | ||
95 | _rotation = 270; //TODO: grab these from the actual settings | 95 | _rotation = 270; //TODO: grab these from the actual settings |
96 | 96 | ||
97 | preview = new PreviewWidget( this, "camera preview widget" ); | 97 | preview = new PreviewWidget( this, "camera preview widget" ); |
98 | //setCentralWidget( preview ); <--- don't do this! | 98 | //setCentralWidget( preview ); <--- don't do this! |
99 | preview->resize( QSize( 240, 288 ) ); | 99 | preview->resize( QSize( 240, 288 ) ); |
100 | preview->show(); | 100 | preview->show(); |
101 | 101 | ||
102 | // construct a System Channel to receive setRotation messages | 102 | // construct a System Channel to receive setRotation messages |
103 | _sysChannel = new QCopChannel( "QPE/System", this ); | 103 | _sysChannel = new QCopChannel( "QPE/System", this ); |
104 | connect( _sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 104 | connect( _sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
105 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); | 105 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
106 | 106 | ||
@@ -217,49 +217,49 @@ void CameraMainWindow::init() | |||
217 | connect( zoomg, SIGNAL( selected(QAction*) ), this, SLOT( zoomMenuItemClicked(QAction*) ) ); | 217 | connect( zoomg, SIGNAL( selected(QAction*) ), this, SLOT( zoomMenuItemClicked(QAction*) ) ); |
218 | connect( flipg, SIGNAL( selected(QAction*) ), this, SLOT( flipMenuItemClicked(QAction*) ) ); | 218 | connect( flipg, SIGNAL( selected(QAction*) ), this, SLOT( flipMenuItemClicked(QAction*) ) ); |
219 | connect( outputTog, SIGNAL( selected(QAction*) ), this, SLOT( outputToMenuItemClicked(QAction*) ) ); | 219 | connect( outputTog, SIGNAL( selected(QAction*) ), this, SLOT( outputToMenuItemClicked(QAction*) ) ); |
220 | connect( outputg, SIGNAL( selected(QAction*) ), this, SLOT( outputMenuItemClicked(QAction*) ) ); | 220 | connect( outputg, SIGNAL( selected(QAction*) ), this, SLOT( outputMenuItemClicked(QAction*) ) ); |
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
224 | void CameraMainWindow::systemMessage( const QCString& msg, const QByteArray& data ) | 224 | void CameraMainWindow::systemMessage( const QCString& msg, const QByteArray& data ) |
225 | { | 225 | { |
226 | int _newrotation; | 226 | int _newrotation; |
227 | 227 | ||
228 | QDataStream stream( data, IO_ReadOnly ); | 228 | QDataStream stream( data, IO_ReadOnly ); |
229 | odebug << "received system message: " << msg << oendl; | 229 | odebug << "received system message: " << msg << oendl; |
230 | if ( msg == "setCurrentRotation(int)" ) | 230 | if ( msg == "setCurrentRotation(int)" ) |
231 | { | 231 | { |
232 | stream >> _newrotation; | 232 | stream >> _newrotation; |
233 | odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; | 233 | odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; |
234 | 234 | ||
235 | switch ( _newrotation ) | 235 | switch ( _newrotation ) |
236 | { | 236 | { |
237 | case 270: preview->resize( QSize( 240, 288 ) ); break; | 237 | case 270: preview->resize( QSize( 240, 288 ) ); break; |
238 | case 180: preview->resize( QSize( 320, 208 ) ); break; | 238 | case 180: preview->resize( QSize( 320, 208 ) ); break; |
239 | default: QMessageBox::warning( this, "opie-camera", | 239 | default: QMessageBox::warning( this, "opie-camera", |
240 | "This rotation is not supported.\n" | 240 | "This rotation is not supported.\n" |
241 | "Supported are 180° and 270°" ); | 241 | "Supported are 180 and 270" ); |
242 | } | 242 | } |
243 | 243 | ||
244 | if ( _newrotation != _rotation ) | 244 | if ( _newrotation != _rotation ) |
245 | { | 245 | { |
246 | int tmp = captureX; | 246 | int tmp = captureX; |
247 | captureX = captureY; | 247 | captureX = captureY; |
248 | captureY = tmp; | 248 | captureY = tmp; |
249 | _rotation = _newrotation; | 249 | _rotation = _newrotation; |
250 | } | 250 | } |
251 | 251 | ||
252 | updateCaption(); | 252 | updateCaption(); |
253 | 253 | ||
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | 257 | ||
258 | void CameraMainWindow::changeZoom( int zoom ) | 258 | void CameraMainWindow::changeZoom( int zoom ) |
259 | { | 259 | { |
260 | int z; | 260 | int z; |
261 | switch ( zoom ) | 261 | switch ( zoom ) |
262 | { | 262 | { |
263 | case 0: z = 128; break; | 263 | case 0: z = 128; break; |
264 | case 1: z = 256; break; | 264 | case 1: z = 256; break; |
265 | case 2: z = 512; break; | 265 | case 2: z = 512; break; |
@@ -312,49 +312,49 @@ void CameraMainWindow::showContextMenu() | |||
312 | m.insertItem( "&Output As", &output ); | 312 | m.insertItem( "&Output As", &output ); |
313 | 313 | ||
314 | #ifndef QT_NO_DEBUG | 314 | #ifndef QT_NO_DEBUG |
315 | m.insertItem( "&Debug!", this, SLOT( doSomething() ) ); | 315 | m.insertItem( "&Debug!", this, SLOT( doSomething() ) ); |
316 | #endif | 316 | #endif |
317 | 317 | ||
318 | m.exec( QCursor::pos() ); | 318 | m.exec( QCursor::pos() ); |
319 | } | 319 | } |
320 | 320 | ||
321 | 321 | ||
322 | void CameraMainWindow::resoMenuItemClicked( QAction* a ) | 322 | void CameraMainWindow::resoMenuItemClicked( QAction* a ) |
323 | { | 323 | { |
324 | switch ( _rotation ) | 324 | switch ( _rotation ) |
325 | { | 325 | { |
326 | case 270: | 326 | case 270: |
327 | captureY = a->text().left(3).toInt(); | 327 | captureY = a->text().left(3).toInt(); |
328 | captureX = a->text().right(3).toInt(); | 328 | captureX = a->text().right(3).toInt(); |
329 | break; | 329 | break; |
330 | case 180: | 330 | case 180: |
331 | captureX = a->text().left(3).toInt(); | 331 | captureX = a->text().left(3).toInt(); |
332 | captureY = a->text().right(3).toInt(); | 332 | captureY = a->text().right(3).toInt(); |
333 | break; | 333 | break; |
334 | default: QMessageBox::warning( this, "opie-camera", | 334 | default: QMessageBox::warning( this, "opie-camera", |
335 | "This rotation is not supported.\n" | 335 | "This rotation is not supported.\n" |
336 | "Supported are 180° and 270°" ); | 336 | "Supported are 180 and 270" ); |
337 | } | 337 | } |
338 | odebug << "Capture Resolution now: " << captureX << ", " << captureY << oendl; | 338 | odebug << "Capture Resolution now: " << captureX << ", " << captureY << oendl; |
339 | updateCaption(); | 339 | updateCaption(); |
340 | } | 340 | } |
341 | 341 | ||
342 | 342 | ||
343 | void CameraMainWindow::qualityMenuItemClicked( QAction* a ) | 343 | void CameraMainWindow::qualityMenuItemClicked( QAction* a ) |
344 | { | 344 | { |
345 | quality = a->text().left(3).toInt(); | 345 | quality = a->text().left(3).toInt(); |
346 | odebug << "Quality now: " << quality << oendl; | 346 | odebug << "Quality now: " << quality << oendl; |
347 | updateCaption(); | 347 | updateCaption(); |
348 | } | 348 | } |
349 | 349 | ||
350 | 350 | ||
351 | void CameraMainWindow::zoomMenuItemClicked( QAction* a ) | 351 | void CameraMainWindow::zoomMenuItemClicked( QAction* a ) |
352 | { | 352 | { |
353 | zoom = QString( a->text().at(2) ).toInt(); | 353 | zoom = QString( a->text().at(2) ).toInt(); |
354 | odebug << "Zoom now: " << zoom << oendl; | 354 | odebug << "Zoom now: " << zoom << oendl; |
355 | ZCameraIO::instance()->setZoom( zoom ); | 355 | ZCameraIO::instance()->setZoom( zoom ); |
356 | updateCaption(); | 356 | updateCaption(); |
357 | } | 357 | } |
358 | 358 | ||
359 | 359 | ||
360 | void CameraMainWindow::flipMenuItemClicked( QAction* a ) | 360 | void CameraMainWindow::flipMenuItemClicked( QAction* a ) |
diff --git a/noncore/multimedia/camera/lib/.cvsignore b/noncore/multimedia/camera/lib/.cvsignore index 2a3a7a8..8e95df7 100644 --- a/noncore/multimedia/camera/lib/.cvsignore +++ b/noncore/multimedia/camera/lib/.cvsignore | |||
@@ -1,6 +1,6 @@ | |||
1 | *.pro | 1 | *.pro |
2 | moc | 2 | *moc |
3 | obj | 3 | *obj |
4 | config.in | 4 | config.in |
5 | Makefile | 5 | Makefile |
6 | 6 | ||