summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Unidiff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp8
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.cpp8
-rw-r--r--libopie2/opiepim/ui/opimrecurrencewidget.cpp4
3 files changed, 10 insertions, 10 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index c12e138..4f9b504 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -52,54 +52,54 @@
52#include <stdlib.h> 52#include <stdlib.h>
53 53
54#include <opie2/ocontactaccessbackend_xml.h> 54#include <opie2/ocontactaccessbackend_xml.h>
55 55
56namespace Opie { 56namespace Opie {
57 57
58OPimContactAccess::OPimContactAccess ( const QString appname, const QString , 58OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
59 OPimContactAccessBackend* end, bool autosync ): 59 OPimContactAccessBackend* end, bool autosync ):
60 OPimAccessTemplate<OPimContact>( end ) 60 OPimAccessTemplate<OPimContact>( end )
61{ 61{
62 /* take care of the backend. If there is no one defined, we 62 /* take care of the backend. If there is no one defined, we
63 * will use the XML-Backend as default (until we have a cute SQL-Backend..). 63 * will use the XML-Backend as default (until we have a cute SQL-Backend..).
64 */ 64 */
65 if( end == 0 ) { 65 if( end == 0 ) {
66 qWarning ("Using BackendFactory !"); 66 qWarning ("Using BackendFactory !");
67 end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname ); 67 end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname );
68 } 68 }
69 // Set backend locally and in template 69 // Set backend locally and in template
70 m_backEnd = end; 70 m_backEnd = end;
71 OPimAccessTemplate<OPimContact>::setBackEnd (end); 71 OPimAccessTemplate<OPimContact>::setBackEnd (end);
72 72
73 73
74 /* Connect signal of external db change to function */ 74 /* Connect signal of external db change to function */
75 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); 75 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
76 connect( dbchannel, SIGNAL(received(const QCString &, const QByteArray &)), 76 connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
77 this, SLOT(copMessage( const QCString &, const QByteArray &)) ); 77 this, SLOT(copMessage(const QCString&,const QByteArray&)) );
78 if ( autosync ){ 78 if ( autosync ){
79 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); 79 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
80 connect( syncchannel, SIGNAL(received(const QCString &, const QByteArray &)), 80 connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)),
81 this, SLOT(copMessage( const QCString &, const QByteArray &)) ); 81 this, SLOT(copMessage(const QCString&,const QByteArray&)) );
82 } 82 }
83 83
84 84
85} 85}
86OPimContactAccess::~OPimContactAccess () 86OPimContactAccess::~OPimContactAccess ()
87{ 87{
88 /* The user may forget to save the changed database, therefore try to 88 /* The user may forget to save the changed database, therefore try to
89 * do it for him.. 89 * do it for him..
90 */ 90 */
91 save(); 91 save();
92 // delete m_backEnd; is done by template.. 92 // delete m_backEnd; is done by template..
93} 93}
94 94
95 95
96bool OPimContactAccess::save () 96bool OPimContactAccess::save ()
97{ 97{
98 /* If the database was changed externally, we could not save the 98 /* If the database was changed externally, we could not save the
99 * Data. This will remove added items which is unacceptable ! 99 * Data. This will remove added items which is unacceptable !
100 * Therefore: Reload database and merge the data... 100 * Therefore: Reload database and merge the data...
101 */ 101 */
102 if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) 102 if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() )
103 reload(); 103 reload();
104 104
105 bool status = OPimAccessTemplate<OPimContact>::save(); 105 bool status = OPimAccessTemplate<OPimContact>::save();
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp
index 10ed743..40dc297 100644
--- a/libopie2/opiepim/ui/opimmainwindow.cpp
+++ b/libopie2/opiepim/ui/opimmainwindow.cpp
@@ -26,52 +26,52 @@
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29#include <qapplication.h> 29#include <qapplication.h>
30#include <qdatetime.h> 30#include <qdatetime.h>
31#include <qcopchannel_qws.h> 31#include <qcopchannel_qws.h>
32 32
33#include <qpe/sound.h> 33#include <qpe/sound.h>
34#include <qpe/qcopenvelope_qws.h> 34#include <qpe/qcopenvelope_qws.h>
35#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
36 36
37#include <opie2/opimresolver.h> 37#include <opie2/opimresolver.h>
38#include "opimmainwindow.h" 38#include "opimmainwindow.h"
39 39
40namespace Opie { 40namespace Opie {
41OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, 41OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
42 const char* name, WFlags flag ) 42 const char* name, WFlags flag )
43 : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) { 43 : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
44 44
45 /* 45 /*
46 * let's generate our QCopChannel 46 * let's generate our QCopChannel
47 */ 47 */
48 m_str = QString("QPE/"+m_service).local8Bit(); 48 m_str = QString("QPE/"+m_service).local8Bit();
49 m_channel= new QCopChannel(m_str, this ); 49 m_channel= new QCopChannel(m_str, this );
50 connect(m_channel, SIGNAL(received(const QCString&, const QByteArray& ) ), 50 connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ),
51 this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); 51 this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
52 connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray& ) ), 52 connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ),
53 this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); 53 this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
54 54
55 /* connect flush and reload */ 55 /* connect flush and reload */
56 connect(qApp, SIGNAL(flush() ), 56 connect(qApp, SIGNAL(flush() ),
57 this, SLOT(flush() ) ); 57 this, SLOT(flush() ) );
58 connect(qApp, SIGNAL(reload() ), 58 connect(qApp, SIGNAL(reload() ),
59 this, SLOT(reload() ) ); 59 this, SLOT(reload() ) );
60} 60}
61OPimMainWindow::~OPimMainWindow() { 61OPimMainWindow::~OPimMainWindow() {
62 delete m_channel; 62 delete m_channel;
63} 63}
64QCopChannel* OPimMainWindow::channel() { 64QCopChannel* OPimMainWindow::channel() {
65 return m_channel; 65 return m_channel;
66} 66}
67void OPimMainWindow::doSetDocument( const QString& ) { 67void OPimMainWindow::doSetDocument( const QString& ) {
68 68
69} 69}
70void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { 70void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
71 bool needShow = false; 71 bool needShow = false;
72 /* 72 /*
73 * create demands to create 73 * create demands to create
74 * a new record... 74 * a new record...
75 */ 75 */
76 QDataStream stream(array, IO_ReadOnly); 76 QDataStream stream(array, IO_ReadOnly);
77 if ( cmd == "create()" ) { 77 if ( cmd == "create()" ) {
diff --git a/libopie2/opiepim/ui/opimrecurrencewidget.cpp b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
index 569bdd5..90c1a5f 100644
--- a/libopie2/opiepim/ui/opimrecurrencewidget.cpp
+++ b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
@@ -531,50 +531,50 @@ void OPimRecurrenceWidget::setupMonthly() {
531 showRepeatStuff(); 531 showRepeatStuff();
532 setupRepeatLabel( 1 ); 532 setupRepeatLabel( 1 );
533} 533}
534void OPimRecurrenceWidget::setupYearly() { 534void OPimRecurrenceWidget::setupYearly() {
535hideExtras(); 535hideExtras();
536 lblWeekVar->hide(); 536 lblWeekVar->hide();
537 spinFreq->setValue( 1 ); 537 spinFreq->setValue( 1 );
538 lblFreq->setText( tr("year(s)") ); 538 lblFreq->setText( tr("year(s)") );
539 lblFreq->show(); 539 lblFreq->show();
540 lblFreq->show(); 540 lblFreq->show();
541 showRepeatStuff(); 541 showRepeatStuff();
542 lblVar2->show(); 542 lblVar2->show();
543 QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) ); 543 QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) );
544 lblRepeat->setText( strEvery ); 544 lblRepeat->setText( strEvery );
545 setupRepeatLabel( 1 ); 545 setupRepeatLabel( 1 );
546 546
547} 547}
548void OPimRecurrenceWidget::init() { 548void OPimRecurrenceWidget::init() {
549 QPopupMenu *m1 = new QPopupMenu( this ); 549 QPopupMenu *m1 = new QPopupMenu( this );
550 repeatPicker = new DateBookMonth( m1, 0, TRUE ); 550 repeatPicker = new DateBookMonth( m1, 0, TRUE );
551 m1->insertItem( repeatPicker ); 551 m1->insertItem( repeatPicker );
552 cmdEnd->setPopup( m1 ); 552 cmdEnd->setPopup( m1 );
553 cmdEnd->setPopupDelay( 0 ); 553 cmdEnd->setPopupDelay( 0 );
554 554
555 QObject::connect( repeatPicker, SIGNAL(dateClicked(int, int, int)), 555 QObject::connect( repeatPicker, SIGNAL(dateClicked(int,int,int)),
556 this, SLOT(endDateChanged(int, int, int)) ); 556 this, SLOT(endDateChanged(int,int,int)) );
557 QObject::connect( qApp, SIGNAL(weekChanged(bool)), 557 QObject::connect( qApp, SIGNAL(weekChanged(bool)),
558 this, SLOT(slotChangeStartOfWeek(bool)) ); 558 this, SLOT(slotChangeStartOfWeek(bool)) );
559 559
560 listRTypeButtons.setAutoDelete( TRUE ); 560 listRTypeButtons.setAutoDelete( TRUE );
561 listRTypeButtons.append( cmdNone ); 561 listRTypeButtons.append( cmdNone );
562 listRTypeButtons.append( cmdDay ); 562 listRTypeButtons.append( cmdDay );
563 listRTypeButtons.append( cmdWeek ); 563 listRTypeButtons.append( cmdWeek );
564 listRTypeButtons.append( cmdMonth ); 564 listRTypeButtons.append( cmdMonth );
565 listRTypeButtons.append( cmdYear ); 565 listRTypeButtons.append( cmdYear );
566 566
567 listExtra.setAutoDelete( TRUE ); 567 listExtra.setAutoDelete( TRUE );
568 listExtra.append( cmdExtra1 ); 568 listExtra.append( cmdExtra1 );
569 listExtra.append( cmdExtra2 ); 569 listExtra.append( cmdExtra2 );
570 listExtra.append( cmdExtra3 ); 570 listExtra.append( cmdExtra3 );
571 listExtra.append( cmdExtra4 ); 571 listExtra.append( cmdExtra4 );
572 listExtra.append( cmdExtra5 ); 572 listExtra.append( cmdExtra5 );
573 listExtra.append( cmdExtra6 ); 573 listExtra.append( cmdExtra6 );
574 listExtra.append( cmdExtra7 ); 574 listExtra.append( cmdExtra7 );
575} 575}
576void OPimRecurrenceWidget::hideExtras() { 576void OPimRecurrenceWidget::hideExtras() {
577 // hide the extra buttons... 577 // hide the extra buttons...
578 fraExtra->hide(); 578 fraExtra->hide();
579 chkNoEnd->hide(); 579 chkNoEnd->hide();
580 QListIterator<QToolButton> it( listExtra ); 580 QListIterator<QToolButton> it( listExtra );