summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/mainwindow.cpp
authormickeyl <mickeyl>2003-04-12 15:02:32 (UTC)
committer mickeyl <mickeyl>2003-04-12 15:02:32 (UTC)
commit2cc909c36a779d1041a3382939f8ad41d84b0fc5 (patch) (side-by-side diff)
tree42c95673d72f7ecb7a8f4acbb0f517dd75ecc167 /noncore/multimedia/camera/mainwindow.cpp
parent11861d35730cee70920aa6797ba12263bbcce081 (diff)
downloadopie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.zip
opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.gz
opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.bz2
- make main layout a full preview window and think about configuring capturing parameters later...adding an on-demand-applet to the taskbar would be spiffy
- portrait or landscape mode is now self-configuring thanks to life-rotation :-D
Diffstat (limited to 'noncore/multimedia/camera/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/mainwindow.cpp41
1 files changed, 35 insertions, 6 deletions
diff --git a/noncore/multimedia/camera/mainwindow.cpp b/noncore/multimedia/camera/mainwindow.cpp
index 8578bce..7080e63 100644
--- a/noncore/multimedia/camera/mainwindow.cpp
+++ b/noncore/multimedia/camera/mainwindow.cpp
@@ -14,28 +14,38 @@
**********************************************************************/
#include "mainwindow.h"
-#include "mainwindowbase.h"
+#include "previewwidget.h"
#include "zcameraio.h"
#include <qvbox.h>
#include <qcombobox.h>
+#include <qdatastream.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qdirectpainter_qws.h>
#include <qpe/resource.h>
+#include <qpe/qcopenvelope_qws.h>
#include <opie/ofiledialog.h>
+#include <opie2/odebug.h>
+
#include <assert.h>
CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f )
:QMainWindow( parent, name, f )
{
- mw = new MainWindowBase( this, "main widget" );
- ZCameraIO::instance()->setCaptureFrame( 240, 160, 256 );
- setCentralWidget( mw );
- mw->show();
+ _rotation = 270; //TODO: grab these from the actual settings
+
+ preview = new PreviewWidget( this, "camera preview widget" );
+ //setCentralWidget( preview ); <--- don't do this!
+ preview->resize( QSize( 240, 288 ) );
+ preview->show();
+
+ // construct a System Channel to receive setRotation messages
+ _sysChannel = new QCopChannel( "QPE/System", this );
+ connect( _sysChannel, SIGNAL( received( const QCString&, const QByteArray& ) ),
+ this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) );
- connect( mw->zoom, SIGNAL( activated( int ) ), this, SLOT( changeZoom(int) ) );
};
@@ -44,6 +54,25 @@ CameraMainWindow::~CameraMainWindow()
}
+void CameraMainWindow::systemMessage( const QCString& msg, const QByteArray& data )
+{
+ QDataStream stream( data, IO_ReadOnly );
+ odebug << "received system message: " << msg << oendl;
+ if ( msg == "setCurrentRotation(int)" )
+ {
+ stream >> _rotation;
+ odebug << "received setCurrentRotation(" << _rotation << ")" << oendl;
+
+ switch ( _rotation )
+ {
+ case 270: preview->resize( QSize( 240, 288 ) ); break;
+ case 180: preview->resize( QSize( 320, 208 ) ); break;
+ default: assert( 0 ); // not yet handled
+ }
+ }
+}
+
+
void CameraMainWindow::changeZoom( int zoom )
{
int z;