Diffstat (limited to 'core/pim/addressbook/configdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index dee0f11..6c98b5d 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | #include "configdlg.h" | 1 | #include "configdlg.h" |
2 | 2 | ||
3 | #include <opie2/opimcontact.h> | ||
4 | #include "opie2/opimcontactfields.h" | ||
5 | |||
6 | #include <qpe/resource.h> | ||
7 | |||
3 | #include <qcheckbox.h> | 8 | #include <qcheckbox.h> |
4 | #include <qradiobutton.h> | 9 | #include <qradiobutton.h> |
5 | #include <qlistbox.h> | 10 | #include <qlistbox.h> |
6 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
7 | 12 | ||
8 | #include <qpe/resource.h> | ||
9 | |||
10 | #include <opie/ocontact.h> | ||
11 | #include "opie/ocontactfields.h" | ||
12 | |||
13 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): | 13 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): |
14 | ConfigDlg_Base(parent, name, true ) | 14 | ConfigDlg_Base(parent, name, true ) |
15 | { | 15 | { |
16 | contFields = OContactFields::trfields(); | 16 | contFields = Opie::OPimContactFields::trfields(); |
17 | 17 | ||
18 | // We add all Fields into the Listbox | 18 | // We add all Fields into the Listbox |
19 | for (uint i=0; i < contFields.count(); i++) { | 19 | for (uint i=0; i < contFields.count(); i++) { |
20 | allFieldListBox->insertItem( contFields[i] ); | 20 | allFieldListBox->insertItem( contFields[i] ); |
21 | } | 21 | } |
22 | 22 | ||
23 | // Reset Widget Flags: This was not changeable by designer :( | 23 | // Reset Widget Flags: This was not changeable by designer :( |
24 | setWFlags ( WStyle_ContextHelp ); | 24 | setWFlags ( WStyle_ContextHelp ); |
25 | 25 | ||
26 | // Set Pics to Buttons and Tabs | 26 | // Set Pics to Buttons and Tabs |
27 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); | 27 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); |
28 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); | 28 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); |
29 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); | 29 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); |
30 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); | 30 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); |
31 | 31 | ||
32 | 32 | ||
33 | // Get the translation maps between Field ID and translated strings | 33 | // Get the translation maps between Field ID and translated strings |
34 | m_mapStrToID = OContactFields::trFieldsToId(); | 34 | m_mapStrToID = Opie::OPimContactFields::trFieldsToId(); |
35 | m_mapIDToStr = OContactFields::idToTrFields(); | 35 | m_mapIDToStr = Opie::OPimContactFields::idToTrFields(); |
36 | 36 | ||
37 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); | 37 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); |
38 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); | 38 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); |
39 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); | 39 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); |
40 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); | 40 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); |
41 | } | 41 | } |
42 | 42 | ||
43 | void ConfigDlg::slotItemUp() | 43 | void ConfigDlg::slotItemUp() |
44 | { | 44 | { |
45 | qWarning( "void ConfigDlg::slotItemUp()" ); | 45 | qWarning( "void ConfigDlg::slotItemUp()" ); |
46 | 46 | ||
47 | int i = fieldListBox->currentItem(); | 47 | int i = fieldListBox->currentItem(); |
@@ -67,75 +67,75 @@ void ConfigDlg::slotItemDown() | |||
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | void ConfigDlg::slotItemAdd() | 70 | void ConfigDlg::slotItemAdd() |
71 | { | 71 | { |
72 | qWarning( "void ConfigDlg::slotItemAdd()" ); | 72 | qWarning( "void ConfigDlg::slotItemAdd()" ); |
73 | 73 | ||
74 | int i = allFieldListBox->currentItem(); | 74 | int i = allFieldListBox->currentItem(); |
75 | if ( i > 0 ) { | 75 | if ( i > 0 ) { |
76 | QString item = allFieldListBox->currentText(); | 76 | QString item = allFieldListBox->currentText(); |
77 | qWarning("ADding %s", item.latin1()); | 77 | qWarning("ADding %s", item.latin1()); |
78 | fieldListBox->insertItem( item ); | 78 | fieldListBox->insertItem( item ); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | void ConfigDlg::slotItemRemove() | 82 | void ConfigDlg::slotItemRemove() |
83 | { | 83 | { |
84 | qWarning( "void ConfigDlg::slotItemRemove()" ); | 84 | qWarning( "void ConfigDlg::slotItemRemove()" ); |
85 | 85 | ||
86 | int i = fieldListBox->currentItem(); | 86 | int i = fieldListBox->currentItem(); |
87 | if ( i > 0 ) { | 87 | if ( i > 0 ) { |
88 | fieldListBox->removeItem( i ); | 88 | fieldListBox->removeItem( i ); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | void ConfigDlg::setConfig( const AbConfig& cnf ) | 92 | void ConfigDlg::setConfig( const AbConfig& cnf ) |
93 | { | 93 | { |
94 | m_config = cnf; | 94 | m_config = cnf; |
95 | 95 | ||
96 | m_useRegExp->setChecked( m_config.useRegExp() ); | 96 | m_useRegExp->setChecked( m_config.useRegExp() ); |
97 | m_useWildCard->setChecked( m_config.useWildCards() ); | 97 | m_useWildCard->setChecked( m_config.useWildCards() ); |
98 | m_useQtMail->setChecked( m_config.useQtMail() ); | 98 | m_useQtMail->setChecked( m_config.useQtMail() ); |
99 | m_useOpieMail->setChecked( m_config.useOpieMail() ); | 99 | m_useOpieMail->setChecked( m_config.useOpieMail() ); |
100 | m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); | 100 | m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); |
101 | 101 | ||
102 | switch( m_config.fontSize() ){ | 102 | switch( m_config.fontSize() ){ |
103 | case 0: | 103 | case 0: |
104 | m_smallFont->setChecked( true ); | 104 | m_smallFont->setChecked( true ); |
105 | m_normalFont->setChecked( false ); | 105 | m_normalFont->setChecked( false ); |
106 | m_largeFont->setChecked( false ); | 106 | m_largeFont->setChecked( false ); |
107 | break; | 107 | break; |
108 | case 1: | 108 | case 1: |
109 | m_smallFont->setChecked( false ); | 109 | m_smallFont->setChecked( false ); |
110 | m_normalFont->setChecked( true ); | 110 | m_normalFont->setChecked( true ); |
111 | m_largeFont->setChecked( false ); | 111 | m_largeFont->setChecked( false ); |
112 | break; | 112 | break; |
113 | case 2: | 113 | case 2: |
114 | m_smallFont->setChecked( false ); | 114 | m_smallFont->setChecked( false ); |
115 | m_normalFont->setChecked( false ); | 115 | m_normalFont->setChecked( false ); |
116 | m_largeFont->setChecked( true ); | 116 | m_largeFont->setChecked( true ); |
117 | break; | 117 | break; |
118 | } | 118 | } |
119 | 119 | ||
120 | for( uint i = 0; i < m_config.orderList().count(); i++ ) { | 120 | for( uint i = 0; i < m_config.orderList().count(); i++ ) { |
121 | fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); | 121 | fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); |
122 | } | 122 | } |
123 | 123 | ||
124 | m_fixedBars->setChecked( m_config.fixedBars() ); | 124 | m_fixedBars->setChecked( m_config.fixedBars() ); |
125 | m_moveBars->setChecked( !m_config.fixedBars() ); | 125 | m_moveBars->setChecked( !m_config.fixedBars() ); |
126 | } | 126 | } |
127 | 127 | ||
128 | AbConfig ConfigDlg::getConfig() | 128 | AbConfig ConfigDlg::getConfig() |
129 | { | 129 | { |
130 | m_config.setUseRegExp( m_useRegExp->isOn() ); | 130 | m_config.setUseRegExp( m_useRegExp->isOn() ); |
131 | m_config.setUseWildCards( m_useWildCard->isOn() ); | 131 | m_config.setUseWildCards( m_useWildCard->isOn() ); |
132 | m_config.setUseQtMail( m_useQtMail->isOn() ); | 132 | m_config.setUseQtMail( m_useQtMail->isOn() ); |
133 | m_config.setUseOpieMail( m_useOpieMail->isOn() ); | 133 | m_config.setUseOpieMail( m_useOpieMail->isOn() ); |
134 | m_config.setBeCaseSensitive( m_useCaseSensitive->isChecked() ); | 134 | m_config.setBeCaseSensitive( m_useCaseSensitive->isChecked() ); |
135 | 135 | ||
136 | if ( m_smallFont->isChecked() ) | 136 | if ( m_smallFont->isChecked() ) |
137 | m_config.setFontSize( 0 ); | 137 | m_config.setFontSize( 0 ); |
138 | if ( m_normalFont->isChecked() ) | 138 | if ( m_normalFont->isChecked() ) |
139 | m_config.setFontSize( 1 ); | 139 | m_config.setFontSize( 1 ); |
140 | if ( m_largeFont->isChecked() ) | 140 | if ( m_largeFont->isChecked() ) |
141 | m_config.setFontSize( 2 ); | 141 | m_config.setFontSize( 2 ); |