summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager
authorzautrix <zautrix>2004-10-19 23:38:16 (UTC)
committer zautrix <zautrix>2004-10-19 23:38:16 (UTC)
commitf013ff3c0108100c6dbf037a05502ed493361fbf (patch) (unidiff)
treebf274ac58b55cea0e2f609db8ae5f27f4418a2df /pwmanager/pwmanager
parentf605b2d40ff0f90b132ca880afa83ac751162a2e (diff)
downloadkdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.zip
kdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.tar.gz
kdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.tar.bz2
desktop fixes
Diffstat (limited to 'pwmanager/pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/pwm.cpp12
-rw-r--r--pwmanager/pwmanager/pwm.h8
-rw-r--r--pwmanager/pwmanager/pwmanager.pro33
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp8
-rw-r--r--pwmanager/pwmanager/pwminit.cpp16
-rw-r--r--pwmanager/pwmanager/serializer.cpp6
7 files changed, 52 insertions, 32 deletions
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 3f2d055..9d1d863 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -200,12 +200,13 @@ int main(int argc, char *argv[])
200#else 200#else
201 a.setMainWidget( &m ); 201 a.setMainWidget( &m );
202 m.resize (640, 480 ); 202 m.resize (640, 480 );
203 m.show(); 203 m.show();
204#endif 204#endif
205 */ 205 */
206 qDebug("exec ");
206 a.exec(); 207 a.exec();
207 208
208 } 209 }
209 qDebug("PWMPI: Bye! "); 210 qDebug("PWMPI: Bye! ");
210 211
211#endif 212#endif
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 26a44b1..c511661 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -583,16 +583,16 @@ bool PwM::saveAs()
583 return true; 583 return true;
584} 584}
585 585
586//US ENH : changed code to run with older MOC 586//US ENH : changed code to run with older MOC
587void PwM::addPwd_slot() 587void PwM::addPwd_slot()
588{ 588{
589 addPwd_slot(0, 0); 589 addPwd_slot1(0, 0);
590} 590}
591 591
592void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) 592void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc)
593{ 593{
594 PwMDoc *doc; 594 PwMDoc *doc;
595 if (_doc) { 595 if (_doc) {
596 doc = _doc; 596 doc = _doc;
597 } else { 597 } else {
598 doc = curDoc(); 598 doc = curDoc();
@@ -652,21 +652,21 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc)
652 doc->timer()->putLock(DocTimer::id_autoLockTimer); 652 doc->timer()->putLock(DocTimer::id_autoLockTimer);
653} 653}
654 654
655//US ENH : changed code to run with older MOC 655//US ENH : changed code to run with older MOC
656void PwM::editPwd_slot() 656void PwM::editPwd_slot()
657{ 657{
658 editPwd_slot(0,0,0); 658 editPwd_slot3(0,0,0);
659} 659}
660 660
661void PwM::editPwd_slot(const QString *category) 661void PwM::editPwd_slot1(const QString *category)
662{ 662{
663 editPwd_slot(category, 0, 0); 663 editPwd_slot3(category, 0, 0);
664} 664}
665 665
666void PwM::editPwd_slot(const QString *category, const int *index, 666void PwM::editPwd_slot3(const QString *category, const int *index,
667 PwMDoc *_doc) 667 PwMDoc *_doc)
668{ 668{
669 PwMDoc *doc; 669 PwMDoc *doc;
670 if (_doc) { 670 if (_doc) {
671 doc = _doc; 671 doc = _doc;
672 } else { 672 } else {
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index fe1f7a1..116bc66 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -131,20 +131,22 @@ public slots:
131 /** file/import/kwallet triggered */ 131 /** file/import/kwallet triggered */
132 bool importKWallet(); 132 bool importKWallet();
133 /** file/print triggered */ 133 /** file/print triggered */
134 void print_slot(); 134 void print_slot();
135 /** manage/add triggered */ 135 /** manage/add triggered */
136 //US ENH : changed code to run with older MOC 136 //US ENH : changed code to run with older MOC
137
137 void addPwd_slot(); 138 void addPwd_slot();
138 void addPwd_slot(QString *pw, PwMDoc *_doc); 139 void addPwd_slot1(QString *pw, PwMDoc *_doc);
139 /** manage/edit triggered */ 140 /** manage/edit triggered */
140 //US ENH : changed code to run with older MOC 141 //US ENH : changed code to run with older MOC
141 void editPwd_slot(); 142 void editPwd_slot();
142 void editPwd_slot(const QString *category); 143 void editPwd_slot1(const QString *category);
143 void editPwd_slot(const QString *category = 0, const int *index = 0, 144 void editPwd_slot3(const QString *category = 0, const int *index = 0,
144 PwMDoc *_doc = 0); 145 PwMDoc *_doc = 0);
146
145 /** manage/delete triggered */ 147 /** manage/delete triggered */
146 void deletePwd_slot(); 148 void deletePwd_slot();
147 /** execute the "Launcher" entry */ 149 /** execute the "Launcher" entry */
148 void execLauncher_slot(); 150 void execLauncher_slot();
149 /** open browser with URL entry */ 151 /** open browser with URL entry */
150 void goToURL_slot(); 152 void goToURL_slot();
diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro
index 34f7403..7f39c76 100644
--- a/pwmanager/pwmanager/pwmanager.pro
+++ b/pwmanager/pwmanager/pwmanager.pro
@@ -1,36 +1,41 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 3DESTDIR= ../../bin
4
5 TARGET = pwmpi 4 TARGET = pwmpi
6OBJECTS_DIR = obj/$(PLATFORM) 5include( ../../variables.pri )
7MOC_DIR = moc/$(PLATFORM)
8DESTDIR=$(QPEDIR)/bin
9 6
10INCLUDEPATH += . ../../ ../../qtcompat ../../qtcompat/xml ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils $(QPEDIR)/include 7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils
11DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION 8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION
12 9
13#enable this setting if you want debugoutput for pwmanager 10#enable this setting if you want debugoutput for pwmanager
14#DEFINES += CONFIG_DEBUG 11#DEFINES += CONFIG_DEBUG
15LIBS += -L../libcrypt/$(PLATFORM) 12LIBS += -L../libcrypt/
13LIBS += -L../../bin/
16LIBS += -lmicrokde 14LIBS += -lmicrokde
17LIBS += -lmicroqtcompat
18LIBS += -lmicrokdepim 15LIBS += -lmicrokdepim
19LIBS += -L$(QPEDIR)/lib
20LIBS += -lqpe
21LIBS += -lzlib 16LIBS += -lzlib
22#LIBS += -lbz2
23#LIBS += -lkpmicrogcrypt
24LIBS += -ljpeg
25LIBS += $(QTOPIALIB)
26LIBS += -lkpmicrocipher 17LIBS += -lkpmicrocipher
27LIBS += -lkpmicroerror 18LIBS += -lkpmicroerror
28LIBS += -lkpmicrompi 19LIBS += -lkpmicrompi
29LIBS += -lstdc++ 20LIBS += -lstdc++
30 21
22unix:{
23OBJECTS_DIR = obj/unix
24MOC_DIR = moc/unix
25
26}
27win32:{
28
29DEFINES += _WIN32_
30OBJECTS_DIR = obj/win
31MOC_DIR = moc/win
32QMAKE_LINK += /NODEFAULTLIB:LIBC
33
34}
35
31#INTERFACES = \ 36#INTERFACES = \
32#addentrywnd.ui \ 37#addentrywnd.ui \
33#configwnd.ui \ 38#configwnd.ui \
34#findwnd.ui \ 39#findwnd.ui \
35#getmasterpwwnd.ui \ 40#getmasterpwwnd.ui \
36#pwgenwnd.ui \ 41#pwgenwnd.ui \
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index e29e3d1..8869f3a 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -2326,14 +2326,14 @@ PwMerror PwMDoc::exportToText(const QString *file)
2326#else 2326#else
2327 QString dfs = KGlobal::locale()->dateFormatShort(); 2327 QString dfs = KGlobal::locale()->dateFormatShort();
2328 bool ampm = KGlobal::locale()->use12Clock(); 2328 bool ampm = KGlobal::locale()->use12Clock();
2329 KGlobal::locale()->setDateFormatShort("%A %B %d"); 2329 KGlobal::locale()->setDateFormatShort("%A %B %d");
2330 KGlobal::locale()->setHore24Format(true); 2330 KGlobal::locale()->setHore24Format(true);
2331 2331
2332 header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined); 2332 header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined).latin1();
2333 header += KGlobal::locale()->formatTime(currTime, true); 2333 header += KGlobal::locale()->formatTime(currTime, true).latin1();
2334 KGlobal::locale()->setDateFormatShort(dfs); 2334 KGlobal::locale()->setDateFormatShort(dfs);
2335 KGlobal::locale()->setHore24Format(!ampm); 2335 KGlobal::locale()->setHore24Format(!ampm);
2336 2336
2337#endif 2337#endif
2338 header += tostr(currDate.year()); 2338 header += tostr(currDate.year());
2339 header += "\n==============================\n\n"; 2339 header += "\n==============================\n\n";
@@ -3015,13 +3015,13 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
3015 unsigned int index; 3015 unsigned int index;
3016 //Step 1. Find syncinfo in Local file and create if not existent. 3016 //Step 1. Find syncinfo in Local file and create if not existent.
3017 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3017 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3018 if (found == false) 3018 if (found == false)
3019 { 3019 {
3020 PwMSyncItem newSyncItemLocal; 3020 PwMSyncItem newSyncItemLocal;
3021 newSyncItemLocal.syncName = mCurrentSyncDevice; 3021 newSyncItemLocal.syncName = mCurrentSyncDevice.latin1();
3022 newSyncItemLocal.lastSyncDate = mLastSync; 3022 newSyncItemLocal.lastSyncDate = mLastSync;
3023 syncLocal->addSyncDataEntry(&newSyncItemLocal, true); 3023 syncLocal->addSyncDataEntry(&newSyncItemLocal, true);
3024 found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3024 found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3025 if (found == false) { 3025 if (found == false) {
3026 qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); 3026 qDebug("PwMDoc::syncronize : newly created local sync data could not be found");
3027 return e_syncError; 3027 return e_syncError;
@@ -3035,13 +3035,13 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
3035 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3035 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3036 if (found == false) 3036 if (found == false)
3037 { 3037 {
3038 qDebug("FULLDATE 1"); 3038 qDebug("FULLDATE 1");
3039 fullDateRange = true; 3039 fullDateRange = true;
3040 PwMSyncItem newSyncItemRemote; 3040 PwMSyncItem newSyncItemRemote;
3041 newSyncItemRemote.syncName = mCurrentSyncName; 3041 newSyncItemRemote.syncName = mCurrentSyncName.latin1();
3042 newSyncItemRemote.lastSyncDate = mLastSync; 3042 newSyncItemRemote.lastSyncDate = mLastSync;
3043 syncRemote->addSyncDataEntry(&newSyncItemRemote, true); 3043 syncRemote->addSyncDataEntry(&newSyncItemRemote, true);
3044 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3044 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3045 if (found == false) { 3045 if (found == false) {
3046 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found"); 3046 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found");
3047 return e_syncError; 3047 return e_syncError;
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index 8946443..ea9e330 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -16,12 +16,13 @@
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwminit.h" 20#include "pwminit.h"
21#include "randomizer.h" 21#include "randomizer.h"
22#include <qdir.h>
22 23
23#ifndef PWM_EMBEDDED 24#ifndef PWM_EMBEDDED
24#include "selftest.h" 25#include "selftest.h"
25#include "configuration.h" 26#include "configuration.h"
26#else 27#else
27#include "pwmprefs.h" 28#include "pwmprefs.h"
@@ -125,48 +126,53 @@ PwMInit::~PwMInit()
125 Configuration::cleanup(); 126 Configuration::cleanup();
126#endif 127#endif
127} 128}
128 129
129void PwMInit::initializeApp() 130void PwMInit::initializeApp()
130{ 131{
132 qDebug("PwMInit::initializeApp() ");
131 PWM_ASSERT(runStatus == unknown); 133 PWM_ASSERT(runStatus == unknown);
132 runStatus = init; 134 runStatus = init;
133 initPosixSignalHandler(); 135 initPosixSignalHandler();
134 Randomizer::init(); 136 Randomizer::init();
135#ifndef PWM_EMBEDDED 137#ifndef PWM_EMBEDDED
136 Configuration::init(); 138 Configuration::init();
137#endif 139#endif
138 initDCOP(); 140 initDCOP();
139 initKWalletEmu(); 141 initKWalletEmu();
140 initKeycard(); 142 initKeycard();
141 initTray(); 143 initTray();
142 handleCmdLineArgs(); 144 handleCmdLineArgs();
143 145 qDebug("handle ");
144 bool openDeeplocked = false; 146 bool openDeeplocked = false;
145 if (conf()->confGlobAutostartDeepLocked() || 147 if (conf()->confGlobAutostartDeepLocked() ||
146 savedCmd.open_deeplocked) 148 savedCmd.open_deeplocked)
147 openDeeplocked = true; 149 openDeeplocked = true;
148 if (conf()->confWndAutoMinimizeOnStart() || 150 if ( false ){
149 savedCmd.minToTray) { 151 // LR is not working
152 //if (conf()->confWndAutoMinimizeOnStart() ||
153 // savedCmd.minToTray) {
150 PwMDoc *newDoc = createDoc(); 154 PwMDoc *newDoc = createDoc();
155 qDebug(" createDoc()");
151 if (!newDoc->openDocUi(newDoc, 156 if (!newDoc->openDocUi(newDoc,
152 conf()->confGlobAutoStart(), 157 conf()->confGlobAutoStart(),
153 openDeeplocked)) { 158 openDeeplocked)) {
154 delete newDoc; 159 delete newDoc;
160 }
155 161
156 //US ENH for embedded devices: in the case of failure, open a document the default way 162 //US ENH for embedded devices: in the case of failure, open a document the default way
157 createMainWnd(conf()->confGlobAutoStart(), 163 createMainWnd(conf()->confGlobAutoStart(),
158 openDeeplocked, 164 openDeeplocked,
159 true, 165 true,
160 0, 166 0,
161 savedCmd.minimized); 167 savedCmd.minimized);
162 168
163 169
164 170
165 171
166 } 172 //}
167 } else { 173 } else {
168 createMainWnd(conf()->confGlobAutoStart(), 174 createMainWnd(conf()->confGlobAutoStart(),
169 openDeeplocked, 175 openDeeplocked,
170 true, 176 true,
171 0, 177 0,
172 savedCmd.minimized); 178 savedCmd.minimized);
@@ -283,12 +289,13 @@ void PwMInit::removeTrayAndQuit()
283PwM * PwMInit::createMainWnd(const QString &loadFile, 289PwM * PwMInit::createMainWnd(const QString &loadFile,
284 bool loadFileDeepLocked, 290 bool loadFileDeepLocked,
285 bool virginity, 291 bool virginity,
286 PwMDoc *doc, 292 PwMDoc *doc,
287 bool minimized) 293 bool minimized)
288{ 294{
295 qDebug("PwMInit::createMainWnd ");
289 PwM *newWnd; 296 PwM *newWnd;
290 if (!doc) 297 if (!doc)
291 doc = createDoc(); 298 doc = createDoc();
292 newWnd = new PwM(this, doc, virginity); 299 newWnd = new PwM(this, doc, virginity);
293#ifndef PWM_EMBEDDED 300#ifndef PWM_EMBEDDED
294 _mainWndList.push_back(newWnd); 301 _mainWndList.push_back(newWnd);
@@ -314,12 +321,13 @@ PwM * PwMInit::createMainWnd(const QString &loadFile,
314#ifndef DESKTOP_VERSION 321#ifndef DESKTOP_VERSION
315 app->showMainWidget( newWnd ); 322 app->showMainWidget( newWnd );
316#else //DESKTOP_VERSION 323#else //DESKTOP_VERSION
317 app->setMainWidget( newWnd ); 324 app->setMainWidget( newWnd );
318 newWnd->resize (640, 480 ); 325 newWnd->resize (640, 480 );
319 newWnd->show(); 326 newWnd->show();
327 qDebug("show ");
320#endif //DESKTOP_VERSION 328#endif //DESKTOP_VERSION
321 329
322#endif //PWM_EMBEDDED 330#endif //PWM_EMBEDDED
323 331
324 if (loadFile != QString::null && 332 if (loadFile != QString::null &&
325 loadFile != "") { 333 loadFile != "") {
diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp
index 2d6498e..ed0f754 100644
--- a/pwmanager/pwmanager/serializer.cpp
+++ b/pwmanager/pwmanager/serializer.cpp
@@ -167,13 +167,17 @@ bool Serializer::parseXml(const QCString &buffer)
167{ 167{
168 PWM_ASSERT(domDoc); 168 PWM_ASSERT(domDoc);
169#ifndef PWM_EMBEDDED 169#ifndef PWM_EMBEDDED
170 if (!domDoc->setContent(buffer, true)) 170 if (!domDoc->setContent(buffer, true))
171 return false; 171 return false;
172#else 172#else
173#ifdef DESKTOP_VERSION
174 if (!domDoc->setContent(buffer, true))
175#else
173 if (!domDoc->setContent(buffer)) 176 if (!domDoc->setContent(buffer))
177#endif
174 return false; 178 return false;
175#endif 179#endif
176 if (!checkValid()) 180 if (!checkValid())
177 return false; 181 return false;
178 return true; 182 return true;
179} 183}
@@ -729,13 +733,13 @@ bool Serializer::readSyncData(const QDomNode &n, vector<PwMSyncItem> *dta)
729 733
730 if ((val == "") || (devicename == QString::null)) { 734 if ((val == "") || (devicename == QString::null)) {
731 printDebug("Serializer::readSyncData(): empty synctarget name or syncdate"); 735 printDebug("Serializer::readSyncData(): empty synctarget name or syncdate");
732 continue; 736 continue;
733 } 737 }
734 738
735 curSync.syncName = devicename; 739 curSync.syncName = devicename.latin1();
736#ifndef PWM_EMBEDDED 740#ifndef PWM_EMBEDDED
737 curSync.lastSyncDate = QDateTime::fromString(val, Qt::ISODate); 741 curSync.lastSyncDate = QDateTime::fromString(val, Qt::ISODate);
738#else 742#else
739 curSync.lastSyncDate = KGlobal::locale()->readDateTime(val, KLocale::ISODate, &ok); 743 curSync.lastSyncDate = KGlobal::locale()->readDateTime(val, KLocale::ISODate, &ok);
740 if (ok == false) 744 if (ok == false)
741 qDebug("Serializer::readSyncData(): could not parse syncdate:%s",val.latin1()); 745 qDebug("Serializer::readSyncData(): could not parse syncdate:%s",val.latin1());