summaryrefslogtreecommitdiff
path: root/core
authorllornkcor <llornkcor>2002-03-18 04:06:49 (UTC)
committer llornkcor <llornkcor>2002-03-18 04:06:49 (UTC)
commitc41df1c96c7843ded6d63fcfb6f368b4173ca842 (patch) (unidiff)
tree1ad241131ae50d41cc6d9dff8719864e68c27c14 /core
parent9fbc04992f0b19f3f8d0aa91f569f9faa0c562f8 (diff)
downloadopie-c41df1c96c7843ded6d63fcfb6f368b4173ca842.zip
opie-c41df1c96c7843ded6d63fcfb6f368b4173ca842.tar.gz
opie-c41df1c96c7843ded6d63fcfb6f368b4173ca842.tar.bz2
heheheh.. no insulting the users, please
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 08efe2d..1936518 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -60,97 +60,97 @@ int AUTOSTART;
60int NEW_START=1; 60int NEW_START=1;
61/* 61/*
62 * Constructs a Example which is a child of 'parent', with the 62 * Constructs a Example which is a child of 'parent', with the
63 * name 'name' and widget flags set to 'f' 63 * name 'name' and widget flags set to 'f'
64 */ 64 */
65Today::Today( QWidget* parent, const char* name, WFlags fl ) 65Today::Today( QWidget* parent, const char* name, WFlags fl )
66 : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { 66 : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) {
67 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); 67 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) );
68 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); 68 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
69 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); 69 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
70 QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); 70 QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) );
71 71
72#if defined(Q_WS_QWS) 72#if defined(Q_WS_QWS)
73#if !defined(QT_NO_COP) 73#if !defined(QT_NO_COP)
74 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); 74 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this );
75 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), 75 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)),
76 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); 76 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) );
77#endif 77#endif
78#endif 78#endif
79 79
80 draw(); 80 draw();
81 setOwnerField(); 81 setOwnerField();
82 autoStart(); 82 autoStart();
83} 83}
84 84
85/* 85/*
86 * Qcop receive method. 86 * Qcop receive method.
87 */ 87 */
88void Today::channelReceived(const QCString &msg, const QByteArray & data) { 88void Today::channelReceived(const QCString &msg, const QByteArray & data) {
89 QDataStream stream(data, IO_ReadOnly ); 89 QDataStream stream(data, IO_ReadOnly );
90 if ( msg == "message(QString)" ) { 90 if ( msg == "message(QString)" ) {
91 QString message; 91 QString message;
92 stream >> message; 92 stream >> message;
93 setOwnerField(message); 93 setOwnerField(message);
94 } 94 }
95 95
96} 96}
97 97
98/* 98/*
99 * Initialises the owner field with the default value, the username 99 * Initialises the owner field with the default value, the username
100 */ 100 */
101void Today::setOwnerField() { 101void Today::setOwnerField() {
102 QString file = Global::applicationFileName("addressbook", "businesscard.vcf"); 102 QString file = Global::applicationFileName("addressbook", "businesscard.vcf");
103 if (QFile::exists(file)) { 103 if (QFile::exists(file)) {
104 Contact cont = Contact::readVCard(file)[0]; 104 Contact cont = Contact::readVCard(file)[0];
105 QString returnString = cont.fullName(); 105 QString returnString = cont.fullName();
106 OwnerField->setText( tr ("<b>Owned by " + returnString + "</b>")); 106 OwnerField->setText( tr ("<b>Owned by " + returnString + "</b>"));
107 } else { 107 } else {
108 OwnerField->setText( tr ("<b>to lame to fill out the business card </b>")); 108 OwnerField->setText( tr ("<b>Please fill out the business card </b>"));
109 } 109 }
110} 110}
111 111
112/* 112/*
113 * Set the owner field with a given QString, for example per qcop. 113 * Set the owner field with a given QString, for example per qcop.
114 */ 114 */
115void Today::setOwnerField(QString &message) { 115void Today::setOwnerField(QString &message) {
116 if (!message.isEmpty()) { 116 if (!message.isEmpty()) {
117 OwnerField->setText("<b>" + message + "</b>"); 117 OwnerField->setText("<b>" + message + "</b>");
118 } 118 }
119} 119}
120 120
121/* 121/*
122 * Autostart, uses the new (opie only) autostart method in the launcher code. 122 * Autostart, uses the new (opie only) autostart method in the launcher code.
123 * If registered against that today ist started on each resume. 123 * If registered against that today ist started on each resume.
124 */ 124 */
125void Today::autoStart() { 125void Today::autoStart() {
126 Config cfg("today"); 126 Config cfg("today");
127 cfg.setGroup("Autostart"); 127 cfg.setGroup("Autostart");
128 AUTOSTART = cfg.readNumEntry("autostart",1); 128 AUTOSTART = cfg.readNumEntry("autostart",1);
129 if (AUTOSTART) { 129 if (AUTOSTART) {
130 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 130 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
131 e << QString("add"); 131 e << QString("add");
132 e << QString("today"); 132 e << QString("today");
133 } else { 133 } else {
134 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 134 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
135 e << QString("remove"); 135 e << QString("remove");
136 e << QString("today"); 136 e << QString("today");
137 } 137 }
138} 138}
139 139
140/* 140/*
141 * Repaint method. Reread all fields. 141 * Repaint method. Reread all fields.
142 */ 142 */
143void Today::draw() { 143void Today::draw() {
144 init(); 144 init();
145 getDates(); 145 getDates();
146 getMail(); 146 getMail();
147 getTodo(); 147 getTodo();
148 // how often refresh 148 // how often refresh
149 QTimer::singleShot( 10*1000, this, SLOT(draw() ) ); 149 QTimer::singleShot( 10*1000, this, SLOT(draw() ) );
150} 150}
151 151
152/* 152/*
153 * Check if the todolist.xml was modified (if there are new entries. 153 * Check if the todolist.xml was modified (if there are new entries.
154 * Returns true if it was modified. 154 * Returns true if it was modified.
155 */ 155 */
156bool Today::checkIfModified() { 156bool Today::checkIfModified() {