summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 529bee4..21a668a 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -174,64 +174,68 @@ void PMainWindow::slotConfig() {
174 keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); 174 keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() );
175 175
176 keyWid->load(); 176 keyWid->load();
177 wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); 177 wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
178 178
179 179
180 bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); 180 bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
181 181
182/* 182/*
183 * clean up 183 * clean up
184 *apply changes 184 *apply changes
185 */ 185 */
186 186
187 QMap<PDirView*, QWidget*>::Iterator it; 187 QMap<PDirView*, QWidget*>::Iterator it;
188 for ( it = lst.begin(); it != lst.end(); ++it ) { 188 for ( it = lst.begin(); it != lst.end(); ++it ) {
189 if ( act ) 189 if ( act )
190 it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); 190 it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg);
191 delete it.key(); 191 delete it.key();
192 } 192 }
193 193
194 194
195 if ( act ) { 195 if ( act ) {
196 m_view->resetView(); 196 m_view->resetView();
197 keyWid->save(); 197 keyWid->save();
198 m_disp->manager()->save();
199 m_info->manager()->save();
200 m_view->manager()->save();
198 } 201 }
202 delete keyWid;
199} 203}
200 204
201/* 205/*
202 * create a new image info component 206 * create a new image info component
203 * and detach the current one 207 * and detach the current one
204 * we will make the other delete on exit 208 * we will make the other delete on exit
205 */ 209 */
206template<class T> 210template<class T>
207void PMainWindow::initT( const char* name, T** ptr, int id) { 211void PMainWindow::initT( const char* name, T** ptr, int id) {
208 if ( *ptr ) { 212 if ( *ptr ) {
209 (*ptr)->disconnect(this, SLOT(slotReturn())); 213 (*ptr)->disconnect(this, SLOT(slotReturn()));
210 (*ptr)->setDestructiveClose(); 214 (*ptr)->setDestructiveClose();
211 m_stack->removeWidget( *ptr ); 215 m_stack->removeWidget( *ptr );
212 } 216 }
213 *ptr = new T( m_stack, name ); 217 *ptr = new T(m_cfg, m_stack, name );
214 m_stack->addWidget( *ptr, id ); 218 m_stack->addWidget( *ptr, id );
215 219
216 connect(*ptr, SIGNAL(sig_return()), 220 connect(*ptr, SIGNAL(sig_return()),
217 this,SLOT(slotReturn())); 221 this,SLOT(slotReturn()));
218 222
219} 223}
220void PMainWindow::initInfo() { 224void PMainWindow::initInfo() {
221 initT<imageinfo>( "Image Info", &m_info, ImageInfo ); 225 initT<imageinfo>( "Image Info", &m_info, ImageInfo );
222 connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); 226 connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&)));
223} 227}
224void PMainWindow::initDisp() { 228void PMainWindow::initDisp() {
225 initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); 229 initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay );
226 if (m_disp) { 230 if (m_disp) {
227 m_disp->setAutoScale(autoScale); 231 m_disp->setAutoScale(autoScale);
228 m_disp->setAutoRotate(autoRotate); 232 m_disp->setAutoRotate(autoRotate);
229 connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); 233 connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&)));
230 } 234 }
231} 235}
232 236
233/** 237/**
234 * With big Screen the plan could be to 'detach' the image 238 * With big Screen the plan could be to 'detach' the image
235 * window if visible and to create a ne wone 239 * window if visible and to create a ne wone
236 * init* already supports it but I make no use of it for 240 * init* already supports it but I make no use of it for
237 * now. We set filename and raise 241 * now. We set filename and raise