summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen/osplitter.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/big-screen/osplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp25
1 files changed, 13 insertions, 12 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
@@ -21,24 +21,25 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "osplitter.h"
/* OPIE */
#include <opie2/otabwidget.h>
+#include <opie2/odebug.h>
/* QT */
#include <qvaluelist.h>
#include <qvbox.h>
using namespace Opie::Ui;
using namespace Opie::Ui::Internal;
/**
*
* This is the constructor of OSplitter
* You might want to call setSizeChange to tell
@@ -72,25 +73,25 @@ OSplitter::OSplitter( Orientation orient, QWidget* parent, const char* name, WFl
changeTab();
}
/**
* Destructor destructs this object and cleans up. All child
* widgets will be deleted
* @see addWidget
*/
OSplitter::~OSplitter()
{
- qWarning("Deleted Splitter");
+ 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()
@@ -201,25 +202,25 @@ void OSplitter::removeWidget( OSplitter* split)
* 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 )
{
- qWarning("Widget is not valid!");
+ owarn << "Widget is not valid!" << oendl;
return;
}
#endif
OSplitterContainer cont;
cont.widget = wid;
cont.icon =icon;
cont.name = label;
m_container.append( cont );
/*
*
@@ -357,44 +358,44 @@ QSize OSplitter::minimumSizeHint()const
}
#endif
/**
* @reimplemented for internal reasons
*/
void OSplitter::resizeEvent( QResizeEvent* res )
{
QFrame::resizeEvent( res );
/*
*
*/
- // qWarning("Old size was width = %d height = %d", res->oldSize().width(), res->oldSize().height() );
+ // owarn << "Old size was width = " << res->oldSize().width() << " height = " << res->oldSize().height() << "" << oendl;
bool mode = true;
- qWarning("New size is width = %d height = %d %s", res->size().width(), res->size().height(), name() );
+ 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 )
{
- qWarning("Changng to vbox %s", name() );
+ 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 )
@@ -435,25 +436,25 @@ void OSplitter::removeFromTab( QWidget* wid )
*/
void OSplitter::changeTab()
{
/* if we're the owner of the tab widget */
if (m_tabWidget )
{
raise();
show();
m_tabWidget->setGeometry( frameRect() );
return;
}
- qWarning(" New Tab Widget %s", name() );
+ 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() )
@@ -462,25 +463,25 @@ void OSplitter::changeTab()
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 )
{
- qWarning("Widget is %s", (*it).name.latin1() );
+ 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;
@@ -495,80 +496,80 @@ void OSplitter::changeTab()
/*
* changes over to a box
* this is recursive as well
*/
void OSplitter::changeHBox()
{
if (m_hbox )
{
m_hbox->setGeometry( frameRect() );
return;
}
- qWarning("new HBox %s", name() );
+ owarn << "new HBox " << name() << "" << oendl;
m_hbox = new QHBox( this );
commonChangeBox();
}
void OSplitter::changeVBox()
{
if (m_hbox )
{
m_hbox->setGeometry( frameRect() );
return;
}
- qWarning("New VBOX %s", name() );
+ 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()
{
- qWarning(" Name of Splitters is %s", name() );
+ 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 );
- qWarning("Adding to box %s", (*it).name.latin1() );
+ 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
{
- qWarning(" setting Box geometry for %s", name() );
+ 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)