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.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 6660eb2..30c9bf1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -128,103 +128,105 @@ void PMainWindow::slotScaleToggled(bool how) | |||
128 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); | 128 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); |
129 | } | 129 | } |
130 | m_aAutoRotate->setEnabled(!how); | 130 | m_aAutoRotate->setEnabled(!how); |
131 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; | 131 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; |
132 | } | 132 | } |
133 | 133 | ||
134 | void PMainWindow::slotConfig() { | 134 | void PMainWindow::slotConfig() { |
135 | /* | 135 | /* |
136 | * have a tab with the possible views | 136 | * have a tab with the possible views |
137 | * a tab for globals image cache size.. scaled loading | 137 | * a tab for globals image cache size.. scaled loading |
138 | * and one tab for the KeyConfigs | 138 | * and one tab for the KeyConfigs |
139 | */ | 139 | */ |
140 | QDialog dlg(this, 0, true); | 140 | QDialog dlg(this, 0, true); |
141 | dlg.setCaption( tr("Opie Eye - Config" ) ); | 141 | dlg.setCaption( tr("Opie Eye - Config" ) ); |
142 | 142 | ||
143 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 143 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
144 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); | 144 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
145 | lay->addWidget( wid ); | 145 | lay->addWidget( wid ); |
146 | 146 | ||
147 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); | 147 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); |
148 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); | 148 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); |
149 | 149 | ||
150 | ViewMap *vM = viewMap(); | 150 | ViewMap *vM = viewMap(); |
151 | ViewMap::Iterator _it = vM->begin(); | 151 | ViewMap::Iterator _it = vM->begin(); |
152 | QMap<PDirView*, QWidget*> lst; | 152 | QMap<PDirView*, QWidget*> lst; |
153 | 153 | ||
154 | for( ; _it != vM->end(); ++_it ) { | 154 | for( ; _it != vM->end(); ++_it ) { |
155 | PDirView *view = (_it.data())(*m_cfg); | 155 | PDirView *view = (_it.data())(*m_cfg); |
156 | PInterfaceInfo *inf = view->interfaceInfo(); | 156 | PInterfaceInfo *inf = view->interfaceInfo(); |
157 | QWidget *_wid = inf->configWidget( *m_cfg ); | 157 | QWidget *_wid = inf->configWidget( *m_cfg ); |
158 | if (!_wid) continue; | 158 | if (!_wid) continue; |
159 | _wid->reparent(wid, QPoint() ); | 159 | _wid->reparent(wid, QPoint() ); |
160 | lst.insert( view, _wid ); | 160 | lst.insert( view, _wid ); |
161 | wid->addTab( _wid, "fileopen", inf->name() ); | 161 | wid->addTab( _wid, "fileopen", inf->name() ); |
162 | } | 162 | } |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * Add the KeyConfigWidget | 165 | * Add the KeyConfigWidget |
166 | */ | 166 | */ |
167 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 167 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
168 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 168 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
169 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 169 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
170 | QWidget*w = m_stack->visibleWidget(); | 170 | QWidget*w = m_stack->visibleWidget(); |
171 | 171 | ||
172 | bool reminfo = false; | 172 | bool reminfo = false; |
173 | if ( !m_info ) { | 173 | if ( !m_info ) { |
174 | reminfo = true; | 174 | reminfo = true; |
175 | initInfo(); | 175 | initInfo(); |
176 | m_info->hide(); | ||
176 | } | 177 | } |
177 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 178 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
178 | 179 | ||
179 | bool remdisp = false; | 180 | bool remdisp = false; |
180 | if ( !m_disp ) { | 181 | if ( !m_disp ) { |
181 | remdisp = true; | 182 | remdisp = true; |
182 | initDisp(); | 183 | initDisp(); |
184 | m_disp->hide(); | ||
183 | } | 185 | } |
184 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | 186 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); |
185 | 187 | ||
186 | keyWid->load(); | 188 | keyWid->load(); |
187 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 189 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
188 | wid->setCurrentTab(0); | 190 | wid->setCurrentTab(0); |
189 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 191 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
190 | 192 | ||
191 | /* | 193 | /* |
192 | * clean up | 194 | * clean up |
193 | *apply changes | 195 | *apply changes |
194 | */ | 196 | */ |
195 | 197 | ||
196 | QMap<PDirView*, QWidget*>::Iterator it; | 198 | QMap<PDirView*, QWidget*>::Iterator it; |
197 | for ( it = lst.begin(); it != lst.end(); ++it ) { | 199 | for ( it = lst.begin(); it != lst.end(); ++it ) { |
198 | if ( act ) | 200 | if ( act ) |
199 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); | 201 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); |
200 | delete it.key(); | 202 | delete it.key(); |
201 | } | 203 | } |
202 | 204 | ||
203 | 205 | ||
204 | if ( act ) { | 206 | if ( act ) { |
205 | m_view->resetView(); | 207 | m_view->resetView(); |
206 | keyWid->save(); | 208 | keyWid->save(); |
207 | m_disp->manager()->save(); | 209 | m_disp->manager()->save(); |
208 | m_info->manager()->save(); | 210 | m_info->manager()->save(); |
209 | m_view->manager()->save(); | 211 | m_view->manager()->save(); |
210 | bSetup->save_values(); | 212 | bSetup->save_values(); |
211 | readConfig(); | 213 | readConfig(); |
212 | } | 214 | } |
213 | delete keyWid; | 215 | delete keyWid; |
214 | 216 | ||
215 | m_stack->raiseWidget(w); | 217 | m_stack->raiseWidget(w); |
216 | if (remdisp) { | 218 | if (remdisp) { |
217 | m_disp->hide(); | 219 | m_disp->hide(); |
218 | } | 220 | } |
219 | if (reminfo) { | 221 | if (reminfo) { |
220 | m_info->hide(); | 222 | m_info->hide(); |
221 | } | 223 | } |
222 | } | 224 | } |
223 | 225 | ||
224 | /* | 226 | /* |
225 | * create a new image info component | 227 | * create a new image info component |
226 | * and detach the current one | 228 | * and detach the current one |
227 | * we will make the other delete on exit | 229 | * we will make the other delete on exit |
228 | */ | 230 | */ |
229 | template<class T> | 231 | template<class T> |
230 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 232 | void PMainWindow::initT( const char* name, T** ptr, int id) { |