-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 93581e8..82a1b57 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -23,96 +23,100 @@ #include "contacteditor.h" #include "ablabel.h" #include "abtable.h" #include "addresssettings.h" #include "addressbook.h" #include <opie/ofileselector.h> #include <opie/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <opie/ocontact.h> #ifndef MAKE_FOR_SHARP_ROM #include <qpe/finddialog.h> #endif #include <qpe/global.h> #include <qpe/resource.h> #include <qpe/ir.h> #include <qpe/qpemessagebox.h> #include <qpe/qcopenvelope_qws.h> #include <qaction.h> #include <qdialog.h> #include <qdir.h> #include <qfile.h> #include <qimage.h> #include <qlayout.h> #include <qpe/qpemenubar.h> #include <qmessagebox.h> #include <qpixmap.h> #include <qpopupmenu.h> #include <qpe/qpetoolbar.h> #include <qstringlist.h> #include <qtoolbutton.h> #include <qwhatsthis.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <qdatetime.h> #include "picker.h" +// Remove this for OPIE releae 1.0 ! +#define __DEBUG_RELEASE + + static QString addressbookPersonalVCardName() { QString filename = Global::applicationFileName("addressbook", "businesscard.vcf"); return filename; } AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, WFlags f ) : QMainWindow( parent, name, f ), abEditor(0), bAbEditFirstTime(TRUE), syncing(FALSE) { isLoading = true; initFields(); setCaption( tr("Contacts") ); setIcon( Resource::loadPixmap( "AddressBook" ) ); setToolBarsMovable( FALSE ); // Create Toolbars QPEToolBar *bar = new QPEToolBar( this ); bar->setHorizontalStretchable( TRUE ); QPEMenuBar *mbList = new QPEMenuBar( bar ); mbList->setMargin( 0 ); QPopupMenu *edit = new QPopupMenu( this ); mbList->insertItem( tr( "Contact" ), edit ); listTools = new QPEToolBar( this, "list operations" ); 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 ); actionEdit = a; @@ -139,100 +143,109 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, #ifndef MAKE_FOR_SHARP_ROM a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 ); actionFind = a; connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); a->addTo( edit ); a->addTo( listTools ); #endif a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), QString::null, 0, this, 0 ); //a->setEnabled( FALSE ); we got support for it now :) zecke actionMail = a; connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); a->addTo( edit ); a->addTo( listTools ); if ( Ir::supported() ) { a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); actionBeam = a; connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); a->addTo( edit ); a->addTo( listTools ); } edit->insertSeparator(); a = new QAction( tr("Import vCard"), QString::null, 0, 0, 0, TRUE ); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); a->addTo( edit ); edit->insertSeparator(); a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); a->addTo( edit ); - - a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); - connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); + // Do we need this function ? (se) +// a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); +// connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); +// a->addTo( edit ); + + +#ifdef __DEBUG_RELEASE + // Remove this function for public Release ! This is only + // for debug purposes .. + a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); a->addTo( edit ); +#endif // Create Views listContainer = new QWidget( this ); QVBoxLayout *vb = new QVBoxLayout( listContainer ); abList = new AbTable( &orderedFields, listContainer, "table" ); vb->addWidget(abList); // abList->setHScrollBarMode( QScrollView::AlwaysOff ); connect( abList, SIGNAL( empty( bool ) ), this, SLOT( listIsEmpty( bool ) ) ); connect( abList, SIGNAL( details() ), this, SLOT( slotListView() ) ); connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) ); mView = 0; abList->load(); pLabel = new LetterPicker( listContainer ); connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); vb->addWidget(pLabel); catMenu = new QPopupMenu( this ); catMenu->setCheckable( TRUE ); connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); populateCategories(); mbList->insertItem( tr("View"), catMenu ); // setCentralWidget( listContainer ); fontMenu = new QPopupMenu(this); fontMenu->setCheckable( true ); connect( fontMenu, SIGNAL(activated(int)), this, SLOT(slotSetFont(int))); fontMenu->insertItem(tr( "Small" ), 0); fontMenu->insertItem(tr( "Normal" ), 1); fontMenu->insertItem(tr( "Large" ), 2); defaultFont = new QFont( abList->font() ); slotSetFont(startFontSize); mbList->insertItem( tr("Font"), fontMenu); setCentralWidget(listContainer); // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); abList->setCurrentCell( 0, 0 ); isLoading = false; |