summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 14e5b3f..a5bf19b 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -78,39 +78,48 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
78 syncing(FALSE), 78 syncing(FALSE),
79 m_tableViewButton(0l), 79 m_tableViewButton(0l),
80 m_cardViewButton(0l) 80 m_cardViewButton(0l)
81{ 81{
82 isLoading = true; 82 isLoading = true;
83 83
84 m_config.load(); 84 m_config.load();
85 85
86 setCaption( tr("Contacts") ); 86 setCaption( tr("Contacts") );
87 setIcon( Resource::loadPixmap( "AddressBook" ) ); 87 setIcon( Resource::loadPixmap( "AddressBook" ) );
88 88
89 // Settings for Main Menu 89 // Settings for Main Menu
90 setToolBarsMovable( true ); 90 // setToolBarsMovable( false );
91 setToolBarsMovable( !m_config.fixedBars() );
91 setRightJustification( true ); 92 setRightJustification( true );
92 93
93 // Create Toolbar 94 QPEToolBar *bar = new QPEToolBar( this );
94 listTools = new QPEToolBar( this, "list operations" ); 95 bar->setHorizontalStretchable( TRUE );
95 listTools->setHorizontalStretchable( true );
96 addToolBar( listTools );
97 moveToolBar( listTools, m_config.getToolBarPos() );
98 96
99 QPEMenuBar *mbList = new QPEMenuBar( this ); 97 QPEMenuBar *mbList = new QPEMenuBar( bar );
100 mbList->setMargin( 0 ); 98 mbList->setMargin( 0 );
101 99
102 QPopupMenu *edit = new QPopupMenu( mbList ); 100 QPopupMenu *edit = new QPopupMenu( mbList );
103 mbList->insertItem( tr( "Contact" ), edit ); 101 mbList->insertItem( tr( "Contact" ), edit );
104 102
103 // Category Menu
104 catMenu = new QPopupMenu( this );
105 catMenu->setCheckable( TRUE );
106 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
107 mbList->insertItem( tr("View"), catMenu );
108
109 // Create Toolbar
110 listTools = new QPEToolBar( this, "list operations" );
111 listTools->setHorizontalStretchable( true );
112 addToolBar( listTools );
113 moveToolBar( listTools, m_config.getToolBarPos() );
105 114
106 // View Icons 115 // View Icons
107 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ), 116 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ),
108 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
109 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); 118 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
110 m_tableViewButton->setToggleAction( true ); 119 m_tableViewButton->setToggleAction( true );
111 m_tableViewButton->addTo( listTools ); 120 m_tableViewButton->addTo( listTools );
112 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 ); 121 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 );
113 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); 122 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
114 m_cardViewButton->setToggleAction( true ); 123 m_cardViewButton->setToggleAction( true );
115 m_cardViewButton->addTo( listTools ); 124 m_cardViewButton->addTo( listTools );
116 125
@@ -234,31 +243,28 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
234 243
235 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 244 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
236 245
237 m_abView->load(); 246 m_abView->load();
238 247
239 // Letter Picker 248 // Letter Picker
240 pLabel = new LetterPicker( listContainer ); 249 pLabel = new LetterPicker( listContainer );
241 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 250 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
242 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 251 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
243 252
244 vb->addWidget( pLabel ); 253 vb->addWidget( pLabel );
245 254
246 // Category Menu 255 // All Categories into view-menu..
247 catMenu = new QPopupMenu( this );
248 catMenu->setCheckable( TRUE );
249 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
250 populateCategories(); 256 populateCategories();
251 mbList->insertItem( tr("View"), catMenu );
252 257
258 // Fontsize
253 defaultFont = new QFont( m_abView->font() ); 259 defaultFont = new QFont( m_abView->font() );
254 slotSetFont(m_config.fontSize()); 260 slotSetFont(m_config.fontSize());
255 m_curFontSize = m_config.fontSize(); 261 m_curFontSize = m_config.fontSize();
256 262
257 setCentralWidget(listContainer); 263 setCentralWidget(listContainer);
258 264
259 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 265 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
260 266
261 267
262 isLoading = false; 268 isLoading = false;
263} 269}
264 270