-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/settings/citytime/citytimebase.cpp | 36 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/zsafe/scqtfiledlg.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/powerchord/powerchordbase.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.cc | 2 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 2 |
11 files changed, 38 insertions, 38 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 9c13017..312c663 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1,1037 +1,1037 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> | 2 | * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> |
3 | * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) | 3 | * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) |
4 | * | 4 | * |
5 | * This file is an add-on for the OPIE Palmtop Environment | 5 | * This file is an add-on for the OPIE Palmtop Environment |
6 | * | 6 | * |
7 | * This file may be distributed and/or modified under the terms of the | 7 | * This file may be distributed and/or modified under the terms of the |
8 | * GNU General Public License version 2 as published by the Free Software | 8 | * GNU General Public License version 2 as published by the Free Software |
9 | * Foundation and appearing in the file LICENSE.GPL included in the pacakaging | 9 | * Foundation and appearing in the file LICENSE.GPL included in the pacakaging |
10 | * of this file. | 10 | * of this file. |
11 | * | 11 | * |
12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | * | 14 | * |
15 | * | 15 | * |
16 | * This is a rewrite of the abeditor.h file, modified to provide a more | 16 | * This is a rewrite of the abeditor.h file, modified to provide a more |
17 | * intuitive interface to TrollTech's original Address Book editor. This | 17 | * intuitive interface to TrollTech's original Address Book editor. This |
18 | * is made to operate exactly in interface with the exception of name. | 18 | * is made to operate exactly in interface with the exception of name. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "contacteditor.h" | 22 | #include "contacteditor.h" |
23 | #include "namelineedit.h" | 23 | #include "namelineedit.h" |
24 | 24 | ||
25 | #include <opie2/odebug.h> | 25 | #include <opie2/odebug.h> |
26 | #include <opie2/opimcontact.h> | 26 | #include <opie2/opimcontact.h> |
27 | 27 | ||
28 | #include <qpe/categoryselect.h> | 28 | #include <qpe/categoryselect.h> |
29 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/qpedialog.h> | 30 | #include <qpe/qpedialog.h> |
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | 32 | ||
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qtabwidget.h> | 34 | #include <qtabwidget.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qmultilineedit.h> | 37 | #include <qmultilineedit.h> |
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | #include <qlistbox.h> | 39 | #include <qlistbox.h> |
40 | #include <qmessagebox.h> | 40 | #include <qmessagebox.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | 42 | ||
43 | #include <assert.h> | 43 | #include <assert.h> |
44 | 44 | ||
45 | static inline bool containsAlphaNum( const QString &str ); | 45 | static inline bool containsAlphaNum( const QString &str ); |
46 | static inline bool constainsWhiteSpace( const QString &str ); | 46 | static inline bool constainsWhiteSpace( const QString &str ); |
47 | 47 | ||
48 | // helper functions, convert our comma delimited list to proper | 48 | // helper functions, convert our comma delimited list to proper |
49 | // file format... | 49 | // file format... |
50 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 50 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
51 | QString &strAll ); | 51 | QString &strAll ); |
52 | 52 | ||
53 | // helper convert from file format to comma delimited... | 53 | // helper convert from file format to comma delimited... |
54 | void parseEmailTo( const QString &strDefaultEmail, | 54 | void parseEmailTo( const QString &strDefaultEmail, |
55 | const QString &strOtherEmail, QString &strBack ); | 55 | const QString &strOtherEmail, QString &strBack ); |
56 | 56 | ||
57 | ContactEditor::ContactEditor(const Opie::OPimContact &entry, | 57 | ContactEditor::ContactEditor(const Opie::OPimContact &entry, |
58 | QWidget *parent, | 58 | QWidget *parent, |
59 | const char *name, | 59 | const char *name, |
60 | WFlags ) | 60 | WFlags ) |
61 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), | 61 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), |
62 | defaultEmailChooserPosition( -1 ), | 62 | defaultEmailChooserPosition( -1 ), |
63 | m_personalView ( false ), | 63 | m_personalView ( false ), |
64 | cmbDefaultEmail( 0 ), | 64 | cmbDefaultEmail( 0 ), |
65 | initializing ( false ) | 65 | initializing ( false ) |
66 | { | 66 | { |
67 | 67 | ||
68 | initializing = true; | 68 | initializing = true; |
69 | 69 | ||
70 | init(); | 70 | init(); |
71 | setEntry( entry ); | 71 | setEntry( entry ); |
72 | // cmbDefaultEmail = 0; | 72 | // cmbDefaultEmail = 0; |
73 | // defaultEmailChooserPosition = -1; | 73 | // defaultEmailChooserPosition = -1; |
74 | 74 | ||
75 | initializing = false; | 75 | initializing = false; |
76 | } | 76 | } |
77 | 77 | ||
78 | ContactEditor::~ContactEditor() { | 78 | ContactEditor::~ContactEditor() { |
79 | } | 79 | } |
80 | 80 | ||
81 | void ContactEditor::init() { | 81 | void ContactEditor::init() { |
82 | owarn << "init() START" << oendl; | 82 | owarn << "init() START" << oendl; |
83 | 83 | ||
84 | uint i = 0; | 84 | uint i = 0; |
85 | 85 | ||
86 | QStringList trlChooserNames; | 86 | QStringList trlChooserNames; |
87 | 87 | ||
88 | for (i = 0; i <= 6; i++) { | 88 | for (i = 0; i <= 6; i++) { |
89 | slHomeAddress.append( "" ); | 89 | slHomeAddress.append( "" ); |
90 | slBusinessAddress.append( "" ); | 90 | slBusinessAddress.append( "" ); |
91 | } | 91 | } |
92 | 92 | ||
93 | trlChooserNames = Opie::OPimContactFields::trphonefields( false ); | 93 | trlChooserNames = Opie::OPimContactFields::trphonefields( false ); |
94 | slChooserNames = Opie::OPimContactFields::untrphonefields( false ); | 94 | slChooserNames = Opie::OPimContactFields::untrphonefields( false ); |
95 | slDynamicEntries = Opie::OPimContactFields::untrdetailsfields( false ); | 95 | slDynamicEntries = Opie::OPimContactFields::untrdetailsfields( false ); |
96 | trlDynamicEntries = Opie::OPimContactFields::trdetailsfields( false ); | 96 | trlDynamicEntries = Opie::OPimContactFields::trdetailsfields( false ); |
97 | 97 | ||
98 | // Ok, we have to remove elements from the list of dynamic entries | 98 | // Ok, we have to remove elements from the list of dynamic entries |
99 | // which are now stored in special (not dynamic) widgets.. | 99 | // which are now stored in special (not dynamic) widgets.. |
100 | // Otherwise we will get problems with field assignments! (se) | 100 | // Otherwise we will get problems with field assignments! (se) |
101 | slDynamicEntries.remove("Anniversary"); | 101 | slDynamicEntries.remove("Anniversary"); |
102 | slDynamicEntries.remove("Birthday"); | 102 | slDynamicEntries.remove("Birthday"); |
103 | slDynamicEntries.remove("Gender"); | 103 | slDynamicEntries.remove("Gender"); |
104 | 104 | ||
105 | // The same with translated fields.. But I will | 105 | // The same with translated fields.. But I will |
106 | // use the translation map to avoid mismatches.. | 106 | // use the translation map to avoid mismatches.. |
107 | QMap<int, QString> translMap = Opie::OPimContactFields::idToTrFields(); | 107 | QMap<int, QString> translMap = Opie::OPimContactFields::idToTrFields(); |
108 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); | 108 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); |
109 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); | 109 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); |
110 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); | 110 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); |
111 | 111 | ||
112 | // Last Check to be sure.. | 112 | // Last Check to be sure.. |
113 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); | 113 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); |
114 | assert( slChooserNames.count() == trlChooserNames.count() ); | 114 | assert( slChooserNames.count() == trlChooserNames.count() ); |
115 | 115 | ||
116 | for (i = 0; i < slChooserNames.count(); i++) | 116 | for (i = 0; i < slChooserNames.count(); i++) |
117 | slChooserValues.append(""); | 117 | slChooserValues.append(""); |
118 | 118 | ||
119 | 119 | ||
120 | QVBoxLayout *vb = new QVBoxLayout( this ); | 120 | QVBoxLayout *vb = new QVBoxLayout( this ); |
121 | 121 | ||
122 | tabMain = new QTabWidget( this ); | 122 | tabMain = new QTabWidget( this ); |
123 | vb->addWidget( tabMain ); | 123 | vb->addWidget( tabMain ); |
124 | 124 | ||
125 | QWidget *tabViewport = new QWidget ( tabMain ); | 125 | QWidget *tabViewport = new QWidget ( tabMain ); |
126 | 126 | ||
127 | vb = new QVBoxLayout( tabViewport ); | 127 | vb = new QVBoxLayout( tabViewport ); |
128 | 128 | ||
129 | svGeneral = new QScrollView( tabViewport ); | 129 | svGeneral = new QScrollView( tabViewport ); |
130 | vb->addWidget( svGeneral, 0, 0 ); | 130 | vb->addWidget( svGeneral, 0, 0 ); |
131 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 131 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
132 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); | 132 | // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff ); |
133 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); | 133 | // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff ); |
134 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 134 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
135 | 135 | ||
136 | QWidget *container = new QWidget( svGeneral->viewport() ); | 136 | QWidget *container = new QWidget( svGeneral->viewport() ); |
137 | svGeneral->addChild( container ); | 137 | svGeneral->addChild( container ); |
138 | 138 | ||
139 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 139 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
140 | gl->setResizeMode( QLayout::FreeResize ); | 140 | gl->setResizeMode( QLayout::FreeResize ); |
141 | 141 | ||
142 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 142 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
143 | QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) ); | 143 | QWhatsThis::add( btnFullName, tr( "Press to enter last- middle and firstname" ) ); |
144 | gl->addWidget( btnFullName, 0, 0 ); | 144 | gl->addWidget( btnFullName, 0, 0 ); |
145 | txtFullName = new ABOOK::NameLineEdit( container ); | 145 | txtFullName = new ABOOK::NameLineEdit( container ); |
146 | 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\"" ) ); | 146 | 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\"" ) ); |
147 | gl->addWidget( txtFullName, 0, 1 ); | 147 | gl->addWidget( txtFullName, 0, 1 ); |
148 | 148 | ||
149 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 149 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
150 | QWhatsThis::add( l, tr( "The jobtitle.." ) ); | 150 | QWhatsThis::add( l, tr( "The jobtitle.." ) ); |
151 | gl->addWidget( l, 1, 0 ); | 151 | gl->addWidget( l, 1, 0 ); |
152 | txtJobTitle = new QLineEdit( container ); | 152 | txtJobTitle = new QLineEdit( container ); |
153 | QWhatsThis::add( txtJobTitle, tr( "The jobtitle.." ) ); | 153 | QWhatsThis::add( txtJobTitle, tr( "The jobtitle.." ) ); |
154 | gl->addWidget( txtJobTitle, 1, 1 ); | 154 | gl->addWidget( txtJobTitle, 1, 1 ); |
155 | 155 | ||
156 | l = new QLabel( tr("Suffix"), container ); | 156 | l = new QLabel( tr("Suffix"), container ); |
157 | QWhatsThis::add( l, tr( "Something like \"jr.\".." ) ); | 157 | QWhatsThis::add( l, tr( "Something like \"jr.\".." ) ); |
158 | gl->addWidget( l, 2, 0 ); | 158 | gl->addWidget( l, 2, 0 ); |
159 | txtSuffix = new QLineEdit( container ); | 159 | txtSuffix = new QLineEdit( container ); |
160 | QWhatsThis::add( txtSuffix, tr( "Something like \"jr.\".." ) ); | 160 | QWhatsThis::add( txtSuffix, tr( "Something like \"jr.\".." ) ); |
161 | gl->addWidget( txtSuffix, 2, 1 ); | 161 | gl->addWidget( txtSuffix, 2, 1 ); |
162 | 162 | ||
163 | l = new QLabel( tr( "Organization" ), container ); | 163 | l = new QLabel( tr( "Organization" ), container ); |
164 | QWhatsThis::add( l, tr( "The working place of the contact" ) ); | 164 | QWhatsThis::add( l, tr( "The working place of the contact" ) ); |
165 | gl->addWidget( l, 3, 0 ); | 165 | gl->addWidget( l, 3, 0 ); |
166 | txtOrganization = new QLineEdit( container ); | 166 | txtOrganization = new QLineEdit( container ); |
167 | QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) ); | 167 | QWhatsThis::add( txtOrganization, tr( "The working place of the contact" ) ); |
168 | gl->addWidget( txtOrganization, 3, 1 ); | 168 | gl->addWidget( txtOrganization, 3, 1 ); |
169 | 169 | ||
170 | // Chooser 1 | 170 | // Chooser 1 |
171 | cmbChooserField1 = new QComboBox( FALSE, container ); | 171 | cmbChooserField1 = new QComboBox( FALSE, container ); |
172 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); | 172 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); |
173 | cmbChooserField1->setMaximumWidth( 90 ); | 173 | cmbChooserField1->setMaximumWidth( 90 ); |
174 | gl->addWidget( cmbChooserField1, 4, 0 ); | 174 | gl->addWidget( cmbChooserField1, 4, 0 ); |
175 | // Textfield for chooser 1. | 175 | // Textfield for chooser 1. |
176 | // Now use Widgetstack to contain the textfield and the default-email combo ! | 176 | // Now use Widgetstack to contain the textfield and the default-email combo ! |
177 | m_widgetStack1 = new QWidgetStack( container ); | 177 | m_widgetStack1 = new QWidgetStack( container ); |
178 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); | 178 | txtChooserField1 = new QLineEdit( m_widgetStack1 ); |
179 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); | 179 | m_widgetStack1 -> addWidget( txtChooserField1, TextField ); |
180 | gl->addWidget( m_widgetStack1, 4, 1 ); | 180 | gl->addWidget( m_widgetStack1, 4, 1 ); |
181 | m_widgetStack1 -> raiseWidget( TextField ); | 181 | m_widgetStack1 -> raiseWidget( TextField ); |
182 | 182 | ||
183 | // Chooser 2 | 183 | // Chooser 2 |
184 | cmbChooserField2 = new QComboBox( FALSE, container ); | 184 | cmbChooserField2 = new QComboBox( FALSE, container ); |
185 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); | 185 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); |
186 | cmbChooserField2->setMaximumWidth( 90 ); | 186 | cmbChooserField2->setMaximumWidth( 90 ); |
187 | gl->addWidget( cmbChooserField2, 5, 0 ); | 187 | gl->addWidget( cmbChooserField2, 5, 0 ); |
188 | // Textfield for chooser 2 | 188 | // Textfield for chooser 2 |
189 | // Now use WidgetStack to contain the textfield and the default-email combo! | 189 | // Now use WidgetStack to contain the textfield and the default-email combo! |
190 | m_widgetStack2 = new QWidgetStack( container ); | 190 | m_widgetStack2 = new QWidgetStack( container ); |
191 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); | 191 | txtChooserField2 = new QLineEdit( m_widgetStack2 ); |
192 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); | 192 | m_widgetStack2 -> addWidget( txtChooserField2, TextField ); |
193 | gl->addWidget( m_widgetStack2, 5, 1 ); | 193 | gl->addWidget( m_widgetStack2, 5, 1 ); |
194 | m_widgetStack2 -> raiseWidget( TextField ); | 194 | m_widgetStack2 -> raiseWidget( TextField ); |
195 | 195 | ||
196 | // Chooser 3 | 196 | // Chooser 3 |
197 | cmbChooserField3 = new QComboBox( FALSE, container ); | 197 | cmbChooserField3 = new QComboBox( FALSE, container ); |
198 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); | 198 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); |
199 | cmbChooserField3->setMaximumWidth( 90 ); | 199 | cmbChooserField3->setMaximumWidth( 90 ); |
200 | gl->addWidget( cmbChooserField3, 6, 0 ); | 200 | gl->addWidget( cmbChooserField3, 6, 0 ); |
201 | // Textfield for chooser 2 | 201 | // Textfield for chooser 2 |
202 | // Now use WidgetStack to contain the textfield and the default-email combo! | 202 | // Now use WidgetStack to contain the textfield and the default-email combo! |
203 | m_widgetStack3 = new QWidgetStack( container ); | 203 | m_widgetStack3 = new QWidgetStack( container ); |
204 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); | 204 | txtChooserField3 = new QLineEdit( m_widgetStack3 ); |
205 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); | 205 | m_widgetStack3 -> addWidget( txtChooserField3, TextField ); |
206 | gl->addWidget( m_widgetStack3, 6, 1 ); | 206 | gl->addWidget( m_widgetStack3, 6, 1 ); |
207 | m_widgetStack3 -> raiseWidget( TextField ); | 207 | m_widgetStack3 -> raiseWidget( TextField ); |
208 | 208 | ||
209 | l = new QLabel( tr( "File As" ), container ); | 209 | l = new QLabel( tr( "File As" ), container ); |
210 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); | 210 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); |
211 | gl->addWidget( l, 7, 0 ); | 211 | gl->addWidget( l, 7, 0 ); |
212 | cmbFileAs = new QComboBox( TRUE, container ); | 212 | cmbFileAs = new QComboBox( TRUE, container ); |
213 | gl->addWidget( cmbFileAs, 7, 1 ); | 213 | gl->addWidget( cmbFileAs, 7, 1 ); |
214 | 214 | ||
215 | labCat = new QLabel( tr( "Category" ), container ); | 215 | labCat = new QLabel( tr( "Category" ), container ); |
216 | gl->addWidget( labCat, 8, 0 ); | 216 | gl->addWidget( labCat, 8, 0 ); |
217 | cmbCat = new CategorySelect( container ); | 217 | cmbCat = new CategorySelect( container ); |
218 | gl->addWidget( cmbCat, 8, 1 ); | 218 | gl->addWidget( cmbCat, 8, 1 ); |
219 | labCat->show(); | 219 | labCat->show(); |
220 | cmbCat->show(); | 220 | cmbCat->show(); |
221 | 221 | ||
222 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 222 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
223 | gl->addWidget( btnNote, 9, 1 ); | 223 | gl->addWidget( btnNote, 9, 1 ); |
224 | 224 | ||
225 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 225 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
226 | 226 | ||
227 | tabViewport = new QWidget ( tabMain ); | 227 | tabViewport = new QWidget ( tabMain ); |
228 | 228 | ||
229 | vb = new QVBoxLayout( tabViewport ); | 229 | vb = new QVBoxLayout( tabViewport ); |
230 | 230 | ||
231 | svAddress = new QScrollView( tabViewport ); | 231 | svAddress = new QScrollView( tabViewport ); |
232 | vb->addWidget( svAddress, 0, 0 ); | 232 | vb->addWidget( svAddress, 0, 0 ); |
233 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 233 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
234 | svAddress->setFrameStyle( QFrame::NoFrame ); | 234 | svAddress->setFrameStyle( QFrame::NoFrame ); |
235 | 235 | ||
236 | container = new QWidget( svAddress->viewport() ); | 236 | container = new QWidget( svAddress->viewport() ); |
237 | svAddress->addChild( container ); | 237 | svAddress->addChild( container ); |
238 | 238 | ||
239 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 239 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
240 | 240 | ||
241 | cmbAddress = new QComboBox( FALSE, container ); | 241 | cmbAddress = new QComboBox( FALSE, container ); |
242 | cmbAddress->insertItem( tr( "Business" ) ); | 242 | cmbAddress->insertItem( tr( "Business" ) ); |
243 | cmbAddress->insertItem( tr( "Home" ) ); | 243 | cmbAddress->insertItem( tr( "Home" ) ); |
244 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 244 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
245 | 245 | ||
246 | l = new QLabel( tr( "Address" ), container ); | 246 | l = new QLabel( tr( "Address" ), container ); |
247 | gl->addWidget( l, 1, 0 ); | 247 | gl->addWidget( l, 1, 0 ); |
248 | txtAddress = new QLineEdit( container ); | 248 | txtAddress = new QLineEdit( container ); |
249 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 249 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
250 | 250 | ||
251 | l = new QLabel( tr( "City" ), container ); | 251 | l = new QLabel( tr( "City" ), container ); |
252 | gl->addWidget( l, 2, 0 ); | 252 | gl->addWidget( l, 2, 0 ); |
253 | txtCity = new QLineEdit( container ); | 253 | txtCity = new QLineEdit( container ); |
254 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 254 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
255 | 255 | ||
256 | l = new QLabel( tr( "State" ), container ); | 256 | l = new QLabel( tr( "State" ), container ); |
257 | gl->addWidget( l, 3, 0 ); | 257 | gl->addWidget( l, 3, 0 ); |
258 | txtState = new QLineEdit( container ); | 258 | txtState = new QLineEdit( container ); |
259 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 259 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
260 | 260 | ||
261 | l = new QLabel( tr( "Zip Code" ), container ); | 261 | l = new QLabel( tr( "Zip Code" ), container ); |
262 | gl->addWidget( l, 4, 0 ); | 262 | gl->addWidget( l, 4, 0 ); |
263 | txtZip = new QLineEdit( container ); | 263 | txtZip = new QLineEdit( container ); |
264 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 264 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
265 | 265 | ||
266 | l = new QLabel( tr( "Country" ), container ); | 266 | l = new QLabel( tr( "Country" ), container ); |
267 | gl->addWidget( l, 5, 0 ); | 267 | gl->addWidget( l, 5, 0 ); |
268 | cmbCountry = new QComboBox( TRUE, container ); | 268 | cmbCountry = new QComboBox( TRUE, container ); |
269 | cmbCountry->insertItem( tr( "" ) ); | 269 | cmbCountry->insertItem( "" ); |
270 | cmbCountry->insertItem( tr ( "United States" ) ); | 270 | cmbCountry->insertItem( tr ( "United States" ) ); |
271 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 271 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
272 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); | 272 | cmbCountry->insertItem( tr ( "Afghanistan" ) ); |
273 | cmbCountry->insertItem( tr ( "Albania" ) ); | 273 | cmbCountry->insertItem( tr ( "Albania" ) ); |
274 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 274 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
275 | cmbCountry->insertItem( tr ( "American Samoa" ) ); | 275 | cmbCountry->insertItem( tr ( "American Samoa" ) ); |
276 | cmbCountry->insertItem( tr ( "Andorra" ) ); | 276 | cmbCountry->insertItem( tr ( "Andorra" ) ); |
277 | cmbCountry->insertItem( tr ( "Angola" ) ); | 277 | cmbCountry->insertItem( tr ( "Angola" ) ); |
278 | cmbCountry->insertItem( tr ( "Anguilla" ) ); | 278 | cmbCountry->insertItem( tr ( "Anguilla" ) ); |
279 | cmbCountry->insertItem( tr ( "Antarctica" ) ); | 279 | cmbCountry->insertItem( tr ( "Antarctica" ) ); |
280 | cmbCountry->insertItem( tr ( "Argentina" ) ); | 280 | cmbCountry->insertItem( tr ( "Argentina" ) ); |
281 | cmbCountry->insertItem( tr ( "Armenia" ) ); | 281 | cmbCountry->insertItem( tr ( "Armenia" ) ); |
282 | cmbCountry->insertItem( tr ( "Aruba" ) ); | 282 | cmbCountry->insertItem( tr ( "Aruba" ) ); |
283 | cmbCountry->insertItem( tr ( "Australia" ) ); | 283 | cmbCountry->insertItem( tr ( "Australia" ) ); |
284 | cmbCountry->insertItem( tr ( "Austria" ) ); | 284 | cmbCountry->insertItem( tr ( "Austria" ) ); |
285 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); | 285 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); |
286 | cmbCountry->insertItem( tr ( "Bahamas" ) ); | 286 | cmbCountry->insertItem( tr ( "Bahamas" ) ); |
287 | cmbCountry->insertItem( tr ( "Bahrain" ) ); | 287 | cmbCountry->insertItem( tr ( "Bahrain" ) ); |
288 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); | 288 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); |
289 | cmbCountry->insertItem( tr ( "Barbados" ) ); | 289 | cmbCountry->insertItem( tr ( "Barbados" ) ); |
290 | cmbCountry->insertItem( tr ( "Belarus" ) ); | 290 | cmbCountry->insertItem( tr ( "Belarus" ) ); |
291 | cmbCountry->insertItem( tr ( "Belgium" ) ); | 291 | cmbCountry->insertItem( tr ( "Belgium" ) ); |
292 | cmbCountry->insertItem( tr ( "Belize" ) ); | 292 | cmbCountry->insertItem( tr ( "Belize" ) ); |
293 | cmbCountry->insertItem( tr ( "Benin" ) ); | 293 | cmbCountry->insertItem( tr ( "Benin" ) ); |
294 | cmbCountry->insertItem( tr ( "Bermuda" ) ); | 294 | cmbCountry->insertItem( tr ( "Bermuda" ) ); |
295 | cmbCountry->insertItem( tr ( "Bhutan" ) ); | 295 | cmbCountry->insertItem( tr ( "Bhutan" ) ); |
296 | cmbCountry->insertItem( tr ( "Bolivia" ) ); | 296 | cmbCountry->insertItem( tr ( "Bolivia" ) ); |
297 | cmbCountry->insertItem( tr ( "Botswana" ) ); | 297 | cmbCountry->insertItem( tr ( "Botswana" ) ); |
298 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); | 298 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); |
299 | cmbCountry->insertItem( tr ( "Brazil" ) ); | 299 | cmbCountry->insertItem( tr ( "Brazil" ) ); |
300 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); | 300 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); |
301 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); | 301 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); |
302 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); | 302 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); |
303 | cmbCountry->insertItem( tr ( "Burundi" ) ); | 303 | cmbCountry->insertItem( tr ( "Burundi" ) ); |
304 | cmbCountry->insertItem( tr ( "Cambodia" ) ); | 304 | cmbCountry->insertItem( tr ( "Cambodia" ) ); |
305 | cmbCountry->insertItem( tr ( "Cameroon" ) ); | 305 | cmbCountry->insertItem( tr ( "Cameroon" ) ); |
306 | cmbCountry->insertItem( tr ( "Canada" ) ); | 306 | cmbCountry->insertItem( tr ( "Canada" ) ); |
307 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); | 307 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); |
308 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); | 308 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); |
309 | cmbCountry->insertItem( tr ( "Chad" ) ); | 309 | cmbCountry->insertItem( tr ( "Chad" ) ); |
310 | cmbCountry->insertItem( tr ( "Chile" ) ); | 310 | cmbCountry->insertItem( tr ( "Chile" ) ); |
311 | cmbCountry->insertItem( tr ( "China" ) ); | 311 | cmbCountry->insertItem( tr ( "China" ) ); |
312 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); | 312 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); |
313 | cmbCountry->insertItem( tr ( "Colombia" ) ); | 313 | cmbCountry->insertItem( tr ( "Colombia" ) ); |
314 | cmbCountry->insertItem( tr ( "Comoros" ) ); | 314 | cmbCountry->insertItem( tr ( "Comoros" ) ); |
315 | cmbCountry->insertItem( tr ( "Congo" ) ); | 315 | cmbCountry->insertItem( tr ( "Congo" ) ); |
316 | cmbCountry->insertItem( tr ( "Cook Island" ) ); | 316 | cmbCountry->insertItem( tr ( "Cook Island" ) ); |
317 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); | 317 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); |
318 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); | 318 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); |
319 | cmbCountry->insertItem( tr ( "Croatia" ) ); | 319 | cmbCountry->insertItem( tr ( "Croatia" ) ); |
320 | cmbCountry->insertItem( tr ( "Cuba" ) ); | 320 | cmbCountry->insertItem( tr ( "Cuba" ) ); |
321 | cmbCountry->insertItem( tr ( "Cyprus" ) ); | 321 | cmbCountry->insertItem( tr ( "Cyprus" ) ); |
322 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); | 322 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); |
323 | cmbCountry->insertItem( tr ( "Denmark" ) ); | 323 | cmbCountry->insertItem( tr ( "Denmark" ) ); |
324 | cmbCountry->insertItem( tr ( "Djibouti" ) ); | 324 | cmbCountry->insertItem( tr ( "Djibouti" ) ); |
325 | cmbCountry->insertItem( tr ( "Dominica" ) ); | 325 | cmbCountry->insertItem( tr ( "Dominica" ) ); |
326 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); | 326 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); |
327 | cmbCountry->insertItem( tr ( "East Timor" ) ); | 327 | cmbCountry->insertItem( tr ( "East Timor" ) ); |
328 | cmbCountry->insertItem( tr ( "Ecuador" ) ); | 328 | cmbCountry->insertItem( tr ( "Ecuador" ) ); |
329 | cmbCountry->insertItem( tr ( "Egypt" ) ); | 329 | cmbCountry->insertItem( tr ( "Egypt" ) ); |
330 | cmbCountry->insertItem( tr ( "El Salvador" ) ); | 330 | cmbCountry->insertItem( tr ( "El Salvador" ) ); |
331 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); | 331 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); |
332 | cmbCountry->insertItem( tr ( "Eritrea" ) ); | 332 | cmbCountry->insertItem( tr ( "Eritrea" ) ); |
333 | cmbCountry->insertItem( tr ( "Estonia" ) ); | 333 | cmbCountry->insertItem( tr ( "Estonia" ) ); |
334 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); | 334 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); |
335 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); | 335 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); |
336 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); | 336 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); |
337 | cmbCountry->insertItem( tr ( "Fiji" ) ); | 337 | cmbCountry->insertItem( tr ( "Fiji" ) ); |
338 | cmbCountry->insertItem( tr ( "Finland" ) ); | 338 | cmbCountry->insertItem( tr ( "Finland" ) ); |
339 | cmbCountry->insertItem( tr ( "France" ) ); | 339 | cmbCountry->insertItem( tr ( "France" ) ); |
340 | cmbCountry->insertItem( tr ( "French Guiana" ) ); | 340 | cmbCountry->insertItem( tr ( "French Guiana" ) ); |
341 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); | 341 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); |
342 | cmbCountry->insertItem( tr ( "Gabon" ) ); | 342 | cmbCountry->insertItem( tr ( "Gabon" ) ); |
343 | cmbCountry->insertItem( tr ( "Gambia" ) ); | 343 | cmbCountry->insertItem( tr ( "Gambia" ) ); |
344 | cmbCountry->insertItem( tr ( "Georgia" ) ); | 344 | cmbCountry->insertItem( tr ( "Georgia" ) ); |
345 | cmbCountry->insertItem( tr ( "Germany" ) ); | 345 | cmbCountry->insertItem( tr ( "Germany" ) ); |
346 | cmbCountry->insertItem( tr ( "Ghana" ) ); | 346 | cmbCountry->insertItem( tr ( "Ghana" ) ); |
347 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); | 347 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); |
348 | cmbCountry->insertItem( tr ( "Greece" ) ); | 348 | cmbCountry->insertItem( tr ( "Greece" ) ); |
349 | cmbCountry->insertItem( tr ( "Greenland" ) ); | 349 | cmbCountry->insertItem( tr ( "Greenland" ) ); |
350 | cmbCountry->insertItem( tr ( "Grenada" ) ); | 350 | cmbCountry->insertItem( tr ( "Grenada" ) ); |
351 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); | 351 | cmbCountry->insertItem( tr ( "Guadeloupe" ) ); |
352 | cmbCountry->insertItem( tr ( "Guam" ) ); | 352 | cmbCountry->insertItem( tr ( "Guam" ) ); |
353 | cmbCountry->insertItem( tr ( "Guatemala" ) ); | 353 | cmbCountry->insertItem( tr ( "Guatemala" ) ); |
354 | cmbCountry->insertItem( tr ( "Guinea" ) ); | 354 | cmbCountry->insertItem( tr ( "Guinea" ) ); |
355 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); | 355 | cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); |
356 | cmbCountry->insertItem( tr ( "Guyana" ) ); | 356 | cmbCountry->insertItem( tr ( "Guyana" ) ); |
357 | cmbCountry->insertItem( tr ( "Haiti" ) ); | 357 | cmbCountry->insertItem( tr ( "Haiti" ) ); |
358 | cmbCountry->insertItem( tr ( "Holy See" ) ); | 358 | cmbCountry->insertItem( tr ( "Holy See" ) ); |
359 | cmbCountry->insertItem( tr ( "Honduras" ) ); | 359 | cmbCountry->insertItem( tr ( "Honduras" ) ); |
360 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); | 360 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); |
361 | cmbCountry->insertItem( tr ( "Hungary" ) ); | 361 | cmbCountry->insertItem( tr ( "Hungary" ) ); |
362 | cmbCountry->insertItem( tr ( "Iceland" ) ); | 362 | cmbCountry->insertItem( tr ( "Iceland" ) ); |
363 | cmbCountry->insertItem( tr ( "India" ) ); | 363 | cmbCountry->insertItem( tr ( "India" ) ); |
364 | cmbCountry->insertItem( tr ( "Indonesia" ) ); | 364 | cmbCountry->insertItem( tr ( "Indonesia" ) ); |
365 | cmbCountry->insertItem( tr ( "Ireland" ) ); | 365 | cmbCountry->insertItem( tr ( "Ireland" ) ); |
366 | cmbCountry->insertItem( tr ( "Israel" ) ); | 366 | cmbCountry->insertItem( tr ( "Israel" ) ); |
367 | cmbCountry->insertItem( tr ( "Italy" ) ); | 367 | cmbCountry->insertItem( tr ( "Italy" ) ); |
368 | cmbCountry->insertItem( tr ( "Jamaica" ) ); | 368 | cmbCountry->insertItem( tr ( "Jamaica" ) ); |
369 | cmbCountry->insertItem( tr ( "Japan" ) ); | 369 | cmbCountry->insertItem( tr ( "Japan" ) ); |
370 | cmbCountry->insertItem( tr ( "Jordan" ) ); | 370 | cmbCountry->insertItem( tr ( "Jordan" ) ); |
371 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); | 371 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); |
372 | cmbCountry->insertItem( tr ( "Kenya" ) ); | 372 | cmbCountry->insertItem( tr ( "Kenya" ) ); |
373 | cmbCountry->insertItem( tr ( "Kiribati" ) ); | 373 | cmbCountry->insertItem( tr ( "Kiribati" ) ); |
374 | cmbCountry->insertItem( tr ( "Korea" ) ); | 374 | cmbCountry->insertItem( tr ( "Korea" ) ); |
375 | cmbCountry->insertItem( tr ( "Kuwait" ) ); | 375 | cmbCountry->insertItem( tr ( "Kuwait" ) ); |
376 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); | 376 | cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); |
377 | cmbCountry->insertItem( tr ( "Laos" ) ); | 377 | cmbCountry->insertItem( tr ( "Laos" ) ); |
378 | cmbCountry->insertItem( tr ( "Latvia" ) ); | 378 | cmbCountry->insertItem( tr ( "Latvia" ) ); |
379 | cmbCountry->insertItem( tr ( "Lebanon" ) ); | 379 | cmbCountry->insertItem( tr ( "Lebanon" ) ); |
380 | cmbCountry->insertItem( tr ( "Lesotho" ) ); | 380 | cmbCountry->insertItem( tr ( "Lesotho" ) ); |
381 | cmbCountry->insertItem( tr ( "Liberia" ) ); | 381 | cmbCountry->insertItem( tr ( "Liberia" ) ); |
382 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); | 382 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); |
383 | cmbCountry->insertItem( tr ( "Lithuania" ) ); | 383 | cmbCountry->insertItem( tr ( "Lithuania" ) ); |
384 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); | 384 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); |
385 | cmbCountry->insertItem( tr ( "Macau" ) ); | 385 | cmbCountry->insertItem( tr ( "Macau" ) ); |
386 | cmbCountry->insertItem( tr ( "Macedonia" ) ); | 386 | cmbCountry->insertItem( tr ( "Macedonia" ) ); |
387 | cmbCountry->insertItem( tr ( "Madagascar" ) ); | 387 | cmbCountry->insertItem( tr ( "Madagascar" ) ); |
388 | cmbCountry->insertItem( tr ( "Malawi" ) ); | 388 | cmbCountry->insertItem( tr ( "Malawi" ) ); |
389 | cmbCountry->insertItem( tr ( "Malaysia" ) ); | 389 | cmbCountry->insertItem( tr ( "Malaysia" ) ); |
390 | cmbCountry->insertItem( tr ( "Maldives" ) ); | 390 | cmbCountry->insertItem( tr ( "Maldives" ) ); |
391 | cmbCountry->insertItem( tr ( "Mali" ) ); | 391 | cmbCountry->insertItem( tr ( "Mali" ) ); |
392 | cmbCountry->insertItem( tr ( "Malta" ) ); | 392 | cmbCountry->insertItem( tr ( "Malta" ) ); |
393 | cmbCountry->insertItem( tr ( "Martinique" ) ); | 393 | cmbCountry->insertItem( tr ( "Martinique" ) ); |
394 | cmbCountry->insertItem( tr ( "Mauritania" ) ); | 394 | cmbCountry->insertItem( tr ( "Mauritania" ) ); |
395 | cmbCountry->insertItem( tr ( "Mauritius" ) ); | 395 | cmbCountry->insertItem( tr ( "Mauritius" ) ); |
396 | cmbCountry->insertItem( tr ( "Mayotte" ) ); | 396 | cmbCountry->insertItem( tr ( "Mayotte" ) ); |
397 | cmbCountry->insertItem( tr ( "Mexico" ) ); | 397 | cmbCountry->insertItem( tr ( "Mexico" ) ); |
398 | cmbCountry->insertItem( tr ( "Micronesia" ) ); | 398 | cmbCountry->insertItem( tr ( "Micronesia" ) ); |
399 | cmbCountry->insertItem( tr ( "Moldova" ) ); | 399 | cmbCountry->insertItem( tr ( "Moldova" ) ); |
400 | cmbCountry->insertItem( tr ( "Monaco" ) ); | 400 | cmbCountry->insertItem( tr ( "Monaco" ) ); |
401 | cmbCountry->insertItem( tr ( "Mongolia" ) ); | 401 | cmbCountry->insertItem( tr ( "Mongolia" ) ); |
402 | cmbCountry->insertItem( tr ( "Montserrat" ) ); | 402 | cmbCountry->insertItem( tr ( "Montserrat" ) ); |
403 | cmbCountry->insertItem( tr ( "Morocco" ) ); | 403 | cmbCountry->insertItem( tr ( "Morocco" ) ); |
404 | cmbCountry->insertItem( tr ( "Mozambique" ) ); | 404 | cmbCountry->insertItem( tr ( "Mozambique" ) ); |
405 | cmbCountry->insertItem( tr ( "Myanmar" ) ); | 405 | cmbCountry->insertItem( tr ( "Myanmar" ) ); |
406 | cmbCountry->insertItem( tr ( "Namibia" ) ); | 406 | cmbCountry->insertItem( tr ( "Namibia" ) ); |
407 | cmbCountry->insertItem( tr ( "Nauru" ) ); | 407 | cmbCountry->insertItem( tr ( "Nauru" ) ); |
408 | cmbCountry->insertItem( tr ( "Nepal" ) ); | 408 | cmbCountry->insertItem( tr ( "Nepal" ) ); |
409 | cmbCountry->insertItem( tr ( "Netherlands" ) ); | 409 | cmbCountry->insertItem( tr ( "Netherlands" ) ); |
410 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); | 410 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); |
411 | cmbCountry->insertItem( tr ( "New Zealand" ) ); | 411 | cmbCountry->insertItem( tr ( "New Zealand" ) ); |
412 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); | 412 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); |
413 | cmbCountry->insertItem( tr ( "Niger" ) ); | 413 | cmbCountry->insertItem( tr ( "Niger" ) ); |
414 | cmbCountry->insertItem( tr ( "Nigeria" ) ); | 414 | cmbCountry->insertItem( tr ( "Nigeria" ) ); |
415 | cmbCountry->insertItem( tr ( "Niue" ) ); | 415 | cmbCountry->insertItem( tr ( "Niue" ) ); |
416 | cmbCountry->insertItem( tr ( "Norway" ) ); | 416 | cmbCountry->insertItem( tr ( "Norway" ) ); |
417 | cmbCountry->insertItem( tr ( "Oman" ) ); | 417 | cmbCountry->insertItem( tr ( "Oman" ) ); |
418 | cmbCountry->insertItem( tr ( "Pakistan" ) ); | 418 | cmbCountry->insertItem( tr ( "Pakistan" ) ); |
419 | cmbCountry->insertItem( tr ( "Palau" ) ); | 419 | cmbCountry->insertItem( tr ( "Palau" ) ); |
420 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); | 420 | cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); |
421 | cmbCountry->insertItem( tr ( "Panama" ) ); | 421 | cmbCountry->insertItem( tr ( "Panama" ) ); |
422 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); | 422 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); |
423 | cmbCountry->insertItem( tr ( "Paraguay" ) ); | 423 | cmbCountry->insertItem( tr ( "Paraguay" ) ); |
424 | cmbCountry->insertItem( tr ( "Peru" ) ); | 424 | cmbCountry->insertItem( tr ( "Peru" ) ); |
425 | cmbCountry->insertItem( tr ( "Philippines" ) ); | 425 | cmbCountry->insertItem( tr ( "Philippines" ) ); |
426 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); | 426 | cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); |
427 | cmbCountry->insertItem( tr ( "Poland" ) ); | 427 | cmbCountry->insertItem( tr ( "Poland" ) ); |
428 | cmbCountry->insertItem( tr ( "Portugal" ) ); | 428 | cmbCountry->insertItem( tr ( "Portugal" ) ); |
429 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); | 429 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); |
430 | cmbCountry->insertItem( tr ( "Qatar" ) ); | 430 | cmbCountry->insertItem( tr ( "Qatar" ) ); |
431 | cmbCountry->insertItem( tr ( "Reunion" ) ); | 431 | cmbCountry->insertItem( tr ( "Reunion" ) ); |
432 | cmbCountry->insertItem( tr ( "Romania" ) ); | 432 | cmbCountry->insertItem( tr ( "Romania" ) ); |
433 | cmbCountry->insertItem( tr ( "Russia" ) ); | 433 | cmbCountry->insertItem( tr ( "Russia" ) ); |
434 | cmbCountry->insertItem( tr ( "Rwanda" ) ); | 434 | cmbCountry->insertItem( tr ( "Rwanda" ) ); |
435 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); | 435 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); |
436 | cmbCountry->insertItem( tr ( "Samoa" ) ); | 436 | cmbCountry->insertItem( tr ( "Samoa" ) ); |
437 | cmbCountry->insertItem( tr ( "San Marino" ) ); | 437 | cmbCountry->insertItem( tr ( "San Marino" ) ); |
438 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); | 438 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); |
439 | cmbCountry->insertItem( tr ( "Senegal" ) ); | 439 | cmbCountry->insertItem( tr ( "Senegal" ) ); |
440 | cmbCountry->insertItem( tr ( "Seychelles" ) ); | 440 | cmbCountry->insertItem( tr ( "Seychelles" ) ); |
441 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); | 441 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); |
442 | cmbCountry->insertItem( tr ( "Singapore" ) ); | 442 | cmbCountry->insertItem( tr ( "Singapore" ) ); |
443 | cmbCountry->insertItem( tr ( "Slovakia" ) ); | 443 | cmbCountry->insertItem( tr ( "Slovakia" ) ); |
444 | cmbCountry->insertItem( tr ( "Slovenia" ) ); | 444 | cmbCountry->insertItem( tr ( "Slovenia" ) ); |
445 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); | 445 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); |
446 | cmbCountry->insertItem( tr ( "Somalia" ) ); | 446 | cmbCountry->insertItem( tr ( "Somalia" ) ); |
447 | cmbCountry->insertItem( tr ( "South Africa" ) ); | 447 | cmbCountry->insertItem( tr ( "South Africa" ) ); |
448 | cmbCountry->insertItem( tr ( "Spain" ) ); | 448 | cmbCountry->insertItem( tr ( "Spain" ) ); |
449 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); | 449 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); |
450 | cmbCountry->insertItem( tr ( "St. Helena" ) ); | 450 | cmbCountry->insertItem( tr ( "St. Helena" ) ); |
451 | cmbCountry->insertItem( tr ( "Sudan" ) ); | 451 | cmbCountry->insertItem( tr ( "Sudan" ) ); |
452 | cmbCountry->insertItem( tr ( "Suriname" ) ); | 452 | cmbCountry->insertItem( tr ( "Suriname" ) ); |
453 | cmbCountry->insertItem( tr ( "Swaziland" ) ); | 453 | cmbCountry->insertItem( tr ( "Swaziland" ) ); |
454 | cmbCountry->insertItem( tr ( "Sweden" ) ); | 454 | cmbCountry->insertItem( tr ( "Sweden" ) ); |
455 | cmbCountry->insertItem( tr ( "Switzerland" ) ); | 455 | cmbCountry->insertItem( tr ( "Switzerland" ) ); |
456 | cmbCountry->insertItem( tr ( "Taiwan" ) ); | 456 | cmbCountry->insertItem( tr ( "Taiwan" ) ); |
457 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); | 457 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); |
458 | cmbCountry->insertItem( tr ( "Tanzania" ) ); | 458 | cmbCountry->insertItem( tr ( "Tanzania" ) ); |
459 | cmbCountry->insertItem( tr ( "Thailand" ) ); | 459 | cmbCountry->insertItem( tr ( "Thailand" ) ); |
460 | cmbCountry->insertItem( tr ( "Togo" ) ); | 460 | cmbCountry->insertItem( tr ( "Togo" ) ); |
461 | cmbCountry->insertItem( tr ( "Tokelau" ) ); | 461 | cmbCountry->insertItem( tr ( "Tokelau" ) ); |
462 | cmbCountry->insertItem( tr ( "Tonga" ) ); | 462 | cmbCountry->insertItem( tr ( "Tonga" ) ); |
463 | cmbCountry->insertItem( tr ( "Tunisia" ) ); | 463 | cmbCountry->insertItem( tr ( "Tunisia" ) ); |
464 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 464 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
465 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 465 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
466 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 466 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
467 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 467 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
468 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 468 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
469 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 469 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
470 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 470 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
471 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 471 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
472 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 472 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
473 | cmbCountry->insertItem( tr ( "Vietnam" ) ); | 473 | cmbCountry->insertItem( tr ( "Vietnam" ) ); |
474 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 474 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
475 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 475 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
476 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 476 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
477 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 477 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
478 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 478 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
479 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 479 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
480 | if (cmbCountry->listBox()!=0) | 480 | if (cmbCountry->listBox()!=0) |
481 | cmbCountry->listBox()->sort(); | 481 | cmbCountry->listBox()->sort(); |
482 | 482 | ||
483 | cmbCountry->setMaximumWidth( 135 ); | 483 | cmbCountry->setMaximumWidth( 135 ); |
484 | 484 | ||
485 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 485 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
486 | 486 | ||
487 | // Chooser 4 | 487 | // Chooser 4 |
488 | cmbChooserField4 = new QComboBox( FALSE, container ); | 488 | cmbChooserField4 = new QComboBox( FALSE, container ); |
489 | cmbChooserField4->setMaximumWidth( 90 ); | 489 | cmbChooserField4->setMaximumWidth( 90 ); |
490 | gl->addWidget( cmbChooserField4, 6, 0 ); | 490 | gl->addWidget( cmbChooserField4, 6, 0 ); |
491 | // Textfield for chooser 2 | 491 | // Textfield for chooser 2 |
492 | // Now use WidgetStack to contain the textfield and the default-email combo! | 492 | // Now use WidgetStack to contain the textfield and the default-email combo! |
493 | m_widgetStack4 = new QWidgetStack( container ); | 493 | m_widgetStack4 = new QWidgetStack( container ); |
494 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); | 494 | txtChooserField4 = new QLineEdit( m_widgetStack4 ); |
495 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); | 495 | m_widgetStack4 -> addWidget( txtChooserField4, TextField ); |
496 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); | 496 | gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); |
497 | m_widgetStack4 -> raiseWidget( TextField ); | 497 | m_widgetStack4 -> raiseWidget( TextField ); |
498 | 498 | ||
499 | QSpacerItem *space = new QSpacerItem(1,1, | 499 | QSpacerItem *space = new QSpacerItem(1,1, |
500 | QSizePolicy::Maximum, | 500 | QSizePolicy::Maximum, |
501 | QSizePolicy::MinimumExpanding ); | 501 | QSizePolicy::MinimumExpanding ); |
502 | gl->addItem( space, 7, 0 ); | 502 | gl->addItem( space, 7, 0 ); |
503 | 503 | ||
504 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 504 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
505 | 505 | ||
506 | tabViewport = new QWidget ( tabMain ); | 506 | tabViewport = new QWidget ( tabMain ); |
507 | 507 | ||
508 | vb = new QVBoxLayout( tabViewport ); | 508 | vb = new QVBoxLayout( tabViewport ); |
509 | 509 | ||
510 | svDetails = new QScrollView( tabViewport ); | 510 | svDetails = new QScrollView( tabViewport ); |
511 | vb->addWidget( svDetails, 0, 0 ); | 511 | vb->addWidget( svDetails, 0, 0 ); |
512 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 512 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
513 | svDetails->setFrameStyle( QFrame::NoFrame ); | 513 | svDetails->setFrameStyle( QFrame::NoFrame ); |
514 | 514 | ||
515 | container = new QWidget( svDetails->viewport() ); | 515 | container = new QWidget( svDetails->viewport() ); |
516 | svDetails->addChild( container ); | 516 | svDetails->addChild( container ); |
517 | 517 | ||
518 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 518 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
519 | 519 | ||
520 | int counter = 0; | 520 | int counter = 0; |
521 | 521 | ||
522 | // Birthday | 522 | // Birthday |
523 | QHBox* hBox = new QHBox( container ); | 523 | QHBox* hBox = new QHBox( container ); |
524 | l = new QLabel( tr("Birthday"), container ); | 524 | l = new QLabel( tr("Birthday"), container ); |
525 | gl->addWidget( l, counter, 0 ); | 525 | gl->addWidget( l, counter, 0 ); |
526 | 526 | ||
527 | QPopupMenu* m1 = new QPopupMenu( container ); | 527 | QPopupMenu* m1 = new QPopupMenu( container ); |
528 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 528 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); |
529 | m1->insertItem( birthdayPicker ); | 529 | m1->insertItem( birthdayPicker ); |
530 | 530 | ||
531 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 531 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
532 | birthdayButton->setPopup( m1 ); | 532 | birthdayButton->setPopup( m1 ); |
533 | birthdayButton->setPopupDelay(0); | 533 | birthdayButton->setPopupDelay(0); |
534 | 534 | ||
535 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 535 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
536 | tr( "Delete" ), | 536 | tr( "Delete" ), |
537 | hBox, 0 ); | 537 | hBox, 0 ); |
538 | 538 | ||
539 | gl->addWidget( hBox, counter , 1 ); | 539 | gl->addWidget( hBox, counter , 1 ); |
540 | 540 | ||
541 | connect( birthdayPicker, SIGNAL( dateClicked(int,int,int) ), | 541 | connect( birthdayPicker, SIGNAL( dateClicked(int,int,int) ), |
542 | this, SLOT( slotBirthdayDateChanged(int,int,int) ) ); | 542 | this, SLOT( slotBirthdayDateChanged(int,int,int) ) ); |
543 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); | 543 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); |
544 | 544 | ||
545 | ++counter; | 545 | ++counter; |
546 | 546 | ||
547 | // Anniversary | 547 | // Anniversary |
548 | hBox = new QHBox( container ); | 548 | hBox = new QHBox( container ); |
549 | l = new QLabel( tr("Anniversary"), container ); | 549 | l = new QLabel( tr("Anniversary"), container ); |
550 | gl->addWidget( l, counter, 0 ); | 550 | gl->addWidget( l, counter, 0 ); |
551 | 551 | ||
552 | m1 = new QPopupMenu( container ); | 552 | m1 = new QPopupMenu( container ); |
553 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 553 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); |
554 | m1->insertItem( anniversaryPicker ); | 554 | m1->insertItem( anniversaryPicker ); |
555 | 555 | ||
556 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 556 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
557 | anniversaryButton->setPopup( m1 ); | 557 | anniversaryButton->setPopup( m1 ); |
558 | anniversaryButton->setPopupDelay(0); | 558 | anniversaryButton->setPopupDelay(0); |
559 | 559 | ||
560 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 560 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
561 | tr( "Delete" ), | 561 | tr( "Delete" ), |
562 | hBox, 0 ); | 562 | hBox, 0 ); |
563 | gl->addWidget( hBox, counter , 1 ); | 563 | gl->addWidget( hBox, counter , 1 ); |
564 | 564 | ||
565 | connect( anniversaryPicker, SIGNAL( dateClicked(int,int,int) ), | 565 | connect( anniversaryPicker, SIGNAL( dateClicked(int,int,int) ), |
566 | this, SLOT( slotAnniversaryDateChanged(int,int,int) ) ); | 566 | this, SLOT( slotAnniversaryDateChanged(int,int,int) ) ); |
567 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); | 567 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); |
568 | 568 | ||
569 | ++counter; | 569 | ++counter; |
570 | 570 | ||
571 | // Gender | 571 | // Gender |
572 | l = new QLabel( tr("Gender"), container ); | 572 | l = new QLabel( tr("Gender"), container ); |
573 | gl->addWidget( l, counter, 0 ); | 573 | gl->addWidget( l, counter, 0 ); |
574 | cmbGender = new QComboBox( container ); | 574 | cmbGender = new QComboBox( container ); |
575 | cmbGender->insertItem( "", 0 ); | 575 | cmbGender->insertItem( "", 0 ); |
576 | cmbGender->insertItem( tr("Male"), 1); | 576 | cmbGender->insertItem( tr("Male"), 1); |
577 | cmbGender->insertItem( tr("Female"), 2); | 577 | cmbGender->insertItem( tr("Female"), 2); |
578 | gl->addWidget( cmbGender, counter, 1 ); | 578 | gl->addWidget( cmbGender, counter, 1 ); |
579 | 579 | ||
580 | ++counter; | 580 | ++counter; |
581 | 581 | ||
582 | // Create Labels and lineedit fields for every dynamic entry | 582 | // Create Labels and lineedit fields for every dynamic entry |
583 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 583 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
584 | QMap<QString, int> mapStrToID = Opie::OPimContactFields::untrFieldsToId(); | 584 | QMap<QString, int> mapStrToID = Opie::OPimContactFields::untrFieldsToId(); |
585 | QMap<int, QString> mapIdToStr = Opie::OPimContactFields::idToTrFields(); | 585 | QMap<int, QString> mapIdToStr = Opie::OPimContactFields::idToTrFields(); |
586 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { | 586 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { |
587 | 587 | ||
588 | if (((*it) == "Anniversary") || | 588 | if (((*it) == "Anniversary") || |
589 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 589 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
590 | 590 | ||
591 | l = new QLabel( mapIdToStr[mapStrToID[*it]], container ); | 591 | l = new QLabel( mapIdToStr[mapStrToID[*it]], container ); |
592 | listName.append( l ); | 592 | listName.append( l ); |
593 | gl->addWidget( l, i, 0 ); | 593 | gl->addWidget( l, i, 0 ); |
594 | QLineEdit *e = new QLineEdit( container ); | 594 | QLineEdit *e = new QLineEdit( container ); |
595 | listValue.append( e ); | 595 | listValue.append( e ); |
596 | gl->addWidget( e, i, 1); | 596 | gl->addWidget( e, i, 1); |
597 | } | 597 | } |
598 | // Fill labels with names.. | 598 | // Fill labels with names.. |
599 | //loadFields(); | 599 | //loadFields(); |
600 | 600 | ||
601 | 601 | ||
602 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 602 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
603 | 603 | ||
604 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 604 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
605 | dlgNote->setCaption( tr("Enter Note") ); | 605 | dlgNote->setCaption( tr("Enter Note") ); |
606 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 606 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
607 | txtNote = new QMultiLineEdit( dlgNote ); | 607 | txtNote = new QMultiLineEdit( dlgNote ); |
608 | vbNote->addWidget( txtNote ); | 608 | vbNote->addWidget( txtNote ); |
609 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 609 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
610 | 610 | ||
611 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 611 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
612 | dlgName->setCaption( tr("Edit Name") ); | 612 | dlgName->setCaption( tr("Edit Name") ); |
613 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 613 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
614 | 614 | ||
615 | l = new QLabel( tr("First Name"), dlgName ); | 615 | l = new QLabel( tr("First Name"), dlgName ); |
616 | gl->addWidget( l, 0, 0 ); | 616 | gl->addWidget( l, 0, 0 ); |
617 | txtFirstName = new ABOOK::NameLineEdit( dlgName ); | 617 | txtFirstName = new ABOOK::NameLineEdit( dlgName ); |
618 | gl->addWidget( txtFirstName, 0, 1 ); | 618 | gl->addWidget( txtFirstName, 0, 1 ); |
619 | 619 | ||
620 | l = new QLabel( tr("Middle Name"), dlgName ); | 620 | l = new QLabel( tr("Middle Name"), dlgName ); |
621 | gl->addWidget( l, 1, 0 ); | 621 | gl->addWidget( l, 1, 0 ); |
622 | txtMiddleName = new ABOOK::NameLineEdit( dlgName ); | 622 | txtMiddleName = new ABOOK::NameLineEdit( dlgName ); |
623 | gl->addWidget( txtMiddleName, 1, 1 ); | 623 | gl->addWidget( txtMiddleName, 1, 1 ); |
624 | 624 | ||
625 | l = new QLabel( tr("Last Name"), dlgName ); | 625 | l = new QLabel( tr("Last Name"), dlgName ); |
626 | gl->addWidget( l, 2, 0 ); | 626 | gl->addWidget( l, 2, 0 ); |
627 | txtLastName = new ABOOK::NameLineEdit( dlgName ); | 627 | txtLastName = new ABOOK::NameLineEdit( dlgName ); |
628 | gl->addWidget( txtLastName, 2, 1 ); | 628 | gl->addWidget( txtLastName, 2, 1 ); |
629 | 629 | ||
630 | // l = new QLabel( tr("Suffix"), dlgName ); | 630 | // l = new QLabel( tr("Suffix"), dlgName ); |
631 | // gl->addWidget( l, 3, 0 ); | 631 | // gl->addWidget( l, 3, 0 ); |
632 | // txtSuffix = new QLineEdit( dlgName ); | 632 | // txtSuffix = new QLineEdit( dlgName ); |
633 | // gl->addWidget( txtSuffix, 3, 1 ); | 633 | // gl->addWidget( txtSuffix, 3, 1 ); |
634 | space = new QSpacerItem(1,1, | 634 | space = new QSpacerItem(1,1, |
635 | QSizePolicy::Maximum, | 635 | QSizePolicy::Maximum, |
636 | QSizePolicy::MinimumExpanding ); | 636 | QSizePolicy::MinimumExpanding ); |
637 | gl->addItem( space, 4, 0 ); | 637 | gl->addItem( space, 4, 0 ); |
638 | 638 | ||
639 | cmbChooserField1->insertStringList( trlChooserNames ); | 639 | cmbChooserField1->insertStringList( trlChooserNames ); |
640 | cmbChooserField2->insertStringList( trlChooserNames ); | 640 | cmbChooserField2->insertStringList( trlChooserNames ); |
641 | cmbChooserField3->insertStringList( trlChooserNames ); | 641 | cmbChooserField3->insertStringList( trlChooserNames ); |
642 | cmbChooserField4->insertStringList( trlChooserNames ); | 642 | cmbChooserField4->insertStringList( trlChooserNames ); |
643 | 643 | ||
644 | cmbChooserField1->setCurrentItem( 0 ); | 644 | cmbChooserField1->setCurrentItem( 0 ); |
645 | cmbChooserField2->setCurrentItem( 1 ); | 645 | cmbChooserField2->setCurrentItem( 1 ); |
646 | cmbChooserField3->setCurrentItem( 2 ); | 646 | cmbChooserField3->setCurrentItem( 2 ); |
647 | 647 | ||
648 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 648 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
649 | 649 | ||
650 | connect( txtFullName, SIGNAL(textChanged(const QString&)), | 650 | connect( txtFullName, SIGNAL(textChanged(const QString&)), |
651 | this, SLOT(slotFullNameChange(const QString&)) ); | 651 | this, SLOT(slotFullNameChange(const QString&)) ); |
652 | connect( txtSuffix, SIGNAL(textChanged(const QString&)), | 652 | connect( txtSuffix, SIGNAL(textChanged(const QString&)), |
653 | this, SLOT(slotSuffixChange(const QString&)) ); | 653 | this, SLOT(slotSuffixChange(const QString&)) ); |
654 | connect( txtOrganization, SIGNAL(textChanged(const QString&)), | 654 | connect( txtOrganization, SIGNAL(textChanged(const QString&)), |
655 | this, SLOT(slotOrganizationChange(const QString&)) ); | 655 | this, SLOT(slotOrganizationChange(const QString&)) ); |
656 | connect( txtChooserField1, SIGNAL(textChanged(const QString&)), | 656 | connect( txtChooserField1, SIGNAL(textChanged(const QString&)), |
657 | this, SLOT(slotChooser1Change(const QString&)) ); | 657 | this, SLOT(slotChooser1Change(const QString&)) ); |
658 | connect( txtChooserField2, SIGNAL(textChanged(const QString&)), | 658 | connect( txtChooserField2, SIGNAL(textChanged(const QString&)), |
659 | this, SLOT(slotChooser2Change(const QString&)) ); | 659 | this, SLOT(slotChooser2Change(const QString&)) ); |
660 | connect( txtChooserField3, SIGNAL(textChanged(const QString&)), | 660 | connect( txtChooserField3, SIGNAL(textChanged(const QString&)), |
661 | this, SLOT(slotChooser3Change(const QString&)) ); | 661 | this, SLOT(slotChooser3Change(const QString&)) ); |
662 | connect( txtChooserField4, SIGNAL(textChanged(const QString&)), | 662 | connect( txtChooserField4, SIGNAL(textChanged(const QString&)), |
663 | this, SLOT(slotChooser4Change(const QString&)) ); | 663 | this, SLOT(slotChooser4Change(const QString&)) ); |
664 | connect( txtAddress, SIGNAL(textChanged(const QString&)), | 664 | connect( txtAddress, SIGNAL(textChanged(const QString&)), |
665 | this, SLOT(slotAddressChange(const QString&)) ); | 665 | this, SLOT(slotAddressChange(const QString&)) ); |
666 | connect( txtCity, SIGNAL(textChanged(const QString&)), | 666 | connect( txtCity, SIGNAL(textChanged(const QString&)), |
667 | this, SLOT(slotCityChange(const QString&)) ); | 667 | this, SLOT(slotCityChange(const QString&)) ); |
668 | connect( txtState, SIGNAL(textChanged(const QString&)), | 668 | connect( txtState, SIGNAL(textChanged(const QString&)), |
669 | this, SLOT(slotStateChange(const QString&)) ); | 669 | this, SLOT(slotStateChange(const QString&)) ); |
670 | connect( txtZip, SIGNAL(textChanged(const QString&)), | 670 | connect( txtZip, SIGNAL(textChanged(const QString&)), |
671 | this, SLOT(slotZipChange(const QString&)) ); | 671 | this, SLOT(slotZipChange(const QString&)) ); |
672 | connect( cmbCountry, SIGNAL(textChanged(const QString&)), | 672 | connect( cmbCountry, SIGNAL(textChanged(const QString&)), |
673 | this, SLOT(slotCountryChange(const QString&)) ); | 673 | this, SLOT(slotCountryChange(const QString&)) ); |
674 | connect( cmbCountry, SIGNAL(activated(const QString&)), | 674 | connect( cmbCountry, SIGNAL(activated(const QString&)), |
675 | this, SLOT(slotCountryChange(const QString&)) ); | 675 | this, SLOT(slotCountryChange(const QString&)) ); |
676 | connect( cmbChooserField1, SIGNAL(activated(int)), | 676 | connect( cmbChooserField1, SIGNAL(activated(int)), |
677 | this, SLOT(slotCmbChooser1Change(int)) ); | 677 | this, SLOT(slotCmbChooser1Change(int)) ); |
678 | connect( cmbChooserField2, SIGNAL(activated(int)), | 678 | connect( cmbChooserField2, SIGNAL(activated(int)), |
679 | this, SLOT(slotCmbChooser2Change(int)) ); | 679 | this, SLOT(slotCmbChooser2Change(int)) ); |
680 | connect( cmbChooserField3, SIGNAL(activated(int)), | 680 | connect( cmbChooserField3, SIGNAL(activated(int)), |
681 | this, SLOT(slotCmbChooser3Change(int)) ); | 681 | this, SLOT(slotCmbChooser3Change(int)) ); |
682 | connect( cmbChooserField4, SIGNAL(activated(int)), | 682 | connect( cmbChooserField4, SIGNAL(activated(int)), |
683 | this, SLOT(slotCmbChooser4Change(int)) ); | 683 | this, SLOT(slotCmbChooser4Change(int)) ); |
684 | connect( cmbAddress, SIGNAL(activated(int)), | 684 | connect( cmbAddress, SIGNAL(activated(int)), |
685 | this, SLOT(slotAddressTypeChange(int)) ); | 685 | this, SLOT(slotAddressTypeChange(int)) ); |
686 | 686 | ||
687 | new QPEDialogListener(this); | 687 | new QPEDialogListener(this); |
688 | 688 | ||
689 | setPersonalView ( m_personalView ); | 689 | setPersonalView ( m_personalView ); |
690 | 690 | ||
691 | owarn << "init() END" << oendl; | 691 | owarn << "init() END" << oendl; |
692 | } | 692 | } |
693 | 693 | ||
694 | void ContactEditor::defaultEmailChanged(int i){ | 694 | void ContactEditor::defaultEmailChanged(int i){ |
695 | odebug << "defaultEmailChanged" << oendl; | 695 | odebug << "defaultEmailChanged" << oendl; |
696 | 696 | ||
697 | // was sollte das ? (se) | 697 | // was sollte das ? (se) |
698 | // int index = cmbChooserField1->currentItem(); | 698 | // int index = cmbChooserField1->currentItem(); |
699 | // slChooserValues[index] = cmbDefaultEmail->text(i); | 699 | // slChooserValues[index] = cmbDefaultEmail->text(i); |
700 | 700 | ||
701 | defaultEmail = cmbDefaultEmail->text(i); | 701 | defaultEmail = cmbDefaultEmail->text(i); |
702 | odebug << "Changed to: " << defaultEmail << oendl; | 702 | odebug << "Changed to: " << defaultEmail << oendl; |
703 | 703 | ||
704 | } | 704 | } |
705 | 705 | ||
706 | void ContactEditor::populateDefaultEmailCmb(){ | 706 | void ContactEditor::populateDefaultEmailCmb(){ |
707 | 707 | ||
708 | // if the default-email combo was not selected and therfore not created | 708 | // if the default-email combo was not selected and therfore not created |
709 | // we get a lot of trouble.. Therfore create an invisible one.. | 709 | // we get a lot of trouble.. Therfore create an invisible one.. |
710 | if ( !cmbDefaultEmail ){ | 710 | if ( !cmbDefaultEmail ){ |
711 | cmbDefaultEmail = new QComboBox(this); | 711 | cmbDefaultEmail = new QComboBox(this); |
712 | cmbDefaultEmail -> hide(); | 712 | cmbDefaultEmail -> hide(); |
713 | } | 713 | } |
714 | cmbDefaultEmail->clear(); | 714 | cmbDefaultEmail->clear(); |
715 | cmbDefaultEmail->insertStringList( emails ); | 715 | cmbDefaultEmail->insertStringList( emails ); |
716 | // cmbDefaultEmail->show(); | 716 | // cmbDefaultEmail->show(); |
717 | 717 | ||
718 | // Select default email in combo.. | 718 | // Select default email in combo.. |
719 | bool found = false; | 719 | bool found = false; |
720 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ | 720 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ |
721 | odebug << " populateDefaultEmailCmb text >" << cmbDefaultEmail->text( i ) | 721 | odebug << " populateDefaultEmailCmb text >" << cmbDefaultEmail->text( i ) |
722 | << "< defaultEmail >" << defaultEmail << "<" << oendl; | 722 | << "< defaultEmail >" << defaultEmail << "<" << oendl; |
723 | 723 | ||
724 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 724 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
725 | cmbDefaultEmail->setCurrentItem( i ); | 725 | cmbDefaultEmail->setCurrentItem( i ); |
726 | odebug << "set" << oendl; | 726 | odebug << "set" << oendl; |
727 | found = true; | 727 | found = true; |
728 | } | 728 | } |
729 | } | 729 | } |
730 | 730 | ||
731 | // If the current default email is not found in the list, we choose the | 731 | // If the current default email is not found in the list, we choose the |
732 | // first one.. | 732 | // first one.. |
733 | if ( !found ) | 733 | if ( !found ) |
734 | defaultEmail = cmbDefaultEmail->text(0); | 734 | defaultEmail = cmbDefaultEmail->text(0); |
735 | } | 735 | } |
736 | 736 | ||
737 | // Called when any combobox was changed. | 737 | // Called when any combobox was changed. |
738 | // "true" returned if the change was chandled by this function, else it should | 738 | // "true" returned if the change was chandled by this function, else it should |
739 | // be handled by something else.. | 739 | // be handled by something else.. |
740 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { | 740 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { |
741 | QString type = slChooserNames[index]; | 741 | QString type = slChooserNames[index]; |
742 | owarn << "ContactEditor::cmbChooserChange -> Type: " << type | 742 | owarn << "ContactEditor::cmbChooserChange -> Type: " << type |
743 | << ", WidgetPos: " << widgetPos << oendl; | 743 | << ", WidgetPos: " << widgetPos << oendl; |
744 | 744 | ||
745 | if ( !initializing ) | 745 | if ( !initializing ) |
746 | contactfields.setFieldOrder( widgetPos-1, index ); | 746 | contactfields.setFieldOrder( widgetPos-1, index ); |
747 | 747 | ||
748 | // Create and connect combobox for selecting the default email | 748 | // Create and connect combobox for selecting the default email |
749 | if ( type == "Default Email"){ | 749 | if ( type == "Default Email"){ |
750 | owarn << "Choosing default-email (defaultEmailChooserPosition= " | 750 | owarn << "Choosing default-email (defaultEmailChooserPosition= " |
751 | << defaultEmailChooserPosition << ") " << oendl; | 751 | << defaultEmailChooserPosition << ") " << oendl; |
752 | 752 | ||
753 | // More than one default-email chooser is not allowed ! | 753 | // More than one default-email chooser is not allowed ! |
754 | if ( ( defaultEmailChooserPosition != -1 ) && | 754 | if ( ( defaultEmailChooserPosition != -1 ) && |
755 | defaultEmailChooserPosition != widgetPos && !initializing){ | 755 | defaultEmailChooserPosition != widgetPos && !initializing){ |
756 | chooserError( widgetPos ); | 756 | chooserError( widgetPos ); |
757 | return true; | 757 | return true; |
758 | } | 758 | } |
759 | 759 | ||
760 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 760 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
761 | if ( cmbo ){ | 761 | if ( cmbo ){ |
762 | inputStack->raiseWidget( TextField ); | 762 | inputStack->raiseWidget( TextField ); |
763 | inputStack -> removeWidget( cmbo ); | 763 | inputStack -> removeWidget( cmbo ); |
764 | delete cmbo; | 764 | delete cmbo; |
765 | } | 765 | } |
766 | cmbo = new QComboBox( inputStack ); | 766 | cmbo = new QComboBox( inputStack ); |
767 | cmbo -> insertStringList( emails ); | 767 | cmbo -> insertStringList( emails ); |
768 | 768 | ||
769 | inputStack -> addWidget( cmbo, Combo ); | 769 | inputStack -> addWidget( cmbo, Combo ); |
770 | inputStack -> raiseWidget( Combo ); | 770 | inputStack -> raiseWidget( Combo ); |
771 | 771 | ||
772 | defaultEmailChooserPosition = widgetPos; | 772 | defaultEmailChooserPosition = widgetPos; |
773 | cmbDefaultEmail = cmbo; | 773 | cmbDefaultEmail = cmbo; |
774 | 774 | ||
775 | connect( cmbo,SIGNAL( activated(int) ), | 775 | connect( cmbo,SIGNAL( activated(int) ), |
776 | SLOT( defaultEmailChanged(int) ) ); | 776 | SLOT( defaultEmailChanged(int) ) ); |
777 | 777 | ||
778 | // Set current default email | 778 | // Set current default email |
779 | populateDefaultEmailCmb(); | 779 | populateDefaultEmailCmb(); |
780 | 780 | ||
781 | 781 | ||
782 | } else { | 782 | } else { |
783 | // Something else was selected: Hide combo.. | 783 | // Something else was selected: Hide combo.. |
784 | owarn << " Hiding default-email combo" << oendl; | 784 | owarn << " Hiding default-email combo" << oendl; |
785 | if ( defaultEmailChooserPosition == widgetPos ){ | 785 | if ( defaultEmailChooserPosition == widgetPos ){ |
786 | defaultEmailChooserPosition = -1; | 786 | defaultEmailChooserPosition = -1; |
787 | } | 787 | } |
788 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 788 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
789 | if ( cmbo ){ | 789 | if ( cmbo ){ |
790 | inputStack->raiseWidget( TextField ); | 790 | inputStack->raiseWidget( TextField ); |
791 | inputStack -> removeWidget( cmbo ); | 791 | inputStack -> removeWidget( cmbo ); |
792 | cmbDefaultEmail = 0l; | 792 | cmbDefaultEmail = 0l; |
793 | delete cmbo; | 793 | delete cmbo; |
794 | } | 794 | } |
795 | 795 | ||
796 | // Caller should initialize the responsible textfield, therefore | 796 | // Caller should initialize the responsible textfield, therefore |
797 | // "false" is returned | 797 | // "false" is returned |
798 | return false; | 798 | return false; |
799 | } | 799 | } |
800 | 800 | ||
801 | // Everything is worked off .. | 801 | // Everything is worked off .. |
802 | return true; | 802 | return true; |
803 | 803 | ||
804 | } | 804 | } |
805 | 805 | ||
806 | // Currently accessed when we select default-email more than once ! | 806 | // Currently accessed when we select default-email more than once ! |
807 | void ContactEditor::chooserError( int index ) | 807 | void ContactEditor::chooserError( int index ) |
808 | { | 808 | { |
809 | owarn << "ContactEditor::chooserError( " << index << " )" << oendl; | 809 | owarn << "ContactEditor::chooserError( " << index << " )" << oendl; |
810 | QMessageBox::warning( this, "Chooser Error", | 810 | QMessageBox::warning( this, "Chooser Error", |
811 | "Multiple selection of this\n" | 811 | "Multiple selection of this\n" |
812 | "Item is not allowed !\n\n" | 812 | "Item is not allowed !\n\n" |
813 | "First deselect the previous one !", | 813 | "First deselect the previous one !", |
814 | "&OK", 0, 0, | 814 | "&OK", 0, 0, |
815 | 0, 0 ); | 815 | 0, 0 ); |
816 | 816 | ||
817 | // Reset the selected Chooser. Unfortunately the chooser | 817 | // Reset the selected Chooser. Unfortunately the chooser |
818 | // generates no signal, therfore we have to | 818 | // generates no signal, therfore we have to |
819 | // call the cmbChooserChange function manually.. | 819 | // call the cmbChooserChange function manually.. |
820 | switch( index ){ | 820 | switch( index ){ |
821 | case 1: | 821 | case 1: |
822 | cmbChooserField1 -> setCurrentItem( 0 ); | 822 | cmbChooserField1 -> setCurrentItem( 0 ); |
823 | slotCmbChooser1Change( 0 ); | 823 | slotCmbChooser1Change( 0 ); |
824 | break; | 824 | break; |
825 | case 2: | 825 | case 2: |
826 | cmbChooserField2 -> setCurrentItem( 0 ); | 826 | cmbChooserField2 -> setCurrentItem( 0 ); |
827 | slotCmbChooser2Change( 0 ); | 827 | slotCmbChooser2Change( 0 ); |
828 | break; | 828 | break; |
829 | case 3: | 829 | case 3: |
830 | cmbChooserField3 -> setCurrentItem( 0 ); | 830 | cmbChooserField3 -> setCurrentItem( 0 ); |
831 | slotCmbChooser3Change( 0 ); | 831 | slotCmbChooser3Change( 0 ); |
832 | break; | 832 | break; |
833 | case 4: | 833 | case 4: |
834 | cmbChooserField4 -> setCurrentItem( 0 ); | 834 | cmbChooserField4 -> setCurrentItem( 0 ); |
835 | slotCmbChooser4Change( 0 ); | 835 | slotCmbChooser4Change( 0 ); |
836 | break; | 836 | break; |
837 | } | 837 | } |
838 | } | 838 | } |
839 | 839 | ||
840 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) | 840 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) |
841 | void ContactEditor::chooserChange( const QString &textChanged, int index, | 841 | void ContactEditor::chooserChange( const QString &textChanged, int index, |
842 | QLineEdit* , int widgetPos ) { | 842 | QLineEdit* , int widgetPos ) { |
843 | 843 | ||
844 | QString type = slChooserNames[index]; // :SX | 844 | QString type = slChooserNames[index]; // :SX |
845 | odebug << "ContactEditor::chooserChange( type=>" << type << "<, textChanged=>" | 845 | odebug << "ContactEditor::chooserChange( type=>" << type << "<, textChanged=>" |
846 | << textChanged << "< index=" << index << ", widgetPos=" << widgetPos | 846 | << textChanged << "< index=" << index << ", widgetPos=" << widgetPos |
847 | << " )" << oendl; | 847 | << " )" << oendl; |
848 | 848 | ||
849 | if ( type == "Default Email"){ | 849 | if ( type == "Default Email"){ |
850 | owarn << "??? Wozu??: " << textChanged << oendl; | 850 | owarn << "??? Wozu??: " << textChanged << oendl; |
851 | defaultEmail = textChanged; | 851 | defaultEmail = textChanged; |
852 | 852 | ||
853 | populateDefaultEmailCmb(); | 853 | populateDefaultEmailCmb(); |
854 | 854 | ||
855 | }else if (type == "Emails"){ | 855 | }else if (type == "Emails"){ |
856 | odebug << "emails" << oendl; | 856 | odebug << "emails" << oendl; |
857 | 857 | ||
858 | QString de; | 858 | QString de; |
859 | emails = QStringList::split (",", textChanged ); | 859 | emails = QStringList::split (",", textChanged ); |
860 | 860 | ||
861 | populateDefaultEmailCmb(); | 861 | populateDefaultEmailCmb(); |
862 | } | 862 | } |
863 | 863 | ||
864 | slChooserValues[index] = textChanged; | 864 | slChooserValues[index] = textChanged; |
865 | 865 | ||
866 | } | 866 | } |
867 | 867 | ||
868 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 868 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
869 | owarn << "ContactEditor::slotChooser1Change( " << textChanged << " )" << oendl; | 869 | owarn << "ContactEditor::slotChooser1Change( " << textChanged << " )" << oendl; |
870 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 870 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
871 | } | 871 | } |
872 | 872 | ||
873 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 873 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
874 | owarn << "ContactEditor::slotChooser2Change( " << textChanged << " )" << oendl; | 874 | owarn << "ContactEditor::slotChooser2Change( " << textChanged << " )" << oendl; |
875 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); | 875 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
876 | 876 | ||
877 | } | 877 | } |
878 | 878 | ||
879 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 879 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
880 | owarn << "ContactEditor::slotChooser3Change( " << textChanged << " )" << oendl; | 880 | owarn << "ContactEditor::slotChooser3Change( " << textChanged << " )" << oendl; |
881 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); | 881 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
882 | } | 882 | } |
883 | 883 | ||
884 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 884 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
885 | owarn << "ContactEditor::slotChooser4Change( " << textChanged << " )" << oendl; | 885 | owarn << "ContactEditor::slotChooser4Change( " << textChanged << " )" << oendl; |
886 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); | 886 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
887 | } | 887 | } |
888 | 888 | ||
889 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 889 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
890 | 890 | ||
891 | if ( cmbAddress->currentItem() == 0 ) { | 891 | if ( cmbAddress->currentItem() == 0 ) { |
892 | slBusinessAddress[0] = textChanged; | 892 | slBusinessAddress[0] = textChanged; |
893 | } else { | 893 | } else { |
894 | slHomeAddress[0] = textChanged; | 894 | slHomeAddress[0] = textChanged; |
895 | } | 895 | } |
896 | } | 896 | } |
897 | 897 | ||
898 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 898 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
899 | 899 | ||
900 | if ( cmbAddress->currentItem() == 0 ) { | 900 | if ( cmbAddress->currentItem() == 0 ) { |
901 | slBusinessAddress[1] = textChanged; | 901 | slBusinessAddress[1] = textChanged; |
902 | } else { | 902 | } else { |
903 | slHomeAddress[1] = textChanged; | 903 | slHomeAddress[1] = textChanged; |
904 | } | 904 | } |
905 | } | 905 | } |
906 | 906 | ||
907 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 907 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
908 | 908 | ||
909 | if ( cmbAddress->currentItem() == 0 ) { | 909 | if ( cmbAddress->currentItem() == 0 ) { |
910 | slBusinessAddress[2] = textChanged; | 910 | slBusinessAddress[2] = textChanged; |
911 | } else { | 911 | } else { |
912 | slHomeAddress[2] = textChanged; | 912 | slHomeAddress[2] = textChanged; |
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 916 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
917 | 917 | ||
918 | if ( cmbAddress->currentItem() == 0 ) { | 918 | if ( cmbAddress->currentItem() == 0 ) { |
919 | slBusinessAddress[3] = textChanged; | 919 | slBusinessAddress[3] = textChanged; |
920 | } else { | 920 | } else { |
921 | slHomeAddress[3] = textChanged; | 921 | slHomeAddress[3] = textChanged; |
922 | } | 922 | } |
923 | } | 923 | } |
924 | 924 | ||
925 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 925 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
926 | 926 | ||
927 | 927 | ||
928 | if ( cmbAddress->currentItem() == 0 ) { | 928 | if ( cmbAddress->currentItem() == 0 ) { |
929 | slBusinessAddress[4] = textChanged; | 929 | slBusinessAddress[4] = textChanged; |
930 | } else { | 930 | } else { |
931 | slHomeAddress[4] = textChanged; | 931 | slHomeAddress[4] = textChanged; |
932 | } | 932 | } |
933 | } | 933 | } |
934 | 934 | ||
935 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 935 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
936 | 936 | ||
937 | if ( cmbAddress->currentItem() == 0 ) { | 937 | if ( cmbAddress->currentItem() == 0 ) { |
938 | slBusinessAddress[5] = textChanged; | 938 | slBusinessAddress[5] = textChanged; |
939 | } else { | 939 | } else { |
940 | slHomeAddress[5] = textChanged; | 940 | slHomeAddress[5] = textChanged; |
941 | } | 941 | } |
942 | } | 942 | } |
943 | 943 | ||
944 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 944 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
945 | 945 | ||
946 | if ( cmbAddress->currentItem() == 0 ) { | 946 | if ( cmbAddress->currentItem() == 0 ) { |
947 | slBusinessAddress[6] = textChanged; | 947 | slBusinessAddress[6] = textChanged; |
948 | } else { | 948 | } else { |
949 | slHomeAddress[6] = textChanged; | 949 | slHomeAddress[6] = textChanged; |
950 | } | 950 | } |
951 | } | 951 | } |
952 | 952 | ||
953 | 953 | ||
954 | void ContactEditor::slotCmbChooser1Change( int index ) { | 954 | void ContactEditor::slotCmbChooser1Change( int index ) { |
955 | owarn << "ContactEditor::slotCmbChooser1Change( " << index << " )" << oendl; | 955 | owarn << "ContactEditor::slotCmbChooser1Change( " << index << " )" << oendl; |
956 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ | 956 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ |
957 | 957 | ||
958 | txtChooserField1->setText( slChooserValues[index] ); | 958 | txtChooserField1->setText( slChooserValues[index] ); |
959 | txtChooserField1->setFocus(); | 959 | txtChooserField1->setFocus(); |
960 | 960 | ||
961 | } | 961 | } |
962 | 962 | ||
963 | } | 963 | } |
964 | 964 | ||
965 | void ContactEditor::slotCmbChooser2Change( int index ) { | 965 | void ContactEditor::slotCmbChooser2Change( int index ) { |
966 | owarn << "ContactEditor::slotCmbChooser2Change( " << index << " )" << oendl; | 966 | owarn << "ContactEditor::slotCmbChooser2Change( " << index << " )" << oendl; |
967 | 967 | ||
968 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ | 968 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ |
969 | 969 | ||
970 | txtChooserField2->setText( slChooserValues[index] ); | 970 | txtChooserField2->setText( slChooserValues[index] ); |
971 | txtChooserField2->setFocus(); | 971 | txtChooserField2->setFocus(); |
972 | 972 | ||
973 | } | 973 | } |
974 | } | 974 | } |
975 | 975 | ||
976 | void ContactEditor::slotCmbChooser3Change( int index ) { | 976 | void ContactEditor::slotCmbChooser3Change( int index ) { |
977 | owarn << "ContactEditor::slotCmbChooser3Change( " << index << " )" << oendl; | 977 | owarn << "ContactEditor::slotCmbChooser3Change( " << index << " )" << oendl; |
978 | 978 | ||
979 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ | 979 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ |
980 | 980 | ||
981 | txtChooserField3->setText( slChooserValues[index] ); | 981 | txtChooserField3->setText( slChooserValues[index] ); |
982 | txtChooserField3->setFocus(); | 982 | txtChooserField3->setFocus(); |
983 | 983 | ||
984 | } | 984 | } |
985 | } | 985 | } |
986 | 986 | ||
987 | void ContactEditor::slotCmbChooser4Change( int index ) { | 987 | void ContactEditor::slotCmbChooser4Change( int index ) { |
988 | owarn << "ContactEditor::slotCmbChooser4Change( " << index << " )" << oendl; | 988 | owarn << "ContactEditor::slotCmbChooser4Change( " << index << " )" << oendl; |
989 | 989 | ||
990 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ | 990 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ |
991 | 991 | ||
992 | txtChooserField4->setText( slChooserValues[index] ); | 992 | txtChooserField4->setText( slChooserValues[index] ); |
993 | txtChooserField4->setFocus(); | 993 | txtChooserField4->setFocus(); |
994 | 994 | ||
995 | } | 995 | } |
996 | } | 996 | } |
997 | 997 | ||
998 | void ContactEditor::slotAddressTypeChange( int index ) { | 998 | void ContactEditor::slotAddressTypeChange( int index ) { |
999 | 999 | ||
1000 | 1000 | ||
1001 | if ( !initializing ) | 1001 | if ( !initializing ) |
1002 | contactfields.setFieldOrder( 4, index ); | 1002 | contactfields.setFieldOrder( 4, index ); |
1003 | 1003 | ||
1004 | 1004 | ||
1005 | if ( index == 0 ) { | 1005 | if ( index == 0 ) { |
1006 | 1006 | ||
1007 | txtAddress->setText( slBusinessAddress[0] ); | 1007 | txtAddress->setText( slBusinessAddress[0] ); |
1008 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 1008 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
1009 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 1009 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
1010 | txtCity->setText( slBusinessAddress[3] ); | 1010 | txtCity->setText( slBusinessAddress[3] ); |
1011 | txtState->setText( slBusinessAddress[4] ); | 1011 | txtState->setText( slBusinessAddress[4] ); |
1012 | txtZip->setText( slBusinessAddress[5] ); | 1012 | txtZip->setText( slBusinessAddress[5] ); |
1013 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1013 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1014 | txtTmp->setText( slBusinessAddress[6] ); | 1014 | txtTmp->setText( slBusinessAddress[6] ); |
1015 | 1015 | ||
1016 | } else { | 1016 | } else { |
1017 | 1017 | ||
1018 | txtAddress->setText( slHomeAddress[0] ); | 1018 | txtAddress->setText( slHomeAddress[0] ); |
1019 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 1019 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
1020 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 1020 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
1021 | txtCity->setText( slHomeAddress[3] ); | 1021 | txtCity->setText( slHomeAddress[3] ); |
1022 | txtState->setText( slHomeAddress[4] ); | 1022 | txtState->setText( slHomeAddress[4] ); |
1023 | txtZip->setText( slHomeAddress[5] ); | 1023 | txtZip->setText( slHomeAddress[5] ); |
1024 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1024 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1025 | txtTmp->setText( slHomeAddress[6] ); | 1025 | txtTmp->setText( slHomeAddress[6] ); |
1026 | 1026 | ||
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1031 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1032 | 1032 | ||
1033 | owarn << "ContactEditor::slotFullNameChange( " << textChanged << " )" << oendl; | 1033 | owarn << "ContactEditor::slotFullNameChange( " << textChanged << " )" << oendl; |
1034 | 1034 | ||
1035 | int index = cmbFileAs->currentItem(); | 1035 | int index = cmbFileAs->currentItem(); |
1036 | 1036 | ||
1037 | cmbFileAs->clear(); | 1037 | cmbFileAs->clear(); |
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 798e1f1..4589c9d 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -1,318 +1,318 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
11 | 11 | ||
12 | 12 | ||
13 | #include "olistview.h" | 13 | #include "olistview.h" |
14 | #include "olistviewitem.h" | 14 | #include "olistviewitem.h" |
15 | #include "resultitem.h" | 15 | #include "resultitem.h" |
16 | #include "adresssearch.h" | 16 | #include "adresssearch.h" |
17 | #include "todosearch.h" | 17 | #include "todosearch.h" |
18 | #include "datebooksearch.h" | 18 | #include "datebooksearch.h" |
19 | #include "applnksearch.h" | 19 | #include "applnksearch.h" |
20 | #include "doclnksearch.h" | 20 | #include "doclnksearch.h" |
21 | #include "mainwindow.h" | 21 | #include "mainwindow.h" |
22 | 22 | ||
23 | #include <opie2/odebug.h> | 23 | #include <opie2/odebug.h> |
24 | #include <opie2/owait.h> | 24 | #include <opie2/owait.h> |
25 | 25 | ||
26 | #include <qpe/qpemessagebox.h> | 26 | #include <qpe/qpemessagebox.h> |
27 | #include <qpe/resource.h> | 27 | #include <qpe/resource.h> |
28 | #include <qpe/config.h> | 28 | #include <qpe/config.h> |
29 | 29 | ||
30 | 30 | ||
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #include <qtoolbar.h> | 34 | #include <qtoolbar.h> |
35 | #include <qaction.h> | 35 | #include <qaction.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | #include <qstring.h> | 39 | #include <qstring.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qfile.h> | 41 | #include <qfile.h> |
42 | #include <qhbuttongroup.h> | 42 | #include <qhbuttongroup.h> |
43 | #include <qhbox.h> | 43 | #include <qhbox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qintdict.h> | 45 | #include <qintdict.h> |
46 | #include <qlayout.h> | 46 | #include <qlayout.h> |
47 | #include <qlineedit.h> | 47 | #include <qlineedit.h> |
48 | #include <qsignalmapper.h> | 48 | #include <qsignalmapper.h> |
49 | #include <qtextbrowser.h> | 49 | #include <qtextbrowser.h> |
50 | #include <qregexp.h> | 50 | #include <qregexp.h> |
51 | #include <qwhatsthis.h> | 51 | #include <qwhatsthis.h> |
52 | #include <qmenubar.h> | 52 | #include <qmenubar.h> |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | static const char* const image1_data[] = { | 56 | static const char* const image1_data[] = { |
57 | "14 14 3 1", | 57 | "14 14 3 1", |
58 | ". c None", | 58 | ". c None", |
59 | "# c #000000", | 59 | "# c #000000", |
60 | "a c #ff0000", | 60 | "a c #ff0000", |
61 | "..............", | 61 | "..............", |
62 | "..##.......###", | 62 | "..##.......###", |
63 | ".#aa#....##aa#", | 63 | ".#aa#....##aa#", |
64 | "#aaaa#.##aaaa#", | 64 | "#aaaa#.##aaaa#", |
65 | ".##aaa#aaaaa##", | 65 | ".##aaa#aaaaa##", |
66 | "...#aaaaaaa#..", | 66 | "...#aaaaaaa#..", |
67 | "....#aaaaa#...", | 67 | "....#aaaaa#...", |
68 | "...#aaaaa#....", | 68 | "...#aaaaa#....", |
69 | "..#aaaaaaa#...", | 69 | "..#aaaaaaa#...", |
70 | ".#aaaaaaaaa#..", | 70 | ".#aaaaaaaaa#..", |
71 | "#aaaa###aaaa#.", | 71 | "#aaaa###aaaa#.", |
72 | "#aaa#..##aaa#.", | 72 | "#aaa#..##aaa#.", |
73 | "#aaa#...#aa#..", | 73 | "#aaa#...#aa#..", |
74 | ".###.....##..."}; | 74 | ".###.....##..."}; |
75 | 75 | ||
76 | 76 | ||
77 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 77 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
78 | QMainWindow( parent, name, f ), _currentItem(0) | 78 | QMainWindow( parent, name, f ), _currentItem(0) |
79 | { | 79 | { |
80 | setCaption( tr("OSearch") ); | 80 | setCaption( tr("OSearch") ); |
81 | 81 | ||
82 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 82 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
83 | 83 | ||
84 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); | 84 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); |
85 | mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 85 | mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
86 | 86 | ||
87 | mainLayout = new QVBoxLayout( mainFrame ); | 87 | mainLayout = new QVBoxLayout( mainFrame ); |
88 | mainLayout->setSpacing( 0 ); | 88 | mainLayout->setSpacing( 0 ); |
89 | mainLayout->setMargin( 3 ); | 89 | mainLayout->setMargin( 3 ); |
90 | 90 | ||
91 | resultsList = new OListView( mainFrame ); | 91 | resultsList = new OListView( mainFrame ); |
92 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 92 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
93 | mainLayout->addWidget( resultsList ); | 93 | mainLayout->addWidget( resultsList ); |
94 | 94 | ||
95 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); | 95 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); |
96 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); | 96 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); |
97 | richEdit = new QTextView( detailsFrame ); | 97 | richEdit = new QTextView( detailsFrame ); |
98 | QWhatsThis::add( richEdit, tr("The details of the current result") ); | 98 | QWhatsThis::add( richEdit, tr("The details of the current result") ); |
99 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 99 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
100 | detailsLayout->addWidget( richEdit ); | 100 | detailsLayout->addWidget( richEdit ); |
101 | 101 | ||
102 | buttonBox = new QHBox( mainFrame, "Button Box" ); | 102 | buttonBox = new QHBox( mainFrame, "Button Box" ); |
103 | 103 | ||
104 | _buttonCount = 0; | 104 | _buttonCount = 0; |
105 | 105 | ||
106 | mainLayout->addWidget( detailsFrame ); | 106 | mainLayout->addWidget( detailsFrame ); |
107 | mainLayout->addWidget( buttonBox ); | 107 | mainLayout->addWidget( buttonBox ); |
108 | detailsFrame->hide(); | 108 | detailsFrame->hide(); |
109 | buttonBox->hide(); | 109 | buttonBox->hide(); |
110 | 110 | ||
111 | searches.append( new AppLnkSearch( resultsList, tr("Applications") ) ); | 111 | searches.append( new AppLnkSearch( resultsList, tr("Applications") ) ); |
112 | searches.append( new DocLnkSearch( resultsList, tr("Documents") ) ); | 112 | searches.append( new DocLnkSearch( resultsList, tr("Documents") ) ); |
113 | searches.append( new TodoSearch( resultsList, tr("Todo List") ) ); | 113 | searches.append( new TodoSearch( resultsList, tr("Todo List") ) ); |
114 | searches.append( new DatebookSearch( resultsList, tr("Calendar") ) ); | 114 | searches.append( new DatebookSearch( resultsList, tr("Calendar") ) ); |
115 | searches.append( new AdressSearch( resultsList, tr("Contacts") ) ); | 115 | searches.append( new AdressSearch( resultsList, tr("Contacts") ) ); |
116 | 116 | ||
117 | setCentralWidget( mainFrame ); | 117 | setCentralWidget( mainFrame ); |
118 | 118 | ||
119 | popupTimer = new QTimer(); | 119 | popupTimer = new QTimer(); |
120 | searchTimer = new QTimer(); | 120 | searchTimer = new QTimer(); |
121 | 121 | ||
122 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); | 122 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); |
123 | connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged())); | 123 | connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged())); |
124 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); | 124 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); |
125 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); | 125 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); |
126 | 126 | ||
127 | signalMapper = new QSignalMapper( this ); | 127 | signalMapper = new QSignalMapper( this ); |
128 | 128 | ||
129 | connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); | 129 | connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); |
130 | 130 | ||
131 | makeMenu(); | 131 | makeMenu(); |
132 | 132 | ||
133 | Config cfg( "osearch", Config::User ); | 133 | Config cfg( "osearch", Config::User ); |
134 | cfg.setGroup( "search_settings" ); | 134 | cfg.setGroup( "search_settings" ); |
135 | actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) ); | 135 | actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) ); |
136 | actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); | 136 | actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); |
137 | // actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) ); | 137 | // actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) ); |
138 | } | 138 | } |
139 | 139 | ||
140 | void MainWindow::makeMenu() | 140 | void MainWindow::makeMenu() |
141 | { | 141 | { |
142 | QToolBar *toolBar = new QToolBar( this ); | 142 | QToolBar *toolBar = new QToolBar( this ); |
143 | QToolBar *searchBar = new QToolBar(this); | 143 | QToolBar *searchBar = new QToolBar(this); |
144 | QMenuBar *menuBar = new QMenuBar( toolBar ); | 144 | QMenuBar *menuBar = new QMenuBar( toolBar ); |
145 | QPopupMenu *searchMenu = new QPopupMenu( menuBar ); | 145 | QPopupMenu *searchMenu = new QPopupMenu( menuBar ); |
146 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 146 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
147 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 147 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
148 | QPopupMenu *searchOptions = new QPopupMenu( cfgMenu ); | 148 | QPopupMenu *searchOptions = new QPopupMenu( cfgMenu ); |
149 | 149 | ||
150 | setToolBarsMovable( false ); | 150 | setToolBarsMovable( false ); |
151 | toolBar->setHorizontalStretchable( true ); | 151 | toolBar->setHorizontalStretchable( true ); |
152 | menuBar->insertItem( tr( "Search" ), searchMenu ); | 152 | menuBar->insertItem( tr( "Search" ), searchMenu ); |
153 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 153 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
154 | 154 | ||
155 | //SETTINGS MENU | 155 | //SETTINGS MENU |
156 | cfgMenu->insertItem( tr( "Search" ), searchOptions ); | 156 | cfgMenu->insertItem( tr( "Search" ), searchOptions ); |
157 | QPopupMenu *pop; | 157 | QPopupMenu *pop; |
158 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 158 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
159 | pop = s->popupMenu(); | 159 | pop = s->popupMenu(); |
160 | if (pop){ | 160 | if (pop){ |
161 | cfgMenu->insertItem( s->text(0), pop ); | 161 | cfgMenu->insertItem( s->text(0), pop ); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | //SEARCH | 166 | //SEARCH |
167 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); | 167 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
168 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); | 168 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); |
169 | // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); | 169 | // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); |
170 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); | 170 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); |
171 | SearchAllAction->addTo( searchMenu ); | 171 | SearchAllAction->addTo( searchMenu ); |
172 | searchMenu->insertItem( tr( "Options" ), searchOptions ); | 172 | searchMenu->insertItem( tr( "Options" ), searchOptions ); |
173 | 173 | ||
174 | //SEARCH OPTIONS | 174 | //SEARCH OPTIONS |
175 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); | 175 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); |
176 | //actionWholeWordsOnly->addTo( searchOptions ); | 176 | //actionWholeWordsOnly->addTo( searchOptions ); |
177 | actionCaseSensitiv = new QAction( tr("Case sensitive"),QString::null, 0, this, 0, true ); | 177 | actionCaseSensitiv = new QAction( tr("Case sensitive"),QString::null, 0, this, 0, true ); |
178 | actionCaseSensitiv->addTo( searchOptions ); | 178 | actionCaseSensitiv->addTo( searchOptions ); |
179 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 179 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
180 | actionWildcards->addTo( searchOptions ); | 180 | actionWildcards->addTo( searchOptions ); |
181 | 181 | ||
182 | //SEARCH BAR | 182 | //SEARCH BAR |
183 | LabelEnterText = new QLabel( searchBar, "Label" ); | 183 | LabelEnterText = new QLabel( searchBar, "Label" ); |
184 | LabelEnterText->setAutoMask( FALSE ); | 184 | LabelEnterText->setAutoMask( FALSE ); |
185 | LabelEnterText->setText( tr( "Search for: " ) ); | 185 | LabelEnterText->setText( tr( "Search for: " ) ); |
186 | 186 | ||
187 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 187 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
188 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 188 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
189 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); | 189 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); |
190 | searchEdit->setFocus(); | 190 | searchEdit->setFocus(); |
191 | searchBar->setHorizontalStretchable( TRUE ); | 191 | searchBar->setHorizontalStretchable( TRUE ); |
192 | searchBar->setStretchableWidget( searchEdit ); | 192 | searchBar->setStretchableWidget( searchEdit ); |
193 | 193 | ||
194 | //Search button | 194 | //Search button |
195 | SearchAllAction->addTo( searchBar ); | 195 | SearchAllAction->addTo( searchBar ); |
196 | 196 | ||
197 | //image ripped of off opie-login/loginwindow.cpp | 197 | //image ripped of off opie-login/loginwindow.cpp |
198 | QPixmap image1( ( const char** ) image1_data ); | 198 | QPixmap image1( ( const char** ) image1_data ); |
199 | 199 | ||
200 | //Clear text | 200 | //Clear text |
201 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); | 201 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); |
202 | ClearSearchText->setText( tr( "" ) ); | 202 | ClearSearchText->setText( "" ); |
203 | ClearSearchText->setPixmap( image1 ); | 203 | ClearSearchText->setPixmap( image1 ); |
204 | 204 | ||
205 | connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) ); | 205 | connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) ); |
206 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); | 206 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); |
207 | 207 | ||
208 | } | 208 | } |
209 | 209 | ||
210 | MainWindow::~MainWindow() | 210 | MainWindow::~MainWindow() |
211 | { | 211 | { |
212 | Config cfg( "osearch", Config::User ); | 212 | Config cfg( "osearch", Config::User ); |
213 | cfg.setGroup( "search_settings" ); | 213 | cfg.setGroup( "search_settings" ); |
214 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); | 214 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); |
215 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); | 215 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); |
216 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); | 216 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); |
217 | } | 217 | } |
218 | 218 | ||
219 | void MainWindow::setCurrent(QListViewItem *item) | 219 | void MainWindow::setCurrent(QListViewItem *item) |
220 | { | 220 | { |
221 | if (!item) return; | 221 | if (!item) return; |
222 | _currentItem = (OListViewItem*)item; | 222 | _currentItem = (OListViewItem*)item; |
223 | //_currentItem = dynamic_cast<OListViewItem*>(item); | 223 | //_currentItem = dynamic_cast<OListViewItem*>(item); |
224 | if (_currentItem->rtti() == OListViewItem::Result){ | 224 | if (_currentItem->rtti() == OListViewItem::Result){ |
225 | ResultItem *res = (ResultItem*)item; | 225 | ResultItem *res = (ResultItem*)item; |
226 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 226 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
227 | richEdit->setText( res->toRichText() ); | 227 | richEdit->setText( res->toRichText() ); |
228 | QIntDict<QString> acts = res->actions(); | 228 | QIntDict<QString> acts = res->actions(); |
229 | QButton *button; | 229 | QButton *button; |
230 | for (uint i = 0; i < acts.count(); i++){ | 230 | for (uint i = 0; i < acts.count(); i++){ |
231 | button = buttonMap[i]; | 231 | button = buttonMap[i]; |
232 | if (!button) { | 232 | if (!button) { |
233 | owarn << " no button for " << *acts[i] << oendl; | 233 | owarn << " no button for " << *acts[i] << oendl; |
234 | button = new QPushButton( buttonBox ); | 234 | button = new QPushButton( buttonBox ); |
235 | buttonMap.insert( i, button ); | 235 | buttonMap.insert( i, button ); |
236 | signalMapper->setMapping(button, i ); | 236 | signalMapper->setMapping(button, i ); |
237 | connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); | 237 | connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); |
238 | } | 238 | } |
239 | button->setText( *acts[i] ); | 239 | button->setText( *acts[i] ); |
240 | button->show(); | 240 | button->show(); |
241 | } | 241 | } |
242 | for (uint i = acts.count(); i < _buttonCount; i++){ | 242 | for (uint i = acts.count(); i < _buttonCount; i++){ |
243 | button = buttonMap[i]; | 243 | button = buttonMap[i]; |
244 | if (button) button->hide(); | 244 | if (button) button->hide(); |
245 | } | 245 | } |
246 | _buttonCount = acts.count(); | 246 | _buttonCount = acts.count(); |
247 | detailsFrame->show(); | 247 | detailsFrame->show(); |
248 | buttonBox->show(); | 248 | buttonBox->show(); |
249 | 249 | ||
250 | }else { | 250 | }else { |
251 | detailsFrame->hide(); | 251 | detailsFrame->hide(); |
252 | buttonBox->hide(); | 252 | buttonBox->hide(); |
253 | } | 253 | } |
254 | popupTimer->start( 300, true ); | 254 | popupTimer->start( 300, true ); |
255 | } | 255 | } |
256 | 256 | ||
257 | void MainWindow::stopTimer(QListViewItem*) | 257 | void MainWindow::stopTimer(QListViewItem*) |
258 | { | 258 | { |
259 | popupTimer->stop(); | 259 | popupTimer->stop(); |
260 | } | 260 | } |
261 | 261 | ||
262 | void MainWindow::showPopup() | 262 | void MainWindow::showPopup() |
263 | { | 263 | { |
264 | popupTimer->stop(); | 264 | popupTimer->stop(); |
265 | if (!_currentItem) return; | 265 | if (!_currentItem) return; |
266 | QPopupMenu *pop = _currentItem->popupMenu(); | 266 | QPopupMenu *pop = _currentItem->popupMenu(); |
267 | if (pop) pop->popup( QCursor::pos() ); | 267 | if (pop) pop->popup( QCursor::pos() ); |
268 | } | 268 | } |
269 | 269 | ||
270 | void MainWindow::setSearch( const QString &key ) | 270 | void MainWindow::setSearch( const QString &key ) |
271 | { | 271 | { |
272 | searchTimer->stop(); | 272 | searchTimer->stop(); |
273 | _searchString = key; | 273 | _searchString = key; |
274 | searchTimer->start( 300 ); | 274 | searchTimer->start( 300 ); |
275 | } | 275 | } |
276 | 276 | ||
277 | void MainWindow::searchStringChanged() | 277 | void MainWindow::searchStringChanged() |
278 | { | 278 | { |
279 | #ifdef NEW_OWAIT | 279 | #ifdef NEW_OWAIT |
280 | OWait("setting search string"); | 280 | OWait("setting search string"); |
281 | #endif | 281 | #endif |
282 | searchTimer->stop(); | 282 | searchTimer->stop(); |
283 | QString ss = _searchString; | 283 | QString ss = _searchString; |
284 | //ss = Global::stringQuote( _searchString ); | 284 | //ss = Global::stringQuote( _searchString ); |
285 | //if (actionWholeWordsOnly->isOn()) | 285 | //if (actionWholeWordsOnly->isOn()) |
286 | // ss = "\\s"+_searchString+"\\s"; | 286 | // ss = "\\s"+_searchString+"\\s"; |
287 | //Opie:Core::odebug << " set searchString >" << ss << "<" << oendl; | 287 | //Opie:Core::odebug << " set searchString >" << ss << "<" << oendl; |
288 | QRegExp re( ss ); | 288 | QRegExp re( ss ); |
289 | re.setCaseSensitive( actionCaseSensitiv->isOn() ); | 289 | re.setCaseSensitive( actionCaseSensitiv->isOn() ); |
290 | re.setWildcard( actionWildcards->isOn() ); | 290 | re.setWildcard( actionWildcards->isOn() ); |
291 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) | 291 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) |
292 | s->setSearch( re ); | 292 | s->setSearch( re ); |
293 | } | 293 | } |
294 | 294 | ||
295 | void MainWindow::searchAll() | 295 | void MainWindow::searchAll() |
296 | { | 296 | { |
297 | #ifdef NEW_OWAIT | 297 | #ifdef NEW_OWAIT |
298 | OWait("searching..."); | 298 | OWait("searching..."); |
299 | #endif | 299 | #endif |
300 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 300 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
301 | s->doSearch(); | 301 | s->doSearch(); |
302 | //resultsList->repaint(); | 302 | //resultsList->repaint(); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | void MainWindow::slotAction( int act ) | 306 | void MainWindow::slotAction( int act ) |
307 | { | 307 | { |
308 | if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){ | 308 | if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){ |
309 | ResultItem *res = (ResultItem*)_currentItem; | 309 | ResultItem *res = (ResultItem*)_currentItem; |
310 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 310 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
311 | res->action(act); | 311 | res->action(act); |
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | void MainWindow::optionChanged(int ) | 315 | void MainWindow::optionChanged(int ) |
316 | { | 316 | { |
317 | searchStringChanged(); | 317 | searchStringChanged(); |
318 | } | 318 | } |
diff --git a/core/settings/citytime/citytimebase.cpp b/core/settings/citytime/citytimebase.cpp index 77cb91d..bcdd422 100644 --- a/core/settings/citytime/citytimebase.cpp +++ b/core/settings/citytime/citytimebase.cpp | |||
@@ -1,415 +1,415 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | // changes by Maximilian Reiss <harlekin@handhelds.org> | 3 | // changes by Maximilian Reiss <harlekin@handhelds.org> |
4 | 4 | ||
5 | #include "citytimebase.h" | 5 | #include "citytimebase.h" |
6 | #include "zonemap.h" | 6 | #include "zonemap.h" |
7 | 7 | ||
8 | /* OPIE */ | 8 | /* OPIE */ |
9 | #include <opie2/odebug.h> | 9 | #include <opie2/odebug.h> |
10 | 10 | ||
11 | /* QT */ | 11 | /* QT */ |
12 | #include <qlabel.h> | 12 | #include <qlabel.h> |
13 | #include <qtoolbutton.h> | 13 | #include <qtoolbutton.h> |
14 | #include <qlayout.h> | 14 | #include <qlayout.h> |
15 | #include <qwhatsthis.h> | 15 | #include <qwhatsthis.h> |
16 | 16 | ||
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Constructs a CityTimeBase which is a child of 'parent', with the | 19 | * Constructs a CityTimeBase which is a child of 'parent', with the |
20 | * name 'name' and widget flags set to 'f' | 20 | * name 'name' and widget flags set to 'f' |
21 | */ | 21 | */ |
22 | CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags ) | 22 | CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags ) |
23 | : QWidget( parent, name, WStyle_ContextHelp ) | 23 | : QWidget( parent, name, WStyle_ContextHelp ) |
24 | { | 24 | { |
25 | if ( !name ) | 25 | if ( !name ) |
26 | setName( "CityTimeBase" ); | 26 | setName( "CityTimeBase" ); |
27 | setCaption( tr( "City Time" ) ); | 27 | setCaption( tr( "City Time" ) ); |
28 | CityTimeBaseLayout = new QVBoxLayout( this ); | 28 | CityTimeBaseLayout = new QVBoxLayout( this ); |
29 | CityTimeBaseLayout->setSpacing( 3 ); | 29 | CityTimeBaseLayout->setSpacing( 3 ); |
30 | CityTimeBaseLayout->setMargin( 0 ); | 30 | CityTimeBaseLayout->setMargin( 0 ); |
31 | 31 | ||
32 | frmMap = new ZoneMap( this, "frmMap" ); | 32 | frmMap = new ZoneMap( this, "frmMap" ); |
33 | frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) ); | 33 | frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) ); |
34 | CityTimeBaseLayout->addWidget( frmMap ); | 34 | CityTimeBaseLayout->addWidget( frmMap ); |
35 | 35 | ||
36 | buttonWidget = new QWidget( this ); | 36 | buttonWidget = new QWidget( this ); |
37 | QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) ); | 37 | QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) ); |
38 | Layout2 = new QGridLayout( buttonWidget ); | 38 | Layout2 = new QGridLayout( buttonWidget ); |
39 | Layout2->setSpacing( 3 ); | 39 | Layout2->setSpacing( 3 ); |
40 | Layout2->setMargin( 4 ); | 40 | Layout2->setMargin( 4 ); |
41 | 41 | ||
42 | cmdCity7 = new QToolButton( buttonWidget, "cmdCity7" ); | 42 | cmdCity7 = new QToolButton( buttonWidget, "cmdCity7" ); |
43 | cmdCity7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity7->sizePolicy().hasHeightForWidth() ) ); | 43 | cmdCity7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity7->sizePolicy().hasHeightForWidth() ) ); |
44 | QFont cmdCity7_font( cmdCity7->font() ); | 44 | QFont cmdCity7_font( cmdCity7->font() ); |
45 | cmdCity7_font.setBold( TRUE ); | 45 | cmdCity7_font.setBold( TRUE ); |
46 | cmdCity7->setFont( cmdCity7_font ); | 46 | cmdCity7->setFont( cmdCity7_font ); |
47 | cmdCity7->setFocusPolicy( QToolButton::TabFocus ); | 47 | cmdCity7->setFocusPolicy( QToolButton::TabFocus ); |
48 | cmdCity7->setText( tr( "" ) ); | 48 | cmdCity7->setText( "" ); |
49 | cmdCity7->setToggleButton( TRUE ); | 49 | cmdCity7->setToggleButton( TRUE ); |
50 | cmdCity7->setToggleButton( TRUE ); | 50 | cmdCity7->setToggleButton( TRUE ); |
51 | 51 | ||
52 | Layout2->addWidget( cmdCity7, 0, 2 ); | 52 | Layout2->addWidget( cmdCity7, 0, 2 ); |
53 | 53 | ||
54 | lblCTime9 = new QLabel( buttonWidget, "lblCTime9" ); | 54 | lblCTime9 = new QLabel( buttonWidget, "lblCTime9" ); |
55 | lblCTime9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime9->sizePolicy().hasHeightForWidth() ) ); | 55 | lblCTime9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime9->sizePolicy().hasHeightForWidth() ) ); |
56 | QFont lblCTime9_font( lblCTime9->font() ); | 56 | QFont lblCTime9_font( lblCTime9->font() ); |
57 | lblCTime9_font.setPointSize( 10 ); | 57 | lblCTime9_font.setPointSize( 10 ); |
58 | lblCTime9->setFont( lblCTime9_font ); | 58 | lblCTime9->setFont( lblCTime9_font ); |
59 | lblCTime9->setText( tr( "" ) ); | 59 | lblCTime9->setText( "" ); |
60 | lblCTime9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 60 | lblCTime9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
61 | 61 | ||
62 | Layout2->addWidget( lblCTime9, 2, 3 ); | 62 | Layout2->addWidget( lblCTime9, 2, 3 ); |
63 | 63 | ||
64 | cmdCity8 = new QToolButton( buttonWidget, "cmdCity8" ); | 64 | cmdCity8 = new QToolButton( buttonWidget, "cmdCity8" ); |
65 | cmdCity8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity8->sizePolicy().hasHeightForWidth() ) ); | 65 | cmdCity8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity8->sizePolicy().hasHeightForWidth() ) ); |
66 | QFont cmdCity8_font( cmdCity8->font() ); | 66 | QFont cmdCity8_font( cmdCity8->font() ); |
67 | cmdCity8_font.setBold( TRUE ); | 67 | cmdCity8_font.setBold( TRUE ); |
68 | cmdCity8->setFont( cmdCity8_font ); | 68 | cmdCity8->setFont( cmdCity8_font ); |
69 | cmdCity8->setFocusPolicy( QToolButton::TabFocus ); | 69 | cmdCity8->setFocusPolicy( QToolButton::TabFocus ); |
70 | cmdCity8->setText( tr( "" ) ); | 70 | cmdCity8->setText( "" ); |
71 | cmdCity8->setToggleButton( TRUE ); | 71 | cmdCity8->setToggleButton( TRUE ); |
72 | cmdCity8->setToggleButton( TRUE ); | 72 | cmdCity8->setToggleButton( TRUE ); |
73 | 73 | ||
74 | Layout2->addWidget( cmdCity8, 1, 2 ); | 74 | Layout2->addWidget( cmdCity8, 1, 2 ); |
75 | 75 | ||
76 | cmdCity2 = new QToolButton( buttonWidget, "cmdCity2" ); | 76 | cmdCity2 = new QToolButton( buttonWidget, "cmdCity2" ); |
77 | QFont cmdCity2_font( cmdCity2->font() ); | 77 | QFont cmdCity2_font( cmdCity2->font() ); |
78 | cmdCity2_font.setBold( TRUE ); | 78 | cmdCity2_font.setBold( TRUE ); |
79 | cmdCity2->setFont( cmdCity2_font ); | 79 | cmdCity2->setFont( cmdCity2_font ); |
80 | cmdCity2->setFocusPolicy( QToolButton::TabFocus ); | 80 | cmdCity2->setFocusPolicy( QToolButton::TabFocus ); |
81 | cmdCity2->setText( tr( "" ) ); | 81 | cmdCity2->setText( "" ); |
82 | cmdCity2->setToggleButton( TRUE ); | 82 | cmdCity2->setToggleButton( TRUE ); |
83 | cmdCity2->setToggleButton( TRUE ); | 83 | cmdCity2->setToggleButton( TRUE ); |
84 | 84 | ||
85 | Layout2->addWidget( cmdCity2, 1, 0 ); | 85 | Layout2->addWidget( cmdCity2, 1, 0 ); |
86 | 86 | ||
87 | lblCTime6 = new QLabel( buttonWidget, "lblCTime6" ); | 87 | lblCTime6 = new QLabel( buttonWidget, "lblCTime6" ); |
88 | QFont lblCTime6_font( lblCTime6->font() ); | 88 | QFont lblCTime6_font( lblCTime6->font() ); |
89 | lblCTime6_font.setPointSize( 10 ); | 89 | lblCTime6_font.setPointSize( 10 ); |
90 | lblCTime6->setFont( lblCTime6_font ); | 90 | lblCTime6->setFont( lblCTime6_font ); |
91 | lblCTime6->setText( tr( "" ) ); | 91 | lblCTime6->setText( "" ); |
92 | lblCTime6->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 92 | lblCTime6->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
93 | 93 | ||
94 | Layout2->addWidget( lblCTime6, 5, 1 ); | 94 | Layout2->addWidget( lblCTime6, 5, 1 ); |
95 | 95 | ||
96 | cmdCity6 = new QToolButton( buttonWidget, "cmdCity6" ); | 96 | cmdCity6 = new QToolButton( buttonWidget, "cmdCity6" ); |
97 | cmdCity6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity6->sizePolicy().hasHeightForWidth() ) ); | 97 | cmdCity6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity6->sizePolicy().hasHeightForWidth() ) ); |
98 | QFont cmdCity6_font( cmdCity6->font() ); | 98 | QFont cmdCity6_font( cmdCity6->font() ); |
99 | cmdCity6_font.setBold( TRUE ); | 99 | cmdCity6_font.setBold( TRUE ); |
100 | cmdCity6->setFont( cmdCity6_font ); | 100 | cmdCity6->setFont( cmdCity6_font ); |
101 | cmdCity6->setFocusPolicy( QToolButton::TabFocus ); | 101 | cmdCity6->setFocusPolicy( QToolButton::TabFocus ); |
102 | cmdCity6->setText( tr( "" ) ); | 102 | cmdCity6->setText( "" ); |
103 | cmdCity6->setToggleButton( TRUE ); | 103 | cmdCity6->setToggleButton( TRUE ); |
104 | cmdCity6->setToggleButton( TRUE ); | 104 | cmdCity6->setToggleButton( TRUE ); |
105 | 105 | ||
106 | Layout2->addWidget( cmdCity6, 5, 0 ); | 106 | Layout2->addWidget( cmdCity6, 5, 0 ); |
107 | 107 | ||
108 | cmdCity4 = new QToolButton( buttonWidget, "cmdCity4" ); | 108 | cmdCity4 = new QToolButton( buttonWidget, "cmdCity4" ); |
109 | cmdCity4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity4->sizePolicy().hasHeightForWidth() ) ); | 109 | cmdCity4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity4->sizePolicy().hasHeightForWidth() ) ); |
110 | QFont cmdCity4_font( cmdCity4->font() ); | 110 | QFont cmdCity4_font( cmdCity4->font() ); |
111 | cmdCity4_font.setBold( TRUE ); | 111 | cmdCity4_font.setBold( TRUE ); |
112 | cmdCity4->setFont( cmdCity4_font ); | 112 | cmdCity4->setFont( cmdCity4_font ); |
113 | cmdCity4->setFocusPolicy( QToolButton::TabFocus ); | 113 | cmdCity4->setFocusPolicy( QToolButton::TabFocus ); |
114 | cmdCity4->setText( tr( "" ) ); | 114 | cmdCity4->setText( "" ); |
115 | cmdCity4->setToggleButton( TRUE ); | 115 | cmdCity4->setToggleButton( TRUE ); |
116 | cmdCity4->setToggleButton( TRUE ); | 116 | cmdCity4->setToggleButton( TRUE ); |
117 | 117 | ||
118 | Layout2->addWidget( cmdCity4, 3, 0 ); | 118 | Layout2->addWidget( cmdCity4, 3, 0 ); |
119 | 119 | ||
120 | lblCTime5 = new QLabel( buttonWidget, "lblCTime5" ); | 120 | lblCTime5 = new QLabel( buttonWidget, "lblCTime5" ); |
121 | QFont lblCTime5_font( lblCTime5->font() ); | 121 | QFont lblCTime5_font( lblCTime5->font() ); |
122 | lblCTime5_font.setPointSize( 10 ); | 122 | lblCTime5_font.setPointSize( 10 ); |
123 | lblCTime5->setFont( lblCTime5_font ); | 123 | lblCTime5->setFont( lblCTime5_font ); |
124 | lblCTime5->setText( tr( "" ) ); | 124 | lblCTime5->setText( "" ); |
125 | lblCTime5->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 125 | lblCTime5->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
126 | 126 | ||
127 | Layout2->addWidget( lblCTime5, 4, 1 ); | 127 | Layout2->addWidget( lblCTime5, 4, 1 ); |
128 | 128 | ||
129 | lblCTime2 = new QLabel( buttonWidget, "lblCTime2" ); | 129 | lblCTime2 = new QLabel( buttonWidget, "lblCTime2" ); |
130 | lblCTime2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, lblCTime2->sizePolicy().hasHeightForWidth() ) ); | 130 | lblCTime2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, lblCTime2->sizePolicy().hasHeightForWidth() ) ); |
131 | QFont lblCTime2_font( lblCTime2->font() ); | 131 | QFont lblCTime2_font( lblCTime2->font() ); |
132 | lblCTime2_font.setPointSize( 10 ); | 132 | lblCTime2_font.setPointSize( 10 ); |
133 | lblCTime2->setFont( lblCTime2_font ); | 133 | lblCTime2->setFont( lblCTime2_font ); |
134 | lblCTime2->setText( tr( "" ) ); | 134 | lblCTime2->setText( "" ); |
135 | lblCTime2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 135 | lblCTime2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
136 | 136 | ||
137 | Layout2->addWidget( lblCTime2, 1, 1 ); | 137 | Layout2->addWidget( lblCTime2, 1, 1 ); |
138 | 138 | ||
139 | lblCTime1 = new QLabel( buttonWidget, "lblCTime1" ); | 139 | lblCTime1 = new QLabel( buttonWidget, "lblCTime1" ); |
140 | lblCTime1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, lblCTime1->sizePolicy().hasHeightForWidth() ) ); | 140 | lblCTime1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, lblCTime1->sizePolicy().hasHeightForWidth() ) ); |
141 | QFont lblCTime1_font( lblCTime1->font() ); | 141 | QFont lblCTime1_font( lblCTime1->font() ); |
142 | lblCTime1_font.setPointSize( 10 ); | 142 | lblCTime1_font.setPointSize( 10 ); |
143 | lblCTime1->setFont( lblCTime1_font ); | 143 | lblCTime1->setFont( lblCTime1_font ); |
144 | lblCTime1->setText( tr( "" ) ); | 144 | lblCTime1->setText( "" ); |
145 | lblCTime1->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 145 | lblCTime1->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
146 | 146 | ||
147 | Layout2->addWidget( lblCTime1, 0, 1 ); | 147 | Layout2->addWidget( lblCTime1, 0, 1 ); |
148 | 148 | ||
149 | cmdCity3 = new QToolButton( buttonWidget, "cmdCity3" ); | 149 | cmdCity3 = new QToolButton( buttonWidget, "cmdCity3" ); |
150 | cmdCity3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity3->sizePolicy().hasHeightForWidth() ) ); | 150 | cmdCity3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity3->sizePolicy().hasHeightForWidth() ) ); |
151 | QFont cmdCity3_font( cmdCity3->font() ); | 151 | QFont cmdCity3_font( cmdCity3->font() ); |
152 | cmdCity3_font.setBold( TRUE ); | 152 | cmdCity3_font.setBold( TRUE ); |
153 | cmdCity3->setFont( cmdCity3_font ); | 153 | cmdCity3->setFont( cmdCity3_font ); |
154 | cmdCity3->setFocusPolicy( QToolButton::TabFocus ); | 154 | cmdCity3->setFocusPolicy( QToolButton::TabFocus ); |
155 | cmdCity3->setText( tr( "" ) ); | 155 | cmdCity3->setText( "" ); |
156 | cmdCity3->setToggleButton( TRUE ); | 156 | cmdCity3->setToggleButton( TRUE ); |
157 | cmdCity3->setToggleButton( TRUE ); | 157 | cmdCity3->setToggleButton( TRUE ); |
158 | 158 | ||
159 | Layout2->addWidget( cmdCity3, 2, 0 ); | 159 | Layout2->addWidget( cmdCity3, 2, 0 ); |
160 | 160 | ||
161 | lblCTime8 = new QLabel( buttonWidget, "lblCTime8" ); | 161 | lblCTime8 = new QLabel( buttonWidget, "lblCTime8" ); |
162 | lblCTime8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime8->sizePolicy().hasHeightForWidth() ) ); | 162 | lblCTime8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime8->sizePolicy().hasHeightForWidth() ) ); |
163 | QFont lblCTime8_font( lblCTime8->font() ); | 163 | QFont lblCTime8_font( lblCTime8->font() ); |
164 | lblCTime8_font.setPointSize( 10 ); | 164 | lblCTime8_font.setPointSize( 10 ); |
165 | lblCTime8->setFont( lblCTime8_font ); | 165 | lblCTime8->setFont( lblCTime8_font ); |
166 | lblCTime8->setText( tr( "" ) ); | 166 | lblCTime8->setText( "" ); |
167 | lblCTime8->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 167 | lblCTime8->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
168 | 168 | ||
169 | Layout2->addWidget( lblCTime8, 1, 3 ); | 169 | Layout2->addWidget( lblCTime8, 1, 3 ); |
170 | 170 | ||
171 | cmdCity1 = new QToolButton( buttonWidget, "cmdCity1" ); | 171 | cmdCity1 = new QToolButton( buttonWidget, "cmdCity1" ); |
172 | cmdCity1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity1->sizePolicy().hasHeightForWidth() ) ); | 172 | cmdCity1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity1->sizePolicy().hasHeightForWidth() ) ); |
173 | QFont cmdCity1_font( cmdCity1->font() ); | 173 | QFont cmdCity1_font( cmdCity1->font() ); |
174 | cmdCity1_font.setBold( TRUE ); | 174 | cmdCity1_font.setBold( TRUE ); |
175 | cmdCity1->setFont( cmdCity1_font ); | 175 | cmdCity1->setFont( cmdCity1_font ); |
176 | cmdCity1->setFocusPolicy( QToolButton::TabFocus ); | 176 | cmdCity1->setFocusPolicy( QToolButton::TabFocus ); |
177 | cmdCity1->setText( tr( "" ) ); | 177 | cmdCity1->setText( "" ); |
178 | cmdCity1->setToggleButton( TRUE ); | 178 | cmdCity1->setToggleButton( TRUE ); |
179 | cmdCity1->setToggleButton( TRUE ); | 179 | cmdCity1->setToggleButton( TRUE ); |
180 | 180 | ||
181 | Layout2->addWidget( cmdCity1, 0, 0 ); | 181 | Layout2->addWidget( cmdCity1, 0, 0 ); |
182 | 182 | ||
183 | lblCTime7 = new QLabel( buttonWidget, "lblCTime7" ); | 183 | lblCTime7 = new QLabel( buttonWidget, "lblCTime7" ); |
184 | lblCTime7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime7->sizePolicy().hasHeightForWidth() ) ); | 184 | lblCTime7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime7->sizePolicy().hasHeightForWidth() ) ); |
185 | QFont lblCTime7_font( lblCTime7->font() ); | 185 | QFont lblCTime7_font( lblCTime7->font() ); |
186 | lblCTime7_font.setPointSize( 10 ); | 186 | lblCTime7_font.setPointSize( 10 ); |
187 | lblCTime7->setFont( lblCTime7_font ); | 187 | lblCTime7->setFont( lblCTime7_font ); |
188 | lblCTime7->setText( tr( "" ) ); | 188 | lblCTime7->setText( "" ); |
189 | lblCTime7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 189 | lblCTime7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
190 | 190 | ||
191 | Layout2->addWidget( lblCTime7, 0, 3 ); | 191 | Layout2->addWidget( lblCTime7, 0, 3 ); |
192 | 192 | ||
193 | lblCTime4 = new QLabel( buttonWidget, "lblCTime4" ); | 193 | lblCTime4 = new QLabel( buttonWidget, "lblCTime4" ); |
194 | QFont lblCTime4_font( lblCTime4->font() ); | 194 | QFont lblCTime4_font( lblCTime4->font() ); |
195 | lblCTime4_font.setPointSize( 10 ); | 195 | lblCTime4_font.setPointSize( 10 ); |
196 | lblCTime4->setFont( lblCTime4_font ); | 196 | lblCTime4->setFont( lblCTime4_font ); |
197 | lblCTime4->setText( tr( "" ) ); | 197 | lblCTime4->setText( "" ); |
198 | lblCTime4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 198 | lblCTime4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
199 | 199 | ||
200 | Layout2->addWidget( lblCTime4, 3, 1 ); | 200 | Layout2->addWidget( lblCTime4, 3, 1 ); |
201 | 201 | ||
202 | cmdCity5 = new QToolButton( buttonWidget, "cmdCity5" ); | 202 | cmdCity5 = new QToolButton( buttonWidget, "cmdCity5" ); |
203 | cmdCity5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity5->sizePolicy().hasHeightForWidth() ) ); | 203 | cmdCity5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity5->sizePolicy().hasHeightForWidth() ) ); |
204 | QFont cmdCity5_font( cmdCity5->font() ); | 204 | QFont cmdCity5_font( cmdCity5->font() ); |
205 | cmdCity5_font.setBold( TRUE ); | 205 | cmdCity5_font.setBold( TRUE ); |
206 | cmdCity5->setFont( cmdCity5_font ); | 206 | cmdCity5->setFont( cmdCity5_font ); |
207 | cmdCity5->setFocusPolicy( QToolButton::TabFocus ); | 207 | cmdCity5->setFocusPolicy( QToolButton::TabFocus ); |
208 | cmdCity5->setText( tr( "" ) ); | 208 | cmdCity5->setText( "" ); |
209 | cmdCity5->setToggleButton( TRUE ); | 209 | cmdCity5->setToggleButton( TRUE ); |
210 | cmdCity5->setToggleButton( TRUE ); | 210 | cmdCity5->setToggleButton( TRUE ); |
211 | 211 | ||
212 | Layout2->addWidget( cmdCity5, 4, 0 ); | 212 | Layout2->addWidget( cmdCity5, 4, 0 ); |
213 | 213 | ||
214 | lblCTime3 = new QLabel( buttonWidget, "lblCTime3" ); | 214 | lblCTime3 = new QLabel( buttonWidget, "lblCTime3" ); |
215 | QFont lblCTime3_font( lblCTime3->font() ); | 215 | QFont lblCTime3_font( lblCTime3->font() ); |
216 | lblCTime3_font.setPointSize( 10 ); | 216 | lblCTime3_font.setPointSize( 10 ); |
217 | lblCTime3->setFont( lblCTime3_font ); | 217 | lblCTime3->setFont( lblCTime3_font ); |
218 | lblCTime3->setText( tr( "" ) ); | 218 | lblCTime3->setText( "" ); |
219 | lblCTime3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | 219 | lblCTime3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); |
220 | 220 | ||
221 | Layout2->addWidget( lblCTime3, 2, 1 ); | 221 | Layout2->addWidget( lblCTime3, 2, 1 ); |
222 | 222 | ||
223 | cmdCity9 = new QToolButton( buttonWidget, "cmdCity9" ); | 223 | cmdCity9 = new QToolButton( buttonWidget, "cmdCity9" ); |
224 | cmdCity9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity9->sizePolicy().hasHeightForWidth() ) ); | 224 | cmdCity9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity9->sizePolicy().hasHeightForWidth() ) ); |
225 | QFont cmdCity9_font( cmdCity9->font() ); | 225 | QFont cmdCity9_font( cmdCity9->font() ); |
226 | cmdCity9_font.setBold( TRUE ); | 226 | cmdCity9_font.setBold( TRUE ); |
227 | cmdCity9->setFont( cmdCity9_font ); | 227 | cmdCity9->setFont( cmdCity9_font ); |
228 | cmdCity9->setFocusPolicy( QToolButton::TabFocus ); | 228 | cmdCity9->setFocusPolicy( QToolButton::TabFocus ); |
229 | cmdCity9->setText( tr( "" ) ); | 229 | cmdCity9->setText( "" ); |
230 | cmdCity9->setToggleButton( TRUE ); | 230 | cmdCity9->setToggleButton( TRUE ); |
231 | cmdCity9->setToggleButton( TRUE ); | 231 | cmdCity9->setToggleButton( TRUE ); |
232 | 232 | ||
233 | Layout2->addWidget( cmdCity9, 2, 2 ); | 233 | Layout2->addWidget( cmdCity9, 2, 2 ); |
234 | CityTimeBaseLayout->addWidget( buttonWidget ); | 234 | CityTimeBaseLayout->addWidget( buttonWidget ); |
235 | 235 | ||
236 | // signals and slots connections | 236 | // signals and slots connections |
237 | connect( frmMap, SIGNAL( signalTz(const QString&,const QString&) ), this, SLOT( slotNewTz(const QString&,const QString&) ) ); | 237 | connect( frmMap, SIGNAL( signalTz(const QString&,const QString&) ), this, SLOT( slotNewTz(const QString&,const QString&) ) ); |
238 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 238 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
239 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 239 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
240 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 240 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
241 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 241 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
242 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 242 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
243 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 243 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
244 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 244 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
245 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 245 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
246 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 246 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
247 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 247 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
248 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 248 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
249 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 249 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
250 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 250 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
251 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 251 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
252 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 252 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
253 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 253 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
254 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 254 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
255 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 255 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
256 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 256 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
257 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 257 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
258 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 258 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
259 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 259 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
260 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 260 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
261 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 261 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
262 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 262 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
263 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 263 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
264 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 264 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
265 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 265 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
266 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 266 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
267 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 267 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
268 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 268 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
269 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 269 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
270 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 270 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
271 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 271 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
272 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 272 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
273 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 273 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
274 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 274 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
275 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 275 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
276 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 276 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
277 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 277 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
278 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 278 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
279 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 279 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
280 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 280 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
281 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 281 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
282 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 282 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
283 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 283 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
284 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 284 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
285 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 285 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
286 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 286 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
287 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 287 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
288 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 288 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
289 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 289 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
290 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 290 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
291 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 291 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
292 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 292 | connect( cmdCity6, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
293 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 293 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
294 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 294 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
295 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); | 295 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity1, SLOT( setDisabled(bool) ) ); |
296 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); | 296 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity3, SLOT( setDisabled(bool) ) ); |
297 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); | 297 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity4, SLOT( setDisabled(bool) ) ); |
298 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); | 298 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity5, SLOT( setDisabled(bool) ) ); |
299 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); | 299 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity6, SLOT( setDisabled(bool) ) ); |
300 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); | 300 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity7, SLOT( setDisabled(bool) ) ); |
301 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); | 301 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity8, SLOT( setDisabled(bool) ) ); |
302 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 302 | connect( cmdCity1, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
303 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 303 | connect( cmdCity2, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
304 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 304 | connect( cmdCity3, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
305 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 305 | connect( cmdCity4, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
306 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 306 | connect( cmdCity5, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
307 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 307 | connect( cmdCity7, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
308 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); | 308 | connect( cmdCity8, SIGNAL( toggled(bool) ), cmdCity9, SLOT( setDisabled(bool) ) ); |
309 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); | 309 | connect( cmdCity9, SIGNAL( toggled(bool) ), cmdCity2, SLOT( setDisabled(bool) ) ); |
310 | connect( cmdCity1, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 310 | connect( cmdCity1, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
311 | connect( cmdCity2, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 311 | connect( cmdCity2, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
312 | connect( cmdCity7, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 312 | connect( cmdCity7, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
313 | connect( cmdCity3, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 313 | connect( cmdCity3, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
314 | connect( cmdCity4, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 314 | connect( cmdCity4, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
315 | connect( cmdCity5, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 315 | connect( cmdCity5, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
316 | connect( cmdCity6, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 316 | connect( cmdCity6, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
317 | connect( cmdCity8, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 317 | connect( cmdCity8, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
318 | connect( cmdCity9, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); | 318 | connect( cmdCity9, SIGNAL( toggled(bool) ), this, SLOT( beginNewTz() ) ); |
319 | 319 | ||
320 | // tab order | 320 | // tab order |
321 | setTabOrder( cmdCity1, cmdCity2 ); | 321 | setTabOrder( cmdCity1, cmdCity2 ); |
322 | setTabOrder( cmdCity2, cmdCity3 ); | 322 | setTabOrder( cmdCity2, cmdCity3 ); |
323 | setTabOrder( cmdCity3, cmdCity4 ); | 323 | setTabOrder( cmdCity3, cmdCity4 ); |
324 | setTabOrder( cmdCity4, cmdCity5 ); | 324 | setTabOrder( cmdCity4, cmdCity5 ); |
325 | setTabOrder( cmdCity5, cmdCity6 ); | 325 | setTabOrder( cmdCity5, cmdCity6 ); |
326 | setTabOrder( cmdCity6, cmdCity7 ); | 326 | setTabOrder( cmdCity6, cmdCity7 ); |
327 | setTabOrder( cmdCity7, cmdCity8 ); | 327 | setTabOrder( cmdCity7, cmdCity8 ); |
328 | setTabOrder( cmdCity8, cmdCity9 ); | 328 | setTabOrder( cmdCity8, cmdCity9 ); |
329 | setTabOrder( cmdCity9, frmMap ); | 329 | setTabOrder( cmdCity9, frmMap ); |
330 | } | 330 | } |
331 | 331 | ||
332 | /* | 332 | /* |
333 | * Destroys the object and frees any allocated resources | 333 | * Destroys the object and frees any allocated resources |
334 | */ | 334 | */ |
335 | CityTimeBase::~CityTimeBase() | 335 | CityTimeBase::~CityTimeBase() |
336 | { | 336 | { |
337 | // no need to delete child widgets, Qt does it all for us | 337 | // no need to delete child widgets, Qt does it all for us |
338 | } | 338 | } |
339 | 339 | ||
340 | /* | 340 | /* |
341 | * Main event handler. Reimplemented to handle application | 341 | * Main event handler. Reimplemented to handle application |
342 | * font changes | 342 | * font changes |
343 | */ | 343 | */ |
344 | bool CityTimeBase::event( QEvent* ev ) | 344 | bool CityTimeBase::event( QEvent* ev ) |
345 | { | 345 | { |
346 | bool ret = QWidget::event( ev ); | 346 | bool ret = QWidget::event( ev ); |
347 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 347 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
348 | QFont cmdCity7_font( cmdCity7->font() ); | 348 | QFont cmdCity7_font( cmdCity7->font() ); |
349 | cmdCity7_font.setBold( TRUE ); | 349 | cmdCity7_font.setBold( TRUE ); |
350 | cmdCity7->setFont( cmdCity7_font ); | 350 | cmdCity7->setFont( cmdCity7_font ); |
351 | QFont lblCTime9_font( lblCTime9->font() ); | 351 | QFont lblCTime9_font( lblCTime9->font() ); |
352 | lblCTime9_font.setPointSize( 10 ); | 352 | lblCTime9_font.setPointSize( 10 ); |
353 | lblCTime9->setFont( lblCTime9_font ); | 353 | lblCTime9->setFont( lblCTime9_font ); |
354 | QFont cmdCity8_font( cmdCity8->font() ); | 354 | QFont cmdCity8_font( cmdCity8->font() ); |
355 | cmdCity8_font.setBold( TRUE ); | 355 | cmdCity8_font.setBold( TRUE ); |
356 | cmdCity8->setFont( cmdCity8_font ); | 356 | cmdCity8->setFont( cmdCity8_font ); |
357 | QFont cmdCity2_font( cmdCity2->font() ); | 357 | QFont cmdCity2_font( cmdCity2->font() ); |
358 | cmdCity2_font.setBold( TRUE ); | 358 | cmdCity2_font.setBold( TRUE ); |
359 | cmdCity2->setFont( cmdCity2_font ); | 359 | cmdCity2->setFont( cmdCity2_font ); |
360 | QFont lblCTime6_font( lblCTime6->font() ); | 360 | QFont lblCTime6_font( lblCTime6->font() ); |
361 | lblCTime6_font.setPointSize( 10 ); | 361 | lblCTime6_font.setPointSize( 10 ); |
362 | lblCTime6->setFont( lblCTime6_font ); | 362 | lblCTime6->setFont( lblCTime6_font ); |
363 | QFont cmdCity6_font( cmdCity6->font() ); | 363 | QFont cmdCity6_font( cmdCity6->font() ); |
364 | cmdCity6_font.setBold( TRUE ); | 364 | cmdCity6_font.setBold( TRUE ); |
365 | cmdCity6->setFont( cmdCity6_font ); | 365 | cmdCity6->setFont( cmdCity6_font ); |
366 | QFont cmdCity4_font( cmdCity4->font() ); | 366 | QFont cmdCity4_font( cmdCity4->font() ); |
367 | cmdCity4_font.setBold( TRUE ); | 367 | cmdCity4_font.setBold( TRUE ); |
368 | cmdCity4->setFont( cmdCity4_font ); | 368 | cmdCity4->setFont( cmdCity4_font ); |
369 | QFont lblCTime5_font( lblCTime5->font() ); | 369 | QFont lblCTime5_font( lblCTime5->font() ); |
370 | lblCTime5_font.setPointSize( 10 ); | 370 | lblCTime5_font.setPointSize( 10 ); |
371 | lblCTime5->setFont( lblCTime5_font ); | 371 | lblCTime5->setFont( lblCTime5_font ); |
372 | QFont lblCTime2_font( lblCTime2->font() ); | 372 | QFont lblCTime2_font( lblCTime2->font() ); |
373 | lblCTime2_font.setPointSize( 10 ); | 373 | lblCTime2_font.setPointSize( 10 ); |
374 | lblCTime2->setFont( lblCTime2_font ); | 374 | lblCTime2->setFont( lblCTime2_font ); |
375 | QFont lblCTime1_font( lblCTime1->font() ); | 375 | QFont lblCTime1_font( lblCTime1->font() ); |
376 | lblCTime1_font.setPointSize( 10 ); | 376 | lblCTime1_font.setPointSize( 10 ); |
377 | lblCTime1->setFont( lblCTime1_font ); | 377 | lblCTime1->setFont( lblCTime1_font ); |
378 | QFont cmdCity3_font( cmdCity3->font() ); | 378 | QFont cmdCity3_font( cmdCity3->font() ); |
379 | cmdCity3_font.setBold( TRUE ); | 379 | cmdCity3_font.setBold( TRUE ); |
380 | cmdCity3->setFont( cmdCity3_font ); | 380 | cmdCity3->setFont( cmdCity3_font ); |
381 | QFont lblCTime8_font( lblCTime8->font() ); | 381 | QFont lblCTime8_font( lblCTime8->font() ); |
382 | lblCTime8_font.setPointSize( 10 ); | 382 | lblCTime8_font.setPointSize( 10 ); |
383 | lblCTime8->setFont( lblCTime8_font ); | 383 | lblCTime8->setFont( lblCTime8_font ); |
384 | QFont cmdCity1_font( cmdCity1->font() ); | 384 | QFont cmdCity1_font( cmdCity1->font() ); |
385 | cmdCity1_font.setBold( TRUE ); | 385 | cmdCity1_font.setBold( TRUE ); |
386 | cmdCity1->setFont( cmdCity1_font ); | 386 | cmdCity1->setFont( cmdCity1_font ); |
387 | QFont lblCTime7_font( lblCTime7->font() ); | 387 | QFont lblCTime7_font( lblCTime7->font() ); |
388 | lblCTime7_font.setPointSize( 10 ); | 388 | lblCTime7_font.setPointSize( 10 ); |
389 | lblCTime7->setFont( lblCTime7_font ); | 389 | lblCTime7->setFont( lblCTime7_font ); |
390 | QFont lblCTime4_font( lblCTime4->font() ); | 390 | QFont lblCTime4_font( lblCTime4->font() ); |
391 | lblCTime4_font.setPointSize( 10 ); | 391 | lblCTime4_font.setPointSize( 10 ); |
392 | lblCTime4->setFont( lblCTime4_font ); | 392 | lblCTime4->setFont( lblCTime4_font ); |
393 | QFont cmdCity5_font( cmdCity5->font() ); | 393 | QFont cmdCity5_font( cmdCity5->font() ); |
394 | cmdCity5_font.setBold( TRUE ); | 394 | cmdCity5_font.setBold( TRUE ); |
395 | cmdCity5->setFont( cmdCity5_font ); | 395 | cmdCity5->setFont( cmdCity5_font ); |
396 | QFont lblCTime3_font( lblCTime3->font() ); | 396 | QFont lblCTime3_font( lblCTime3->font() ); |
397 | lblCTime3_font.setPointSize( 10 ); | 397 | lblCTime3_font.setPointSize( 10 ); |
398 | lblCTime3->setFont( lblCTime3_font ); | 398 | lblCTime3->setFont( lblCTime3_font ); |
399 | QFont cmdCity9_font( cmdCity9->font() ); | 399 | QFont cmdCity9_font( cmdCity9->font() ); |
400 | cmdCity9_font.setBold( TRUE ); | 400 | cmdCity9_font.setBold( TRUE ); |
401 | cmdCity9->setFont( cmdCity9_font ); | 401 | cmdCity9->setFont( cmdCity9_font ); |
402 | } | 402 | } |
403 | return ret; | 403 | return ret; |
404 | } | 404 | } |
405 | 405 | ||
406 | void CityTimeBase::beginNewTz() | 406 | void CityTimeBase::beginNewTz() |
407 | { | 407 | { |
408 | owarn << "CityTimeBase::beginNewTz(): Not implemented yet!" << oendl; | 408 | owarn << "CityTimeBase::beginNewTz(): Not implemented yet!" << oendl; |
409 | } | 409 | } |
410 | 410 | ||
411 | void CityTimeBase::slotNewTz(const QString &, const QString &) | 411 | void CityTimeBase::slotNewTz(const QString &, const QString &) |
412 | { | 412 | { |
413 | owarn << "CityTimeBase::slotNewTz(const QString &, const QString &): Not implemented yet!" << oendl; | 413 | owarn << "CityTimeBase::slotNewTz(const QString &, const QString &): Not implemented yet!" << oendl; |
414 | } | 414 | } |
415 | 415 | ||
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp index a71078f..96010c8 100644 --- a/noncore/applets/memoryapplet/swapfile.cpp +++ b/noncore/applets/memoryapplet/swapfile.cpp | |||
@@ -1,439 +1,439 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "swapfile.h" | 21 | #include "swapfile.h" |
22 | 22 | ||
23 | /* OPIE */ | 23 | /* OPIE */ |
24 | #include <opie2/odebug.h> | 24 | #include <opie2/odebug.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | using namespace Opie::Core; | 26 | using namespace Opie::Core; |
27 | 27 | ||
28 | /* QT */ | 28 | /* QT */ |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qhbuttongroup.h> | 35 | #include <qhbuttongroup.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
38 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qvgroupbox.h> | 40 | #include <qvgroupbox.h> |
41 | #include <qhbox.h> | 41 | #include <qhbox.h> |
42 | #include <qmessagebox.h> | 42 | #include <qmessagebox.h> |
43 | #include <qcopchannel_qws.h> | 43 | #include <qcopchannel_qws.h> |
44 | 44 | ||
45 | /* STD */ | 45 | /* STD */ |
46 | #include <stdio.h> | 46 | #include <stdio.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <string.h> | 48 | #include <string.h> |
49 | #include <unistd.h> | 49 | #include <unistd.h> |
50 | #include <fcntl.h> | 50 | #include <fcntl.h> |
51 | #include <sys/vfs.h> | 51 | #include <sys/vfs.h> |
52 | #include <mntent.h> | 52 | #include <mntent.h> |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #include <sys/types.h> | 54 | #include <sys/types.h> |
55 | 55 | ||
56 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) | 56 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) |
57 | : QWidget( parent, name, f ) | 57 | : QWidget( parent, name, f ) |
58 | { | 58 | { |
59 | // are we running as root? | 59 | // are we running as root? |
60 | isRoot = geteuid() == 0; | 60 | isRoot = geteuid() == 0; |
61 | 61 | ||
62 | QVBoxLayout* vb = new QVBoxLayout(this, 5); | 62 | QVBoxLayout* vb = new QVBoxLayout(this, 5); |
63 | 63 | ||
64 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); | 64 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); |
65 | cfsdRBG->setRadioButtonExclusive(true); | 65 | cfsdRBG->setRadioButtonExclusive(true); |
66 | vb->addWidget(cfsdRBG); | 66 | vb->addWidget(cfsdRBG); |
67 | 67 | ||
68 | ramRB = new QRadioButton(tr("RAM"), cfsdRBG); | 68 | ramRB = new QRadioButton(tr("RAM"), cfsdRBG); |
69 | cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); | 69 | cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); |
70 | sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); | 70 | sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); |
71 | 71 | ||
72 | QHBox *hb1 = new QHBox(this); | 72 | QHBox *hb1 = new QHBox(this); |
73 | hb1->setSpacing(5); | 73 | hb1->setSpacing(5); |
74 | 74 | ||
75 | swapPath1 = new QLineEdit(hb1); | 75 | swapPath1 = new QLineEdit(hb1); |
76 | swapPath1->setEnabled(false); | 76 | swapPath1->setEnabled(false); |
77 | 77 | ||
78 | QPushButton* swapOn = new QPushButton(tr(" On "), hb1); | 78 | QPushButton* swapOn = new QPushButton(tr(" On "), hb1); |
79 | QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); | 79 | QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); |
80 | vb->addWidget(hb1); | 80 | vb->addWidget(hb1); |
81 | 81 | ||
82 | QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); | 82 | QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); |
83 | vb->addWidget(box1); | 83 | vb->addWidget(box1); |
84 | 84 | ||
85 | QHBox *hb2 = new QHBox(box1); | 85 | QHBox *hb2 = new QHBox(box1); |
86 | hb2->setSpacing(5); | 86 | hb2->setSpacing(5); |
87 | QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); | 87 | QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); |
88 | QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); | 88 | QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); |
89 | 89 | ||
90 | QHBox *hb3 = new QHBox(box1); | 90 | QHBox *hb3 = new QHBox(box1); |
91 | hb3->setSpacing(5); | 91 | hb3->setSpacing(5); |
92 | swapSize = new QComboBox(hb3); | 92 | swapSize = new QComboBox(hb3); |
93 | swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb"))); | 93 | swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb"))); |
94 | 94 | ||
95 | mkswapProgress = new QProgressBar(3, hb3); | 95 | mkswapProgress = new QProgressBar(3, hb3); |
96 | mkswapProgress->setCenterIndicator(true); | 96 | mkswapProgress->setCenterIndicator(true); |
97 | 97 | ||
98 | QHBox *hb4 = new QHBox(this); | 98 | QHBox *hb4 = new QHBox(this); |
99 | hb4->setSpacing(5); | 99 | hb4->setSpacing(5); |
100 | 100 | ||
101 | swapStatusIcon = new QLabel(hb4); | 101 | swapStatusIcon = new QLabel(hb4); |
102 | swapStatus = new QLabel(tr(""), hb4); | 102 | swapStatus = new QLabel("", hb4); |
103 | hb4->setStretchFactor(swapStatus, 99); | 103 | hb4->setStretchFactor(swapStatus, 99); |
104 | vb->addWidget(hb4); | 104 | vb->addWidget(hb4); |
105 | 105 | ||
106 | connect(swapOn, SIGNAL(clicked()), this, SLOT(swapon())); | 106 | connect(swapOn, SIGNAL(clicked()), this, SLOT(swapon())); |
107 | connect(swapOff, SIGNAL(clicked()), this, SLOT(swapoff())); | 107 | connect(swapOff, SIGNAL(clicked()), this, SLOT(swapoff())); |
108 | connect(cfRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); | 108 | connect(cfRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); |
109 | connect(sdRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); | 109 | connect(sdRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); |
110 | connect(ramRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); | 110 | connect(ramRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); |
111 | connect(mkSwap, SIGNAL(clicked()), this, SLOT(makeswapfile())); | 111 | connect(mkSwap, SIGNAL(clicked()), this, SLOT(makeswapfile())); |
112 | connect(rmSwap, SIGNAL(clicked()), this, SLOT(removeswapfile())); | 112 | connect(rmSwap, SIGNAL(clicked()), this, SLOT(removeswapfile())); |
113 | 113 | ||
114 | cfRB->setEnabled(FALSE); | 114 | cfRB->setEnabled(FALSE); |
115 | sdRB->setEnabled(FALSE); | 115 | sdRB->setEnabled(FALSE); |
116 | 116 | ||
117 | QCopChannel *pcmciaChannel = new QCopChannel("QPE/Card", this); | 117 | QCopChannel *pcmciaChannel = new QCopChannel("QPE/Card", this); |
118 | connect(pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&))); | 118 | connect(pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&))); |
119 | QCopChannel *sdChannel = new QCopChannel("QPE/Card", this); | 119 | QCopChannel *sdChannel = new QCopChannel("QPE/Card", this); |
120 | connect(sdChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&))); | 120 | connect(sdChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&))); |
121 | 121 | ||
122 | cardInPcmcia0 = FALSE; | 122 | cardInPcmcia0 = FALSE; |
123 | cardInPcmcia1 = FALSE; | 123 | cardInPcmcia1 = FALSE; |
124 | cardInSd = FALSE; | 124 | cardInSd = FALSE; |
125 | 125 | ||
126 | Swapfile::status(); | 126 | Swapfile::status(); |
127 | Swapfile::getStatusPcmcia(); | 127 | Swapfile::getStatusPcmcia(); |
128 | Swapfile::getStatusSd(); | 128 | Swapfile::getStatusSd(); |
129 | } | 129 | } |
130 | 130 | ||
131 | int Swapfile::exec(const QString& arg) | 131 | int Swapfile::exec(const QString& arg) |
132 | { | 132 | { |
133 | return system((!isRoot ? "sudo " : "") + arg); | 133 | return system((!isRoot ? "sudo " : "") + arg); |
134 | } | 134 | } |
135 | 135 | ||
136 | 136 | ||
137 | Swapfile::~Swapfile() | 137 | Swapfile::~Swapfile() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | void Swapfile::cardnotify(const QCString & msg, const QByteArray &) | 141 | void Swapfile::cardnotify(const QCString & msg, const QByteArray &) |
142 | { | 142 | { |
143 | if (msg == "stabChanged()") | 143 | if (msg == "stabChanged()") |
144 | { | 144 | { |
145 | getStatusPcmcia(); | 145 | getStatusPcmcia(); |
146 | } | 146 | } |
147 | else if (msg == "mtabChanged()") | 147 | else if (msg == "mtabChanged()") |
148 | { | 148 | { |
149 | getStatusSd(); | 149 | getStatusSd(); |
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | void Swapfile::getStatusPcmcia() | 153 | void Swapfile::getStatusPcmcia() |
154 | { | 154 | { |
155 | 155 | ||
156 | bool cardWas0 = cardInPcmcia0;// remember last state | 156 | bool cardWas0 = cardInPcmcia0;// remember last state |
157 | bool cardWas1 = cardInPcmcia1; | 157 | bool cardWas1 = cardInPcmcia1; |
158 | 158 | ||
159 | QString fileName; | 159 | QString fileName; |
160 | 160 | ||
161 | // one of these 3 files should exist | 161 | // one of these 3 files should exist |
162 | if (QFile::exists("/var/run/stab")) { | 162 | if (QFile::exists("/var/run/stab")) { |
163 | fileName = "/var/run/stab"; | 163 | fileName = "/var/run/stab"; |
164 | } else if (QFile::exists("/var/state/pcmcia/stab")) { | 164 | } else if (QFile::exists("/var/state/pcmcia/stab")) { |
165 | fileName = "/var/state/pcmcia/stab"; | 165 | fileName = "/var/state/pcmcia/stab"; |
166 | } else { | 166 | } else { |
167 | fileName = "/var/lib/pcmcia/stab"; | 167 | fileName = "/var/lib/pcmcia/stab"; |
168 | } | 168 | } |
169 | 169 | ||
170 | QFile f(fileName); | 170 | QFile f(fileName); |
171 | 171 | ||
172 | if (f.open(IO_ReadOnly)) { | 172 | if (f.open(IO_ReadOnly)) { |
173 | QStringList list; | 173 | QStringList list; |
174 | QTextStream stream(&f); | 174 | QTextStream stream(&f); |
175 | QString streamIn; | 175 | QString streamIn; |
176 | streamIn = stream.read(); | 176 | streamIn = stream.read(); |
177 | list = QStringList::split("\n", streamIn); | 177 | list = QStringList::split("\n", streamIn); |
178 | for (QStringList::Iterator line = list.begin(); line != list.end(); | 178 | for (QStringList::Iterator line = list.begin(); line != list.end(); |
179 | line++) { | 179 | line++) { |
180 | if ((*line).startsWith("Socket 0:")) { | 180 | if ((*line).startsWith("Socket 0:")) { |
181 | if ((*line).startsWith("Socket 0: empty") && cardInPcmcia0) { | 181 | if ((*line).startsWith("Socket 0: empty") && cardInPcmcia0) { |
182 | cardInPcmcia0 = FALSE; | 182 | cardInPcmcia0 = FALSE; |
183 | } else if (!(*line).startsWith("Socket 0: empty") | 183 | } else if (!(*line).startsWith("Socket 0: empty") |
184 | && !cardInPcmcia0) { | 184 | && !cardInPcmcia0) { |
185 | cardInPcmcia0 = TRUE; | 185 | cardInPcmcia0 = TRUE; |
186 | } | 186 | } |
187 | } else if ((*line).startsWith("Socket 1:")) { | 187 | } else if ((*line).startsWith("Socket 1:")) { |
188 | if ((*line).startsWith("Socket 1: empty") && cardInPcmcia1) { | 188 | if ((*line).startsWith("Socket 1: empty") && cardInPcmcia1) { |
189 | cardInPcmcia1 = FALSE; | 189 | cardInPcmcia1 = FALSE; |
190 | } else if (!(*line).startsWith("Socket 1: empty") | 190 | } else if (!(*line).startsWith("Socket 1: empty") |
191 | && !cardInPcmcia1) { | 191 | && !cardInPcmcia1) { |
192 | cardInPcmcia1 = TRUE; | 192 | cardInPcmcia1 = TRUE; |
193 | } | 193 | } |
194 | } | 194 | } |
195 | } | 195 | } |
196 | f.close(); | 196 | f.close(); |
197 | 197 | ||
198 | if (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1) { | 198 | if (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1) { |
199 | QString text = QString::null; | 199 | QString text = QString::null; |
200 | QString what = QString::null; | 200 | QString what = QString::null; |
201 | if (cardWas0 != cardInPcmcia0) { | 201 | if (cardWas0 != cardInPcmcia0) { |
202 | if (cardInPcmcia0) { | 202 | if (cardInPcmcia0) { |
203 | cfRB->setEnabled(TRUE); | 203 | cfRB->setEnabled(TRUE); |
204 | } else { | 204 | } else { |
205 | cfRB->setChecked(FALSE); | 205 | cfRB->setChecked(FALSE); |
206 | cfRB->setEnabled(FALSE); | 206 | cfRB->setEnabled(FALSE); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | if (cardWas1 != cardInPcmcia1) { | 210 | if (cardWas1 != cardInPcmcia1) { |
211 | if (cardInPcmcia1) { | 211 | if (cardInPcmcia1) { |
212 | cfRB->setEnabled(TRUE); | 212 | cfRB->setEnabled(TRUE); |
213 | } else { | 213 | } else { |
214 | cfRB->setChecked(FALSE); | 214 | cfRB->setChecked(FALSE); |
215 | cfRB->setEnabled(FALSE); | 215 | cfRB->setEnabled(FALSE); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | } | 218 | } |
219 | } else { | 219 | } else { |
220 | // no file found | 220 | // no file found |
221 | odebug << "no file found" << oendl; | 221 | odebug << "no file found" << oendl; |
222 | cardInPcmcia0 = FALSE; | 222 | cardInPcmcia0 = FALSE; |
223 | cardInPcmcia1 = FALSE; | 223 | cardInPcmcia1 = FALSE; |
224 | } | 224 | } |
225 | Swapfile::cfsdchecked(); | 225 | Swapfile::cfsdchecked(); |
226 | } | 226 | } |
227 | 227 | ||
228 | 228 | ||
229 | void Swapfile::getStatusSd() | 229 | void Swapfile::getStatusSd() |
230 | { | 230 | { |
231 | 231 | ||
232 | bool cardWas = cardInSd;// remember last state | 232 | bool cardWas = cardInSd;// remember last state |
233 | cardInSd = FALSE; | 233 | cardInSd = FALSE; |
234 | 234 | ||
235 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 235 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
236 | struct mntent *me; | 236 | struct mntent *me; |
237 | FILE *mntfp = setmntent("/etc/mtab", "r"); | 237 | FILE *mntfp = setmntent("/etc/mtab", "r"); |
238 | 238 | ||
239 | if (mntfp) { | 239 | if (mntfp) { |
240 | while ((me = getmntent(mntfp)) != 0) { | 240 | while ((me = getmntent(mntfp)) != 0) { |
241 | QString fs = me->mnt_fsname; | 241 | QString fs = me->mnt_fsname; |
242 | if (fs.left(14) == "/dev/mmc/part1" || fs.left(7) == "/dev/sd" | 242 | if (fs.left(14) == "/dev/mmc/part1" || fs.left(7) == "/dev/sd" |
243 | || fs.left(9) == "/dev/mmcd") { | 243 | || fs.left(9) == "/dev/mmcd") { |
244 | cardInSd = TRUE; | 244 | cardInSd = TRUE; |
245 | show(); | 245 | show(); |
246 | } | 246 | } |
247 | } | 247 | } |
248 | endmntent(mntfp); | 248 | endmntent(mntfp); |
249 | } | 249 | } |
250 | 250 | ||
251 | if (cardWas != cardInSd) { | 251 | if (cardWas != cardInSd) { |
252 | QString text = QString::null; | 252 | QString text = QString::null; |
253 | QString what = QString::null; | 253 | QString what = QString::null; |
254 | if (cardInSd) { | 254 | if (cardInSd) { |
255 | sdRB->setEnabled(TRUE); | 255 | sdRB->setEnabled(TRUE); |
256 | } else { | 256 | } else { |
257 | sdRB->setChecked(FALSE); | 257 | sdRB->setChecked(FALSE); |
258 | sdRB->setEnabled(FALSE); | 258 | sdRB->setEnabled(FALSE); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | #else | 261 | #else |
262 | #error "Not on Linux" | 262 | #error "Not on Linux" |
263 | #endif | 263 | #endif |
264 | Swapfile::cfsdchecked(); | 264 | Swapfile::cfsdchecked(); |
265 | } | 265 | } |
266 | 266 | ||
267 | int rc=0; | 267 | int rc=0; |
268 | 268 | ||
269 | void Swapfile::swapon() | 269 | void Swapfile::swapon() |
270 | { | 270 | { |
271 | char swapcmd[128] ="swapon "; | 271 | char swapcmd[128] ="swapon "; |
272 | Swapfile::cfsdchecked(); | 272 | Swapfile::cfsdchecked(); |
273 | strcat(swapcmd,swapPath1->text()); | 273 | strcat(swapcmd,swapPath1->text()); |
274 | char *runcmd = swapcmd; | 274 | char *runcmd = swapcmd; |
275 | rc = exec(QString("%1").arg(runcmd)); | 275 | rc = exec(QString("%1").arg(runcmd)); |
276 | if (rc != 0) { | 276 | if (rc != 0) { |
277 | setStatusMessage("Failed to attach swapfile.", true); | 277 | setStatusMessage("Failed to attach swapfile.", true); |
278 | } | 278 | } |
279 | else { | 279 | else { |
280 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 280 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
281 | setStatusMessage("Swapfile activated."); | 281 | setStatusMessage("Swapfile activated."); |
282 | } | 282 | } |
283 | Swapfile::status(); | 283 | Swapfile::status(); |
284 | } | 284 | } |
285 | 285 | ||
286 | 286 | ||
287 | void Swapfile::setStatusMessage(const QString& text, bool error /* = false */) | 287 | void Swapfile::setStatusMessage(const QString& text, bool error /* = false */) |
288 | { | 288 | { |
289 | swapStatus->setText("<b>" + text + "</b>"); | 289 | swapStatus->setText("<b>" + text + "</b>"); |
290 | swapStatusIcon->setPixmap(Resource::loadPixmap(error ? "close" : "done")); | 290 | swapStatusIcon->setPixmap(Resource::loadPixmap(error ? "close" : "done")); |
291 | } | 291 | } |
292 | 292 | ||
293 | 293 | ||
294 | void Swapfile::swapoff() | 294 | void Swapfile::swapoff() |
295 | { | 295 | { |
296 | char swapcmd[128] ="swapoff "; | 296 | char swapcmd[128] ="swapoff "; |
297 | if (Swapfile::cfRB->isChecked() == TRUE) | 297 | if (Swapfile::cfRB->isChecked() == TRUE) |
298 | Swapfile::cfsdchecked(); | 298 | Swapfile::cfsdchecked(); |
299 | strcat(swapcmd,swapPath1->text()); | 299 | strcat(swapcmd,swapPath1->text()); |
300 | char *runcmd = swapcmd; | 300 | char *runcmd = swapcmd; |
301 | rc = exec(QString("%1").arg(runcmd)); | 301 | rc = exec(QString("%1").arg(runcmd)); |
302 | if (rc != 0) { | 302 | if (rc != 0) { |
303 | setStatusMessage(tr("Failed to detach swapfile."), true); | 303 | setStatusMessage(tr("Failed to detach swapfile."), true); |
304 | } | 304 | } |
305 | else { | 305 | else { |
306 | /* QMessageBox::information(this, "Information", "Swapfile is inactive!"); */ | 306 | /* QMessageBox::information(this, "Information", "Swapfile is inactive!"); */ |
307 | setStatusMessage(tr("Swapfile deactivated.")); | 307 | setStatusMessage(tr("Swapfile deactivated.")); |
308 | /* Swapfile::swapPath->clear();*/ | 308 | /* Swapfile::swapPath->clear();*/ |
309 | } | 309 | } |
310 | Swapfile::status(); | 310 | Swapfile::status(); |
311 | } | 311 | } |
312 | 312 | ||
313 | void Swapfile::cfsdchecked() | 313 | void Swapfile::cfsdchecked() |
314 | { | 314 | { |
315 | /* Swapfile::swapPath->clear();*/ | 315 | /* Swapfile::swapPath->clear();*/ |
316 | Swapfile::swapPath1->clear(); | 316 | Swapfile::swapPath1->clear(); |
317 | if (Swapfile::ramRB->isChecked() == TRUE) | 317 | if (Swapfile::ramRB->isChecked() == TRUE) |
318 | { | 318 | { |
319 | Swapfile::swapPath1->insert("/home/swapfile"); | 319 | Swapfile::swapPath1->insert("/home/swapfile"); |
320 | } | 320 | } |
321 | if (Swapfile::sdRB->isChecked() == TRUE) | 321 | if (Swapfile::sdRB->isChecked() == TRUE) |
322 | { | 322 | { |
323 | Swapfile::swapPath1->insert("/mnt/card/swapfile"); | 323 | Swapfile::swapPath1->insert("/mnt/card/swapfile"); |
324 | } | 324 | } |
325 | if (Swapfile::cfRB->isChecked() == TRUE) | 325 | if (Swapfile::cfRB->isChecked() == TRUE) |
326 | { | 326 | { |
327 | Swapfile::swapPath1->insert("/mnt/cf/swapfile"); | 327 | Swapfile::swapPath1->insert("/mnt/cf/swapfile"); |
328 | } | 328 | } |
329 | /*Swapfile::swapPath->insert(Swapfile::swapPath1->text());*/ | 329 | /*Swapfile::swapPath->insert(Swapfile::swapPath1->text());*/ |
330 | } | 330 | } |
331 | 331 | ||
332 | void Swapfile::makeswapfile() | 332 | void Swapfile::makeswapfile() |
333 | { | 333 | { |
334 | int i = swapSize->currentItem(); | 334 | int i = swapSize->currentItem(); |
335 | 335 | ||
336 | mkswapProgress->setProgress(1); | 336 | mkswapProgress->setProgress(1); |
337 | switch ( i ) { | 337 | switch ( i ) { |
338 | case 0: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=2048").arg(swapPath1->text())); | 338 | case 0: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=2048").arg(swapPath1->text())); |
339 | break; | 339 | break; |
340 | case 1: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=4096").arg(swapPath1->text())); | 340 | case 1: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=4096").arg(swapPath1->text())); |
341 | break; | 341 | break; |
342 | case 2: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=6144").arg(swapPath1->text())); | 342 | case 2: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=6144").arg(swapPath1->text())); |
343 | break; | 343 | break; |
344 | case 3: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=8192").arg(swapPath1->text())); | 344 | case 3: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=8192").arg(swapPath1->text())); |
345 | break; | 345 | break; |
346 | } | 346 | } |
347 | if (rc != 0) { | 347 | if (rc != 0) { |
348 | setStatusMessage(tr("Failed to create swapfile."), true); | 348 | setStatusMessage(tr("Failed to create swapfile."), true); |
349 | } | 349 | } |
350 | 350 | ||
351 | mkswapProgress->setProgress(2); | 351 | mkswapProgress->setProgress(2); |
352 | rc=exec(QString("mkswap %1").arg(swapPath1->text())); | 352 | rc=exec(QString("mkswap %1").arg(swapPath1->text())); |
353 | if (rc != 0) { | 353 | if (rc != 0) { |
354 | setStatusMessage(tr("Failed to initialize swapfile."), true); | 354 | setStatusMessage(tr("Failed to initialize swapfile."), true); |
355 | } | 355 | } |
356 | mkswapProgress->setProgress(3); | 356 | mkswapProgress->setProgress(3); |
357 | mkswapProgress->reset(); | 357 | mkswapProgress->reset(); |
358 | setStatusMessage(tr("Swapfile created.")); | 358 | setStatusMessage(tr("Swapfile created.")); |
359 | } | 359 | } |
360 | 360 | ||
361 | void Swapfile::removeswapfile() | 361 | void Swapfile::removeswapfile() |
362 | { | 362 | { |
363 | exec(QString("swapoff %1").arg(swapPath1->text())); | 363 | exec(QString("swapoff %1").arg(swapPath1->text())); |
364 | rc=exec(QString("rm -rf %1").arg(swapPath1->text())); | 364 | rc=exec(QString("rm -rf %1").arg(swapPath1->text())); |
365 | if (rc != 0) { | 365 | if (rc != 0) { |
366 | setStatusMessage(tr("Failed to remove swapfile."), true); | 366 | setStatusMessage(tr("Failed to remove swapfile."), true); |
367 | } | 367 | } |
368 | Swapfile::status(); | 368 | Swapfile::status(); |
369 | Swapfile::cfsdchecked(); | 369 | Swapfile::cfsdchecked(); |
370 | setStatusMessage(tr("Swapfile removed.")); | 370 | setStatusMessage(tr("Swapfile removed.")); |
371 | } | 371 | } |
372 | 372 | ||
373 | void Swapfile::status() | 373 | void Swapfile::status() |
374 | { | 374 | { |
375 | FILE *fp; | 375 | FILE *fp; |
376 | char buffer[128], swapfile[128], temp[128]; | 376 | char buffer[128], swapfile[128], temp[128]; |
377 | int swapsize=2000, i=1; | 377 | int swapsize=2000, i=1; |
378 | 378 | ||
379 | fp=fopen("/proc/swaps", "r"); | 379 | fp=fopen("/proc/swaps", "r"); |
380 | while ( (fgets(buffer,128,fp)) != NULL ) { | 380 | while ( (fgets(buffer,128,fp)) != NULL ) { |
381 | sscanf(buffer, "%s %s %d %s %s\n", swapfile, temp, &swapsize, temp, temp); | 381 | sscanf(buffer, "%s %s %d %s %s\n", swapfile, temp, &swapsize, temp, temp); |
382 | } | 382 | } |
383 | fclose(fp); | 383 | fclose(fp); |
384 | 384 | ||
385 | ramRB->setChecked(FALSE); | 385 | ramRB->setChecked(FALSE); |
386 | cfRB->setChecked(FALSE); | 386 | cfRB->setChecked(FALSE); |
387 | sdRB->setChecked(FALSE); | 387 | sdRB->setChecked(FALSE); |
388 | 388 | ||
389 | i=strcmp(swapfile, "/home/swapfile"); | 389 | i=strcmp(swapfile, "/home/swapfile"); |
390 | if ( i == 0 ) { | 390 | if ( i == 0 ) { |
391 | ramRB->setChecked(TRUE); | 391 | ramRB->setChecked(TRUE); |
392 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 392 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
393 | setStatusMessage(tr("Swapfile activated.")); | 393 | setStatusMessage(tr("Swapfile activated.")); |
394 | } | 394 | } |
395 | i=strcmp(swapfile, "/usr/mnt.rom/cf/swapfile"); | 395 | i=strcmp(swapfile, "/usr/mnt.rom/cf/swapfile"); |
396 | if ( i == 0 ) { | 396 | if ( i == 0 ) { |
397 | cfRB->setChecked(TRUE); | 397 | cfRB->setChecked(TRUE); |
398 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 398 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
399 | setStatusMessage(tr("Swapfile activated.")); | 399 | setStatusMessage(tr("Swapfile activated.")); |
400 | } | 400 | } |
401 | i=strcmp(swapfile, "/mnt/cf/swapfile"); | 401 | i=strcmp(swapfile, "/mnt/cf/swapfile"); |
402 | if ( i == 0 ) { | 402 | if ( i == 0 ) { |
403 | cfRB->setChecked(TRUE); | 403 | cfRB->setChecked(TRUE); |
404 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 404 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
405 | setStatusMessage(tr("Swapfile activated.")); | 405 | setStatusMessage(tr("Swapfile activated.")); |
406 | } | 406 | } |
407 | i=strcmp(swapfile, "/usr/mnt.rom/card/swapfile"); | 407 | i=strcmp(swapfile, "/usr/mnt.rom/card/swapfile"); |
408 | if ( i == 0 ) { | 408 | if ( i == 0 ) { |
409 | sdRB->setChecked(TRUE); | 409 | sdRB->setChecked(TRUE); |
410 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 410 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
411 | setStatusMessage(tr("Swapfile activated.")); | 411 | setStatusMessage(tr("Swapfile activated.")); |
412 | } | 412 | } |
413 | i=strcmp(swapfile, "/mnt/card/swapfile"); | 413 | i=strcmp(swapfile, "/mnt/card/swapfile"); |
414 | if ( i == 0 ) { | 414 | if ( i == 0 ) { |
415 | sdRB->setChecked(TRUE); | 415 | sdRB->setChecked(TRUE); |
416 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ | 416 | /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ |
417 | setStatusMessage(tr("Swapfile activated.")); | 417 | setStatusMessage(tr("Swapfile activated.")); |
418 | } | 418 | } |
419 | 419 | ||
420 | Swapfile::cfsdchecked(); | 420 | Swapfile::cfsdchecked(); |
421 | 421 | ||
422 | 422 | ||
423 | swapsize /=1000; | 423 | swapsize /=1000; |
424 | 424 | ||
425 | switch ( swapsize ) { | 425 | switch ( swapsize ) { |
426 | case 2: swapSize->setCurrentItem(0); | 426 | case 2: swapSize->setCurrentItem(0); |
427 | break; | 427 | break; |
428 | case 4: swapSize->setCurrentItem(1); | 428 | case 4: swapSize->setCurrentItem(1); |
429 | break; | 429 | break; |
430 | case 6: swapSize->setCurrentItem(2); | 430 | case 6: swapSize->setCurrentItem(2); |
431 | break; | 431 | break; |
432 | case 8: swapSize->setCurrentItem(3); | 432 | case 8: swapSize->setCurrentItem(3); |
433 | break; | 433 | break; |
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
437 | } | 437 | } |
438 | 438 | ||
439 | 439 | ||
diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp index c67bbd5..f036101 100644 --- a/noncore/apps/zsafe/scqtfiledlg.cpp +++ b/noncore/apps/zsafe/scqtfiledlg.cpp | |||
@@ -1,253 +1,253 @@ | |||
1 | #include "scqtfiledlg.h" | 1 | #include "scqtfiledlg.h" |
2 | 2 | ||
3 | /* OPIE */ | 3 | /* OPIE */ |
4 | #include <opie2/odebug.h> | 4 | #include <opie2/odebug.h> |
5 | using namespace Opie::Core; | 5 | using namespace Opie::Core; |
6 | 6 | ||
7 | /* QT */ | 7 | /* QT */ |
8 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qlistview.h> | 10 | #include <qlistview.h> |
11 | #include <qtoolbutton.h> | 11 | #include <qtoolbutton.h> |
12 | #include <qlayout.h> | 12 | #include <qlayout.h> |
13 | #include <qtooltip.h> | 13 | #include <qtooltip.h> |
14 | #include <qwhatsthis.h> | 14 | #include <qwhatsthis.h> |
15 | 15 | ||
16 | static const char* const image0_data[] = { | 16 | static const char* const image0_data[] = { |
17 | "24 16 3 1", | 17 | "24 16 3 1", |
18 | ". c None", | 18 | ". c None", |
19 | "# c #000040", | 19 | "# c #000040", |
20 | "a c #808080", | 20 | "a c #808080", |
21 | "........................", | 21 | "........................", |
22 | "........................", | 22 | "........................", |
23 | ".................####...", | 23 | ".................####...", |
24 | ".................####...", | 24 | ".................####...", |
25 | ".......##........#aa#...", | 25 | ".......##........#aa#...", |
26 | "......###........#aa#...", | 26 | "......###........#aa#...", |
27 | ".....####........#aa#...", | 27 | ".....####........#aa#...", |
28 | "....##############aa#...", | 28 | "....##############aa#...", |
29 | "...###aaaaaaaaaaaaaa#...", | 29 | "...###aaaaaaaaaaaaaa#...", |
30 | "..####aaaaaaaaaaaaaa#...", | 30 | "..####aaaaaaaaaaaaaa#...", |
31 | "...###aaaaaaaaaaaaaa#...", | 31 | "...###aaaaaaaaaaaaaa#...", |
32 | "....#################...", | 32 | "....#################...", |
33 | ".....####...............", | 33 | ".....####...............", |
34 | "......###...............", | 34 | "......###...............", |
35 | ".......##...............", | 35 | ".......##...............", |
36 | "........................"}; | 36 | "........................"}; |
37 | 37 | ||
38 | static const char* const image1_data[] = { | 38 | static const char* const image1_data[] = { |
39 | "24 16 4 1", | 39 | "24 16 4 1", |
40 | ". c None", | 40 | ". c None", |
41 | "a c #008080", | 41 | "a c #008080", |
42 | "b c #808080", | 42 | "b c #808080", |
43 | "# c #ff0000", | 43 | "# c #ff0000", |
44 | "........................", | 44 | "........................", |
45 | "........................", | 45 | "........................", |
46 | "...####..........####...", | 46 | "...####..........####...", |
47 | "...#####........#####...", | 47 | "...#####........#####...", |
48 | "....######.....#####a...", | 48 | "....######.....#####a...", |
49 | ".....######...#####ba...", | 49 | ".....######...#####ba...", |
50 | ".....aa###########bba...", | 50 | ".....aa###########bba...", |
51 | "....aaaaa#######aabba...", | 51 | "....aaaaa#######aabba...", |
52 | "...aaabbb######bbbbba...", | 52 | "...aaabbb######bbbbba...", |
53 | "..aaaabb########bbbba...", | 53 | "..aaaabb########bbbba...", |
54 | "...aaa############bba...", | 54 | "...aaa############bba...", |
55 | "....a######aaa#####aa...", | 55 | "....a######aaa#####aa...", |
56 | "....######.....######...", | 56 | "....######.....######...", |
57 | "...#####a........####...", | 57 | "...#####a........####...", |
58 | "...####aa.........###...", | 58 | "...####aa.........###...", |
59 | "........................"}; | 59 | "........................"}; |
60 | 60 | ||
61 | static const char* const image2_data[] = { | 61 | static const char* const image2_data[] = { |
62 | "17 15 4 1", | 62 | "17 15 4 1", |
63 | "# c #000000", | 63 | "# c #000000", |
64 | ". c #dcdcdc", | 64 | ". c #dcdcdc", |
65 | "a c #ffff00", | 65 | "a c #ffff00", |
66 | "b c #ffffff", | 66 | "b c #ffffff", |
67 | ".................", | 67 | ".................", |
68 | "............#....", | 68 | "............#....", |
69 | ".................", | 69 | ".................", |
70 | "............#....", | 70 | "............#....", |
71 | ".........#.....#.", | 71 | ".........#.....#.", |
72 | "....####..#.#.#..", | 72 | "....####..#.#.#..", |
73 | "...#abab#..#.#...", | 73 | "...#abab#..#.#...", |
74 | "..##########..#.#", | 74 | "..##########..#.#", |
75 | "..#babababab##...", | 75 | "..#babababab##...", |
76 | "..#ababababa#.#..", | 76 | "..#ababababa#.#..", |
77 | "..#babababab#..#.", | 77 | "..#babababab#..#.", |
78 | "..#ababababa#....", | 78 | "..#ababababa#....", |
79 | "..#babababab#....", | 79 | "..#babababab#....", |
80 | "..#ababababa#....", | 80 | "..#ababababa#....", |
81 | "..###########...."}; | 81 | "..###########...."}; |
82 | 82 | ||
83 | 83 | ||
84 | /* | 84 | /* |
85 | * Constructs a ScQtFileDlg which is a child of 'parent', with the | 85 | * Constructs a ScQtFileDlg which is a child of 'parent', with the |
86 | * name 'name' and widget flags set to 'f' | 86 | * name 'name' and widget flags set to 'f' |
87 | * | 87 | * |
88 | * The dialog will by default be modeless, unless you set 'modal' to | 88 | * The dialog will by default be modeless, unless you set 'modal' to |
89 | * TRUE to construct a modal dialog. | 89 | * TRUE to construct a modal dialog. |
90 | */ | 90 | */ |
91 | ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) | 91 | ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) |
92 | : QDialog( parent, name, modal, fl ) | 92 | : QDialog( parent, name, modal, fl ) |
93 | { | 93 | { |
94 | QPixmap image0( ( const char** ) image0_data ); | 94 | QPixmap image0( ( const char** ) image0_data ); |
95 | QPixmap image1( ( const char** ) image1_data ); | 95 | QPixmap image1( ( const char** ) image1_data ); |
96 | QPixmap image2( ( const char** ) image2_data ); | 96 | QPixmap image2( ( const char** ) image2_data ); |
97 | if ( !name ) | 97 | if ( !name ) |
98 | setName( "ScQtFileDlg" ); | 98 | setName( "ScQtFileDlg" ); |
99 | resize( 196, 279 ); | 99 | resize( 196, 279 ); |
100 | if (!name) | 100 | if (!name) |
101 | setCaption( tr( "FileDlg" ) ); | 101 | setCaption( tr( "FileDlg" ) ); |
102 | else | 102 | else |
103 | setCaption(name); | 103 | setCaption(name); |
104 | ScQtFileDlgLayout = new QVBoxLayout( this ); | 104 | ScQtFileDlgLayout = new QVBoxLayout( this ); |
105 | ScQtFileDlgLayout->setSpacing( 6 ); | 105 | ScQtFileDlgLayout->setSpacing( 6 ); |
106 | ScQtFileDlgLayout->setMargin( 11 ); | 106 | ScQtFileDlgLayout->setMargin( 11 ); |
107 | 107 | ||
108 | Layout5 = new QVBoxLayout; | 108 | Layout5 = new QVBoxLayout; |
109 | Layout5->setSpacing( 6 ); | 109 | Layout5->setSpacing( 6 ); |
110 | Layout5->setMargin( 0 ); | 110 | Layout5->setMargin( 0 ); |
111 | 111 | ||
112 | Layout4 = new QVBoxLayout; | 112 | Layout4 = new QVBoxLayout; |
113 | Layout4->setSpacing( 6 ); | 113 | Layout4->setSpacing( 6 ); |
114 | Layout4->setMargin( 0 ); | 114 | Layout4->setMargin( 0 ); |
115 | 115 | ||
116 | Layout3 = new QHBoxLayout; | 116 | Layout3 = new QHBoxLayout; |
117 | Layout3->setSpacing( 6 ); | 117 | Layout3->setSpacing( 6 ); |
118 | Layout3->setMargin( 0 ); | 118 | Layout3->setMargin( 0 ); |
119 | 119 | ||
120 | TypeComboBox = new QComboBox( FALSE, this, "TypeComboBox" ); | 120 | TypeComboBox = new QComboBox( FALSE, this, "TypeComboBox" ); |
121 | TypeComboBox->setEditable( TRUE ); | 121 | TypeComboBox->setEditable( TRUE ); |
122 | TypeComboBox->setInsertionPolicy( QComboBox::AtBottom ); | 122 | TypeComboBox->setInsertionPolicy( QComboBox::AtBottom ); |
123 | TypeComboBox->setAutoCompletion( FALSE ); | 123 | TypeComboBox->setAutoCompletion( FALSE ); |
124 | TypeComboBox->setDuplicatesEnabled( FALSE ); | 124 | TypeComboBox->setDuplicatesEnabled( FALSE ); |
125 | QToolTip::add( TypeComboBox, tr( "file type filter" ) ); | 125 | QToolTip::add( TypeComboBox, tr( "file type filter" ) ); |
126 | QWhatsThis::add( TypeComboBox, tr( "ComboBox FileTypeFilter\n" | 126 | QWhatsThis::add( TypeComboBox, tr( "ComboBox FileTypeFilter\n" |
127 | "\n" | 127 | "\n" |
128 | "edit or select the filter" ) ); | 128 | "edit or select the filter" ) ); |
129 | Layout3->addWidget( TypeComboBox ); | 129 | Layout3->addWidget( TypeComboBox ); |
130 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | 130 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
131 | Layout3->addItem( spacer ); | 131 | Layout3->addItem( spacer ); |
132 | 132 | ||
133 | OkButton = new QToolButton( this, "OkButton" ); | 133 | OkButton = new QToolButton( this, "OkButton" ); |
134 | OkButton->setText( tr( "" ) ); | 134 | OkButton->setText( "" ); |
135 | OkButton->setPixmap( image0 ); | 135 | OkButton->setPixmap( image0 ); |
136 | OkButton->setUsesBigPixmap( FALSE ); | 136 | OkButton->setUsesBigPixmap( FALSE ); |
137 | QToolTip::add( OkButton, tr( "confirms the selection and closes the form" ) ); | 137 | QToolTip::add( OkButton, tr( "confirms the selection and closes the form" ) ); |
138 | QWhatsThis::add( OkButton, tr( "OKButton" ) ); | 138 | QWhatsThis::add( OkButton, tr( "OKButton" ) ); |
139 | Layout3->addWidget( OkButton ); | 139 | Layout3->addWidget( OkButton ); |
140 | 140 | ||
141 | CancelButton = new QToolButton( this, "CancelButton" ); | 141 | CancelButton = new QToolButton( this, "CancelButton" ); |
142 | CancelButton->setText( tr( "" ) ); | 142 | CancelButton->setText( "" ); |
143 | CancelButton->setPixmap( image1 ); | 143 | CancelButton->setPixmap( image1 ); |
144 | CancelButton->setUsesBigPixmap( FALSE ); | 144 | CancelButton->setUsesBigPixmap( FALSE ); |
145 | QToolTip::add( CancelButton, tr( "cancels the selection and closes the form" ) ); | 145 | QToolTip::add( CancelButton, tr( "cancels the selection and closes the form" ) ); |
146 | QWhatsThis::add( CancelButton, tr( "CancelButton" ) ); | 146 | QWhatsThis::add( CancelButton, tr( "CancelButton" ) ); |
147 | Layout3->addWidget( CancelButton ); | 147 | Layout3->addWidget( CancelButton ); |
148 | Layout4->addLayout( Layout3 ); | 148 | Layout4->addLayout( Layout3 ); |
149 | 149 | ||
150 | Layout3_2 = new QHBoxLayout; | 150 | Layout3_2 = new QHBoxLayout; |
151 | Layout3_2->setSpacing( 6 ); | 151 | Layout3_2->setSpacing( 6 ); |
152 | Layout3_2->setMargin( 0 ); | 152 | Layout3_2->setMargin( 0 ); |
153 | 153 | ||
154 | FNameLineEdit = new QLineEdit( this, "FNameLineEdit" ); | 154 | FNameLineEdit = new QLineEdit( this, "FNameLineEdit" ); |
155 | QToolTip::add( FNameLineEdit, tr( "shows the selected filename" ) ); | 155 | QToolTip::add( FNameLineEdit, tr( "shows the selected filename" ) ); |
156 | QWhatsThis::add( FNameLineEdit, tr( "Filename LineEdit\n" | 156 | QWhatsThis::add( FNameLineEdit, tr( "Filename LineEdit\n" |
157 | "\n" | 157 | "\n" |
158 | "shows the selected file\n" | 158 | "shows the selected file\n" |
159 | "and allows the direct filename\n" | 159 | "and allows the direct filename\n" |
160 | "edit" ) ); | 160 | "edit" ) ); |
161 | Layout3_2->addWidget( FNameLineEdit ); | 161 | Layout3_2->addWidget( FNameLineEdit ); |
162 | 162 | ||
163 | MkDirButton = new QToolButton( this, "MkDirButton" ); | 163 | MkDirButton = new QToolButton( this, "MkDirButton" ); |
164 | MkDirButton->setText( tr( "" ) ); | 164 | MkDirButton->setText( "" ); |
165 | MkDirButton->setPixmap( image2 ); | 165 | MkDirButton->setPixmap( image2 ); |
166 | MkDirButton->setUsesBigPixmap( FALSE ); | 166 | MkDirButton->setUsesBigPixmap( FALSE ); |
167 | QToolTip::add( MkDirButton, tr( "confirms the selection and closes the form" ) ); | 167 | QToolTip::add( MkDirButton, tr( "confirms the selection and closes the form" ) ); |
168 | QWhatsThis::add( MkDirButton, tr( "OKButton" ) ); | 168 | QWhatsThis::add( MkDirButton, tr( "OKButton" ) ); |
169 | Layout3_2->addWidget( MkDirButton ); | 169 | Layout3_2->addWidget( MkDirButton ); |
170 | Layout4->addLayout( Layout3_2 ); | 170 | Layout4->addLayout( Layout3_2 ); |
171 | 171 | ||
172 | DirComboBox = new QComboBox( FALSE, this, "DirComboBox" ); | 172 | DirComboBox = new QComboBox( FALSE, this, "DirComboBox" ); |
173 | DirComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DirComboBox->sizePolicy().hasHeightForWidth() ) ); | 173 | DirComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DirComboBox->sizePolicy().hasHeightForWidth() ) ); |
174 | DirComboBox->setEditable( TRUE ); | 174 | DirComboBox->setEditable( TRUE ); |
175 | DirComboBox->setDuplicatesEnabled( FALSE ); | 175 | DirComboBox->setDuplicatesEnabled( FALSE ); |
176 | QWhatsThis::add( DirComboBox, tr( "ComboBox Directory \n" | 176 | QWhatsThis::add( DirComboBox, tr( "ComboBox Directory \n" |
177 | "edit or select the directories name" ) ); | 177 | "edit or select the directories name" ) ); |
178 | Layout4->addWidget( DirComboBox ); | 178 | Layout4->addWidget( DirComboBox ); |
179 | Layout5->addLayout( Layout4 ); | 179 | Layout5->addLayout( Layout4 ); |
180 | 180 | ||
181 | ListView = new QListView( this, "ListView" ); | 181 | ListView = new QListView( this, "ListView" ); |
182 | ListView->addColumn( tr( "Name" ) ); | 182 | ListView->addColumn( tr( "Name" ) ); |
183 | ListView->addColumn( tr( "size" ) ); | 183 | ListView->addColumn( tr( "size" ) ); |
184 | ListView->addColumn( tr( "type" ) ); | 184 | ListView->addColumn( tr( "type" ) ); |
185 | ListView->setRootIsDecorated( TRUE ); | 185 | ListView->setRootIsDecorated( TRUE ); |
186 | QToolTip::add( ListView, tr( "directory listview" ) ); | 186 | QToolTip::add( ListView, tr( "directory listview" ) ); |
187 | QWhatsThis::add( ListView, tr( "Directory ListView\n" | 187 | QWhatsThis::add( ListView, tr( "Directory ListView\n" |
188 | "\n" | 188 | "\n" |
189 | "shows the list of dirs and files" ) ); | 189 | "shows the list of dirs and files" ) ); |
190 | Layout5->addWidget( ListView ); | 190 | Layout5->addWidget( ListView ); |
191 | ScQtFileDlgLayout->addLayout( Layout5 ); | 191 | ScQtFileDlgLayout->addLayout( Layout5 ); |
192 | 192 | ||
193 | // signals and slots connections | 193 | // signals and slots connections |
194 | connect( OkButton, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); | 194 | connect( OkButton, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); |
195 | connect( DirComboBox, SIGNAL( activated(int) ), this, SLOT( slotDirComboBoxChanged(int) ) ); | 195 | connect( DirComboBox, SIGNAL( activated(int) ), this, SLOT( slotDirComboBoxChanged(int) ) ); |
196 | connect( TypeComboBox, SIGNAL( activated(int) ), this, SLOT( slotTypeComboBoxChanged(int) ) ); | 196 | connect( TypeComboBox, SIGNAL( activated(int) ), this, SLOT( slotTypeComboBoxChanged(int) ) ); |
197 | connect( CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); | 197 | connect( CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); |
198 | connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) ); | 198 | connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) ); |
199 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) ); | 199 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) ); |
200 | connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem*) ) ); | 200 | connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem*) ) ); |
201 | connect( FNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileTextChanged(const QString&) ) ); | 201 | connect( FNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileTextChanged(const QString&) ) ); |
202 | connect( FNameLineEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) ); | 202 | connect( FNameLineEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) ); |
203 | connect( MkDirButton, SIGNAL( clicked() ), this, SLOT( slotMkDir() ) ); | 203 | connect( MkDirButton, SIGNAL( clicked() ), this, SLOT( slotMkDir() ) ); |
204 | } | 204 | } |
205 | 205 | ||
206 | /* | 206 | /* |
207 | * Destroys the object and frees any allocated resources | 207 | * Destroys the object and frees any allocated resources |
208 | */ | 208 | */ |
209 | ScQtFileDlg::~ScQtFileDlg() | 209 | ScQtFileDlg::~ScQtFileDlg() |
210 | { | 210 | { |
211 | // no need to delete child widgets, Qt does it all for us | 211 | // no need to delete child widgets, Qt does it all for us |
212 | } | 212 | } |
213 | 213 | ||
214 | void ScQtFileDlg::slotCancel() | 214 | void ScQtFileDlg::slotCancel() |
215 | { | 215 | { |
216 | owarn << "ScQtFileDlg::slotCancel(): Not implemented yet!" << oendl; | 216 | owarn << "ScQtFileDlg::slotCancel(): Not implemented yet!" << oendl; |
217 | } | 217 | } |
218 | 218 | ||
219 | void ScQtFileDlg::slotDirComboBoxChanged( int ) | 219 | void ScQtFileDlg::slotDirComboBoxChanged( int ) |
220 | { | 220 | { |
221 | owarn << "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" << oendl; | 221 | owarn << "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" << oendl; |
222 | } | 222 | } |
223 | 223 | ||
224 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) | 224 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) |
225 | { | 225 | { |
226 | owarn << "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" << oendl; | 226 | owarn << "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" << oendl; |
227 | } | 227 | } |
228 | 228 | ||
229 | void ScQtFileDlg::slotFileTextChanged( const QString & ) | 229 | void ScQtFileDlg::slotFileTextChanged( const QString & ) |
230 | { | 230 | { |
231 | owarn << "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" << oendl; | 231 | owarn << "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" << oendl; |
232 | } | 232 | } |
233 | 233 | ||
234 | void ScQtFileDlg::slotMkDir() | 234 | void ScQtFileDlg::slotMkDir() |
235 | { | 235 | { |
236 | owarn << "ScQtFileDlg::slotMkDir(): Not implemented yet!" << oendl; | 236 | owarn << "ScQtFileDlg::slotMkDir(): Not implemented yet!" << oendl; |
237 | } | 237 | } |
238 | 238 | ||
239 | void ScQtFileDlg::slotOK() | 239 | void ScQtFileDlg::slotOK() |
240 | { | 240 | { |
241 | owarn << "ScQtFileDlg::slotOK(): Not implemented yet!" << oendl; | 241 | owarn << "ScQtFileDlg::slotOK(): Not implemented yet!" << oendl; |
242 | } | 242 | } |
243 | 243 | ||
244 | void ScQtFileDlg::slotSelectionChanged(QListViewItem *) | 244 | void ScQtFileDlg::slotSelectionChanged(QListViewItem *) |
245 | { | 245 | { |
246 | owarn << "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" << oendl; | 246 | owarn << "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" << oendl; |
247 | } | 247 | } |
248 | 248 | ||
249 | void ScQtFileDlg::slotTypeComboBoxChanged( int ) | 249 | void ScQtFileDlg::slotTypeComboBoxChanged( int ) |
250 | { | 250 | { |
251 | owarn << "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" << oendl; | 251 | owarn << "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" << oendl; |
252 | } | 252 | } |
253 | 253 | ||
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index ca3ff52..189453e 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -1,1376 +1,1376 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** | 2 | ** |
3 | ** Created: Sat Apr 6 17:57:45 2002 | 3 | ** Created: Sat Apr 6 17:57:45 2002 |
4 | ** | 4 | ** |
5 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> | 5 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> |
6 | ** | 6 | ** |
7 | ** $Id$ | 7 | ** $Id$ |
8 | ** | 8 | ** |
9 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html | 9 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html |
10 | ** | 10 | ** |
11 | ** Compile Flags: | 11 | ** Compile Flags: |
12 | ** Zaurus arm : -DNO_OPIE | 12 | ** Zaurus arm : -DNO_OPIE |
13 | ** Zaurus Opie arm: none | 13 | ** Zaurus Opie arm: none |
14 | ** Linux Desktop : -DDESKTOP | 14 | ** Linux Desktop : -DDESKTOP |
15 | ** Windows Desktop: -DDESKTOP -DWIN32 | 15 | ** Windows Desktop: -DDESKTOP -DWIN32 |
16 | ** | 16 | ** |
17 | ** for japanese version additional use: -DJPATCH_HDE | 17 | ** for japanese version additional use: -DJPATCH_HDE |
18 | ** | 18 | ** |
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | #include "zsafe.h" | 20 | #include "zsafe.h" |
21 | #include "newdialog.h" | 21 | #include "newdialog.h" |
22 | #include "searchdialog.h" | 22 | #include "searchdialog.h" |
23 | #include "categorydialog.h" | 23 | #include "categorydialog.h" |
24 | #include "passworddialog.h" | 24 | #include "passworddialog.h" |
25 | #include "infoform.h" | 25 | #include "infoform.h" |
26 | #include "zlistview.h" | 26 | #include "zlistview.h" |
27 | #include "shadedlistitem.h" | 27 | #include "shadedlistitem.h" |
28 | 28 | ||
29 | #ifndef DESKTOP | 29 | #ifndef DESKTOP |
30 | #ifndef NO_OPIE | 30 | #ifndef NO_OPIE |
31 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
32 | #include <opie2/odebug.h> | 32 | #include <opie2/odebug.h> |
33 | using namespace Opie::Core; | 33 | using namespace Opie::Core; |
34 | using namespace Opie::Ui; | 34 | using namespace Opie::Ui; |
35 | #else | 35 | #else |
36 | #include "scqtfileedit.h" | 36 | #include "scqtfileedit.h" |
37 | #endif | 37 | #endif |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include <qclipboard.h> | 40 | #include <qclipboard.h> |
41 | 41 | ||
42 | #include <sys/types.h> | 42 | #include <sys/types.h> |
43 | #include <sys/stat.h> | 43 | #include <sys/stat.h> |
44 | #include <fcntl.h> | 44 | #include <fcntl.h> |
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | #ifndef WIN32 | 46 | #ifndef WIN32 |
47 | #include <unistd.h> | 47 | #include <unistd.h> |
48 | #endif | 48 | #endif |
49 | #include <string.h> | 49 | #include <string.h> |
50 | #include <errno.h> | 50 | #include <errno.h> |
51 | 51 | ||
52 | #include <qmenubar.h> | 52 | #include <qmenubar.h> |
53 | #include <qpopupmenu.h> | 53 | #include <qpopupmenu.h> |
54 | 54 | ||
55 | #ifdef DESKTOP | 55 | #ifdef DESKTOP |
56 | #include <qfiledialog.h> | 56 | #include <qfiledialog.h> |
57 | #ifndef WIN32 | 57 | #ifndef WIN32 |
58 | #include <qsettings.h> | 58 | #include <qsettings.h> |
59 | #else | 59 | #else |
60 | #include "qsettings.h" | 60 | #include "qsettings.h" |
61 | #endif | 61 | #endif |
62 | #include <qapplication.h> | 62 | #include <qapplication.h> |
63 | #else | 63 | #else |
64 | #include <qfile.h> | 64 | #include <qfile.h> |
65 | #include <qpe/fileselector.h> | 65 | #include <qpe/fileselector.h> |
66 | #include <qpe/global.h> | 66 | #include <qpe/global.h> |
67 | #include <qpe/qpeapplication.h> | 67 | #include <qpe/qpeapplication.h> |
68 | #include <qpe/resource.h> | 68 | #include <qpe/resource.h> |
69 | #include <qpe/config.h> | 69 | #include <qpe/config.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #include <qtimer.h> | 72 | #include <qtimer.h> |
73 | #include <qlayout.h> | 73 | #include <qlayout.h> |
74 | #include <qmessagebox.h> | 74 | #include <qmessagebox.h> |
75 | #include <qfile.h> | 75 | #include <qfile.h> |
76 | #include <qtextstream.h> | 76 | #include <qtextstream.h> |
77 | #include <qheader.h> | 77 | #include <qheader.h> |
78 | #include <qlistview.h> | 78 | #include <qlistview.h> |
79 | #include <qtoolbutton.h> | 79 | #include <qtoolbutton.h> |
80 | #include <qvariant.h> | 80 | #include <qvariant.h> |
81 | #include <qtooltip.h> | 81 | #include <qtooltip.h> |
82 | #include <qwhatsthis.h> | 82 | #include <qwhatsthis.h> |
83 | #include <qimage.h> | 83 | #include <qimage.h> |
84 | #include <qpixmap.h> | 84 | #include <qpixmap.h> |
85 | #include <qlineedit.h> | 85 | #include <qlineedit.h> |
86 | #include <qmultilineedit.h> | 86 | #include <qmultilineedit.h> |
87 | #include <qregexp.h> | 87 | #include <qregexp.h> |
88 | #include <qdir.h> | 88 | #include <qdir.h> |
89 | #include <qtextbrowser.h> | 89 | #include <qtextbrowser.h> |
90 | #include <qlabel.h> | 90 | #include <qlabel.h> |
91 | #include <qcombobox.h> | 91 | #include <qcombobox.h> |
92 | 92 | ||
93 | #include "krc2.h" | 93 | #include "krc2.h" |
94 | 94 | ||
95 | #include "wait.h" | 95 | #include "wait.h" |
96 | 96 | ||
97 | extern int DeskW, DeskH; | 97 | extern int DeskW, DeskH; |
98 | #ifdef DESKTOP | 98 | #ifdef DESKTOP |
99 | extern QApplication *appl; | 99 | extern QApplication *appl; |
100 | #else | 100 | #else |
101 | extern QPEApplication *appl; | 101 | extern QPEApplication *appl; |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #ifdef JPATCH_HDE | 104 | #ifdef JPATCH_HDE |
105 | #define tr(arg) arg | 105 | #define tr(arg) arg |
106 | #endif | 106 | #endif |
107 | 107 | ||
108 | 108 | ||
109 | #ifdef DESKTOP | 109 | #ifdef DESKTOP |
110 | #ifndef WIN32 | 110 | #ifndef WIN32 |
111 | const QString APP_KEY="/.zsafe/"; | 111 | const QString APP_KEY="/.zsafe/"; |
112 | #else | 112 | #else |
113 | const QString APP_KEY=""; | 113 | const QString APP_KEY=""; |
114 | #endif | 114 | #endif |
115 | #else | 115 | #else |
116 | const QString APP_KEY=""; | 116 | const QString APP_KEY=""; |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | // include xmp images | 119 | // include xmp images |
120 | #include "pics/zsafe/copy.xpm" | 120 | #include "pics/zsafe/copy.xpm" |
121 | #include "pics/zsafe/cut.xpm" | 121 | #include "pics/zsafe/cut.xpm" |
122 | #include "pics/zsafe/edit.xpm" | 122 | #include "pics/zsafe/edit.xpm" |
123 | #include "pics/zsafe/editdelete.xpm" | 123 | #include "pics/zsafe/editdelete.xpm" |
124 | #include "pics/zsafe/find.xpm" | 124 | #include "pics/zsafe/find.xpm" |
125 | #include "pics/zsafe/folder_open.xpm" | 125 | #include "pics/zsafe/folder_open.xpm" |
126 | #include "pics/zsafe/help_icon.xpm" | 126 | #include "pics/zsafe/help_icon.xpm" |
127 | #include "pics/zsafe/new.xpm" | 127 | #include "pics/zsafe/new.xpm" |
128 | #include "pics/zsafe/paste.xpm" | 128 | #include "pics/zsafe/paste.xpm" |
129 | #include "pics/zsafe/quit_icon.xpm" | 129 | #include "pics/zsafe/quit_icon.xpm" |
130 | #include "pics/zsafe/save.xpm" | 130 | #include "pics/zsafe/save.xpm" |
131 | #include "pics/zsafe/trash.xpm" | 131 | #include "pics/zsafe/trash.xpm" |
132 | #include "pics/zsafe/expand.xpm" | 132 | #include "pics/zsafe/expand.xpm" |
133 | #include "pics/zsafe/export.xpm" | 133 | #include "pics/zsafe/export.xpm" |
134 | #include "pics/zsafe/import.xpm" | 134 | #include "pics/zsafe/import.xpm" |
135 | #include "pics/zsafe/zsafe.xpm" | 135 | #include "pics/zsafe/zsafe.xpm" |
136 | 136 | ||
137 | static const char* const bank_cards_data[] = { | 137 | static const char* const bank_cards_data[] = { |
138 | "14 14 16 1", | 138 | "14 14 16 1", |
139 | ". c None", | 139 | ". c None", |
140 | "# c #000000", | 140 | "# c #000000", |
141 | "b c #0000de", | 141 | "b c #0000de", |
142 | "a c #0000e6", | 142 | "a c #0000e6", |
143 | "j c #41de83", | 143 | "j c #41de83", |
144 | "k c #4acecd", | 144 | "k c #4acecd", |
145 | "h c #4aced5", | 145 | "h c #4aced5", |
146 | "g c #5a40cd", | 146 | "g c #5a40cd", |
147 | "d c #5a44d5", | 147 | "d c #5a44d5", |
148 | "l c #9440d5", | 148 | "l c #9440d5", |
149 | "m c #b4ce4a", | 149 | "m c #b4ce4a", |
150 | "n c #cd4883", | 150 | "n c #cd4883", |
151 | "e c #d5ae10", | 151 | "e c #d5ae10", |
152 | "f c #de3ce6", | 152 | "f c #de3ce6", |
153 | "i c #e640e6", | 153 | "i c #e640e6", |
154 | "c c #ffffff", | 154 | "c c #ffffff", |
155 | "..............", | 155 | "..............", |
156 | ".###########..", | 156 | ".###########..", |
157 | ".#ababababa#..", | 157 | ".#ababababa#..", |
158 | ".#babbbabbb#..", | 158 | ".#babbbabbb#..", |
159 | ".#ccccccccc#..", | 159 | ".#ccccccccc#..", |
160 | ".#cdcefcghc#..", | 160 | ".#cdcefcghc#..", |
161 | ".#ccccccccc#..", | 161 | ".#ccccccccc#..", |
162 | ".#cicjkclic#..", | 162 | ".#cicjkclic#..", |
163 | ".#ccccccccc#..", | 163 | ".#ccccccccc#..", |
164 | ".#cmchlcnec#..", | 164 | ".#cmchlcnec#..", |
165 | ".#ccccccccc#..", | 165 | ".#ccccccccc#..", |
166 | ".###########..", | 166 | ".###########..", |
167 | "..............", | 167 | "..............", |
168 | ".............."}; | 168 | ".............."}; |
169 | 169 | ||
170 | 170 | ||
171 | static const char* const passwords_data[] = { | 171 | static const char* const passwords_data[] = { |
172 | "16 16 20 1", | 172 | "16 16 20 1", |
173 | ". c None", | 173 | ". c None", |
174 | "# c #000000", | 174 | "# c #000000", |
175 | "r c #000083", | 175 | "r c #000083", |
176 | "p c #0000c5", | 176 | "p c #0000c5", |
177 | "q c #0000ff", | 177 | "q c #0000ff", |
178 | "n c #008100", | 178 | "n c #008100", |
179 | "l c #00c200", | 179 | "l c #00c200", |
180 | "m c #00ff00", | 180 | "m c #00ff00", |
181 | "j c #838100", | 181 | "j c #838100", |
182 | "a c #c55900", | 182 | "a c #c55900", |
183 | "h c #c5c200", | 183 | "h c #c5c200", |
184 | "o c #c5c2ff", | 184 | "o c #c5c2ff", |
185 | "k c #c5ffc5", | 185 | "k c #c5ffc5", |
186 | "f c #ff0000", | 186 | "f c #ff0000", |
187 | "d c #ff8100", | 187 | "d c #ff8100", |
188 | "b c #ffaa5a", | 188 | "b c #ffaa5a", |
189 | "e c #ffc2c5", | 189 | "e c #ffc2c5", |
190 | "c c #ffdeac", | 190 | "c c #ffdeac", |
191 | "i c #ffff00", | 191 | "i c #ffff00", |
192 | "g c #ffffc5", | 192 | "g c #ffffc5", |
193 | "............###.", | 193 | "............###.", |
194 | "...........#abb#", | 194 | "...........#abb#", |
195 | "..........#cbab#", | 195 | "..........#cbab#", |
196 | ".........#cbdd#.", | 196 | ".........#cbdd#.", |
197 | "######..#cbdd#..", | 197 | "######..#cbdd#..", |
198 | "#eeff#..#add#...", | 198 | "#eeff#..#add#...", |
199 | "#eeff#######....", | 199 | "#eeff#######....", |
200 | "#ccdbdd#........", | 200 | "#ccdbdd#........", |
201 | "#dddbdd###......", | 201 | "#dddbdd###......", |
202 | "#gghihhjj#......", | 202 | "#gghihhjj#......", |
203 | "#hhhihhjj###....", | 203 | "#hhhihhjj###....", |
204 | "#kklmllnnnn#....", | 204 | "#kklmllnnnn#....", |
205 | "#lllmllnnnn#....", | 205 | "#lllmllnnnn#....", |
206 | "#oopqpprprr#....", | 206 | "#oopqpprprr#....", |
207 | "#oopqpprprr#....", | 207 | "#oopqpprprr#....", |
208 | "############...."}; | 208 | "############...."}; |
209 | 209 | ||
210 | static const char* const software_data[] = { | 210 | static const char* const software_data[] = { |
211 | "16 16 5 1", | 211 | "16 16 5 1", |
212 | ". c None", | 212 | ". c None", |
213 | "# c #000000", | 213 | "# c #000000", |
214 | "b c #838183", | 214 | "b c #838183", |
215 | "c c #c5ffff", | 215 | "c c #c5ffff", |
216 | "a c #ffffff", | 216 | "a c #ffffff", |
217 | "................", | 217 | "................", |
218 | ".##############.", | 218 | ".##############.", |
219 | "#aaaaaaaaaaaaaa#", | 219 | "#aaaaaaaaaaaaaa#", |
220 | "#abbbbbbbbbbbbb#", | 220 | "#abbbbbbbbbbbbb#", |
221 | "#ab##########ab#", | 221 | "#ab##########ab#", |
222 | "#ab#c########ab#", | 222 | "#ab#c########ab#", |
223 | "#ab#c#c######ab#", | 223 | "#ab#c#c######ab#", |
224 | "#ab##########ab#", | 224 | "#ab##########ab#", |
225 | "#ab##########ab#", | 225 | "#ab##########ab#", |
226 | "#ab##########ab#", | 226 | "#ab##########ab#", |
227 | "#ab##########ab#", | 227 | "#ab##########ab#", |
228 | "#ab##########ab#", | 228 | "#ab##########ab#", |
229 | "#aaaaaaaaaaaaab#", | 229 | "#aaaaaaaaaaaaab#", |
230 | "#bbbbbbbbbbbbbb#", | 230 | "#bbbbbbbbbbbbbb#", |
231 | ".##############.", | 231 | ".##############.", |
232 | "................"}; | 232 | "................"}; |
233 | 233 | ||
234 | static const char* const general_data[] = { | 234 | static const char* const general_data[] = { |
235 | "14 14 98 2", | 235 | "14 14 98 2", |
236 | "Qt c None", | 236 | "Qt c None", |
237 | ".k c #000000", | 237 | ".k c #000000", |
238 | "#x c #080808", | 238 | "#x c #080808", |
239 | "#F c #101008", | 239 | "#F c #101008", |
240 | "#q c #101010", | 240 | "#q c #101010", |
241 | "#i c #101410", | 241 | "#i c #101410", |
242 | "## c #101810", | 242 | "## c #101810", |
243 | ".m c #181818", | 243 | ".m c #181818", |
244 | ".3 c #181c18", | 244 | ".3 c #181c18", |
245 | ".I c #182018", | 245 | ".I c #182018", |
246 | ".T c #202420", | 246 | ".T c #202420", |
247 | "#D c #202820", | 247 | "#D c #202820", |
248 | "#y c #292c29", | 248 | "#y c #292c29", |
249 | ".c c #293029", | 249 | ".c c #293029", |
250 | ".d c #313031", | 250 | ".d c #313031", |
251 | "#E c #313429", | 251 | "#E c #313429", |
252 | "#r c #313831", | 252 | "#r c #313831", |
253 | ".j c #393c31", | 253 | ".j c #393c31", |
254 | "#j c #394039", | 254 | "#j c #394039", |
255 | "#C c #414841", | 255 | "#C c #414841", |
256 | ".w c #4a554a", | 256 | ".w c #4a554a", |
257 | ".a c #4a594a", | 257 | ".a c #4a594a", |
258 | ".# c #525052", | 258 | ".# c #525052", |
259 | ".l c #52594a", | 259 | ".l c #52594a", |
260 | "#f c #525952", | 260 | "#f c #525952", |
261 | "#v c #525d52", | 261 | "#v c #525d52", |
262 | ".O c #5a4c4a", | 262 | ".O c #5a4c4a", |
263 | ".9 c #5a595a", | 263 | ".9 c #5a595a", |
264 | ".A c #5a5d52", | 264 | ".A c #5a5d52", |
265 | ".B c #624c52", | 265 | ".B c #624c52", |
266 | ".0 c #625552", | 266 | ".0 c #625552", |
267 | "#o c #626562", | 267 | "#o c #626562", |
268 | ".R c #626962", | 268 | ".R c #626962", |
269 | "#. c #626d5a", | 269 | "#. c #626d5a", |
270 | "#p c #626d62", | 270 | "#p c #626d62", |
271 | ".2 c #627162", | 271 | ".2 c #627162", |
272 | "#h c #6a6d62", | 272 | "#h c #6a6d62", |
273 | "#z c #6a7562", | 273 | "#z c #6a7562", |
274 | "#w c #6a756a", | 274 | "#w c #6a756a", |
275 | ".C c #73656a", | 275 | ".C c #73656a", |
276 | ".P c #73696a", | 276 | ".P c #73696a", |
277 | "#a c #737d6a", | 277 | "#a c #737d6a", |
278 | ".U c #738573", | 278 | ".U c #738573", |
279 | ".E c #7b817b", | 279 | ".E c #7b817b", |
280 | "#B c #7b857b", | 280 | "#B c #7b857b", |
281 | "#s c #7b897b", | 281 | "#s c #7b897b", |
282 | "#n c #7b917b", | 282 | "#n c #7b917b", |
283 | ".b c #838d83", | 283 | ".b c #838d83", |
284 | ".7 c #839583", | 284 | ".7 c #839583", |
285 | ".n c #8b7d7b", | 285 | ".n c #8b7d7b", |
286 | "#g c #8b8583", | 286 | "#g c #8b8583", |
287 | ".g c #8b858b", | 287 | ".g c #8b858b", |
288 | ".r c #8b898b", | 288 | ".r c #8b898b", |
289 | ".s c #8b8d8b", | 289 | ".s c #8b8d8b", |
290 | ".i c #8b9183", | 290 | ".i c #8b9183", |
291 | ".8 c #8b918b", | 291 | ".8 c #8b918b", |
292 | "#A c #8b9d8b", | 292 | "#A c #8b9d8b", |
293 | ".S c #8ba183", | 293 | ".S c #8ba183", |
294 | ".Z c #94918b", | 294 | ".Z c #94918b", |
295 | ".N c #949994", | 295 | ".N c #949994", |
296 | ".F c #949d94", | 296 | ".F c #949d94", |
297 | ".x c #94a18b", | 297 | ".x c #94a18b", |
298 | ".v c #94a194", | 298 | ".v c #94a194", |
299 | ".Y c #94aa94", | 299 | ".Y c #94aa94", |
300 | ".h c #9c999c", | 300 | ".h c #9c999c", |
301 | ".Q c #9ca19c", | 301 | ".Q c #9ca19c", |
302 | "#u c #9ca59c", | 302 | "#u c #9ca59c", |
303 | ".H c #9caa9c", | 303 | ".H c #9caa9c", |
304 | "#e c #9cb29c", | 304 | "#e c #9cb29c", |
305 | "#m c #a4b29c", | 305 | "#m c #a4b29c", |
306 | "#t c #a4b2a4", | 306 | "#t c #a4b2a4", |
307 | ".M c #a4b69c", | 307 | ".M c #a4b69c", |
308 | "#l c #a4b6a4", | 308 | "#l c #a4b6a4", |
309 | ".z c #a4baa4", | 309 | ".z c #a4baa4", |
310 | ".f c #aca5ac", | 310 | ".f c #aca5ac", |
311 | ".q c #acaaac", | 311 | ".q c #acaaac", |
312 | "#d c #acbeac", | 312 | "#d c #acbeac", |
313 | ".6 c #acc2ac", | 313 | ".6 c #acc2ac", |
314 | ".o c #b4b2b4", | 314 | ".o c #b4b2b4", |
315 | ".t c #b4beb4", | 315 | ".t c #b4beb4", |
316 | "#k c #b4c2ac", | 316 | "#k c #b4c2ac", |
317 | ".5 c #b4cab4", | 317 | ".5 c #b4cab4", |
318 | ".D c #bdb6bd", | 318 | ".D c #bdb6bd", |
319 | ".G c #bdc6b4", | 319 | ".G c #bdc6b4", |
320 | "#c c #bdceb4", | 320 | "#c c #bdceb4", |
321 | ".X c #bdd2bd", | 321 | ".X c #bdd2bd", |
322 | ".4 c #bdd6bd", | 322 | ".4 c #bdd6bd", |
323 | ".1 c #c5bec5", | 323 | ".1 c #c5bec5", |
324 | ".e c #c5c2c5", | 324 | ".e c #c5c2c5", |
325 | ".u c #c5cac5", | 325 | ".u c #c5cac5", |
326 | "#b c #c5d6c5", | 326 | "#b c #c5d6c5", |
327 | ".J c #c5dec5", | 327 | ".J c #c5dec5", |
328 | ".p c #cdcacd", | 328 | ".p c #cdcacd", |
329 | ".W c #cddecd", | 329 | ".W c #cddecd", |
330 | ".L c #cde2cd", | 330 | ".L c #cde2cd", |
331 | ".K c #d5eacd", | 331 | ".K c #d5eacd", |
332 | ".V c #d5ead5", | 332 | ".V c #d5ead5", |
333 | ".y c #d5eed5", | 333 | ".y c #d5eed5", |
334 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQt", | 334 | "QtQtQtQtQtQtQtQtQtQtQtQtQtQt", |
335 | "QtQtQt.#.a.b.cQtQtQtQtQtQtQt", | 335 | "QtQtQt.#.a.b.cQtQtQtQtQtQtQt", |
336 | "QtQt.d.e.f.g.h.i.c.j.dQt.kQt", | 336 | "QtQt.d.e.f.g.h.i.c.j.dQt.kQt", |
337 | ".a.l.m.n.o.p.q.r.s.t.u.v.wQt", | 337 | ".a.l.m.n.o.p.q.r.s.t.u.v.wQt", |
338 | ".x.y.z.A.B.C.D.p.q.E.F.G.H.I", | 338 | ".x.y.z.A.B.C.D.p.q.E.F.G.H.I", |
339 | ".I.J.K.L.M.N.O.P.o.p.Q.R.S.T", | 339 | ".I.J.K.L.M.N.O.P.o.p.Q.R.S.T", |
340 | "Qt.U.V.L.W.X.Y.Z.0.P.1.s.2.3", | 340 | "Qt.U.V.L.W.X.Y.Z.0.P.1.s.2.3", |
341 | "Qt.3.X.W.4.X.5.6.7.8.9.s#.##", | 341 | "Qt.3.X.W.4.X.5.6.7.8.9.s#.##", |
342 | "QtQt#a.X#b#c.5.6#d#e#f#g#h#i", | 342 | "QtQt#a.X#b#c.5.6#d#e#f#g#h#i", |
343 | "QtQtQt#j.7#k.6#d#l#m#n#o#p#q", | 343 | "QtQtQt#j.7#k.6#d#l#m#n#o#p#q", |
344 | "QtQtQtQt.k#r#s#m#t.H#u#v#w#x", | 344 | "QtQtQtQt.k#r#s#m#t.H#u#v#w#x", |
345 | "QtQtQtQtQtQt.k#y#z.v#A#B#C#x", | 345 | "QtQtQtQtQtQt.k#y#z.v#A#B#C#x", |
346 | "QtQtQtQtQtQtQtQt.k#D.w#s#E.k", | 346 | "QtQtQtQtQtQtQtQt.k#D.w#s#E.k", |
347 | "QtQtQtQtQtQtQtQtQtQtQt#x#FQt"}; | 347 | "QtQtQtQtQtQtQtQtQtQtQt#x#FQt"}; |
348 | 348 | ||
349 | // exit ZSafe and clear the clipboard for security reasons | 349 | // exit ZSafe and clear the clipboard for security reasons |
350 | void ZSafe::exitZs (int ec) | 350 | void ZSafe::exitZs (int ec) |
351 | { | 351 | { |
352 | QClipboard *cb = QApplication::clipboard(); | 352 | QClipboard *cb = QApplication::clipboard(); |
353 | cb->clear(); | 353 | cb->clear(); |
354 | 354 | ||
355 | exit (ec); | 355 | exit (ec); |
356 | } | 356 | } |
357 | 357 | ||
358 | 358 | ||
359 | // save the configuration into the file | 359 | // save the configuration into the file |
360 | void ZSafe::saveConf () | 360 | void ZSafe::saveConf () |
361 | { | 361 | { |
362 | if (conf) | 362 | if (conf) |
363 | { | 363 | { |
364 | delete conf; | 364 | delete conf; |
365 | 365 | ||
366 | #ifdef DESKTOP | 366 | #ifdef DESKTOP |
367 | #ifndef WIN32 | 367 | #ifndef WIN32 |
368 | conf = new QSettings (); | 368 | conf = new QSettings (); |
369 | conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); | 369 | conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); |
370 | #else | 370 | #else |
371 | conf = new QSettings (cfgFile); | 371 | conf = new QSettings (cfgFile); |
372 | conf->insertSearchPath (QSettings::Unix, cfgFile); | 372 | conf->insertSearchPath (QSettings::Unix, cfgFile); |
373 | #endif | 373 | #endif |
374 | #else | 374 | #else |
375 | conf = new Config (cfgFile, Config::File); | 375 | conf = new Config (cfgFile, Config::File); |
376 | conf->setGroup ("zsafe"); | 376 | conf->setGroup ("zsafe"); |
377 | #endif | 377 | #endif |
378 | } | 378 | } |
379 | } | 379 | } |
380 | 380 | ||
381 | 381 | ||
382 | /* | 382 | /* |
383 | * Constructs a ZSafe which is a child of 'parent', with the | 383 | * Constructs a ZSafe which is a child of 'parent', with the |
384 | * name 'name' and widget flags set to 'f' | 384 | * name 'name' and widget flags set to 'f' |
385 | * | 385 | * |
386 | * The dialog will by default be modeless, unless you set 'modal' to | 386 | * The dialog will by default be modeless, unless you set 'modal' to |
387 | * TRUE to construct a modal dialog. | 387 | * TRUE to construct a modal dialog. |
388 | */ | 388 | */ |
389 | ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | 389 | ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) |
390 | : QDialog( parent, name, modal, fl ), | 390 | : QDialog( parent, name, modal, fl ), |
391 | Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) | 391 | Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) |
392 | { | 392 | { |
393 | IsCut = false; | 393 | IsCut = false; |
394 | IsCopy = false; | 394 | IsCopy = false; |
395 | modified = false; | 395 | modified = false; |
396 | 396 | ||
397 | // set the config file | 397 | // set the config file |
398 | cfgFile=QDir::homeDirPath(); | 398 | cfgFile=QDir::homeDirPath(); |
399 | cfgFile += "/.zsafe.cfg"; | 399 | cfgFile += "/.zsafe.cfg"; |
400 | // set the icon path | 400 | // set the icon path |
401 | #ifdef NO_OPIE | 401 | #ifdef NO_OPIE |
402 | QString qpedir ((const char *)getenv("QPEDIR")); | 402 | QString qpedir ((const char *)getenv("QPEDIR")); |
403 | #else | 403 | #else |
404 | QString qpedir ((const char *)getenv("OPIEDIR")); | 404 | QString qpedir ((const char *)getenv("OPIEDIR")); |
405 | #endif | 405 | #endif |
406 | 406 | ||
407 | #ifdef DESKTOP | 407 | #ifdef DESKTOP |
408 | iconPath = QDir::homeDirPath() + "/pics/"; | 408 | iconPath = QDir::homeDirPath() + "/pics/"; |
409 | #else | 409 | #else |
410 | if (qpedir.isEmpty()) | 410 | if (qpedir.isEmpty()) |
411 | iconPath = "/home/QtPalmtop/pics/"; | 411 | iconPath = "/home/QtPalmtop/pics/"; |
412 | else | 412 | else |
413 | iconPath = qpedir + "/pics/"; | 413 | iconPath = qpedir + "/pics/"; |
414 | #endif | 414 | #endif |
415 | 415 | ||
416 | // create a zsafe configuration object | 416 | // create a zsafe configuration object |
417 | #ifdef DESKTOP | 417 | #ifdef DESKTOP |
418 | #ifndef WIN32 | 418 | #ifndef WIN32 |
419 | conf = new QSettings (); | 419 | conf = new QSettings (); |
420 | conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); | 420 | conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath()); |
421 | #else | 421 | #else |
422 | conf = new QSettings (cfgFile); | 422 | conf = new QSettings (cfgFile); |
423 | conf->insertSearchPath (QSettings::Unix, cfgFile); | 423 | conf->insertSearchPath (QSettings::Unix, cfgFile); |
424 | #endif | 424 | #endif |
425 | #else | 425 | #else |
426 | conf = new Config (cfgFile, Config::File); | 426 | conf = new Config (cfgFile, Config::File); |
427 | conf->setGroup ("zsafePrefs"); | 427 | conf->setGroup ("zsafePrefs"); |
428 | #endif | 428 | #endif |
429 | #ifdef DESKTOP | 429 | #ifdef DESKTOP |
430 | // #ifndef WIN32 | 430 | // #ifndef WIN32 |
431 | expandTree = conf->readBoolEntry(APP_KEY+"expandTree", false); | 431 | expandTree = conf->readBoolEntry(APP_KEY+"expandTree", false); |
432 | // #endif | 432 | // #endif |
433 | #else | 433 | #else |
434 | expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); | 434 | expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); |
435 | #endif | 435 | #endif |
436 | #ifndef DESKTOP | 436 | #ifndef DESKTOP |
437 | conf->setGroup ("zsafe"); | 437 | conf->setGroup ("zsafe"); |
438 | #endif | 438 | #endif |
439 | 439 | ||
440 | QPixmap copy_img((const char**) copy_xpm); | 440 | QPixmap copy_img((const char**) copy_xpm); |
441 | QPixmap cut_img((const char**) cut_xpm); | 441 | QPixmap cut_img((const char**) cut_xpm); |
442 | QPixmap edit_img((const char**) edit_xpm); | 442 | QPixmap edit_img((const char**) edit_xpm); |
443 | QPixmap editdelete_img((const char**) editdelete_xpm); | 443 | QPixmap editdelete_img((const char**) editdelete_xpm); |
444 | QPixmap find_img((const char**) find_xpm); | 444 | QPixmap find_img((const char**) find_xpm); |
445 | QPixmap folder_open_img((const char**) folder_open_xpm); | 445 | QPixmap folder_open_img((const char**) folder_open_xpm); |
446 | QPixmap help_icon_img((const char**) help_icon_xpm); | 446 | QPixmap help_icon_img((const char**) help_icon_xpm); |
447 | QPixmap new_img((const char**) new_xpm); | 447 | QPixmap new_img((const char**) new_xpm); |
448 | QPixmap paste_img((const char**) paste_xpm); | 448 | QPixmap paste_img((const char**) paste_xpm); |
449 | QPixmap quit_icon_img((const char**) quit_icon_xpm); | 449 | QPixmap quit_icon_img((const char**) quit_icon_xpm); |
450 | QPixmap save_img((const char**) save_xpm); | 450 | QPixmap save_img((const char**) save_xpm); |
451 | QPixmap trash_img((const char**) trash_xpm); | 451 | QPixmap trash_img((const char**) trash_xpm); |
452 | QPixmap expand_img((const char**) expand_xpm); | 452 | QPixmap expand_img((const char**) expand_xpm); |
453 | QPixmap export_img((const char**) export_xpm); | 453 | QPixmap export_img((const char**) export_xpm); |
454 | QPixmap import_img((const char**) import_xpm); | 454 | QPixmap import_img((const char**) import_xpm); |
455 | 455 | ||
456 | QPixmap bank_cards( ( const char** ) bank_cards_data ); | 456 | QPixmap bank_cards( ( const char** ) bank_cards_data ); |
457 | QPixmap passwords( ( const char** ) passwords_data ); | 457 | QPixmap passwords( ( const char** ) passwords_data ); |
458 | QPixmap software( ( const char** ) software_data ); | 458 | QPixmap software( ( const char** ) software_data ); |
459 | QPixmap general( ( const char** ) general_data ); | 459 | QPixmap general( ( const char** ) general_data ); |
460 | if ( !name ) | 460 | if ( !name ) |
461 | setName( "ZSafe" ); | 461 | setName( "ZSafe" ); |
462 | 462 | ||
463 | #ifdef DESKTOP | 463 | #ifdef DESKTOP |
464 | #ifdef WIN32 | 464 | #ifdef WIN32 |
465 | setGeometry(100, 150, DeskW, DeskH-30 ); | 465 | setGeometry(100, 150, DeskW, DeskH-30 ); |
466 | #else | 466 | #else |
467 | resize( DeskW, DeskH-30 ); | 467 | resize( DeskW, DeskH-30 ); |
468 | #endif | 468 | #endif |
469 | 469 | ||
470 | #else | 470 | #else |
471 | 471 | ||
472 | #ifdef JPATCH_HDE | 472 | #ifdef JPATCH_HDE |
473 | int DeskS; | 473 | int DeskS; |
474 | if(DeskW > DeskH) | 474 | if(DeskW > DeskH) |
475 | { | 475 | { |
476 | DeskS = DeskW; | 476 | DeskS = DeskW; |
477 | } | 477 | } |
478 | else | 478 | else |
479 | { | 479 | { |
480 | DeskS = DeskH; | 480 | DeskS = DeskH; |
481 | } | 481 | } |
482 | resize( DeskW, DeskH ); | 482 | resize( DeskW, DeskH ); |
483 | setMinimumSize( QSize( DeskS, DeskS ) ); | 483 | setMinimumSize( QSize( DeskS, DeskS ) ); |
484 | setMaximumSize( QSize( DeskS, DeskS ) ); | 484 | setMaximumSize( QSize( DeskS, DeskS ) ); |
485 | #else | 485 | #else |
486 | resize( DeskW, DeskH-30 ); | 486 | resize( DeskW, DeskH-30 ); |
487 | #endif | 487 | #endif |
488 | 488 | ||
489 | #endif | 489 | #endif |
490 | setCaption( tr( "ZSafe" ) ); | 490 | setCaption( tr( "ZSafe" ) ); |
491 | QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe"; | 491 | QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe"; |
492 | QString filename = conf->readEntry(APP_KEY+"document"); | 492 | QString filename = conf->readEntry(APP_KEY+"document"); |
493 | if (filename.isEmpty() || filename.isNull()) | 493 | if (filename.isEmpty() || filename.isNull()) |
494 | { | 494 | { |
495 | if ( !QDir( zsafeAppDirPath ).exists() ) | 495 | if ( !QDir( zsafeAppDirPath ).exists() ) |
496 | { | 496 | { |
497 | //FIXME: Pending someone to look into why QDir.mkdir does not work as expected | 497 | //FIXME: Pending someone to look into why QDir.mkdir does not work as expected |
498 | QString cmdline = QString().sprintf( "mkdir -p %s", (const char*) zsafeAppDirPath ); | 498 | QString cmdline = QString().sprintf( "mkdir -p %s", (const char*) zsafeAppDirPath ); |
499 | ::system( cmdline ); | 499 | ::system( cmdline ); |
500 | } | 500 | } |
501 | if ( !QDir( zsafeAppDirPath ).exists() ) | 501 | if ( !QDir( zsafeAppDirPath ).exists() ) |
502 | { | 502 | { |
503 | QMessageBox::critical( 0, "ZSafe", tr("Can't create application data directory.\nZSafe will now exit.")); | 503 | QMessageBox::critical( 0, "ZSafe", tr("Can't create application data directory.\nZSafe will now exit.")); |
504 | exitZs (1); | 504 | exitZs (1); |
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
508 | // set the default filename | 508 | // set the default filename |
509 | filename = zsafeAppDirPath + "/passwords.zsf"; | 509 | filename = zsafeAppDirPath + "/passwords.zsf"; |
510 | 510 | ||
511 | // save the current filename to the config file | 511 | // save the current filename to the config file |
512 | conf->writeEntry(APP_KEY+"document", filename); | 512 | conf->writeEntry(APP_KEY+"document", filename); |
513 | saveConf(); | 513 | saveConf(); |
514 | 514 | ||
515 | //if (filename == "INVALIDPWD") | 515 | //if (filename == "INVALIDPWD") |
516 | //filename = ""; | 516 | //filename = ""; |
517 | 517 | ||
518 | QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); | 518 | QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); |
519 | #ifdef WIN32 | 519 | #ifdef WIN32 |
520 | this->setCaption("Qt ZSafe: " + ti); | 520 | this->setCaption("Qt ZSafe: " + ti); |
521 | #else | 521 | #else |
522 | this->setCaption("ZSafe: " + ti); | 522 | this->setCaption("ZSafe: " + ti); |
523 | #endif | 523 | #endif |
524 | 524 | ||
525 | selectedItem = NULL; | 525 | selectedItem = NULL; |
526 | lastSearchedCategory = NULL; | 526 | lastSearchedCategory = NULL; |
527 | lastSearchedItem = NULL; | 527 | lastSearchedItem = NULL; |
528 | lastSearchedName = ""; | 528 | lastSearchedName = ""; |
529 | lastSearchedUsername = ""; | 529 | lastSearchedUsername = ""; |
530 | lastSearchedComment = ""; | 530 | lastSearchedComment = ""; |
531 | 531 | ||
532 | infoForm = new InfoForm(); | 532 | infoForm = new InfoForm(); |
533 | categoryDialog = NULL; | 533 | categoryDialog = NULL; |
534 | 534 | ||
535 | // add a menu bar | 535 | // add a menu bar |
536 | QMenuBar *menu = new QMenuBar( this ); | 536 | QMenuBar *menu = new QMenuBar( this ); |
537 | 537 | ||
538 | // add file menu | 538 | // add file menu |
539 | // QPopupMenu *file = new QPopupMenu( this ); | 539 | // QPopupMenu *file = new QPopupMenu( this ); |
540 | file = new QPopupMenu( this ); | 540 | file = new QPopupMenu( this ); |
541 | 541 | ||
542 | // #ifdef DESKTOP | 542 | // #ifdef DESKTOP |
543 | file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) ); | 543 | file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) ); |
544 | file->insertItem( folder_open_img, tr("&Open document"), this, SLOT(loadDocument()) ); | 544 | file->insertItem( folder_open_img, tr("&Open document"), this, SLOT(loadDocument()) ); |
545 | file->insertItem( save_img, tr("&Save document as .."), this, SLOT(saveDocumentAs()) ); | 545 | file->insertItem( save_img, tr("&Save document as .."), this, SLOT(saveDocumentAs()) ); |
546 | file->insertSeparator(); | 546 | file->insertSeparator(); |
547 | // #endif | 547 | // #endif |
548 | 548 | ||
549 | file->insertItem( save_img, tr("&Save document"), this, SLOT(saveDocumentWithoutPwd()) ); | 549 | file->insertItem( save_img, tr("&Save document"), this, SLOT(saveDocumentWithoutPwd()) ); |
550 | file->insertItem( save_img, tr("S&ave document with new Password"), this, | 550 | file->insertItem( save_img, tr("S&ave document with new Password"), this, |
551 | SLOT(saveDocumentWithPwd()) ); | 551 | SLOT(saveDocumentWithPwd()) ); |
552 | file->insertSeparator(); | 552 | file->insertSeparator(); |
553 | file->insertItem( export_img, tr("&Export text file"), this, SLOT(writeAllEntries()) ); | 553 | file->insertItem( export_img, tr("&Export text file"), this, SLOT(writeAllEntries()) ); |
554 | file->insertItem( import_img, tr("&Import text file"), this, SLOT(readAllEntries()) ); | 554 | file->insertItem( import_img, tr("&Import text file"), this, SLOT(readAllEntries()) ); |
555 | file->insertItem( trash_img, tr("&Remove text file"), this, SLOT(removeAsciiFile()) ); | 555 | file->insertItem( trash_img, tr("&Remove text file"), this, SLOT(removeAsciiFile()) ); |
556 | file->insertSeparator(); | 556 | file->insertSeparator(); |
557 | file->insertItem( expand_img, tr("&Open entries expanded"), this, | 557 | file->insertItem( expand_img, tr("&Open entries expanded"), this, |
558 | SLOT(setExpandFlag()), 0, 'o'); | 558 | SLOT(setExpandFlag()), 0, 'o'); |
559 | file->setItemChecked('o', expandTree); | 559 | file->setItemChecked('o', expandTree); |
560 | file->insertSeparator(); | 560 | file->insertSeparator(); |
561 | file->insertItem( quit_icon_img, tr("E&xit"), this, SLOT(quitMe()) ); | 561 | file->insertItem( quit_icon_img, tr("E&xit"), this, SLOT(quitMe()) ); |
562 | menu->insertItem( tr("&File"), file ); | 562 | menu->insertItem( tr("&File"), file ); |
563 | 563 | ||
564 | QPopupMenu *cat = new QPopupMenu( this ); | 564 | QPopupMenu *cat = new QPopupMenu( this ); |
565 | cat->insertItem( new_img, tr("&New"), this, SLOT(addCategory()) ); | 565 | cat->insertItem( new_img, tr("&New"), this, SLOT(addCategory()) ); |
566 | cat->insertItem( edit_img, tr("&Edit"), this, SLOT(editCategory()) ); | 566 | cat->insertItem( edit_img, tr("&Edit"), this, SLOT(editCategory()) ); |
567 | cat->insertItem( trash_img, tr("&Delete"), this, SLOT(delCategory()) ); | 567 | cat->insertItem( trash_img, tr("&Delete"), this, SLOT(delCategory()) ); |
568 | menu->insertItem( tr("&Category"), cat ); | 568 | menu->insertItem( tr("&Category"), cat ); |
569 | 569 | ||
570 | QPopupMenu *it = new QPopupMenu( this ); | 570 | QPopupMenu *it = new QPopupMenu( this ); |
571 | it->insertItem( cut_img, tr("&Cut"), this, SLOT(cutItem()) ); | 571 | it->insertItem( cut_img, tr("&Cut"), this, SLOT(cutItem()) ); |
572 | it->insertItem( copy_img, tr("C&opy"), this, SLOT(copyItem()) ); | 572 | it->insertItem( copy_img, tr("C&opy"), this, SLOT(copyItem()) ); |
573 | it->insertItem( paste_img, tr("&Paste"), this, SLOT(pasteItem()) ); | 573 | it->insertItem( paste_img, tr("&Paste"), this, SLOT(pasteItem()) ); |
574 | it->insertSeparator(); | 574 | it->insertSeparator(); |
575 | it->insertItem( new_img, tr("&New"), this, SLOT(newPwd()) ); | 575 | it->insertItem( new_img, tr("&New"), this, SLOT(newPwd()) ); |
576 | it->insertItem( edit_img, tr("&Edit"), this, SLOT(editPwd()) ); | 576 | it->insertItem( edit_img, tr("&Edit"), this, SLOT(editPwd()) ); |
577 | it->insertItem( trash_img, tr("&Delete"), this, SLOT(deletePwd()) ); | 577 | it->insertItem( trash_img, tr("&Delete"), this, SLOT(deletePwd()) ); |
578 | it->insertItem( find_img, tr("&Search"), this, SLOT(findPwd()) ); | 578 | it->insertItem( find_img, tr("&Search"), this, SLOT(findPwd()) ); |
579 | menu->insertItem( tr("&Entry"), it ); | 579 | menu->insertItem( tr("&Entry"), it ); |
580 | 580 | ||
581 | QPopupMenu *help = new QPopupMenu( this ); | 581 | QPopupMenu *help = new QPopupMenu( this ); |
582 | help->insertItem( help_icon_img, tr("&About"), this, SLOT(about()) ); | 582 | help->insertItem( help_icon_img, tr("&About"), this, SLOT(about()) ); |
583 | menu->insertItem( tr("&Help"), help ); | 583 | menu->insertItem( tr("&Help"), help ); |
584 | 584 | ||
585 | // toolbar icons | 585 | // toolbar icons |
586 | 586 | ||
587 | New = new QToolButton( menu, "New" ); | 587 | New = new QToolButton( menu, "New" ); |
588 | New->setGeometry( QRect( DeskW-84, 2, 20, 20 ) ); | 588 | New->setGeometry( QRect( DeskW-84, 2, 20, 20 ) ); |
589 | New->setMouseTracking( TRUE ); | 589 | New->setMouseTracking( TRUE ); |
590 | New->setText( tr( "" ) ); | 590 | New->setText( "" ); |
591 | New->setPixmap( new_img ); | 591 | New->setPixmap( new_img ); |
592 | QToolTip::add( New, tr( "New entry" ) ); | 592 | QToolTip::add( New, tr( "New entry" ) ); |
593 | 593 | ||
594 | Edit = new QToolButton( menu, "Edit" ); | 594 | Edit = new QToolButton( menu, "Edit" ); |
595 | Edit->setGeometry( QRect( DeskW-64, 2, 20, 20 ) ); | 595 | Edit->setGeometry( QRect( DeskW-64, 2, 20, 20 ) ); |
596 | Edit->setText( tr( "" ) ); | 596 | Edit->setText( "" ); |
597 | Edit->setPixmap( edit_img ); | 597 | Edit->setPixmap( edit_img ); |
598 | QToolTip::add( Edit, tr( "Edit category or entry" ) ); | 598 | QToolTip::add( Edit, tr( "Edit category or entry" ) ); |
599 | 599 | ||
600 | Delete = new QToolButton( menu, "Delete" ); | 600 | Delete = new QToolButton( menu, "Delete" ); |
601 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); | 601 | Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) ); |
602 | Delete->setText( tr( "" ) ); | 602 | Delete->setText( "" ); |
603 | Delete->setPixmap( trash_img ); | 603 | Delete->setPixmap( trash_img ); |
604 | QToolTip::add( Delete, tr( "Delete category or entry" ) ); | 604 | QToolTip::add( Delete, tr( "Delete category or entry" ) ); |
605 | 605 | ||
606 | Find = new QToolButton( menu, "Find" ); | 606 | Find = new QToolButton( menu, "Find" ); |
607 | Find->setGeometry( QRect( DeskW-24, 2, 20, 20 ) ); | 607 | Find->setGeometry( QRect( DeskW-24, 2, 20, 20 ) ); |
608 | Find->setText( tr( "" ) ); | 608 | Find->setText( "" ); |
609 | Find->setPixmap( find_img ); | 609 | Find->setPixmap( find_img ); |
610 | QToolTip::add( Find, tr( "Find entry" ) ); | 610 | QToolTip::add( Find, tr( "Find entry" ) ); |
611 | 611 | ||
612 | /* | 612 | /* |
613 | QBoxLayout * h = new QHBoxLayout( this ); | 613 | QBoxLayout * h = new QHBoxLayout( this ); |
614 | h->addWidget (menu); | 614 | h->addWidget (menu); |
615 | h->addWidget (New); | 615 | h->addWidget (New); |
616 | h->addWidget (Edit); | 616 | h->addWidget (Edit); |
617 | h->addWidget (Delete); | 617 | h->addWidget (Delete); |
618 | h->addWidget (Find); | 618 | h->addWidget (Find); |
619 | */ | 619 | */ |
620 | 620 | ||
621 | ListView = new ZListView( this, "ListView" ); | 621 | ListView = new ZListView( this, "ListView" ); |
622 | ListView->addColumn( tr( "Name" ) ); | 622 | ListView->addColumn( tr( "Name" ) ); |
623 | ListView->addColumn( tr( "Field 2" ) ); | 623 | ListView->addColumn( tr( "Field 2" ) ); |
624 | ListView->addColumn( tr( "Field 3" ) ); | 624 | ListView->addColumn( tr( "Field 3" ) ); |
625 | ListView->addColumn( tr( "Comment" ) ); | 625 | ListView->addColumn( tr( "Comment" ) ); |
626 | ListView->addColumn( tr( "Field 4" ) ); | 626 | ListView->addColumn( tr( "Field 4" ) ); |
627 | ListView->addColumn( tr( "Field 5" ) ); | 627 | ListView->addColumn( tr( "Field 5" ) ); |
628 | ListView->setAllColumnsShowFocus(TRUE); | 628 | ListView->setAllColumnsShowFocus(TRUE); |
629 | 629 | ||
630 | #ifdef DESKTOP | 630 | #ifdef DESKTOP |
631 | ListView->setResizePolicy(QScrollView::AutoOneFit); | 631 | ListView->setResizePolicy(QScrollView::AutoOneFit); |
632 | // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) ); | 632 | // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) ); |
633 | #else | 633 | #else |
634 | ListView->setResizePolicy(QScrollView::AutoOneFit); | 634 | ListView->setResizePolicy(QScrollView::AutoOneFit); |
635 | // ListView->setGeometry( QRect( 0, 22, | 635 | // ListView->setGeometry( QRect( 0, 22, |
636 | // this->width(), this->height() - 30 ) ); | 636 | // this->width(), this->height() - 30 ) ); |
637 | // ListView->setMaximumSize( QSize( 440, 290 ) ); | 637 | // ListView->setMaximumSize( QSize( 440, 290 ) ); |
638 | #endif | 638 | #endif |
639 | ListView->setVScrollBarMode( QListView::Auto ); | 639 | ListView->setVScrollBarMode( QListView::Auto ); |
640 | 640 | ||
641 | QBoxLayout * l = new QVBoxLayout( this ); | 641 | QBoxLayout * l = new QVBoxLayout( this ); |
642 | l->addWidget (menu); | 642 | l->addWidget (menu); |
643 | l->addWidget (ListView); | 643 | l->addWidget (ListView); |
644 | 644 | ||
645 | #ifndef DESKTOP | 645 | #ifndef DESKTOP |
646 | // start a timer (100 ms) to load the default document | 646 | // start a timer (100 ms) to load the default document |
647 | docuTimer.start( 100, true ); | 647 | docuTimer.start( 100, true ); |
648 | connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) ); | 648 | connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) ); |
649 | raiseFlag = true; | 649 | raiseFlag = true; |
650 | connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); | 650 | connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); |
651 | #else | 651 | #else |
652 | // open the default document | 652 | // open the default document |
653 | openDocument(filename); | 653 | openDocument(filename); |
654 | #endif | 654 | #endif |
655 | 655 | ||
656 | // signals and slots connections for QTollButton | 656 | // signals and slots connections for QTollButton |
657 | connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) ); | 657 | connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) ); |
658 | connect( Edit, SIGNAL( clicked() ), this, SLOT( editPwd() ) ); | 658 | connect( Edit, SIGNAL( clicked() ), this, SLOT( editPwd() ) ); |
659 | connect( Delete, SIGNAL( clicked() ), this, SLOT( deletePwd() ) ); | 659 | connect( Delete, SIGNAL( clicked() ), this, SLOT( deletePwd() ) ); |
660 | connect( Find, SIGNAL( clicked() ), this, SLOT( findPwd() ) ); | 660 | connect( Find, SIGNAL( clicked() ), this, SLOT( findPwd() ) ); |
661 | // signals and slots connections for QListView | 661 | // signals and slots connections for QListView |
662 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), | 662 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), |
663 | this, SLOT( listViewSelected(QListViewItem*) ) ); | 663 | this, SLOT( listViewSelected(QListViewItem*) ) ); |
664 | connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), | 664 | connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), |
665 | this, SLOT( showInfo(QListViewItem*) ) ); | 665 | this, SLOT( showInfo(QListViewItem*) ) ); |
666 | connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), | 666 | connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), |
667 | this, SLOT( showInfo(QListViewItem*) ) ); | 667 | this, SLOT( showInfo(QListViewItem*) ) ); |
668 | 668 | ||
669 | } | 669 | } |
670 | 670 | ||
671 | const QColor *ZSafe::evenRowColor = &Qt::white; | 671 | const QColor *ZSafe::evenRowColor = &Qt::white; |
672 | // const QColor *ZSafe::oddRowColor = &Qt::lightGray; | 672 | // const QColor *ZSafe::oddRowColor = &Qt::lightGray; |
673 | const QColor *ZSafe::oddRowColor = new QColor(216,240,255); | 673 | const QColor *ZSafe::oddRowColor = new QColor(216,240,255); |
674 | 674 | ||
675 | /* | 675 | /* |
676 | * Destroys the object and frees any allocated resources | 676 | * Destroys the object and frees any allocated resources |
677 | */ | 677 | */ |
678 | ZSafe::~ZSafe() | 678 | ZSafe::~ZSafe() |
679 | { | 679 | { |
680 | // no need to delete child widgets, Qt does it all for us | 680 | // no need to delete child widgets, Qt does it all for us |
681 | quitMe(); | 681 | quitMe(); |
682 | } | 682 | } |
683 | 683 | ||
684 | // load the default document | 684 | // load the default document |
685 | void ZSafe::slotLoadDocu() | 685 | void ZSafe::slotLoadDocu() |
686 | { | 686 | { |
687 | openDocument (filename); | 687 | openDocument (filename); |
688 | } | 688 | } |
689 | 689 | ||
690 | void ZSafe::deletePwd() | 690 | void ZSafe::deletePwd() |
691 | { | 691 | { |
692 | 692 | ||
693 | if (!selectedItem) | 693 | if (!selectedItem) |
694 | return; | 694 | return; |
695 | if (!isCategory(selectedItem)) | 695 | if (!isCategory(selectedItem)) |
696 | { | 696 | { |
697 | switch( QMessageBox::information( this, tr("ZSafe"), | 697 | switch( QMessageBox::information( this, tr("ZSafe"), |
698 | tr("Do you want to delete?"), | 698 | tr("Do you want to delete?"), |
699 | tr("&Delete"), tr("D&on't Delete"), | 699 | tr("&Delete"), tr("D&on't Delete"), |
700 | 0 // Enter == button 0 | 700 | 0 // Enter == button 0 |
701 | ) ) { // Escape == button 2 | 701 | ) ) { // Escape == button 2 |
702 | case 0: // Delete clicked, Alt-S or Enter pressed. | 702 | case 0: // Delete clicked, Alt-S or Enter pressed. |
703 | // Delete | 703 | // Delete |
704 | modified = true; | 704 | modified = true; |
705 | selectedItem->parent()->takeItem(selectedItem); | 705 | selectedItem->parent()->takeItem(selectedItem); |
706 | selectedItem = NULL; | 706 | selectedItem = NULL; |
707 | break; | 707 | break; |
708 | case 1: // Don't delete | 708 | case 1: // Don't delete |
709 | break; | 709 | break; |
710 | } | 710 | } |
711 | } | 711 | } |
712 | else | 712 | else |
713 | { | 713 | { |
714 | delCategory(); | 714 | delCategory(); |
715 | } | 715 | } |
716 | } | 716 | } |
717 | 717 | ||
718 | void ZSafe::editPwd() | 718 | void ZSafe::editPwd() |
719 | { | 719 | { |
720 | if (!selectedItem) | 720 | if (!selectedItem) |
721 | return; | 721 | return; |
722 | if (!isCategory(selectedItem)) | 722 | if (!isCategory(selectedItem)) |
723 | { | 723 | { |
724 | // open the 'New Entry' dialog | 724 | // open the 'New Entry' dialog |
725 | NewDialog *dialog = new NewDialog(this, tr("Edit Entry"), TRUE); | 725 | NewDialog *dialog = new NewDialog(this, tr("Edit Entry"), TRUE); |
726 | #ifdef WIN32 | 726 | #ifdef WIN32 |
727 | dialog->setCaption ("Qt " + tr("Edit Entry")); | 727 | dialog->setCaption ("Qt " + tr("Edit Entry")); |
728 | dialog->setGeometry(200, 250, 220, 310 ); | 728 | dialog->setGeometry(200, 250, 220, 310 ); |
729 | #endif | 729 | #endif |
730 | 730 | ||
731 | // set the labels | 731 | // set the labels |
732 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); | 732 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); |
733 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); | 733 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); |
734 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); | 734 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); |
735 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); | 735 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); |
736 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); | 736 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); |
737 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); | 737 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); |
738 | 738 | ||
739 | // set the fields | 739 | // set the fields |
740 | dialog->NameField->setText(selectedItem->text (0)); | 740 | dialog->NameField->setText(selectedItem->text (0)); |
741 | dialog->UsernameField->setText(selectedItem->text (1)); | 741 | dialog->UsernameField->setText(selectedItem->text (1)); |
742 | dialog->PasswordField->setText(selectedItem->text (2)); | 742 | dialog->PasswordField->setText(selectedItem->text (2)); |
743 | QString comment = selectedItem->text (3); | 743 | QString comment = selectedItem->text (3); |
744 | comment.replace (QRegExp("<br>"), "\n"); | 744 | comment.replace (QRegExp("<br>"), "\n"); |
745 | dialog->Field5->setText(selectedItem->text (4)); | 745 | dialog->Field5->setText(selectedItem->text (4)); |
746 | dialog->Field6->setText(selectedItem->text (5)); | 746 | dialog->Field6->setText(selectedItem->text (5)); |
747 | dialog->CommentField->insertLine(comment); | 747 | dialog->CommentField->insertLine(comment); |
748 | dialog->CommentField->setCursorPosition(0,0); | 748 | dialog->CommentField->setCursorPosition(0,0); |
749 | 749 | ||
750 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); | 750 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); |
751 | 751 | ||
752 | #ifdef DESKTOP | 752 | #ifdef DESKTOP |
753 | result = Accepted; | 753 | result = Accepted; |
754 | #endif | 754 | #endif |
755 | if (result == Accepted) | 755 | if (result == Accepted) |
756 | { | 756 | { |
757 | modified = true; | 757 | modified = true; |
758 | // edit the selected item | 758 | // edit the selected item |
759 | QString name = dialog->NameField->text(); | 759 | QString name = dialog->NameField->text(); |
760 | selectedItem->setText (0, tr (name)); | 760 | selectedItem->setText (0, tr (name)); |
761 | QString user = dialog->UsernameField->text(); | 761 | QString user = dialog->UsernameField->text(); |
762 | selectedItem->setText (1, tr (user)); | 762 | selectedItem->setText (1, tr (user)); |
763 | QString pwd = dialog->PasswordField->text(); | 763 | QString pwd = dialog->PasswordField->text(); |
764 | selectedItem->setText (2, tr (pwd)); | 764 | selectedItem->setText (2, tr (pwd)); |
765 | QString comment = dialog->CommentField->text(); | 765 | QString comment = dialog->CommentField->text(); |
766 | comment.replace (QRegExp("\n"), "<br>"); | 766 | comment.replace (QRegExp("\n"), "<br>"); |
767 | selectedItem->setText (3, tr (comment)); | 767 | selectedItem->setText (3, tr (comment)); |
768 | QString f5 = dialog->Field5->text(); | 768 | QString f5 = dialog->Field5->text(); |
769 | selectedItem->setText (4, tr (f5)); | 769 | selectedItem->setText (4, tr (f5)); |
770 | QString f6 = dialog->Field6->text(); | 770 | QString f6 = dialog->Field6->text(); |
771 | selectedItem->setText (5, tr (f6)); | 771 | selectedItem->setText (5, tr (f6)); |
772 | } | 772 | } |
773 | 773 | ||
774 | delete dialog; | 774 | delete dialog; |
775 | } | 775 | } |
776 | else | 776 | else |
777 | { | 777 | { |
778 | editCategory(); | 778 | editCategory(); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | 781 | ||
782 | void ZSafe::newPwd() | 782 | void ZSafe::newPwd() |
783 | { | 783 | { |
784 | if (!selectedItem) | 784 | if (!selectedItem) |
785 | return; | 785 | return; |
786 | 786 | ||
787 | if (!isCategory(selectedItem)) | 787 | if (!isCategory(selectedItem)) |
788 | selectedItem = selectedItem->parent(); | 788 | selectedItem = selectedItem->parent(); |
789 | 789 | ||
790 | if (isCategory(selectedItem)) | 790 | if (isCategory(selectedItem)) |
791 | { | 791 | { |
792 | QString cat = selectedItem->text(0); | 792 | QString cat = selectedItem->text(0); |
793 | 793 | ||
794 | // open the 'New Entry' dialog | 794 | // open the 'New Entry' dialog |
795 | NewDialog *dialog = new NewDialog(this, tr("New Entry"), TRUE); | 795 | NewDialog *dialog = new NewDialog(this, tr("New Entry"), TRUE); |
796 | #ifdef WIN32 | 796 | #ifdef WIN32 |
797 | dialog->setCaption ("Qt " + tr("New Entry")); | 797 | dialog->setCaption ("Qt " + tr("New Entry")); |
798 | dialog->setGeometry(200, 250, 220, 310 ); | 798 | dialog->setGeometry(200, 250, 220, 310 ); |
799 | #endif | 799 | #endif |
800 | // set the labels | 800 | // set the labels |
801 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); | 801 | dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); |
802 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); | 802 | dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); |
803 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); | 803 | dialog->Password->setText(getFieldLabel (selectedItem, "3", tr("Password"))); |
804 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); | 804 | dialog->Comment->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); |
805 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); | 805 | dialog->Field5Label->setText(getFieldLabel (selectedItem,"5", tr("Field 4"))); |
806 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); | 806 | dialog->Field6Label->setText(getFieldLabel (selectedItem,"6", tr("Field 5"))); |
807 | retype: | 807 | retype: |
808 | 808 | ||
809 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); | 809 | DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); |
810 | #ifdef DESKTOP | 810 | #ifdef DESKTOP |
811 | result = Accepted; | 811 | result = Accepted; |
812 | #endif | 812 | #endif |
813 | 813 | ||
814 | if (result == Accepted) | 814 | if (result == Accepted) |
815 | { | 815 | { |
816 | 816 | ||
817 | QString name = dialog->NameField->text(); | 817 | QString name = dialog->NameField->text(); |
818 | if (cat == name) | 818 | if (cat == name) |
819 | { | 819 | { |
820 | QMessageBox::critical( 0, tr("ZSafe"), | 820 | QMessageBox::critical( 0, tr("ZSafe"), |
821 | tr("Entry name must be different\nfrom the category name.") ); | 821 | tr("Entry name must be different\nfrom the category name.") ); |
822 | goto retype; // it's not a good programming style :-) | 822 | goto retype; // it's not a good programming style :-) |
823 | } | 823 | } |
824 | 824 | ||
825 | modified = true; | 825 | modified = true; |
826 | // add the new item | 826 | // add the new item |
827 | QListViewItem *i = new ShadedListItem (0, selectedItem); | 827 | QListViewItem *i = new ShadedListItem (0, selectedItem); |
828 | i->setOpen (TRUE); | 828 | i->setOpen (TRUE); |
829 | 829 | ||
830 | i->setText (0, tr (name)); | 830 | i->setText (0, tr (name)); |
831 | QString user = dialog->UsernameField->text(); | 831 | QString user = dialog->UsernameField->text(); |
832 | i->setText (1, tr (user)); | 832 | i->setText (1, tr (user)); |
833 | QString pwd = dialog->PasswordField->text(); | 833 | QString pwd = dialog->PasswordField->text(); |
834 | i->setText (2, tr (pwd)); | 834 | i->setText (2, tr (pwd)); |
835 | QString comment = dialog->CommentField->text(); | 835 | QString comment = dialog->CommentField->text(); |
836 | comment.replace (QRegExp("\n"), "<br>"); | 836 | comment.replace (QRegExp("\n"), "<br>"); |
837 | i->setText (3, tr (comment)); | 837 | i->setText (3, tr (comment)); |
838 | QString f5 = dialog->Field5->text(); | 838 | QString f5 = dialog->Field5->text(); |
839 | i->setText (4, tr (f5)); | 839 | i->setText (4, tr (f5)); |
840 | QString f6 = dialog->Field6->text(); | 840 | QString f6 = dialog->Field6->text(); |
841 | i->setText (5, tr (f6)); | 841 | i->setText (5, tr (f6)); |
842 | } | 842 | } |
843 | 843 | ||
844 | delete dialog; | 844 | delete dialog; |
845 | } | 845 | } |
846 | } | 846 | } |
847 | 847 | ||
848 | void ZSafe::findPwd() | 848 | void ZSafe::findPwd() |
849 | { | 849 | { |
850 | 850 | ||
851 | // open the 'Search' dialog | 851 | // open the 'Search' dialog |
852 | SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE); | 852 | SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE); |
853 | #ifdef WIN32 | 853 | #ifdef WIN32 |
854 | dialog->setCaption ("Qt " + tr("Search")); | 854 | dialog->setCaption ("Qt " + tr("Search")); |
855 | #endif | 855 | #endif |
856 | 856 | ||
857 | #ifdef DESKTOP | 857 | #ifdef DESKTOP |
858 | #endif | 858 | #endif |
859 | if (lastSearchedName) | 859 | if (lastSearchedName) |
860 | dialog->NameField->setText(lastSearchedName); | 860 | dialog->NameField->setText(lastSearchedName); |
861 | else | 861 | else |
862 | dialog->NameField->setText(""); | 862 | dialog->NameField->setText(""); |
863 | if (lastSearchedUsername) | 863 | if (lastSearchedUsername) |
864 | dialog->UsernameField->setText(lastSearchedUsername); | 864 | dialog->UsernameField->setText(lastSearchedUsername); |
865 | else | 865 | else |
866 | dialog->UsernameField->setText(""); | 866 | dialog->UsernameField->setText(""); |
867 | if (lastSearchedComment) | 867 | if (lastSearchedComment) |
868 | dialog->CommentField->setText(lastSearchedComment); | 868 | dialog->CommentField->setText(lastSearchedComment); |
869 | else | 869 | else |
870 | dialog->CommentField->setText(""); | 870 | dialog->CommentField->setText(""); |
871 | DialogCode result = (DialogCode) dialog->exec(); | 871 | DialogCode result = (DialogCode) dialog->exec(); |
872 | #ifdef DESKTOP | 872 | #ifdef DESKTOP |
873 | result = Accepted; | 873 | result = Accepted; |
874 | #endif | 874 | #endif |
875 | 875 | ||
876 | QString name; | 876 | QString name; |
877 | QString username; | 877 | QString username; |
878 | QString comment; | 878 | QString comment; |
879 | if (result == Accepted) | 879 | if (result == Accepted) |
880 | { | 880 | { |
881 | name = dialog->NameField->text(); | 881 | name = dialog->NameField->text(); |
882 | username = dialog->UsernameField->text(); | 882 | username = dialog->UsernameField->text(); |
883 | comment = dialog->CommentField->text(); | 883 | comment = dialog->CommentField->text(); |
884 | owarn << name << oendl; | 884 | owarn << name << oendl; |
885 | } | 885 | } |
886 | else | 886 | else |
887 | { | 887 | { |
888 | delete dialog; | 888 | delete dialog; |
889 | return; | 889 | return; |
890 | } | 890 | } |
891 | 891 | ||
892 | if (!name.isEmpty() && name != lastSearchedName || | 892 | if (!name.isEmpty() && name != lastSearchedName || |
893 | lastSearchedName.isEmpty() && !name.isEmpty()) | 893 | lastSearchedName.isEmpty() && !name.isEmpty()) |
894 | { | 894 | { |
895 | // set search at the beginning if a new name is given | 895 | // set search at the beginning if a new name is given |
896 | lastSearchedCategory = NULL; | 896 | lastSearchedCategory = NULL; |
897 | lastSearchedItem = NULL; | 897 | lastSearchedItem = NULL; |
898 | } | 898 | } |
899 | lastSearchedName = name; | 899 | lastSearchedName = name; |
900 | if (!username.isEmpty() && username != lastSearchedUsername || | 900 | if (!username.isEmpty() && username != lastSearchedUsername || |
901 | lastSearchedUsername.isEmpty() && !username.isEmpty()) | 901 | lastSearchedUsername.isEmpty() && !username.isEmpty()) |
902 | { | 902 | { |
903 | // set search at the beginning if a new name is given | 903 | // set search at the beginning if a new name is given |
904 | lastSearchedCategory = NULL; | 904 | lastSearchedCategory = NULL; |
905 | lastSearchedItem = NULL; | 905 | lastSearchedItem = NULL; |
906 | } | 906 | } |
907 | lastSearchedUsername = username; | 907 | lastSearchedUsername = username; |
908 | if (!comment.isEmpty() && comment != lastSearchedComment || | 908 | if (!comment.isEmpty() && comment != lastSearchedComment || |
909 | lastSearchedComment.isEmpty() && !comment.isEmpty()) | 909 | lastSearchedComment.isEmpty() && !comment.isEmpty()) |
910 | { | 910 | { |
911 | // set search at the beginning if a new name is given | 911 | // set search at the beginning if a new name is given |
912 | lastSearchedCategory = NULL; | 912 | lastSearchedCategory = NULL; |
913 | lastSearchedItem = NULL; | 913 | lastSearchedItem = NULL; |
914 | } | 914 | } |
915 | lastSearchedComment = comment; | 915 | lastSearchedComment = comment; |
916 | 916 | ||
917 | ListView->clearSelection(); | 917 | ListView->clearSelection(); |
918 | 918 | ||
919 | bool found=FALSE; | 919 | bool found=FALSE; |
920 | // step through all categories | 920 | // step through all categories |
921 | QListViewItem *i; | 921 | QListViewItem *i; |
922 | if (lastSearchedCategory) | 922 | if (lastSearchedCategory) |
923 | i = lastSearchedCategory; | 923 | i = lastSearchedCategory; |
924 | else | 924 | else |
925 | i = ListView->firstChild(); | 925 | i = ListView->firstChild(); |
926 | for (; | 926 | for (; |
927 | i != NULL; | 927 | i != NULL; |
928 | i = i->nextSibling()) | 928 | i = i->nextSibling()) |
929 | { | 929 | { |
930 | owarn << i->text(0) << oendl; | 930 | owarn << i->text(0) << oendl; |
931 | i->setSelected(FALSE); | 931 | i->setSelected(FALSE); |
932 | 932 | ||
933 | // step through all subitems | 933 | // step through all subitems |
934 | QListViewItem *si; | 934 | QListViewItem *si; |
935 | if (lastSearchedItem) | 935 | if (lastSearchedItem) |
936 | si = lastSearchedItem; | 936 | si = lastSearchedItem; |
937 | else | 937 | else |
938 | si = i->firstChild(); | 938 | si = i->firstChild(); |
939 | // for (si = i->firstChild(); | 939 | // for (si = i->firstChild(); |
940 | for (; | 940 | for (; |
941 | si != NULL; | 941 | si != NULL; |
942 | si = si->nextSibling()) | 942 | si = si->nextSibling()) |
943 | { | 943 | { |
944 | owarn << si->text(0) << oendl; | 944 | owarn << si->text(0) << oendl; |
945 | if (si->isSelected()) | 945 | if (si->isSelected()) |
946 | si->setSelected(FALSE); | 946 | si->setSelected(FALSE); |
947 | // ListView->repaintItem(si); | 947 | // ListView->repaintItem(si); |
948 | 948 | ||
949 | bool n=TRUE; | 949 | bool n=TRUE; |
950 | bool u=TRUE; | 950 | bool u=TRUE; |
951 | bool c=TRUE; | 951 | bool c=TRUE; |
952 | if (!name.isEmpty()) | 952 | if (!name.isEmpty()) |
953 | n = (si->text(0)).contains (name, FALSE); | 953 | n = (si->text(0)).contains (name, FALSE); |
954 | if (!username.isEmpty()) | 954 | if (!username.isEmpty()) |
955 | u = (si->text(1)).contains (username, FALSE); | 955 | u = (si->text(1)).contains (username, FALSE); |
956 | if (!comment.isEmpty()) | 956 | if (!comment.isEmpty()) |
957 | c = (si->text(3)).contains (comment, FALSE); | 957 | c = (si->text(3)).contains (comment, FALSE); |
958 | 958 | ||
959 | if ((n && u && c ) && !found) | 959 | if ((n && u && c ) && !found) |
960 | { | 960 | { |
961 | owarn << "Found" << oendl; | 961 | owarn << "Found" << oendl; |
962 | selectedItem = si; | 962 | selectedItem = si; |
963 | si->setSelected(TRUE); | 963 | si->setSelected(TRUE); |
964 | ListView->setCurrentItem(si); | 964 | ListView->setCurrentItem(si); |
965 | ListView->ensureItemVisible(si); | 965 | ListView->ensureItemVisible(si); |
966 | ListView->triggerUpdate(); | 966 | ListView->triggerUpdate(); |
967 | 967 | ||
968 | lastSearchedCategory = i; | 968 | lastSearchedCategory = i; |
969 | // set to the next item | 969 | // set to the next item |
970 | lastSearchedItem = si->nextSibling(); | 970 | lastSearchedItem = si->nextSibling(); |
971 | if (!lastSearchedItem) | 971 | if (!lastSearchedItem) |
972 | { | 972 | { |
973 | // no next item within category -> set next category | 973 | // no next item within category -> set next category |
974 | lastSearchedCategory = i->nextSibling(); | 974 | lastSearchedCategory = i->nextSibling(); |
975 | if (!lastSearchedCategory) | 975 | if (!lastSearchedCategory) |
976 | lastSearchedItem = NULL; // END | 976 | lastSearchedItem = NULL; // END |
977 | } | 977 | } |
978 | 978 | ||
979 | found = TRUE; | 979 | found = TRUE; |
980 | delete dialog; | 980 | delete dialog; |
981 | update(); | 981 | update(); |
982 | return; | 982 | return; |
983 | } | 983 | } |
984 | } | 984 | } |
985 | lastSearchedCategory = i->nextSibling(); | 985 | lastSearchedCategory = i->nextSibling(); |
986 | lastSearchedItem = NULL; | 986 | lastSearchedItem = NULL; |
987 | } | 987 | } |
988 | lastSearchedCategory = NULL; | 988 | lastSearchedCategory = NULL; |
989 | lastSearchedItem = NULL; | 989 | lastSearchedItem = NULL; |
990 | delete dialog; | 990 | delete dialog; |
991 | update(); | 991 | update(); |
992 | QMessageBox::information( this, tr("ZSafe"), | 992 | QMessageBox::information( this, tr("ZSafe"), |
993 | tr("Entry not found"), tr("&OK"), 0); | 993 | tr("Entry not found"), tr("&OK"), 0); |
994 | 994 | ||
995 | } | 995 | } |
996 | 996 | ||
997 | QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def) | 997 | QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def) |
998 | { | 998 | { |
999 | QString category; | 999 | QString category; |
1000 | if (_item) | 1000 | if (_item) |
1001 | { | 1001 | { |
1002 | if (isCategory(_item)) | 1002 | if (isCategory(_item)) |
1003 | { | 1003 | { |
1004 | category = _item->text(0); | 1004 | category = _item->text(0); |
1005 | } | 1005 | } |
1006 | else | 1006 | else |
1007 | { | 1007 | { |
1008 | QListViewItem *cat = _item->parent(); | 1008 | QListViewItem *cat = _item->parent(); |
1009 | category = cat->text(0); | 1009 | category = cat->text(0); |
1010 | } | 1010 | } |
1011 | } | 1011 | } |
1012 | else | 1012 | else |
1013 | { | 1013 | { |
1014 | return def; | 1014 | return def; |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | QString app_key = APP_KEY; | 1017 | QString app_key = APP_KEY; |
1018 | #ifndef DESKTOP | 1018 | #ifndef DESKTOP |
1019 | #ifndef WIN32 | 1019 | #ifndef WIN32 |
1020 | conf->setGroup ("fieldDefs"); | 1020 | conf->setGroup ("fieldDefs"); |
1021 | #endif | 1021 | #endif |
1022 | #else | 1022 | #else |
1023 | #ifndef WIN32 | 1023 | #ifndef WIN32 |
1024 | app_key += "/fieldDefs/"; | 1024 | app_key += "/fieldDefs/"; |
1025 | #endif | 1025 | #endif |
1026 | #endif | 1026 | #endif |
1027 | // #ifndef WIN32 | 1027 | // #ifndef WIN32 |
1028 | QString label = conf->readEntry(app_key+category+"-field"+field,def); | 1028 | QString label = conf->readEntry(app_key+category+"-field"+field,def); |
1029 | // #else | 1029 | // #else |
1030 | // QString label(def); | 1030 | // QString label(def); |
1031 | // #endif | 1031 | // #endif |
1032 | 1032 | ||
1033 | #ifndef DESKTOP | 1033 | #ifndef DESKTOP |
1034 | conf->setGroup ("zsafe"); | 1034 | conf->setGroup ("zsafe"); |
1035 | #endif | 1035 | #endif |
1036 | return label; | 1036 | return label; |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | QString ZSafe::getFieldLabel (QString category, QString field, QString def) | 1039 | QString ZSafe::getFieldLabel (QString category, QString field, QString def) |
1040 | { | 1040 | { |
1041 | QString app_key = APP_KEY; | 1041 | QString app_key = APP_KEY; |
1042 | #ifndef DESKTOP | 1042 | #ifndef DESKTOP |
1043 | conf->setGroup ("fieldDefs"); | 1043 | conf->setGroup ("fieldDefs"); |
1044 | #else | 1044 | #else |
1045 | #ifndef WIN32 | 1045 | #ifndef WIN32 |
1046 | app_key += "/fieldDefs/"; | 1046 | app_key += "/fieldDefs/"; |
1047 | #endif | 1047 | #endif |
1048 | #endif | 1048 | #endif |
1049 | // #ifndef WIN32 | 1049 | // #ifndef WIN32 |
1050 | QString label = conf->readEntry(app_key+category+"-field"+field, | 1050 | QString label = conf->readEntry(app_key+category+"-field"+field, |
1051 | def); | 1051 | def); |
1052 | // #else | 1052 | // #else |
1053 | // QString label(def); | 1053 | // QString label(def); |
1054 | // #endif | 1054 | // #endif |
1055 | #ifndef DESKTOP | 1055 | #ifndef DESKTOP |
1056 | conf->setGroup ("zsafe"); | 1056 | conf->setGroup ("zsafe"); |
1057 | #endif | 1057 | #endif |
1058 | return label; | 1058 | return label; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | void ZSafe::showInfo( QListViewItem *_item) | 1061 | void ZSafe::showInfo( QListViewItem *_item) |
1062 | { | 1062 | { |
1063 | if (!_item) | 1063 | if (!_item) |
1064 | return; | 1064 | return; |
1065 | if (selectedItem != NULL) | 1065 | if (selectedItem != NULL) |
1066 | selectedItem->setSelected(FALSE); | 1066 | selectedItem->setSelected(FALSE); |
1067 | 1067 | ||
1068 | selectedItem = _item; | 1068 | selectedItem = _item; |
1069 | selectedItem->setSelected(TRUE); | 1069 | selectedItem->setSelected(TRUE); |
1070 | 1070 | ||
1071 | if (!isCategory(_item)) | 1071 | if (!isCategory(_item)) |
1072 | { | 1072 | { |
1073 | /* | 1073 | /* |
1074 | QString label=selectedItem->text(0); | 1074 | QString label=selectedItem->text(0); |
1075 | label+="\n"; | 1075 | label+="\n"; |
1076 | label+=selectedItem->text(1); | 1076 | label+=selectedItem->text(1); |
1077 | label+="\n"; | 1077 | label+="\n"; |
1078 | label+=selectedItem->text(2); | 1078 | label+=selectedItem->text(2); |
1079 | label+="\n"; | 1079 | label+="\n"; |
1080 | label+=selectedItem->text(3); | 1080 | label+=selectedItem->text(3); |
1081 | */ | 1081 | */ |
1082 | 1082 | ||
1083 | QString text; | 1083 | QString text; |
1084 | QString entry; | 1084 | QString entry; |
1085 | 1085 | ||
1086 | text = "<html><body><div align=""center""><u><b>"; | 1086 | text = "<html><body><div align=""center""><u><b>"; |
1087 | text += selectedItem->text(0); | 1087 | text += selectedItem->text(0); |
1088 | text += "</b></u><br></div><br>"; | 1088 | text += "</b></u><br></div><br>"; |
1089 | 1089 | ||
1090 | entry = selectedItem->text(1); | 1090 | entry = selectedItem->text(1); |
1091 | if (!entry.isEmpty() && entry.compare(" ")) | 1091 | if (!entry.isEmpty() && entry.compare(" ")) |
1092 | { | 1092 | { |
1093 | text += "<u><b>"; | 1093 | text += "<u><b>"; |
1094 | text += getFieldLabel (selectedItem, "2", tr("Username")); | 1094 | text += getFieldLabel (selectedItem, "2", tr("Username")); |
1095 | text += ":<br></b></u><blockquote>"; | 1095 | text += ":<br></b></u><blockquote>"; |
1096 | text += entry; | 1096 | text += entry; |
1097 | text += "</blockquote>"; | 1097 | text += "</blockquote>"; |
1098 | // text += "<br>"; | 1098 | // text += "<br>"; |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | entry = selectedItem->text(2); | 1101 | entry = selectedItem->text(2); |
1102 | if (!entry.isEmpty() && entry.compare(" ")) | 1102 | if (!entry.isEmpty() && entry.compare(" ")) |
1103 | { | 1103 | { |
1104 | text += "<u><b>"; | 1104 | text += "<u><b>"; |
1105 | text += getFieldLabel (selectedItem, "3", tr("Password")); | 1105 | text += getFieldLabel (selectedItem, "3", tr("Password")); |
1106 | text += ":<br> </b></u><blockquote>"; | 1106 | text += ":<br> </b></u><blockquote>"; |
1107 | text += entry; | 1107 | text += entry; |
1108 | text += "</blockquote>"; | 1108 | text += "</blockquote>"; |
1109 | // text += "<br>"; | 1109 | // text += "<br>"; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | entry = selectedItem->text(4); | 1112 | entry = selectedItem->text(4); |
1113 | if (!entry.isEmpty() && entry.compare(" ")) | 1113 | if (!entry.isEmpty() && entry.compare(" ")) |
1114 | { | 1114 | { |
1115 | text += "<u><b>"; | 1115 | text += "<u><b>"; |
1116 | text += getFieldLabel (selectedItem, "5", tr("Field 4")); | 1116 | text += getFieldLabel (selectedItem, "5", tr("Field 4")); |
1117 | text += ":<br> </b></u><blockquote>"; | 1117 | text += ":<br> </b></u><blockquote>"; |
1118 | text += entry; | 1118 | text += entry; |
1119 | text += "</blockquote>"; | 1119 | text += "</blockquote>"; |
1120 | // text += "<br>"; | 1120 | // text += "<br>"; |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | entry = selectedItem->text(5); | 1123 | entry = selectedItem->text(5); |
1124 | if (!entry.isEmpty() && entry.compare(" ")) | 1124 | if (!entry.isEmpty() && entry.compare(" ")) |
1125 | { | 1125 | { |
1126 | text += "<u><b>"; | 1126 | text += "<u><b>"; |
1127 | text += getFieldLabel (selectedItem, "6", tr("Field 5")); | 1127 | text += getFieldLabel (selectedItem, "6", tr("Field 5")); |
1128 | text += ":<br> </b></u><blockquote>"; | 1128 | text += ":<br> </b></u><blockquote>"; |
1129 | text += entry; | 1129 | text += entry; |
1130 | text += "</blockquote>"; | 1130 | text += "</blockquote>"; |
1131 | // text += "<br>"; | 1131 | // text += "<br>"; |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | entry = selectedItem->text(3); | 1134 | entry = selectedItem->text(3); |
1135 | if (!entry.isEmpty() && entry.compare(" ")) | 1135 | if (!entry.isEmpty() && entry.compare(" ")) |
1136 | { | 1136 | { |
1137 | text += "<u><b>"; | 1137 | text += "<u><b>"; |
1138 | text += getFieldLabel (selectedItem, "4", tr("Comment")); | 1138 | text += getFieldLabel (selectedItem, "4", tr("Comment")); |
1139 | text += ":<br> </b></u>"; | 1139 | text += ":<br> </b></u>"; |
1140 | QString comment = selectedItem->text(3); | 1140 | QString comment = selectedItem->text(3); |
1141 | comment.replace (QRegExp("\n"), "<br>"); | 1141 | comment.replace (QRegExp("\n"), "<br>"); |
1142 | text += comment; | 1142 | text += comment; |
1143 | // text += "<br>"; | 1143 | // text += "<br>"; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | text += "</body></html>"; | 1146 | text += "</body></html>"; |
1147 | 1147 | ||
1148 | infoForm->InfoText->setText(text); | 1148 | infoForm->InfoText->setText(text); |
1149 | infoForm->hide(); | 1149 | infoForm->hide(); |
1150 | QPEApplication::showDialog( infoForm ); | 1150 | QPEApplication::showDialog( infoForm ); |
1151 | } | 1151 | } |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | void ZSafe::listViewSelected( QListViewItem *_item) | 1154 | void ZSafe::listViewSelected( QListViewItem *_item) |
1155 | { | 1155 | { |
1156 | if (!_item) | 1156 | if (!_item) |
1157 | return; | 1157 | return; |
1158 | if (selectedItem != NULL) | 1158 | if (selectedItem != NULL) |
1159 | selectedItem->setSelected(FALSE); | 1159 | selectedItem->setSelected(FALSE); |
1160 | 1160 | ||
1161 | selectedItem = _item; | 1161 | selectedItem = _item; |
1162 | 1162 | ||
1163 | #ifndef DESKTOP | 1163 | #ifndef DESKTOP |
1164 | // set the column text dependent on the selected item | 1164 | // set the column text dependent on the selected item |
1165 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); | 1165 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); |
1166 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); | 1166 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); |
1167 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); | 1167 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); |
1168 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); | 1168 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); |
1169 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); | 1169 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); |
1170 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); | 1170 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); |
1171 | #endif | 1171 | #endif |
1172 | #ifdef WIN32 | 1172 | #ifdef WIN32 |
1173 | // set the column text dependent on the selected item | 1173 | // set the column text dependent on the selected item |
1174 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); | 1174 | ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); |
1175 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); | 1175 | ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); |
1176 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); | 1176 | ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3"))); |
1177 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); | 1177 | ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); |
1178 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); | 1178 | ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); |
1179 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); | 1179 | ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); |
1180 | #endif | 1180 | #endif |
1181 | 1181 | ||
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | bool ZSafe::isCategory(QListViewItem *_item) | 1184 | bool ZSafe::isCategory(QListViewItem *_item) |
1185 | { | 1185 | { |
1186 | if (_item == NULL) | 1186 | if (_item == NULL) |
1187 | return FALSE; | 1187 | return FALSE; |
1188 | 1188 | ||
1189 | QString categoryName = _item->text (0); | 1189 | QString categoryName = _item->text (0); |
1190 | if (categories.find (categoryName)) | 1190 | if (categories.find (categoryName)) |
1191 | return TRUE; | 1191 | return TRUE; |
1192 | else | 1192 | else |
1193 | return FALSE; | 1193 | return FALSE; |
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | void ZSafe::removeAsciiFile() | 1196 | void ZSafe::removeAsciiFile() |
1197 | { | 1197 | { |
1198 | // QString fn = filename + ".txt"; | 1198 | // QString fn = filename + ".txt"; |
1199 | // open the file dialog | 1199 | // open the file dialog |
1200 | #ifndef DESKTOP | 1200 | #ifndef DESKTOP |
1201 | #ifndef NO_OPIE | 1201 | #ifndef NO_OPIE |
1202 | QMap<QString, QStringList> mimeTypes; | 1202 | QMap<QString, QStringList> mimeTypes; |
1203 | mimeTypes.insert(tr("All"), QStringList() ); | 1203 | mimeTypes.insert(tr("All"), QStringList() ); |
1204 | mimeTypes.insert(tr("Text"), "text/*" ); | 1204 | mimeTypes.insert(tr("Text"), "text/*" ); |
1205 | QString fn = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, | 1205 | QString fn = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, |
1206 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1206 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1207 | QString::null, | 1207 | QString::null, |
1208 | mimeTypes, | 1208 | mimeTypes, |
1209 | this, | 1209 | this, |
1210 | tr ("Remove text file")); | 1210 | tr ("Remove text file")); |
1211 | #else | 1211 | #else |
1212 | QString fn = ScQtFileEdit::getOpenFileName(this, | 1212 | QString fn = ScQtFileEdit::getOpenFileName(this, |
1213 | tr ("Remove text file"), | 1213 | tr ("Remove text file"), |
1214 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1214 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1215 | "*.txt"); | 1215 | "*.txt"); |
1216 | #endif | 1216 | #endif |
1217 | #else | 1217 | #else |
1218 | QString fn = QFileDialog::getOpenFileName( | 1218 | QString fn = QFileDialog::getOpenFileName( |
1219 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1219 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1220 | "ZSafe (*.txt)", | 1220 | "ZSafe (*.txt)", |
1221 | this, | 1221 | this, |
1222 | "ZSafe File Dialog" | 1222 | "ZSafe File Dialog" |
1223 | "Choose a text file" ); | 1223 | "Choose a text file" ); |
1224 | #endif | 1224 | #endif |
1225 | 1225 | ||
1226 | if (fn && fn.length() > 0 ) | 1226 | if (fn && fn.length() > 0 ) |
1227 | { | 1227 | { |
1228 | QFile f( fn ); | 1228 | QFile f( fn ); |
1229 | if ( !f.remove() ) | 1229 | if ( !f.remove() ) |
1230 | { | 1230 | { |
1231 | owarn << "Could not remove file " << fn << oendl; | 1231 | owarn << "Could not remove file " << fn << oendl; |
1232 | QMessageBox::critical( 0, tr("ZSafe"), | 1232 | QMessageBox::critical( 0, tr("ZSafe"), |
1233 | tr("Could not remove text file.") ); | 1233 | tr("Could not remove text file.") ); |
1234 | return; | 1234 | return; |
1235 | } | 1235 | } |
1236 | } | 1236 | } |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | void ZSafe::writeAllEntries() | 1239 | void ZSafe::writeAllEntries() |
1240 | { | 1240 | { |
1241 | if (filename.isEmpty()) | 1241 | if (filename.isEmpty()) |
1242 | { | 1242 | { |
1243 | QMessageBox::critical( 0, tr("ZSafe"), | 1243 | QMessageBox::critical( 0, tr("ZSafe"), |
1244 | tr("No document defined.\nYou have to create a new document")); | 1244 | tr("No document defined.\nYou have to create a new document")); |
1245 | return; | 1245 | return; |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | // open the file dialog | 1248 | // open the file dialog |
1249 | #ifndef DESKTOP | 1249 | #ifndef DESKTOP |
1250 | #ifndef NO_OPIE | 1250 | #ifndef NO_OPIE |
1251 | QMap<QString, QStringList> mimeTypes; | 1251 | QMap<QString, QStringList> mimeTypes; |
1252 | mimeTypes.insert(tr("All"), QStringList() ); | 1252 | mimeTypes.insert(tr("All"), QStringList() ); |
1253 | mimeTypes.insert(tr("Text"), "text/*" ); | 1253 | mimeTypes.insert(tr("Text"), "text/*" ); |
1254 | QString fn = OFileDialog::getSaveFileName( OFileSelector::EXTENDED_ALL, | 1254 | QString fn = OFileDialog::getSaveFileName( OFileSelector::EXTENDED_ALL, |
1255 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1255 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1256 | QString::null, | 1256 | QString::null, |
1257 | mimeTypes, | 1257 | mimeTypes, |
1258 | this, | 1258 | this, |
1259 | tr ("Export text file")); | 1259 | tr ("Export text file")); |
1260 | #else | 1260 | #else |
1261 | QString fn = ScQtFileEdit::getSaveAsFileName(this, | 1261 | QString fn = ScQtFileEdit::getSaveAsFileName(this, |
1262 | tr ("Export text file"), | 1262 | tr ("Export text file"), |
1263 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1263 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1264 | "*.txt"); | 1264 | "*.txt"); |
1265 | #endif | 1265 | #endif |
1266 | #else | 1266 | #else |
1267 | QString fn = QFileDialog::getSaveFileName( | 1267 | QString fn = QFileDialog::getSaveFileName( |
1268 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1268 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1269 | "ZSafe (*.txt)", | 1269 | "ZSafe (*.txt)", |
1270 | this, | 1270 | this, |
1271 | "ZSafe File Dialog" | 1271 | "ZSafe File Dialog" |
1272 | "Choose a text file" ); | 1272 | "Choose a text file" ); |
1273 | #endif | 1273 | #endif |
1274 | 1274 | ||
1275 | // open the new document | 1275 | // open the new document |
1276 | if (fn && fn.length() > 0 ) | 1276 | if (fn && fn.length() > 0 ) |
1277 | { | 1277 | { |
1278 | QFile f( fn ); | 1278 | QFile f( fn ); |
1279 | if ( !f.open( IO_WriteOnly ) ) { | 1279 | if ( !f.open( IO_WriteOnly ) ) { |
1280 | owarn << "Could not write to file " << fn << oendl; | 1280 | owarn << "Could not write to file " << fn << oendl; |
1281 | QMessageBox::critical( 0, "ZSafe", | 1281 | QMessageBox::critical( 0, "ZSafe", |
1282 | QString("Could not export to text file.") ); | 1282 | QString("Could not export to text file.") ); |
1283 | return; | 1283 | return; |
1284 | } | 1284 | } |
1285 | QTextStream t( &f ); | 1285 | QTextStream t( &f ); |
1286 | 1286 | ||
1287 | QListViewItem *i; | 1287 | QListViewItem *i; |
1288 | // step through all categories | 1288 | // step through all categories |
1289 | for (i = ListView->firstChild(); | 1289 | for (i = ListView->firstChild(); |
1290 | i != NULL; | 1290 | i != NULL; |
1291 | i = i->nextSibling()) | 1291 | i = i->nextSibling()) |
1292 | { | 1292 | { |
1293 | // step through all subitems | 1293 | // step through all subitems |
1294 | QListViewItem *si; | 1294 | QListViewItem *si; |
1295 | for (si = i->firstChild(); | 1295 | for (si = i->firstChild(); |
1296 | si != NULL; | 1296 | si != NULL; |
1297 | si = si->nextSibling()) | 1297 | si = si->nextSibling()) |
1298 | { | 1298 | { |
1299 | QString oneEntry; | 1299 | QString oneEntry; |
1300 | oneEntry += "\""; | 1300 | oneEntry += "\""; |
1301 | oneEntry += i->text(0); | 1301 | oneEntry += i->text(0); |
1302 | oneEntry += "\";"; | 1302 | oneEntry += "\";"; |
1303 | oneEntry += "\""; | 1303 | oneEntry += "\""; |
1304 | oneEntry += si->text(0); | 1304 | oneEntry += si->text(0); |
1305 | oneEntry += "\";"; | 1305 | oneEntry += "\";"; |
1306 | oneEntry += "\""; | 1306 | oneEntry += "\""; |
1307 | oneEntry += si->text(1); | 1307 | oneEntry += si->text(1); |
1308 | oneEntry += "\";"; | 1308 | oneEntry += "\";"; |
1309 | oneEntry += "\""; | 1309 | oneEntry += "\""; |
1310 | oneEntry += si->text(2); | 1310 | oneEntry += si->text(2); |
1311 | oneEntry += "\";"; | 1311 | oneEntry += "\";"; |
1312 | oneEntry += "\""; | 1312 | oneEntry += "\""; |
1313 | QString comment = si->text(3); | 1313 | QString comment = si->text(3); |
1314 | comment.replace (QRegExp("\n"), "<br>"); | 1314 | comment.replace (QRegExp("\n"), "<br>"); |
1315 | oneEntry += comment; | 1315 | oneEntry += comment; |
1316 | oneEntry += "\";"; | 1316 | oneEntry += "\";"; |
1317 | oneEntry += "\""; | 1317 | oneEntry += "\""; |
1318 | oneEntry += si->text(4); | 1318 | oneEntry += si->text(4); |
1319 | oneEntry += "\";"; | 1319 | oneEntry += "\";"; |
1320 | oneEntry += "\""; | 1320 | oneEntry += "\""; |
1321 | oneEntry += si->text(5); | 1321 | oneEntry += si->text(5); |
1322 | oneEntry += "\""; | 1322 | oneEntry += "\""; |
1323 | // owarn << oneEntry << oendl; | 1323 | // owarn << oneEntry << oendl; |
1324 | t << oneEntry << endl; | 1324 | t << oneEntry << endl; |
1325 | 1325 | ||
1326 | // owarn << si->text(0) << oendl; | 1326 | // owarn << si->text(0) << oendl; |
1327 | } | 1327 | } |
1328 | } | 1328 | } |
1329 | f.close(); | 1329 | f.close(); |
1330 | } | 1330 | } |
1331 | } | 1331 | } |
1332 | 1332 | ||
1333 | void ZSafe::readAllEntries() | 1333 | void ZSafe::readAllEntries() |
1334 | { | 1334 | { |
1335 | if (filename.isEmpty()) | 1335 | if (filename.isEmpty()) |
1336 | { | 1336 | { |
1337 | QMessageBox::critical( 0, tr("ZSafe"), | 1337 | QMessageBox::critical( 0, tr("ZSafe"), |
1338 | tr("No document defined.\nYou have to create a new document")); | 1338 | tr("No document defined.\nYou have to create a new document")); |
1339 | return; | 1339 | return; |
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | // open the file dialog | 1342 | // open the file dialog |
1343 | #ifndef DESKTOP | 1343 | #ifndef DESKTOP |
1344 | #ifndef NO_OPIE | 1344 | #ifndef NO_OPIE |
1345 | QMap<QString, QStringList> mimeTypes; | 1345 | QMap<QString, QStringList> mimeTypes; |
1346 | mimeTypes.insert(tr("All"), QStringList() ); | 1346 | mimeTypes.insert(tr("All"), QStringList() ); |
1347 | mimeTypes.insert(tr("Text"), "text/*" ); | 1347 | mimeTypes.insert(tr("Text"), "text/*" ); |
1348 | QString fn = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, | 1348 | QString fn = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, |
1349 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1349 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1350 | QString::null, | 1350 | QString::null, |
1351 | mimeTypes, | 1351 | mimeTypes, |
1352 | this, | 1352 | this, |
1353 | tr ("Import text file")); | 1353 | tr ("Import text file")); |
1354 | #else | 1354 | #else |
1355 | QString fn = ScQtFileEdit::getOpenFileName(this, | 1355 | QString fn = ScQtFileEdit::getOpenFileName(this, |
1356 | tr ("Import text file"), | 1356 | tr ("Import text file"), |
1357 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1357 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1358 | "*.txt"); | 1358 | "*.txt"); |
1359 | #endif | 1359 | #endif |
1360 | #else | 1360 | #else |
1361 | QString fn = QFileDialog::getOpenFileName( | 1361 | QString fn = QFileDialog::getOpenFileName( |
1362 | QDir::homeDirPath() + "/Documents/application/zsafe", | 1362 | QDir::homeDirPath() + "/Documents/application/zsafe", |
1363 | "ZSafe (*.txt)", | 1363 | "ZSafe (*.txt)", |
1364 | this, | 1364 | this, |
1365 | "ZSafe File Dialog" | 1365 | "ZSafe File Dialog" |
1366 | "Choose a text file" ); | 1366 | "Choose a text file" ); |
1367 | #endif | 1367 | #endif |
1368 | 1368 | ||
1369 | if (fn && fn.length() > 0 ) | 1369 | if (fn && fn.length() > 0 ) |
1370 | { | 1370 | { |
1371 | QFile f( fn ); | 1371 | QFile f( fn ); |
1372 | if ( !f.open( IO_ReadOnly ) ) | 1372 | if ( !f.open( IO_ReadOnly ) ) |
1373 | { | 1373 | { |
1374 | owarn << "Could not read file " << fn << oendl; | 1374 | owarn << "Could not read file " << fn << oendl; |
1375 | QMessageBox::critical( 0, "ZSafe", | 1375 | QMessageBox::critical( 0, "ZSafe", |
1376 | QString("Could not import text file.") ); | 1376 | QString("Could not import text file.") ); |
diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp index 98fe3f7..f0d1487 100644 --- a/noncore/multimedia/powerchord/powerchordbase.cpp +++ b/noncore/multimedia/powerchord/powerchordbase.cpp | |||
@@ -1,593 +1,593 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form implementation generated from reading ui file 'powerchordbase.ui' | 2 | ** Form implementation generated from reading ui file 'powerchordbase.ui' |
3 | ** | 3 | ** |
4 | ** Created: Sun Jan 13 23:05:11 2002 | 4 | ** Created: Sun Jan 13 23:05:11 2002 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "powerchordbase.h" | 9 | #include "powerchordbase.h" |
10 | #include "fretboard.h" | 10 | #include "fretboard.h" |
11 | #include "vumeter.h" | 11 | #include "vumeter.h" |
12 | 12 | ||
13 | /* OPIE */ | 13 | /* OPIE */ |
14 | #include <opie2/odebug.h> | 14 | #include <opie2/odebug.h> |
15 | #include <qpe/resource.h> | 15 | #include <qpe/resource.h> |
16 | using namespace Opie::Core; | 16 | using namespace Opie::Core; |
17 | 17 | ||
18 | /* QT */ | 18 | /* QT */ |
19 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlistbox.h> | 21 | #include <qlistbox.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qspinbox.h> | 23 | #include <qspinbox.h> |
24 | #include <qtabwidget.h> | 24 | #include <qtabwidget.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Constructs a PowerchordBase which is a child of 'parent', with the | 29 | * Constructs a PowerchordBase which is a child of 'parent', with the |
30 | * name 'name' and widget flags set to 'f' | 30 | * name 'name' and widget flags set to 'f' |
31 | */ | 31 | */ |
32 | PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) | 32 | PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) |
33 | : QWidget( parent, name, fl ) | 33 | : QWidget( parent, name, fl ) |
34 | { | 34 | { |
35 | simulation_timer = 0; | 35 | simulation_timer = 0; |
36 | audio_timer = 0; | 36 | audio_timer = 0; |
37 | 37 | ||
38 | // setPalette( QPalette( QColor( 232, 227, 215) ) ); | 38 | // setPalette( QPalette( QColor( 232, 227, 215) ) ); |
39 | 39 | ||
40 | // QPixmap image0(QString("/opt/Qtopia/pics/powerchord/image0")); | 40 | // QPixmap image0(QString("/opt/Qtopia/pics/powerchord/image0")); |
41 | QPixmap image1 = Resource::loadPixmap( "powerchord/image1"); | 41 | QPixmap image1 = Resource::loadPixmap( "powerchord/image1"); |
42 | QPixmap image2 = Resource::loadPixmap( "powerchord/image2"); | 42 | QPixmap image2 = Resource::loadPixmap( "powerchord/image2"); |
43 | QPixmap image3 = Resource::loadPixmap( "powerchord/image3"); | 43 | QPixmap image3 = Resource::loadPixmap( "powerchord/image3"); |
44 | QPixmap image4 = Resource::loadPixmap( "powerchord/image4"); | 44 | QPixmap image4 = Resource::loadPixmap( "powerchord/image4"); |
45 | QPixmap image5 = Resource::loadPixmap( "powerchord/image5"); | 45 | QPixmap image5 = Resource::loadPixmap( "powerchord/image5"); |
46 | image6 = Resource::loadPixmap( "powerchord/image6"); | 46 | image6 = Resource::loadPixmap( "powerchord/image6"); |
47 | image_open = Resource::loadPixmap( "powerchord/image_open"); | 47 | image_open = Resource::loadPixmap( "powerchord/image_open"); |
48 | 48 | ||
49 | // image0.setMask(image0.createHeuristicMask()); | 49 | // image0.setMask(image0.createHeuristicMask()); |
50 | image1.setMask(image1.createHeuristicMask()); | 50 | image1.setMask(image1.createHeuristicMask()); |
51 | // image2.setMask(image2.createHeuristicMask()); | 51 | // image2.setMask(image2.createHeuristicMask()); |
52 | // image3.setMask(image3.createHeuristicMask()); | 52 | // image3.setMask(image3.createHeuristicMask()); |
53 | // image4.setMask(image4.createHeuristicMask()); | 53 | // image4.setMask(image4.createHeuristicMask()); |
54 | // image5.setMask(image5.createHeuristicMask()); | 54 | // image5.setMask(image5.createHeuristicMask()); |
55 | // image6->setMask(image6->createHeuristicMask()); | 55 | // image6->setMask(image6->createHeuristicMask()); |
56 | // image_open->setMask(image_open->createHeuristicMask()); | 56 | // image_open->setMask(image_open->createHeuristicMask()); |
57 | 57 | ||
58 | if ( !name ) | 58 | if ( !name ) |
59 | setName( "PowerchordBase" ); | 59 | setName( "PowerchordBase" ); |
60 | resize( 240, 284 ); | 60 | resize( 240, 284 ); |
61 | setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) ); | 61 | setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) ); |
62 | setMinimumSize( QSize( 240, 284 ) ); | 62 | setMinimumSize( QSize( 240, 284 ) ); |
63 | setMaximumSize( QSize( 240, 284 ) ); | 63 | setMaximumSize( QSize( 240, 284 ) ); |
64 | setCaption( tr( "Powerchord" ) ); | 64 | setCaption( tr( "Powerchord" ) ); |
65 | 65 | ||
66 | tabs = new QTabWidget( this, "tabs" ); | 66 | tabs = new QTabWidget( this, "tabs" ); |
67 | tabs->setEnabled( TRUE ); | 67 | tabs->setEnabled( TRUE ); |
68 | tabs->setGeometry( QRect( 0, 0, 240, 286 ) ); | 68 | tabs->setGeometry( QRect( 0, 0, 240, 286 ) ); |
69 | tabs->setTabPosition( QTabWidget::Bottom ); | 69 | tabs->setTabPosition( QTabWidget::Bottom ); |
70 | 70 | ||
71 | tab = new QWidget( tabs, "tab" ); | 71 | tab = new QWidget( tabs, "tab" ); |
72 | 72 | ||
73 | chordkey = new QComboBox( FALSE, tab, "chordkey" ); | 73 | chordkey = new QComboBox( FALSE, tab, "chordkey" ); |
74 | chordkey->insertItem( tr( "maj" ) ); | 74 | chordkey->insertItem( tr( "maj" ) ); |
75 | chordkey->insertItem( tr( "min" ) ); | 75 | chordkey->insertItem( tr( "min" ) ); |
76 | chordkey->insertItem( tr( "7th" ) ); | 76 | chordkey->insertItem( tr( "7th" ) ); |
77 | chordkey->insertItem( tr( "m7" ) ); | 77 | chordkey->insertItem( tr( "m7" ) ); |
78 | chordkey->insertItem( tr( "maj7" ) ); | 78 | chordkey->insertItem( tr( "maj7" ) ); |
79 | chordkey->insertItem( tr( "6th" ) ); | 79 | chordkey->insertItem( tr( "6th" ) ); |
80 | chordkey->insertItem( tr( "m6th" ) ); | 80 | chordkey->insertItem( tr( "m6th" ) ); |
81 | chordkey->insertItem( tr( "aug" ) ); | 81 | chordkey->insertItem( tr( "aug" ) ); |
82 | chordkey->insertItem( tr( "dim" ) ); | 82 | chordkey->insertItem( tr( "dim" ) ); |
83 | chordkey->insertItem( tr( "sus4" ) ); | 83 | chordkey->insertItem( tr( "sus4" ) ); |
84 | chordkey->insertItem( tr( "7sus4" ) ); | 84 | chordkey->insertItem( tr( "7sus4" ) ); |
85 | chordkey->insertItem( tr( "9th" ) ); | 85 | chordkey->insertItem( tr( "9th" ) ); |
86 | chordkey->insertItem( tr( "add9" ) ); | 86 | chordkey->insertItem( tr( "add9" ) ); |
87 | chordkey->insertItem( tr( "m9th" ) ); | 87 | chordkey->insertItem( tr( "m9th" ) ); |
88 | chordkey->insertItem( tr( "maj9" ) ); | 88 | chordkey->insertItem( tr( "maj9" ) ); |
89 | chordkey->insertItem( tr( "sus2" ) ); | 89 | chordkey->insertItem( tr( "sus2" ) ); |
90 | chordkey->insertItem( tr( "7sus2" ) ); | 90 | chordkey->insertItem( tr( "7sus2" ) ); |
91 | chordkey->insertItem( tr( "11th" ) ); | 91 | chordkey->insertItem( tr( "11th" ) ); |
92 | chordkey->insertItem( tr( "m11th" ) ); | 92 | chordkey->insertItem( tr( "m11th" ) ); |
93 | chordkey->insertItem( tr( "13th" ) ); | 93 | chordkey->insertItem( tr( "13th" ) ); |
94 | chordkey->insertItem( tr( "m13th" ) ); | 94 | chordkey->insertItem( tr( "m13th" ) ); |
95 | chordkey->insertItem( tr( "maj13" ) ); | 95 | chordkey->insertItem( tr( "maj13" ) ); |
96 | chordkey->insertItem( tr( "6/9" ) ); | 96 | chordkey->insertItem( tr( "6/9" ) ); |
97 | chordkey->insertItem( tr( "flat5" ) ); | 97 | chordkey->insertItem( tr( "flat5" ) ); |
98 | chordkey->insertItem( tr( "7#9" ) ); | 98 | chordkey->insertItem( tr( "7#9" ) ); |
99 | chordkey->insertItem( tr( QString::fromUtf8( "ø7" ) ) ); | 99 | chordkey->insertItem( tr( QString::fromUtf8( "ø7" ) ) ); |
100 | chordkey->insertItem( tr( "5" ) ); | 100 | chordkey->insertItem( tr( "5" ) ); |
101 | chordkey->setGeometry( QRect( 40, 0, 51, 21 ) ); | 101 | chordkey->setGeometry( QRect( 40, 0, 51, 21 ) ); |
102 | 102 | ||
103 | chordfret = new QComboBox( FALSE, tab, "chordfret" ); | 103 | chordfret = new QComboBox( FALSE, tab, "chordfret" ); |
104 | chordfret->insertItem( tr( "open" ) ); | 104 | chordfret->insertItem( tr( "open" ) ); |
105 | chordfret->insertItem( tr( "1st" ) ); | 105 | chordfret->insertItem( tr( "1st" ) ); |
106 | chordfret->insertItem( tr( "2nd" ) ); | 106 | chordfret->insertItem( tr( "2nd" ) ); |
107 | chordfret->insertItem( tr( "3rd" ) ); | 107 | chordfret->insertItem( tr( "3rd" ) ); |
108 | chordfret->insertItem( tr( "4th" ) ); | 108 | chordfret->insertItem( tr( "4th" ) ); |
109 | chordfret->insertItem( tr( "5th" ) ); | 109 | chordfret->insertItem( tr( "5th" ) ); |
110 | chordfret->insertItem( tr( "6th" ) ); | 110 | chordfret->insertItem( tr( "6th" ) ); |
111 | chordfret->insertItem( tr( "7th" ) ); | 111 | chordfret->insertItem( tr( "7th" ) ); |
112 | chordfret->insertItem( tr( "8th" ) ); | 112 | chordfret->insertItem( tr( "8th" ) ); |
113 | chordfret->insertItem( tr( "9th" ) ); | 113 | chordfret->insertItem( tr( "9th" ) ); |
114 | chordfret->insertItem( tr( "10th" ) ); | 114 | chordfret->insertItem( tr( "10th" ) ); |
115 | chordfret->insertItem( tr( "11th" ) ); | 115 | chordfret->insertItem( tr( "11th" ) ); |
116 | chordfret->insertItem( tr( "12th" ) ); | 116 | chordfret->insertItem( tr( "12th" ) ); |
117 | chordfret->insertItem( tr( "13th" ) ); | 117 | chordfret->insertItem( tr( "13th" ) ); |
118 | chordfret->insertItem( tr( "14th" ) ); | 118 | chordfret->insertItem( tr( "14th" ) ); |
119 | chordfret->insertItem( tr( "15th" ) ); | 119 | chordfret->insertItem( tr( "15th" ) ); |
120 | chordfret->insertItem( tr( "16th" ) ); | 120 | chordfret->insertItem( tr( "16th" ) ); |
121 | chordfret->setGeometry( QRect( 90, 0, 55, 21 ) ); //cxm less 5 width | 121 | chordfret->setGeometry( QRect( 90, 0, 55, 21 ) ); //cxm less 5 width |
122 | 122 | ||
123 | chordnote = new QComboBox( FALSE, tab, "chordnote" ); | 123 | chordnote = new QComboBox( FALSE, tab, "chordnote" ); |
124 | chordnote->insertItem( tr( "C" ) ); | 124 | chordnote->insertItem( tr( "C" ) ); |
125 | chordnote->insertItem( tr( "C#" ) ); | 125 | chordnote->insertItem( tr( "C#" ) ); |
126 | chordnote->insertItem( tr( "D" ) ); | 126 | chordnote->insertItem( tr( "D" ) ); |
127 | chordnote->insertItem( tr( "Eb" ) ); | 127 | chordnote->insertItem( tr( "Eb" ) ); |
128 | chordnote->insertItem( tr( "E" ) ); | 128 | chordnote->insertItem( tr( "E" ) ); |
129 | chordnote->insertItem( tr( "F" ) ); | 129 | chordnote->insertItem( tr( "F" ) ); |
130 | chordnote->insertItem( tr( "F#" ) ); | 130 | chordnote->insertItem( tr( "F#" ) ); |
131 | chordnote->insertItem( tr( "G" ) ); | 131 | chordnote->insertItem( tr( "G" ) ); |
132 | chordnote->insertItem( tr( "G#" ) ); | 132 | chordnote->insertItem( tr( "G#" ) ); |
133 | chordnote->insertItem( tr( "A" ) ); | 133 | chordnote->insertItem( tr( "A" ) ); |
134 | chordnote->insertItem( tr( "Bb" ) ); | 134 | chordnote->insertItem( tr( "Bb" ) ); |
135 | chordnote->insertItem( tr( "B" ) ); | 135 | chordnote->insertItem( tr( "B" ) ); |
136 | chordnote->setGeometry( QRect( 0, 0, 40, 21 ) ); | 136 | chordnote->setGeometry( QRect( 0, 0, 40, 21 ) ); |
137 | chordnote->setCurrentItem( 9 ); | 137 | chordnote->setCurrentItem( 9 ); |
138 | 138 | ||
139 | QWidget* privateLayoutWidget = new QWidget( tab, "Layout1" ); | 139 | QWidget* privateLayoutWidget = new QWidget( tab, "Layout1" ); |
140 | privateLayoutWidget->setGeometry( QRect( 5, 232, 160, 20 ) ); | 140 | privateLayoutWidget->setGeometry( QRect( 5, 232, 160, 20 ) ); |
141 | Layout1 = new QHBoxLayout( privateLayoutWidget ); | 141 | Layout1 = new QHBoxLayout( privateLayoutWidget ); |
142 | Layout1->setSpacing( 6 ); | 142 | Layout1->setSpacing( 6 ); |
143 | Layout1->setMargin( 0 ); | 143 | Layout1->setMargin( 0 ); |
144 | 144 | ||
145 | s1_1 = new QLabel( privateLayoutWidget, "s1_1" ); | 145 | s1_1 = new QLabel( privateLayoutWidget, "s1_1" ); |
146 | s1_1->setText( tr( "E" ) ); | 146 | s1_1->setText( tr( "E" ) ); |
147 | s1_1->setAlignment( int( QLabel::AlignCenter ) ); | 147 | s1_1->setAlignment( int( QLabel::AlignCenter ) ); |
148 | Layout1->addWidget( s1_1 ); | 148 | Layout1->addWidget( s1_1 ); |
149 | 149 | ||
150 | s1_2 = new QLabel( privateLayoutWidget, "s1_2" ); | 150 | s1_2 = new QLabel( privateLayoutWidget, "s1_2" ); |
151 | s1_2->setText( tr( "A" ) ); | 151 | s1_2->setText( tr( "A" ) ); |
152 | s1_2->setAlignment( int( QLabel::AlignCenter ) ); | 152 | s1_2->setAlignment( int( QLabel::AlignCenter ) ); |
153 | Layout1->addWidget( s1_2 ); | 153 | Layout1->addWidget( s1_2 ); |
154 | 154 | ||
155 | s1_3 = new QLabel( privateLayoutWidget, "s1_3" ); | 155 | s1_3 = new QLabel( privateLayoutWidget, "s1_3" ); |
156 | s1_3->setText( tr( "E" ) ); | 156 | s1_3->setText( tr( "E" ) ); |
157 | s1_3->setAlignment( int( QLabel::AlignCenter ) ); | 157 | s1_3->setAlignment( int( QLabel::AlignCenter ) ); |
158 | Layout1->addWidget( s1_3 ); | 158 | Layout1->addWidget( s1_3 ); |
159 | 159 | ||
160 | s1_4 = new QLabel( privateLayoutWidget, "s1_4" ); | 160 | s1_4 = new QLabel( privateLayoutWidget, "s1_4" ); |
161 | s1_4->setText( tr( "A" ) ); | 161 | s1_4->setText( tr( "A" ) ); |
162 | s1_4->setAlignment( int( QLabel::AlignCenter ) ); | 162 | s1_4->setAlignment( int( QLabel::AlignCenter ) ); |
163 | Layout1->addWidget( s1_4 ); | 163 | Layout1->addWidget( s1_4 ); |
164 | 164 | ||
165 | s1_5 = new QLabel( privateLayoutWidget, "s1_5" ); | 165 | s1_5 = new QLabel( privateLayoutWidget, "s1_5" ); |
166 | s1_5->setText( tr( "C#" ) ); | 166 | s1_5->setText( tr( "C#" ) ); |
167 | s1_5->setAlignment( int( QLabel::AlignCenter ) ); | 167 | s1_5->setAlignment( int( QLabel::AlignCenter ) ); |
168 | Layout1->addWidget( s1_5 ); | 168 | Layout1->addWidget( s1_5 ); |
169 | 169 | ||
170 | s1_6 = new QLabel( privateLayoutWidget, "s1_6" ); | 170 | s1_6 = new QLabel( privateLayoutWidget, "s1_6" ); |
171 | s1_6->setText( tr( "E" ) ); | 171 | s1_6->setText( tr( "E" ) ); |
172 | s1_6->setAlignment( int( QLabel::AlignCenter ) ); | 172 | s1_6->setAlignment( int( QLabel::AlignCenter ) ); |
173 | Layout1->addWidget( s1_6 ); | 173 | Layout1->addWidget( s1_6 ); |
174 | 174 | ||
175 | // sound_label = new QLabel( tab, "sound_label" ); | 175 | // sound_label = new QLabel( tab, "sound_label" ); |
176 | // sound_label->setGeometry( QRect( 185, 160, 32, 17 ) ); | 176 | // sound_label->setGeometry( QRect( 185, 160, 32, 17 ) ); |
177 | // sound_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sound_label->sizePolicy().hasHeightForWidth() ) ); | 177 | // sound_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sound_label->sizePolicy().hasHeightForWidth() ) ); |
178 | // sound_label->setPixmap( image0 ); | 178 | // sound_label->setPixmap( image0 ); |
179 | // sound_label->pixmap()->setMask(*image0.mask()); | 179 | // sound_label->pixmap()->setMask(*image0.mask()); |
180 | // sound_label->setScaledContents( TRUE ); | 180 | // sound_label->setScaledContents( TRUE ); |
181 | // sound_label->setBackgroundMode( QWidget::PaletteButton ); | 181 | // sound_label->setBackgroundMode( QWidget::PaletteButton ); |
182 | // sound_label->setBackgroundColor(this->backgroundColor()); | 182 | // sound_label->setBackgroundColor(this->backgroundColor()); |
183 | // sound_label->setPalette( QPalette( QColor( 232, 227, 215) ) ); | 183 | // sound_label->setPalette( QPalette( QColor( 232, 227, 215) ) ); |
184 | 184 | ||
185 | 185 | ||
186 | Frame6 = new QFrame( tab, "Frame6" ); | 186 | Frame6 = new QFrame( tab, "Frame6" ); |
187 | Frame6->setGeometry( QRect( 170, 145, 66, 10 ) ); | 187 | Frame6->setGeometry( QRect( 170, 145, 66, 10 ) ); |
188 | Frame6->setFrameShape( QFrame::HLine ); | 188 | Frame6->setFrameShape( QFrame::HLine ); |
189 | Frame6->setFrameShadow( QFrame::Raised ); | 189 | Frame6->setFrameShadow( QFrame::Raised ); |
190 | 190 | ||
191 | chordshow_label = new QLabel( tab, "chordshow_label" ); | 191 | chordshow_label = new QLabel( tab, "chordshow_label" ); |
192 | chordshow_label->setGeometry( QRect( 185, 60, 32, 17 ) ); | 192 | chordshow_label->setGeometry( QRect( 185, 60, 32, 17 ) ); |
193 | // chordshow_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, chordshow_label->sizePolicy().hasHeightForWidth() ) ); | 193 | // chordshow_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, chordshow_label->sizePolicy().hasHeightForWidth() ) ); |
194 | chordshow_label->setFrameShape( QLabel::NoFrame ); | 194 | chordshow_label->setFrameShape( QLabel::NoFrame ); |
195 | chordshow_label->setPixmap( image1 ); | 195 | chordshow_label->setPixmap( image1 ); |
196 | chordshow_label->setScaledContents( TRUE ); | 196 | chordshow_label->setScaledContents( TRUE ); |
197 | // chordshow_label->setBackgroundMode( QWidget::PaletteButton ); | 197 | // chordshow_label->setBackgroundMode( QWidget::PaletteButton ); |
198 | 198 | ||
199 | transport_rec = new QPushButton( tab, "transport_rec" ); | 199 | transport_rec = new QPushButton( tab, "transport_rec" ); |
200 | transport_rec->setGeometry( QRect( 170, 80, 30, 30 ) ); | 200 | transport_rec->setGeometry( QRect( 170, 80, 30, 30 ) ); |
201 | transport_rec->setText( tr( "" ) ); | 201 | transport_rec->setText( "" ); |
202 | transport_rec->setPixmap( image2 ); | 202 | transport_rec->setPixmap( image2 ); |
203 | 203 | ||
204 | play_sound = new QPushButton( tab, "play_sound" ); | 204 | play_sound = new QPushButton( tab, "play_sound" ); |
205 | play_sound->setGeometry( QRect( 170, 180, 60, 55 ) ); | 205 | play_sound->setGeometry( QRect( 170, 180, 60, 55 ) ); |
206 | play_sound->setText( tr( "" ) ); | 206 | play_sound->setText( "" ); |
207 | play_sound->setPixmap( image3 ); | 207 | play_sound->setPixmap( image3 ); |
208 | 208 | ||
209 | Frame6_2 = new QFrame( tab, "Frame6_2" ); | 209 | Frame6_2 = new QFrame( tab, "Frame6_2" ); |
210 | Frame6_2->setGeometry( QRect( 170, 45, 66, 10 ) ); | 210 | Frame6_2->setGeometry( QRect( 170, 45, 66, 10 ) ); |
211 | Frame6_2->setFrameShape( QFrame::HLine ); | 211 | Frame6_2->setFrameShape( QFrame::HLine ); |
212 | Frame6_2->setFrameShadow( QFrame::Raised ); | 212 | Frame6_2->setFrameShadow( QFrame::Raised ); |
213 | 213 | ||
214 | transport_play = new QPushButton( tab, "transport_play" ); | 214 | transport_play = new QPushButton( tab, "transport_play" ); |
215 | transport_play->setEnabled( FALSE ); | 215 | transport_play->setEnabled( FALSE ); |
216 | transport_play->setGeometry( QRect( 200, 80, 30, 30 ) ); | 216 | transport_play->setGeometry( QRect( 200, 80, 30, 30 ) ); |
217 | transport_play->setText( tr( "" ) ); | 217 | transport_play->setText( "" ); |
218 | transport_play->setPixmap( image3 ); | 218 | transport_play->setPixmap( image3 ); |
219 | 219 | ||
220 | transport_rew = new QPushButton( tab, "transport_rew" ); | 220 | transport_rew = new QPushButton( tab, "transport_rew" ); |
221 | transport_rew->setEnabled( FALSE ); | 221 | transport_rew->setEnabled( FALSE ); |
222 | transport_rew->setGeometry( QRect( 170, 110, 30, 30 ) ); | 222 | transport_rew->setGeometry( QRect( 170, 110, 30, 30 ) ); |
223 | transport_rew->setText( tr( "" ) ); | 223 | transport_rew->setText( "" ); |
224 | transport_rew->setPixmap( image4 ); | 224 | transport_rew->setPixmap( image4 ); |
225 | 225 | ||
226 | transport_fwd = new QPushButton( tab, "transport_fwd" ); | 226 | transport_fwd = new QPushButton( tab, "transport_fwd" ); |
227 | transport_fwd->setEnabled( FALSE ); | 227 | transport_fwd->setEnabled( FALSE ); |
228 | transport_fwd->setGeometry( QRect( 200, 110, 30, 30 ) ); | 228 | transport_fwd->setGeometry( QRect( 200, 110, 30, 30 ) ); |
229 | transport_fwd->setText( tr( "" ) ); | 229 | transport_fwd->setText( "" ); |
230 | transport_fwd->setPixmap( image5 ); | 230 | transport_fwd->setPixmap( image5 ); |
231 | 231 | ||
232 | chordname = new QLabel( tab, "chordname" ); | 232 | chordname = new QLabel( tab, "chordname" ); |
233 | chordname->setGeometry( QRect( 146, 0, 90, 20 ) ); //cxm moved l 5 | 233 | chordname->setGeometry( QRect( 146, 0, 90, 20 ) ); //cxm moved l 5 |
234 | chordname->setText( tr( "A" ) ); | 234 | chordname->setText( tr( "A" ) ); |
235 | chordname->setAlignment( int( QLabel::AlignCenter ) ); | 235 | chordname->setAlignment( int( QLabel::AlignCenter ) ); |
236 | QToolTip::add( chordname, tr( "" ) ); | 236 | QToolTip::add( chordname, "" ); |
237 | 237 | ||
238 | synth = new gs(); | 238 | synth = new gs(); |
239 | tuner = new gt(); | 239 | tuner = new gt(); |
240 | frets = new FretBoard( tab, "frets" ); | 240 | frets = new FretBoard( tab, "frets" ); |
241 | frets->setGeometry( QRect( 0, 20, 168, 210 ) ); | 241 | frets->setGeometry( QRect( 0, 20, 168, 210 ) ); |
242 | tabs->insertTab( tab, tr( "Guitar" ) ); | 242 | tabs->insertTab( tab, tr( "Guitar" ) ); |
243 | 243 | ||
244 | tab_2 = new QWidget( tabs, "tab_2" ); | 244 | tab_2 = new QWidget( tabs, "tab_2" ); |
245 | 245 | ||
246 | optlab2 = new QLabel( tab_2, "optlab2" ); | 246 | optlab2 = new QLabel( tab_2, "optlab2" ); |
247 | optlab2->setGeometry( QRect( 9, 58, 120, 41 ) ); | 247 | optlab2->setGeometry( QRect( 9, 58, 120, 41 ) ); |
248 | optlab2->setText( tr( "Alternative tunings are possible" ) ); | 248 | optlab2->setText( tr( "Alternative tunings are possible" ) ); |
249 | optlab2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); | 249 | optlab2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); |
250 | 250 | ||
251 | span = new QComboBox( FALSE, tab_2, "span" ); | 251 | span = new QComboBox( FALSE, tab_2, "span" ); |
252 | span->insertItem( tr( "2" ) ); | 252 | span->insertItem( tr( "2" ) ); |
253 | span->insertItem( tr( "3" ) ); | 253 | span->insertItem( tr( "3" ) ); |
254 | span->insertItem( tr( "4" ) ); | 254 | span->insertItem( tr( "4" ) ); |
255 | span->insertItem( tr( "5" ) ); | 255 | span->insertItem( tr( "5" ) ); |
256 | span->insertItem( tr( "6" ) ); | 256 | span->insertItem( tr( "6" ) ); |
257 | span->setGeometry( QRect( 180, 20, 50, 21 ) ); | 257 | span->setGeometry( QRect( 180, 20, 50, 21 ) ); |
258 | span->setCurrentItem( 1 ); | 258 | span->setCurrentItem( 1 ); |
259 | 259 | ||
260 | TextLabel1 = new QLabel( tab_2, "TextLabel1" ); | 260 | TextLabel1 = new QLabel( tab_2, "TextLabel1" ); |
261 | TextLabel1->setGeometry( QRect( 3, 109, 226, 140 ) ); | 261 | TextLabel1->setGeometry( QRect( 3, 109, 226, 140 ) ); |
262 | TextLabel1->setText( tr( QString::fromUtf8( "©2002 Camilo Mesias\n" | 262 | TextLabel1->setText( tr( QString::fromUtf8( "©2002 Camilo Mesias\n" |
263 | "camilo@mesias.co.uk\n" | 263 | "camilo@mesias.co.uk\n" |
264 | "Version 0.0.7 beta" ) ) ); | 264 | "Version 0.0.7 beta" ) ) ); |
265 | TextLabel1->setAlignment( int( QLabel::AlignBottom | QLabel::AlignLeft ) ); | 265 | TextLabel1->setAlignment( int( QLabel::AlignBottom | QLabel::AlignLeft ) ); |
266 | 266 | ||
267 | tuning = new QComboBox( FALSE, tab_2, "tuning" ); | 267 | tuning = new QComboBox( FALSE, tab_2, "tuning" ); |
268 | tuning->insertItem( tr( "EADGBE" ) ); | 268 | tuning->insertItem( tr( "EADGBE" ) ); |
269 | tuning->insertItem( tr( "EBEG#BE" ) ); | 269 | tuning->insertItem( tr( "EBEG#BE" ) ); |
270 | tuning->insertItem( tr( "EAEAC#E" ) ); | 270 | tuning->insertItem( tr( "EAEAC#E" ) ); |
271 | tuning->insertItem( tr( "EADF#BE" ) ); | 271 | tuning->insertItem( tr( "EADF#BE" ) ); |
272 | tuning->insertItem( tr( "EADGCF" ) ); | 272 | tuning->insertItem( tr( "EADGCF" ) ); |
273 | tuning->insertItem( tr( "DADGAD" ) ); | 273 | tuning->insertItem( tr( "DADGAD" ) ); |
274 | tuning->insertItem( tr( "DGCGCD" ) ); | 274 | tuning->insertItem( tr( "DGCGCD" ) ); |
275 | tuning->insertItem( tr( "DADF#AD" ) ); | 275 | tuning->insertItem( tr( "DADF#AD" ) ); |
276 | tuning->insertItem( tr( "DADGBE" ) ); | 276 | tuning->insertItem( tr( "DADGBE" ) ); |
277 | tuning->insertItem( tr( "DGDGBD" ) ); | 277 | tuning->insertItem( tr( "DGDGBD" ) ); |
278 | tuning->insertItem( tr( "DADACD" ) ); | 278 | tuning->insertItem( tr( "DADACD" ) ); |
279 | tuning->insertItem( tr( "CGCGAE" ) ); | 279 | tuning->insertItem( tr( "CGCGAE" ) ); |
280 | tuning->insertItem( tr( "FADGBE" ) ); | 280 | tuning->insertItem( tr( "FADGBE" ) ); |
281 | tuning->insertItem( tr( "G minor" ) ); | 281 | tuning->insertItem( tr( "G minor" ) ); |
282 | tuning->setGeometry( QRect( 140, 70, 91, 21 ) ); | 282 | tuning->setGeometry( QRect( 140, 70, 91, 21 ) ); |
283 | 283 | ||
284 | optlab1 = new QLabel( tab_2, "optlab1" ); | 284 | optlab1 = new QLabel( tab_2, "optlab1" ); |
285 | optlab1->setGeometry( QRect( 8, 8, 160, 40 ) ); | 285 | optlab1->setGeometry( QRect( 8, 8, 160, 40 ) ); |
286 | optlab1->setText( tr( "Span: the greatest number of frets over which you want chords to be generated" ) ); | 286 | optlab1->setText( tr( "Span: the greatest number of frets over which you want chords to be generated" ) ); |
287 | optlab1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); | 287 | optlab1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignLeft ) ); |
288 | tabs->insertTab( tab_2, tr( "Options" ) ); | 288 | tabs->insertTab( tab_2, tr( "Options" ) ); |
289 | 289 | ||
290 | Tuner = new QWidget( tabs, "Tuner" ); | 290 | Tuner = new QWidget( tabs, "Tuner" ); |
291 | 291 | ||
292 | Frame4 = new QFrame( Tuner, "Frame4" ); | 292 | Frame4 = new QFrame( Tuner, "Frame4" ); |
293 | Frame4->setGeometry( QRect( 0, 0, 230, 126 ) ); | 293 | Frame4->setGeometry( QRect( 0, 0, 230, 126 ) ); |
294 | Frame4->setFrameShape( QFrame::Box ); | 294 | Frame4->setFrameShape( QFrame::Box ); |
295 | Frame4->setFrameShadow( QFrame::Raised ); | 295 | Frame4->setFrameShadow( QFrame::Raised ); |
296 | 296 | ||
297 | vu = new VUMeter( Frame4, "vu" ); | 297 | vu = new VUMeter( Frame4, "vu" ); |
298 | vu->setGeometry( QRect( 5, 5, 220, 115 ) ); | 298 | vu->setGeometry( QRect( 5, 5, 220, 115 ) ); |
299 | 299 | ||
300 | tuner_note = new QComboBox( FALSE, Tuner, "tuner_note" ); | 300 | tuner_note = new QComboBox( FALSE, Tuner, "tuner_note" ); |
301 | tuner_note->insertItem( tr( "auto" ) ); | 301 | tuner_note->insertItem( tr( "auto" ) ); |
302 | tuner_note->insertItem( tr( "E" ) ); | 302 | tuner_note->insertItem( tr( "E" ) ); |
303 | tuner_note->insertItem( tr( "D" ) ); | 303 | tuner_note->insertItem( tr( "D" ) ); |
304 | tuner_note->insertItem( tr( "G" ) ); | 304 | tuner_note->insertItem( tr( "G" ) ); |
305 | tuner_note->insertItem( tr( "A" ) ); | 305 | tuner_note->insertItem( tr( "A" ) ); |
306 | tuner_note->insertItem( tr( "B" ) ); | 306 | tuner_note->insertItem( tr( "B" ) ); |
307 | tuner_note->insertItem( tr( "C" ) ); | 307 | tuner_note->insertItem( tr( "C" ) ); |
308 | tuner_note->insertItem( tr( "F" ) ); | 308 | tuner_note->insertItem( tr( "F" ) ); |
309 | tuner_note->setGeometry( QRect( 5, 160, 90, 20 ) ); | 309 | tuner_note->setGeometry( QRect( 5, 160, 90, 20 ) ); |
310 | 310 | ||
311 | Frame8 = new QFrame( Tuner, "Frame8" ); | 311 | Frame8 = new QFrame( Tuner, "Frame8" ); |
312 | Frame8->setGeometry( QRect( -2, 188, 231, 10 ) ); | 312 | Frame8->setGeometry( QRect( -2, 188, 231, 10 ) ); |
313 | Frame8->setFrameShape( QFrame::HLine ); | 313 | Frame8->setFrameShape( QFrame::HLine ); |
314 | Frame8->setFrameShadow( QFrame::Raised ); | 314 | Frame8->setFrameShadow( QFrame::Raised ); |
315 | 315 | ||
316 | tuner_start = new QPushButton( Tuner, "tuner_start" ); | 316 | tuner_start = new QPushButton( Tuner, "tuner_start" ); |
317 | tuner_start->setGeometry( QRect( 100, 155, 91, 30 ) ); | 317 | tuner_start->setGeometry( QRect( 100, 155, 91, 30 ) ); |
318 | tuner_start->setText( tr( "Start" ) ); | 318 | tuner_start->setText( tr( "Start" ) ); |
319 | 319 | ||
320 | tuner_lab1 = new QLabel( Tuner, "tuner_lab1" ); | 320 | tuner_lab1 = new QLabel( Tuner, "tuner_lab1" ); |
321 | tuner_lab1->setGeometry( QRect( 10, 130, 100, 21 ) ); | 321 | tuner_lab1->setGeometry( QRect( 10, 130, 100, 21 ) ); |
322 | tuner_lab1->setText( tr( "Tuner operation" ) ); | 322 | tuner_lab1->setText( tr( "Tuner operation" ) ); |
323 | 323 | ||
324 | tuner_lab2 = new QLabel( Tuner, "tuner_lab2" ); | 324 | tuner_lab2 = new QLabel( Tuner, "tuner_lab2" ); |
325 | tuner_lab2->setGeometry( QRect( 10, 200, 100, 16 ) ); | 325 | tuner_lab2->setGeometry( QRect( 10, 200, 100, 16 ) ); |
326 | tuner_lab2->setText( tr( "Pitch calibration" ) ); | 326 | tuner_lab2->setText( tr( "Pitch calibration" ) ); |
327 | 327 | ||
328 | tuner_calib_note = new QComboBox( FALSE, Tuner, "tuner_calib_note" ); | 328 | tuner_calib_note = new QComboBox( FALSE, Tuner, "tuner_calib_note" ); |
329 | tuner_calib_note->insertItem( tr( "A" ) ); | 329 | tuner_calib_note->insertItem( tr( "A" ) ); |
330 | tuner_calib_note->insertItem( tr( "C" ) ); | 330 | tuner_calib_note->insertItem( tr( "C" ) ); |
331 | tuner_calib_note->setGeometry( QRect( 5, 225, 90, 21 ) ); | 331 | tuner_calib_note->setGeometry( QRect( 5, 225, 90, 21 ) ); |
332 | 332 | ||
333 | tuner_calib_freq = new QSpinBox( Tuner, "tuner_calib_freq" ); | 333 | tuner_calib_freq = new QSpinBox( Tuner, "tuner_calib_freq" ); |
334 | tuner_calib_freq->setGeometry( QRect( 105, 225, 71, 21 ) ); | 334 | tuner_calib_freq->setGeometry( QRect( 105, 225, 71, 21 ) ); |
335 | tuner_calib_freq->setSuffix( tr( "Hz" ) ); | 335 | tuner_calib_freq->setSuffix( tr( "Hz" ) ); |
336 | tuner_calib_freq->setWrapping( TRUE ); | 336 | tuner_calib_freq->setWrapping( TRUE ); |
337 | tuner_calib_freq->setMaxValue( 500 ); | 337 | tuner_calib_freq->setMaxValue( 500 ); |
338 | tuner_calib_freq->setMinValue( 300 ); | 338 | tuner_calib_freq->setMinValue( 300 ); |
339 | tuner_calib_freq->setValue( 440 ); | 339 | tuner_calib_freq->setValue( 440 ); |
340 | 340 | ||
341 | tuner_lab3 = new QLabel( Tuner, "tuner_lab3" ); | 341 | tuner_lab3 = new QLabel( Tuner, "tuner_lab3" ); |
342 | tuner_lab3->setGeometry( QRect( 185, 225, 40, 21 ) ); | 342 | tuner_lab3->setGeometry( QRect( 185, 225, 40, 21 ) ); |
343 | tuner_lab3->setText( tr( "Pitch" ) ); | 343 | tuner_lab3->setText( tr( "Pitch" ) ); |
344 | 344 | ||
345 | tuner_pic1 = new QLabel( Tuner, "tuner_pic1" ); | 345 | tuner_pic1 = new QLabel( Tuner, "tuner_pic1" ); |
346 | tuner_pic1->setGeometry( QRect( 195, 155, 31, 31 ) ); | 346 | tuner_pic1->setGeometry( QRect( 195, 155, 31, 31 ) ); |
347 | tuner_pic1->setFrameShape( QLabel::NoFrame ); | 347 | tuner_pic1->setFrameShape( QLabel::NoFrame ); |
348 | tuner_pic1->setPixmap( image6 ); | 348 | tuner_pic1->setPixmap( image6 ); |
349 | tuner_pic1->setScaledContents( TRUE ); | 349 | tuner_pic1->setScaledContents( TRUE ); |
350 | tabs->insertTab( Tuner, tr( "Tuner" ) ); | 350 | tabs->insertTab( Tuner, tr( "Tuner" ) ); |
351 | 351 | ||
352 | tab_3 = new QWidget( tabs, "tab_3" ); | 352 | tab_3 = new QWidget( tabs, "tab_3" ); |
353 | 353 | ||
354 | chordlistlab1 = new QLabel( tab_3, "chordlistlab1" ); | 354 | chordlistlab1 = new QLabel( tab_3, "chordlistlab1" ); |
355 | chordlistlab1->setGeometry( QRect( 5, 5, 216, 16 ) ); | 355 | chordlistlab1->setGeometry( QRect( 5, 5, 216, 16 ) ); |
356 | chordlistlab1->setText( tr( "Chord list" ) ); | 356 | chordlistlab1->setText( tr( "Chord list" ) ); |
357 | 357 | ||
358 | chordlist = new QListBox( tab_3, "chordlist" ); | 358 | chordlist = new QListBox( tab_3, "chordlist" ); |
359 | chordlist->setGeometry( QRect( 5, 25, 220, 200 ) ); | 359 | chordlist->setGeometry( QRect( 5, 25, 220, 200 ) ); |
360 | 360 | ||
361 | list_remove_btn = new QPushButton( tab_3, "list_remove_btn" ); | 361 | list_remove_btn = new QPushButton( tab_3, "list_remove_btn" ); |
362 | list_remove_btn->setGeometry( QRect( 150, 230, 71, 25 ) ); | 362 | list_remove_btn->setGeometry( QRect( 150, 230, 71, 25 ) ); |
363 | list_remove_btn->setText( tr( "Remove" ) ); | 363 | list_remove_btn->setText( tr( "Remove" ) ); |
364 | tabs->insertTab( tab_3, tr( "Chords" ) ); | 364 | tabs->insertTab( tab_3, tr( "Chords" ) ); |
365 | 365 | ||
366 | // hope this does what it's supposed to!! | 366 | // hope this does what it's supposed to!! |
367 | // setPalette( QPalette( QColor( 232, 227, 215) ) ); | 367 | // setPalette( QPalette( QColor( 232, 227, 215) ) ); |
368 | 368 | ||
369 | // signals and slots connections | 369 | // signals and slots connections |
370 | 370 | ||
371 | //cxm | 371 | //cxm |
372 | connect( tuning, SIGNAL( activated(int) ), frets, SLOT( Tune(int) ) ); | 372 | connect( tuning, SIGNAL( activated(int) ), frets, SLOT( Tune(int) ) ); |
373 | connect( span, SIGNAL( activated(int) ), frets, SLOT( Span(int) ) ); | 373 | connect( span, SIGNAL( activated(int) ), frets, SLOT( Span(int) ) ); |
374 | connect( transport_rec, SIGNAL( clicked() ), this, SLOT( transport_rec_cb() )); | 374 | connect( transport_rec, SIGNAL( clicked() ), this, SLOT( transport_rec_cb() )); |
375 | connect( play_sound, SIGNAL( clicked() ), this, SLOT( play_chord_cb() )); | 375 | connect( play_sound, SIGNAL( clicked() ), this, SLOT( play_chord_cb() )); |
376 | connect( tuner_start, SIGNAL( clicked() ), this, SLOT( tuner_start_cb() )); | 376 | connect( tuner_start, SIGNAL( clicked() ), this, SLOT( tuner_start_cb() )); |
377 | connect( tuner_note, SIGNAL( textChanged(const QString&) ), vu, SLOT( AnnotL(const QString&) )); | 377 | connect( tuner_note, SIGNAL( textChanged(const QString&) ), vu, SLOT( AnnotL(const QString&) )); |
378 | connect( this, SIGNAL( frequency_change(int) ), vu, SLOT( Value(int) )); | 378 | connect( this, SIGNAL( frequency_change(int) ), vu, SLOT( Value(int) )); |
379 | 379 | ||
380 | connect( chordnote, SIGNAL( activated(int) ), frets, SLOT( Base(int) ) ); | 380 | connect( chordnote, SIGNAL( activated(int) ), frets, SLOT( Base(int) ) ); |
381 | connect( chordkey, SIGNAL( activated(int) ), frets, SLOT( Chord(int) ) ); | 381 | connect( chordkey, SIGNAL( activated(int) ), frets, SLOT( Chord(int) ) ); |
382 | connect( chordfret, SIGNAL( activated(int) ), frets, SLOT( Fret(int) ) ); | 382 | connect( chordfret, SIGNAL( activated(int) ), frets, SLOT( Fret(int) ) ); |
383 | connect( list_remove_btn, SIGNAL( clicked() ), this, SLOT( list_remove_cb() ) ); | 383 | connect( list_remove_btn, SIGNAL( clicked() ), this, SLOT( list_remove_cb() ) ); |
384 | connect( frets, SIGNAL( s1nameChanged(const QString&) ), s1_1, SLOT( setText(const QString&) ) ); | 384 | connect( frets, SIGNAL( s1nameChanged(const QString&) ), s1_1, SLOT( setText(const QString&) ) ); |
385 | connect( frets, SIGNAL( s2nameChanged(const QString&) ), s1_2, SLOT( setText(const QString&) ) ); | 385 | connect( frets, SIGNAL( s2nameChanged(const QString&) ), s1_2, SLOT( setText(const QString&) ) ); |
386 | connect( frets, SIGNAL( s3nameChanged(const QString&) ), s1_3, SLOT( setText(const QString&) ) ); | 386 | connect( frets, SIGNAL( s3nameChanged(const QString&) ), s1_3, SLOT( setText(const QString&) ) ); |
387 | connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) ); | 387 | connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) ); |
388 | connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) ); | 388 | connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) ); |
389 | connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) ); | 389 | connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) ); |
390 | connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) ); | 390 | connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) ); |
391 | } | 391 | } |
392 | 392 | ||
393 | 393 | ||
394 | static int known=0; | 394 | static int known=0; |
395 | #include <qmessagebox.h> | 395 | #include <qmessagebox.h> |
396 | void PowerchordBase::transport_rec_cb(){ | 396 | void PowerchordBase::transport_rec_cb(){ |
397 | chordlist->insertItem(chordname->text(),-1); | 397 | chordlist->insertItem(chordname->text(),-1); |
398 | if (!known){ | 398 | if (!known){ |
399 | QMessageBox::information(this, tr("Powerchord"), | 399 | QMessageBox::information(this, tr("Powerchord"), |
400 | tr("<P>This chord has been saved into the list of chords, for later playback.<P>")); | 400 | tr("<P>This chord has been saved into the list of chords, for later playback.<P>")); |
401 | known = 1; | 401 | known = 1; |
402 | } | 402 | } |
403 | } | 403 | } |
404 | void PowerchordBase::list_remove_cb(){ | 404 | void PowerchordBase::list_remove_cb(){ |
405 | if (chordlist->count() > 0){ | 405 | if (chordlist->count() > 0){ |
406 | chordlist->removeItem(0); | 406 | chordlist->removeItem(0); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | void PowerchordBase::play_chord_cb(){ | 409 | void PowerchordBase::play_chord_cb(){ |
410 | // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes."); | 410 | // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes."); |
411 | 411 | ||
412 | 412 | ||
413 | if (audio_timer){ | 413 | if (audio_timer){ |
414 | audio_timer->stop(); | 414 | audio_timer->stop(); |
415 | // set pixmap? | 415 | // set pixmap? |
416 | synth->Stop(); | 416 | synth->Stop(); |
417 | delete(audio_timer); | 417 | delete(audio_timer); |
418 | audio_timer = 0; | 418 | audio_timer = 0; |
419 | }else{ | 419 | }else{ |
420 | // get notes from chord engine | 420 | // get notes from chord engine |
421 | 421 | ||
422 | int note; | 422 | int note; |
423 | int base; | 423 | int base; |
424 | int octave; | 424 | int octave; |
425 | note = frets->ce.noteindex(0); | 425 | note = frets->ce.noteindex(0); |
426 | if (note >= 0){ | 426 | if (note >= 0){ |
427 | //fprintf(stderr, "Note was %d\n", note); | 427 | //fprintf(stderr, "Note was %d\n", note); |
428 | base = note % 12; | 428 | base = note % 12; |
429 | octave = note / 12; | 429 | octave = note / 12; |
430 | synth->note_start(0, base, octave); | 430 | synth->note_start(0, base, octave); |
431 | }else{ | 431 | }else{ |
432 | // subtle bug here - replay second note if 1st one muted | 432 | // subtle bug here - replay second note if 1st one muted |
433 | note = frets->ce.noteindex(1); | 433 | note = frets->ce.noteindex(1); |
434 | base = note % 12; | 434 | base = note % 12; |
435 | octave = note / 12; | 435 | octave = note / 12; |
436 | synth->note_start(1, base, octave); | 436 | synth->note_start(1, base, octave); |
437 | 437 | ||
438 | } | 438 | } |
439 | 439 | ||
440 | // init synth | 440 | // init synth |
441 | if (synth->Play()){ | 441 | if (synth->Play()){ |
442 | // error | 442 | // error |
443 | QMessageBox::information(this, tr("Powerchord"), | 443 | QMessageBox::information(this, tr("Powerchord"), |
444 | tr("<P>Unable to open device for sound playback - check that no other application is using it.</P>")); | 444 | tr("<P>Unable to open device for sound playback - check that no other application is using it.</P>")); |
445 | return; | 445 | return; |
446 | } | 446 | } |
447 | synth->fill_buffer(); | 447 | synth->fill_buffer(); |
448 | 448 | ||
449 | // start timer | 449 | // start timer |
450 | audio_timer = new QTimer(); | 450 | audio_timer = new QTimer(); |
451 | connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() )); | 451 | connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() )); |
452 | // set pixmap on player? | 452 | // set pixmap on player? |
453 | audio_timer->start(19); // 19 msec (fudge factor!!) | 453 | audio_timer->start(19); // 19 msec (fudge factor!!) |
454 | } | 454 | } |
455 | } | 455 | } |
456 | 456 | ||
457 | 457 | ||
458 | 458 | ||
459 | void PowerchordBase::audio_cb(){ | 459 | void PowerchordBase::audio_cb(){ |
460 | // play the next bit of audio until quiet | 460 | // play the next bit of audio until quiet |
461 | 461 | ||
462 | // strum timing | 462 | // strum timing |
463 | #define INTERVAL 2 | 463 | #define INTERVAL 2 |
464 | 464 | ||
465 | if ((synth->Frames() % INTERVAL) == 0){ | 465 | if ((synth->Frames() % INTERVAL) == 0){ |
466 | int string = synth->Frames() / INTERVAL; | 466 | int string = synth->Frames() / INTERVAL; |
467 | if (string <= 5){ | 467 | if (string <= 5){ |
468 | int note; | 468 | int note; |
469 | int base; | 469 | int base; |
470 | int octave; | 470 | int octave; |
471 | note = frets->ce.noteindex(string); | 471 | note = frets->ce.noteindex(string); |
472 | // check not muted... | 472 | // check not muted... |
473 | if (note > 0){ | 473 | if (note > 0){ |
474 | base = note % 12; | 474 | base = note % 12; |
475 | octave = note / 12; | 475 | octave = note / 12; |
476 | synth->note_start(string, base, octave); | 476 | synth->note_start(string, base, octave); |
477 | } | 477 | } |
478 | } | 478 | } |
479 | } | 479 | } |
480 | 480 | ||
481 | if (synth->Playing()){ | 481 | if (synth->Playing()){ |
482 | synth->write_buffer(); | 482 | synth->write_buffer(); |
483 | synth->fill_buffer(); | 483 | synth->fill_buffer(); |
484 | }else{ | 484 | }else{ |
485 | audio_timer->stop(); | 485 | audio_timer->stop(); |
486 | // set pixmap? | 486 | // set pixmap? |
487 | synth->Stop(); | 487 | synth->Stop(); |
488 | delete(audio_timer); | 488 | delete(audio_timer); |
489 | audio_timer = 0; | 489 | audio_timer = 0; |
490 | } | 490 | } |
491 | } | 491 | } |
492 | 492 | ||
493 | // the real tuner | 493 | // the real tuner |
494 | // void PowerchordBase::tuner_start_cb(){ | 494 | // void PowerchordBase::tuner_start_cb(){ |
495 | 495 | ||
496 | // if (tuner->Listening()){ | 496 | // if (tuner->Listening()){ |
497 | // simulation_timer->stop(); | 497 | // simulation_timer->stop(); |
498 | // tuner->Stop(); | 498 | // tuner->Stop(); |
499 | // tuner_pic1->setPixmap( *image6 ); | 499 | // tuner_pic1->setPixmap( *image6 ); |
500 | 500 | ||
501 | // }else{ | 501 | // }else{ |
502 | // tuner_pic1->setPixmap( *image_open ); | 502 | // tuner_pic1->setPixmap( *image_open ); |
503 | 503 | ||
504 | // if (!simulation_timer){ | 504 | // if (!simulation_timer){ |
505 | // simulation_timer = new QTimer(); | 505 | // simulation_timer = new QTimer(); |
506 | 506 | ||
507 | 507 | ||
508 | // connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_cb() )); | 508 | // connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_cb() )); |
509 | // } | 509 | // } |
510 | 510 | ||
511 | // simulation_timer->start(50); | 511 | // simulation_timer->start(50); |
512 | // tuner->Listen(); | 512 | // tuner->Listen(); |
513 | 513 | ||
514 | // } | 514 | // } |
515 | // } | 515 | // } |
516 | 516 | ||
517 | void PowerchordBase::tuner_cb(){ | 517 | void PowerchordBase::tuner_cb(){ |
518 | if (tuner->Listening()){ | 518 | if (tuner->Listening()){ |
519 | tuner->read_buffer(); | 519 | tuner->read_buffer(); |
520 | tuner->process_buffer(); | 520 | tuner->process_buffer(); |
521 | 521 | ||
522 | // update gui | 522 | // update gui |
523 | // do something with the note: tuner->Note() | 523 | // do something with the note: tuner->Note() |
524 | emit frequency_change(tuner->Tuning()); | 524 | emit frequency_change(tuner->Tuning()); |
525 | 525 | ||
526 | }else{ | 526 | }else{ |
527 | simulation_timer->stop(); | 527 | simulation_timer->stop(); |
528 | tuner->Stop(); | 528 | tuner->Stop(); |
529 | tuner_pic1->setPixmap( image6 ); | 529 | tuner_pic1->setPixmap( image6 ); |
530 | } | 530 | } |
531 | } | 531 | } |
532 | 532 | ||
533 | 533 | ||
534 | void PowerchordBase::tuner_start_cb(){ | 534 | void PowerchordBase::tuner_start_cb(){ |
535 | if (0 == QMessageBox::information(this, tr("Powerchord"), | 535 | if (0 == QMessageBox::information(this, tr("Powerchord"), |
536 | tr("<P>Using the microphone, the note's frequency is analysed. This is a simulation.</P>"), | 536 | tr("<P>Using the microphone, the note's frequency is analysed. This is a simulation.</P>"), |
537 | tr("OK"), tr("Cancel"), 0, 1)){ | 537 | tr("OK"), tr("Cancel"), 0, 1)){ |
538 | if (simulation_timer){ | 538 | if (simulation_timer){ |
539 | simulation_timer->stop(); | 539 | simulation_timer->stop(); |
540 | }else{ | 540 | }else{ |
541 | simulation_timer = new QTimer(); | 541 | simulation_timer = new QTimer(); |
542 | connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() )); | 542 | connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() )); |
543 | 543 | ||
544 | } | 544 | } |
545 | simulation_x = -45; | 545 | simulation_x = -45; |
546 | simulation_v = 0; | 546 | simulation_v = 0; |
547 | simulation_iter = 0; | 547 | simulation_iter = 0; |
548 | 548 | ||
549 | tuner_pic1->setPixmap( image_open ); | 549 | tuner_pic1->setPixmap( image_open ); |
550 | simulation_timer->start(100); | 550 | simulation_timer->start(100); |
551 | } | 551 | } |
552 | } | 552 | } |
553 | 553 | ||
554 | #include <stdio.h> | 554 | #include <stdio.h> |
555 | 555 | ||
556 | void PowerchordBase::tuner_simulation_cb(){ | 556 | void PowerchordBase::tuner_simulation_cb(){ |
557 | if (simulation_x < -10 || simulation_x > 10){ | 557 | if (simulation_x < -10 || simulation_x > 10){ |
558 | simulation_v = (simulation_v/2)-(simulation_x/5); | 558 | simulation_v = (simulation_v/2)-(simulation_x/5); |
559 | } | 559 | } |
560 | 560 | ||
561 | simulation_x += simulation_v; | 561 | simulation_x += simulation_v; |
562 | simulation_iter++; | 562 | simulation_iter++; |
563 | 563 | ||
564 | if (simulation_x > 50){ | 564 | if (simulation_x > 50){ |
565 | simulation_x = 50; | 565 | simulation_x = 50; |
566 | } | 566 | } |
567 | 567 | ||
568 | if (simulation_x < -50){ | 568 | if (simulation_x < -50){ |
569 | simulation_x = -50; | 569 | simulation_x = -50; |
570 | } | 570 | } |
571 | 571 | ||
572 | if (simulation_iter > 50){ | 572 | if (simulation_iter > 50){ |
573 | simulation_timer->stop(); | 573 | simulation_timer->stop(); |
574 | emit frequency_change(0); | 574 | emit frequency_change(0); |
575 | tuner_pic1->setPixmap( image6 ); | 575 | tuner_pic1->setPixmap( image6 ); |
576 | }else{ | 576 | }else{ |
577 | emit frequency_change(simulation_x); | 577 | emit frequency_change(simulation_x); |
578 | } | 578 | } |
579 | } | 579 | } |
580 | 580 | ||
581 | /* | 581 | /* |
582 | * Destroys the object and frees any allocated resources | 582 | * Destroys the object and frees any allocated resources |
583 | */ | 583 | */ |
584 | PowerchordBase::~PowerchordBase() | 584 | PowerchordBase::~PowerchordBase() |
585 | { | 585 | { |
586 | // no need to delete child widgets, Qt does it all for us | 586 | // no need to delete child widgets, Qt does it all for us |
587 | } | 587 | } |
588 | 588 | ||
589 | void PowerchordBase::change_handler() | 589 | void PowerchordBase::change_handler() |
590 | { | 590 | { |
591 | owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl; | 591 | owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl; |
592 | } | 592 | } |
593 | 593 | ||
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 979b73a..6252fc2 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -1,218 +1,218 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | 6 | ||
7 | #include <opie2/odebug.h> | 7 | #include <opie2/odebug.h> |
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | 9 | ||
10 | #include "defines.h" | 10 | #include "defines.h" |
11 | #include "mainwindow.h" | 11 | #include "mainwindow.h" |
12 | 12 | ||
13 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
14 | 14 | ||
15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
16 | : QMainWindow( parent, name, flags ) | 16 | : QMainWindow( parent, name, flags ) |
17 | { | 17 | { |
18 | 18 | ||
19 | setCaption( tr( "Mail" ) ); | 19 | setCaption( tr( "Mail" ) ); |
20 | setToolBarsMovable( false ); | 20 | setToolBarsMovable( false ); |
21 | 21 | ||
22 | toolBar = new QToolBar( this ); | 22 | toolBar = new QToolBar( this ); |
23 | menuBar = new QMenuBar( toolBar ); | 23 | menuBar = new QMenuBar( toolBar ); |
24 | mailMenu = new QPopupMenu( menuBar ); | 24 | mailMenu = new QPopupMenu( menuBar ); |
25 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 25 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
26 | settingsMenu = new QPopupMenu( menuBar ); | 26 | settingsMenu = new QPopupMenu( menuBar ); |
27 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 27 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
28 | 28 | ||
29 | addToolBar( toolBar ); | 29 | addToolBar( toolBar ); |
30 | toolBar->setHorizontalStretchable( true ); | 30 | toolBar->setHorizontalStretchable( true ); |
31 | 31 | ||
32 | QLabel *spacer = new QLabel( toolBar ); | 32 | QLabel *spacer = new QLabel( toolBar ); |
33 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 33 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
34 | toolBar->setStretchableWidget( spacer ); | 34 | toolBar->setStretchableWidget( spacer ); |
35 | 35 | ||
36 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 36 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
37 | 0, 0, this ); | 37 | 0, 0, this ); |
38 | composeMail->addTo( toolBar ); | 38 | composeMail->addTo( toolBar ); |
39 | composeMail->addTo( mailMenu ); | 39 | composeMail->addTo( mailMenu ); |
40 | 40 | ||
41 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, | 41 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, |
42 | 0, 0, this ); | 42 | 0, 0, this ); |
43 | sendQueued->addTo( toolBar ); | 43 | sendQueued->addTo( toolBar ); |
44 | sendQueued->addTo( mailMenu ); | 44 | sendQueued->addTo( mailMenu ); |
45 | 45 | ||
46 | /* | 46 | /* |
47 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 47 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
48 | 0, 0, this ); | 48 | 0, 0, this ); |
49 | syncFolders->addTo( toolBar ); | 49 | syncFolders->addTo( toolBar ); |
50 | syncFolders->addTo( mailMenu ); | 50 | syncFolders->addTo( mailMenu ); |
51 | */ | 51 | */ |
52 | 52 | ||
53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
54 | 0, 0, this, 0, true ); | 54 | 0, 0, this, 0, true ); |
55 | showFolders->addTo( toolBar ); | 55 | showFolders->addTo( toolBar ); |
56 | showFolders->addTo( mailMenu ); | 56 | showFolders->addTo( mailMenu ); |
57 | showFolders->setOn( true ); | 57 | showFolders->setOn( true ); |
58 | connect(showFolders, SIGNAL( toggled(bool) ), | 58 | connect(showFolders, SIGNAL( toggled(bool) ), |
59 | SLOT( slotShowFolders(bool) ) ); | 59 | SLOT( slotShowFolders(bool) ) ); |
60 | 60 | ||
61 | /* | 61 | /* |
62 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), | 62 | searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), |
63 | 0, 0, this ); | 63 | 0, 0, this ); |
64 | searchMails->addTo( toolBar ); | 64 | searchMails->addTo( toolBar ); |
65 | searchMails->addTo( mailMenu ); | 65 | searchMails->addTo( mailMenu ); |
66 | */ | 66 | */ |
67 | 67 | ||
68 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); | 68 | deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); |
69 | deleteMails->addTo( toolBar ); | 69 | deleteMails->addTo( toolBar ); |
70 | deleteMails->addTo( mailMenu ); | 70 | deleteMails->addTo( mailMenu ); |
71 | connect( deleteMails, SIGNAL( activated() ), | 71 | connect( deleteMails, SIGNAL( activated() ), |
72 | SLOT( slotDeleteMail() ) ); | 72 | SLOT( slotDeleteMail() ) ); |
73 | 73 | ||
74 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , | 74 | editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , |
75 | 0, 0, this ); | 75 | 0, 0, this ); |
76 | editSettings->addTo( settingsMenu ); | 76 | editSettings->addTo( settingsMenu ); |
77 | connect( editSettings, SIGNAL( activated() ), | 77 | connect( editSettings, SIGNAL( activated() ), |
78 | SLOT( slotEditSettings() ) ); | 78 | SLOT( slotEditSettings() ) ); |
79 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , | 79 | editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , |
80 | 0, 0, this ); | 80 | 0, 0, this ); |
81 | editAccounts->addTo( settingsMenu ); | 81 | editAccounts->addTo( settingsMenu ); |
82 | 82 | ||
83 | //setCentralWidget( view ); | 83 | //setCentralWidget( view ); |
84 | 84 | ||
85 | QVBox* wrapperBox = new QVBox( this ); | 85 | QVBox* wrapperBox = new QVBox( this ); |
86 | setCentralWidget( wrapperBox ); | 86 | setCentralWidget( wrapperBox ); |
87 | 87 | ||
88 | QWidget *view = new QWidget( wrapperBox ); | 88 | QWidget *view = new QWidget( wrapperBox ); |
89 | 89 | ||
90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
91 | 91 | ||
92 | folderView = new AccountView( view ); | 92 | folderView = new AccountView( view ); |
93 | folderView->header()->hide(); | 93 | folderView->header()->hide(); |
94 | folderView->setRootIsDecorated( true ); | 94 | folderView->setRootIsDecorated( true ); |
95 | folderView->addColumn( tr( "Mailbox" ) ); | 95 | folderView->addColumn( tr( "Mailbox" ) ); |
96 | 96 | ||
97 | layout->addWidget( folderView ); | 97 | layout->addWidget( folderView ); |
98 | 98 | ||
99 | mailView = new QListView( view ); | 99 | mailView = new QListView( view ); |
100 | mailView->addColumn( tr( "" ) ); | 100 | mailView->addColumn( "" ); |
101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
103 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 103 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
104 | mailView->addColumn( tr( "Date" )); | 104 | mailView->addColumn( tr( "Date" )); |
105 | mailView->setAllColumnsShowFocus(true); | 105 | mailView->setAllColumnsShowFocus(true); |
106 | mailView->setSorting(-1); | 106 | mailView->setSorting(-1); |
107 | 107 | ||
108 | statusWidget = new StatusWidget( wrapperBox ); | 108 | statusWidget = new StatusWidget( wrapperBox ); |
109 | statusWidget->hide(); | 109 | statusWidget->hide(); |
110 | 110 | ||
111 | layout->addWidget( mailView ); | 111 | layout->addWidget( mailView ); |
112 | layout->setStretchFactor( folderView, 1 ); | 112 | layout->setStretchFactor( folderView, 1 ); |
113 | layout->setStretchFactor( mailView, 2 ); | 113 | layout->setStretchFactor( mailView, 2 ); |
114 | 114 | ||
115 | slotAdjustLayout(); | 115 | slotAdjustLayout(); |
116 | 116 | ||
117 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 117 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
118 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 118 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
119 | 119 | ||
120 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, | 120 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, |
121 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); | 121 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); |
122 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 122 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
123 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 123 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
124 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 124 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
125 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 125 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
126 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 126 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
127 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 127 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
128 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 128 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
129 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 129 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
130 | // Added by Stefan Eilers to allow starting by addressbook.. | 130 | // Added by Stefan Eilers to allow starting by addressbook.. |
131 | // copied from old mail2 | 131 | // copied from old mail2 |
132 | #if !defined(QT_NO_COP) | 132 | #if !defined(QT_NO_COP) |
133 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), | 133 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
134 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); | 134 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 137 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
138 | } | 138 | } |
139 | 139 | ||
140 | MainWindow::~MainWindow() | 140 | MainWindow::~MainWindow() |
141 | { | 141 | { |
142 | } | 142 | } |
143 | 143 | ||
144 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 144 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
145 | { | 145 | { |
146 | odebug << "appMessage not reached" << oendl; | 146 | odebug << "appMessage not reached" << oendl; |
147 | } | 147 | } |
148 | 148 | ||
149 | void MainWindow::slotAdjustLayout() { | 149 | void MainWindow::slotAdjustLayout() { |
150 | 150 | ||
151 | QWidget *d = QApplication::desktop(); | 151 | QWidget *d = QApplication::desktop(); |
152 | 152 | ||
153 | if ( d->width() < d->height() ) { | 153 | if ( d->width() < d->height() ) { |
154 | layout->setDirection( QBoxLayout::TopToBottom ); | 154 | layout->setDirection( QBoxLayout::TopToBottom ); |
155 | } else { | 155 | } else { |
156 | layout->setDirection( QBoxLayout::LeftToRight ); | 156 | layout->setDirection( QBoxLayout::LeftToRight ); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | void MainWindow::slotAdjustColumns() | 160 | void MainWindow::slotAdjustColumns() |
161 | { | 161 | { |
162 | bool hidden = folderView->isHidden(); | 162 | bool hidden = folderView->isHidden(); |
163 | if ( hidden ) folderView->show(); | 163 | if ( hidden ) folderView->show(); |
164 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 164 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
165 | if ( hidden ) folderView->hide(); | 165 | if ( hidden ) folderView->hide(); |
166 | 166 | ||
167 | mailView->setColumnWidth( 0, 10 ); | 167 | mailView->setColumnWidth( 0, 10 ); |
168 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 168 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
169 | mailView->setColumnWidth( 2, 80 ); | 169 | mailView->setColumnWidth( 2, 80 ); |
170 | mailView->setColumnWidth( 3, 50 ); | 170 | mailView->setColumnWidth( 3, 50 ); |
171 | mailView->setColumnWidth( 4, 50 ); | 171 | mailView->setColumnWidth( 4, 50 ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void MainWindow::slotEditSettings() | 174 | void MainWindow::slotEditSettings() |
175 | { | 175 | { |
176 | } | 176 | } |
177 | 177 | ||
178 | void MainWindow::slotShowFolders( bool ) | 178 | void MainWindow::slotShowFolders( bool ) |
179 | { | 179 | { |
180 | odebug << "slotShowFolders not reached" << oendl; | 180 | odebug << "slotShowFolders not reached" << oendl; |
181 | } | 181 | } |
182 | 182 | ||
183 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 183 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
184 | { | 184 | { |
185 | odebug << "refreshMailView not reached" << oendl; | 185 | odebug << "refreshMailView not reached" << oendl; |
186 | } | 186 | } |
187 | 187 | ||
188 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) | 188 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) |
189 | { | 189 | { |
190 | odebug << "mailLeftClicked not reached" << oendl; | 190 | odebug << "mailLeftClicked not reached" << oendl; |
191 | } | 191 | } |
192 | 192 | ||
193 | void MainWindow::displayMail() | 193 | void MainWindow::displayMail() |
194 | { | 194 | { |
195 | odebug << "displayMail not reached" << oendl; | 195 | odebug << "displayMail not reached" << oendl; |
196 | } | 196 | } |
197 | 197 | ||
198 | void MainWindow::slotDeleteMail() | 198 | void MainWindow::slotDeleteMail() |
199 | { | 199 | { |
200 | odebug << "deleteMail not reached" << oendl; | 200 | odebug << "deleteMail not reached" << oendl; |
201 | } | 201 | } |
202 | 202 | ||
203 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 203 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
204 | { | 204 | { |
205 | odebug << "mailHold not reached" << oendl; | 205 | odebug << "mailHold not reached" << oendl; |
206 | } | 206 | } |
207 | 207 | ||
208 | void MainWindow::slotSendQueued() | 208 | void MainWindow::slotSendQueued() |
209 | { | 209 | { |
210 | } | 210 | } |
211 | 211 | ||
212 | void MainWindow::slotEditAccounts() | 212 | void MainWindow::slotEditAccounts() |
213 | { | 213 | { |
214 | } | 214 | } |
215 | 215 | ||
216 | void MainWindow::slotComposeMail() | 216 | void MainWindow::slotComposeMail() |
217 | { | 217 | { |
218 | } | 218 | } |
diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc index 0c6cf12..621784e 100644 --- a/noncore/settings/mediummount/mediumglobal.cc +++ b/noncore/settings/mediummount/mediumglobal.cc | |||
@@ -1,190 +1,190 @@ | |||
1 | 1 | ||
2 | #include "mediumglobal.h" | 2 | #include "mediumglobal.h" |
3 | 3 | ||
4 | /* OPIE */ | 4 | /* OPIE */ |
5 | #include <opie2/odebug.h> | 5 | #include <opie2/odebug.h> |
6 | using namespace Opie::Core; | 6 | using namespace Opie::Core; |
7 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
8 | 8 | ||
9 | /* QT */ | 9 | /* QT */ |
10 | #include <qlineedit.h> | 10 | #include <qlineedit.h> |
11 | #include <qcheckbox.h> | 11 | #include <qcheckbox.h> |
12 | #include <qlabel.h> | 12 | #include <qlabel.h> |
13 | #include <qabstractlayout.h> // spacer item | 13 | #include <qabstractlayout.h> // spacer item |
14 | #include <qlayout.h> | 14 | #include <qlayout.h> |
15 | #include <qframe.h> | 15 | #include <qframe.h> |
16 | #include <qgroupbox.h> | 16 | #include <qgroupbox.h> |
17 | #include <qwhatsthis.h> | 17 | #include <qwhatsthis.h> |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | using namespace MediumMountSetting; | 21 | using namespace MediumMountSetting; |
22 | 22 | ||
23 | /* TRANSLATOR MediumMountSetting::MediumGlobalWidget */ | 23 | /* TRANSLATOR MediumMountSetting::MediumGlobalWidget */ |
24 | 24 | ||
25 | MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) | 25 | MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) |
26 | : QWidget( wid, name, WStyle_ContextHelp ) | 26 | : QWidget( wid, name, WStyle_ContextHelp ) |
27 | { | 27 | { |
28 | m_config = 0; | 28 | m_config = 0; |
29 | initGUI(); | 29 | initGUI(); |
30 | readConfig(); | 30 | readConfig(); |
31 | 31 | ||
32 | } | 32 | } |
33 | void MediumGlobalWidget::initGUI() | 33 | void MediumGlobalWidget::initGUI() |
34 | { | 34 | { |
35 | m_layout = new QVBoxLayout(this ); | 35 | m_layout = new QVBoxLayout(this ); |
36 | m_layout->setMargin( 4 ); | 36 | m_layout->setMargin( 4 ); |
37 | // m_layout->setSpacing( 10 ); | 37 | // m_layout->setSpacing( 10 ); |
38 | 38 | ||
39 | 39 | ||
40 | m_label = new QLabel( this ); | 40 | m_label = new QLabel( this ); |
41 | m_label->setTextFormat( Qt::RichText ); | 41 | m_label->setTextFormat( Qt::RichText ); |
42 | m_label->setText( tr("") ); | 42 | m_label->setText( "" ); |
43 | QWhatsThis::add( this, tr("If a medium gets inserted into this device Opie " | 43 | QWhatsThis::add( this, tr("If a medium gets inserted into this device Opie " |
44 | "tries to search the medium for Documents. On " | 44 | "tries to search the medium for Documents. On " |
45 | "large mediums this can take some time. You can choose " | 45 | "large mediums this can take some time. You can choose " |
46 | "if Opie should scan for Documents globally or on a " | 46 | "if Opie should scan for Documents globally or on a " |
47 | "per medium level. You're also able to reconfigure " | 47 | "per medium level. You're also able to reconfigure " |
48 | "each medium.") ); | 48 | "each medium.") ); |
49 | 49 | ||
50 | m_layout->addWidget( m_label ); | 50 | m_layout->addWidget( m_label ); |
51 | 51 | ||
52 | m_check = new QCheckBox( tr("Enable medium checking" ), this ); | 52 | m_check = new QCheckBox( tr("Enable medium checking" ), this ); |
53 | connect( m_check, SIGNAL(stateChanged(int) ), | 53 | connect( m_check, SIGNAL(stateChanged(int) ), |
54 | this, SLOT(slotEnableChecking() ) ); | 54 | this, SLOT(slotEnableChecking() ) ); |
55 | m_layout->addWidget(m_check ); | 55 | m_layout->addWidget(m_check ); |
56 | 56 | ||
57 | m_frame = new QFrame(this, "Frame" ); | 57 | m_frame = new QFrame(this, "Frame" ); |
58 | m_frame->setFrameShape( QFrame::Box ); | 58 | m_frame->setFrameShape( QFrame::Box ); |
59 | m_frame->setFrameShadow( QFrame::Sunken ); | 59 | m_frame->setFrameShadow( QFrame::Sunken ); |
60 | 60 | ||
61 | m_box = new QVBoxLayout( m_frame ); | 61 | m_box = new QVBoxLayout( m_frame ); |
62 | m_box->setMargin( 5 ); | 62 | m_box->setMargin( 5 ); |
63 | m_useglobal = new QCheckBox( tr("Use global settings"), m_frame ); | 63 | m_useglobal = new QCheckBox( tr("Use global settings"), m_frame ); |
64 | connect( m_useglobal, SIGNAL( stateChanged(int) ), | 64 | connect( m_useglobal, SIGNAL( stateChanged(int) ), |
65 | this, SLOT( slotGlobalChanged() ) ); | 65 | this, SLOT( slotGlobalChanged() ) ); |
66 | 66 | ||
67 | m_box->addWidget( m_useglobal ); | 67 | m_box->addWidget( m_useglobal ); |
68 | 68 | ||
69 | m_global = new QGroupBox( tr("Which media files"), m_frame ); | 69 | m_global = new QGroupBox( tr("Which media files"), m_frame ); |
70 | m_frameLay = new QGridLayout(m_global, 4, 3 ); | 70 | m_frameLay = new QGridLayout(m_global, 4, 3 ); |
71 | m_frameLay->setMargin( 10 ); | 71 | m_frameLay->setMargin( 10 ); |
72 | 72 | ||
73 | QSpacerItem *item2 = new QSpacerItem( 5, 8, | 73 | QSpacerItem *item2 = new QSpacerItem( 5, 8, |
74 | QSizePolicy::Fixed, | 74 | QSizePolicy::Fixed, |
75 | QSizePolicy::Fixed ); | 75 | QSizePolicy::Fixed ); |
76 | m_audio = new QCheckBox( tr("Audio"), m_global ); | 76 | m_audio = new QCheckBox( tr("Audio"), m_global ); |
77 | m_all = new QCheckBox( tr("All") , m_global ); | 77 | m_all = new QCheckBox( tr("All") , m_global ); |
78 | m_image = new QCheckBox( tr("Image"), m_global ); | 78 | m_image = new QCheckBox( tr("Image"), m_global ); |
79 | m_text = new QCheckBox( tr("Text") , m_global ); | 79 | m_text = new QCheckBox( tr("Text") , m_global ); |
80 | m_video = new QCheckBox( tr("Video"), m_global ); | 80 | m_video = new QCheckBox( tr("Video"), m_global ); |
81 | 81 | ||
82 | connect(m_all, SIGNAL(stateChanged(int) ), | 82 | connect(m_all, SIGNAL(stateChanged(int) ), |
83 | this, SLOT(slotAllChanged() ) ); | 83 | this, SLOT(slotAllChanged() ) ); |
84 | 84 | ||
85 | m_frameLay->addItem( item2, 0, 0 ); | 85 | m_frameLay->addItem( item2, 0, 0 ); |
86 | 86 | ||
87 | m_frameLay->addWidget( m_audio, 1, 0 ); | 87 | m_frameLay->addWidget( m_audio, 1, 0 ); |
88 | m_frameLay->addWidget( m_image, 2, 0 ); | 88 | m_frameLay->addWidget( m_image, 2, 0 ); |
89 | m_frameLay->addWidget( m_all, 3, 0 ); | 89 | m_frameLay->addWidget( m_all, 3, 0 ); |
90 | 90 | ||
91 | m_frameLay->addWidget( m_text, 1, 2 ); | 91 | m_frameLay->addWidget( m_text, 1, 2 ); |
92 | m_frameLay->addWidget( m_video, 2, 2 ); | 92 | m_frameLay->addWidget( m_video, 2, 2 ); |
93 | 93 | ||
94 | m_frameLay->addRowSpacing( 0, 8 ); | 94 | m_frameLay->addRowSpacing( 0, 8 ); |
95 | m_frameLay->addColSpacing( 1, 2 ); | 95 | m_frameLay->addColSpacing( 1, 2 ); |
96 | 96 | ||
97 | m_box->addWidget( m_global ); | 97 | m_box->addWidget( m_global ); |
98 | 98 | ||
99 | 99 | ||
100 | m_layout->addWidget( m_frame ); | 100 | m_layout->addWidget( m_frame ); |
101 | 101 | ||
102 | QSpacerItem *item1 = new QSpacerItem( 1, 24, | 102 | QSpacerItem *item1 = new QSpacerItem( 1, 24, |
103 | QSizePolicy::Fixed, | 103 | QSizePolicy::Fixed, |
104 | QSizePolicy::Expanding ); | 104 | QSizePolicy::Expanding ); |
105 | m_layout->addItem( item1 ); | 105 | m_layout->addItem( item1 ); |
106 | } | 106 | } |
107 | void MediumGlobalWidget::readConfig() | 107 | void MediumGlobalWidget::readConfig() |
108 | { | 108 | { |
109 | if( m_config == 0 ) | 109 | if( m_config == 0 ) |
110 | m_config = new Config("medium" ); | 110 | m_config = new Config("medium" ); |
111 | 111 | ||
112 | m_config->setGroup("main"); | 112 | m_config->setGroup("main"); |
113 | m_useglobal->setChecked( m_config->readBoolEntry("global", false ) ); | 113 | m_useglobal->setChecked( m_config->readBoolEntry("global", false ) ); |
114 | m_check->setChecked( m_config->readBoolEntry("use", true ) ); | 114 | m_check->setChecked( m_config->readBoolEntry("use", true ) ); |
115 | 115 | ||
116 | m_config->setGroup("mimetypes" ); | 116 | m_config->setGroup("mimetypes" ); |
117 | m_all->setChecked ( m_config->readBoolEntry("all", false ) ); | 117 | m_all->setChecked ( m_config->readBoolEntry("all", false ) ); |
118 | m_audio->setChecked( m_config->readBoolEntry("audio", true ) ); | 118 | m_audio->setChecked( m_config->readBoolEntry("audio", true ) ); |
119 | m_video->setChecked( m_config->readBoolEntry("video", true ) ); | 119 | m_video->setChecked( m_config->readBoolEntry("video", true ) ); |
120 | m_text->setChecked ( m_config->readBoolEntry("text", true ) ); | 120 | m_text->setChecked ( m_config->readBoolEntry("text", true ) ); |
121 | m_image->setChecked( m_config->readBoolEntry("image", true ) ); | 121 | m_image->setChecked( m_config->readBoolEntry("image", true ) ); |
122 | 122 | ||
123 | slotAllChanged(); | 123 | slotAllChanged(); |
124 | slotEnableChecking(); | 124 | slotEnableChecking(); |
125 | slotGlobalChanged(); | 125 | slotGlobalChanged(); |
126 | if( m_all->isChecked() ){ | 126 | if( m_all->isChecked() ){ |
127 | m_video->setEnabled( false ); | 127 | m_video->setEnabled( false ); |
128 | m_text->setEnabled( false ); | 128 | m_text->setEnabled( false ); |
129 | m_audio->setEnabled( false ); | 129 | m_audio->setEnabled( false ); |
130 | m_image->setEnabled( false ); | 130 | m_image->setEnabled( false ); |
131 | 131 | ||
132 | } | 132 | } |
133 | } | 133 | } |
134 | void MediumGlobalWidget::writeConfig() | 134 | void MediumGlobalWidget::writeConfig() |
135 | { | 135 | { |
136 | m_config->setGroup( "main" ); | 136 | m_config->setGroup( "main" ); |
137 | m_config->writeEntry("global", m_useglobal->isChecked() ); | 137 | m_config->writeEntry("global", m_useglobal->isChecked() ); |
138 | m_config->writeEntry("use", m_check->isChecked() ); | 138 | m_config->writeEntry("use", m_check->isChecked() ); |
139 | 139 | ||
140 | m_config->setGroup("mimetypes" ); | 140 | m_config->setGroup("mimetypes" ); |
141 | 141 | ||
142 | m_config->writeEntry("all", m_all->isChecked() ); | 142 | m_config->writeEntry("all", m_all->isChecked() ); |
143 | m_config->writeEntry("audio", m_audio->isChecked() ); | 143 | m_config->writeEntry("audio", m_audio->isChecked() ); |
144 | m_config->writeEntry("video", m_video->isChecked() ); | 144 | m_config->writeEntry("video", m_video->isChecked() ); |
145 | m_config->writeEntry("text", m_text->isChecked() ); | 145 | m_config->writeEntry("text", m_text->isChecked() ); |
146 | m_config->writeEntry("image", m_image->isChecked() ); | 146 | m_config->writeEntry("image", m_image->isChecked() ); |
147 | } | 147 | } |
148 | MediumGlobalWidget::~MediumGlobalWidget() | 148 | MediumGlobalWidget::~MediumGlobalWidget() |
149 | { | 149 | { |
150 | delete m_config; | 150 | delete m_config; |
151 | } | 151 | } |
152 | void MediumGlobalWidget::slotGlobalChanged() | 152 | void MediumGlobalWidget::slotGlobalChanged() |
153 | { | 153 | { |
154 | int mode = GLOBAL_DISABLED; | 154 | int mode = GLOBAL_DISABLED; |
155 | bool enabled = false; | 155 | bool enabled = false; |
156 | if( ( enabled =m_useglobal->isChecked() ) ){ | 156 | if( ( enabled =m_useglobal->isChecked() ) ){ |
157 | mode = GLOBAL_ENABLED; | 157 | mode = GLOBAL_ENABLED; |
158 | }else | 158 | }else |
159 | mode = GLOBAL_DISABLED; | 159 | mode = GLOBAL_DISABLED; |
160 | owarn << "enabled = " << enabled << oendl; | 160 | owarn << "enabled = " << enabled << oendl; |
161 | m_all->setEnabled ( enabled ); | 161 | m_all->setEnabled ( enabled ); |
162 | m_audio->setEnabled( enabled ); | 162 | m_audio->setEnabled( enabled ); |
163 | m_image->setEnabled( enabled ); | 163 | m_image->setEnabled( enabled ); |
164 | m_text->setEnabled ( enabled ); | 164 | m_text->setEnabled ( enabled ); |
165 | m_video->setEnabled ( enabled ); | 165 | m_video->setEnabled ( enabled ); |
166 | slotAllChanged(); | 166 | slotAllChanged(); |
167 | 167 | ||
168 | emit globalStateChanged( mode ); | 168 | emit globalStateChanged( mode ); |
169 | } | 169 | } |
170 | void MediumGlobalWidget::slotEnableChecking() | 170 | void MediumGlobalWidget::slotEnableChecking() |
171 | { | 171 | { |
172 | int mode = ENABLE_CHECKS; | 172 | int mode = ENABLE_CHECKS; |
173 | bool enabled = false; | 173 | bool enabled = false; |
174 | if( ( enabled = m_check->isChecked() ) ){ | 174 | if( ( enabled = m_check->isChecked() ) ){ |
175 | mode = ENABLE_CHECKS; | 175 | mode = ENABLE_CHECKS; |
176 | }else{ | 176 | }else{ |
177 | mode = DISABLE_CHECKS; | 177 | mode = DISABLE_CHECKS; |
178 | } | 178 | } |
179 | m_frame->setEnabled( enabled ); | 179 | m_frame->setEnabled( enabled ); |
180 | slotGlobalChanged(); | 180 | slotGlobalChanged(); |
181 | emit enableStateChanged( mode ); | 181 | emit enableStateChanged( mode ); |
182 | } | 182 | } |
183 | void MediumGlobalWidget::slotAllChanged() | 183 | void MediumGlobalWidget::slotAllChanged() |
184 | { | 184 | { |
185 | bool enable = !m_all->isChecked(); | 185 | bool enable = !m_all->isChecked(); |
186 | m_audio->setEnabled( enable ); | 186 | m_audio->setEnabled( enable ); |
187 | m_text->setEnabled( enable ); | 187 | m_text->setEnabled( enable ); |
188 | m_video->setEnabled( enable ); | 188 | m_video->setEnabled( enable ); |
189 | m_image->setEnabled( enable ); | 189 | m_image->setEnabled( enable ); |
190 | } | 190 | } |
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index f283119..84187d2 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp | |||
@@ -1,180 +1,180 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form implementation generated from reading ui file 'soundsettingsbase.ui' | 2 | ** Form implementation generated from reading ui file 'soundsettingsbase.ui' |
3 | ** | 3 | ** |
4 | ** Created: Sun May 19 12:11:35 2002 | 4 | ** Created: Sun May 19 12:11:35 2002 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "soundsettingsbase.h" | 9 | #include "soundsettingsbase.h" |
10 | 10 | ||
11 | #include <qcheckbox.h> | 11 | #include <qcheckbox.h> |
12 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
13 | 13 | ||
14 | #include <qlabel.h> | 14 | #include <qlabel.h> |
15 | #include <qlayout.h> | 15 | #include <qlayout.h> |
16 | #include <qpixmap.h> | 16 | #include <qpixmap.h> |
17 | 17 | ||
18 | static const char* const image0_data[] = { | 18 | static const char* const image0_data[] = { |
19 | "16 16 3 1", | 19 | "16 16 3 1", |
20 | ". c None", | 20 | ". c None", |
21 | "a c #000000", | 21 | "a c #000000", |
22 | "# c #ff0000", | 22 | "# c #ff0000", |
23 | "............#...", | 23 | "............#...", |
24 | "............##..", | 24 | "............##..", |
25 | "..........#..#..", | 25 | "..........#..#..", |
26 | ".....a..#..#.#..", | 26 | ".....a..#..#.#..", |
27 | "....aa..##.#..#.", | 27 | "....aa..##.#..#.", |
28 | "...aaa...#.##.#.", | 28 | "...aaa...#.##.#.", |
29 | "aaaaaa.#.#..#.##", | 29 | "aaaaaa.#.#..#.##", |
30 | "aaaaaa.#.##.#.##", | 30 | "aaaaaa.#.##.#.##", |
31 | "aaaaaa.#.##.#.##", | 31 | "aaaaaa.#.##.#.##", |
32 | "aaaaaa.#.##.#.##", | 32 | "aaaaaa.#.##.#.##", |
33 | "aaaaaa.#.#..#.##", | 33 | "aaaaaa.#.#..#.##", |
34 | "...aaa...#.##.#.", | 34 | "...aaa...#.##.#.", |
35 | "....aa..#..#..#.", | 35 | "....aa..#..#..#.", |
36 | ".....a.....#.##.", | 36 | ".....a.....#.##.", |
37 | "..........#..#..", | 37 | "..........#..#..", |
38 | "............##.."}; | 38 | "............##.."}; |
39 | 39 | ||
40 | static const char* const image1_data[] = { | 40 | static const char* const image1_data[] = { |
41 | "16 16 3 1", | 41 | "16 16 3 1", |
42 | ". c None", | 42 | ". c None", |
43 | "# c #000000", | 43 | "# c #000000", |
44 | "a c #ff0000", | 44 | "a c #ff0000", |
45 | "................", | 45 | "................", |
46 | "................", | 46 | "................", |
47 | "................", | 47 | "................", |
48 | ".....#..........", | 48 | ".....#..........", |
49 | "....##..........", | 49 | "....##..........", |
50 | "...###...a...a..", | 50 | "...###...a...a..", |
51 | "######..aaa.aaa.", | 51 | "######..aaa.aaa.", |
52 | "######...aaaaa..", | 52 | "######...aaaaa..", |
53 | "######....aaa...", | 53 | "######....aaa...", |
54 | "######...aaaaa..", | 54 | "######...aaaaa..", |
55 | "######..aaa.aaa.", | 55 | "######..aaa.aaa.", |
56 | "...###...a...a..", | 56 | "...###...a...a..", |
57 | "....##..........", | 57 | "....##..........", |
58 | ".....#..........", | 58 | ".....#..........", |
59 | "................", | 59 | "................", |
60 | "................"}; | 60 | "................"}; |
61 | 61 | ||
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Constructs a SoundSettingsBase which is a child of 'parent', with the | 64 | * Constructs a SoundSettingsBase which is a child of 'parent', with the |
65 | * name 'name' and widget flags set to 'f' | 65 | * name 'name' and widget flags set to 'f' |
66 | * | 66 | * |
67 | * The dialog will by default be modeless, unless you set 'modal' to | 67 | * The dialog will by default be modeless, unless you set 'modal' to |
68 | * TRUE to construct a modal dialog. | 68 | * TRUE to construct a modal dialog. |
69 | */ | 69 | */ |
70 | SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) | 70 | SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) |
71 | : QMainWindow( parent, name, fl ) | 71 | : QMainWindow( parent, name, fl ) |
72 | { | 72 | { |
73 | QPixmap image0( ( const char** ) image0_data ); | 73 | QPixmap image0( ( const char** ) image0_data ); |
74 | QPixmap image1( ( const char** ) image1_data ); | 74 | QPixmap image1( ( const char** ) image1_data ); |
75 | if ( !name ) | 75 | if ( !name ) |
76 | setName( "SoundSettingsBase" ); | 76 | setName( "SoundSettingsBase" ); |
77 | // resize(255,301); | 77 | // resize(255,301); |
78 | setCaption( tr( "Vmemo Settings" ) ); | 78 | setCaption( tr( "Vmemo Settings" ) ); |
79 | 79 | ||
80 | SoundSettingsBaseLayout = new QGridLayout( this ); | 80 | SoundSettingsBaseLayout = new QGridLayout( this ); |
81 | SoundSettingsBaseLayout->setSpacing( 4 ); | 81 | SoundSettingsBaseLayout->setSpacing( 4 ); |
82 | SoundSettingsBaseLayout->setMargin( 4 ); | 82 | SoundSettingsBaseLayout->setMargin( 4 ); |
83 | 83 | ||
84 | QHBoxLayout *Layout11; | 84 | QHBoxLayout *Layout11; |
85 | Layout11 = new QHBoxLayout; | 85 | Layout11 = new QHBoxLayout; |
86 | Layout11->setSpacing( 4 ); | 86 | Layout11->setSpacing( 4 ); |
87 | Layout11->setMargin( 0 ); | 87 | Layout11->setMargin( 0 ); |
88 | 88 | ||
89 | stereoCheckBox = new QCheckBox( this, "stereoCheckBox" ); | 89 | stereoCheckBox = new QCheckBox( this, "stereoCheckBox" ); |
90 | stereoCheckBox->setText( tr( "Stereo" ) ); | 90 | stereoCheckBox->setText( tr( "Stereo" ) ); |
91 | Layout11->addWidget( stereoCheckBox ); | 91 | Layout11->addWidget( stereoCheckBox ); |
92 | 92 | ||
93 | sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" ); | 93 | sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" ); |
94 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); | 94 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); |
95 | Layout11->addWidget( sixteenBitCheckBox ); | 95 | Layout11->addWidget( sixteenBitCheckBox ); |
96 | 96 | ||
97 | AlertCheckBox = new QCheckBox( this, "AlertCheckBox" ); | 97 | AlertCheckBox = new QCheckBox( this, "AlertCheckBox" ); |
98 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); | 98 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); |
99 | Layout11->addWidget( AlertCheckBox ); | 99 | Layout11->addWidget( AlertCheckBox ); |
100 | 100 | ||
101 | SoundSettingsBaseLayout->addLayout( Layout11, 0, 0); | 101 | SoundSettingsBaseLayout->addLayout( Layout11, 0, 0); |
102 | 102 | ||
103 | sampleRateLabel = new QLabel(this, "sampleRateLabel" ); | 103 | sampleRateLabel = new QLabel(this, "sampleRateLabel" ); |
104 | sampleRateLabel->setText( tr( "Sample Rate:" ) ); | 104 | sampleRateLabel->setText( tr( "Sample Rate:" ) ); |
105 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1); | 105 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1); |
106 | 106 | ||
107 | sampleRate = new QComboBox( FALSE,this, "sampleRate" ); | 107 | sampleRate = new QComboBox( FALSE,this, "sampleRate" ); |
108 | 108 | ||
109 | sampleRate->insertItem( tr( "8000" ) ); | 109 | sampleRate->insertItem( tr( "8000" ) ); |
110 | sampleRate->insertItem( tr( "11025" ) ); | 110 | sampleRate->insertItem( tr( "11025" ) ); |
111 | sampleRate->insertItem( tr( "22050" ) ); | 111 | sampleRate->insertItem( tr( "22050" ) ); |
112 | sampleRate->insertItem( tr( "33075" ) ); | 112 | sampleRate->insertItem( tr( "33075" ) ); |
113 | sampleRate->insertItem( tr( "44100" ) ); | 113 | sampleRate->insertItem( tr( "44100" ) ); |
114 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 ); | 114 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 ); |
115 | 115 | ||
116 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 116 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
117 | TextLabel1->setText( tr( "Recording Directory:" ) ); | 117 | TextLabel1->setText( tr( "Recording Directory:" ) ); |
118 | SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1); | 118 | SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1); |
119 | 119 | ||
120 | 120 | ||
121 | LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" ); | 121 | LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" ); |
122 | SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1); | 122 | SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1); |
123 | 123 | ||
124 | QLabel *TextLabelKey; | 124 | QLabel *TextLabelKey; |
125 | TextLabelKey = new QLabel( this, "TextLabelKey" ); | 125 | TextLabelKey = new QLabel( this, "TextLabelKey" ); |
126 | TextLabelKey->setText( tr( "Recording Key:" ) ); | 126 | TextLabelKey->setText( tr( "Recording Key:" ) ); |
127 | SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1); | 127 | SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1); |
128 | 128 | ||
129 | keyComboBox = new QComboBox( FALSE, this, "keyComboBox" ); | 129 | keyComboBox = new QComboBox( FALSE, this, "keyComboBox" ); |
130 | keyComboBox->insertItem( tr( "" ) ); | 130 | keyComboBox->insertItem( "" ); |
131 | keyComboBox->insertItem( tr( "Taskbar Icon" ) ); | 131 | keyComboBox->insertItem( tr( "Taskbar Icon" ) ); |
132 | keyComboBox->insertItem( tr( "Key_Record" ) ); | 132 | keyComboBox->insertItem( tr( "Key_Record" ) ); |
133 | keyComboBox->insertItem( tr( "Key_Space" ) ); | 133 | keyComboBox->insertItem( tr( "Key_Space" ) ); |
134 | keyComboBox->insertItem( tr( "Key_Home" ) ); | 134 | keyComboBox->insertItem( tr( "Key_Home" ) ); |
135 | keyComboBox->insertItem( tr( "Key_Calender" ) ); | 135 | keyComboBox->insertItem( tr( "Key_Calender" ) ); |
136 | keyComboBox->insertItem( tr( "Key_Contacts" ) ); | 136 | keyComboBox->insertItem( tr( "Key_Contacts" ) ); |
137 | keyComboBox->insertItem( tr( "Key_Menu" ) ); | 137 | keyComboBox->insertItem( tr( "Key_Menu" ) ); |
138 | keyComboBox->insertItem( tr( "Key_Mail" ) ); | 138 | keyComboBox->insertItem( tr( "Key_Mail" ) ); |
139 | SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1); | 139 | SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1); |
140 | 140 | ||
141 | keyLabel= new QLabel( this, "keyLabel" ); | 141 | keyLabel= new QLabel( this, "keyLabel" ); |
142 | SoundSettingsBaseLayout->addMultiCellWidget( keyLabel , 6, 6, 0, 2, 3); | 142 | SoundSettingsBaseLayout->addMultiCellWidget( keyLabel , 6, 6, 0, 2, 3); |
143 | 143 | ||
144 | QLabel *timeLimitLabel; | 144 | QLabel *timeLimitLabel; |
145 | timeLimitLabel= new QLabel( this, "timeLimitLabel" ); | 145 | timeLimitLabel= new QLabel( this, "timeLimitLabel" ); |
146 | timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) ); | 146 | timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) ); |
147 | SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1); | 147 | SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1); |
148 | 148 | ||
149 | timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); | 149 | timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); |
150 | timeLimitComboBox->insertItem( tr( "30" ) ); | 150 | timeLimitComboBox->insertItem( tr( "30" ) ); |
151 | timeLimitComboBox->insertItem( tr( "20" ) ); | 151 | timeLimitComboBox->insertItem( tr( "20" ) ); |
152 | timeLimitComboBox->insertItem( tr( "15" ) ); | 152 | timeLimitComboBox->insertItem( tr( "15" ) ); |
153 | timeLimitComboBox->insertItem( tr( "10" ) ); | 153 | timeLimitComboBox->insertItem( tr( "10" ) ); |
154 | timeLimitComboBox->insertItem( tr( "5" ) ); | 154 | timeLimitComboBox->insertItem( tr( "5" ) ); |
155 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); | 155 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); |
156 | 156 | ||
157 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); | 157 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); |
158 | 158 | ||
159 | 159 | ||
160 | restartCheckBox= new QCheckBox( this, "restartCheck" ); | 160 | restartCheckBox= new QCheckBox( this, "restartCheck" ); |
161 | restartCheckBox->setText( tr( "Restart Opie if needed" ) ); | 161 | restartCheckBox->setText( tr( "Restart Opie if needed" ) ); |
162 | 162 | ||
163 | SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1); | 163 | SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1); |
164 | 164 | ||
165 | adpcmCheckBox = new QCheckBox( this, "adpcmCheck" ); | 165 | adpcmCheckBox = new QCheckBox( this, "adpcmCheck" ); |
166 | adpcmCheckBox->setText( tr( "Use ADPCM compression" ) ); | 166 | adpcmCheckBox->setText( tr( "Use ADPCM compression" ) ); |
167 | 167 | ||
168 | SoundSettingsBaseLayout->addMultiCellWidget( adpcmCheckBox , 10, 10, 0, 0, 1); | 168 | SoundSettingsBaseLayout->addMultiCellWidget( adpcmCheckBox , 10, 10, 0, 0, 1); |
169 | 169 | ||
170 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | 170 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); |
171 | SoundSettingsBaseLayout->addItem( spacer4, 10, 0 ); | 171 | SoundSettingsBaseLayout->addItem( spacer4, 10, 0 ); |
172 | } | 172 | } |
173 | 173 | ||
174 | /* | 174 | /* |
175 | * Destroys the object and frees any allocated resources | 175 | * Destroys the object and frees any allocated resources |
176 | */ | 176 | */ |
177 | SoundSettingsBase::~SoundSettingsBase() | 177 | SoundSettingsBase::~SoundSettingsBase() |
178 | { | 178 | { |
179 | // no need to delete child widgets, Qt does it all for us | 179 | // no need to delete child widgets, Qt does it all for us |
180 | } | 180 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 7f1c0b8..1719ed8 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,515 +1,515 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // Copyright (C) 2000 Trolltech AS. | 9 | // Copyright (C) 2000 Trolltech AS. |
10 | // adadpted form qpe/qipkg | 10 | // adadpted form qpe/qipkg |
11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 11 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
12 | 12 | ||
13 | 13 | ||
14 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
15 | 15 | ||
16 | #include <qmenubar.h> | 16 | #include <qmenubar.h> |
17 | #include <qpe/qpemessagebox.h> | 17 | #include <qpe/qpemessagebox.h> |
18 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include <qtoolbar.h> | 20 | #include <qtoolbar.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | #include <qaction.h> | 22 | #include <qaction.h> |
23 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
24 | #include <qpopupmenu.h> | 24 | #include <qpopupmenu.h> |
25 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qfile.h> | 28 | #include <qfile.h> |
29 | #include <qlistview.h> | 29 | #include <qlistview.h> |
30 | #include <qtextview.h> | 30 | #include <qtextview.h> |
31 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
37 | #include <qlayout.h> | 37 | #include <qlayout.h> |
38 | 38 | ||
39 | #include "pksettingsbase.h" | 39 | #include "pksettingsbase.h" |
40 | #include "utils.h" | 40 | #include "utils.h" |
41 | #include "packagelistitem.h" | 41 | #include "packagelistitem.h" |
42 | 42 | ||
43 | 43 | ||
44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
45 | QMainWindow( parent, name, f ) | 45 | QMainWindow( parent, name, f ) |
46 | // packageListServers( QObject(parent), name ), | 46 | // packageListServers( QObject(parent), name ), |
47 | // packageListSearch( parent, name ), | 47 | // packageListSearch( parent, name ), |
48 | // packageListDocLnk( parent, name ) | 48 | // packageListDocLnk( parent, name ) |
49 | { | 49 | { |
50 | setCaption( tr("Package Manager") ); | 50 | setCaption( tr("Package Manager") ); |
51 | settings = new PackageManagerSettings(this,0,TRUE); | 51 | settings = new PackageManagerSettings(this,0,TRUE); |
52 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 52 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
53 | setCentralWidget( listViewPackages ); | 53 | setCentralWidget( listViewPackages ); |
54 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 54 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
55 | listViewPackages->addList( tr("ipkgfind&killefiz"), &packageListSearch ); | 55 | listViewPackages->addList( tr("ipkgfind&killefiz"), &packageListSearch ); |
56 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 56 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
57 | ipkg = new PmIpkg( settings, this ); | 57 | ipkg = new PmIpkg( settings, this ); |
58 | packageListServers.setSettings( settings ); | 58 | packageListServers.setSettings( settings ); |
59 | packageListSearch.setSettings( settings ); | 59 | packageListSearch.setSettings( settings ); |
60 | packageListDocLnk.setSettings( settings ); | 60 | packageListDocLnk.setSettings( settings ); |
61 | pvDebug(9,"packageListServers.update"); | 61 | pvDebug(9,"packageListServers.update"); |
62 | packageListServers.update(); | 62 | packageListServers.update(); |
63 | pvDebug(9,"packageListDocLnk.update"); | 63 | pvDebug(9,"packageListDocLnk.update"); |
64 | packageListDocLnk.update(); | 64 | packageListDocLnk.update(); |
65 | pvDebug(9,"makeMenu"); | 65 | pvDebug(9,"makeMenu"); |
66 | makeMenu(); | 66 | makeMenu(); |
67 | makeChannel(); | 67 | makeChannel(); |
68 | 68 | ||
69 | 69 | ||
70 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 70 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
71 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 71 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
72 | 72 | ||
73 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 73 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
74 | SLOT(removeLinks()) ); | 74 | SLOT(removeLinks()) ); |
75 | connect( settings->createLinksButton, SIGNAL( clicked()), | 75 | connect( settings->createLinksButton, SIGNAL( clicked()), |
76 | SLOT(createLinks()) ); | 76 | SLOT(createLinks()) ); |
77 | 77 | ||
78 | pvDebug(9,"displayList"); | 78 | pvDebug(9,"displayList"); |
79 | displayList(); | 79 | displayList(); |
80 | } | 80 | } |
81 | 81 | ||
82 | void MainWindow::makeMenu() | 82 | void MainWindow::makeMenu() |
83 | { | 83 | { |
84 | 84 | ||
85 | QToolBar *toolBar = new QToolBar( this ); | 85 | QToolBar *toolBar = new QToolBar( this ); |
86 | QMenuBar *menuBar = new QMenuBar( toolBar ); | 86 | QMenuBar *menuBar = new QMenuBar( toolBar ); |
87 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 87 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
88 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 88 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
89 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 89 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
90 | QPopupMenu *helpMenu = new QPopupMenu( menuBar ); | 90 | QPopupMenu *helpMenu = new QPopupMenu( menuBar ); |
91 | 91 | ||
92 | setToolBarsMovable( false ); | 92 | setToolBarsMovable( false ); |
93 | toolBar->setHorizontalStretchable( true ); | 93 | toolBar->setHorizontalStretchable( true ); |
94 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 94 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
95 | menuBar->insertItem( tr( "View" ), viewMenu ); | 95 | menuBar->insertItem( tr( "View" ), viewMenu ); |
96 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 96 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
97 | menuBar->insertItem( tr( "Help" ), helpMenu ); | 97 | menuBar->insertItem( tr( "Help" ), helpMenu ); |
98 | 98 | ||
99 | // QLabel *spacer; | 99 | // QLabel *spacer; |
100 | // spacer = new QLabel( "", toolBar ); | 100 | // spacer = new QLabel( "", toolBar ); |
101 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); | 101 | // spacer->setBackgroundColor( toolBar->backgroundColor() ); |
102 | // toolBar->setStretchableWidget( spacer ); | 102 | // toolBar->setStretchableWidget( spacer ); |
103 | 103 | ||
104 | 104 | ||
105 | runAction = new QAction( tr( "Apply" ), | 105 | runAction = new QAction( tr( "Apply" ), |
106 | Resource::loadPixmap( "oipkg/install" ), | 106 | Resource::loadPixmap( "oipkg/install" ), |
107 | QString::null, 0, this, 0 ); | 107 | QString::null, 0, this, 0 ); |
108 | connect( runAction, SIGNAL( activated() ), | 108 | connect( runAction, SIGNAL( activated() ), |
109 | this, SLOT( runIpkg() ) ); | 109 | this, SLOT( runIpkg() ) ); |
110 | runAction->addTo( toolBar ); | 110 | runAction->addTo( toolBar ); |
111 | runAction->addTo( srvMenu ); | 111 | runAction->addTo( srvMenu ); |
112 | 112 | ||
113 | srvMenu->insertSeparator(); | 113 | srvMenu->insertSeparator(); |
114 | 114 | ||
115 | updateAction = new QAction( tr( "Update" ), | 115 | updateAction = new QAction( tr( "Update" ), |
116 | Resource::loadIconSet( "oipkg/update" ), | 116 | Resource::loadIconSet( "oipkg/update" ), |
117 | QString::null, 0, this, 0 ); | 117 | QString::null, 0, this, 0 ); |
118 | connect( updateAction, SIGNAL( activated() ), | 118 | connect( updateAction, SIGNAL( activated() ), |
119 | this , SLOT( updateList() ) ); | 119 | this , SLOT( updateList() ) ); |
120 | updateAction->addTo( toolBar ); | 120 | updateAction->addTo( toolBar ); |
121 | updateAction->addTo( srvMenu ); | 121 | updateAction->addTo( srvMenu ); |
122 | 122 | ||
123 | QAction *cfgact; | 123 | QAction *cfgact; |
124 | 124 | ||
125 | cfgact = new QAction( tr( "Setups" ), | 125 | cfgact = new QAction( tr( "Setups" ), |
126 | QString::null, 0, this, 0 ); | 126 | QString::null, 0, this, 0 ); |
127 | connect( cfgact, SIGNAL( activated() ), | 127 | connect( cfgact, SIGNAL( activated() ), |
128 | SLOT( showSettingsSetup() ) ); | 128 | SLOT( showSettingsSetup() ) ); |
129 | cfgact->addTo( cfgMenu ); | 129 | cfgact->addTo( cfgMenu ); |
130 | 130 | ||
131 | cfgact = new QAction( tr( "Servers" ), | 131 | cfgact = new QAction( tr( "Servers" ), |
132 | QString::null, 0, this, 0 ); | 132 | QString::null, 0, this, 0 ); |
133 | connect( cfgact, SIGNAL( activated() ), | 133 | connect( cfgact, SIGNAL( activated() ), |
134 | SLOT( showSettingsSrv() ) ); | 134 | SLOT( showSettingsSrv() ) ); |
135 | cfgact->addTo( cfgMenu ); | 135 | cfgact->addTo( cfgMenu ); |
136 | cfgact = new QAction( tr( "Destinations" ), | 136 | cfgact = new QAction( tr( "Destinations" ), |
137 | QString::null, 0, this, 0 ); | 137 | QString::null, 0, this, 0 ); |
138 | connect( cfgact, SIGNAL( activated() ), | 138 | connect( cfgact, SIGNAL( activated() ), |
139 | SLOT( showSettingsDst() ) ); | 139 | SLOT( showSettingsDst() ) ); |
140 | cfgact->addTo( cfgMenu ); | 140 | cfgact->addTo( cfgMenu ); |
141 | 141 | ||
142 | QAction *a; | 142 | QAction *a; |
143 | 143 | ||
144 | // SECTIONS | 144 | // SECTIONS |
145 | sectionBar = new QToolBar( this ); | 145 | sectionBar = new QToolBar( this ); |
146 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 146 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
147 | sectionBar->setHorizontalStretchable( true ); | 147 | sectionBar->setHorizontalStretchable( true ); |
148 | QLabel *label = new QLabel( sectionBar, "section" ); | 148 | QLabel *label = new QLabel( sectionBar, "section" ); |
149 | // label->setBackgroundMode( NoBackground ); | 149 | // label->setBackgroundMode( NoBackground ); |
150 | label->font().setPointSize( 8 ); | 150 | label->font().setPointSize( 8 ); |
151 | label->setText( tr( "Section:" ) ); | 151 | label->setText( tr( "Section:" ) ); |
152 | sectionBar->setStretchableWidget( label ); | 152 | sectionBar->setStretchableWidget( label ); |
153 | section = new QComboBox( false, sectionBar ); | 153 | section = new QComboBox( false, sectionBar ); |
154 | section->font().setPointSize( 8 ); | 154 | section->font().setPointSize( 8 ); |
155 | label = new QLabel( " / ", sectionBar ); | 155 | label = new QLabel( " / ", sectionBar ); |
156 | label->font().setPointSize( 8 ); | 156 | label->font().setPointSize( 8 ); |
157 | // label->setBackgroundMode( PaletteForeground ); | 157 | // label->setBackgroundMode( PaletteForeground ); |
158 | subsection = new QComboBox( false, sectionBar ); | 158 | subsection = new QComboBox( false, sectionBar ); |
159 | subsection->font().setPointSize( 8 ); | 159 | subsection->font().setPointSize( 8 ); |
160 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 160 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
161 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 161 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
162 | a->addTo( sectionBar ); | 162 | a->addTo( sectionBar ); |
163 | setSections(); | 163 | setSections(); |
164 | setSubSections(); | 164 | setSubSections(); |
165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
167 | sectionAction->setToggleAction( true ); | 167 | sectionAction->setToggleAction( true ); |
168 | sectionAction->addTo( viewMenu ); | 168 | sectionAction->addTo( viewMenu ); |
169 | // sectionBar->setStretchableWidget( section ); | 169 | // sectionBar->setStretchableWidget( section ); |
170 | 170 | ||
171 | //FIND | 171 | //FIND |
172 | findBar = new QToolBar(this); | 172 | findBar = new QToolBar(this); |
173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); | 173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
174 | label = new QLabel( tr("Filter: "), findBar ); | 174 | label = new QLabel( tr("Filter: "), findBar ); |
175 | // label->setBackgroundMode( PaletteForeground ); | 175 | // label->setBackgroundMode( PaletteForeground ); |
176 | findBar->setHorizontalStretchable( TRUE ); | 176 | findBar->setHorizontalStretchable( TRUE ); |
177 | findEdit = new QLineEdit( findBar, "findEdit" ); | 177 | findEdit = new QLineEdit( findBar, "findEdit" ); |
178 | findBar->setStretchableWidget( findEdit ); | 178 | findBar->setStretchableWidget( findEdit ); |
179 | connect( findEdit, SIGNAL( textChanged(const QString&) ), | 179 | connect( findEdit, SIGNAL( textChanged(const QString&) ), |
180 | this, SLOT( displayList() ) ); | 180 | this, SLOT( displayList() ) ); |
181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
183 | a->addTo( findBar ); | 183 | a->addTo( findBar ); |
184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
186 | a->addTo( findBar ); | 186 | a->addTo( findBar ); |
187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); | 187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
189 | findAction->setToggleAction( true ); | 189 | findAction->setToggleAction( true ); |
190 | findAction->addTo( viewMenu ); | 190 | findAction->addTo( viewMenu ); |
191 | 191 | ||
192 | //SEARCH | 192 | //SEARCH |
193 | searchBar = new QToolBar(this); | 193 | searchBar = new QToolBar(this); |
194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
195 | label = new QLabel( tr("Search: "), searchBar ); | 195 | label = new QLabel( tr("Search: "), searchBar ); |
196 | // label->setBackgroundMode( PaletteForeground ); | 196 | // label->setBackgroundMode( PaletteForeground ); |
197 | searchBar->setHorizontalStretchable( TRUE ); | 197 | searchBar->setHorizontalStretchable( TRUE ); |
198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
199 | searchBar->setStretchableWidget( searchEdit ); | 199 | searchBar->setStretchableWidget( searchEdit ); |
200 | // connect( searchEdit, SIGNAL( textChanged(const QString&) ), | 200 | // connect( searchEdit, SIGNAL( textChanged(const QString&) ), |
201 | // this, SLOT( displayList() ) ); | 201 | // this, SLOT( displayList() ) ); |
202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
204 | a->addTo( searchBar ); | 204 | a->addTo( searchBar ); |
205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
207 | searchCommit->addTo( searchBar ); | 207 | searchCommit->addTo( searchBar ); |
208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
210 | a->addTo( searchBar ); | 210 | a->addTo( searchBar ); |
211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
212 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | 212 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); |
213 | searchAction->setToggleAction( true ); | 213 | searchAction->setToggleAction( true ); |
214 | searchAction->addTo( viewMenu ); | 214 | searchAction->addTo( viewMenu ); |
215 | 215 | ||
216 | //DEST | 216 | //DEST |
217 | destBar = new QToolBar(this); | 217 | destBar = new QToolBar(this); |
218 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 218 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
219 | label = new QLabel( tr("Destination: "), destBar ); | 219 | label = new QLabel( tr("Destination: "), destBar ); |
220 | // label->setBackgroundMode( PaletteForeground ); | 220 | // label->setBackgroundMode( PaletteForeground ); |
221 | destBar->setHorizontalStretchable( TRUE ); | 221 | destBar->setHorizontalStretchable( TRUE ); |
222 | destination = new QComboBox( false, destBar ); | 222 | destination = new QComboBox( false, destBar ); |
223 | destination->insertStringList( settings->getDestinationNames() ); | 223 | destination->insertStringList( settings->getDestinationNames() ); |
224 | setComboName(destination,settings->getDestinationName()); | 224 | setComboName(destination,settings->getDestinationName()); |
225 | connect( destination, SIGNAL(activated(int)), | 225 | connect( destination, SIGNAL(activated(int)), |
226 | settings, SLOT(activeDestinationChange(int)) ); | 226 | settings, SLOT(activeDestinationChange(int)) ); |
227 | // space->setBackgroundMode( PaletteForeground ); | 227 | // space->setBackgroundMode( PaletteForeground ); |
228 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 228 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
229 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); | 229 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); |
230 | CheckBoxLink->setChecked( settings->createLinks() ); | 230 | CheckBoxLink->setChecked( settings->createLinks() ); |
231 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 231 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
232 | settings, SLOT(linkEnabled(bool)) ); | 232 | settings, SLOT(linkEnabled(bool)) ); |
233 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 233 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
234 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 234 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
235 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 235 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
236 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 236 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
237 | a->addTo( destBar ); | 237 | a->addTo( destBar ); |
238 | destBar->setStretchableWidget( CheckBoxLink ); | 238 | destBar->setStretchableWidget( CheckBoxLink ); |
239 | destAction->setToggleAction( true ); | 239 | destAction->setToggleAction( true ); |
240 | destAction->addTo( viewMenu ); | 240 | destAction->addTo( viewMenu ); |
241 | 241 | ||
242 | // helpMenu | 242 | // helpMenu |
243 | helpMenu->insertSeparator(); | 243 | helpMenu->insertSeparator(); |
244 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); | 244 | a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); |
245 | a->addTo( helpMenu ); | 245 | a->addTo( helpMenu ); |
246 | helpMenu->insertSeparator(); | 246 | helpMenu->insertSeparator(); |
247 | a = new QAction( tr( "Install" ), | 247 | a = new QAction( tr( "Install" ), |
248 | Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); | 248 | Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); |
249 | a->addTo( helpMenu ); | 249 | a->addTo( helpMenu ); |
250 | a = new QAction( tr( "Remove" ), | 250 | a = new QAction( tr( "Remove" ), |
251 | Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); | 251 | Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); |
252 | a->addTo( helpMenu ); | 252 | a->addTo( helpMenu ); |
253 | helpMenu->insertSeparator(); | 253 | helpMenu->insertSeparator(); |
254 | a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); | 254 | a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); |
255 | a->addTo( helpMenu ); | 255 | a->addTo( helpMenu ); |
256 | helpMenu->insertSeparator(); | 256 | helpMenu->insertSeparator(); |
257 | a = new QAction( tr( "New version, installed" ), | 257 | a = new QAction( tr( "New version, installed" ), |
258 | Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); | 258 | Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); |
259 | a->addTo( helpMenu ); | 259 | a->addTo( helpMenu ); |
260 | a = new QAction( tr( "New version, not installed" ), | 260 | a = new QAction( tr( "New version, not installed" ), |
261 | Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); | 261 | Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); |
262 | a->addTo( helpMenu ); | 262 | a->addTo( helpMenu ); |
263 | a = new QAction( tr( "Old version, installed" ), | 263 | a = new QAction( tr( "Old version, installed" ), |
264 | Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); | 264 | Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); |
265 | a->addTo( helpMenu ); | 265 | a->addTo( helpMenu ); |
266 | a = new QAction( tr( "Old version, not installed" ), | 266 | a = new QAction( tr( "Old version, not installed" ), |
267 | Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); | 267 | Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); |
268 | a->addTo( helpMenu ); | 268 | a->addTo( helpMenu ); |
269 | a = new QAction( tr( "Old version, new version installed" ), | 269 | a = new QAction( tr( "Old version, new version installed" ), |
270 | Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); | 270 | Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); |
271 | a->addTo( helpMenu ); | 271 | a->addTo( helpMenu ); |
272 | a = new QAction( tr( "New version, old version installed" ), | 272 | a = new QAction( tr( "New version, old version installed" ), |
273 | Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); | 273 | Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); |
274 | a->addTo( helpMenu ); | 274 | a->addTo( helpMenu ); |
275 | //a = new QAction( tr( "" ), | 275 | //a = new QAction( "", |
276 | // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); | 276 | // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); |
277 | // a->addTo( helpMenu ); | 277 | // a->addTo( helpMenu ); |
278 | 278 | ||
279 | // configure the menus | 279 | // configure the menus |
280 | Config cfg( "oipkg", Config::User ); | 280 | Config cfg( "oipkg", Config::User ); |
281 | cfg.setGroup( "gui" ); | 281 | cfg.setGroup( "gui" ); |
282 | 282 | ||
283 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 283 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
284 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 284 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
285 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 285 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
286 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 286 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
287 | setComboName(section,cfg.readEntry("default_section")); | 287 | setComboName(section,cfg.readEntry("default_section")); |
288 | sectionChanged(); | 288 | sectionChanged(); |
289 | } | 289 | } |
290 | 290 | ||
291 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
292 | { | 292 | { |
293 | Config cfg( "oipkg", Config::User ); | 293 | Config cfg( "oipkg", Config::User ); |
294 | cfg.setGroup( "gui" ); | 294 | cfg.setGroup( "gui" ); |
295 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 295 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
296 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | 296 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); |
297 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 297 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
298 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 298 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
299 | cfg.writeEntry( "default_section", section->currentText() ); | 299 | cfg.writeEntry( "default_section", section->currentText() ); |
300 | 300 | ||
301 | } | 301 | } |
302 | 302 | ||
303 | void MainWindow::runIpkg() | 303 | void MainWindow::runIpkg() |
304 | { | 304 | { |
305 | packageListServers.allPackages(); | 305 | packageListServers.allPackages(); |
306 | ipkg->loadList( &packageListSearch ); | 306 | ipkg->loadList( &packageListSearch ); |
307 | ipkg->loadList( &packageListDocLnk ); | 307 | ipkg->loadList( &packageListDocLnk ); |
308 | ipkg->loadList( &packageListServers ); | 308 | ipkg->loadList( &packageListServers ); |
309 | ipkg->commit(); | 309 | ipkg->commit(); |
310 | ipkg->clearLists(); | 310 | ipkg->clearLists(); |
311 | // ##### If we looked in the list of files, we could send out accurate | 311 | // ##### If we looked in the list of files, we could send out accurate |
312 | // ##### messages. But we don't bother yet, and just do an "all". | 312 | // ##### messages. But we don't bother yet, and just do an "all". |
313 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 313 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
314 | QString lf = QString::null; | 314 | QString lf = QString::null; |
315 | e << lf; | 315 | e << lf; |
316 | displayList(); | 316 | displayList(); |
317 | } | 317 | } |
318 | 318 | ||
319 | void MainWindow::updateList() | 319 | void MainWindow::updateList() |
320 | { | 320 | { |
321 | packageListServers.clear(); | 321 | packageListServers.clear(); |
322 | packageListSearch.clear(); | 322 | packageListSearch.clear(); |
323 | 323 | ||
324 | packageListDocLnk.clear(); | 324 | packageListDocLnk.clear(); |
325 | ipkg->update(); | 325 | ipkg->update(); |
326 | packageListServers.update(); | 326 | packageListServers.update(); |
327 | packageListSearch.update(); | 327 | packageListSearch.update(); |
328 | packageListDocLnk.update(); | 328 | packageListDocLnk.update(); |
329 | } | 329 | } |
330 | 330 | ||
331 | void MainWindow::filterList() | 331 | void MainWindow::filterList() |
332 | { | 332 | { |
333 | QString f = ""; | 333 | QString f = ""; |
334 | if ( findAction->isOn() ) f = findEdit->text(); | 334 | if ( findAction->isOn() ) f = findEdit->text(); |
335 | packageListServers.filterPackages( f ); | 335 | packageListServers.filterPackages( f ); |
336 | } | 336 | } |
337 | 337 | ||
338 | void MainWindow::displayList() | 338 | void MainWindow::displayList() |
339 | { | 339 | { |
340 | filterList(); | 340 | filterList(); |
341 | listViewPackages->display(); | 341 | listViewPackages->display(); |
342 | } | 342 | } |
343 | 343 | ||
344 | void MainWindow::sectionChanged() | 344 | void MainWindow::sectionChanged() |
345 | { | 345 | { |
346 | disconnect( section, SIGNAL( activated(int) ), | 346 | disconnect( section, SIGNAL( activated(int) ), |
347 | this, SLOT( sectionChanged() ) ); | 347 | this, SLOT( sectionChanged() ) ); |
348 | disconnect( subsection, SIGNAL(activated(int) ), | 348 | disconnect( subsection, SIGNAL(activated(int) ), |
349 | this, SLOT( subSectionChanged() ) ); | 349 | this, SLOT( subSectionChanged() ) ); |
350 | subsection->clear(); | 350 | subsection->clear(); |
351 | packageListServers.setSection( section->currentText() ); | 351 | packageListServers.setSection( section->currentText() ); |
352 | setSubSections(); | 352 | setSubSections(); |
353 | connect( section, SIGNAL( activated(int) ), | 353 | connect( section, SIGNAL( activated(int) ), |
354 | this, SLOT( sectionChanged() ) ); | 354 | this, SLOT( sectionChanged() ) ); |
355 | connect( subsection, SIGNAL(activated(int) ), | 355 | connect( subsection, SIGNAL(activated(int) ), |
356 | this, SLOT( subSectionChanged() ) ); | 356 | this, SLOT( subSectionChanged() ) ); |
357 | displayList(); | 357 | displayList(); |
358 | } | 358 | } |
359 | 359 | ||
360 | void MainWindow::subSectionChanged() | 360 | void MainWindow::subSectionChanged() |
361 | { | 361 | { |
362 | disconnect( section, SIGNAL( activated(int) ), | 362 | disconnect( section, SIGNAL( activated(int) ), |
363 | this, SLOT( sectionChanged() ) ); | 363 | this, SLOT( sectionChanged() ) ); |
364 | disconnect( subsection, SIGNAL(activated(int) ), | 364 | disconnect( subsection, SIGNAL(activated(int) ), |
365 | this, SLOT( subSectionChanged() ) ); | 365 | this, SLOT( subSectionChanged() ) ); |
366 | packageListServers.setSubSection( subsection->currentText() ); | 366 | packageListServers.setSubSection( subsection->currentText() ); |
367 | connect( section, SIGNAL( activated(int) ), | 367 | connect( section, SIGNAL( activated(int) ), |
368 | this, SLOT( sectionChanged() ) ); | 368 | this, SLOT( sectionChanged() ) ); |
369 | connect( subsection, SIGNAL(activated(int) ), | 369 | connect( subsection, SIGNAL(activated(int) ), |
370 | this, SLOT( subSectionChanged() ) ); | 370 | this, SLOT( subSectionChanged() ) ); |
371 | displayList(); | 371 | displayList(); |
372 | } | 372 | } |
373 | 373 | ||
374 | void MainWindow::setSections() | 374 | void MainWindow::setSections() |
375 | { | 375 | { |
376 | section->clear(); | 376 | section->clear(); |
377 | section->insertStringList( packageListServers.getSections() ); | 377 | section->insertStringList( packageListServers.getSections() ); |
378 | } | 378 | } |
379 | 379 | ||
380 | void MainWindow::setSubSections() | 380 | void MainWindow::setSubSections() |
381 | { | 381 | { |
382 | subsection->clear(); | 382 | subsection->clear(); |
383 | subsection->insertStringList( packageListServers.getSubSections() ); | 383 | subsection->insertStringList( packageListServers.getSubSections() ); |
384 | } | 384 | } |
385 | 385 | ||
386 | 386 | ||
387 | void MainWindow::showSettings(int i) | 387 | void MainWindow::showSettings(int i) |
388 | { | 388 | { |
389 | if ( settings->showDialog( i ) ) | 389 | if ( settings->showDialog( i ) ) |
390 | { | 390 | { |
391 | updateList(); | 391 | updateList(); |
392 | } | 392 | } |
393 | setComboName(destination,settings->getDestinationName()); | 393 | setComboName(destination,settings->getDestinationName()); |
394 | CheckBoxLink->setChecked( settings->createLinks() ); | 394 | CheckBoxLink->setChecked( settings->createLinks() ); |
395 | } | 395 | } |
396 | void MainWindow::showSettingsSetup() | 396 | void MainWindow::showSettingsSetup() |
397 | { | 397 | { |
398 | showSettings(0); | 398 | showSettings(0); |
399 | } | 399 | } |
400 | void MainWindow::showSettingsSrv() | 400 | void MainWindow::showSettingsSrv() |
401 | { | 401 | { |
402 | showSettings(1); | 402 | showSettings(1); |
403 | } | 403 | } |
404 | void MainWindow::showSettingsDst() | 404 | void MainWindow::showSettingsDst() |
405 | { | 405 | { |
406 | showSettings(2); | 406 | showSettings(2); |
407 | } | 407 | } |
408 | 408 | ||
409 | void MainWindow::sectionShow(bool b) | 409 | void MainWindow::sectionShow(bool b) |
410 | { | 410 | { |
411 | if (b) sectionBar->show(); | 411 | if (b) sectionBar->show(); |
412 | else sectionBar->hide(); | 412 | else sectionBar->hide(); |
413 | sectionAction->setOn( b ); | 413 | sectionAction->setOn( b ); |
414 | } | 414 | } |
415 | 415 | ||
416 | void MainWindow::sectionClose() | 416 | void MainWindow::sectionClose() |
417 | { | 417 | { |
418 | sectionAction->setOn( false ); | 418 | sectionAction->setOn( false ); |
419 | } | 419 | } |
420 | 420 | ||
421 | void MainWindow::findShow(bool b) | 421 | void MainWindow::findShow(bool b) |
422 | { | 422 | { |
423 | if (b) findBar->show(); | 423 | if (b) findBar->show(); |
424 | else findBar->hide(); | 424 | else findBar->hide(); |
425 | findAction->setOn( b ); | 425 | findAction->setOn( b ); |
426 | } | 426 | } |
427 | 427 | ||
428 | void MainWindow::findClose() | 428 | void MainWindow::findClose() |
429 | { | 429 | { |
430 | findAction->setOn( false ); | 430 | findAction->setOn( false ); |
431 | } | 431 | } |
432 | 432 | ||
433 | void MainWindow::searchShow(bool b) | 433 | void MainWindow::searchShow(bool b) |
434 | { | 434 | { |
435 | if (b) searchBar->show(); | 435 | if (b) searchBar->show(); |
436 | else searchBar->hide(); | 436 | else searchBar->hide(); |
437 | searchAction->setOn( b ); | 437 | searchAction->setOn( b ); |
438 | } | 438 | } |
439 | 439 | ||
440 | void MainWindow::searchClose() | 440 | void MainWindow::searchClose() |
441 | { | 441 | { |
442 | searchAction->setOn( false ); | 442 | searchAction->setOn( false ); |
443 | } | 443 | } |
444 | 444 | ||
445 | 445 | ||
446 | void MainWindow::destShow(bool b) | 446 | void MainWindow::destShow(bool b) |
447 | { | 447 | { |
448 | if (b) destBar->show(); | 448 | if (b) destBar->show(); |
449 | else destBar->hide(); | 449 | else destBar->hide(); |
450 | destAction->setOn( b ); | 450 | destAction->setOn( b ); |
451 | } | 451 | } |
452 | 452 | ||
453 | void MainWindow::destClose() | 453 | void MainWindow::destClose() |
454 | { | 454 | { |
455 | destAction->setOn( false ); | 455 | destAction->setOn( false ); |
456 | } | 456 | } |
457 | 457 | ||
458 | void MainWindow::setDocument(const QString &fileName) | 458 | void MainWindow::setDocument(const QString &fileName) |
459 | { | 459 | { |
460 | if ( !QFile::exists( fileName ) ) return; | 460 | if ( !QFile::exists( fileName ) ) return; |
461 | ipkg->installFile( fileName ); | 461 | ipkg->installFile( fileName ); |
462 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 462 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
463 | QString lf = QString::null; | 463 | QString lf = QString::null; |
464 | e << lf; | 464 | e << lf; |
465 | } | 465 | } |
466 | 466 | ||
467 | 467 | ||
468 | void MainWindow::makeChannel() | 468 | void MainWindow::makeChannel() |
469 | { | 469 | { |
470 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | 470 | channel = new QCopChannel( "QPE/Application/oipkg", this ); |
471 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 471 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
472 | this, SLOT(receive(const QCString&,const QByteArray&)) ); | 472 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
473 | } | 473 | } |
474 | 474 | ||
475 | 475 | ||
476 | 476 | ||
477 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | 477 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) |
478 | { | 478 | { |
479 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); | 479 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); |
480 | if ( msg == "installFile(QString)" ) | 480 | if ( msg == "installFile(QString)" ) |
481 | { | 481 | { |
482 | ipkg->installFile( QString(arg) ); | 482 | ipkg->installFile( QString(arg) ); |
483 | }else if( msg == "removeFile(QString)" ) | 483 | }else if( msg == "removeFile(QString)" ) |
484 | { | 484 | { |
485 | ipkg->removeFile( QString(arg) ); | 485 | ipkg->removeFile( QString(arg) ); |
486 | }else if( msg == "createLinks(QString)" ) | 486 | }else if( msg == "createLinks(QString)" ) |
487 | { | 487 | { |
488 | ipkg->createLinks( QString(arg) ); | 488 | ipkg->createLinks( QString(arg) ); |
489 | }else if( msg == "removeLinks(QString)" ) | 489 | }else if( msg == "removeLinks(QString)" ) |
490 | { | 490 | { |
491 | ipkg->removeLinks( QString(arg) ); | 491 | ipkg->removeLinks( QString(arg) ); |
492 | }else{ | 492 | }else{ |
493 | pvDebug(2,"Huh what do ya want") | 493 | pvDebug(2,"Huh what do ya want") |
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
497 | 497 | ||
498 | void MainWindow::createLinks() | 498 | void MainWindow::createLinks() |
499 | { | 499 | { |
500 | pvDebug(2,"creating links..."); | 500 | pvDebug(2,"creating links..."); |
501 | ipkg->createLinks( settings->destinationurl->text() ); | 501 | ipkg->createLinks( settings->destinationurl->text() ); |
502 | } | 502 | } |
503 | 503 | ||
504 | void MainWindow::removeLinks() | 504 | void MainWindow::removeLinks() |
505 | { | 505 | { |
506 | pvDebug(2,"removing links..."); | 506 | pvDebug(2,"removing links..."); |
507 | ipkg->removeLinks( settings->destinationurl->text() ); | 507 | ipkg->removeLinks( settings->destinationurl->text() ); |
508 | } | 508 | } |
509 | 509 | ||
510 | void MainWindow::remotePackageQuery() | 510 | void MainWindow::remotePackageQuery() |
511 | { | 511 | { |
512 | packageListSearch.query( searchEdit->text() ); | 512 | packageListSearch.query( searchEdit->text() ); |
513 | packageListSearch.update(); | 513 | packageListSearch.update(); |
514 | displayList(); | 514 | displayList(); |
515 | } | 515 | } |