summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 9cf55b3..8a5f9d5 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -126,47 +126,47 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
126 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 126 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
127 0, this, 0 ); 127 0, this, 0 );
128 actionTrash = a; 128 actionTrash = a;
129 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); 129 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) );
130 a->addTo( edit ); 130 a->addTo( edit );
131 a->addTo( listTools ); 131 a->addTo( listTools );
132 132
133 133
134 // make it possible to go directly to businesscard via qcop call 134 // make it possible to go directly to businesscard via qcop call
135 //#if defined(Q_WS_QWS) // Why this ? (se) 135 //#if defined(Q_WS_QWS) // Why this ? (se)
136#if !defined(QT_NO_COP) 136#if !defined(QT_NO_COP)
137 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); 137 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this );
138 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), 138 connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)),
139 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); 139 this, SLOT ( appMessage(const QCString&,const QByteArray&) ) );
140#endif 140#endif
141 // #endif 141 // #endif
142 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), 142 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ),
143 QString::null, 0, this, 0 ); 143 QString::null, 0, this, 0 );
144 actionFind = a; 144 actionFind = a;
145 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); 145 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) );
146 a->addTo( edit ); 146 a->addTo( edit );
147 a->addTo( listTools ); 147 a->addTo( listTools );
148 148
149 // Much better search widget, taken from QTReader.. (se) 149 // Much better search widget, taken from QTReader.. (se)
150 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); 150 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE );
151 searchBar->setHorizontalStretchable( TRUE ); 151 searchBar->setHorizontalStretchable( TRUE );
152 searchBar->hide(); 152 searchBar->hide();
153 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 153 searchEdit = new QLineEdit( searchBar, "searchEdit" );
154 154
155 // QFont f("unifont", 16 /*, QFont::Bold*/); 155 // QFont f("unifont", 16 /*, QFont::Bold*/);
156 // searchEdit->setFont( f ); 156 // searchEdit->setFont( f );
157 157
158 searchBar->setStretchableWidget( searchEdit ); 158 searchBar->setStretchableWidget( searchEdit );
159 connect( searchEdit, SIGNAL( returnPressed( ) ), 159 connect( searchEdit, SIGNAL( returnPressed() ),
160 this, SLOT( slotFind( ) ) ); 160 this, SLOT( slotFind() ) );
161 161
162 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); 162 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
163 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); 163 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
164 a->addTo( searchBar ); 164 a->addTo( searchBar );
165 165
166 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 166 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
167 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); 167 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) );
168 a->addTo( searchBar ); 168 a->addTo( searchBar );
169 169
170 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), 170 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ),
171 QString::null, 0, this, 0 ); 171 QString::null, 0, this, 0 );
172 //a->setEnabled( FALSE ); we got support for it now :) zecke 172 //a->setEnabled( FALSE ); we got support for it now :) zecke
@@ -217,26 +217,26 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
217 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 217 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null,
218 0, this, 0 ); 218 0, this, 0 );
219 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); 219 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) );
220 a->addTo( edit ); 220 a->addTo( edit );
221 221
222 // Create Views 222 // Create Views
223 listContainer = new QWidget( this ); 223 listContainer = new QWidget( this );
224 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 224 QVBoxLayout *vb = new QVBoxLayout( listContainer );
225 225
226 m_abView = new AbView( listContainer, m_config.orderList() ); 226 m_abView = new AbView( listContainer, m_config.orderList() );
227 vb->addWidget( m_abView ); 227 vb->addWidget( m_abView );
228 // abList->setHScrollBarMode( QScrollView::AlwaysOff ); 228 // abList->setHScrollBarMode( QScrollView::AlwaysOff );
229 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), 229 connect( m_abView, SIGNAL( signalViewSwitched(int) ),
230 this, SLOT( slotViewSwitched( int ) ) ); 230 this, SLOT( slotViewSwitched(int) ) );
231 231
232 232
233 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 233 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
234 234
235 // m_abView->load(); // Already done by c'tor . 235 // m_abView->load(); // Already done by c'tor .
236 236
237 // Letter Picker 237 // Letter Picker
238 pLabel = new LetterPicker( listContainer ); 238 pLabel = new LetterPicker( listContainer );
239 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 239 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
240 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 240 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
241 241
242 vb->addWidget( pLabel ); 242 vb->addWidget( pLabel );
@@ -245,26 +245,26 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
245 populateCategories(); 245 populateCategories();
246 246
247 // Fontsize 247 // Fontsize
248 defaultFont = new QFont( m_abView->font() ); 248 defaultFont = new QFont( m_abView->font() );
249 slotSetFont(m_config.fontSize()); 249 slotSetFont(m_config.fontSize());
250 m_curFontSize = m_config.fontSize(); 250 m_curFontSize = m_config.fontSize();
251 251
252 setCentralWidget(listContainer); 252 setCentralWidget(listContainer);
253 253
254 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 254 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
255 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); 255 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
256 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) ); 256 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) );
257 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ), 257 connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
258 this, SLOT( appMessage(const QCString &, const QByteArray &) ) ); 258 this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
259 259
260 260
261 isLoading = false; 261 isLoading = false;
262} 262}
263 263
264 264
265void AddressbookWindow::slotConfig() 265void AddressbookWindow::slotConfig()
266{ 266{
267 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 267 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
268 dlg -> setConfig( m_config ); 268 dlg -> setConfig( m_config );
269 if ( QPEApplication::execDialog( dlg ) ) { 269 if ( QPEApplication::execDialog( dlg ) ) {
270 qWarning ("Config Dialog accepted!"); 270 qWarning ("Config Dialog accepted!");
@@ -586,25 +586,25 @@ void AddressbookWindow::slotBeam()
586 beamfile ); 586 beamfile );
587 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 587 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
588 access->add( c ); 588 access->add( c );
589 access->save(); 589 access->save();
590 delete access; 590 delete access;
591 591
592 beamFilename = beamfile; 592 beamFilename = beamfile;
593 } 593 }
594 594
595 qWarning("Beaming: %s", beamFilename.latin1() ); 595 qWarning("Beaming: %s", beamFilename.latin1() );
596 596
597 Ir *ir = new Ir( this ); 597 Ir *ir = new Ir( this );
598 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 598 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
599 QString description = c.fullName(); 599 QString description = c.fullName();
600 ir->send( beamFilename, description, "text/x-vCard" ); 600 ir->send( beamFilename, description, "text/x-vCard" );
601} 601}
602 602
603void AddressbookWindow::beamDone( Ir *ir ) 603void AddressbookWindow::beamDone( Ir *ir )
604{ 604{
605 605
606 delete ir; 606 delete ir;
607 unlink( beamfile ); 607 unlink( beamfile );
608} 608}
609 609
610 610
@@ -664,25 +664,25 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
664 cnt.setFileAs(); 664 cnt.setFileAs();
665 665
666 m_abView -> addEntry( cnt ); 666 m_abView -> addEntry( cnt );
667 667
668 // :SXm_abView()->init( cnt ); 668 // :SXm_abView()->init( cnt );
669 editEntry( EditEntry ); 669 editEntry( EditEntry );
670 } else if ( msg == "beamBusinessCard()" ) { 670 } else if ( msg == "beamBusinessCard()" ) {
671 QString beamFilename = addressbookPersonalVCardName(); 671 QString beamFilename = addressbookPersonalVCardName();
672 if ( !QFile::exists( beamFilename ) ) 672 if ( !QFile::exists( beamFilename ) )
673 return; // can't beam a non-existent file 673 return; // can't beam a non-existent file
674 674
675 Ir *ir = new Ir( this ); 675 Ir *ir = new Ir( this );
676 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 676 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
677 QString description = "mycard.vcf"; 677 QString description = "mycard.vcf";
678 ir->send( beamFilename, description, "text/x-vCard" ); 678 ir->send( beamFilename, description, "text/x-vCard" );
679 } else if ( msg == "show(int)" ) { 679 } else if ( msg == "show(int)" ) {
680 raise(); 680 raise();
681 QDataStream stream(data,IO_ReadOnly); 681 QDataStream stream(data,IO_ReadOnly);
682 int uid; 682 int uid;
683 stream >> uid; 683 stream >> uid;
684 684
685 qWarning( "Showing uid: %d" , uid ); 685 qWarning( "Showing uid: %d" , uid );
686 686
687 // Deactivate Personal View.. 687 // Deactivate Personal View..
688 if ( actionPersonal->isOn() ){ 688 if ( actionPersonal->isOn() ){