-rw-r--r-- | libopie2/opieui/big-screen/osplitter.cpp | 15 | ||||
-rw-r--r-- | libopie2/opieui/big-screen/owidgetstack.cpp | 1 |
2 files changed, 0 insertions, 16 deletions
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp index f50e7f0..78e919a 100644 --- a/libopie2/opieui/big-screen/osplitter.cpp +++ b/libopie2/opieui/big-screen/osplitter.cpp @@ -69,33 +69,32 @@ OSplitter::OSplitter( Orientation orient, QWidget* parent, const char* name, WFl /* start by default with the tab widget */ m_tabWidget = 0; m_parentTab = 0; changeTab(); } /** * Destructor destructs this object and cleans up. All child * widgets will be deleted * @see addWidget */ OSplitter::~OSplitter() { - owarn << "Deleted Splitter" << oendl; m_splitter.setAutoDelete( true ); m_splitter.clear(); delete m_hbox; delete m_tabWidget; } /** * Sets the label for the Splitter. This label will be used * if a parent splitter is arranged as TabWidget but * this splitter is in fullscreen mode. Then a tab with OSplitter::label() * and iconName() gets added. * * @param name The name of the Label */ @@ -197,36 +196,33 @@ void OSplitter::removeWidget( OSplitter* split) * Adds a widget to the Splitter. The widgets gets inserted * at the end of either the Box or TabWidget. * Ownership gets transfered and the widgets gets reparented. * Note: icon and label is only available on small screensizes * if size is smaller than the mark * Warning: No null checking of the widget is done. Only on debug * a message will be outputtet * * @param wid The widget which will be added * @param icon The icon of the possible Tab * @param label The label of the possible Tab */ void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label ) { #ifdef DEBUG if (!wid ) - { - owarn << "Widget is not valid!" << oendl; return; - } #endif OSplitterContainer cont; cont.widget = wid; cont.icon =icon; cont.name = label; m_container.append( cont ); /* * */ if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) ) setTabWidget( m_parentTab ); else { if (m_hbox ) @@ -354,52 +350,49 @@ QSize OSplitter::minimumSizeHint()const if (m_hbox) return m_hbox->sizeHint(); else return m_tabWidget->sizeHint(); } #endif /** * @reimplemented for internal reasons */ void OSplitter::resizeEvent( QResizeEvent* res ) { QFrame::resizeEvent( res ); /* * */ - // owarn << "Old size was width = " << res->oldSize().width() << " height = " << res->oldSize().height() << "" << oendl; bool mode = true; - owarn << "New size is width = " << res->size().width() << " height = " << res->size().height() << " " << name() << "" << oendl; if ( res->size().width() > m_size_policy && m_orient == Horizontal ) { changeHBox(); mode = false; } else if ( (res->size().width() <= m_size_policy && m_orient == Horizontal ) || (res->size().height() <= m_size_policy && m_orient == Vertical ) ) { changeTab(); } else if ( res->size().height() > m_size_policy && m_orient == Vertical ) { - owarn << "Changng to vbox " << name() << "" << oendl; changeVBox(); mode = false; } emit sizeChanged(mode, m_orient ); } /* * Adds a container to a tab either the parent tab * or our own */ void OSplitter::addToTab( const Opie::Ui::Internal::OSplitterContainer& con ) { QWidget *wid = con.widget; // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); if (m_parentTab ) @@ -432,148 +425,140 @@ void OSplitter::removeFromTab( QWidget* wid ) /* * switches over to a OTabWidget layout * it is recursive */ void OSplitter::changeTab() { /* if we're the owner of the tab widget */ if (m_tabWidget ) { raise(); show(); m_tabWidget->setGeometry( frameRect() ); return; } - owarn << " New Tab Widget " << name() << "" << oendl; /* * and add all widgets this will reparent them * delete m_hbox set it to 0 * */ OTabWidget *tab; if ( m_parentTab ) { hide(); tab = m_parentTab; /* expensive but needed cause we're called from setTabWidget and resizeEvent*/ if (!m_container.isEmpty() ) { ContainerList::Iterator it = m_container.begin(); for (; it != m_container.end(); ++it ) m_parentTab->removePage( (*it).widget ); } } else tab = m_tabWidget = new OTabWidget( this ); connect(tab, SIGNAL(currentChanged(QWidget*) ), this, SIGNAL(currentChanged(QWidget*) ) ); for ( ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) { - owarn << "Widget is " << (*it).name << "" << oendl; addToTab( (*it) ); } for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) { split->reparent(this, 0, QPoint(0, 0) ); split->setTabWidget( tab ); } delete m_hbox; m_hbox = 0; if (!m_tabWidget ) return; m_tabWidget->setGeometry( frameRect() ); m_tabWidget->show(); } /* * changes over to a box * this is recursive as well */ void OSplitter::changeHBox() { if (m_hbox ) { m_hbox->setGeometry( frameRect() ); return; } - owarn << "new HBox " << name() << "" << oendl; m_hbox = new QHBox( this ); commonChangeBox(); } void OSplitter::changeVBox() { if (m_hbox ) { m_hbox->setGeometry( frameRect() ); return; } - owarn << "New VBOX " << name() << "" << oendl; m_hbox = new QVBox( this ); commonChangeBox(); } /* * common box code * first remove and add children * the other splitters * it is recursive as well due the call to setTabWidget */ void OSplitter::commonChangeBox() { - owarn << " Name of Splitters is " << name() << "" << oendl; - for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) { /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */ if (m_parentTab ) removeFromTab( (*it).widget ); - owarn << "Adding to box " << (*it).name << "" << oendl; addToBox( (*it) ); } for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) { /* tell them the world had changed */ split->setTabWidget( 0 ); OSplitterContainer con; con.widget = split; // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget) // : static_cast<QWidget*>(split->m_hbox); addToBox( con ); } if (m_parentTab ) m_parentTab->addTab(m_hbox, iconName(), label() ); else { - owarn << " setting Box geometry for " << name() << "" << oendl; m_hbox->setGeometry( frameRect() ); m_hbox->show(); delete m_tabWidget; m_tabWidget = 0; show(); // also show this widget } } /* * sets the tabwidget, removes tabs, and relayouts the widget */ void OSplitter::setTabWidget( OTabWidget* wid) { /* clean up cause m_parentTab will not be available for us */ if ( m_parentTab ) { diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp index 9c9f7ec..b14a643 100644 --- a/libopie2/opieui/big-screen/owidgetstack.cpp +++ b/libopie2/opieui/big-screen/owidgetstack.cpp @@ -297,33 +297,32 @@ void OWidgetStack::hideWidget( int id) { } /** * This is overloaded and only differs in the parameters * it takes. */ void OWidgetStack::hideWidget( QWidget* wid) { /* still not smart */ if ( m_mode == BigScreen && m_last != m_mWidget ) m_last->hide(); raiseWidget( wid ); } bool OWidgetStack::eventFilter( QObject* obj, QEvent* e) { - owarn << " " << obj->name() << " " << obj->className() << "" << oendl; if ( e->type() == QEvent::Resize ) { QResizeEvent *res = static_cast<QResizeEvent*>( e ); QSize size = res->size(); if ( size.width() >= mode_size ) switchTop(); else switchStack(); } return false; } /** * @internal_resons */ void OWidgetStack::resizeEvent( QResizeEvent* ev ) { |