author | harlekin <harlekin> | 2003-03-08 21:10:34 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-08 21:10:34 (UTC) |
commit | d44025daf7b191e1f79fe181b9ad1fcad20f3bdb (patch) (side-by-side diff) | |
tree | dfeca99f66ac32be7d7485aaf36b353a8d775dd3 /core/pim/addressbook/addressbook.cpp | |
parent | 9e482f354732a04aebfe8ab9a9eb5cfaad5b3cdb (diff) | |
download | opie-d44025daf7b191e1f79fe181b9ad1fcad20f3bdb.zip opie-d44025daf7b191e1f79fe181b9ad1fcad20f3bdb.tar.gz opie-d44025daf7b191e1f79fe181b9ad1fcad20f3bdb.tar.bz2 |
use the opie wide config icon
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 8937227..14e5b3f 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -90,5 +90,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, setToolBarsMovable( true ); setRightJustification( true ); - + // Create Toolbar listTools = new QPEToolBar( this, "list operations" ); @@ -96,14 +96,14 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, addToolBar( listTools ); moveToolBar( listTools, m_config.getToolBarPos() ); - + QPEMenuBar *mbList = new QPEMenuBar( this ); mbList->setMargin( 0 ); - + QPopupMenu *edit = new QPopupMenu( mbList ); mbList->insertItem( tr( "Contact" ), edit ); - - + + // View Icons - m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ), + m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ), QString::null, 0, this, 0 ); connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); @@ -124,5 +124,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); a->addTo( listTools ); - + a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); @@ -131,5 +131,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); a->addTo( listTools ); - + a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 ); @@ -138,14 +138,14 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); a->addTo( listTools ); - - + + // make it possible to go directly to businesscard via qcop call //#if defined(Q_WS_QWS) // Why this ? (se) -#if !defined(QT_NO_COP) +#if !defined(QT_NO_COP) QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); #endif - // #endif + // #endif a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 ); @@ -183,5 +183,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); a->addTo( listTools ); - + if ( Ir::supported() ) { a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, @@ -192,21 +192,21 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( listTools ); } - + edit->insertSeparator(); - - a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null, + + a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null, 0, this, 0); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); a->addTo( edit ); - + edit->insertSeparator(); - - a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), + + a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), QString::null, 0, this, 0 , TRUE ); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); a->addTo( edit ); - + #ifdef __DEBUG_RELEASE @@ -217,5 +217,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); #endif - a = new QAction( tr( "Config" ), Resource::loadPixmap( "addressbook/configure" ), QString::null, + a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); @@ -225,16 +225,16 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 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 ) ), + 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 ); @@ -250,14 +250,14 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, populateCategories(); mbList->insertItem( tr("View"), catMenu ); - + 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; } @@ -284,15 +284,15 @@ void AddressbookWindow::slotConfig() -void AddressbookWindow::slotSetFont( int size ) +void AddressbookWindow::slotSetFont( int size ) { qWarning("void AddressbookWindow::slotSetFont( %d )", size); - + if (size > 2 || size < 0) size = 1; - + m_config.setFontSize( size ); - + QFont *currentFont; - + switch (size) { case 0: @@ -324,5 +324,5 @@ void AddressbookWindow::importvCard() { setDocument((const QString&) str ); } - + } @@ -331,5 +331,5 @@ void AddressbookWindow::setDocument( const QString &filename ) qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); - if ( filename.find(".vcf") != int(filename.length()) - 4 ){ + if ( filename.find(".vcf") != int(filename.length()) - 4 ){ @@ -340,8 +340,8 @@ void AddressbookWindow::setDocument( const QString &filename ) 0, // Enter == button 0 2 ) ) { // Escape == button 2 - case 0: + case 0: qWarning("YES clicked"); break; - case 1: + case 1: qWarning("NO clicked"); return; @@ -350,5 +350,5 @@ void AddressbookWindow::setDocument( const QString &filename ) } - OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, + OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, filename ); OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); @@ -373,9 +373,9 @@ void AddressbookWindow::setDocument( const QString &filename ) 0, // Enter == button 0 2 ) ) { // Escape == button 2 - case 0: + case 0: qWarning("YES clicked"); m_abView->addEntry( *it ); break; - case 1: + case 1: qWarning("NO clicked"); break; @@ -389,5 +389,5 @@ void AddressbookWindow::setDocument( const QString &filename ) } - + delete access; } @@ -396,5 +396,5 @@ void AddressbookWindow::resizeEvent( QResizeEvent *e ) { QMainWindow::resizeEvent( e ); - + } @@ -438,5 +438,5 @@ void AddressbookWindow::slotListDelete() if(!syncing) { OContact tmpEntry = m_abView ->currentEntry(); - + // get a name, do the best we can... QString strName = tmpEntry.fullName(); @@ -446,6 +446,6 @@ void AddressbookWindow::slotListDelete() strName = "No Name"; } - - + + if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), strName ) ) { @@ -475,8 +475,8 @@ void AddressbookWindow::slotFind() { m_abView->slotDoFind( searchEdit->text(), m_config.beCaseSensitive(), m_config.useRegExp(), false); - + searchEdit->clearFocus(); // m_abView->setFocus(); - + } @@ -508,5 +508,5 @@ void AddressbookWindow::writeMail() QString email = c.defaultEmail(); - // I prefer the OPIE-Environment variable before the + // I prefer the OPIE-Environment variable before the // QPE-one.. QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); @@ -514,6 +514,6 @@ void AddressbookWindow::writeMail() basepath = QString::fromLatin1( getenv("QPEDIR") ); - // Try to access the preferred. If not possible, try to - // switch to the other one.. + // Try to access the preferred. If not possible, try to + // switch to the other one.. if ( m_config.useQtMail() ){ qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1()); @@ -549,5 +549,5 @@ void AddressbookWindow::slotBeam() if ( !QFile::exists( beamFilename ) ) return; // can't beam a non-existent file - OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, + OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, beamFilename ); OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); @@ -561,5 +561,5 @@ void AddressbookWindow::slotBeam() mkdir("/tmp/obex/", 0755); c = m_abView -> currentEntry(); - OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, + OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, beamfile ); OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); @@ -590,5 +590,5 @@ static void parseName( const QString& name, QString *first, QString *middle, QString * last ) { - + int comma = name.find ( "," ); QString rest; @@ -611,5 +611,5 @@ static void parseName( const QString& name, QString *first, QString *middle, *middle = rest.mid( space+1 ); } - + } @@ -626,5 +626,5 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) QString name, email; stream >> name >> email; - + OContact cnt; QString fn, mn, ln; @@ -637,7 +637,7 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) cnt.setDefaultEmail( email ); cnt.setFileAs(); - + m_abView -> addEntry( cnt ); - + // :SXm_abView()->init( cnt ); editEntry( EditEntry ); @@ -669,7 +669,7 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) picker.showMaximized(); picker.exec(); - + // ###### note: contacts may have been added - save here! - + setCentralWidget(abList); QCopEnvelope e(ch,m); @@ -681,5 +681,5 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) } #endif - + } @@ -696,5 +696,5 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) // other things may change the caption. abEditor->setCaption( tr("Edit Address") ); - + #if defined(Q_WS_QWS) || defined(_WS_QWS_) abEditor->showMaximized(); @@ -759,8 +759,8 @@ void AddressbookWindow::slotPersonalView() m_abView->showPersonal( false ); - + return; } - + qWarning("slotPersonalView()-> ON"); // XXX need to disable some QActions. @@ -769,9 +769,9 @@ void AddressbookWindow::slotPersonalView() actionFind->setEnabled(FALSE); actionMail->setEnabled(FALSE); - + setCaption( tr("Contacts - My Personal Details") ); m_abView->showPersonal( true ); - + } @@ -857,5 +857,5 @@ void AddressbookWindow::slotNotFound() tr( "Unable to find a contact for this \n search pattern!" ) ); - + } void AddressbookWindow::slotWrapAround() @@ -865,5 +865,5 @@ void AddressbookWindow::slotWrapAround() // QMessageBox::information( this, tr( "End of list" ), // tr( "End of list. Wrap around now...!" ) + "\n" ); - + } @@ -871,12 +871,12 @@ void AddressbookWindow::slotSetCategory( int c ) { qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); - + QString cat, book; AbView::Views view = AbView::TableView; - + if ( c <= 0 ) return; - - // Switch view + + // Switch view if ( c < 3 ) for ( unsigned int i = 1; i < 3; i++ ){ @@ -885,8 +885,8 @@ void AddressbookWindow::slotSetCategory( int c ) } else - // Checkmark Category Menu Item Selected + // Checkmark Category Menu Item Selected for ( unsigned int i = 3; i < catMenu->count(); i++ ) catMenu->setItemChecked( i, c == (int)i ); - + // Now switch to the selected category for ( unsigned int i = 1; i < catMenu->count(); i++ ) { @@ -911,5 +911,5 @@ void AddressbookWindow::slotSetCategory( int c ) } } - + // Switch to the selected View slotViewSwitched( view ); @@ -922,5 +922,5 @@ void AddressbookWindow::slotSetCategory( int c ) if ( cat.isEmpty() ) cat = "All"; - + setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); } @@ -966,7 +966,7 @@ void AddressbookWindow::slotCardView() void AddressbookWindow::slotSetLetter( char c ) { - + m_abView->setShowByLetter( c ); - + } @@ -975,14 +975,14 @@ void AddressbookWindow::populateCategories() { catMenu->clear(); - + int id, rememberId; id = 1; rememberId = 0; - + catMenu->insertItem( Resource::loadPixmap( "datebook/weeklst" ), tr( "List" ), id++ ); catMenu->insertItem( Resource::loadPixmap( "day" ), tr( "Cards" ), id++ ); // catMenu->insertItem( tr( "Personal" ), id++ ); catMenu->insertSeparator(); - + catMenu->insertItem( tr( "All" ), id++ ); QStringList categories = m_abView->categories(); @@ -996,5 +996,5 @@ void AddressbookWindow::populateCategories() } - + if ( m_abView -> showCategory().isEmpty() ) { slotSetCategory( 3 ); |