summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-19 22:13:43 (UTC)
committer zautrix <zautrix>2004-10-19 22:13:43 (UTC)
commit2ab05e776276f02fd688b7041e5ccc5eb4573e50 (patch) (unidiff)
treeb5df81769861183faf4a0198046eb70b8f0df7bb
parentb11fbdc29bf96507c68ee9b6813d76ae37b5fd8f (diff)
downloadkdepimpi-2ab05e776276f02fd688b7041e5ccc5eb4573e50.zip
kdepimpi-2ab05e776276f02fd688b7041e5ccc5eb4573e50.tar.gz
kdepimpi-2ab05e776276f02fd688b7041e5ccc5eb4573e50.tar.bz2
many small bugfixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/findwnd_emb.cpp6
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp2
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp11
-rw-r--r--pwmanager/pwmanager/main.cpp7
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_0.cpp4
-rw-r--r--pwmanager/pwmanager/pwmviewstyle_1.cpp4
6 files changed, 21 insertions, 13 deletions
diff --git a/pwmanager/pwmanager/findwnd_emb.cpp b/pwmanager/pwmanager/findwnd_emb.cpp
index 6db2684..6dcabe8 100644
--- a/pwmanager/pwmanager/findwnd_emb.cpp
+++ b/pwmanager/pwmanager/findwnd_emb.cpp
@@ -1,123 +1,123 @@
1/* 1/*
2 This file is part of PwManager/Platform independent. 2 This file is part of PwManager/Platform independent.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "findwnd_emb.h" 26#include "findwnd_emb.h"
27 27
28#include <klocale.h> 28#include <klocale.h>
29 29
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qbuttongroup.h> 31#include <qbuttongroup.h>
32#include <qradiobutton.h> 32#include <qradiobutton.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <klineedit.h> 34#include <klineedit.h>
35#include <qlabel.h> 35#include <qlabel.h>
36 36
37/* 37/*
38#include <qvariant.h> 38#include <qvariant.h>
39#include <qlabel.h> 39#include <qlabel.h>
40#include <qlineedit.h> 40#include <qlineedit.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qcheckbox.h> 42#include <qcheckbox.h>
43#include <qbuttongroup.h> 43#include <qbuttongroup.h>
44#include <qradiobutton.h> 44#include <qradiobutton.h>
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qtooltip.h> 46#include <qtooltip.h>
47#include <qwhatsthis.h> 47#include <qwhatsthis.h>
48*/ 48*/
49 49
50/* 50/*
51 * Constructs a findWnd as a child of 'parent', with the 51 * Constructs a findWnd as a child of 'parent', with the
52 * name 'name'. 52 * name 'name'.
53 */ 53 */
54findWnd::findWnd( QWidget* parent, const char* name ) 54findWnd::findWnd( QWidget* parent, const char* name )
55 : KDialogBase( KDialogBase::Plain, i18n( "Find" ), 55 : KDialogBase( KDialogBase::Plain, i18n( "Find" ),
56 KDialogBase::Ok | KDialogBase::Cancel, 56 KDialogBase::Ok | KDialogBase::Cancel,
57 KDialogBase::Ok, parent, name, true ) 57 KDialogBase::Ok, parent, name, true )
58{ 58{
59 QWidget *page = plainPage(); 59 QWidget *page = plainPage();
60 QVBoxLayout *layout = new QVBoxLayout( page ); 60 QVBoxLayout *layout = new QVBoxLayout( page );
61 layout->setMargin( KDialogBase::marginHint() ); 61 layout->setMargin( KDialogBase::marginHint() );
62 layout->setSpacing( KDialogBase::spacingHint() ); 62 layout->setSpacing( KDialogBase::spacingHint() );
63 63
64 exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page ); 64 exactCheckBox = new QCheckBox( i18n( "&Exact match" ), page );
65 layout->addWidget( exactCheckBox ); 65 layout->addWidget( exactCheckBox );
66 66
67 caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page ); 67 caseSensCheckBox = new QCheckBox( i18n( "&Case sensitive" ), page );
68 layout->addWidget( caseSensCheckBox ); 68 layout->addWidget( caseSensCheckBox );
69 69
70 70
71 QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page ); 71 QButtonGroup* buttonGroup1 = new QButtonGroup(1, Qt::Horizontal, i18n( "Search in Column" ), page );
72 layout->addWidget( buttonGroup1 ); 72 layout->addWidget( buttonGroup1 );
73 73
74 descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 ); 74 descRadioButton = new QRadioButton( i18n( "&Description" ), buttonGroup1 );
75 pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 ); 75 pwRadioButton = new QRadioButton( i18n( "&Password" ), buttonGroup1 );
76 commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 ); 76 commentRadioButton = new QRadioButton( i18n( "C&omment" ), buttonGroup1 );
77 nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 ); 77 nameRadioButton = new QRadioButton( i18n( "&Username" ), buttonGroup1 );
78 urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 ); 78 urlRadioButton = new QRadioButton( i18n( "U&RL" ), buttonGroup1 );
79 launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 ); 79 launcherRadioButton = new QRadioButton( i18n( "&Launcher" ), buttonGroup1 );
80 descRadioButton->setChecked( TRUE ); 80 descRadioButton->setChecked( TRUE );
81 81
82 findLineEdit = new KLineEdit( page ); 82 findLineEdit = new KLineEdit( page );
83 QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page ); 83 // QLabel* label = new QLabel( findLineEdit, i18n( "Find:" ), page );
84 layout->addWidget( label ); 84 //layout->addWidget( label );
85 layout->addWidget( findLineEdit ); 85 layout->addWidget( findLineEdit );
86 86
87 setButtonText( KDialogBase::Ok, "&Find" ); 87 setButtonText( KDialogBase::Ok, "&Find" );
88 setButtonText( KDialogBase::Cancel, "&Close" ); 88 setButtonText( KDialogBase::Cancel, "&Close" );
89 89
90 90
91 // resize( QSize(200, 150) ); 91 resize( sizeHint() );
92 92
93 93
94 connect( buttonGroup1, SIGNAL( clicked(int) ), this, SLOT( selectionChanged_slot() ) ); 94 connect( buttonGroup1, SIGNAL( clicked(int) ), this, SLOT( selectionChanged_slot() ) );
95 connect( findLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( selectionChanged_slot() ) ); 95 connect( findLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( selectionChanged_slot() ) );
96 connect( caseSensCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) ); 96 connect( caseSensCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
97 connect( exactCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) ); 97 connect( exactCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
98 98
99} 99}
100 100
101/* 101/*
102 * Destroys the object and frees any allocated resources 102 * Destroys the object and frees any allocated resources
103 */ 103 */
104findWnd::~findWnd() 104findWnd::~findWnd()
105{ 105{
106 // no need to delete child widgets, Qt does it all for us 106 // no need to delete child widgets, Qt does it all for us
107} 107}
108 108
109void findWnd::findButton_slot() 109void findWnd::findButton_slot()
110{ 110{
111 qWarning( "findWnd::findButton_slot(): Not implemented yet" ); 111 qWarning( "findWnd::findButton_slot(): Not implemented yet" );
112} 112}
113 113
114void findWnd::selectionChanged_slot() 114void findWnd::selectionChanged_slot()
115{ 115{
116 qWarning( "findWnd::selectionChanged_slot(): Not implemented yet" ); 116 qWarning( "findWnd::selectionChanged_slot(): Not implemented yet" );
117} 117}
118 118
119void findWnd::closeButton_slot() 119void findWnd::closeButton_slot()
120{ 120{
121 qWarning( "findWnd::closeButton_slot(): Not implemented yet" ); 121 qWarning( "findWnd::closeButton_slot(): Not implemented yet" );
122} 122}
123 123
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index ff4c28a..7f4ccef 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -1,196 +1,196 @@
1/* 1/*
2 This file is part of PwManager/Platform independent. 2 This file is part of PwManager/Platform independent.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22 22
23$Id$ 23$Id$
24*/ 24*/
25 25
26#include "getmasterpwwnd_emb.h" 26#include "getmasterpwwnd_emb.h"
27 27
28#include "klocale.h" 28#include "klocale.h"
29 29
30/* 30/*
31#include <qvariant.h> 31#include <qvariant.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qtooltip.h> 36#include <qtooltip.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38*/ 38*/
39 39
40#include <qwidget.h> 40#include <qwidget.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qlabel.h> 42#include <qlabel.h>
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 numberBox->setFixedHeight(100);
68 numberBox->setFixedWidth(100); 68 numberBox->setFixedWidth(100);
69 69
70 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); 70 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );
71 numberLayout->setMargin( 0 ); 71 numberLayout->setMargin( 0 );
72 numberLayout->setSpacing( 0 ); 72 numberLayout->setSpacing( 0 );
73 73
74 QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); 74 QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
75 numberLayout->addWidget( p1, 0, 0 ); 75 numberLayout->addWidget( p1, 0, 0 );
76 QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); 76 QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
77 numberLayout->addWidget( p2, 0, 1 ); 77 numberLayout->addWidget( p2, 0, 1 );
78 QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); 78 QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
79 numberLayout->addWidget( p3, 0, 2 ); 79 numberLayout->addWidget( p3, 0, 2 );
80 QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); 80 QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
81 numberLayout->addWidget( p4, 1, 0 ); 81 numberLayout->addWidget( p4, 1, 0 );
82 QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); 82 QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
83 numberLayout->addWidget( p5, 1, 1 ); 83 numberLayout->addWidget( p5, 1, 1 );
84 QPushButton* p6 = new QPushButton( i18n("6"), numberBox ); 84 QPushButton* p6 = new QPushButton( i18n("6"), numberBox );
85 numberLayout->addWidget( p6, 1, 2 ); 85 numberLayout->addWidget( p6, 1, 2 );
86 QPushButton* p7 = new QPushButton( i18n("7"), numberBox ); 86 QPushButton* p7 = new QPushButton( i18n("7"), numberBox );
87 numberLayout->addWidget( p7, 2, 0 ); 87 numberLayout->addWidget( p7, 2, 0 );
88 QPushButton* p8 = new QPushButton( i18n("8"), numberBox ); 88 QPushButton* p8 = new QPushButton( i18n("8"), numberBox );
89 numberLayout->addWidget( p8, 2, 1 ); 89 numberLayout->addWidget( p8, 2, 1 );
90 QPushButton* p9 = new QPushButton( i18n("9"), numberBox ); 90 QPushButton* p9 = new QPushButton( i18n("9"), numberBox );
91 numberLayout->addWidget( p9, 2, 2 ); 91 numberLayout->addWidget( p9, 2, 2 );
92 QPushButton* clear = new QPushButton( i18n("x"), numberBox ); 92 QPushButton* clear = new QPushButton( i18n("x"), numberBox );
93 numberLayout->addWidget( clear, 3, 0 ); 93 numberLayout->addWidget( clear, 3, 0 );
94 QPushButton* p0 = new QPushButton( i18n("0"), numberBox ); 94 QPushButton* p0 = new QPushButton( i18n("0"), numberBox );
95 numberLayout->addWidget( p0, 3, 1 ); 95 numberLayout->addWidget( p0, 3, 1 );
96 QPushButton* backspace = new QPushButton( i18n("-"), numberBox ); 96 QPushButton* backspace = new QPushButton( i18n("-"), numberBox );
97 numberLayout->addWidget( backspace, 3, 2 ); 97 numberLayout->addWidget( backspace, 3, 2 );
98 98
99 99
100 pageLayout->addWidget(numberBox); 100 pageLayout->addWidget(numberBox);
101 101
102 resize( QSize(200, 180) ); 102 resize( 200,sizeHint().height() );
103 103
104 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) ); 104 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) );
105 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) ); 105 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) );
106 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) ); 106 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) );
107 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) ); 107 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) );
108 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) ); 108 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) );
109 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) ); 109 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) );
110 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) ); 110 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) );
111 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) ); 111 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) );
112 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) ); 112 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) );
113 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) ); 113 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) );
114 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); 114 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) );
115 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); 115 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) );
116 116
117 117
118 118
119} 119}
120 120
121/* 121/*
122 * Destroys the object and frees any allocated resources 122 * Destroys the object and frees any allocated resources
123 */ 123 */
124getMasterPwWnd::~getMasterPwWnd() 124getMasterPwWnd::~getMasterPwWnd()
125{ 125{
126 // no need to delete child widgets, Qt does it all for us 126 // no need to delete child widgets, Qt does it all for us
127} 127}
128 128
129void getMasterPwWnd::okButton_slot() 129void getMasterPwWnd::okButton_slot()
130{ 130{
131 qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" ); 131 qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" );
132} 132}
133 133
134void getMasterPwWnd::cancelButton_slot() 134void getMasterPwWnd::cancelButton_slot()
135{ 135{
136 qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" ); 136 qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" );
137} 137}
138 138
139void getMasterPwWnd::add0() 139void getMasterPwWnd::add0()
140{ 140{
141 addCharacter("0"); 141 addCharacter("0");
142} 142}
143void getMasterPwWnd::add1() 143void getMasterPwWnd::add1()
144{ 144{
145 addCharacter("1"); 145 addCharacter("1");
146} 146}
147void getMasterPwWnd::add2() 147void getMasterPwWnd::add2()
148{ 148{
149 addCharacter("2"); 149 addCharacter("2");
150} 150}
151void getMasterPwWnd::add3() 151void getMasterPwWnd::add3()
152{ 152{
153 addCharacter("3"); 153 addCharacter("3");
154} 154}
155void getMasterPwWnd::add4() 155void getMasterPwWnd::add4()
156{ 156{
157 addCharacter("4"); 157 addCharacter("4");
158} 158}
159void getMasterPwWnd::add5() 159void getMasterPwWnd::add5()
160{ 160{
161 addCharacter("5"); 161 addCharacter("5");
162} 162}
163void getMasterPwWnd::add6() 163void getMasterPwWnd::add6()
164{ 164{
165 addCharacter("6"); 165 addCharacter("6");
166} 166}
167void getMasterPwWnd::add7() 167void getMasterPwWnd::add7()
168{ 168{
169 addCharacter("7"); 169 addCharacter("7");
170} 170}
171void getMasterPwWnd::add8() 171void getMasterPwWnd::add8()
172{ 172{
173 addCharacter("8"); 173 addCharacter("8");
174} 174}
175void getMasterPwWnd::add9() 175void getMasterPwWnd::add9()
176{ 176{
177 addCharacter("9"); 177 addCharacter("9");
178} 178}
179void getMasterPwWnd::backspace() 179void getMasterPwWnd::backspace()
180{ 180{
181 QString old = pwLineEdit->text(); 181 QString old = pwLineEdit->text();
182 old.truncate(old.length()-1); 182 old.truncate(old.length()-1);
183 pwLineEdit->setText(old); 183 pwLineEdit->setText(old);
184} 184}
185 185
186void getMasterPwWnd::clear() 186void getMasterPwWnd::clear()
187{ 187{
188 pwLineEdit->setText(""); 188 pwLineEdit->setText("");
189} 189}
190 190
191void getMasterPwWnd::addCharacter(const QString& s) 191void getMasterPwWnd::addCharacter(const QString& s)
192{ 192{
193 QString old = pwLineEdit->text(); 193 QString old = pwLineEdit->text();
194 pwLineEdit->setText(old + s); 194 pwLineEdit->setText(old + s);
195} 195}
196 196
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 525bdaa..720dfcc 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -1,272 +1,279 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qspinbox.h> 32#include <qspinbox.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qvbox.h> 35#include <qvbox.h>
36 36
37#include <kconfig.h> 37#include <kconfig.h>
38#include <kdebug.h> 38#include <kdebug.h>
39#include <kdialog.h> 39#include <kdialog.h>
40#include <klistview.h> 40#include <klistview.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kglobal.h> 42#include <kglobal.h>
43#include <kmessagebox.h> 43#include <kmessagebox.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kio/kfile/kurlrequester.h> 45#include <kio/kfile/kurlrequester.h>
46 46
47#include "pwmprefs.h" 47#include "pwmprefs.h"
48 48
49#include "pwmconfigwidget.h" 49#include "pwmconfigwidget.h"
50#include "pwmexception.h" 50#include "pwmexception.h"
51 51
52PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) 52PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name )
53 : KPrefsWidget(prefs, parent, name ) 53 : KPrefsWidget(prefs, parent, name )
54{ 54{
55 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 55 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
56 KDialog::spacingHint() ); 56 KDialog::spacingHint() );
57 57
58 QTabWidget *tabWidget = new QTabWidget( this ); 58 QTabWidget *tabWidget = new QTabWidget( this );
59 topLayout->addWidget( tabWidget ); 59 topLayout->addWidget( tabWidget );
60 60
61 // windowsStyle page 61 // windowsStyle page
62 ////////////////////////////////////////////////////// 62 //////////////////////////////////////////////////////
63 QWidget *windowStylePage = new QWidget( this ); 63 QWidget *windowStylePage = new QWidget( this );
64 QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); 64 QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3);
65 65
66 int i = 0; 66 int i = 0;
67 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); 67 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage);
68 windowStyle->addRadio(i18n("Category on top")); 68 windowStyle->addRadio(i18n("Category on top"));
69 windowStyle->addRadio(i18n("Category-list left/top")); 69 windowStyle->addRadio(i18n("Category-list left/top"));
70 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); 70 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2);
71 ++i; 71 ++i;
72
73 QLabel* lab = new QLabel(i18n("<b>Font for Password entries:</b>"), windowStylePage);
74 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
75
72 76
77 ++i;
78
73 KPrefsWidFont *selEntrFont = 79 KPrefsWidFont *selEntrFont =
74 addWidFont(i18n("Password"),i18n("Font for Pw entries:"), 80 addWidFont(i18n("Password"),i18n("Font:"),
75 &(prefs->mEntryFont),windowStylePage); 81 &(prefs->mEntryFont),windowStylePage);
76 windowStyleLayout->addWidget(selEntrFont->label(),i,0); 82 windowStyleLayout->addWidget(selEntrFont->label(),i,0);
77 windowStyleLayout->addWidget(selEntrFont->preview(),i,1); 83 windowStyleLayout->addWidget(selEntrFont->preview(),i,1);
78 windowStyleLayout->addWidget(selEntrFont->button(),i,2); 84 windowStyleLayout->addWidget(selEntrFont->button(),i,2);
79 ++i; 85 ++i;
80 86 lab = new QLabel(i18n(""), windowStylePage);
87 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
81 88
82 // File page 89 // File page
83 ////////////////////////////////////////////////////// 90 //////////////////////////////////////////////////////
84 QWidget *filePage = new QWidget( this ); 91 QWidget *filePage = new QWidget( this );
85 QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); 92 QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2);
86 93
87 i = 0; 94 i = 0;
88 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); 95 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage);
89 fileLayout->addWidget(kcfg_compression_label,i,0); 96 fileLayout->addWidget(kcfg_compression_label,i,0);
90 kcfg_compression = new QComboBox(filePage, "kcfg_compression"); 97 kcfg_compression = new QComboBox(filePage, "kcfg_compression");
91 kcfg_compression->insertItem(i18n("None")); 98 kcfg_compression->insertItem(i18n("None"));
92 kcfg_compression->insertItem(i18n("gzip")); 99 kcfg_compression->insertItem(i18n("gzip"));
93 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); 100 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2"));
94 fileLayout->addWidget( kcfg_compression,i,1); 101 fileLayout->addWidget( kcfg_compression,i,1);
95 ++i; 102 ++i;
96 103
97 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); 104 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage);
98 fileLayout->addWidget(kcfg_crypt_label,i,0); 105 fileLayout->addWidget(kcfg_crypt_label,i,0);
99 kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo"); 106 kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo");
100 kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)")); 107 kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)"));
101#ifdef CONFIG_PWMANAGER_GCRY 108#ifdef CONFIG_PWMANAGER_GCRY
102 kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)")); 109 kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)"));
103 kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)")); 110 kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)"));
104 kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)")); 111 kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)"));
105 kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)")); 112 kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)"));
106 kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)")); 113 kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)"));
107 kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)")); 114 kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)"));
108#endif // CONFIG_PWMANAGER_GCRY 115#endif // CONFIG_PWMANAGER_GCRY
109 fileLayout->addWidget( kcfg_cryptAlgo,i,1); 116 fileLayout->addWidget( kcfg_cryptAlgo,i,1);
110 ++i; 117 ++i;
111 118
112 QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage); 119 QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage);
113 fileLayout->addWidget(kcfg_hash_label,i,0); 120 fileLayout->addWidget(kcfg_hash_label,i,0);
114 kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo"); 121 kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo");
115 kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)")); 122 kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)"));
116#ifdef CONFIG_PWMANAGER_GCRY 123#ifdef CONFIG_PWMANAGER_GCRY
117 kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)")); 124 kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)"));
118 kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)")); 125 kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)"));
119 kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)")); 126 kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)"));
120 kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)")); 127 kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)"));
121 kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)")); 128 kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)"));
122 kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)")); 129 kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)"));
123#endif // CONFIG_PWMANAGER_GCRY 130#endif // CONFIG_PWMANAGER_GCRY
124 fileLayout->addWidget( kcfg_hashAlgo,i,1); 131 fileLayout->addWidget( kcfg_hashAlgo,i,1);
125 ++i; 132 ++i;
126 133
127 permissionLineEdit = new QLineEdit(filePage); 134 permissionLineEdit = new QLineEdit(filePage);
128 QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); 135 QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage);
129 fileLayout->addWidget(permissionLineLabel,i,0); 136 fileLayout->addWidget(permissionLineLabel,i,0);
130 fileLayout->addWidget(permissionLineEdit,i,1); 137 fileLayout->addWidget(permissionLineEdit,i,1);
131 ++i; 138 ++i;
132 139
133 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), 140 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"),
134 &(prefs->mMakeFileBackup),filePage); 141 &(prefs->mMakeFileBackup),filePage);
135 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 142 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
136 ++i; 143 ++i;
137 144
138 // Timeout page 145 // Timeout page
139 ////////////////////////////////////////////////////// 146 //////////////////////////////////////////////////////
140 QWidget *timeoutPage = new QWidget( this ); 147 QWidget *timeoutPage = new QWidget( this );
141 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); 148 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2);
142 149
143 i = 0; 150 i = 0;
144 pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); 151 pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" );
145 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage); 152 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage);
146 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); 153 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0);
147 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); 154 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1);
148 ++i; 155 ++i;
149 156
150 lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); 157 lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" );
151 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage); 158 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage);
152 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); 159 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0);
153 timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); 160 timeoutLayout->addWidget(lockTimeoutSpinBox,i,1);
154 ++i; 161 ++i;
155 162
156 sb = addWidBool(i18n("deep-lock on autolock"), 163 sb = addWidBool(i18n("deep-lock on autolock"),
157 &(prefs->mAutoDeeplock),timeoutPage); 164 &(prefs->mAutoDeeplock),timeoutPage);
158 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 165 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
159 ++i; 166 ++i;
160 167
161 168
162 // Autostart page 169 // Autostart page
163 ////////////////////////////////////////////////////// 170 //////////////////////////////////////////////////////
164 QWidget *autostartPage = new QWidget( this ); 171 QWidget *autostartPage = new QWidget( this );
165 QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); 172 QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2);
166 173
167 i = 0; 174 i = 0;
168 175
169 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); 176 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit");
170 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); 177 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage);
171 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); 178 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1);
172 ++i; 179 ++i;
173 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); 180 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1);
174 ++i; 181 ++i;
175 182
176 sb = addWidBool(i18n("open deeplocked"), 183 sb = addWidBool(i18n("open deeplocked"),
177 &(prefs->mAutostartDeeplocked),autostartPage); 184 &(prefs->mAutostartDeeplocked),autostartPage);
178 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 185 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
179 ++i; 186 ++i;
180 187
181 188
182 // external app page 189 // external app page
183 ////////////////////////////////////////////////////// 190 //////////////////////////////////////////////////////
184 QWidget *externalappPage = new QWidget( this ); 191 QWidget *externalappPage = new QWidget( this );
185 QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); 192 QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2);
186 193
187 i = 0; 194 i = 0;
188 195
189 browserLineEdit = new QLineEdit(externalappPage); 196 browserLineEdit = new QLineEdit(externalappPage);
190 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); 197 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage);
191 externalappLayout->addWidget(browserLineLabel,i,0); 198 externalappLayout->addWidget(browserLineLabel,i,0);
192 externalappLayout->addWidget(browserLineEdit,i,1); 199 externalappLayout->addWidget(browserLineEdit,i,1);
193 ++i; 200 ++i;
194 201
195 xtermLineEdit = new QLineEdit(externalappPage); 202 xtermLineEdit = new QLineEdit(externalappPage);
196 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); 203 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage);
197 externalappLayout->addWidget(xtermLineLabel,i,0); 204 externalappLayout->addWidget(xtermLineLabel,i,0);
198 externalappLayout->addWidget(xtermLineEdit,i,1); 205 externalappLayout->addWidget(xtermLineEdit,i,1);
199 ++i; 206 ++i;
200 207
201 208
202 // miscelaneous page 209 // miscelaneous page
203 ////////////////////////////////////////////////////// 210 //////////////////////////////////////////////////////
204 QWidget *miscPage = new QWidget( this ); 211 QWidget *miscPage = new QWidget( this );
205 QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); 212 QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2);
206 213
207 i = 0; 214 i = 0;
208 215
209 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); 216 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage);
210 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 217 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
211 ++i; 218 ++i;
212 219
213 220
214 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); 221 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage);
215 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 222 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
216 ++i; 223 ++i;
217 224
218 sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); 225 sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage);
219 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 226 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
220 sb->checkBox()->setEnabled (FALSE); 227 sb->checkBox()->setEnabled (FALSE);
221 ++i; 228 ++i;
222 229
223 KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); 230 KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage);
224 minimizeRadio->addRadio(i18n("don't lock")); 231 minimizeRadio->addRadio(i18n("don't lock"));
225 minimizeRadio->addRadio(i18n("normal lock")); 232 minimizeRadio->addRadio(i18n("normal lock"));
226 minimizeRadio->addRadio(i18n("deep-lock")); 233 minimizeRadio->addRadio(i18n("deep-lock"));
227 miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); 234 miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2);
228 ++i; 235 ++i;
229 236
230 sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); 237 sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage);
231 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 238 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
232 ++i; 239 ++i;
233 240
234 sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); 241 sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage);
235 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 242 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
236 ++i; 243 ++i;
237 244
238 245
239 246
240 tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); 247 tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) );
241 tabWidget->addTab( filePage, i18n( "File" ) ); 248 tabWidget->addTab( filePage, i18n( "File" ) );
242 tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); 249 tabWidget->addTab( timeoutPage, i18n( "Timeout" ) );
243 tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); 250 tabWidget->addTab( autostartPage, i18n( "Autostart" ) );
244 tabWidget->addTab( externalappPage, i18n( "External apps" ) ); 251 tabWidget->addTab( externalappPage, i18n( "External apps" ) );
245 tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); 252 tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) );
246 253
247 254
248 connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); 255 connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
249 connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); 256 connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) );
250 connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); 257 connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) );
251 connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); 258 connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
252 connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); 259 connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
253 connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); 260 connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
254 261
255} 262}
256 263
257 264
258void PWMConfigWidget::usrReadConfig() 265void PWMConfigWidget::usrReadConfig()
259{ 266{
260 PWMPrefs* prefs = PWMPrefs::instance(); 267 PWMPrefs* prefs = PWMPrefs::instance();
261 268
262 269
263 setFilePermissions(prefs->mFilePermissions); 270 setFilePermissions(prefs->mFilePermissions);
264 271
265 pwTimeoutSpinBox->setValue(prefs->mPwTimeout); 272 pwTimeoutSpinBox->setValue(prefs->mPwTimeout);
266 lockTimeoutSpinBox->setValue(prefs->mLockTimeout); 273 lockTimeoutSpinBox->setValue(prefs->mLockTimeout);
267 autostartLineEdit->setURL(prefs->mAutoStart); 274 autostartLineEdit->setURL(prefs->mAutoStart);
268 browserLineEdit->setText(prefs->mBrowserCommand); 275 browserLineEdit->setText(prefs->mBrowserCommand);
269 xtermLineEdit->setText(prefs->mXTermCommand); 276 xtermLineEdit->setText(prefs->mXTermCommand);
270 277
271 kcfg_compression->setCurrentItem(prefs->mCompression); 278 kcfg_compression->setCurrentItem(prefs->mCompression);
272 kcfg_cryptAlgo->setCurrentItem(prefs->mCryptAlgo); 279 kcfg_cryptAlgo->setCurrentItem(prefs->mCryptAlgo);
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 3ae4d55..3f2d055 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -1,212 +1,213 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2003, 2004 by Michael Buesch * 3 * copyright (C) 2003, 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#ifndef PWM_EMBEDDED 20#ifndef PWM_EMBEDDED
21#include <kcmdlineargs.h> 21#include <kcmdlineargs.h>
22#include <kaboutdata.h> 22#include <kaboutdata.h>
23#else 23#else
24#include <qdir.h> 24#include <qdir.h>
25#include <kpimglobalprefs.h> 25#include <kpimglobalprefs.h>
26#endif 26#endif
27 27
28#include <klocale.h> 28#include <klocale.h>
29#include <kstandarddirs.h> 29#include <kstandarddirs.h>
30 30
31#include "pwmexception.h" 31#include "pwmexception.h"
32#include "pwminit.h" 32#include "pwminit.h"
33 33
34 #define LICENSE_FILE(::locate("data", "pwmanager/pwmanager_license_text")) 34 #define LICENSE_FILE(::locate("data", "pwmanager/pwmanager_license_text"))
35 35
36int PwMApplication::newInstance() 36int PwMApplication::newInstance()
37{ 37{
38 static bool initial = true; 38 static bool initial = true;
39 if (initial) { 39 if (initial) {
40 initial = false; 40 initial = false;
41 init = new PwMInit(this); 41 init = new PwMInit(this);
42 init->initializeApp(); 42 init->initializeApp();
43 } else { 43 } else {
44 BUG_ON(!init); 44 BUG_ON(!init);
45 printInfo("passing parameters to old instance."); 45 printInfo("passing parameters to old instance.");
46 init->handleCmdLineArgs(false); 46 init->handleCmdLineArgs(false);
47 } 47 }
48 return EXIT_SUCCESS; 48 return EXIT_SUCCESS;
49} 49}
50 50
51 51
52static const char *description = I18N_NOOP("PwManager\n" 52static const char *description = I18N_NOOP("PwManager\n"
53 "The convenient way of managing passwords"); 53 "The convenient way of managing passwords");
54 54
55#ifndef PWM_EMBEDDED 55#ifndef PWM_EMBEDDED
56static KCmdLineOptions options[] = 56static KCmdLineOptions options[] =
57{ 57{
58 { "minimized", I18N_NOOP("Windows minimized"), 0 }, 58 { "minimized", I18N_NOOP("Windows minimized"), 0 },
59 { "mintray", I18N_NOOP("Windows minimized to tray"),0 }, 59 { "mintray", I18N_NOOP("Windows minimized to tray"),0 },
60 { "open-deeplocked", I18N_NOOP("Open all \"files\" deeplocked"),0 }, 60 { "open-deeplocked", I18N_NOOP("Open all \"files\" deeplocked"),0 },
61 { "skip-self-test", I18N_NOOP("Don't run a self-test on startup"),0 }, 61 { "skip-self-test", I18N_NOOP("Don't run a self-test on startup"),0 },
62 { "+[files...]", I18N_NOOP("Files to open on startup"), 0 }, 62 { "+[files...]", I18N_NOOP("Files to open on startup"), 0 },
63 { 0, 0, 0 } 63 { 0, 0, 0 }
64}; 64};
65#endif 65#endif
66 66
67#ifdef PWM_DEBUG 67#ifdef PWM_DEBUG
68static void printDebugConfigureInfo() 68static void printDebugConfigureInfo()
69{ 69{
70 cout << "================================" << endl; 70 cout << "================================" << endl;
71 cout << PROG_NAME " version " PACKAGE_VER << endl; 71 cout << PROG_NAME " version " PACKAGE_VER << endl;
72#ifdef CONFIG_KEYCARD 72#ifdef CONFIG_KEYCARD
73 cout << "CONFIG_KEYCARD: enabled" << endl; 73 cout << "CONFIG_KEYCARD: enabled" << endl;
74#else 74#else
75 cout << "CONFIG_KEYCARD: disabled" << endl; 75 cout << "CONFIG_KEYCARD: disabled" << endl;
76#endif 76#endif
77#ifdef CONFIG_KWALLETIF 77#ifdef CONFIG_KWALLETIF
78 cout << "CONFIG_KWALLETIF: enabled" << endl; 78 cout << "CONFIG_KWALLETIF: enabled" << endl;
79#else 79#else
80 cout << "CONFIG_KWALLETIF: disabled" << endl; 80 cout << "CONFIG_KWALLETIF: disabled" << endl;
81#endif 81#endif
82#ifdef BIG_ENDIAN_HOST 82#ifdef BIG_ENDIAN_HOST
83 cout << "Endianess: big-endian" << endl; 83 cout << "Endianess: big-endian" << endl;
84#else 84#else
85 cout << "Endianess: little-endian" << endl; 85 cout << "Endianess: little-endian" << endl;
86#endif 86#endif
87 cout << "sizeof(long): " << sizeof(long) << endl; 87 cout << "sizeof(long): " << sizeof(long) << endl;
88 cout << "================================" << endl; 88 cout << "================================" << endl;
89} 89}
90#else // PWM_DEBUG 90#else // PWM_DEBUG
91static inline void printDebugConfigureInfo() { /* nothing */ } 91static inline void printDebugConfigureInfo() { /* nothing */ }
92#endif // PWM_DEBUG 92#endif // PWM_DEBUG
93 93
94#ifndef PWM_EMBEDDED 94#ifndef PWM_EMBEDDED
95static void addAuthors(KAboutData *aboutData) 95static void addAuthors(KAboutData *aboutData)
96{ 96{
97 aboutData->addAuthor("Michael Buesch", 97 aboutData->addAuthor("Michael Buesch",
98 I18N_NOOP( 98 I18N_NOOP(
99 "main programming and current maintainer"), 99 "main programming and current maintainer"),
100 "mbuesch@freenet.de"); 100 "mbuesch@freenet.de");
101 aboutData->addAuthor("Matt Scifo", 101 aboutData->addAuthor("Matt Scifo",
102 I18N_NOOP( 102 I18N_NOOP(
103 "original implementaion of \n" 103 "original implementaion of \n"
104 "\"categories\" and the password-tree \n" 104 "\"categories\" and the password-tree \n"
105 "in the system-tray. Original implementations of \n" 105 "in the system-tray. Original implementations of \n"
106 "numerous view-improvements."), 106 "numerous view-improvements."),
107 "mscifo@o1.com"); 107 "mscifo@o1.com");
108 aboutData->addCredit("Elias Probst", 108 aboutData->addCredit("Elias Probst",
109 I18N_NOOP( 109 I18N_NOOP(
110 "Gentoo ebuild maintainer."), 110 "Gentoo ebuild maintainer."),
111 "elias.probst@gmx.de"); 111 "elias.probst@gmx.de");
112 aboutData->addCredit("George Staikos", 112 aboutData->addCredit("George Staikos",
113 I18N_NOOP("KWallet"), 113 I18N_NOOP("KWallet"),
114 "staikos@kde.org"); 114 "staikos@kde.org");
115 aboutData->addCredit("Matthew Palmer", 115 aboutData->addCredit("Matthew Palmer",
116 I18N_NOOP("rc2 code"), 116 I18N_NOOP("rc2 code"),
117 "mjp16@uow.edu.au"); 117 "mjp16@uow.edu.au");
118 aboutData->addCredit("Olivier Sessink", 118 aboutData->addCredit("Olivier Sessink",
119 I18N_NOOP("gpasman"), 119 I18N_NOOP("gpasman"),
120 "gpasman@nl.linux.org"); 120 "gpasman@nl.linux.org");
121 aboutData->addCredit("The libgcrypt developers", 121 aboutData->addCredit("The libgcrypt developers",
122 I18N_NOOP("Blowfish and SHA1 algorithms"), 122 I18N_NOOP("Blowfish and SHA1 algorithms"),
123 0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/"); 123 0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/");
124 aboutData->addCredit("Troy Engel", 124 aboutData->addCredit("Troy Engel",
125 I18N_NOOP("kpasman"), 125 I18N_NOOP("kpasman"),
126 "tengel@sonic.net"); 126 "tengel@sonic.net");
127 aboutData->addCredit("Wickey", 127 aboutData->addCredit("Wickey",
128 I18N_NOOP("graphics-design in older versions."), 128 I18N_NOOP("graphics-design in older versions."),
129 "wickey@gmx.at"); 129 "wickey@gmx.at");
130 aboutData->addCredit("Ian MacGregor", 130 aboutData->addCredit("Ian MacGregor",
131 I18N_NOOP( 131 I18N_NOOP(
132 "original documentation author.")); 132 "original documentation author."));
133} 133}
134#endif 134#endif
135 135
136int main(int argc, char *argv[]) 136int main(int argc, char *argv[])
137{ 137{
138 printDebugConfigureInfo(); 138 printDebugConfigureInfo();
139#ifndef PWM_EMBEDDED 139#ifndef PWM_EMBEDDED
140 KAboutData aboutData(PACKAGE_NAME, PROG_NAME, 140 KAboutData aboutData(PACKAGE_NAME, PROG_NAME,
141 PACKAGE_VER, description, KAboutData::License_File, 141 PACKAGE_VER, description, KAboutData::License_File,
142 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0, 142 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0,
143 "http://passwordmanager.sourceforge.net/", 143 "http://passwordmanager.sourceforge.net/",
144 "mbuesch@freenet.de"); 144 "mbuesch@freenet.de");
145 addAuthors(&aboutData); 145 addAuthors(&aboutData);
146 146
147 KCmdLineArgs::init(argc, argv, &aboutData); 147 KCmdLineArgs::init(argc, argv, &aboutData);
148 KCmdLineArgs::addCmdLineOptions(options); 148 KCmdLineArgs::addCmdLineOptions(options);
149 149
150 KUniqueApplication::addCmdLineOptions(); 150 KUniqueApplication::addCmdLineOptions();
151 if (!KUniqueApplication::start()) { 151 if (!KUniqueApplication::start()) {
152 printInfo("already running."); 152 printInfo("already running.");
153 return EXIT_SUCCESS; 153 return EXIT_SUCCESS;
154 } 154 }
155 PwMApplication a; 155 PwMApplication a;
156 aboutData.setLicenseTextFile(LICENSE_FILE); 156 aboutData.setLicenseTextFile(LICENSE_FILE);
157 return a.exec(); 157 return a.exec();
158#else 158#else
159 159
160 bool exitHelp = false; 160 bool exitHelp = false;
161 if ( argc > 1 ) { 161 if ( argc > 1 ) {
162 QString command = argv[1]; 162 QString command = argv[1];
163 if ( command == "-help" ){ 163 if ( command == "-help" ){
164 printf("PWM/PI command line commands:\n"); 164 printf("PWM/PI command line commands:\n");
165 printf(" no command: Start PWM/PI in usual way\n"); 165 printf(" no command: Start PWM/PI in usual way\n");
166 printf(" -help: This output\n"); 166 printf(" -help: This output\n");
167 printf(" PWM/PI is exiting now. Bye!\n"); 167 printf(" PWM/PI is exiting now. Bye!\n");
168 exitHelp = true; 168 exitHelp = true;
169 } 169 }
170 } 170 }
171 if ( ! exitHelp ) { 171 if ( ! exitHelp ) {
172 172
173 PwMApplication a(argc, argv); 173 PwMApplication a(argc, argv);
174 174
175 KGlobal::setAppName( "pwmanager" ); 175 KGlobal::setAppName( "pwmanager" );
176#ifndef DESKTOP_VERSION 176#ifndef DESKTOP_VERSION
177 //US if ( QApplication::desktop()->width() > 320 ) 177 //qDebug("width %d ",QApplication::desktop()->width() );
178 //US KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); 178 if ( QApplication::desktop()->width() > 320 )
179 //US else 179 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
180 else
180 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); 181 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/");
181#else 182#else
182 QString fileName ; 183 QString fileName ;
183 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 184 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
184 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 185 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
185 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 186 QApplication::addLibraryPath ( qApp->applicationDirPath () );
186 187
187#endif 188#endif
188 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 189 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
189 KPimGlobalPrefs::instance()->setGlobalConfig(); 190 KPimGlobalPrefs::instance()->setGlobalConfig();
190 191
191 a.newInstance(); 192 a.newInstance();
192 193
193 //US KAddressBookMain m ; 194 //US KAddressBookMain m ;
194 195
195 //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 & )));
196 /*US 197 /*US
197#ifndef DESKTOP_VERSION 198#ifndef DESKTOP_VERSION
198 a.showMainWidget( &m ); 199 a.showMainWidget( &m );
199#else 200#else
200 a.setMainWidget( &m ); 201 a.setMainWidget( &m );
201 m.resize (640, 480 ); 202 m.resize (640, 480 );
202 m.show(); 203 m.show();
203#endif 204#endif
204 */ 205 */
205 a.exec(); 206 a.exec();
206 207
207 } 208 }
208 qDebug("PWMPI: Bye! "); 209 qDebug("PWMPI: Bye! ");
209 210
210#endif 211#endif
211 212
212} 213}
diff --git a/pwmanager/pwmanager/pwmviewstyle_0.cpp b/pwmanager/pwmanager/pwmviewstyle_0.cpp
index 7262684..1453d03 100644
--- a/pwmanager/pwmanager/pwmviewstyle_0.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_0.cpp
@@ -1,112 +1,112 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2004 by Michael Buesch * 3 * copyright (C) 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwmviewstyle_0.h" 20#include "pwmviewstyle_0.h"
21#include "pwmview.h" 21#include "pwmview.h"
22#include "listviewpwm.h" 22#include "listviewpwm.h"
23#include "commentbox.h" 23#include "commentbox.h"
24 24
25#include <klocale.h> 25#include <klocale.h>
26#include "pwmprefs.h" 26#include "pwmprefs.h"
27 27
28PwMViewStyle_0::PwMViewStyle_0(PwMView *view) 28PwMViewStyle_0::PwMViewStyle_0(PwMView *view)
29 : QObject() 29 : QObject()
30{ 30{
31 vbox1 = new QVBox(view); 31 vbox1 = new QVBox(view);
32 vbox1->setSpacing(3); 32 vbox1->setSpacing(3);
33 hbox1 = new QHBox(vbox1); 33 hbox1 = new QHBox(vbox1);
34 hbox1->setSpacing(10); 34 hbox1->setSpacing(3);
35 categoriesTitle = new QLabel(hbox1); 35 categoriesTitle = new QLabel(hbox1);
36 categoriesTitle->setText(i18n("Categories:")); 36 categoriesTitle->setText(i18n("Categories:"));
37 categoriesCombo = new QComboBox(hbox1); 37 categoriesCombo = new QComboBox(hbox1);
38 renCatButton = new QPushButton(i18n("&Rename"), hbox1); 38 renCatButton = new QPushButton(i18n("&Rename"), hbox1);
39 delCatButton = new QPushButton(i18n("&Delete"), hbox1); 39 delCatButton = new QPushButton(i18n("&Delete"), hbox1);
40#ifndef PWM_EMBEDDED 40#ifndef PWM_EMBEDDED
41 splitter1 = new QSplitter(vbox1); 41 splitter1 = new QSplitter(vbox1);
42 splitter1->setOrientation(Qt::Vertical); 42 splitter1->setOrientation(Qt::Vertical);
43#else 43#else
44 splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1); 44 splitter1 = new KDGanttMinimizeSplitter( Qt::Vertical, vbox1);
45 splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 45 splitter1->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
46 46
47 //US topLayout->addWidget(mMiniSplitter ); 47 //US topLayout->addWidget(mMiniSplitter );
48#endif 48#endif
49 lv = new ListViewPwM(splitter1); 49 lv = new ListViewPwM(splitter1);
50 commentBox = new CommentBox(splitter1); 50 commentBox = new CommentBox(splitter1);
51 // set sizes and styles 51 // set sizes and styles
52 commentBox->resize(commentBox->size().width(), 60); 52 commentBox->resize(commentBox->size().width(), 60);
53 categoriesTitle->setAlignment(Qt::AlignVCenter | Qt::AlignRight); 53 categoriesTitle->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
54 // connections 54 // connections
55 connect(categoriesCombo, SIGNAL(activated(int)), 55 connect(categoriesCombo, SIGNAL(activated(int)),
56 view, SLOT(shiftToView())); 56 view, SLOT(shiftToView()));
57 connect(renCatButton, SIGNAL(clicked()), 57 connect(renCatButton, SIGNAL(clicked()),
58 view, SLOT(renCatButton_slot())); 58 view, SLOT(renCatButton_slot()));
59 connect(delCatButton, SIGNAL(clicked()), 59 connect(delCatButton, SIGNAL(clicked()),
60 view, SLOT(delCatButton_slot())); 60 view, SLOT(delCatButton_slot()));
61} 61}
62 62
63PwMViewStyle_0::~PwMViewStyle_0() 63PwMViewStyle_0::~PwMViewStyle_0()
64{ 64{
65 delete vbox1; 65 delete vbox1;
66} 66}
67 67
68void PwMViewStyle_0::delCategory(const QString &cat) 68void PwMViewStyle_0::delCategory(const QString &cat)
69{ 69{
70 PWM_ASSERT(categoriesCombo); 70 PWM_ASSERT(categoriesCombo);
71 int i, count = categoriesCombo->count(); 71 int i, count = categoriesCombo->count();
72 for (i = 0; i < count; ++i) { 72 for (i = 0; i < count; ++i) {
73 if (categoriesCombo->text(i) == cat) { 73 if (categoriesCombo->text(i) == cat) {
74 categoriesCombo->removeItem(i); 74 categoriesCombo->removeItem(i);
75 return; 75 return;
76 } 76 }
77 } 77 }
78 BUG(); 78 BUG();
79} 79}
80 80
81void PwMViewStyle_0::selectCategory(const QString &cat) 81void PwMViewStyle_0::selectCategory(const QString &cat)
82{ 82{
83 PWM_ASSERT(categoriesCombo); 83 PWM_ASSERT(categoriesCombo);
84 int i, count = categoriesCombo->count(); 84 int i, count = categoriesCombo->count();
85 for (i = 0; i < count; ++i) { 85 for (i = 0; i < count; ++i) {
86 if (categoriesCombo->text(i) == cat) { 86 if (categoriesCombo->text(i) == cat) {
87 categoriesCombo->setCurrentItem(i); 87 categoriesCombo->setCurrentItem(i);
88 return; 88 return;
89 } 89 }
90 } 90 }
91 // fall back to 0 91 // fall back to 0
92 categoriesCombo->setCurrentItem(0); 92 categoriesCombo->setCurrentItem(0);
93} 93}
94 94
95 95
96//US ENH: I need a place to load the view dependend settings. Eg. splittersize 96//US ENH: I need a place to load the view dependend settings. Eg. splittersize
97void PwMViewStyle_0::restoreSettings(PWMPrefs* prefs) 97void PwMViewStyle_0::restoreSettings(PWMPrefs* prefs)
98{ 98{
99 //load and store the size of the listviewcolumns 99 //load and store the size of the listviewcolumns
100 lv->restoreLayout(prefs->getConfig(), "listview"); 100 lv->restoreLayout(prefs->getConfig(), "listview");
101 splitter1->setSizes( prefs->mCommentSplitter ); 101 splitter1->setSizes( prefs->mCommentSplitter );
102 102
103} 103}
104 104
105//US ENH: I need a place to load the view dependend settings. Eg. splittersize 105//US ENH: I need a place to load the view dependend settings. Eg. splittersize
106void PwMViewStyle_0::saveSettings(PWMPrefs* prefs) 106void PwMViewStyle_0::saveSettings(PWMPrefs* prefs)
107{ 107{
108 //store the size of the listviewcolumns 108 //store the size of the listviewcolumns
109 lv->saveLayout(prefs->getConfig(), "listview"); 109 lv->saveLayout(prefs->getConfig(), "listview");
110 prefs->mCommentSplitter = splitter1->sizes(); 110 prefs->mCommentSplitter = splitter1->sizes();
111 111
112} 112}
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.cpp b/pwmanager/pwmanager/pwmviewstyle_1.cpp
index 374c698..a85cece 100644
--- a/pwmanager/pwmanager/pwmviewstyle_1.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle_1.cpp
@@ -1,152 +1,152 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2004 by Michael Buesch * 3 * copyright (C) 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwmviewstyle_1.h" 20#include "pwmviewstyle_1.h"
21#include "pwmview.h" 21#include "pwmview.h"
22#include "listviewpwm.h" 22#include "listviewpwm.h"
23#include "commentbox.h" 23#include "commentbox.h"
24 24
25#include <klocale.h> 25#include <klocale.h>
26#include "pwmprefs.h" 26#include "pwmprefs.h"
27 27
28 #define INITIAL_CATEGORIES_WIDTH100 28 #define INITIAL_CATEGORIES_WIDTH100
29 29
30PwMViewStyle_1::PwMViewStyle_1(PwMView *view) 30PwMViewStyle_1::PwMViewStyle_1(PwMView *view)
31 : QObject() 31 : QObject()
32{ 32{
33#ifndef PWM_EMBEDDED 33#ifndef PWM_EMBEDDED
34 splitter = new QSplitter(view); 34 splitter = new QSplitter(view);
35#else 35#else
36 splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view); 36 splitter = new KDGanttMinimizeSplitter( Qt::Horizontal, view);
37 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 37 splitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
38 38
39 //US topLayout->addWidget(mMiniSplitter ); 39 //US topLayout->addWidget(mMiniSplitter );
40#endif 40#endif
41 41
42 vbox1 = new QVBox(splitter); 42 vbox1 = new QVBox(splitter);
43 categoriesTitle = new QLabel(vbox1); 43 categoriesTitle = new QLabel(vbox1);
44 categoriesList = new QListBox(vbox1); 44 categoriesList = new QListBox(vbox1);
45#ifndef PWM_EMBEDDED 45#ifndef PWM_EMBEDDED
46 splitter2 = new QSplitter(splitter); 46 splitter2 = new QSplitter(splitter);
47 splitter2->setOrientation(Qt::Vertical); 47 splitter2->setOrientation(Qt::Vertical);
48#else 48#else
49 splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter); 49 splitter2 = new KDGanttMinimizeSplitter( Qt::Vertical, splitter);
50 splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 50 splitter2->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
51 51
52 //US topLayout->addWidget(mMiniSplitter ); 52 //US topLayout->addWidget(mMiniSplitter );
53#endif 53#endif
54 lv = new ListViewPwM(splitter2); 54 lv = new ListViewPwM(splitter2);
55 commentBox = new CommentBox(splitter2); 55 commentBox = new CommentBox(splitter2);
56 // set sizes and styles 56 // set sizes and styles
57 //UScommentBox->resize(commentBox->size().width(), 60); 57 //UScommentBox->resize(commentBox->size().width(), 60);
58 QValueList<int> sizes; 58 QValueList<int> sizes;
59#ifndef PWM_EMBEDDED 59#ifndef PWM_EMBEDDED
60 sizes.push_back(INITIAL_CATEGORIES_WIDTH); 60 sizes.push_back(INITIAL_CATEGORIES_WIDTH);
61 sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH); 61 sizes.push_back(view->height() - INITIAL_CATEGORIES_WIDTH);
62#else 62#else
63 sizes.append(INITIAL_CATEGORIES_WIDTH); 63 sizes.append(INITIAL_CATEGORIES_WIDTH);
64 sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH); 64 sizes.append(view->height() - INITIAL_CATEGORIES_WIDTH);
65#endif 65#endif
66 //USsplitter->setSizes(sizes); 66 //USsplitter->setSizes(sizes);
67 categoriesTitle->setAlignment(Qt::AlignHCenter); 67 categoriesTitle->setAlignment(Qt::AlignHCenter);
68#ifndef PWM_EMBEDDED 68#ifndef PWM_EMBEDDED
69 categoriesTitle->setFrameShape(QFrame::MenuBarPanel); 69 categoriesTitle->setFrameShape(QFrame::MenuBarPanel);
70#else 70#else
71 categoriesTitle->setFrameShape(QFrame::StyledPanel); 71 categoriesTitle->setFrameShape(QFrame::StyledPanel);
72#endif 72#endif
73 categoriesTitle->setText(i18n("Categories:")); 73 categoriesTitle->setText(i18n("Categories:"));
74 catCtxMenu = new QPopupMenu(view); 74 catCtxMenu = new QPopupMenu(view);
75 catCtxMenu->insertItem(i18n("&Rename"), 75 catCtxMenu->insertItem(i18n("&Rename"),
76 view, SLOT(renCatButton_slot())); 76 view, SLOT(renCatButton_slot()));
77 catCtxMenu->insertItem(i18n("&Delete"), 77 catCtxMenu->insertItem(i18n("&Delete"),
78 view, SLOT(delCatButton_slot())); 78 view, SLOT(delCatButton_slot()));
79 // connections 79 // connections
80 connect(categoriesList, SIGNAL(highlighted(int)), 80 connect(categoriesList, SIGNAL(highlighted(int)),
81 view, SLOT(shiftToView())); 81 view, SLOT(shiftToView()));
82 connect(categoriesList, 82 connect(categoriesList,
83 SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), 83 SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),
84 this, 84 this,
85 SLOT(catRightClick(QListBoxItem *, const QPoint &))); 85 SLOT(catRightClick(QListBoxItem *, const QPoint &)));
86} 86}
87 87
88PwMViewStyle_1::~PwMViewStyle_1() 88PwMViewStyle_1::~PwMViewStyle_1()
89{ 89{
90 delete catCtxMenu; 90 delete catCtxMenu;
91 delete splitter; 91 delete splitter;
92} 92}
93 93
94void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point) 94void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point)
95{ 95{
96 if (!item) 96 if (!item)
97 return; 97 return;
98 catCtxMenu->move(point); 98 catCtxMenu->move(point);
99 catCtxMenu->show(); 99 catCtxMenu->show();
100} 100}
101 101
102void PwMViewStyle_1::delCategory(const QString &cat) 102void PwMViewStyle_1::delCategory(const QString &cat)
103{ 103{
104 PWM_ASSERT(categoriesList); 104 PWM_ASSERT(categoriesList);
105 int i, count = categoriesList->count(); 105 int i, count = categoriesList->count();
106 for (i = 0; i < count; ++i) { 106 for (i = 0; i < count; ++i) {
107 if (categoriesList->text(i) == cat) { 107 if (categoriesList->text(i) == cat) {
108 categoriesList->removeItem(i); 108 categoriesList->removeItem(i);
109 return; 109 return;
110 } 110 }
111 } 111 }
112 BUG(); 112 BUG();
113} 113}
114 114
115void PwMViewStyle_1::selectCategory(const QString &cat) 115void PwMViewStyle_1::selectCategory(const QString &cat)
116{ 116{
117 PWM_ASSERT(categoriesList); 117 PWM_ASSERT(categoriesList);
118 int i, count = categoriesList->count(); 118 int i, count = categoriesList->count();
119 for (i = 0; i < count; ++i) { 119 for (i = 0; i < count; ++i) {
120 if (categoriesList->text(i) == cat) { 120 if (categoriesList->text(i) == cat) {
121 categoriesList->setCurrentItem(i); 121 categoriesList->setCurrentItem(i);
122 return; 122 return;
123 } 123 }
124 } 124 }
125 // fall back to 0 125 // fall back to 0
126 categoriesList->setCurrentItem(0); 126 categoriesList->setCurrentItem(0);
127} 127}
128 128
129//US ENH: I need a place to load the view dependend settings. Eg. splittersize 129//US ENH: I need a place to load the view dependend settings. Eg. splittersize
130void PwMViewStyle_1::restoreSettings(PWMPrefs* prefs) 130void PwMViewStyle_1::restoreSettings(PWMPrefs* prefs)
131{ 131{
132 //load and store the size of the listviewcolumns 132 //load and store the size of the listviewcolumns
133 lv->restoreLayout(prefs->getConfig(), "listview"); 133 lv->restoreLayout(prefs->getConfig(), "listview");
134 splitter->setSizes( prefs->mCategorySplitter ); 134 splitter->setSizes( prefs->mCategorySplitter );
135 splitter2->setSizes( prefs->mCommentSplitter ); 135 splitter2->setSizes( prefs->mCommentSplitter );
136 136
137} 137}
138 138
139//US ENH: I need a place to load the view dependend settings. Eg. splittersize 139//US ENH: I need a place to load the view dependend settings. Eg. splittersize
140void PwMViewStyle_1::saveSettings(PWMPrefs* prefs) 140void PwMViewStyle_1::saveSettings(PWMPrefs* prefs)
141{ 141{
142 //store the size of the listviewcolumns 142 //store the size of the listviewcolumns
143 lv->saveLayout(prefs->getConfig(), "listview"); 143 lv->saveLayout(prefs->getConfig(), "listview");
144 prefs->mCategorySplitter = splitter->sizes(); 144 prefs->mCategorySplitter = splitter->sizes();
145 prefs->mCommentSplitter = splitter2->sizes(); 145 prefs->mCommentSplitter = splitter2->sizes();
146 146
147} 147}
148 148
149 149
150#ifndef PWM_EMBEDDED 150#ifndef PWM_EMBEDDED
151#include "pwmviewstyle_1.moc" 151#include "pwmviewstyle_1.moc"
152#endif 152#endif