Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index e502cf6..beb953a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -99,7 +99,6 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
99 | 99 | ||
100 | setToolBarsMovable( FALSE ); | 100 | setToolBarsMovable( FALSE ); |
101 | 101 | ||
102 | QBoxLayout *vb = new QVBoxLayout( this, 0, 0 ); | ||
103 | // Create Toolbars | 102 | // Create Toolbars |
104 | 103 | ||
105 | QPEToolBar *bar = new QPEToolBar( this ); | 104 | QPEToolBar *bar = new QPEToolBar( this ); |
@@ -190,8 +189,12 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
190 | ); | 189 | ); |
191 | } | 190 | } |
192 | 191 | ||
193 | abList = new AbTable( &orderedFields, this, "table" ); | 192 | listContainer = new QWidget( this ); |
194 | vb->insertWidget(0,abList); | 193 | |
194 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); | ||
195 | |||
196 | abList = new AbTable( &orderedFields, listContainer, "table" ); | ||
197 | vb->addWidget(abList); | ||
195 | abList->setHScrollBarMode( QScrollView::AlwaysOff ); | 198 | abList->setHScrollBarMode( QScrollView::AlwaysOff ); |
196 | connect( abList, SIGNAL( empty( bool ) ), | 199 | connect( abList, SIGNAL( empty( bool ) ), |
197 | this, SLOT( listIsEmpty( bool ) ) ); | 200 | this, SLOT( listIsEmpty( bool ) ) ); |
@@ -208,16 +211,16 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
208 | QFile::remove(addressbookOldXMLFilename()); | 211 | QFile::remove(addressbookOldXMLFilename()); |
209 | } | 212 | } |
210 | 213 | ||
211 | pLabel = new LetterPicker( abList ); | 214 | pLabel = new LetterPicker( listContainer ); |
212 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); | 215 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); |
213 | vb->insertWidget(1,pLabel); | 216 | vb->addWidget(pLabel); |
214 | catMenu = new QPopupMenu( this ); | 217 | catMenu = new QPopupMenu( this ); |
215 | catMenu->setCheckable( TRUE ); | 218 | catMenu->setCheckable( TRUE ); |
216 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); | 219 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); |
217 | populateCategories(); | 220 | populateCategories(); |
218 | 221 | ||
219 | mbList->insertItem( tr("View"), catMenu ); | 222 | mbList->insertItem( tr("View"), catMenu ); |
220 | setCentralWidget( abList ); | 223 | setCentralWidget( listContainer ); |
221 | 224 | ||
222 | fontMenu = new QPopupMenu(this); | 225 | fontMenu = new QPopupMenu(this); |
223 | fontMenu->setCheckable( true ); | 226 | fontMenu->setCheckable( true ); |
@@ -232,7 +235,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
232 | slotSetFont(startFontSize); | 235 | slotSetFont(startFontSize); |
233 | 236 | ||
234 | mbList->insertItem( tr("Font"), fontMenu); | 237 | mbList->insertItem( tr("Font"), fontMenu); |
235 | setCentralWidget(abList); | 238 | setCentralWidget(listContainer); |
236 | 239 | ||
237 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 240 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
238 | } | 241 | } |
@@ -294,7 +297,7 @@ void AddressbookWindow::resizeEvent( QResizeEvent *e ) | |||
294 | { | 297 | { |
295 | QMainWindow::resizeEvent( e ); | 298 | QMainWindow::resizeEvent( e ); |
296 | 299 | ||
297 | if ( centralWidget() == abList ) | 300 | if ( centralWidget() == listContainer ) |
298 | showList(); | 301 | showList(); |
299 | else if ( centralWidget() == mView ) | 302 | else if ( centralWidget() == mView ) |
300 | showView(); | 303 | showView(); |
@@ -316,8 +319,8 @@ void AddressbookWindow::slotUpdateToolbar() | |||
316 | void AddressbookWindow::showList() | 319 | void AddressbookWindow::showList() |
317 | { | 320 | { |
318 | if ( mView ) mView->hide(); | 321 | if ( mView ) mView->hide(); |
319 | setCentralWidget( abList ); | 322 | setCentralWidget( listContainer ); |
320 | abList->show(); | 323 | listContainer->show(); |
321 | // update our focues... (or use a stack widget!); | 324 | // update our focues... (or use a stack widget!); |
322 | abList->setFocus(); | 325 | abList->setFocus(); |
323 | } | 326 | } |
@@ -325,7 +328,7 @@ void AddressbookWindow::showList() | |||
325 | void AddressbookWindow::showView() | 328 | void AddressbookWindow::showView() |
326 | { | 329 | { |
327 | if ( abList->numRows() > 0 ) { | 330 | if ( abList->numRows() > 0 ) { |
328 | abList->hide(); | 331 | listContainer->hide(); |
329 | setCentralWidget( abView() ); | 332 | setCentralWidget( abView() ); |
330 | mView->show(); | 333 | mView->show(); |
331 | mView->setFocus(); | 334 | mView->setFocus(); |
@@ -601,7 +604,7 @@ void AddressbookWindow::slotPersonalView() | |||
601 | 604 | ||
602 | abView()->init( me ); | 605 | abView()->init( me ); |
603 | abView()->sync(); | 606 | abView()->sync(); |
604 | abList->hide(); | 607 | listContainer->hide(); |
605 | setCentralWidget( abView() ); | 608 | setCentralWidget( abView() ); |
606 | mView->show(); | 609 | mView->show(); |
607 | mView->setFocus(); | 610 | mView->setFocus(); |