summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-19 23:51:51 (UTC)
committer zautrix <zautrix>2004-10-19 23:51:51 (UTC)
commita9119c4edc272815121ddc863963b5289bb95b13 (patch) (unidiff)
treef515514cda0e212da6722ef8baf5d378e08d34eb
parentf013ff3c0108100c6dbf037a05502ed493361fbf (diff)
downloadkdepimpi-a9119c4edc272815121ddc863963b5289bb95b13.zip
kdepimpi-a9119c4edc272815121ddc863963b5289bb95b13.tar.gz
kdepimpi-a9119c4edc272815121ddc863963b5289bb95b13.tar.bz2
more fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp11
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/pwminit.cpp4
3 files changed, 9 insertions, 7 deletions
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index 7f4ccef..8b6dfbc 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -43,84 +43,89 @@ $Id$
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45 45
46/* 46/*
47 * Constructs a getMasterPwWnd as a child of 'parent', with the 47 * Constructs a getMasterPwWnd as a child of 'parent', with the
48 * name 'name' 48 * name 'name'
49 */ 49 */
50getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) 50getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
51 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ), 51 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ),
52 KDialogBase::Ok | KDialogBase::Cancel, 52 KDialogBase::Ok | KDialogBase::Cancel,
53 KDialogBase::Ok, parent, name, true ) 53 KDialogBase::Ok, parent, name, true )
54{ 54{
55 QWidget *page = plainPage(); 55 QWidget *page = plainPage();
56 QVBoxLayout *pageLayout = new QVBoxLayout( page ); 56 QVBoxLayout *pageLayout = new QVBoxLayout( page );
57 57
58 pwLineEdit = new QLineEdit( page, "pwLineEdit" ); 58 pwLineEdit = new QLineEdit( page, "pwLineEdit" );
59 pwLineEdit->setEchoMode( QLineEdit::Password ); 59 pwLineEdit->setEchoMode( QLineEdit::Password );
60 60
61 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); 61 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" );
62 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); 62 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
63 pageLayout->addWidget(textLabel1); 63 pageLayout->addWidget(textLabel1);
64 pageLayout->addWidget(pwLineEdit); 64 pageLayout->addWidget(pwLineEdit);
65 65
66 QWidget* numberBox = new QWidget( page ); 66 QWidget* numberBox = new QWidget( page );
67 numberBox->setFixedHeight(100); 67#ifndef DESKTOP_VERSION
68 numberBox->setFixedWidth(100); 68 numberBox->setFixedHeight(150);
69 numberBox->setFixedWidth(150);
70#endif
69 71
70 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); 72 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );
71 numberLayout->setMargin( 0 ); 73 numberLayout->setMargin( 0 );
72 numberLayout->setSpacing( 0 ); 74 numberLayout->setSpacing( 0 );
73 75
74 QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); 76 QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
75 numberLayout->addWidget( p1, 0, 0 ); 77 numberLayout->addWidget( p1, 0, 0 );
76 QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); 78 QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
77 numberLayout->addWidget( p2, 0, 1 ); 79 numberLayout->addWidget( p2, 0, 1 );
78 QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); 80 QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
79 numberLayout->addWidget( p3, 0, 2 ); 81 numberLayout->addWidget( p3, 0, 2 );
80 QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); 82 QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
81 numberLayout->addWidget( p4, 1, 0 ); 83 numberLayout->addWidget( p4, 1, 0 );
82 QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); 84 QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
83 numberLayout->addWidget( p5, 1, 1 ); 85 numberLayout->addWidget( p5, 1, 1 );
84 QPushButton* p6 = new QPushButton( i18n("6"), numberBox ); 86 QPushButton* p6 = new QPushButton( i18n("6"), numberBox );
85 numberLayout->addWidget( p6, 1, 2 ); 87 numberLayout->addWidget( p6, 1, 2 );
86 QPushButton* p7 = new QPushButton( i18n("7"), numberBox ); 88 QPushButton* p7 = new QPushButton( i18n("7"), numberBox );
87 numberLayout->addWidget( p7, 2, 0 ); 89 numberLayout->addWidget( p7, 2, 0 );
88 QPushButton* p8 = new QPushButton( i18n("8"), numberBox ); 90 QPushButton* p8 = new QPushButton( i18n("8"), numberBox );
89 numberLayout->addWidget( p8, 2, 1 ); 91 numberLayout->addWidget( p8, 2, 1 );
90 QPushButton* p9 = new QPushButton( i18n("9"), numberBox ); 92 QPushButton* p9 = new QPushButton( i18n("9"), numberBox );
91 numberLayout->addWidget( p9, 2, 2 ); 93 numberLayout->addWidget( p9, 2, 2 );
92 QPushButton* clear = new QPushButton( i18n("x"), numberBox ); 94 QPushButton* clear = new QPushButton( i18n("x"), numberBox );
93 numberLayout->addWidget( clear, 3, 0 ); 95 numberLayout->addWidget( clear, 3, 0 );
94 QPushButton* p0 = new QPushButton( i18n("0"), numberBox ); 96 QPushButton* p0 = new QPushButton( i18n("0"), numberBox );
95 numberLayout->addWidget( p0, 3, 1 ); 97 numberLayout->addWidget( p0, 3, 1 );
96 QPushButton* backspace = new QPushButton( i18n("-"), numberBox ); 98 QPushButton* backspace = new QPushButton( i18n("-"), numberBox );
97 numberLayout->addWidget( backspace, 3, 2 ); 99 numberLayout->addWidget( backspace, 3, 2 );
98 100
99 101
100 pageLayout->addWidget(numberBox); 102 pageLayout->addWidget(numberBox);
101 103#ifdef DESKTOP_VERSION
104 resize( sizeHint() );
105#else
102 resize( 200,sizeHint().height() ); 106 resize( 200,sizeHint().height() );
107#endif
103 108
104 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) ); 109 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) );
105 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) ); 110 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) );
106 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) ); 111 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) );
107 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) ); 112 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) );
108 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) ); 113 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) );
109 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) ); 114 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) );
110 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) ); 115 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) );
111 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) ); 116 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) );
112 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) ); 117 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) );
113 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) ); 118 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) );
114 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); 119 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) );
115 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); 120 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) );
116 121
117 122
118 123
119} 124}
120 125
121/* 126/*
122 * Destroys the object and frees any allocated resources 127 * Destroys the object and frees any allocated resources
123 */ 128 */
124getMasterPwWnd::~getMasterPwWnd() 129getMasterPwWnd::~getMasterPwWnd()
125{ 130{
126 // no need to delete child widgets, Qt does it all for us 131 // no need to delete child widgets, Qt does it all for us
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 9d1d863..3f2d055 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -182,33 +182,32 @@ int main(int argc, char *argv[])
182#else 182#else
183 QString fileName ; 183 QString fileName ;
184 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 184 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
185 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 185 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
186 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 186 QApplication::addLibraryPath ( qApp->applicationDirPath () );
187 187
188#endif 188#endif
189 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 189 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
190 KPimGlobalPrefs::instance()->setGlobalConfig(); 190 KPimGlobalPrefs::instance()->setGlobalConfig();
191 191
192 a.newInstance(); 192 a.newInstance();
193 193
194 //US KAddressBookMain m ; 194 //US KAddressBookMain m ;
195 195
196 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 196 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
197 /*US 197 /*US
198#ifndef DESKTOP_VERSION 198#ifndef DESKTOP_VERSION
199 a.showMainWidget( &m ); 199 a.showMainWidget( &m );
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 ");
207 a.exec(); 206 a.exec();
208 207
209 } 208 }
210 qDebug("PWMPI: Bye! "); 209 qDebug("PWMPI: Bye! ");
211 210
212#endif 211#endif
213 212
214} 213}
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index ea9e330..9238c8c 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -108,62 +108,61 @@ PwMInit::~PwMInit()
108 vector<PwMDocList::listItem> dl = *(_dl->getList()); 108 vector<PwMDocList::listItem> dl = *(_dl->getList());
109 vector<PwMDocList::listItem>::iterator i2 = dl.begin(), 109 vector<PwMDocList::listItem>::iterator i2 = dl.begin(),
110 end2 = dl.end(); 110 end2 = dl.end();
111 while (i2 != end2) { 111 while (i2 != end2) {
112 delete (*i2).doc; 112 delete (*i2).doc;
113 ++i2; 113 ++i2;
114 } 114 }
115 115
116#ifdef CONFIG_KWALLETIF 116#ifdef CONFIG_KWALLETIF
117 delete_ifnot_null(_kwalletEmu); 117 delete_ifnot_null(_kwalletEmu);
118#endif // CONFIG_KWALLETIF 118#endif // CONFIG_KWALLETIF
119#ifdef CONFIG_KEYCARD 119#ifdef CONFIG_KEYCARD
120 delete_ifnot_null(_keycard); 120 delete_ifnot_null(_keycard);
121#endif // CONFIG_KEYCARD 121#endif // CONFIG_KEYCARD
122 delete_ifnot_null(_tray); 122 delete_ifnot_null(_tray);
123 123
124 Randomizer::cleanup(); 124 Randomizer::cleanup();
125#ifndef PWM_EMBEDDED 125#ifndef PWM_EMBEDDED
126 Configuration::cleanup(); 126 Configuration::cleanup();
127#endif 127#endif
128} 128}
129 129
130void PwMInit::initializeApp() 130void PwMInit::initializeApp()
131{ 131{
132 qDebug("PwMInit::initializeApp() "); 132 //qDebug("PwMInit::initializeApp() ");
133 PWM_ASSERT(runStatus == unknown); 133 PWM_ASSERT(runStatus == unknown);
134 runStatus = init; 134 runStatus = init;
135 initPosixSignalHandler(); 135 initPosixSignalHandler();
136 Randomizer::init(); 136 Randomizer::init();
137#ifndef PWM_EMBEDDED 137#ifndef PWM_EMBEDDED
138 Configuration::init(); 138 Configuration::init();
139#endif 139#endif
140 initDCOP(); 140 initDCOP();
141 initKWalletEmu(); 141 initKWalletEmu();
142 initKeycard(); 142 initKeycard();
143 initTray(); 143 initTray();
144 handleCmdLineArgs(); 144 handleCmdLineArgs();
145 qDebug("handle ");
146 bool openDeeplocked = false; 145 bool openDeeplocked = false;
147 if (conf()->confGlobAutostartDeepLocked() || 146 if (conf()->confGlobAutostartDeepLocked() ||
148 savedCmd.open_deeplocked) 147 savedCmd.open_deeplocked)
149 openDeeplocked = true; 148 openDeeplocked = true;
150 if ( false ){ 149 if ( false ){
151 // LR is not working 150 // LR is not working
152 //if (conf()->confWndAutoMinimizeOnStart() || 151 //if (conf()->confWndAutoMinimizeOnStart() ||
153 // savedCmd.minToTray) { 152 // savedCmd.minToTray) {
154 PwMDoc *newDoc = createDoc(); 153 PwMDoc *newDoc = createDoc();
155 qDebug(" createDoc()"); 154 qDebug(" createDoc()");
156 if (!newDoc->openDocUi(newDoc, 155 if (!newDoc->openDocUi(newDoc,
157 conf()->confGlobAutoStart(), 156 conf()->confGlobAutoStart(),
158 openDeeplocked)) { 157 openDeeplocked)) {
159 delete newDoc; 158 delete newDoc;
160 } 159 }
161 160
162 //US ENH for embedded devices: in the case of failure, open a document the default way 161 //US ENH for embedded devices: in the case of failure, open a document the default way
163 createMainWnd(conf()->confGlobAutoStart(), 162 createMainWnd(conf()->confGlobAutoStart(),
164 openDeeplocked, 163 openDeeplocked,
165 true, 164 true,
166 0, 165 0,
167 savedCmd.minimized); 166 savedCmd.minimized);
168 167
169 168
@@ -271,49 +270,48 @@ void PwMInit::initTray()
271 _tray->show(); 270 _tray->show();
272 // connect the signals of all open documents. 271 // connect the signals of all open documents.
273 const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList(); 272 const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList();
274 vector<PwMDocList::listItem>::const_iterator i = dl->begin(), 273 vector<PwMDocList::listItem>::const_iterator i = dl->begin(),
275 end = dl->end(); 274 end = dl->end();
276 while (i != end) { 275 while (i != end) {
277 _tray->connectDocToTray((*i).doc); 276 _tray->connectDocToTray((*i).doc);
278 ++i; 277 ++i;
279 } 278 }
280} 279}
281 280
282void PwMInit::removeTrayAndQuit() 281void PwMInit::removeTrayAndQuit()
283{ 282{
284 PWM_ASSERT(_tray); 283 PWM_ASSERT(_tray);
285 // _tray is deleted in ~PwMInit 284 // _tray is deleted in ~PwMInit
286 shutdownApp(0); 285 shutdownApp(0);
287} 286}
288 287
289PwM * PwMInit::createMainWnd(const QString &loadFile, 288PwM * PwMInit::createMainWnd(const QString &loadFile,
290 bool loadFileDeepLocked, 289 bool loadFileDeepLocked,
291 bool virginity, 290 bool virginity,
292 PwMDoc *doc, 291 PwMDoc *doc,
293 bool minimized) 292 bool minimized)
294{ 293{
295 qDebug("PwMInit::createMainWnd ");
296 PwM *newWnd; 294 PwM *newWnd;
297 if (!doc) 295 if (!doc)
298 doc = createDoc(); 296 doc = createDoc();
299 newWnd = new PwM(this, doc, virginity); 297 newWnd = new PwM(this, doc, virginity);
300#ifndef PWM_EMBEDDED 298#ifndef PWM_EMBEDDED
301 _mainWndList.push_back(newWnd); 299 _mainWndList.push_back(newWnd);
302#else 300#else
303 _mainWndList.append(newWnd); 301 _mainWndList.append(newWnd);
304#endif 302#endif
305 connect(newWnd, SIGNAL(closed(PwM *)), 303 connect(newWnd, SIGNAL(closed(PwM *)),
306 this, SLOT(mainWndClosed(PwM *))); 304 this, SLOT(mainWndClosed(PwM *)));
307 connect(newWnd, SIGNAL(gotFocus(PwM *)), 305 connect(newWnd, SIGNAL(gotFocus(PwM *)),
308 this, SLOT(setCurWidget(PwM *))); 306 this, SLOT(setCurWidget(PwM *)));
309 connect(newWnd, SIGNAL(lostFocus(PwM *)), 307 connect(newWnd, SIGNAL(lostFocus(PwM *)),
310 this, SLOT(resetCurWidget())); 308 this, SLOT(resetCurWidget()));
311 309
312 //US ENH 310 //US ENH
313#ifndef PWM_EMBEDDED 311#ifndef PWM_EMBEDDED
314 if (minimized) 312 if (minimized)
315 newWnd->showMinimized(); 313 newWnd->showMinimized();
316 else 314 else
317 newWnd->show(); 315 newWnd->show();
318 316
319#else //PWM_EMBEDDED 317#else //PWM_EMBEDDED