summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/gui/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/camera/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/gui/mainwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/camera/gui/mainwindow.cpp b/noncore/multimedia/camera/gui/mainwindow.cpp
index 2f42049..e4e1b6c 100644
--- a/noncore/multimedia/camera/gui/mainwindow.cpp
+++ b/noncore/multimedia/camera/gui/mainwindow.cpp
@@ -53,98 +53,98 @@ using namespace Opie;
53#include <assert.h> 53#include <assert.h>
54#include <sys/types.h> 54#include <sys/types.h>
55#include <sys/stat.h> 55#include <sys/stat.h>
56#include <fcntl.h> 56#include <fcntl.h>
57#include <string.h> 57#include <string.h>
58#include <errno.h> 58#include <errno.h>
59#include <unistd.h> 59#include <unistd.h>
60 60
61#define CAPTUREFILE "/tmp/capture.dat" 61#define CAPTUREFILE "/tmp/capture.dat"
62#define OUTPUTFILE "/tmp/output.avi" 62#define OUTPUTFILE "/tmp/output.avi"
63 63
64#define OUTPUT_TO_CUSTOM 250 64#define OUTPUT_TO_CUSTOM 250
65#define OUTPUT_TO_DOCFOLDER 251 65#define OUTPUT_TO_DOCFOLDER 251
66 66
67CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f ) 67CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f )
68 :QMainWindow( parent, name, f ), 68 :QMainWindow( parent, name, f ),
69 _rotation( 270 ), // FIXME: get this from current settings (ODevice?) 69 _rotation( 270 ), // FIXME: get this from current settings (ODevice?)
70 _capturing( false ), 70 _capturing( false ),
71 _pics( 1 ), _videos( 1 ) 71 _pics( 1 ), _videos( 1 )
72{ 72{
73 #ifdef QT_NO_DEBUG 73 #ifdef QT_NO_DEBUG
74 if ( !ZCameraIO::instance()->isOpen() ) 74 if ( !ZCameraIO::instance()->isOpen() )
75 { 75 {
76 QVBox* v = new QVBox( this ); 76 QVBox* v = new QVBox( this );
77 v->setMargin( 10 ); 77 v->setMargin( 10 );
78 QLabel* l1 = new QLabel( v ); 78 QLabel* l1 = new QLabel( v );
79 l1->setPixmap( Resource::loadPixmap( "camera/error" ) ); 79 l1->setPixmap( Resource::loadPixmap( "camera/error" ) );
80 QLabel* l2 = new QLabel( v ); 80 QLabel* l2 = new QLabel( v );
81 l2->setText( "<b>Sorry. could not detect your camera :-(</b><p>" 81 l2->setText( "<b>Sorry. could not detect your camera :-(</b><p>"
82 "* Is the sharpzdc_cs module loaded ?<br>" 82 "* Is the sharpzdc_cs module loaded ?<br>"
83 "* Is /dev/sharpzdc read/writable ?<p>" ); 83 "* Is /dev/sharpzdc read/writable ?<p>" );
84 connect( new QPushButton( "Exit", v ), SIGNAL( clicked() ), this, SLOT( close() ) ); 84 connect( new QPushButton( "Exit", v ), SIGNAL( clicked() ), this, SLOT( close() ) );
85 setCentralWidget( v ); 85 setCentralWidget( v );
86 return; 86 return;
87 } 87 }
88 #endif 88 #endif
89 89
90 init(); 90 init();
91 91
92 _rotation = 270; //TODO: grab these from the actual settings 92 _rotation = 270; //TODO: grab these from the actual settings
93 93
94 preview = new PreviewWidget( this, "camera preview widget" ); 94 preview = new PreviewWidget( this, "camera preview widget" );
95 //setCentralWidget( preview ); <--- don't do this! 95 //setCentralWidget( preview ); <--- don't do this!
96 preview->resize( QSize( 240, 288 ) ); 96 preview->resize( QSize( 240, 288 ) );
97 preview->show(); 97 preview->show();
98 98
99 // construct a System Channel to receive setRotation messages 99 // construct a System Channel to receive setRotation messages
100 _sysChannel = new QCopChannel( "QPE/System", this ); 100 _sysChannel = new QCopChannel( "QPE/System", this );
101 connect( _sysChannel, SIGNAL( received( const QCString&, const QByteArray& ) ), 101 connect( _sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
102 this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); 102 this, SLOT( systemMessage(const QCString&,const QByteArray&) ) );
103 103
104 connect( preview, SIGNAL( contextMenuRequested() ), this, SLOT( showContextMenu() ) ); 104 connect( preview, SIGNAL( contextMenuRequested() ), this, SLOT( showContextMenu() ) );
105 105
106 connect( ZCameraIO::instance(), SIGNAL( shutterClicked() ), this, SLOT( shutterClicked() ) ); 106 connect( ZCameraIO::instance(), SIGNAL( shutterClicked() ), this, SLOT( shutterClicked() ) );
107 107
108 updateCaption(); 108 updateCaption();
109 109
110}; 110};
111 111
112 112
113CameraMainWindow::~CameraMainWindow() 113CameraMainWindow::~CameraMainWindow()
114{ 114{
115 // write back configuration 115 // write back configuration
116 OConfigGroupSaver cgs( oApp->config(), "General" ); 116 OConfigGroupSaver cgs( oApp->config(), "General" );
117 cgs.config()->writeEntry( "flip", flip ); 117 cgs.config()->writeEntry( "flip", flip );
118 cgs.config()->writeEntry( "quality", quality ); 118 cgs.config()->writeEntry( "quality", quality );
119 cgs.config()->writeEntry( "zoom", zoom ); 119 cgs.config()->writeEntry( "zoom", zoom );
120 cgs.config()->writeEntry( "captureX", captureX ); 120 cgs.config()->writeEntry( "captureX", captureX );
121 cgs.config()->writeEntry( "captureY", captureY ); 121 cgs.config()->writeEntry( "captureY", captureY );
122 cgs.config()->writeEntry( "captureFormat", captureFormat ); 122 cgs.config()->writeEntry( "captureFormat", captureFormat );
123 cgs.config()->writeEntry( "outputTo", outputTo ); 123 cgs.config()->writeEntry( "outputTo", outputTo );
124 cgs.config()->writeEntry( "prefix", prefix ); 124 cgs.config()->writeEntry( "prefix", prefix );
125 cgs.config()->writeEntry( "appendSettings", appendSettings ); 125 cgs.config()->writeEntry( "appendSettings", appendSettings );
126} 126}
127 127
128 128
129void CameraMainWindow::init() 129void CameraMainWindow::init()
130{ 130{
131 // get values from configuration 131 // get values from configuration
132 OConfigGroupSaver cgs( oApp->config(), "General" ); 132 OConfigGroupSaver cgs( oApp->config(), "General" );
133 flip = cgs.config()->readEntry( "flip", "A" ); 133 flip = cgs.config()->readEntry( "flip", "A" );
134 quality = cgs.config()->readNumEntry( "quality", 50 ); 134 quality = cgs.config()->readNumEntry( "quality", 50 );
135 zoom = cgs.config()->readNumEntry( "zoom", 1 ); 135 zoom = cgs.config()->readNumEntry( "zoom", 1 );
136 captureX = cgs.config()->readNumEntry( "captureX", 480 ); 136 captureX = cgs.config()->readNumEntry( "captureX", 480 );
137 captureY = cgs.config()->readNumEntry( "captureY", 640 ); 137 captureY = cgs.config()->readNumEntry( "captureY", 640 );
138 captureFormat = cgs.config()->readEntry( "captureFormat", "JPEG" ); 138 captureFormat = cgs.config()->readEntry( "captureFormat", "JPEG" );
139 outputTo = cgs.config()->readEntry( "outputTo", "Documents Folder" ); 139 outputTo = cgs.config()->readEntry( "outputTo", "Documents Folder" );
140 prefix = cgs.config()->readEntry( "prefix", "Untitled" ); 140 prefix = cgs.config()->readEntry( "prefix", "Untitled" );
141 appendSettings = cgs.config()->readBoolEntry( "appendSettings", true ); 141 appendSettings = cgs.config()->readBoolEntry( "appendSettings", true );
142 142
143 // create action groups 143 // create action groups
144 QAction* a; 144 QAction* a;
145 resog = new QActionGroup( 0, "reso", true ); 145 resog = new QActionGroup( 0, "reso", true );
146 resog->setToggleAction( true ); 146 resog->setToggleAction( true );
147 new QAction( " 64 x 48", 0, 0, resog, "64x48", true ); 147 new QAction( " 64 x 48", 0, 0, resog, "64x48", true );
148 new QAction( "128 x 96", 0, 0, resog, "128x96", true ); 148 new QAction( "128 x 96", 0, 0, resog, "128x96", true );
149 new QAction( "192 x 144", 0, 0, resog, "192x144", true ); 149 new QAction( "192 x 144", 0, 0, resog, "192x144", true );
150 new QAction( "256 x 192", 0, 0, resog, "256x192", true ); 150 new QAction( "256 x 192", 0, 0, resog, "256x192", true );