summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp32
1 files changed, 19 insertions, 13 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
@@ -66,63 +66,72 @@
#include "picker.h"
#include "configdlg.h"
extern QString addressbookPersonalVCardName();
AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
WFlags f )
: QMainWindow( parent, name, f ),
catMenu (0l),
abEditor(0l),
syncing(FALSE),
m_tableViewButton(0l),
m_cardViewButton(0l)
{
isLoading = true;
m_config.load();
setCaption( tr("Contacts") );
setIcon( Resource::loadPixmap( "AddressBook" ) );
// Settings for Main Menu
- setToolBarsMovable( true );
+ // setToolBarsMovable( false );
+ setToolBarsMovable( !m_config.fixedBars() );
setRightJustification( true );
- // Create Toolbar
- listTools = new QPEToolBar( this, "list operations" );
- listTools->setHorizontalStretchable( true );
- addToolBar( listTools );
- moveToolBar( listTools, m_config.getToolBarPos() );
+ QPEToolBar *bar = new QPEToolBar( this );
+ bar->setHorizontalStretchable( TRUE );
- QPEMenuBar *mbList = new QPEMenuBar( this );
+ QPEMenuBar *mbList = new QPEMenuBar( bar );
mbList->setMargin( 0 );
QPopupMenu *edit = new QPopupMenu( mbList );
mbList->insertItem( tr( "Contact" ), edit );
+ // Category Menu
+ catMenu = new QPopupMenu( this );
+ catMenu->setCheckable( TRUE );
+ connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
+ mbList->insertItem( tr("View"), catMenu );
+
+ // Create Toolbar
+ listTools = new QPEToolBar( this, "list operations" );
+ listTools->setHorizontalStretchable( true );
+ addToolBar( listTools );
+ moveToolBar( listTools, m_config.getToolBarPos() );
// View Icons
m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ),
QString::null, 0, this, 0 );
connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
m_tableViewButton->setToggleAction( true );
m_tableViewButton->addTo( listTools );
m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 );
connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
m_cardViewButton->setToggleAction( true );
m_cardViewButton->addTo( listTools );
listTools->addSeparator();
// Other Buttons
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null,
0, this, 0 );
actionNew = a;
connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) );
a->addTo( edit );
a->addTo( listTools );
a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
0, this, 0 );
@@ -222,56 +231,53 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
a->addTo( edit );
// Create Views
listContainer = new QWidget( this );
QVBoxLayout *vb = new QVBoxLayout( listContainer );
m_abView = new AbView( listContainer, m_config.orderList() );
vb->addWidget( m_abView );
// abList->setHScrollBarMode( QScrollView::AlwaysOff );
connect( m_abView, SIGNAL( signalViewSwitched ( int ) ),
this, SLOT( slotViewSwitched( int ) ) );
QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
m_abView->load();
// Letter Picker
pLabel = new LetterPicker( listContainer );
connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
vb->addWidget( pLabel );
- // Category Menu
- catMenu = new QPopupMenu( this );
- catMenu->setCheckable( TRUE );
- connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
+ // All Categories into view-menu..
populateCategories();
- mbList->insertItem( tr("View"), catMenu );
- defaultFont = new QFont( m_abView->font() );
+ // Fontsize
+ defaultFont = new QFont( m_abView->font() );
slotSetFont(m_config.fontSize());
m_curFontSize = m_config.fontSize();
setCentralWidget(listContainer);
// qDebug("adressbook contrsuction: t=%d", t.elapsed() );
isLoading = false;
}
void AddressbookWindow::slotConfig()
{
ConfigDlg* dlg = new ConfigDlg( this, "Config" );
dlg -> setConfig( m_config );
dlg -> showMaximized();
if ( dlg -> exec() ) {
qWarning ("Config Dialog accepted!");
m_config = dlg -> getConfig();
if ( m_curFontSize != m_config.fontSize() ){
qWarning("Font was changed!");
m_curFontSize = m_config.fontSize();
emit slotSetFont( m_curFontSize );