summaryrefslogtreecommitdiff
authoreilers <eilers>2003-03-07 14:33:36 (UTC)
committer eilers <eilers>2003-03-07 14:33:36 (UTC)
commiteeb28ead6d3050d662783696661d9360a049104f (patch) (unidiff)
tree3a9f27185ecddcd1fe7a9dd20db49f87b4841556
parent78a2773ef477a4ab7327350e5f1f6c07428ad8a4 (diff)
downloadopie-eeb28ead6d3050d662783696661d9360a049104f.zip
opie-eeb28ead6d3050d662783696661d9360a049104f.tar.gz
opie-eeb28ead6d3050d662783696661d9360a049104f.tar.bz2
Removed unused files and starting with WhatsThis..
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addresssettings.cpp136
-rw-r--r--core/pim/addressbook/addresssettings.h47
-rw-r--r--core/pim/addressbook/addresssettingsbase.ui170
-rw-r--r--core/pim/addressbook/configdlg.cpp3
-rw-r--r--core/pim/addressbook/configdlg_base.ui75
-rw-r--r--core/pim/addressbook/contacteditor.cpp17
6 files changed, 92 insertions, 356 deletions
diff --git a/core/pim/addressbook/addresssettings.cpp b/core/pim/addressbook/addresssettings.cpp
deleted file mode 100644
index 2a9413c..0000000
--- a/core/pim/addressbook/addresssettings.cpp
+++ b/dev/null
@@ -1,136 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qt Palmtop Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21
22#include "addresssettings.h"
23
24#include <qpe/config.h>
25#include <opie/ocontact.h>
26
27#include <qfile.h>
28#include <qlistbox.h>
29
30#include <stdlib.h>
31
32AddressSettings::AddressSettings( QWidget *parent, const char *name )
33 : AddressSettingsBase( parent, name, TRUE )
34{
35 init();
36}
37
38AddressSettings::~AddressSettings()
39{
40}
41
42void AddressSettings::init()
43{
44 QStringList slFields = OContact::trfields();
45 // Make this match what is in initFields
46 slFields.remove( tr("Name Title") );
47 slFields.remove( tr("First Name") );
48 slFields.remove( tr("Last Name") );
49 slFields.remove( tr("File As") );
50 slFields.remove( tr("Default Email") );
51 slFields.remove( tr("Notes") );
52 slFields.remove( tr("Gender") );
53
54
55 for( QStringList::Iterator it = slFields.begin();
56 it != slFields.end(); ++it ) {
57 fieldListBox->insertItem( *it );
58 }
59
60 Config cfg( "AddressBook" );
61
62 cfg.setGroup( "Version" );
63 int version;
64 version = cfg.readNumEntry( "version" );
65 if ( version >= ADDRESSVERSION ) {
66 int i = 0;
67 int p = 0;
68 cfg.setGroup( "ImportantCategory" );
69 QString zn = cfg.readEntry( "Category" + QString::number(i),
70 QString::null );
71 while ( !zn.isNull() ) {
72 for ( int m = i; m < (int)fieldListBox->count(); m++ ) {
73 if ( fieldListBox->text( m ) == zn ) {
74 if ( m != p ) {
75 fieldListBox->removeItem( m );
76 fieldListBox->insertItem( zn, p );
77 }
78 p++;
79 break;
80 }
81 }
82 zn = cfg.readEntry( "Category" + QString::number(++i),
83 QString::null );
84 }
85
86 fieldListBox->setCurrentItem( 0 );
87 } else {
88 QString str;
89 str = getenv("HOME");
90
91 str += "/Settings/AddressBook.conf";
92 QFile::remove( str );
93 }
94}
95
96void AddressSettings::itemUp()
97{
98 int i = fieldListBox->currentItem();
99 if ( i > 0 ) {
100 QString item = fieldListBox->currentText();
101 fieldListBox->removeItem( i );
102 fieldListBox->insertItem( item, i-1 );
103 fieldListBox->setCurrentItem( i-1 );
104 }
105}
106
107void AddressSettings::itemDown()
108{
109 int i = fieldListBox->currentItem();
110 if ( i < (int)fieldListBox->count() - 1 ) {
111 QString item = fieldListBox->currentText();
112 fieldListBox->removeItem( i );
113 fieldListBox->insertItem( item, i+1 );
114 fieldListBox->setCurrentItem( i+1 );
115 }
116}
117
118void AddressSettings::accept()
119{
120 save();
121 QDialog::accept();
122}
123
124
125void AddressSettings::save()
126{
127 Config cfg( "AddressBook" );
128 cfg.setGroup( "Version" );
129 // *** To change the version change it here...
130 cfg.writeEntry( "version", QString::number(ADDRESSVERSION) );
131 cfg.setGroup( "ImportantCategory" );
132
133 for ( int i = 0; i < (int)fieldListBox->count(); i++ ) {
134 cfg.writeEntry( "Category"+QString::number(i), fieldListBox->text(i) );
135 }
136}
diff --git a/core/pim/addressbook/addresssettings.h b/core/pim/addressbook/addresssettings.h
deleted file mode 100644
index 0fdfa77..0000000
--- a/core/pim/addressbook/addresssettings.h
+++ b/dev/null
@@ -1,47 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qt Palmtop Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#ifndef _ADDRESSSETTINGS_H_
22#define _ADDRESSSETTINGS_H_
23
24#include <qlist.h>
25#include <qstringlist.h>
26#include "addresssettingsbase.h"
27
28const int ADDRESSVERSION = 3;
29
30class AddressSettings : public AddressSettingsBase
31{
32 Q_OBJECT
33public:
34 AddressSettings( QWidget *parent = 0, const char *name = 0 );
35 ~AddressSettings();
36
37protected:
38 void accept();
39 virtual void itemUp();
40 virtual void itemDown();
41
42private:
43 void init();
44 void save();
45};
46
47#endif // _ADDRESSSETTINGS_H_
diff --git a/core/pim/addressbook/addresssettingsbase.ui b/core/pim/addressbook/addresssettingsbase.ui
deleted file mode 100644
index f0eb7e8..0000000
--- a/core/pim/addressbook/addresssettingsbase.ui
+++ b/dev/null
@@ -1,170 +0,0 @@
1<!DOCTYPE UI><UI>
2<class>AddressSettingsBase</class>
3<comment>/**********************************************************************
4** Copyright (C) 2001 Trolltech AS. All rights reserved.
5**
6** This file is part of Qt Palmtop Environment.
7**
8** This file may be distributed and/or modified under the terms of the
9** GNU General Public License version 2 as published by the Free Software
10** Foundation and appearing in the file LICENSE.GPL included in the
11** packaging of this file.
12**
13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17**
18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you.
20**
21** $Id$
22**
23**********************************************************************/</comment>
24<widget>
25 <class>QDialog</class>
26 <property stdset="1">
27 <name>name</name>
28 <cstring>AddressSettingsBase</cstring>
29 </property>
30 <property stdset="1">
31 <name>geometry</name>
32 <rect>
33 <x>0</x>
34 <y>0</y>
35 <width>240</width>
36 <height>207</height>
37 </rect>
38 </property>
39 <property stdset="1">
40 <name>caption</name>
41 <string>Arrange Edit Fields</string>
42 </property>
43 <property>
44 <name>layoutMargin</name>
45 </property>
46 <property>
47 <name>layoutSpacing</name>
48 </property>
49 <grid>
50 <property stdset="1">
51 <name>margin</name>
52 <number>6</number>
53 </property>
54 <property stdset="1">
55 <name>spacing</name>
56 <number>6</number>
57 </property>
58 <widget row="1" column="0" rowspan="3" colspan="1" >
59 <class>QListBox</class>
60 <property stdset="1">
61 <name>name</name>
62 <cstring>fieldListBox</cstring>
63 </property>
64 </widget>
65 <widget row="0" column="0" rowspan="1" colspan="2" >
66 <class>QLabel</class>
67 <property stdset="1">
68 <name>name</name>
69 <cstring>lblExplain</cstring>
70 </property>
71 <property stdset="1">
72 <name>sizePolicy</name>
73 <sizepolicy>
74 <hsizetype>1</hsizetype>
75 <vsizetype>1</vsizetype>
76 </sizepolicy>
77 </property>
78 <property stdset="1">
79 <name>frameShape</name>
80 <enum>MShape</enum>
81 </property>
82 <property stdset="1">
83 <name>frameShadow</name>
84 <enum>MShadow</enum>
85 </property>
86 <property stdset="1">
87 <name>text</name>
88 <string>Select the field order:</string>
89 </property>
90 <property stdset="1">
91 <name>alignment</name>
92 <set>AlignTop|AlignLeft</set>
93 </property>
94 <property>
95 <name>hAlign</name>
96 </property>
97 <property>
98 <name>vAlign</name>
99 </property>
100 </widget>
101 <widget row="1" column="1" >
102 <class>QPushButton</class>
103 <property stdset="1">
104 <name>name</name>
105 <cstring>upButton</cstring>
106 </property>
107 <property stdset="1">
108 <name>text</name>
109 <string>Up</string>
110 </property>
111 <property stdset="1">
112 <name>autoRepeat</name>
113 <bool>true</bool>
114 </property>
115 </widget>
116 <widget row="2" column="1" >
117 <class>QPushButton</class>
118 <property stdset="1">
119 <name>name</name>
120 <cstring>downButton</cstring>
121 </property>
122 <property stdset="1">
123 <name>text</name>
124 <string>Down</string>
125 </property>
126 <property stdset="1">
127 <name>autoRepeat</name>
128 <bool>true</bool>
129 </property>
130 </widget>
131 <spacer row="3" column="1" >
132 <property>
133 <name>name</name>
134 <cstring>Spacer2</cstring>
135 </property>
136 <property stdset="1">
137 <name>orientation</name>
138 <enum>Vertical</enum>
139 </property>
140 <property stdset="1">
141 <name>sizeType</name>
142 <enum>Expanding</enum>
143 </property>
144 <property>
145 <name>sizeHint</name>
146 <size>
147 <width>20</width>
148 <height>20</height>
149 </size>
150 </property>
151 </spacer>
152 </grid>
153</widget>
154<connections>
155 <connection>
156 <sender>upButton</sender>
157 <signal>clicked()</signal>
158 <receiver>AddressSettingsBase</receiver>
159 <slot>itemUp()</slot>
160 </connection>
161 <connection>
162 <sender>downButton</sender>
163 <signal>clicked()</signal>
164 <receiver>AddressSettingsBase</receiver>
165 <slot>itemDown()</slot>
166 </connection>
167 <slot access="protected">itemUp()</slot>
168 <slot access="protected">itemDown()</slot>
169</connections>
170</UI>
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp
index f5c0c5b..f2f4141 100644
--- a/core/pim/addressbook/configdlg.cpp
+++ b/core/pim/addressbook/configdlg.cpp
@@ -23,2 +23,5 @@ ConfigDlg::ConfigDlg( QWidget *parent, const char *name):
23 23
24 // Reset Widget Flags: This was not changeable by designer :(
25 setWFlags ( WStyle_ContextHelp );
26
24 // Set Pics to Buttons and Tabs 27 // Set Pics to Buttons and Tabs
diff --git a/core/pim/addressbook/configdlg_base.ui b/core/pim/addressbook/configdlg_base.ui
index 8ae2578..308e138 100644
--- a/core/pim/addressbook/configdlg_base.ui
+++ b/core/pim/addressbook/configdlg_base.ui
@@ -3,2 +3,3 @@
3<author>Stefan Eilers</author> 3<author>Stefan Eilers</author>
4<include location="global">qwhatsthis.h</include>
4<widget> 5<widget>
@@ -14,3 +15,3 @@
14 <y>0</y> 15 <y>0</y>
15 <width>282</width> 16 <width>284</width>
16 <height>327</height> 17 <height>327</height>
@@ -64,2 +65,6 @@
64 </property> 65 </property>
66 <property>
67 <name>whatsThis</name>
68 <string>Click on tab to select one</string>
69 </property>
65 <widget> 70 <widget>
@@ -112,2 +117,6 @@
112 </property> 117 </property>
118 <property>
119 <name>whatsThis</name>
120 <string>Settings for the search query style</string>
121 </property>
113 <vbox> 122 <vbox>
@@ -131,2 +140,6 @@
131 </property> 140 </property>
141 <property>
142 <name>whatsThis</name>
143 <string>Search widget expects regular expressions if selected</string>
144 </property>
132 </widget> 145 </widget>
@@ -146,2 +159,6 @@
146 </property> 159 </property>
160 <property>
161 <name>whatsThis</name>
162 <string>Search widget just expects simple wildcards</string>
163 </property>
147 </widget> 164 </widget>
@@ -159,2 +176,6 @@
159 </property> 176 </property>
177 <property>
178 <name>whatsThis</name>
179 <string>If selected, search differs between upper and lower chars</string>
180 </property>
160 </widget> 181 </widget>
@@ -172,2 +193,6 @@
172 </property> 193 </property>
194 <property>
195 <name>whatsThis</name>
196 <string></string>
197 </property>
173 <hbox> 198 <hbox>
@@ -191,2 +216,6 @@
191 </property> 216 </property>
217 <property>
218 <name>whatsThis</name>
219 <string>Font size for list- and card view</string>
220 </property>
192 </widget> 221 </widget>
@@ -206,2 +235,6 @@
206 </property> 235 </property>
236 <property>
237 <name>whatsThis</name>
238 <string>Font size for list- and card view</string>
239 </property>
207 </widget> 240 </widget>
@@ -217,2 +250,6 @@
217 </property> 250 </property>
251 <property>
252 <name>whatsThis</name>
253 <string>Font size for list- and card view</string>
254 </property>
218 </widget> 255 </widget>
@@ -272,2 +309,6 @@
272 </property> 309 </property>
310 <property>
311 <name>whatsThis</name>
312 <string>Fontsettings for list and card view</string>
313 </property>
273 <vbox> 314 <vbox>
@@ -295,2 +336,6 @@
295 </property> 336 </property>
337 <property>
338 <name>whatsThis</name>
339 <string>Use Sharp's mail application if available</string>
340 </property>
296 </widget> 341 </widget>
@@ -306,2 +351,6 @@
306 </property> 351 </property>
352 <property>
353 <name>whatsThis</name>
354 <string>Use OPIE mail if installed</string>
355 </property>
307 </widget> 356 </widget>
@@ -405,2 +454,6 @@ is provided free !</string>
405 </property> 454 </property>
455 <property>
456 <name>whatsThis</name>
457 <string>Move selected attribute one line up</string>
458 </property>
406 </widget> 459 </widget>
@@ -427,2 +480,6 @@ is provided free !</string>
427 </property> 480 </property>
481 <property>
482 <name>whatsThis</name>
483 <string>Move selected attribute one line down</string>
484 </property>
428 </widget> 485 </widget>
@@ -441,2 +498,6 @@ is provided free !</string>
441 </property> 498 </property>
499 <property>
500 <name>whatsThis</name>
501 <string>List of all available attributes</string>
502 </property>
442 </widget> 503 </widget>
@@ -459,2 +520,6 @@ is provided free !</string>
459 </property> 520 </property>
521 <property>
522 <name>whatsThis</name>
523 <string>Add selected attribute from list below to the upper list</string>
524 </property>
460 </widget> 525 </widget>
@@ -477,2 +542,6 @@ is provided free !</string>
477 </property> 542 </property>
543 <property>
544 <name>whatsThis</name>
545 <string>Remove the selected attribute from the upper list</string>
546 </property>
478 </widget> 547 </widget>
@@ -533,2 +602,6 @@ is provided free !</string>
533 </property> 602 </property>
603 <property>
604 <name>whatsThis</name>
605 <string>Order (up -&gt; down) defines the primary contact shown in the second column of the list view</string>
606 </property>
534 </widget> 607 </widget>
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 0b65a10..df97b85 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -49,2 +49,3 @@
49#include <qmessagebox.h> 49#include <qmessagebox.h>
50#include <qwhatsthis.h>
50 51
@@ -67,4 +68,4 @@ ContactEditor::ContactEditor( const OContact &entry,
67 const char *name, 68 const char *name,
68 WFlags fl ) 69 WFlags )
69 : QDialog( parent, name, TRUE, fl ), 70 : QDialog( parent, name, TRUE, WStyle_ContextHelp ),
70 defaultEmailChooserPosition( -1 ), 71 defaultEmailChooserPosition( -1 ),
@@ -150,4 +151,6 @@ void ContactEditor::init() {
150 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 151 btnFullName = new QPushButton( tr( "Full Name..." ), container );
152 QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) );
151 gl->addWidget( btnFullName, 0, 0 ); 153 gl->addWidget( btnFullName, 0, 0 );
152 txtFullName = new QLineEdit( container ); 154 txtFullName = new QLineEdit( container );
155 QWhatsThis::add( txtFullName, tr( "Enter fullname directly ! If you have a lastname with multiple words ( for instance \"de la Guerra\"), please write <lastname>,<firstnames> like this: \"de la Guerra, Carlos Pedro\"" ) );
153 gl->addWidget( txtFullName, 0, 1 ); 156 gl->addWidget( txtFullName, 0, 1 );
@@ -155,4 +158,6 @@ void ContactEditor::init() {
155 QLabel *l = new QLabel( tr( "Job Title" ), container ); 158 QLabel *l = new QLabel( tr( "Job Title" ), container );
159 QWhatsThis::add( l, tr( "The jobtitle.." ) );
156 gl->addWidget( l, 1, 0 ); 160 gl->addWidget( l, 1, 0 );
157 txtJobTitle = new QLineEdit( container ); 161 txtJobTitle = new QLineEdit( container );
162 QWhatsThis::add( txtJobTitle, tr( "The jobtitle.." ) );
158 gl->addWidget( txtJobTitle, 1, 1 ); 163 gl->addWidget( txtJobTitle, 1, 1 );
@@ -160,4 +165,6 @@ void ContactEditor::init() {
160 l = new QLabel( tr("Suffix"), container ); 165 l = new QLabel( tr("Suffix"), container );
166 QWhatsThis::add( l, tr( "Something like \"jr.\".." ) );
161 gl->addWidget( l, 2, 0 ); 167 gl->addWidget( l, 2, 0 );
162 txtSuffix = new QLineEdit( container ); 168 txtSuffix = new QLineEdit( container );
169 QWhatsThis::add( txtSuffix, tr( "Something like \"jr.\".." ) );
163 gl->addWidget( txtSuffix, 2, 1 ); 170 gl->addWidget( txtSuffix, 2, 1 );
@@ -165,4 +172,6 @@ void ContactEditor::init() {
165 l = new QLabel( tr( "Organization" ), container ); 172 l = new QLabel( tr( "Organization" ), container );
173 QWhatsThis::add( l, tr( "The working place of the contact" ) );
166 gl->addWidget( l, 3, 0 ); 174 gl->addWidget( l, 3, 0 );
167 txtOrganization = new QLineEdit( container ); 175 txtOrganization = new QLineEdit( container );
176 QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) );
168 gl->addWidget( txtOrganization, 3, 1 ); 177 gl->addWidget( txtOrganization, 3, 1 );
@@ -171,2 +180,3 @@ void ContactEditor::init() {
171 cmbChooserField1 = new QComboBox( FALSE, container ); 180 cmbChooserField1 = new QComboBox( FALSE, container );
181 QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) );
172 cmbChooserField1->setMaximumWidth( 90 ); 182 cmbChooserField1->setMaximumWidth( 90 );
@@ -183,2 +193,3 @@ void ContactEditor::init() {
183 cmbChooserField2 = new QComboBox( FALSE, container ); 193 cmbChooserField2 = new QComboBox( FALSE, container );
194 QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) );
184 cmbChooserField2->setMaximumWidth( 90 ); 195 cmbChooserField2->setMaximumWidth( 90 );
@@ -195,2 +206,3 @@ void ContactEditor::init() {
195 cmbChooserField3 = new QComboBox( FALSE, container ); 206 cmbChooserField3 = new QComboBox( FALSE, container );
207 QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) );
196 cmbChooserField3->setMaximumWidth( 90 ); 208 cmbChooserField3->setMaximumWidth( 90 );
@@ -206,2 +218,3 @@ void ContactEditor::init() {
206 l = new QLabel( tr( "File As" ), container ); 218 l = new QLabel( tr( "File As" ), container );
219 QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) );
207 gl->addWidget( l, 7, 0 ); 220 gl->addWidget( l, 7, 0 );