author | drw <drw> | 2003-04-13 23:00:25 (UTC) |
---|---|---|
committer | drw <drw> | 2003-04-13 23:00:25 (UTC) |
commit | 377a172d8b497674d14d7e3580a008228f83d081 (patch) (unidiff) | |
tree | 7a4fdb5986db9ce9b3b26c9c0b56ece9ec63a468 | |
parent | f744559411664bc8c017bd642302ffe72dfbbb84 (diff) | |
download | opie-377a172d8b497674d14d7e3580a008228f83d081.zip opie-377a172d8b497674d14d7e3580a008228f83d081.tar.gz opie-377a172d8b497674d14d7e3580a008228f83d081.tar.bz2 |
OTabWidget::getCurrentTab() is now OTabWidget::currentTab()
-rw-r--r-- | libopie/otabwidget.cpp | 20 | ||||
-rw-r--r-- | libopie/otabwidget.h | 7 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 2 |
4 files changed, 15 insertions, 16 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp index a1fd2c0..05aafd4 100644 --- a/libopie/otabwidget.cpp +++ b/libopie/otabwidget.cpp | |||
@@ -65,33 +65,33 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi | |||
65 | widgetStack->setFrameStyle( QFrame::NoFrame ); | 65 | widgetStack->setFrameStyle( QFrame::NoFrame ); |
66 | widgetStack->setLineWidth( style().defaultFrameWidth() ); | 66 | widgetStack->setLineWidth( style().defaultFrameWidth() ); |
67 | 67 | ||
68 | tabBarStack = new QWidgetStack( this, "tabbarstack" ); | 68 | tabBarStack = new QWidgetStack( this, "tabbarstack" ); |
69 | 69 | ||
70 | tabBar = new OTabBar( tabBarStack, "tabbar" ); | 70 | tabBar = new OTabBar( tabBarStack, "tabbar" ); |
71 | tabBarStack->addWidget( tabBar, 0 ); | 71 | tabBarStack->addWidget( tabBar, 0 ); |
72 | connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) ); | 72 | connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) ); |
73 | 73 | ||
74 | tabList = new QComboBox( false, tabBarStack, "tablist" ); | 74 | tabList = new QComboBox( false, tabBarStack, "tablist" ); |
75 | tabBarStack->addWidget( tabList, 1 ); | 75 | tabBarStack->addWidget( tabList, 1 ); |
76 | connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); | 76 | connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); |
77 | 77 | ||
78 | setTabStyle( s ); | 78 | setTabStyle( s ); |
79 | setTabPosition( p ); | 79 | setTabPosition( p ); |
80 | 80 | ||
81 | currentTab= 0x0; | 81 | currTab= 0x0; |
82 | } | 82 | } |
83 | 83 | ||
84 | OTabWidget::~OTabWidget() | 84 | OTabWidget::~OTabWidget() |
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label ) | 88 | void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label ) |
89 | { | 89 | { |
90 | QPixmap iconset = loadSmooth( icon ); | 90 | QPixmap iconset = loadSmooth( icon ); |
91 | 91 | ||
92 | QTab *tab = new QTab(); | 92 | QTab *tab = new QTab(); |
93 | if ( tabBarStyle == IconTab ) | 93 | if ( tabBarStyle == IconTab ) |
94 | { | 94 | { |
95 | tab->label = QString::null; | 95 | tab->label = QString::null; |
96 | } | 96 | } |
97 | else | 97 | else |
@@ -134,34 +134,34 @@ void OTabWidget::removePage( QWidget *childwidget ) | |||
134 | if ( tab && tab->control() == childwidget ) | 134 | if ( tab && tab->control() == childwidget ) |
135 | { | 135 | { |
136 | tabBar->setTabEnabled( tab->id(), FALSE ); | 136 | tabBar->setTabEnabled( tab->id(), FALSE ); |
137 | tabBar->removeTab( tabBar->tab( tab->id() ) ); | 137 | tabBar->removeTab( tabBar->tab( tab->id() ) ); |
138 | int i = 0; | 138 | int i = 0; |
139 | while ( i < tabList->count() && tabList->text( i ) != tab->label() ) | 139 | while ( i < tabList->count() && tabList->text( i ) != tab->label() ) |
140 | { | 140 | { |
141 | i++; | 141 | i++; |
142 | } | 142 | } |
143 | if ( tabList->text( i ) == tab->label() ) | 143 | if ( tabList->text( i ) == tab->label() ) |
144 | { | 144 | { |
145 | tabList->removeItem( i ); | 145 | tabList->removeItem( i ); |
146 | } | 146 | } |
147 | widgetStack->removeWidget( childwidget ); | 147 | widgetStack->removeWidget( childwidget ); |
148 | tabs.remove( tab ); | 148 | tabs.remove( tab ); |
149 | delete tab; | 149 | delete tab; |
150 | currentTab = tabs.current(); | 150 | currTab = tabs.current(); |
151 | if ( !currentTab ) | 151 | if ( !currTab ) |
152 | { | 152 | { |
153 | widgetStack->setFrameStyle( QFrame::NoFrame ); | 153 | widgetStack->setFrameStyle( QFrame::NoFrame ); |
154 | } | 154 | } |
155 | 155 | ||
156 | setUpLayout(); | 156 | setUpLayout(); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) | 161 | void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) |
162 | { | 162 | { |
163 | OTabInfo *currtab = tabs.first(); | 163 | OTabInfo *currtab = tabs.first(); |
164 | while ( currtab && currtab->control() != widget ) | 164 | while ( currtab && currtab->control() != widget ) |
165 | { | 165 | { |
166 | currtab = tabs.next(); | 166 | currtab = tabs.next(); |
167 | } | 167 | } |
@@ -237,33 +237,33 @@ OTabWidget::TabStyle OTabWidget::tabStyle() const | |||
237 | { | 237 | { |
238 | return tabBarStyle; | 238 | return tabBarStyle; |
239 | } | 239 | } |
240 | 240 | ||
241 | void OTabWidget::setTabStyle( TabStyle s ) | 241 | void OTabWidget::setTabStyle( TabStyle s ) |
242 | { | 242 | { |
243 | tabBarStyle = s; | 243 | tabBarStyle = s; |
244 | if ( tabBarStyle == TextTab || tabBarStyle == IconTab ) | 244 | if ( tabBarStyle == TextTab || tabBarStyle == IconTab ) |
245 | { | 245 | { |
246 | QTab *currtab; | 246 | QTab *currtab; |
247 | for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) | 247 | for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) |
248 | { | 248 | { |
249 | currtab = tabBar->tab( tabinfo->id() ); | 249 | currtab = tabBar->tab( tabinfo->id() ); |
250 | if ( tabBarStyle == IconTab ) | 250 | if ( tabBarStyle == IconTab ) |
251 | { | 251 | { |
252 | currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); | 252 | currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); |
253 | if ( tabinfo == currentTab ) | 253 | if ( tabinfo == currTab ) |
254 | currtab->setText( tabinfo->label() ); | 254 | currtab->setText( tabinfo->label() ); |
255 | else | 255 | else |
256 | currtab->setText( QString::null ); | 256 | currtab->setText( QString::null ); |
257 | } | 257 | } |
258 | else | 258 | else |
259 | { | 259 | { |
260 | currtab->iconset = 0x0; | 260 | currtab->iconset = 0x0; |
261 | currtab->setText( tabinfo->label() ); | 261 | currtab->setText( tabinfo->label() ); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | tabBarStack->raiseWidget( tabBar ); | 264 | tabBarStack->raiseWidget( tabBar ); |
265 | } | 265 | } |
266 | else if ( tabBarStyle == TextList || tabBarStyle == IconList ) | 266 | else if ( tabBarStyle == TextList || tabBarStyle == IconList ) |
267 | { | 267 | { |
268 | tabList->clear(); | 268 | tabList->clear(); |
269 | for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) | 269 | for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) |
@@ -322,52 +322,52 @@ void OTabWidget::slotTabListSelected( int index ) | |||
322 | selectTab( newtab ); | 322 | selectTab( newtab ); |
323 | } | 323 | } |
324 | } | 324 | } |
325 | 325 | ||
326 | QPixmap OTabWidget::loadSmooth( const QString &name ) | 326 | QPixmap OTabWidget::loadSmooth( const QString &name ) |
327 | { | 327 | { |
328 | QImage image = Resource::loadImage( name ); | 328 | QImage image = Resource::loadImage( name ); |
329 | QPixmap pixmap; | 329 | QPixmap pixmap; |
330 | pixmap.convertFromImage( image.smoothScale( 14, 14 ) ); | 330 | pixmap.convertFromImage( image.smoothScale( 14, 14 ) ); |
331 | return pixmap; | 331 | return pixmap; |
332 | } | 332 | } |
333 | 333 | ||
334 | void OTabWidget::selectTab( OTabInfo *tab ) | 334 | void OTabWidget::selectTab( OTabInfo *tab ) |
335 | { | 335 | { |
336 | if ( tabBarStyle == IconTab ) | 336 | if ( tabBarStyle == IconTab ) |
337 | { | 337 | { |
338 | if ( currentTab ) | 338 | if ( currTab ) |
339 | { | 339 | { |
340 | tabBar->tab( currentTab->id() )->setText( QString::null ); | 340 | tabBar->tab( currTab->id() )->setText( QString::null ); |
341 | setUpLayout(); | 341 | setUpLayout(); |
342 | } | 342 | } |
343 | tabBar->tab( tab->id() )->setText( tab->label() ); | 343 | tabBar->tab( tab->id() )->setText( tab->label() ); |
344 | tabBar->setCurrentTab( tab->id() ); | 344 | tabBar->setCurrentTab( tab->id() ); |
345 | setUpLayout(); | 345 | setUpLayout(); |
346 | tabBar->update(); | 346 | tabBar->update(); |
347 | } | 347 | } |
348 | else | 348 | else |
349 | { | 349 | { |
350 | tabBar->setCurrentTab( tab->id() ); | 350 | tabBar->setCurrentTab( tab->id() ); |
351 | } | 351 | } |
352 | 352 | ||
353 | widgetStack->raiseWidget( tab->control() ); | 353 | widgetStack->raiseWidget( tab->control() ); |
354 | 354 | ||
355 | emit currentChanged( tab->control() ); | 355 | emit currentChanged( tab->control() ); |
356 | 356 | ||
357 | currentTab = tab; | 357 | currTab = tab; |
358 | } | 358 | } |
359 | 359 | ||
360 | void OTabWidget::setUpLayout() | 360 | void OTabWidget::setUpLayout() |
361 | { | 361 | { |
362 | tabBar->layoutTabs(); | 362 | tabBar->layoutTabs(); |
363 | QSize t( tabBarStack->sizeHint() ); | 363 | QSize t( tabBarStack->sizeHint() ); |
364 | if ( tabBarStyle == IconTab ) | 364 | if ( tabBarStyle == IconTab ) |
365 | { | 365 | { |
366 | if ( t.width() > width() ) | 366 | if ( t.width() > width() ) |
367 | t.setWidth( width() ); | 367 | t.setWidth( width() ); |
368 | } | 368 | } |
369 | else | 369 | else |
370 | { | 370 | { |
371 | t.setWidth( width() ); | 371 | t.setWidth( width() ); |
372 | } | 372 | } |
373 | int lw = widgetStack->lineWidth(); | 373 | int lw = widgetStack->lineWidth(); |
@@ -385,25 +385,25 @@ void OTabWidget::setUpLayout() | |||
385 | if ( autoMask() ) | 385 | if ( autoMask() ) |
386 | updateMask(); | 386 | updateMask(); |
387 | } | 387 | } |
388 | 388 | ||
389 | QSize OTabWidget::sizeHint() const | 389 | QSize OTabWidget::sizeHint() const |
390 | { | 390 | { |
391 | QSize s( widgetStack->sizeHint() ); | 391 | QSize s( widgetStack->sizeHint() ); |
392 | QSize t( tabBarStack->sizeHint() ); | 392 | QSize t( tabBarStack->sizeHint() ); |
393 | return QSize( QMAX( s.width(), t.width() ), s.height() + t.height() ); | 393 | return QSize( QMAX( s.width(), t.width() ), s.height() + t.height() ); |
394 | } | 394 | } |
395 | 395 | ||
396 | void OTabWidget::resizeEvent( QResizeEvent * ) | 396 | void OTabWidget::resizeEvent( QResizeEvent * ) |
397 | { | 397 | { |
398 | setUpLayout(); | 398 | setUpLayout(); |
399 | } | 399 | } |
400 | 400 | ||
401 | int OTabWidget::getCurrentTab() | 401 | int OTabWidget::currentTab() |
402 | { | 402 | { |
403 | if ( currentTab ) | 403 | if ( currTab ) |
404 | { | 404 | { |
405 | return currentTab->id(); | 405 | return currTab->id(); |
406 | } | 406 | } |
407 | return -1; | 407 | return -1; |
408 | } | 408 | } |
409 | 409 | ||
diff --git a/libopie/otabwidget.h b/libopie/otabwidget.h index 23fe774..bcd9a85 100644 --- a/libopie/otabwidget.h +++ b/libopie/otabwidget.h | |||
@@ -182,50 +182,49 @@ public: | |||
182 | 182 | ||
183 | /** | 183 | /** |
184 | * @fn setCurrentTab( int ) | 184 | * @fn setCurrentTab( int ) |
185 | * @brief Selects and brings to top the desired widget, by using id. | 185 | * @brief Selects and brings to top the desired widget, by using id. |
186 | * | 186 | * |
187 | * @param tab id for widget to select. | 187 | * @param tab id for widget to select. |
188 | */ | 188 | */ |
189 | void setCurrentTab(int); | 189 | void setCurrentTab(int); |
190 | 190 | ||
191 | /** | 191 | /** |
192 | * @fn sizeHint() | 192 | * @fn sizeHint() |
193 | * @brief Reimplemented for internal purposes. | 193 | * @brief Reimplemented for internal purposes. |
194 | */ | 194 | */ |
195 | QSize sizeHint() const; | 195 | QSize sizeHint() const; |
196 | 196 | ||
197 | /** | 197 | /** |
198 | * @fn getCurrentTab( ) | 198 | * @fn currentTab( ) |
199 | * @brief returns current tab id. | 199 | * @brief returns current tab id. |
200 | */ | 200 | */ |
201 | //FIXME TT coding style currentTab() -zecke | 201 | int currentTab(); |
202 | int getCurrentTab(); | ||
203 | 202 | ||
204 | 203 | ||
205 | protected: | 204 | protected: |
206 | 205 | ||
207 | /** | 206 | /** |
208 | * @fn resizeEvent( QResizeEvent * ) | 207 | * @fn resizeEvent( QResizeEvent * ) |
209 | * @brief Reimplemented for internal purposes. | 208 | * @brief Reimplemented for internal purposes. |
210 | */ | 209 | */ |
211 | void resizeEvent( QResizeEvent * ); | 210 | void resizeEvent( QResizeEvent * ); |
212 | 211 | ||
213 | private: | 212 | private: |
214 | OTabInfoList tabs; | 213 | OTabInfoList tabs; |
215 | OTabInfo *currentTab; | 214 | OTabInfo *currTab; |
216 | 215 | ||
217 | TabStyle tabBarStyle; | 216 | TabStyle tabBarStyle; |
218 | TabPosition tabBarPosition; | 217 | TabPosition tabBarPosition; |
219 | 218 | ||
220 | QWidgetStack *tabBarStack; | 219 | QWidgetStack *tabBarStack; |
221 | OTabBar *tabBar; | 220 | OTabBar *tabBar; |
222 | QComboBox *tabList; | 221 | QComboBox *tabList; |
223 | 222 | ||
224 | QWidgetStack *widgetStack; | 223 | QWidgetStack *widgetStack; |
225 | 224 | ||
226 | /** | 225 | /** |
227 | * @fn loadSmooth( const QString &name ) | 226 | * @fn loadSmooth( const QString &name ) |
228 | * @brief Loads icon for widget. | 227 | * @brief Loads icon for widget. |
229 | * | 228 | * |
230 | * @param name Name of icon image file. | 229 | * @param name Name of icon image file. |
231 | */ | 230 | */ |
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 1a5e131..41e83c7 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -334,33 +334,33 @@ void AdvancedFm::writeConfig() | |||
334 | 334 | ||
335 | void AdvancedFm::currentPathComboChanged() | 335 | void AdvancedFm::currentPathComboChanged() |
336 | { | 336 | { |
337 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) | 337 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) |
338 | { | 338 | { |
339 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); | 339 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); |
340 | populateView(); | 340 | populateView(); |
341 | } | 341 | } |
342 | else | 342 | else |
343 | { | 343 | { |
344 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 344 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | void AdvancedFm::fillCombo(const QString ¤tPath) | 348 | void AdvancedFm::fillCombo(const QString ¤tPath) |
349 | { | 349 | { |
350 | // qDebug("%d",TabWidget->getCurrentTab()); | 350 | // qDebug("%d",TabWidget->currentTab()); |
351 | if ( whichTab == 1) | 351 | if ( whichTab == 1) |
352 | { | 352 | { |
353 | currentPathCombo->lineEdit()->setText( currentPath); | 353 | currentPathCombo->lineEdit()->setText( currentPath); |
354 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) | 354 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) |
355 | { | 355 | { |
356 | currentPathCombo->clear(); | 356 | currentPathCombo->clear(); |
357 | localDirPathStringList.prepend( currentPath ); | 357 | localDirPathStringList.prepend( currentPath ); |
358 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 358 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
359 | } | 359 | } |
360 | } | 360 | } |
361 | else | 361 | else |
362 | { | 362 | { |
363 | currentPathCombo->lineEdit()->setText( currentPath); | 363 | currentPathCombo->lineEdit()->setText( currentPath); |
364 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) | 364 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) |
365 | { | 365 | { |
366 | currentPathCombo->clear(); | 366 | currentPathCombo->clear(); |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index eac13f6..93203cd 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -695,33 +695,33 @@ void AdvancedFm::doBeam() | |||
695 | Ir *file = new Ir(this, "IR"); | 695 | Ir *file = new Ir(this, "IR"); |
696 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); | 696 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); |
697 | file->send( curFile, curFile ); | 697 | file->send( curFile, curFile ); |
698 | } | 698 | } |
699 | } | 699 | } |
700 | } | 700 | } |
701 | 701 | ||
702 | } | 702 | } |
703 | 703 | ||
704 | void AdvancedFm::fileBeamFinished( Ir *) | 704 | void AdvancedFm::fileBeamFinished( Ir *) |
705 | { | 705 | { |
706 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 706 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
707 | } | 707 | } |
708 | 708 | ||
709 | void AdvancedFm::selectAll() | 709 | void AdvancedFm::selectAll() |
710 | { | 710 | { |
711 | // if (TabWidget->getCurrentTab() == 0) { | 711 | // if (TabWidget->currentTab() == 0) { |
712 | QListView *thisView = CurrentView(); | 712 | QListView *thisView = CurrentView(); |
713 | thisView->selectAll(true); | 713 | thisView->selectAll(true); |
714 | thisView->setSelected( thisView->firstChild(),false); | 714 | thisView->setSelected( thisView->firstChild(),false); |
715 | // } else { | 715 | // } else { |
716 | // Remote_View->selectAll(true); | 716 | // Remote_View->selectAll(true); |
717 | // Remote_View->setSelected( Remote_View->firstChild(),false); | 717 | // Remote_View->setSelected( Remote_View->firstChild(),false); |
718 | // } | 718 | // } |
719 | } | 719 | } |
720 | 720 | ||
721 | void AdvancedFm::startProcess(const QString & cmd) | 721 | void AdvancedFm::startProcess(const QString & cmd) |
722 | { | 722 | { |
723 | QStringList command; | 723 | QStringList command; |
724 | OProcess *process; | 724 | OProcess *process; |
725 | process = new OProcess(); | 725 | process = new OProcess(); |
726 | connect(process, SIGNAL(processExited(OProcess *)), | 726 | connect(process, SIGNAL(processExited(OProcess *)), |
727 | this, SLOT( processEnded(OProcess *))); | 727 | this, SLOT( processEnded(OProcess *))); |