summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen
authorar <ar>2004-06-02 22:20:53 (UTC)
committer ar <ar>2004-06-02 22:20:53 (UTC)
commit9135254f2b593741cf7b0ffd80bb8bb63986333d (patch) (unidiff)
tree98248548d823b97970b2240695c958b7ce440a9d /libopie2/opieui/big-screen
parent8fe425e226eefcd652c4cb875d68fbd886d4c42c (diff)
downloadopie-9135254f2b593741cf7b0ffd80bb8bb63986333d.zip
opie-9135254f2b593741cf7b0ffd80bb8bb63986333d.tar.gz
opie-9135254f2b593741cf7b0ffd80bb8bb63986333d.tar.bz2
- convert to odebug framework
Diffstat (limited to 'libopie2/opieui/big-screen') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp25
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp5
2 files changed, 17 insertions, 13 deletions
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp
index f0287ed..f50e7f0 100644
--- a/libopie2/opieui/big-screen/osplitter.cpp
+++ b/libopie2/opieui/big-screen/osplitter.cpp
@@ -27,12 +27,13 @@
27*/ 27*/
28 28
29#include "osplitter.h" 29#include "osplitter.h"
30 30
31/* OPIE */ 31/* OPIE */
32#include <opie2/otabwidget.h> 32#include <opie2/otabwidget.h>
33#include <opie2/odebug.h>
33 34
34/* QT */ 35/* QT */
35#include <qvaluelist.h> 36#include <qvaluelist.h>
36#include <qvbox.h> 37#include <qvbox.h>
37 38
38using namespace Opie::Ui; 39using namespace Opie::Ui;
@@ -78,13 +79,13 @@ OSplitter::OSplitter( Orientation orient, QWidget* parent, const char* name, WFl
78 * Destructor destructs this object and cleans up. All child 79 * Destructor destructs this object and cleans up. All child
79 * widgets will be deleted 80 * widgets will be deleted
80 * @see addWidget 81 * @see addWidget
81 */ 82 */
82OSplitter::~OSplitter() 83OSplitter::~OSplitter()
83{ 84{
84 qWarning("Deleted Splitter"); 85 owarn << "Deleted Splitter" << oendl;
85 m_splitter.setAutoDelete( true ); 86 m_splitter.setAutoDelete( true );
86 m_splitter.clear(); 87 m_splitter.clear();
87 88
88 delete m_hbox; 89 delete m_hbox;
89 delete m_tabWidget; 90 delete m_tabWidget;
90} 91}
@@ -207,13 +208,13 @@ void OSplitter::removeWidget( OSplitter* split)
207 */ 208 */
208void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label ) 209void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label )
209{ 210{
210#ifdef DEBUG 211#ifdef DEBUG
211 if (!wid ) 212 if (!wid )
212 { 213 {
213 qWarning("Widget is not valid!"); 214 owarn << "Widget is not valid!" << oendl;
214 return; 215 return;
215 } 216 }
216#endif 217#endif
217 OSplitterContainer cont; 218 OSplitterContainer cont;
218 cont.widget = wid; 219 cont.widget = wid;
219 cont.icon =icon; 220 cont.icon =icon;
@@ -363,15 +364,15 @@ QSize OSplitter::minimumSizeHint()const
363void OSplitter::resizeEvent( QResizeEvent* res ) 364void OSplitter::resizeEvent( QResizeEvent* res )
364{ 365{
365 QFrame::resizeEvent( res ); 366 QFrame::resizeEvent( res );
366 /* 367 /*
367 * 368 *
368 */ 369 */
369 // qWarning("Old size was width = %d height = %d", res->oldSize().width(), res->oldSize().height() ); 370 // owarn << "Old size was width = " << res->oldSize().width() << " height = " << res->oldSize().height() << "" << oendl;
370 bool mode = true; 371 bool mode = true;
371 qWarning("New size is width = %d height = %d %s", res->size().width(), res->size().height(), name() ); 372 owarn << "New size is width = " << res->size().width() << " height = " << res->size().height() << " " << name() << "" << oendl;
372 if ( res->size().width() > m_size_policy && 373 if ( res->size().width() > m_size_policy &&
373 m_orient == Horizontal ) 374 m_orient == Horizontal )
374 { 375 {
375 changeHBox(); 376 changeHBox();
376 mode = false; 377 mode = false;
377 } 378 }
@@ -382,13 +383,13 @@ void OSplitter::resizeEvent( QResizeEvent* res )
382 { 383 {
383 changeTab(); 384 changeTab();
384 } 385 }
385 else if ( res->size().height() > m_size_policy && 386 else if ( res->size().height() > m_size_policy &&
386 m_orient == Vertical ) 387 m_orient == Vertical )
387 { 388 {
388 qWarning("Changng to vbox %s", name() ); 389 owarn << "Changng to vbox " << name() << "" << oendl;
389 changeVBox(); 390 changeVBox();
390 mode = false; 391 mode = false;
391 } 392 }
392 393
393 emit sizeChanged(mode, m_orient ); 394 emit sizeChanged(mode, m_orient );
394} 395}
@@ -441,13 +442,13 @@ void OSplitter::changeTab()
441 raise(); 442 raise();
442 show(); 443 show();
443 m_tabWidget->setGeometry( frameRect() ); 444 m_tabWidget->setGeometry( frameRect() );
444 return; 445 return;
445 } 446 }
446 447
447 qWarning(" New Tab Widget %s", name() ); 448 owarn << " New Tab Widget " << name() << "" << oendl;
448 /* 449 /*
449 * and add all widgets this will reparent them 450 * and add all widgets this will reparent them
450 * delete m_hbox set it to 0 451 * delete m_hbox set it to 0
451 * 452 *
452 */ 453 */
453 OTabWidget *tab; 454 OTabWidget *tab;
@@ -468,13 +469,13 @@ void OSplitter::changeTab()
468 469
469 connect(tab, SIGNAL(currentChanged(QWidget*) ), 470 connect(tab, SIGNAL(currentChanged(QWidget*) ),
470 this, SIGNAL(currentChanged(QWidget*) ) ); 471 this, SIGNAL(currentChanged(QWidget*) ) );
471 472
472 for ( ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) 473 for ( ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it )
473 { 474 {
474 qWarning("Widget is %s", (*it).name.latin1() ); 475 owarn << "Widget is " << (*it).name << "" << oendl;
475 addToTab( (*it) ); 476 addToTab( (*it) );
476 } 477 }
477 478
478 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) 479 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() )
479 { 480 {
480 split->reparent(this, 0, QPoint(0, 0) ); 481 split->reparent(this, 0, QPoint(0, 0) );
@@ -501,26 +502,26 @@ void OSplitter::changeHBox()
501 if (m_hbox ) 502 if (m_hbox )
502 { 503 {
503 m_hbox->setGeometry( frameRect() ); 504 m_hbox->setGeometry( frameRect() );
504 return; 505 return;
505 } 506 }
506 507
507 qWarning("new HBox %s", name() ); 508 owarn << "new HBox " << name() << "" << oendl;
508 m_hbox = new QHBox( this ); 509 m_hbox = new QHBox( this );
509 commonChangeBox(); 510 commonChangeBox();
510} 511}
511 512
512void OSplitter::changeVBox() 513void OSplitter::changeVBox()
513{ 514{
514 if (m_hbox ) 515 if (m_hbox )
515 { 516 {
516 m_hbox->setGeometry( frameRect() ); 517 m_hbox->setGeometry( frameRect() );
517 return; 518 return;
518 } 519 }
519 520
520 qWarning("New VBOX %s", name() ); 521 owarn << "New VBOX " << name() << "" << oendl;
521 m_hbox = new QVBox( this ); 522 m_hbox = new QVBox( this );
522 523
523 commonChangeBox(); 524 commonChangeBox();
524 525
525} 526}
526 527
@@ -529,20 +530,20 @@ void OSplitter::changeVBox()
529 * first remove and add children 530 * first remove and add children
530 * the other splitters 531 * the other splitters
531 * it is recursive as well due the call to setTabWidget 532 * it is recursive as well due the call to setTabWidget
532 */ 533 */
533void OSplitter::commonChangeBox() 534void OSplitter::commonChangeBox()
534{ 535{
535 qWarning(" Name of Splitters is %s", name() ); 536 owarn << " Name of Splitters is " << name() << "" << oendl;
536 537
537 for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) 538 for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it )
538 { 539 {
539 /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */ 540 /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */
540 if (m_parentTab ) 541 if (m_parentTab )
541 removeFromTab( (*it).widget ); 542 removeFromTab( (*it).widget );
542 qWarning("Adding to box %s", (*it).name.latin1() ); 543 owarn << "Adding to box " << (*it).name << "" << oendl;
543 addToBox( (*it) ); 544 addToBox( (*it) );
544 } 545 }
545 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) 546 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() )
546 { 547 {
547 /* tell them the world had changed */ 548 /* tell them the world had changed */
548 split->setTabWidget( 0 ); 549 split->setTabWidget( 0 );
@@ -556,13 +557,13 @@ void OSplitter::commonChangeBox()
556 557
557 558
558 if (m_parentTab ) 559 if (m_parentTab )
559 m_parentTab->addTab(m_hbox, iconName(), label() ); 560 m_parentTab->addTab(m_hbox, iconName(), label() );
560 else 561 else
561 { 562 {
562 qWarning(" setting Box geometry for %s", name() ); 563 owarn << " setting Box geometry for " << name() << "" << oendl;
563 m_hbox->setGeometry( frameRect() ); 564 m_hbox->setGeometry( frameRect() );
564 m_hbox->show(); 565 m_hbox->show();
565 delete m_tabWidget; 566 delete m_tabWidget;
566 m_tabWidget = 0; 567 m_tabWidget = 0;
567 show(); // also show this widget 568 show(); // also show this widget
568 } 569 }
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index a0a6355..de7f83f 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
@@ -25,12 +25,15 @@
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "owidgetstack.h" 29#include "owidgetstack.h"
30 30
31/* OPIE */
32#include <opie2/odebug.h>
33
31/* QT */ 34/* QT */
32#include <qapplication.h> 35#include <qapplication.h>
33#include <qwidgetstack.h> 36#include <qwidgetstack.h>
34 37
35namespace Opie { 38namespace Opie {
36namespace Ui { 39namespace Ui {
@@ -304,13 +307,13 @@ void OWidgetStack::hideWidget( QWidget* wid) {
304 307
305 raiseWidget( wid ); 308 raiseWidget( wid );
306} 309}
307 310
308 311
309bool OWidgetStack::eventFilter( QObject* obj, QEvent* e) { 312bool OWidgetStack::eventFilter( QObject* obj, QEvent* e) {
310 qWarning(" %s %s", obj->name(), obj->className() ); 313 owarn << " " << obj->name() << " " << obj->className() << "" << oendl;
311 if ( e->type() == QEvent::Resize ) { 314 if ( e->type() == QEvent::Resize ) {
312 QResizeEvent *res = static_cast<QResizeEvent*>( e ); 315 QResizeEvent *res = static_cast<QResizeEvent*>( e );
313 QSize size = res->size(); 316 QSize size = res->size();
314 if ( size.width() >= mode_size ) 317 if ( size.width() >= mode_size )
315 switchTop(); 318 switchTop();
316 else 319 else