summaryrefslogtreecommitdiff
path: root/noncore/settings
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/settings
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp24
-rw-r--r--noncore/settings/appearance2/sample.cpp4
-rw-r--r--noncore/settings/aqpkg/inputdlg.cpp4
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp8
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp10
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp26
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp4
-rw-r--r--noncore/settings/backup/backuprestore.cpp4
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp14
-rw-r--r--noncore/settings/netsystemtime/settingstabwidget.cpp4
-rw-r--r--noncore/settings/netsystemtime/timetabwidget.cpp2
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp4
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp14
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp8
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp12
-rw-r--r--noncore/settings/networksettings/ppp/pppdargs.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp2
-rw-r--r--noncore/settings/packagemanager/filterdlg.cpp2
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp8
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp16
-rw-r--r--noncore/settings/sound/soundsettings.cpp20
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp2
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp4
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp4
-rw-r--r--noncore/settings/tabmanager/tabmanager.cpp4
-rw-r--r--noncore/settings/usermanager/usermanager.cpp2
27 files changed, 107 insertions, 107 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index b39203b..8ae87fe 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -76,323 +76,323 @@ using namespace Opie;
76 76
77 77
78class DefaultWindowDecoration : public WindowDecorationInterface 78class DefaultWindowDecoration : public WindowDecorationInterface
79{ 79{
80public: 80public:
81 DefaultWindowDecoration() : ref(0) {} 81 DefaultWindowDecoration() : ref(0) {}
82 QString name() const 82 QString name() const
83 { 83 {
84 return "Default"; 84 return "Default";
85 } 85 }
86 QPixmap icon() const 86 QPixmap icon() const
87 { 87 {
88 return QPixmap(); 88 return QPixmap();
89 } 89 }
90 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 90 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
91 { 91 {
92 *iface = 0; 92 *iface = 0;
93 if ( uuid == IID_QUnknown ) 93 if ( uuid == IID_QUnknown )
94 *iface = this; 94 *iface = this;
95 else if ( uuid == IID_WindowDecoration ) 95 else if ( uuid == IID_WindowDecoration )
96 *iface = this; 96 *iface = this;
97 97
98 if ( *iface ) 98 if ( *iface )
99 (*iface)->addRef(); 99 (*iface)->addRef();
100 return QS_OK; 100 return QS_OK;
101 } 101 }
102 Q_REFCOUNT 102 Q_REFCOUNT
103 103
104private: 104private:
105 ulong ref; 105 ulong ref;
106}; 106};
107 107
108 108
109 109
110 110
111 111
112 112
113 113
114QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) 114QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
115{ 115{
116 QWidget* tab = new QWidget( parent, "StyleTab" ); 116 QWidget* tab = new QWidget( parent, "StyleTab" );
117 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 117 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
118 118
119 m_style_list = new QListBox( tab, "m_style_list" ); 119 m_style_list = new QListBox( tab, "m_style_list" );
120 vertLayout->addWidget( m_style_list ); 120 vertLayout->addWidget( m_style_list );
121 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) ); 121 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) );
122 122
123 m_style_settings = new QPushButton ( tr( "Settings..." ), tab ); 123 m_style_settings = new QPushButton ( tr( "Settings..." ), tab );
124 connect ( m_style_settings, SIGNAL( clicked ( )), this, SLOT( styleSettingsClicked ( ))); 124 connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked()));
125 vertLayout-> addWidget ( m_style_settings ); 125 vertLayout-> addWidget ( m_style_settings );
126 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) ); 126 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) );
127 127
128 QString s = cfg. readEntry ( "Style", "Light" ); 128 QString s = cfg. readEntry ( "Style", "Light" );
129 129
130 130
131#if QT_VERSION >= 300 131#if QT_VERSION >= 300
132 m_style_list->insertStringList(QStyleFactory::styles()); 132 m_style_list->insertStringList(QStyleFactory::styles());
133#else 133#else
134 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( ))); 134 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( )));
135 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( ))); 135 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( )));
136 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); 136 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( )));
137#endif 137#endif
138 138
139 { 139 {
140 QString path = QPEApplication::qpeDir ( ); 140 QString path = QPEApplication::qpeDir ( );
141 path.append( "/plugins/styles/" ); 141 path.append( "/plugins/styles/" );
142 QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); 142 QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
143 143
144 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 144 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
145 { 145 {
146 QString libstr = path; 146 QString libstr = path;
147 libstr.append( "/" ); 147 libstr.append( "/" );
148 libstr.append( *it ); 148 libstr.append( *it );
149 QLibrary *lib = new QLibrary ( libstr ); 149 QLibrary *lib = new QLibrary ( libstr );
150 StyleInterface *iface; 150 StyleInterface *iface;
151 151
152 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) 152 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
153 { 153 {
154 StyleListItem *slit = new StyleListItem ( lib, iface ); 154 StyleListItem *slit = new StyleListItem ( lib, iface );
155 m_style_list-> insertItem ( slit ); 155 m_style_list-> insertItem ( slit );
156 156
157 if ( slit-> key ( ) == s ) 157 if ( slit-> key ( ) == s )
158 m_style_list-> setCurrentItem ( slit ); 158 m_style_list-> setCurrentItem ( slit );
159 } 159 }
160 else 160 else
161 delete lib; 161 delete lib;
162 } 162 }
163 } 163 }
164 164
165 m_original_style = m_style_list-> currentItem ( ); 165 m_original_style = m_style_list-> currentItem ( );
166 styleClicked ( m_original_style ); 166 styleClicked ( m_original_style );
167 167
168 connect( m_style_list, SIGNAL( highlighted( int ) ), this, SLOT( styleClicked( int ) ) ); 168 connect( m_style_list, SIGNAL( highlighted(int) ), this, SLOT( styleClicked(int) ) );
169 169
170 return tab; 170 return tab;
171} 171}
172 172
173QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) 173QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
174{ 174{
175 QWidget* tab = new QWidget( parent, "DecoTab" ); 175 QWidget* tab = new QWidget( parent, "DecoTab" );
176 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 176 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
177 177
178 m_deco_list = new QListBox( tab, "m_deco_list" ); 178 m_deco_list = new QListBox( tab, "m_deco_list" );
179 vertLayout->addWidget( m_deco_list ); 179 vertLayout->addWidget( m_deco_list );
180 QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) ); 180 QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) );
181 181
182 QString s = cfg. readEntry ( "Decoration", "libflat.so" ); 182 QString s = cfg. readEntry ( "Decoration", "libflat.so" );
183 183
184 m_deco_list-> insertItem ( new DecoListItem ( "QPE" )); 184 m_deco_list-> insertItem ( new DecoListItem ( "QPE" ));
185 185
186 { 186 {
187 QString path = QPEApplication::qpeDir(); 187 QString path = QPEApplication::qpeDir();
188 path.append( "/plugins/decorations/" ); 188 path.append( "/plugins/decorations/" );
189 QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); 189 QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
190 190
191 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 191 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
192 { 192 {
193 QString libstr = path; 193 QString libstr = path;
194 libstr.append( "/" ); 194 libstr.append( "/" );
195 libstr.append( *it ); 195 libstr.append( *it );
196 QLibrary *lib = new QLibrary ( libstr ); 196 QLibrary *lib = new QLibrary ( libstr );
197 WindowDecorationInterface *iface; 197 WindowDecorationInterface *iface;
198 198
199 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) 199 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
200 { 200 {
201 DecoListItem *dlit = new DecoListItem ( lib, iface ); 201 DecoListItem *dlit = new DecoListItem ( lib, iface );
202 m_deco_list-> insertItem ( dlit ); 202 m_deco_list-> insertItem ( dlit );
203 203
204 if ( dlit-> key ( ) == s ) 204 if ( dlit-> key ( ) == s )
205 m_deco_list-> setCurrentItem ( dlit ); 205 m_deco_list-> setCurrentItem ( dlit );
206 } 206 }
207 else 207 else
208 delete lib; 208 delete lib;
209 } 209 }
210 } 210 }
211 211
212 m_original_deco = m_deco_list-> currentItem ( ); 212 m_original_deco = m_deco_list-> currentItem ( );
213 if ( m_deco_list-> currentItem ( ) < 0 ) 213 if ( m_deco_list-> currentItem ( ) < 0 )
214 m_deco_list-> setCurrentItem ( 0 ); 214 m_deco_list-> setCurrentItem ( 0 );
215 decoClicked ( m_original_deco ); 215 decoClicked ( m_original_deco );
216 216
217 connect( m_deco_list, SIGNAL( highlighted( int ) ), this, SLOT( decoClicked( int ) ) ); 217 connect( m_deco_list, SIGNAL( highlighted(int) ), this, SLOT( decoClicked(int) ) );
218 218
219 return tab; 219 return tab;
220} 220}
221 221
222QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) 222QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg )
223{ 223{
224 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); 224 QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
225 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); 225 QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
226 int size = cfg. readNumEntry ( "FontSize", 10 ); 226 int size = cfg. readNumEntry ( "FontSize", 10 );
227 227
228 m_fontselect = new OFontSelector ( false, parent, "FontTab" ); 228 m_fontselect = new OFontSelector ( false, parent, "FontTab" );
229 m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 229 m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
230 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); 230 QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) );
231 231
232 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), 232 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
233 this, SLOT( fontClicked ( const QFont & ))); 233 this, SLOT( fontClicked(const QFont&)));
234 234
235 return m_fontselect; 235 return m_fontselect;
236} 236}
237 237
238QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) 238QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
239{ 239{
240 QWidget *tab = new QWidget( parent, "ColorTab" ); 240 QWidget *tab = new QWidget( parent, "ColorTab" );
241 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 ); 241 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 );
242 gridLayout->setRowStretch ( 3, 10 ); 242 gridLayout->setRowStretch ( 3, 10 );
243 243
244 m_color_list = new QListBox ( tab ); 244 m_color_list = new QListBox ( tab );
245 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); 245 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 );
246 connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) ); 246 connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) );
247 QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) ); 247 QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) );
248 248
249 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg )); 249 m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg ));
250 250
251 QString path = QPEApplication::qpeDir ( ); 251 QString path = QPEApplication::qpeDir ( );
252 path.append( "/etc/colors/" ); 252 path.append( "/etc/colors/" );
253 QStringList sl = QDir ( path ). entryList ( "*.scheme" ); 253 QStringList sl = QDir ( path ). entryList ( "*.scheme" );
254 254
255 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 255 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
256 { 256 {
257 QString name = (*it). left ((*it). find ( ".scheme" )); 257 QString name = (*it). left ((*it). find ( ".scheme" ));
258 QString pathstr = path; 258 QString pathstr = path;
259 pathstr.append( *it ); 259 pathstr.append( *it );
260 Config config ( pathstr, Config::File ); 260 Config config ( pathstr, Config::File );
261 config. setGroup ( "Colors" ); 261 config. setGroup ( "Colors" );
262 262
263 m_color_list-> insertItem ( new ColorListItem ( name, config )); 263 m_color_list-> insertItem ( new ColorListItem ( name, config ));
264 } 264 }
265 265
266 m_color_list-> setCurrentItem ( 0 ); 266 m_color_list-> setCurrentItem ( 0 );
267 267
268 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" ); 268 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" );
269 tempButton->setText( tr( "Edit..." ) ); 269 tempButton->setText( tr( "Edit..." ) );
270 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) ); 270 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) );
271 gridLayout->addWidget( tempButton, 0, 1 ); 271 gridLayout->addWidget( tempButton, 0, 1 );
272 QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) ); 272 QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) );
273 273
274 tempButton = new QPushButton( tab, "deleteSchemeButton" ); 274 tempButton = new QPushButton( tab, "deleteSchemeButton" );
275 tempButton->setText( tr( "Delete" ) ); 275 tempButton->setText( tr( "Delete" ) );
276 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) ); 276 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) );
277 gridLayout->addWidget( tempButton, 1, 1 ); 277 gridLayout->addWidget( tempButton, 1, 1 );
278 QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) ); 278 QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) );
279 279
280 tempButton = new QPushButton( tab, "saveSchemeButton" ); 280 tempButton = new QPushButton( tab, "saveSchemeButton" );
281 tempButton->setText( tr( "Save" ) ); 281 tempButton->setText( tr( "Save" ) );
282 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) ); 282 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) );
283 gridLayout->addWidget( tempButton, 2, 1 ); 283 gridLayout->addWidget( tempButton, 2, 1 );
284 QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) ); 284 QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) );
285 285
286 return tab; 286 return tab;
287} 287}
288 288
289QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) 289QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
290{ 290{
291 QWidget *tab = new QWidget ( parent ); 291 QWidget *tab = new QWidget ( parent );
292 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); 292 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
293 293
294 QGridLayout *lay = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 294 QGridLayout *lay = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
295 295
296 m_force = new QCheckBox ( tr( "Force styling for all applications." ), tab ); 296 m_force = new QCheckBox ( tr( "Force styling for all applications." ), tab );
297 m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" )); 297 m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" ));
298 lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 ); 298 lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 );
299 QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) ); 299 QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) );
300 300
301 QLabel *l = new QLabel ( tab ); 301 QLabel *l = new QLabel ( tab );
302 l-> setText ( QString ( "<p>%1</p>" ). arg ( tr( "Disable styling for these applications ( <b>*</b> can be used as a wildcard):" ))); 302 l-> setText ( QString ( "<p>%1</p>" ). arg ( tr( "Disable styling for these applications ( <b>*</b> can be used as a wildcard):" )));
303 lay-> addMultiCellWidget ( l, 1, 1, 0, 1 ); 303 lay-> addMultiCellWidget ( l, 1, 1, 0, 1 );
304 QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); 304 QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
305 305
306 m_except = new QListView ( tab ); 306 m_except = new QListView ( tab );
307 m_except-> addColumn ( Resource::loadIconSet ( "appearance" ), "", 24 ); 307 m_except-> addColumn ( Resource::loadIconSet ( "appearance" ), "", 24 );
308 m_except-> addColumn ( Resource::loadIconSet ( "font" ), "", 24 ); 308 m_except-> addColumn ( Resource::loadIconSet ( "font" ), "", 24 );
309 m_except-> addColumn ( Resource::loadIconSet ( "appearance/deco" ), "", 24 ); 309 m_except-> addColumn ( Resource::loadIconSet ( "appearance/deco" ), "", 24 );
310 m_except-> addColumn ( tr( "Binary file(s)" )); 310 m_except-> addColumn ( tr( "Binary file(s)" ));
311 m_except-> setColumnAlignment ( 0, AlignCenter ); 311 m_except-> setColumnAlignment ( 0, AlignCenter );
312 m_except-> setColumnAlignment ( 1, AlignCenter ); 312 m_except-> setColumnAlignment ( 1, AlignCenter );
313 m_except-> setColumnAlignment ( 2, AlignCenter ); 313 m_except-> setColumnAlignment ( 2, AlignCenter );
314 m_except-> setAllColumnsShowFocus ( true ); 314 m_except-> setAllColumnsShowFocus ( true );
315 m_except-> setMinimumHeight ( 30 ); 315 m_except-> setMinimumHeight ( 30 );
316 m_except-> header ( )-> setClickEnabled ( false ); 316 m_except-> header ( )-> setClickEnabled ( false );
317 m_except-> header ( )-> setResizeEnabled ( false ); 317 m_except-> header ( )-> setResizeEnabled ( false );
318 m_except-> header ( )-> setMovingEnabled ( false ); 318 m_except-> header ( )-> setMovingEnabled ( false );
319 m_except-> setSorting ( -1 ); 319 m_except-> setSorting ( -1 );
320 lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 ); 320 lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 );
321 QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); 321 QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) );
322 322
323 connect ( m_except, SIGNAL( clicked ( QListViewItem *, const QPoint &, int )), this, SLOT( clickedExcept ( QListViewItem *, const QPoint &, int ))); 323 connect ( m_except, SIGNAL( clicked(QListViewItem*,const QPoint&,int)), this, SLOT( clickedExcept(QListViewItem*,const QPoint&,int)));
324 324
325 QToolButton *tb = new QToolButton ( tab ); 325 QToolButton *tb = new QToolButton ( tab );
326 tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" )); 326 tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" ));
327 tb-> setFocusPolicy ( QWidget::StrongFocus ); 327 tb-> setFocusPolicy ( QWidget::StrongFocus );
328 lay-> addWidget ( tb, 2, 1 ); 328 lay-> addWidget ( tb, 2, 1 );
329 connect ( tb, SIGNAL( clicked ( )), this, SLOT( addExcept ( ))); 329 connect ( tb, SIGNAL( clicked()), this, SLOT( addExcept()));
330 QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) ); 330 QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) );
331 331
332 tb = new QToolButton ( tab ); 332 tb = new QToolButton ( tab );
333 tb-> setIconSet ( Resource::loadIconSet ( "editdelete" )); 333 tb-> setIconSet ( Resource::loadIconSet ( "editdelete" ));
334 tb-> setFocusPolicy ( QWidget::StrongFocus ); 334 tb-> setFocusPolicy ( QWidget::StrongFocus );
335 lay-> addWidget ( tb, 3, 1 ); 335 lay-> addWidget ( tb, 3, 1 );
336 connect ( tb, SIGNAL( clicked ( )), this, SLOT( delExcept ( ))); 336 connect ( tb, SIGNAL( clicked()), this, SLOT( delExcept()));
337 QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) ); 337 QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) );
338 338
339 tb = new QToolButton ( tab ); 339 tb = new QToolButton ( tab );
340 tb-> setIconSet ( Resource::loadIconSet ( "up" )); 340 tb-> setIconSet ( Resource::loadIconSet ( "up" ));
341 tb-> setFocusPolicy ( QWidget::StrongFocus ); 341 tb-> setFocusPolicy ( QWidget::StrongFocus );
342 lay-> addWidget ( tb, 4, 1 ); 342 lay-> addWidget ( tb, 4, 1 );
343 connect ( tb, SIGNAL( clicked ( )), this, SLOT( upExcept ( ))); 343 connect ( tb, SIGNAL( clicked()), this, SLOT( upExcept()));
344 QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) ); 344 QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) );
345 345
346 tb = new QToolButton ( tab ); 346 tb = new QToolButton ( tab );
347 tb-> setIconSet ( Resource::loadIconSet ( "down" )); 347 tb-> setIconSet ( Resource::loadIconSet ( "down" ));
348 tb-> setFocusPolicy ( QWidget::StrongFocus ); 348 tb-> setFocusPolicy ( QWidget::StrongFocus );
349 lay-> addWidget ( tb, 5, 1 ); 349 lay-> addWidget ( tb, 5, 1 );
350 connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( ))); 350 connect ( tb, SIGNAL( clicked()), this, SLOT( downExcept()));
351 QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) ); 351 QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) );
352 352
353 lay-> setRowStretch ( 6, 10 ); 353 lay-> setRowStretch ( 6, 10 );
354 lay-> setColStretch ( 0, 10 ); 354 lay-> setColStretch ( 0, 10 );
355 355
356 QStringList sl = cfg. readListEntry ( "NoStyle", ';' ); 356 QStringList sl = cfg. readListEntry ( "NoStyle", ';' );
357 QListViewItem *lvit = 0; 357 QListViewItem *lvit = 0;
358 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 358 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
359 { 359 {
360 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); 360 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
361 361
362 lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 ); 362 lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 );
363 } 363 }
364 364
365 365
366 vertLayout-> addSpacing ( 3 ); 366 vertLayout-> addSpacing ( 3 );
367 QFrame *f = new QFrame ( tab ); 367 QFrame *f = new QFrame ( tab );
368 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); 368 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
369 vertLayout-> addWidget ( f ); 369 vertLayout-> addWidget ( f );
370 vertLayout-> addSpacing ( 3 ); 370 vertLayout-> addSpacing ( 3 );
371 371
372 372
373 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 373 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
374 374
375 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; 375 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
376 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); 376 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" );
377 377
378 QLabel* label = new QLabel( tr( "Tab style:" ), tab ); 378 QLabel* label = new QLabel( tr( "Tab style:" ), tab );
379 gridLayout-> addWidget ( label, 0, 0 ); 379 gridLayout-> addWidget ( label, 0, 0 );
380 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 380 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
381 381
382 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); 382 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
383 btngrp-> hide ( ); 383 btngrp-> hide ( );
384 btngrp-> setExclusive ( true ); 384 btngrp-> setExclusive ( true );
385 385
386 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); 386 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
387 m_tabstyle_list-> insertItem ( tr( "Tabs" )); 387 m_tabstyle_list-> insertItem ( tr( "Tabs" ));
388 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); 388 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
389 m_tabstyle_list-> insertItem ( tr( "Drop down list" )); 389 m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
390 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); 390 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
391 m_tabstyle_list-> setCurrentItem ( style ); 391 m_tabstyle_list-> setCurrentItem ( style );
392 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); 392 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
393 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 393 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
394 394
395 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); 395 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
396 btngrp-> insert ( m_tabstyle_top ); 396 btngrp-> insert ( m_tabstyle_top );
397 gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); 397 gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
398 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); 398 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
@@ -442,97 +442,97 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
442 442
443 if (rotDirection == -1) 443 if (rotDirection == -1)
444 { 444 {
445 rot = ODevice::inst ( )-> direction ( ); 445 rot = ODevice::inst ( )-> direction ( );
446 } 446 }
447 else 447 else
448 { 448 {
449 rot = (ODirection)rotDirection; 449 rot = (ODirection)rotDirection;
450 } 450 }
451 451
452 m_rotdir_cw-> setChecked ( rot == CW ); 452 m_rotdir_cw-> setChecked ( rot == CW );
453 m_rotdir_ccw-> setChecked ( rot == CCW ); 453 m_rotdir_ccw-> setChecked ( rot == CCW );
454 m_rotdir_flip-> setChecked ( rot == Flip ); 454 m_rotdir_flip-> setChecked ( rot == Flip );
455 455
456 return tab; 456 return tab;
457} 457}
458 458
459 459
460Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 460Appearance::Appearance( QWidget* parent, const char* name, WFlags )
461 : QDialog ( parent, name, true, WStyle_ContextHelp ) 461 : QDialog ( parent, name, true, WStyle_ContextHelp )
462{ 462{
463 setCaption( tr( "Appearance Settings" ) ); 463 setCaption( tr( "Appearance Settings" ) );
464 464
465 Config config( "qpe" ); 465 Config config( "qpe" );
466 config.setGroup( "Appearance" ); 466 config.setGroup( "Appearance" );
467 467
468 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); 468 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 );
469 469
470 m_sample = new SampleWindow ( this ); 470 m_sample = new SampleWindow ( this );
471 471
472 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); 472 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
473 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); 473 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
474 474
475 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 475 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
476 QWidget *styletab; 476 QWidget *styletab;
477 477
478 m_color_list = 0; 478 m_color_list = 0;
479 479
480 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); 480 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" ));
481 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); 481 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" ));
482 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); 482 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) );
483 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); 483 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) );
484 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); 484 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) );
485 485
486 top-> addWidget ( tw, 10 ); 486 top-> addWidget ( tw, 10 );
487 top-> addWidget ( m_sample, 1 ); 487 top-> addWidget ( m_sample, 1 );
488 488
489 tw-> setCurrentTab ( styletab ); 489 tw-> setCurrentTab ( styletab );
490 connect ( tw, SIGNAL( currentChanged ( QWidget * )), this, SLOT( tabChanged ( QWidget * ))); 490 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*)));
491 491
492 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; 492 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
493} 493}
494 494
495Appearance::~Appearance() 495Appearance::~Appearance()
496{} 496{}
497 497
498void Appearance::tabChanged ( QWidget *w ) 498void Appearance::tabChanged ( QWidget *w )
499{ 499{
500 if ( w == m_advtab ) 500 if ( w == m_advtab )
501 { 501 {
502 m_sample-> hide ( ); 502 m_sample-> hide ( );
503 updateGeometry ( ); // shouldn't be necessary ... 503 updateGeometry ( ); // shouldn't be necessary ...
504 } 504 }
505 else 505 else
506 m_sample-> show ( ); 506 m_sample-> show ( );
507} 507}
508 508
509void Appearance::accept ( ) 509void Appearance::accept ( )
510{ 510{
511 bool newtabpos = m_tabstyle_top-> isChecked ( ); 511 bool newtabpos = m_tabstyle_top-> isChecked ( );
512 int newtabstyle = m_tabstyle_list-> currentItem ( ); 512 int newtabstyle = m_tabstyle_list-> currentItem ( );
513 513
514 Config config ( "qpe" ); 514 Config config ( "qpe" );
515 config. setGroup ( "Appearance" ); 515 config. setGroup ( "Appearance" );
516 516
517 if ( m_style_changed ) 517 if ( m_style_changed )
518 { 518 {
519 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); 519 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
520 if ( item ) 520 if ( item )
521 config.writeEntry( "Style", item-> key ( )); 521 config.writeEntry( "Style", item-> key ( ));
522 } 522 }
523 523
524 if ( m_deco_changed ) 524 if ( m_deco_changed )
525 { 525 {
526 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); 526 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
527 if ( item ) 527 if ( item )
528 config.writeEntry( "Decoration", item-> key ( )); 528 config.writeEntry( "Decoration", item-> key ( ));
529 } 529 }
530 530
531 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) 531 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
532 { 532 {
533 config. writeEntry ( "TabStyle", newtabstyle + 1 ); 533 config. writeEntry ( "TabStyle", newtabstyle + 1 );
534 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); 534 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" );
535 } 535 }
536 536
537 if ( m_font_changed ) 537 if ( m_font_changed )
538 { 538 {
diff --git a/noncore/settings/appearance2/sample.cpp b/noncore/settings/appearance2/sample.cpp
index b3a9d48..f6c4dca 100644
--- a/noncore/settings/appearance2/sample.cpp
+++ b/noncore/settings/appearance2/sample.cpp
@@ -46,127 +46,127 @@
46class SampleText : public QWidget 46class SampleText : public QWidget
47{ 47{
48public: 48public:
49 SampleText( const QString &t, bool h, QWidget *parent ) 49 SampleText( const QString &t, bool h, QWidget *parent )
50 : QWidget( parent ), hl(h), text(t) 50 : QWidget( parent ), hl(h), text(t)
51 { 51 {
52 if ( hl ) 52 if ( hl )
53 setBackgroundMode( PaletteHighlight ); 53 setBackgroundMode( PaletteHighlight );
54 else 54 else
55 setBackgroundMode( PaletteBase ); 55 setBackgroundMode( PaletteBase );
56 } 56 }
57 57
58 QSize sizeHint() const 58 QSize sizeHint() const
59 { 59 {
60 QFontMetrics fm(font()); 60 QFontMetrics fm(font());
61 return QSize( fm.width(text)+10, fm.height()+4 ); 61 return QSize( fm.width(text)+10, fm.height()+4 );
62 } 62 }
63 63
64 void paintEvent( QPaintEvent * ) 64 void paintEvent( QPaintEvent * )
65 { 65 {
66 QPainter p(this); 66 QPainter p(this);
67 if ( hl ) 67 if ( hl )
68 p.setPen( colorGroup().highlightedText() ); 68 p.setPen( colorGroup().highlightedText() );
69 else 69 else
70 p.setPen( colorGroup().text() ); 70 p.setPen( colorGroup().text() );
71 p.drawText( rect(), AlignCenter, text ); 71 p.drawText( rect(), AlignCenter, text );
72 } 72 }
73 73
74private: 74private:
75 bool hl; 75 bool hl;
76 QString text; 76 QString text;
77}; 77};
78 78
79 79
80SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) 80SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0)
81{ 81{
82 init(); 82 init();
83} 83}
84 84
85QSize SampleWindow::sizeHint() const 85QSize SampleWindow::sizeHint() const
86{ 86{
87 return container->sizeHint() + QSize( 10, 35 ); 87 return container->sizeHint() + QSize( 10, 35 );
88} 88}
89 89
90void SampleWindow::setFont( const QFont &f ) 90void SampleWindow::setFont( const QFont &f )
91{ 91{
92 QWidget::setFont( f ); 92 QWidget::setFont( f );
93 popup->setFont( f ); 93 popup->setFont( f );
94 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 94 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
95} 95}
96 96
97static void setStyleRecursive ( QWidget *w, QStyle *s ) 97static void setStyleRecursive ( QWidget *w, QStyle *s )
98{ 98{
99 w->setStyle( s ); 99 w->setStyle( s );
100 QObjectList *childObjects=(QObjectList*)w->children(); 100 QObjectList *childObjects=(QObjectList*)w->children();
101 if ( childObjects ) { 101 if ( childObjects ) {
102 QObject * o; 102 QObject * o;
103 for(o=childObjects->first();o!=0;o=childObjects->next()) { 103 for(o=childObjects->first();o!=0;o=childObjects->next()) {
104 if( o->isWidgetType() ) { 104 if( o->isWidgetType() ) {
105 setStyleRecursive((QWidget *)o,s); 105 setStyleRecursive((QWidget *)o,s);
106 } 106 }
107 } 107 }
108 } 108 }
109} 109}
110 110
111 111
112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal ) 112void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal )
113{ 113{
114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool); 114 typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, QColorGroup &, bool, bool);
115 115
116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl); 116 extern QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl);
117 117
118 QPixmapCache::clear ( ); 118 QPixmapCache::clear ( );
119 QPalette p = pal; // ette ( ); 119 QPalette p = pal; // ette ( );
120 sty-> polish ( p ); 120 sty-> polish ( p );
121 qt_set_draw_menu_bar_impl ( 0 ); 121 qt_set_draw_menu_bar_impl ( 0 );
122 setStyleRecursive ( this, sty ); 122 setStyleRecursive ( this, sty );
123 setPalette ( p ); 123 setPalette ( p );
124 QTimer::singleShot ( 0, this, SLOT( fixGeometry ( ))); 124 QTimer::singleShot ( 0, this, SLOT( fixGeometry()));
125} 125}
126 126
127 127
128void SampleWindow::setDecoration( WindowDecorationInterface *i ) 128void SampleWindow::setDecoration( WindowDecorationInterface *i )
129{ 129{
130 iface = i; 130 iface = i;
131 wd.rect = QRect( 0, 0, 150, 75 ); 131 wd.rect = QRect( 0, 0, 150, 75 );
132 wd.caption = tr("Sample"); 132 wd.caption = tr("Sample");
133 wd.palette = palette(); 133 wd.palette = palette();
134 wd.flags = WindowDecorationInterface::WindowData::Dialog | 134 wd.flags = WindowDecorationInterface::WindowData::Dialog |
135 WindowDecorationInterface::WindowData::Active; 135 WindowDecorationInterface::WindowData::Active;
136 wd.reserved = 1; 136 wd.reserved = 1;
137 137
138 th = iface->metric(WindowDecorationInterface::TitleHeight, &wd); 138 th = iface->metric(WindowDecorationInterface::TitleHeight, &wd);
139 tb = iface->metric(WindowDecorationInterface::TopBorder, &wd); 139 tb = iface->metric(WindowDecorationInterface::TopBorder, &wd);
140 lb = iface->metric(WindowDecorationInterface::LeftBorder, &wd); 140 lb = iface->metric(WindowDecorationInterface::LeftBorder, &wd);
141 rb = iface->metric(WindowDecorationInterface::RightBorder, &wd); 141 rb = iface->metric(WindowDecorationInterface::RightBorder, &wd);
142 bb = iface->metric(WindowDecorationInterface::BottomBorder, &wd); 142 bb = iface->metric(WindowDecorationInterface::BottomBorder, &wd);
143 143
144 int yoff = th + tb; 144 int yoff = th + tb;
145 int xoff = lb; 145 int xoff = lb;
146 146
147 wd.rect.setX( 0 ); 147 wd.rect.setX( 0 );
148 wd.rect.setWidth( width() - lb - rb ); 148 wd.rect.setWidth( width() - lb - rb );
149 wd.rect.setY( 0 ); 149 wd.rect.setY( 0 );
150 wd.rect.setHeight( height() - yoff - bb ); 150 wd.rect.setHeight( height() - yoff - bb );
151 151
152 container->setGeometry( xoff, yoff, wd.rect.width(), wd.rect.height() ); 152 container->setGeometry( xoff, yoff, wd.rect.width(), wd.rect.height() );
153 setMinimumSize( container->sizeHint().width()+lb+rb, 153 setMinimumSize( container->sizeHint().width()+lb+rb,
154 container->sizeHint().height()+tb+th+bb ); 154 container->sizeHint().height()+tb+th+bb );
155} 155}
156 156
157void SampleWindow::paintEvent( QPaintEvent * ) 157void SampleWindow::paintEvent( QPaintEvent * )
158{ 158{
159 if ( !iface ) 159 if ( !iface )
160 return; 160 return;
161 161
162 QPainter p( this ); 162 QPainter p( this );
163 163
164 p.translate( lb, th+tb ); 164 p.translate( lb, th+tb );
165 165
166 iface->drawArea(WindowDecorationInterface::Border, &p, &wd); 166 iface->drawArea(WindowDecorationInterface::Border, &p, &wd);
167 iface->drawArea(WindowDecorationInterface::Title, &p, &wd); 167 iface->drawArea(WindowDecorationInterface::Title, &p, &wd);
168 168
169 p.setPen(palette().active().color(QColorGroup::HighlightedText)); 169 p.setPen(palette().active().color(QColorGroup::HighlightedText));
170 QFont f( font() ); 170 QFont f( font() );
171 f.setWeight( QFont::Bold ); 171 f.setWeight( QFont::Bold );
172 p.setFont(f); 172 p.setFont(f);
diff --git a/noncore/settings/aqpkg/inputdlg.cpp b/noncore/settings/aqpkg/inputdlg.cpp
index 06e934c..30f0527 100644
--- a/noncore/settings/aqpkg/inputdlg.cpp
+++ b/noncore/settings/aqpkg/inputdlg.cpp
@@ -30,98 +30,98 @@
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qspinbox.h> 34#include <qspinbox.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qwidgetstack.h> 36#include <qwidgetstack.h>
37#include <qvalidator.h> 37#include <qvalidator.h>
38#include <qapplication.h> 38#include <qapplication.h>
39 39
40#include "inputdlg.h" 40#include "inputdlg.h"
41#include "global.h" 41#include "global.h"
42 42
43 43
44InputDialog :: InputDialog( const QString &label, QWidget* parent, const char* name, 44InputDialog :: InputDialog( const QString &label, QWidget* parent, const char* name,
45 bool modal ) 45 bool modal )
46 : QDialog( parent, name, modal ) 46 : QDialog( parent, name, modal )
47{ 47{
48 lineEdit = 0; 48 lineEdit = 0;
49 49
50 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); 50 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
51 51
52 QLabel* l = new QLabel( label, this ); 52 QLabel* l = new QLabel( label, this );
53 vbox->addWidget( l ); 53 vbox->addWidget( l );
54 54
55 lineEdit = new QLineEdit( this ); 55 lineEdit = new QLineEdit( this );
56 vbox->addWidget( lineEdit ); 56 vbox->addWidget( lineEdit );
57 57
58 QHBoxLayout *hbox = new QHBoxLayout( 6 ); 58 QHBoxLayout *hbox = new QHBoxLayout( 6 );
59 vbox->addLayout( hbox, AlignRight ); 59 vbox->addLayout( hbox, AlignRight );
60 60
61 ok = new QPushButton( tr( "&OK" ), this ); 61 ok = new QPushButton( tr( "&OK" ), this );
62 ok->setDefault( TRUE ); 62 ok->setDefault( TRUE );
63 QPushButton *cancel = new QPushButton( tr( "&Cancel" ), this ); 63 QPushButton *cancel = new QPushButton( tr( "&Cancel" ), this );
64 64
65 QSize bs( ok->sizeHint() ); 65 QSize bs( ok->sizeHint() );
66 if ( cancel->sizeHint().width() > bs.width() ) 66 if ( cancel->sizeHint().width() > bs.width() )
67 bs.setWidth( cancel->sizeHint().width() ); 67 bs.setWidth( cancel->sizeHint().width() );
68 68
69 ok->setFixedSize( bs ); 69 ok->setFixedSize( bs );
70 cancel->setFixedSize( bs ); 70 cancel->setFixedSize( bs );
71 71
72 hbox->addWidget( new QWidget( this ) ); 72 hbox->addWidget( new QWidget( this ) );
73 hbox->addWidget( ok ); 73 hbox->addWidget( ok );
74 hbox->addWidget( cancel ); 74 hbox->addWidget( cancel );
75 75
76 connect( lineEdit, SIGNAL( returnPressed() ), 76 connect( lineEdit, SIGNAL( returnPressed() ),
77 this, SLOT( tryAccept() ) ); 77 this, SLOT( tryAccept() ) );
78 connect( lineEdit, SIGNAL( textChanged( const QString & ) ), 78 connect( lineEdit, SIGNAL( textChanged(const QString&) ),
79 this, SLOT( textChanged( const QString & ) ) ); 79 this, SLOT( textChanged(const QString&) ) );
80 80
81 connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); 81 connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) );
82 connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); 82 connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
83 83
84 resize( QMAX( sizeHint().width(), 240 ), sizeHint().height() ); 84 resize( QMAX( sizeHint().width(), 240 ), sizeHint().height() );
85} 85}
86 86
87/*! 87/*!
88 Destructor. 88 Destructor.
89*/ 89*/
90 90
91InputDialog::~InputDialog() 91InputDialog::~InputDialog()
92{ 92{
93} 93}
94 94
95void InputDialog :: setText( const QString &text ) 95void InputDialog :: setText( const QString &text )
96{ 96{
97 lineEdit->setText( text ); 97 lineEdit->setText( text );
98 lineEdit->selectAll(); 98 lineEdit->selectAll();
99} 99}
100 100
101QString InputDialog :: getText() 101QString InputDialog :: getText()
102{ 102{
103 return lineEdit->text(); 103 return lineEdit->text();
104} 104}
105 105
106QString InputDialog::getText( const QString &caption, const QString &label, 106QString InputDialog::getText( const QString &caption, const QString &label,
107 const QString &text, bool *ok, QWidget *parent, 107 const QString &text, bool *ok, QWidget *parent,
108 const char *name ) 108 const char *name )
109{ 109{
110 InputDialog *dlg = new InputDialog( label, parent, name, true ); 110 InputDialog *dlg = new InputDialog( label, parent, name, true );
111 dlg->setCaption( caption ); 111 dlg->setCaption( caption );
112 dlg->setText( text ); 112 dlg->setText( text );
113 113
114 QString result; 114 QString result;
115 *ok = dlg->exec() == QDialog::Accepted; 115 *ok = dlg->exec() == QDialog::Accepted;
116 if ( *ok ) 116 if ( *ok )
117 result = dlg->getText(); 117 result = dlg->getText();
118 118
119 delete dlg; 119 delete dlg;
120 return result; 120 return result;
121} 121}
122 122
123 123
124 124
125void InputDialog :: textChanged( const QString &s ) 125void InputDialog :: textChanged( const QString &s )
126{ 126{
127 ok->setEnabled( !s.isEmpty() ); 127 ok->setEnabled( !s.isEmpty() );
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index d927a36..d2babb4 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -127,98 +127,98 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag
127 else if ( item->option == "D" ) 127 else if ( item->option == "D" )
128 { 128 {
129 remove.append( QString( " %1\n" ).arg( item->packageName ) ); 129 remove.append( QString( " %1\n" ).arg( item->packageName ) );
130 } 130 }
131 else if ( item->option == "U" || item->option == "R" ) 131 else if ( item->option == "U" || item->option == "R" )
132 { 132 {
133 QString type; 133 QString type;
134 if ( item->option == "R" ) 134 if ( item->option == "R" )
135 type = tr( "(ReInstall)" ); 135 type = tr( "(ReInstall)" );
136 else 136 else
137 type = tr( "(Upgrade)" ); 137 type = tr( "(Upgrade)" );
138 upgrade.append( QString( " %1 %2\n" ).arg( item->packageName ).arg( type ) ); 138 upgrade.append( QString( " %1 %2\n" ).arg( item->packageName ).arg( type ) );
139 } 139 }
140 } 140 }
141 141
142 output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) ); 142 output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) );
143 143
144 displayAvailableSpace( destination->currentText() ); 144 displayAvailableSpace( destination->currentText() );
145} 145}
146 146
147InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *title ) 147InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *title )
148 : QWidget( 0, 0, 0 ) 148 : QWidget( 0, 0, 0 )
149{ 149{
150 setCaption( title ); 150 setCaption( title );
151 init( FALSE ); 151 init( FALSE );
152 pIpkg = ipkg; 152 pIpkg = ipkg;
153 output->setText( initialText ); 153 output->setText( initialText );
154} 154}
155 155
156 156
157InstallDlgImpl::~InstallDlgImpl() 157InstallDlgImpl::~InstallDlgImpl()
158{ 158{
159 if ( pIpkg ) 159 if ( pIpkg )
160 delete pIpkg; 160 delete pIpkg;
161} 161}
162 162
163void InstallDlgImpl :: init( bool displayextrainfo ) 163void InstallDlgImpl :: init( bool displayextrainfo )
164{ 164{
165 QGridLayout *layout = new QGridLayout( this ); 165 QGridLayout *layout = new QGridLayout( this );
166 layout->setSpacing( 4 ); 166 layout->setSpacing( 4 );
167 layout->setMargin( 4 ); 167 layout->setMargin( 4 );
168 168
169 if ( displayextrainfo ) 169 if ( displayextrainfo )
170 { 170 {
171 QLabel *label = new QLabel( tr( "Destination" ), this ); 171 QLabel *label = new QLabel( tr( "Destination" ), this );
172 layout->addWidget( label, 0, 0 ); 172 layout->addWidget( label, 0, 0 );
173 destination = new QComboBox( FALSE, this ); 173 destination = new QComboBox( FALSE, this );
174 layout->addWidget( destination, 0, 1 ); 174 layout->addWidget( destination, 0, 1 );
175 connect( destination, SIGNAL( highlighted( const QString & ) ), 175 connect( destination, SIGNAL( highlighted(const QString&) ),
176 this, SLOT( displayAvailableSpace( const QString & ) ) ); 176 this, SLOT( displayAvailableSpace(const QString&) ) );
177 177
178 QLabel *label2 = new QLabel( tr( "Space Avail" ), this ); 178 QLabel *label2 = new QLabel( tr( "Space Avail" ), this );
179 layout->addWidget( label2, 1, 0 ); 179 layout->addWidget( label2, 1, 0 );
180 txtAvailableSpace = new QLabel( "", this ); 180 txtAvailableSpace = new QLabel( "", this );
181 layout->addWidget( txtAvailableSpace, 1, 1 ); 181 layout->addWidget( txtAvailableSpace, 1, 1 );
182 } 182 }
183 else 183 else
184 { 184 {
185 destination = 0x0; 185 destination = 0x0;
186 txtAvailableSpace = 0x0; 186 txtAvailableSpace = 0x0;
187 } 187 }
188 188
189 QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); 189 QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this );
190 GroupBox2->layout()->setSpacing( 0 ); 190 GroupBox2->layout()->setSpacing( 0 );
191 GroupBox2->layout()->setMargin( 4 ); 191 GroupBox2->layout()->setMargin( 4 );
192 192
193 QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() ); 193 QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() );
194 output = new QMultiLineEdit( GroupBox2 ); 194 output = new QMultiLineEdit( GroupBox2 );
195 GroupBox2Layout->addWidget( output ); 195 GroupBox2Layout->addWidget( output );
196 layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); 196 layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 );
197 197
198 btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this ); 198 btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this );
199 layout->addWidget( btnInstall, 3, 0 ); 199 layout->addWidget( btnInstall, 3, 0 );
200 connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); 200 connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) );
201 201
202 btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); 202 btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this );
203 layout->addWidget( btnOptions, 3, 1 ); 203 layout->addWidget( btnOptions, 3, 1 );
204 connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); 204 connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) );
205} 205}
206 206
207void InstallDlgImpl :: optionsSelected() 207void InstallDlgImpl :: optionsSelected()
208{ 208{
209 if ( btnOptions->text() == tr( "Options" ) ) 209 if ( btnOptions->text() == tr( "Options" ) )
210 { 210 {
211 InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); 211 InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true );
212 if ( opt.exec() == QDialog::Accepted ) 212 if ( opt.exec() == QDialog::Accepted )
213 { 213 {
214 // set options selected from dialog 214 // set options selected from dialog
215 flags = opt.getFlags(); 215 flags = opt.getFlags();
216 infoLevel = opt.getInfoLevel(); 216 infoLevel = opt.getInfoLevel();
217 217
218#ifdef QWS 218#ifdef QWS
219 Config cfg( "aqpkg" ); 219 Config cfg( "aqpkg" );
220 cfg.setGroup( "settings" ); 220 cfg.setGroup( "settings" );
221 cfg.writeEntry( "installFlags", flags ); 221 cfg.writeEntry( "installFlags", flags );
222 cfg.writeEntry( "infoLevel", infoLevel ); 222 cfg.writeEntry( "infoLevel", infoLevel );
223#endif 223#endif
224 } 224 }
@@ -233,119 +233,119 @@ void InstallDlgImpl :: optionsSelected()
233 text << "*"; 233 text << "*";
234 map.insert( tr( "All" ), text ); 234 map.insert( tr( "All" ), text );
235 235
236 QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); 236 QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
237 if( !filename.isEmpty() ) 237 if( !filename.isEmpty() )
238 { 238 {
239 QString currentFileName = QFileInfo( filename ).fileName(); 239 QString currentFileName = QFileInfo( filename ).fileName();
240 DocLnk doc; 240 DocLnk doc;
241 doc.setType( "text/plain" ); 241 doc.setType( "text/plain" );
242 doc.setFile( filename ); 242 doc.setFile( filename );
243 doc.setName( currentFileName ); 243 doc.setName( currentFileName );
244 FileManager fm; 244 FileManager fm;
245 fm.saveFile( doc, output->text() ); 245 fm.saveFile( doc, output->text() );
246 } 246 }
247 } 247 }
248} 248}
249 249
250void InstallDlgImpl :: installSelected() 250void InstallDlgImpl :: installSelected()
251{ 251{
252 if ( btnInstall->text() == tr( "Abort" ) ) 252 if ( btnInstall->text() == tr( "Abort" ) )
253 { 253 {
254 if ( pIpkg ) 254 if ( pIpkg )
255 { 255 {
256 displayText( tr( "\n**** User Clicked ABORT ***" ) ); 256 displayText( tr( "\n**** User Clicked ABORT ***" ) );
257 pIpkg->abort(); 257 pIpkg->abort();
258 displayText( tr( "**** Process Aborted ****" ) ); 258 displayText( tr( "**** Process Aborted ****" ) );
259 } 259 }
260 260
261 btnInstall->setText( tr( "Close" ) ); 261 btnInstall->setText( tr( "Close" ) );
262 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); 262 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
263 return; 263 return;
264 } 264 }
265 else if ( btnInstall->text() == tr( "Close" ) ) 265 else if ( btnInstall->text() == tr( "Close" ) )
266 { 266 {
267 emit reloadData( this ); 267 emit reloadData( this );
268 return; 268 return;
269 } 269 }
270 270
271 // Disable buttons 271 // Disable buttons
272 btnOptions->setEnabled( false ); 272 btnOptions->setEnabled( false );
273// btnInstall->setEnabled( false ); 273// btnInstall->setEnabled( false );
274 274
275 btnInstall->setText( tr( "Abort" ) ); 275 btnInstall->setText( tr( "Abort" ) );
276 btnInstall->setIconSet( Resource::loadPixmap( "close" ) ); 276 btnInstall->setIconSet( Resource::loadPixmap( "close" ) );
277 277
278 if ( pIpkg ) 278 if ( pIpkg )
279 { 279 {
280 output->setText( "" ); 280 output->setText( "" );
281 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 281 connect( pIpkg, SIGNAL(outputText(const QString&)), this, SLOT(displayText(const QString&)));
282 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished())); 282 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
283 pIpkg->runIpkg(); 283 pIpkg->runIpkg();
284 } 284 }
285 else 285 else
286 { 286 {
287 output->setText( "" ); 287 output->setText( "" );
288 Destination *d = dataMgr->getDestination( destination->currentText() ); 288 Destination *d = dataMgr->getDestination( destination->currentText() );
289 QString dest = d->getDestinationName(); 289 QString dest = d->getDestinationName();
290 QString destDir = d->getDestinationPath(); 290 QString destDir = d->getDestinationPath();
291 int instFlags = flags; 291 int instFlags = flags;
292 if ( d->linkToRoot() ) 292 if ( d->linkToRoot() )
293 instFlags |= MAKE_LINKS; 293 instFlags |= MAKE_LINKS;
294 294
295#ifdef QWS 295#ifdef QWS
296 // Save settings 296 // Save settings
297 Config cfg( "aqpkg" ); 297 Config cfg( "aqpkg" );
298 cfg.setGroup( "settings" ); 298 cfg.setGroup( "settings" );
299 cfg.writeEntry( "dest", dest ); 299 cfg.writeEntry( "dest", dest );
300#endif 300#endif
301 301
302 pIpkg = new Ipkg; 302 pIpkg = new Ipkg;
303 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 303 connect( pIpkg, SIGNAL(outputText(const QString&)), this, SLOT(displayText(const QString&)));
304 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished())); 304 connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished()));
305 305
306 firstPackage = TRUE; 306 firstPackage = TRUE;
307 ipkgFinished(); 307 ipkgFinished();
308 308
309 // First run through the remove list, then the install list then the upgrade list 309 // First run through the remove list, then the install list then the upgrade list
310/* 310/*
311 pIpkg->setOption( "remove" ); 311 pIpkg->setOption( "remove" );
312 QListIterator<InstallData> it( removeList ); 312 QListIterator<InstallData> it( removeList );
313 InstallData *idata; 313 InstallData *idata;
314 for ( ; it.current(); ++it ) 314 for ( ; it.current(); ++it )
315 { 315 {
316 idata = it.current(); 316 idata = it.current();
317 pIpkg->setDestination( idata->destination->getDestinationName() ); 317 pIpkg->setDestination( idata->destination->getDestinationName() );
318 pIpkg->setDestinationDir( idata->destination->getDestinationPath() ); 318 pIpkg->setDestinationDir( idata->destination->getDestinationPath() );
319 pIpkg->setPackage( idata->packageName ); 319 pIpkg->setPackage( idata->packageName );
320 320
321 int tmpFlags = flags; 321 int tmpFlags = flags;
322 if ( idata->destination->linkToRoot() ) 322 if ( idata->destination->linkToRoot() )
323 tmpFlags |= MAKE_LINKS; 323 tmpFlags |= MAKE_LINKS;
324 324
325 pIpkg->setFlags( tmpFlags, infoLevel ); 325 pIpkg->setFlags( tmpFlags, infoLevel );
326 pIpkg->runIpkg(); 326 pIpkg->runIpkg();
327 } 327 }
328 328
329 pIpkg->setOption( "install" ); 329 pIpkg->setOption( "install" );
330 pIpkg->setDestination( dest ); 330 pIpkg->setDestination( dest );
331 pIpkg->setDestinationDir( destDir ); 331 pIpkg->setDestinationDir( destDir );
332 pIpkg->setFlags( instFlags, infoLevel ); 332 pIpkg->setFlags( instFlags, infoLevel );
333 QListIterator<InstallData> it2( installList ); 333 QListIterator<InstallData> it2( installList );
334 for ( ; it2.current(); ++it2 ) 334 for ( ; it2.current(); ++it2 )
335 { 335 {
336 pIpkg->setPackage( it2.current()->packageName ); 336 pIpkg->setPackage( it2.current()->packageName );
337 pIpkg->runIpkg(); 337 pIpkg->runIpkg();
338 } 338 }
339 339
340 flags |= FORCE_REINSTALL; 340 flags |= FORCE_REINSTALL;
341 QListIterator<InstallData> it3( updateList ); 341 QListIterator<InstallData> it3( updateList );
342 for ( ; it3.current() ; ++it3 ) 342 for ( ; it3.current() ; ++it3 )
343 { 343 {
344 idata = it3.current(); 344 idata = it3.current();
345 if ( idata->option == "R" ) 345 if ( idata->option == "R" )
346 pIpkg->setOption( "reinstall" ); 346 pIpkg->setOption( "reinstall" );
347 else 347 else
348 pIpkg->setOption( "upgrade" ); 348 pIpkg->setOption( "upgrade" );
349 pIpkg->setDestination( idata->destination->getDestinationName() ); 349 pIpkg->setDestination( idata->destination->getDestinationName() );
350 pIpkg->setDestinationDir( idata->destination->getDestinationPath() ); 350 pIpkg->setDestinationDir( idata->destination->getDestinationPath() );
351 pIpkg->setPackage( idata->packageName ); 351 pIpkg->setPackage( idata->packageName );
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 3761b67..866afed 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -243,104 +243,104 @@ void Ipkg :: removeStatusEntry()
243 value = value.stripWhiteSpace(); 243 value = value.stripWhiteSpace();
244 } else { 244 } else {
245 key = ""; 245 key = "";
246 value = ""; 246 value = "";
247 } 247 }
248 248
249 if ( key == "Package" && value == package ) 249 if ( key == "Package" && value == package )
250 { 250 {
251 //skip lines from the deleted package 251 //skip lines from the deleted package
252 while ( ( !readStream.atEnd() ) && ( line.stripWhiteSpace() != "" ) ) 252 while ( ( !readStream.atEnd() ) && ( line.stripWhiteSpace() != "" ) )
253 { 253 {
254 line = readStream.readLine(); 254 line = readStream.readLine();
255 } 255 }
256 } else { 256 } else {
257 257
258 //write other lines into the tempfile 258 //write other lines into the tempfile
259 writeStream << line << "\n"; 259 writeStream << line << "\n";
260 260
261 // Improve UI responsiveness 261 // Improve UI responsiveness
262 i++; 262 i++;
263 if ( ( i % 50 ) == 0 ) 263 if ( ( i % 50 ) == 0 )
264 qApp->processEvents(); 264 qApp->processEvents();
265 } 265 }
266 } 266 }
267 267
268 readFile.close(); 268 readFile.close();
269 writeFile.close(); 269 writeFile.close();
270 270
271 // Remove old status file and put tmp stats file in its place 271 // Remove old status file and put tmp stats file in its place
272 remove( statusFile ); 272 remove( statusFile );
273 rename( outStatusFile, statusFile ); 273 rename( outStatusFile, statusFile );
274 } 274 }
275 275
276int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) 276int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
277{ 277{
278 // If one is already running - should never be but just to be safe 278 // If one is already running - should never be but just to be safe
279 if ( proc ) 279 if ( proc )
280 { 280 {
281 delete proc; 281 delete proc;
282 proc = 0; 282 proc = 0;
283 } 283 }
284 284
285 // OK we're gonna use OProcess to run this thing 285 // OK we're gonna use OProcess to run this thing
286 proc = new OProcess(); 286 proc = new OProcess();
287 aborted = false; 287 aborted = false;
288 288
289 289
290 // Connect up our slots 290 // Connect up our slots
291 connect(proc, SIGNAL(processExited(OProcess *)), 291 connect(proc, SIGNAL(processExited(OProcess*)),
292 this, SLOT( processFinished())); 292 this, SLOT( processFinished()));
293 293
294 connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), 294 connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
295 this, SLOT(commandStdout(OProcess *, char *, int))); 295 this, SLOT(commandStdout(OProcess*,char*,int)));
296 296
297 connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), 297 connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
298 this, SLOT(commandStderr(OProcess *, char *, int))); 298 this, SLOT(commandStderr(OProcess*,char*,int)));
299 299
300 for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) 300 for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it )
301 { 301 {
302 *proc << (*it).latin1(); 302 *proc << (*it).latin1();
303 } 303 }
304 304
305 // Start the process going 305 // Start the process going
306 finished = false; 306 finished = false;
307 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) 307 if(!proc->start(OProcess::NotifyOnExit, OProcess::All))
308 { 308 {
309 emit outputText( tr("Couldn't start ipkg process" ) ); 309 emit outputText( tr("Couldn't start ipkg process" ) );
310 } 310 }
311} 311}
312 312
313void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) 313void Ipkg::commandStdout(OProcess*, char *buffer, int buflen)
314{ 314{
315 QString lineStr = buffer; 315 QString lineStr = buffer;
316 if ( lineStr[buflen-1] == '\n' ) 316 if ( lineStr[buflen-1] == '\n' )
317 buflen --; 317 buflen --;
318 lineStr = lineStr.left( buflen ); 318 lineStr = lineStr.left( buflen );
319 emit outputText( lineStr ); 319 emit outputText( lineStr );
320 320
321 // check if we are installing dependant packages 321 // check if we are installing dependant packages
322 if ( option == "install" || option == "reinstall" ) 322 if ( option == "install" || option == "reinstall" )
323 { 323 {
324 // Need to keep track of any dependant packages that get installed 324 // Need to keep track of any dependant packages that get installed
325 // so that we can create links to them as necessary 325 // so that we can create links to them as necessary
326 if ( lineStr.startsWith( "Installing " ) ) 326 if ( lineStr.startsWith( "Installing " ) )
327 { 327 {
328 int start = lineStr.find( " " ) + 1; 328 int start = lineStr.find( " " ) + 1;
329 int end = lineStr.find( " ", start ); 329 int end = lineStr.find( " ", start );
330 QString *package = new QString( lineStr.mid( start, end-start ) ); 330 QString *package = new QString( lineStr.mid( start, end-start ) );
331 dependantPackages->append( package ); 331 dependantPackages->append( package );
332 } 332 }
333 } 333 }
334 else if ( option == "remove" && !( flags & FORCE_DEPENDS ) && 334 else if ( option == "remove" && !( flags & FORCE_DEPENDS ) &&
335 lineStr.find( "is depended upon by packages:" ) != -1 ) 335 lineStr.find( "is depended upon by packages:" ) != -1 )
336 { 336 {
337 // Ipkg should send this to STDERR, but doesn't - so trap here 337 // Ipkg should send this to STDERR, but doesn't - so trap here
338 error = true; 338 error = true;
339 } 339 }
340 340
341 buffer[0] = '\0'; 341 buffer[0] = '\0';
342} 342}
343 343
344void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) 344void Ipkg::commandStderr(OProcess*, char *buffer, int buflen)
345{ 345{
346 QString lineStr = buffer; 346 QString lineStr = buffer;
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 6f5c712..6b31cd1 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -55,114 +55,114 @@
55#include <qlayout.h> 55#include <qlayout.h>
56#include <qlineedit.h> 56#include <qlineedit.h>
57#include <qlistview.h> 57#include <qlistview.h>
58#include <qmenubar.h> 58#include <qmenubar.h>
59#include <qmessagebox.h> 59#include <qmessagebox.h>
60#include <qpopupmenu.h> 60#include <qpopupmenu.h>
61#include <qprogressbar.h> 61#include <qprogressbar.h>
62#include <qtimer.h> 62#include <qtimer.h>
63#include <qwhatsthis.h> 63#include <qwhatsthis.h>
64#include <qwidgetstack.h> 64#include <qwidgetstack.h>
65 65
66/* STD */ 66/* STD */
67#include <linux/limits.h> 67#include <linux/limits.h>
68#include <unistd.h> 68#include <unistd.h>
69 69
70extern int compareVersions( const char *v1, const char *v2 ); 70extern int compareVersions( const char *v1, const char *v2 );
71 71
72MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) 72MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
73 :QMainWindow( parent, name, fl || WStyle_ContextHelp ) 73 :QMainWindow( parent, name, fl || WStyle_ContextHelp )
74{ 74{
75 // Disable suspend mode 75 // Disable suspend mode
76 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 76 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
77 77
78 LOCAL_SERVER = QObject::tr( "Installed packages" ); 78 LOCAL_SERVER = QObject::tr( "Installed packages" );
79 LOCAL_IPKGS = QObject::tr( "Local packages" ); 79 LOCAL_IPKGS = QObject::tr( "Local packages" );
80 80
81 setCaption( tr( "AQPkg - Package Manager" ) ); 81 setCaption( tr( "AQPkg - Package Manager" ) );
82 82
83 // Create UI widgets 83 // Create UI widgets
84 initMainWidget(); 84 initMainWidget();
85 initProgressWidget(); 85 initProgressWidget();
86 86
87 // Build menu and tool bars 87 // Build menu and tool bars
88 setToolBarsMovable( FALSE ); 88 setToolBarsMovable( FALSE );
89 89
90 QToolBar *bar = new QToolBar( this ); 90 QToolBar *bar = new QToolBar( this );
91 bar->setHorizontalStretchable( TRUE ); 91 bar->setHorizontalStretchable( TRUE );
92 QMenuBar *mb = new QMenuBar( bar ); 92 QMenuBar *mb = new QMenuBar( bar );
93 mb->setMargin( 0 ); 93 mb->setMargin( 0 );
94 bar = new QToolBar( this ); 94 bar = new QToolBar( this );
95 95
96 // Find toolbar 96 // Find toolbar
97 findBar = new QToolBar( this ); 97 findBar = new QToolBar( this );
98 addToolBar( findBar, QMainWindow::Top, true ); 98 addToolBar( findBar, QMainWindow::Top, true );
99 findBar->setHorizontalStretchable( true ); 99 findBar->setHorizontalStretchable( true );
100 findEdit = new QLineEdit( findBar ); 100 findEdit = new QLineEdit( findBar );
101 QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); 101 QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) );
102 findBar->setStretchableWidget( findEdit ); 102 findBar->setStretchableWidget( findEdit );
103 connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); 103 connect( findEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( findPackage(const QString&) ) );
104 104
105 // Quick jump toolbar 105 // Quick jump toolbar
106 jumpBar = new QToolBar( this ); 106 jumpBar = new QToolBar( this );
107 addToolBar( jumpBar, QMainWindow::Top, true ); 107 addToolBar( jumpBar, QMainWindow::Top, true );
108 jumpBar->setHorizontalStretchable( true ); 108 jumpBar->setHorizontalStretchable( true );
109 QWidget *w = new QWidget( jumpBar ); 109 QWidget *w = new QWidget( jumpBar );
110 jumpBar->setStretchableWidget( w ); 110 jumpBar->setStretchableWidget( w );
111 111
112 QGridLayout *layout = new QGridLayout( w ); 112 QGridLayout *layout = new QGridLayout( w );
113 113
114 char text[2]; 114 char text[2];
115 text[1] = '\0'; 115 text[1] = '\0';
116 for ( int i = 0 ; i < 26 ; ++i ) 116 for ( int i = 0 ; i < 26 ; ++i )
117 { 117 {
118 text[0] = 'A' + i; 118 text[0] = 'A' + i;
119 LetterPushButton *b = new LetterPushButton( text, w ); 119 LetterPushButton *b = new LetterPushButton( text, w );
120 connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); 120 connect( b, SIGNAL( released(QString) ), this, SLOT( letterPushed(QString) ) );
121 layout->addWidget( b, i / 13, i % 13); 121 layout->addWidget( b, i / 13, i % 13);
122 } 122 }
123 123
124 QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); 124 QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 );
125 a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); 125 a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) );
126 connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); 126 connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) );
127 a->addTo( jumpBar ); 127 a->addTo( jumpBar );
128 jumpBar->hide(); 128 jumpBar->hide();
129 129
130 // Packages menu 130 // Packages menu
131 QPopupMenu *popup = new QPopupMenu( this ); 131 QPopupMenu *popup = new QPopupMenu( this );
132 132
133 a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); 133 a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 );
134 a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); 134 a->setWhatsThis( tr( "Click here to update package lists from servers." ) );
135 connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); 135 connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) );
136 a->addTo( popup ); 136 a->addTo( popup );
137 a->addTo( bar ); 137 a->addTo( bar );
138 138
139 actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); 139 actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 );
140 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); 140 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) );
141 connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); 141 connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) );
142 actionUpgrade->addTo( popup ); 142 actionUpgrade->addTo( popup );
143 actionUpgrade->addTo( bar ); 143 actionUpgrade->addTo( bar );
144 144
145 iconDownload = Resource::loadPixmap( "aqpkg/download" ); 145 iconDownload = Resource::loadPixmap( "aqpkg/download" );
146 iconRemove = Resource::loadPixmap( "aqpkg/remove" ); 146 iconRemove = Resource::loadPixmap( "aqpkg/remove" );
147 actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); 147 actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
148 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); 148 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) );
149 connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); 149 connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) );
150 actionDownload->addTo( popup ); 150 actionDownload->addTo( popup );
151 actionDownload->addTo( bar ); 151 actionDownload->addTo( bar );
152 152
153 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); 153 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 );
154 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); 154 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) );
155 connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); 155 connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) );
156 a->addTo( popup ); 156 a->addTo( popup );
157 a->addTo( bar ); 157 a->addTo( bar );
158 158
159 popup->insertSeparator(); 159 popup->insertSeparator();
160 160
161 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 161 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
162 a->setWhatsThis( tr( "Click here to configure this application." ) ); 162 a->setWhatsThis( tr( "Click here to configure this application." ) );
163 connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); 163 connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) );
164 a->addTo( popup ); 164 a->addTo( popup );
165 mb->insertItem( tr( "Actions" ), popup ); 165 mb->insertItem( tr( "Actions" ), popup );
166 166
167 // View menu 167 // View menu
168 popup = new QPopupMenu( this ); 168 popup = new QPopupMenu( this );
@@ -220,141 +220,141 @@ MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
220 connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); 220 connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) );
221 a->addTo( popup ); 221 a->addTo( popup );
222 222
223 mb->insertItem( tr( "View" ), popup ); 223 mb->insertItem( tr( "View" ), popup );
224 224
225 // Finish find toolbar creation 225 // Finish find toolbar creation
226 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 226 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
227 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); 227 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) );
228 connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); 228 connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) );
229 a->addTo( findBar ); 229 a->addTo( findBar );
230 findBar->hide(); 230 findBar->hide();
231 231
232 // Create widget stack and add UI widgets 232 // Create widget stack and add UI widgets
233 stack = new QWidgetStack( this ); 233 stack = new QWidgetStack( this );
234 stack->addWidget( progressWindow, 2 ); 234 stack->addWidget( progressWindow, 2 );
235 stack->addWidget( networkPkgWindow, 1 ); 235 stack->addWidget( networkPkgWindow, 1 );
236 setCentralWidget( stack ); 236 setCentralWidget( stack );
237 stack->raiseWidget( progressWindow ); 237 stack->raiseWidget( progressWindow );
238 238
239 // Delayed call to finish initialization 239 // Delayed call to finish initialization
240 QTimer::singleShot( 100, this, SLOT( init() ) ); 240 QTimer::singleShot( 100, this, SLOT( init() ) );
241} 241}
242 242
243MainWindow :: ~MainWindow() 243MainWindow :: ~MainWindow()
244{ 244{
245 delete mgr; 245 delete mgr;
246 246
247 // Reenable suspend mode 247 // Reenable suspend mode
248 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 248 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
249} 249}
250 250
251void MainWindow :: initMainWidget() 251void MainWindow :: initMainWidget()
252{ 252{
253 networkPkgWindow = new QWidget( this ); 253 networkPkgWindow = new QWidget( this );
254 254
255 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); 255 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow );
256 256
257 serversList = new QComboBox( networkPkgWindow ); 257 serversList = new QComboBox( networkPkgWindow );
258 connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) ); 258 connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) );
259 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); 259 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) );
260 260
261 installedIcon = Resource::loadPixmap( "installed" ); 261 installedIcon = Resource::loadPixmap( "installed" );
262 updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); 262 updatedIcon = Resource::loadPixmap( "aqpkg/updated" );
263 263
264 packagesList = new QListView( networkPkgWindow ); 264 packagesList = new QListView( networkPkgWindow );
265 packagesList->addColumn( tr( "Packages" ), 225 ); 265 packagesList->addColumn( tr( "Packages" ), 225 );
266 QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); 266 QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) );
267 QPEApplication::setStylusOperation( packagesList->viewport(), QPEApplication::RightOnHold ); 267 QPEApplication::setStylusOperation( packagesList->viewport(), QPEApplication::RightOnHold );
268 connect( packagesList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), 268 connect( packagesList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),
269 this, SLOT(slotDisplayPackage(QListViewItem *)) ); 269 this, SLOT(slotDisplayPackage(QListViewItem*)) );
270 270
271 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); 271 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 );
272 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); 272 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 );
273 hbox1->addWidget( l ); 273 hbox1->addWidget( l );
274 hbox1->addWidget( serversList ); 274 hbox1->addWidget( serversList );
275 275
276 vbox->addWidget( packagesList ); 276 vbox->addWidget( packagesList );
277 277
278 downloadEnabled = TRUE; 278 downloadEnabled = TRUE;
279} 279}
280 280
281void MainWindow :: initProgressWidget() 281void MainWindow :: initProgressWidget()
282{ 282{
283 progressWindow = new QWidget( this ); 283 progressWindow = new QWidget( this );
284 284
285 QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); 285 QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 );
286 286
287 m_status = new QLabel( progressWindow ); 287 m_status = new QLabel( progressWindow );
288 m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 288 m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
289 layout->addWidget( m_status ); 289 layout->addWidget( m_status );
290 290
291 m_progress = new QProgressBar( progressWindow ); 291 m_progress = new QProgressBar( progressWindow );
292 layout->addWidget( m_progress ); 292 layout->addWidget( m_progress );
293} 293}
294 294
295void MainWindow :: init() 295void MainWindow :: init()
296{ 296{
297#ifdef QWS 297#ifdef QWS
298 // read download directory from config file 298 // read download directory from config file
299 Config cfg( "aqpkg" ); 299 Config cfg( "aqpkg" );
300 cfg.setGroup( "settings" ); 300 cfg.setGroup( "settings" );
301 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); 301 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
302 // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); 302 // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
303 303
304#endif 304#endif
305 305
306 stack->raiseWidget( progressWindow ); 306 stack->raiseWidget( progressWindow );
307 307
308 mgr = new DataManager(); 308 mgr = new DataManager();
309 connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); 309 connect( mgr, SIGNAL( progressSetSteps(int) ), this, SLOT( setProgressSteps(int) ) );
310 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), 310 connect( mgr, SIGNAL( progressSetMessage(const QString&) ),
311 this, SLOT( setProgressMessage( const QString & ) ) ); 311 this, SLOT( setProgressMessage(const QString&) ) );
312 connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); 312 connect( mgr, SIGNAL( progressUpdate(int) ), this, SLOT( updateProgress(int) ) );
313 mgr->loadServers(); 313 mgr->loadServers();
314 314
315 showUninstalledPkgs = false; 315 showUninstalledPkgs = false;
316 showInstalledPkgs = false; 316 showInstalledPkgs = false;
317 showUpgradedPkgs = false; 317 showUpgradedPkgs = false;
318 categoryFilterEnabled = false; 318 categoryFilterEnabled = false;
319 319
320 updateData(); 320 updateData();
321 321
322 stack->raiseWidget( networkPkgWindow ); 322 stack->raiseWidget( networkPkgWindow );
323} 323}
324 324
325void MainWindow :: setDocument( const QString &doc ) 325void MainWindow :: setDocument( const QString &doc )
326{ 326{
327 // Remove path from package 327 // Remove path from package
328 QString package = Utils::getPackageNameFromIpkFilename( doc ); 328 QString package = Utils::getPackageNameFromIpkFilename( doc );
329 329
330 // First select local server 330 // First select local server
331 for ( int i = 0 ; i < serversList->count() ; ++i ) 331 for ( int i = 0 ; i < serversList->count() ; ++i )
332 { 332 {
333 if ( serversList->text( i ) == LOCAL_IPKGS ) 333 if ( serversList->text( i ) == LOCAL_IPKGS )
334 { 334 {
335 serversList->setCurrentItem( i ); 335 serversList->setCurrentItem( i );
336 break; 336 break;
337 } 337 }
338 } 338 }
339 serverSelected( 0 ); 339 serverSelected( 0 );
340 340
341 // Now set the check box of the selected package 341 // Now set the check box of the selected package
342 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 342 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
343 item != 0 ; 343 item != 0 ;
344 item = (QCheckListItem *)item->nextSibling() ) 344 item = (QCheckListItem *)item->nextSibling() )
345 { 345 {
346 if ( item->text().startsWith( package ) ) 346 if ( item->text().startsWith( package ) )
347 { 347 {
348 item->setOn( true ); 348 item->setOn( true );
349 break; 349 break;
350 } 350 }
351 } 351 }
352} 352}
353 353
354void MainWindow :: displaySettings() 354void MainWindow :: displaySettings()
355{ 355{
356 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); 356 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
357 if ( dlg->showDlg() ) 357 if ( dlg->showDlg() )
358 { 358 {
359 stack->raiseWidget( progressWindow ); 359 stack->raiseWidget( progressWindow );
360 updateData(); 360 updateData();
@@ -725,128 +725,128 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
725 725
726 // Display this widget once everything is done 726 // Display this widget once everything is done
727 if ( doProgress && raiseProgress ) 727 if ( doProgress && raiseProgress )
728 { 728 {
729 stack->raiseWidget( networkPkgWindow ); 729 stack->raiseWidget( networkPkgWindow );
730 } 730 }
731} 731}
732 732
733void MainWindow :: searchForPackage( const QString &text ) 733void MainWindow :: searchForPackage( const QString &text )
734{ 734{
735 if ( !text.isEmpty() ) 735 if ( !text.isEmpty() )
736 { 736 {
737 // look through package list for text startng at current position 737 // look through package list for text startng at current position
738 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); 738 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
739 739
740 if ( start == 0 ) 740 if ( start == 0 )
741 start = (QCheckListItem *)packagesList->firstChild(); 741 start = (QCheckListItem *)packagesList->firstChild();
742 742
743 for ( QCheckListItem *item = start; item != 0 ; 743 for ( QCheckListItem *item = start; item != 0 ;
744 item = (QCheckListItem *)item->nextSibling() ) 744 item = (QCheckListItem *)item->nextSibling() )
745 { 745 {
746 if ( item->text().lower().find( text ) != -1 ) 746 if ( item->text().lower().find( text ) != -1 )
747 { 747 {
748 packagesList->ensureItemVisible( item ); 748 packagesList->ensureItemVisible( item );
749 packagesList->setCurrentItem( item ); 749 packagesList->setCurrentItem( item );
750 break; 750 break;
751 } 751 }
752 } 752 }
753 } 753 }
754} 754}
755 755
756void MainWindow :: updateServer() 756void MainWindow :: updateServer()
757{ 757{
758 QString serverName = serversList->currentText(); 758 QString serverName = serversList->currentText();
759 759
760 // Update the current server 760 // Update the current server
761 // Display dialog 761 // Display dialog
762 762
763 // Disable buttons to stop silly people clicking lots on them :) 763 // Disable buttons to stop silly people clicking lots on them :)
764 764
765 // First, write out ipkg_conf file so that ipkg can use it 765 // First, write out ipkg_conf file so that ipkg can use it
766 mgr->writeOutIpkgConf(); 766 mgr->writeOutIpkgConf();
767 767
768 Ipkg *ipkg = new Ipkg; 768 Ipkg *ipkg = new Ipkg;
769 ipkg->setOption( "update" ); 769 ipkg->setOption( "update" );
770 770
771 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), 771 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
772 tr( "Update lists" ) ); 772 tr( "Update lists" ) );
773 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 773 connect( dlg, SIGNAL( reloadData(InstallDlgImpl*) ), this, SLOT( reloadData(InstallDlgImpl*) ) );
774 reloadDocuments = FALSE; 774 reloadDocuments = FALSE;
775 stack->addWidget( dlg, 3 ); 775 stack->addWidget( dlg, 3 );
776 stack->raiseWidget( dlg ); 776 stack->raiseWidget( dlg );
777 777
778 // delete progDlg; 778 // delete progDlg;
779} 779}
780 780
781void MainWindow :: upgradePackages() 781void MainWindow :: upgradePackages()
782{ 782{
783 // We're gonna do an upgrade of all packages 783 // We're gonna do an upgrade of all packages
784 // First warn user that this isn't recommended 784 // First warn user that this isn't recommended
785 // TODO - ODevice???? 785 // TODO - ODevice????
786 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); 786 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" );
787 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning, 787 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning,
788 QMessageBox::Yes, 788 QMessageBox::Yes,
789 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , 789 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ,
790 0, this ); 790 0, this );
791 warn.adjustSize(); 791 warn.adjustSize();
792 792
793 if ( warn.exec() == QMessageBox::Yes ) 793 if ( warn.exec() == QMessageBox::Yes )
794 { 794 {
795 // First, write out ipkg_conf file so that ipkg can use it 795 // First, write out ipkg_conf file so that ipkg can use it
796 mgr->writeOutIpkgConf(); 796 mgr->writeOutIpkgConf();
797 797
798 // Now run upgrade 798 // Now run upgrade
799 Ipkg *ipkg = new Ipkg; 799 Ipkg *ipkg = new Ipkg;
800 ipkg->setOption( "upgrade" ); 800 ipkg->setOption( "upgrade" );
801 801
802 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), 802 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ),
803 tr ( "Upgrade" ) ); 803 tr ( "Upgrade" ) );
804 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 804 connect( dlg, SIGNAL( reloadData(InstallDlgImpl*) ), this, SLOT( reloadData(InstallDlgImpl*) ) );
805 reloadDocuments = TRUE; 805 reloadDocuments = TRUE;
806 stack->addWidget( dlg, 3 ); 806 stack->addWidget( dlg, 3 );
807 stack->raiseWidget( dlg ); 807 stack->raiseWidget( dlg );
808 } 808 }
809} 809}
810 810
811void MainWindow :: downloadPackage() 811void MainWindow :: downloadPackage()
812{ 812{
813 bool doUpdate = true; 813 bool doUpdate = true;
814 if ( downloadEnabled ) 814 if ( downloadEnabled )
815 { 815 {
816 // See if any packages are selected 816 // See if any packages are selected
817 bool found = false; 817 bool found = false;
818 if ( serversList->currentText() != LOCAL_SERVER ) 818 if ( serversList->currentText() != LOCAL_SERVER )
819 { 819 {
820 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 820 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
821 item != 0 && !found; 821 item != 0 && !found;
822 item = (QCheckListItem *)item->nextSibling() ) 822 item = (QCheckListItem *)item->nextSibling() )
823 { 823 {
824 if ( item->isOn() ) 824 if ( item->isOn() )
825 found = true; 825 found = true;
826 } 826 }
827 } 827 }
828 828
829 // If user selected some packages then download the and store the locally 829 // If user selected some packages then download the and store the locally
830 // otherwise, display dialog asking user what package to download from an http server 830 // otherwise, display dialog asking user what package to download from an http server
831 // and whether to install it 831 // and whether to install it
832 if ( found ) 832 if ( found )
833 downloadSelectedPackages(); 833 downloadSelectedPackages();
834 else 834 else
835 downloadRemotePackage(); 835 downloadRemotePackage();
836 836
837 } 837 }
838 else 838 else
839 { 839 {
840 doUpdate = false; 840 doUpdate = false;
841 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 841 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
842 item != 0 ; 842 item != 0 ;
843 item = (QCheckListItem *)item->nextSibling() ) 843 item = (QCheckListItem *)item->nextSibling() )
844 { 844 {
845 if ( item->isOn() ) 845 if ( item->isOn() )
846 { 846 {
847 QString name = item->text(); 847 QString name = item->text();
848 int pos = name.find( "*" ); 848 int pos = name.find( "*" );
849 name.truncate( pos ); 849 name.truncate( pos );
850 850
851 // if (there is a (installed), remove it 851 // if (there is a (installed), remove it
852 pos = name.find( "(installed)" ); 852 pos = name.find( "(installed)" );
@@ -861,179 +861,179 @@ void MainWindow :: downloadPackage()
861 msgtext, tr( "No" ), tr( "Yes" ) ) == 1 ) 861 msgtext, tr( "No" ), tr( "Yes" ) ) == 1 )
862 { 862 {
863 doUpdate = true; 863 doUpdate = true;
864 QFile f( p->getFilename() ); 864 QFile f( p->getFilename() );
865 f.remove(); 865 f.remove();
866 } 866 }
867 } 867 }
868 } 868 }
869 } 869 }
870 870
871 if ( doUpdate ) 871 if ( doUpdate )
872 { 872 {
873 reloadData( 0x0 ); 873 reloadData( 0x0 );
874 } 874 }
875} 875}
876 876
877void MainWindow :: downloadSelectedPackages() 877void MainWindow :: downloadSelectedPackages()
878{ 878{
879 // First, write out ipkg_conf file so that ipkg can use it 879 // First, write out ipkg_conf file so that ipkg can use it
880 mgr->writeOutIpkgConf(); 880 mgr->writeOutIpkgConf();
881 881
882 // Display dialog to user asking where to download the files to 882 // Display dialog to user asking where to download the files to
883 bool ok = FALSE; 883 bool ok = FALSE;
884 QString dir = ""; 884 QString dir = "";
885#ifdef QWS 885#ifdef QWS
886 // read download directory from config file 886 // read download directory from config file
887 Config cfg( "aqpkg" ); 887 Config cfg( "aqpkg" );
888 cfg.setGroup( "settings" ); 888 cfg.setGroup( "settings" );
889 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" ); 889 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" );
890#endif 890#endif
891 891
892 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this ); 892 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this );
893 if ( ok && !text.isEmpty() ) 893 if ( ok && !text.isEmpty() )
894 dir = text; // user entered something and pressed ok 894 dir = text; // user entered something and pressed ok
895 else 895 else
896 return; // user entered nothing or pressed cancel 896 return; // user entered nothing or pressed cancel
897 897
898#ifdef QWS 898#ifdef QWS
899 // Store download directory in config file 899 // Store download directory in config file
900 cfg.writeEntry( "downloadDir", dir ); 900 cfg.writeEntry( "downloadDir", dir );
901#endif 901#endif
902 902
903 // Get starting directory 903 // Get starting directory
904 char initDir[PATH_MAX]; 904 char initDir[PATH_MAX];
905 getcwd( initDir, PATH_MAX ); 905 getcwd( initDir, PATH_MAX );
906 906
907 // Download each package 907 // Download each package
908 Ipkg ipkg; 908 Ipkg ipkg;
909 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 909 connect( &ipkg, SIGNAL(outputText(const QString&)), this, SLOT(displayText(const QString&)));
910 910
911 ipkg.setOption( "download" ); 911 ipkg.setOption( "download" );
912 ipkg.setRuntimeDirectory( dir ); 912 ipkg.setRuntimeDirectory( dir );
913 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 913 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
914 item != 0 ; 914 item != 0 ;
915 item = (QCheckListItem *)item->nextSibling() ) 915 item = (QCheckListItem *)item->nextSibling() )
916 { 916 {
917 if ( item->isOn() ) 917 if ( item->isOn() )
918 { 918 {
919 ipkg.setPackage( item->text() ); 919 ipkg.setPackage( item->text() );
920 ipkg.runIpkg( ); 920 ipkg.runIpkg( );
921 } 921 }
922 } 922 }
923} 923}
924 924
925void MainWindow :: downloadRemotePackage() 925void MainWindow :: downloadRemotePackage()
926{ 926{
927 // Display dialog 927 // Display dialog
928 bool ok; 928 bool ok;
929 QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this ); 929 QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this );
930 if ( !ok || package.isEmpty() ) 930 if ( !ok || package.isEmpty() )
931 return; 931 return;
932 // DownloadRemoteDlgImpl dlg( this, "Install", true ); 932 // DownloadRemoteDlgImpl dlg( this, "Install", true );
933 // if ( dlg.exec() == QDialog::Rejected ) 933 // if ( dlg.exec() == QDialog::Rejected )
934 // return; 934 // return;
935 935
936 // grab details from dialog 936 // grab details from dialog
937 // QString package = dlg.getPackageLocation(); 937 // QString package = dlg.getPackageLocation();
938 938
939 InstallData *item = new InstallData(); 939 InstallData *item = new InstallData();
940 item->option = "I"; 940 item->option = "I";
941 item->packageName = package; 941 item->packageName = package;
942 QList<InstallData> workingPackages; 942 QList<InstallData> workingPackages;
943 workingPackages.setAutoDelete( TRUE ); 943 workingPackages.setAutoDelete( TRUE );
944 workingPackages.append( item ); 944 workingPackages.append( item );
945 945
946 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); 946 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) );
947 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 947 connect( dlg, SIGNAL( reloadData(InstallDlgImpl*) ), this, SLOT( reloadData(InstallDlgImpl*) ) );
948 reloadDocuments = TRUE; 948 reloadDocuments = TRUE;
949 stack->addWidget( dlg, 3 ); 949 stack->addWidget( dlg, 3 );
950 stack->raiseWidget( dlg ); 950 stack->raiseWidget( dlg );
951} 951}
952 952
953 953
954void MainWindow :: applyChanges() 954void MainWindow :: applyChanges()
955{ 955{
956 stickyOption = ""; 956 stickyOption = "";
957 957
958 // First, write out ipkg_conf file so that ipkg can use it 958 // First, write out ipkg_conf file so that ipkg can use it
959 mgr->writeOutIpkgConf(); 959 mgr->writeOutIpkgConf();
960 960
961 // Now for each selected item 961 // Now for each selected item
962 // deal with it 962 // deal with it
963 963
964 QList<InstallData> workingPackages; 964 QList<InstallData> workingPackages;
965 workingPackages.setAutoDelete( TRUE ); 965 workingPackages.setAutoDelete( TRUE );
966 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 966 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
967 item != 0 ; 967 item != 0 ;
968 item = (QCheckListItem *)item->nextSibling() ) 968 item = (QCheckListItem *)item->nextSibling() )
969 { 969 {
970 if ( item->isOn() ) 970 if ( item->isOn() )
971 { 971 {
972 InstallData *instdata = dealWithItem( item ); 972 InstallData *instdata = dealWithItem( item );
973 if ( instdata ) 973 if ( instdata )
974 workingPackages.append( instdata ); 974 workingPackages.append( instdata );
975 else 975 else
976 return; 976 return;
977 } 977 }
978 } 978 }
979 979
980 if ( workingPackages.count() == 0 ) 980 if ( workingPackages.count() == 0 )
981 { 981 {
982 // Nothing to do 982 // Nothing to do
983 QMessageBox::information( this, tr( "Nothing to do" ), 983 QMessageBox::information( this, tr( "Nothing to do" ),
984 tr( "No packages selected" ), tr( "OK" ) ); 984 tr( "No packages selected" ), tr( "OK" ) );
985 985
986 return; 986 return;
987 } 987 }
988 988
989 // do the stuff 989 // do the stuff
990 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); 990 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) );
991 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 991 connect( dlg, SIGNAL( reloadData(InstallDlgImpl*) ), this, SLOT( reloadData(InstallDlgImpl*) ) );
992 reloadDocuments = TRUE; 992 reloadDocuments = TRUE;
993 stack->addWidget( dlg, 3 ); 993 stack->addWidget( dlg, 3 );
994 stack->raiseWidget( dlg ); 994 stack->raiseWidget( dlg );
995} 995}
996 996
997// decide what to do - either remove, upgrade or install 997// decide what to do - either remove, upgrade or install
998// Current rules: 998// Current rules:
999// If not installed - install 999// If not installed - install
1000// If installed and different version available - upgrade 1000// If installed and different version available - upgrade
1001// If installed and version up to date - remove 1001// If installed and version up to date - remove
1002InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) 1002InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1003{ 1003{
1004 QString name = item->text(); 1004 QString name = item->text();
1005 1005
1006 // Get package 1006 // Get package
1007 Server *s = mgr->getServer( serversList->currentText() ); 1007 Server *s = mgr->getServer( serversList->currentText() );
1008 Package *p = s->getPackage( name ); 1008 Package *p = s->getPackage( name );
1009 1009
1010 // If the package has a filename then it is a local file 1010 // If the package has a filename then it is a local file
1011 if ( p->isPackageStoredLocally() ) 1011 if ( p->isPackageStoredLocally() )
1012 name = p->getFilename(); 1012 name = p->getFilename();
1013 1013
1014 QString option; 1014 QString option;
1015 QString dest = "root"; 1015 QString dest = "root";
1016 if ( !p->isInstalled() ) 1016 if ( !p->isInstalled() )
1017 { 1017 {
1018 InstallData *newitem = new InstallData(); 1018 InstallData *newitem = new InstallData();
1019 newitem->option = "I"; 1019 newitem->option = "I";
1020 newitem->packageName = name; 1020 newitem->packageName = name;
1021 return newitem; 1021 return newitem;
1022 } 1022 }
1023 else 1023 else
1024 { 1024 {
1025 InstallData *newitem = new InstallData(); 1025 InstallData *newitem = new InstallData();
1026 newitem->option = "D"; 1026 newitem->option = "D";
1027 // If local file, remove using package name, not filename 1027 // If local file, remove using package name, not filename
1028 if ( p->isPackageStoredLocally() ) 1028 if ( p->isPackageStoredLocally() )
1029 name = item->text(); 1029 name = item->text();
1030 1030
1031 if ( !p->isPackageStoredLocally() ) 1031 if ( !p->isPackageStoredLocally() )
1032 newitem->packageName = p->getInstalledPackageName(); 1032 newitem->packageName = p->getInstalledPackageName();
1033 else 1033 else
1034 newitem->packageName = name; 1034 newitem->packageName = name;
1035 1035
1036 if ( p->getInstalledTo() ) 1036 if ( p->getInstalledTo() )
1037 { 1037 {
1038 newitem->destination = p->getInstalledTo(); 1038 newitem->destination = p->getInstalledTo();
1039 } 1039 }
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 6e9dd99..b9dbb6e 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -66,155 +66,155 @@ SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const
66 Opie::OTabWidget *tabwidget = new Opie::OTabWidget( this ); 66 Opie::OTabWidget *tabwidget = new Opie::OTabWidget( this );
67 layout->addWidget( tabwidget ); 67 layout->addWidget( tabwidget );
68 68
69 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); 69 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) );
70 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); 70 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) );
71 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); 71 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) );
72 tabwidget->setCurrentTab( tr( "Servers" ) ); 72 tabwidget->setCurrentTab( tr( "Servers" ) );
73 73
74 dataMgr = dataManager; 74 dataMgr = dataManager;
75 setupData(); 75 setupData();
76 changed = false; 76 changed = false;
77 newserver = false; 77 newserver = false;
78 newdestination = false; 78 newdestination = false;
79} 79}
80 80
81SettingsImpl :: ~SettingsImpl() 81SettingsImpl :: ~SettingsImpl()
82{ 82{
83} 83}
84 84
85bool SettingsImpl :: showDlg() 85bool SettingsImpl :: showDlg()
86{ 86{
87 QPEApplication::execDialog( this ); 87 QPEApplication::execDialog( this );
88 if ( changed ) 88 if ( changed )
89 dataMgr->writeOutIpkgConf(); 89 dataMgr->writeOutIpkgConf();
90 90
91 return changed; 91 return changed;
92} 92}
93 93
94QWidget *SettingsImpl :: initServerTab() 94QWidget *SettingsImpl :: initServerTab()
95{ 95{
96 QWidget *control = new QWidget( this ); 96 QWidget *control = new QWidget( this );
97 97
98 QVBoxLayout *vb = new QVBoxLayout( control ); 98 QVBoxLayout *vb = new QVBoxLayout( control );
99 99
100 QScrollView *sv = new QScrollView( control ); 100 QScrollView *sv = new QScrollView( control );
101 vb->addWidget( sv, 0, 0 ); 101 vb->addWidget( sv, 0, 0 );
102 sv->setResizePolicy( QScrollView::AutoOneFit ); 102 sv->setResizePolicy( QScrollView::AutoOneFit );
103 sv->setFrameStyle( QFrame::NoFrame ); 103 sv->setFrameStyle( QFrame::NoFrame );
104 104
105 QWidget *container = new QWidget( sv->viewport() ); 105 QWidget *container = new QWidget( sv->viewport() );
106 sv->addChild( container ); 106 sv->addChild( container );
107 107
108 QGridLayout *layout = new QGridLayout( container ); 108 QGridLayout *layout = new QGridLayout( container );
109 layout->setSpacing( 2 ); 109 layout->setSpacing( 2 );
110 layout->setMargin( 4 ); 110 layout->setMargin( 4 );
111 111
112 servers = new QListBox( container ); 112 servers = new QListBox( container );
113 servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 113 servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
114 connect( servers, SIGNAL( highlighted( int ) ), this, SLOT( editServer( int ) ) ); 114 connect( servers, SIGNAL( highlighted(int) ), this, SLOT( editServer(int) ) );
115 layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); 115 layout->addMultiCellWidget( servers, 0, 0, 0, 1 );
116 116
117 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 117 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
118 connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); 118 connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) );
119 layout->addWidget( btn, 1, 0 ); 119 layout->addWidget( btn, 1, 0 );
120 120
121 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 121 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
122 connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); 122 connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) );
123 layout->addWidget( btn, 1, 1 ); 123 layout->addWidget( btn, 1, 1 );
124 124
125 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); 125 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container );
126 grpbox->layout()->setSpacing( 2 ); 126 grpbox->layout()->setSpacing( 2 );
127 grpbox->layout()->setMargin( 4 ); 127 grpbox->layout()->setMargin( 4 );
128 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); 128 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 );
129 129
130 QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); 130 QGridLayout *grplayout = new QGridLayout( grpbox->layout() );
131 131
132 QLabel *label = new QLabel( tr( "Name:" ), grpbox ); 132 QLabel *label = new QLabel( tr( "Name:" ), grpbox );
133 grplayout->addWidget( label, 0, 0 ); 133 grplayout->addWidget( label, 0, 0 );
134 servername = new QLineEdit( grpbox ); 134 servername = new QLineEdit( grpbox );
135 grplayout->addWidget( servername, 0, 1 ); 135 grplayout->addWidget( servername, 0, 1 );
136 136
137 label = new QLabel( tr( "Address:" ), grpbox ); 137 label = new QLabel( tr( "Address:" ), grpbox );
138 grplayout->addWidget( label, 1, 0 ); 138 grplayout->addWidget( label, 1, 0 );
139 serverurl = new QLineEdit( grpbox ); 139 serverurl = new QLineEdit( grpbox );
140 grplayout->addWidget( serverurl, 1, 1 ); 140 grplayout->addWidget( serverurl, 1, 1 );
141 141
142 active = new QCheckBox( tr( "Active Server" ), grpbox ); 142 active = new QCheckBox( tr( "Active Server" ), grpbox );
143 grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); 143 grplayout->addMultiCellWidget( active, 2, 2, 0, 1 );
144 144
145 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); 145 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox );
146 connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); 146 connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) );
147 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); 147 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 );
148 148
149 return control; 149 return control;
150} 150}
151 151
152QWidget *SettingsImpl :: initDestinationTab() 152QWidget *SettingsImpl :: initDestinationTab()
153{ 153{
154 QWidget *control = new QWidget( this ); 154 QWidget *control = new QWidget( this );
155 155
156 QVBoxLayout *vb = new QVBoxLayout( control ); 156 QVBoxLayout *vb = new QVBoxLayout( control );
157 157
158 QScrollView *sv = new QScrollView( control ); 158 QScrollView *sv = new QScrollView( control );
159 vb->addWidget( sv, 0, 0 ); 159 vb->addWidget( sv, 0, 0 );
160 sv->setResizePolicy( QScrollView::AutoOneFit ); 160 sv->setResizePolicy( QScrollView::AutoOneFit );
161 sv->setFrameStyle( QFrame::NoFrame ); 161 sv->setFrameStyle( QFrame::NoFrame );
162 162
163 QWidget *container = new QWidget( sv->viewport() ); 163 QWidget *container = new QWidget( sv->viewport() );
164 sv->addChild( container ); 164 sv->addChild( container );
165 165
166 QGridLayout *layout = new QGridLayout( container ); 166 QGridLayout *layout = new QGridLayout( container );
167 layout->setSpacing( 2 ); 167 layout->setSpacing( 2 );
168 layout->setMargin( 4 ); 168 layout->setMargin( 4 );
169 169
170 destinations = new QListBox( container ); 170 destinations = new QListBox( container );
171 destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); 171 destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
172 connect( destinations, SIGNAL( highlighted( int ) ), this, SLOT( editDestination( int ) ) ); 172 connect( destinations, SIGNAL( highlighted(int) ), this, SLOT( editDestination(int) ) );
173 layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); 173 layout->addMultiCellWidget( destinations, 0, 0, 0, 1 );
174 174
175 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); 175 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container );
176 connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); 176 connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) );
177 layout->addWidget( btn, 1, 0 ); 177 layout->addWidget( btn, 1, 0 );
178 178
179 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); 179 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container );
180 connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); 180 connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) );
181 layout->addWidget( btn, 1, 1 ); 181 layout->addWidget( btn, 1, 1 );
182 182
183 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); 183 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container );
184 grpbox->layout()->setSpacing( 2 ); 184 grpbox->layout()->setSpacing( 2 );
185 grpbox->layout()->setMargin( 4 ); 185 grpbox->layout()->setMargin( 4 );
186 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); 186 layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 );
187 187
188 QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); 188 QGridLayout *grplayout = new QGridLayout( grpbox->layout() );
189 189
190 QLabel *label = new QLabel( tr( "Name:" ), grpbox ); 190 QLabel *label = new QLabel( tr( "Name:" ), grpbox );
191 grplayout->addWidget( label, 0, 0 ); 191 grplayout->addWidget( label, 0, 0 );
192 destinationname = new QLineEdit( grpbox ); 192 destinationname = new QLineEdit( grpbox );
193 grplayout->addWidget( destinationname, 0, 1 ); 193 grplayout->addWidget( destinationname, 0, 1 );
194 194
195 label = new QLabel( tr( "Location:" ), grpbox ); 195 label = new QLabel( tr( "Location:" ), grpbox );
196 grplayout->addWidget( label, 1, 0 ); 196 grplayout->addWidget( label, 1, 0 );
197 destinationurl = new QLineEdit( grpbox ); 197 destinationurl = new QLineEdit( grpbox );
198 grplayout->addWidget( destinationurl, 1, 1 ); 198 grplayout->addWidget( destinationurl, 1, 1 );
199 199
200 linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); 200 linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox );
201 grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); 201 grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 );
202 202
203 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); 203 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox );
204 connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); 204 connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) );
205 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); 205 grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 );
206 206
207 return control; 207 return control;
208} 208}
209 209
210QWidget *SettingsImpl :: initProxyTab() 210QWidget *SettingsImpl :: initProxyTab()
211{ 211{
212 QWidget *control = new QWidget( this ); 212 QWidget *control = new QWidget( this );
213 213
214 QVBoxLayout *vb = new QVBoxLayout( control ); 214 QVBoxLayout *vb = new QVBoxLayout( control );
215 215
216 QScrollView *sv = new QScrollView( control ); 216 QScrollView *sv = new QScrollView( control );
217 vb->addWidget( sv, 0, 0 ); 217 vb->addWidget( sv, 0, 0 );
218 sv->setResizePolicy( QScrollView::AutoOneFit ); 218 sv->setResizePolicy( QScrollView::AutoOneFit );
219 sv->setFrameStyle( QFrame::NoFrame ); 219 sv->setFrameStyle( QFrame::NoFrame );
220 220
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 977c283..6b83bc9 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -5,99 +5,99 @@
5/* OPIE */ 5/* OPIE */
6#include <opie2/ostorageinfo.h> 6#include <opie2/ostorageinfo.h>
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9/* QT */ 9/* QT */
10#include <qapplication.h> 10#include <qapplication.h>
11#include <qmultilineedit.h> 11#include <qmultilineedit.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qfile.h> 13#include <qfile.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlistview.h> 15#include <qlistview.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17#include <qheader.h> 17#include <qheader.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qcombobox.h> 21#include <qcombobox.h>
22#include <qlist.h> 22#include <qlist.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include <qregexp.h> 24#include <qregexp.h>
25#include <qtextstream.h> 25#include <qtextstream.h>
26#include <qtextview.h> 26#include <qtextview.h>
27 27
28/* STD */ 28/* STD */
29#include <errno.h> 29#include <errno.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include <unistd.h> 31#include <unistd.h>
32#include <sys/stat.h> 32#include <sys/stat.h>
33#include <dirent.h> 33#include <dirent.h>
34 34
35#define HEADER_NAME 0 35#define HEADER_NAME 0
36#define HEADER_BACKUP 1 36#define HEADER_BACKUP 1
37#define BACKUP_LOCATION 2 37#define BACKUP_LOCATION 2
38 38
39#define EXTENSION ".bck" 39#define EXTENSION ".bck"
40 40
41const QString tempFileName = "/tmp/backup.err"; 41const QString tempFileName = "/tmp/backup.err";
42 42
43 43
44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
45 : BackupAndRestoreBase(parent, name, fl) 45 : BackupAndRestoreBase(parent, name, fl)
46{ 46{
47 backupList->header()->hide(); 47 backupList->header()->hide();
48 restoreList->header()->hide(); 48 restoreList->header()->hide();
49 connect(backupButton, SIGNAL(clicked()), 49 connect(backupButton, SIGNAL(clicked()),
50 this, SLOT(backup())); 50 this, SLOT(backup()));
51 connect(restoreButton, SIGNAL(clicked()), 51 connect(restoreButton, SIGNAL(clicked()),
52 this, SLOT(restore())); 52 this, SLOT(restore()));
53 connect(backupList, SIGNAL(clicked( QListViewItem * )), 53 connect(backupList, SIGNAL(clicked(QListViewItem*)),
54 this, SLOT(selectItem(QListViewItem*))); 54 this, SLOT(selectItem(QListViewItem*)));
55 connect(restoreSource, SIGNAL(activated( int )), 55 connect(restoreSource, SIGNAL(activated(int)),
56 this, SLOT(sourceDirChanged(int))); 56 this, SLOT(sourceDirChanged(int)));
57 connect(updateList, SIGNAL(clicked()), 57 connect(updateList, SIGNAL(clicked()),
58 this, SLOT( fileListUpdate())); 58 this, SLOT( fileListUpdate()));
59 59
60 //add directorys for backing up 60 //add directorys for backing up
61 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); 61 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/");
62 selectItem(applicationSettings); 62 selectItem(applicationSettings);
63 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); 63 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/");
64 selectItem(applicationSettings); 64 selectItem(applicationSettings);
65 documents= new QListViewItem(backupList, "Documents", "", "Documents/"); 65 documents= new QListViewItem(backupList, "Documents", "", "Documents/");
66 selectItem(documents); 66 selectItem(documents);
67 67
68 scanForApplicationSettings(); 68 scanForApplicationSettings();
69 69
70 OStorageInfo storage; 70 OStorageInfo storage;
71 71
72 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 72 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
73 if ( storage.hasCf() ) 73 if ( storage.hasCf() )
74 { 74 {
75 backupLocations.insert( "CF", storage.cfPath() ); 75 backupLocations.insert( "CF", storage.cfPath() );
76 qDebug( "Cf Path: " + storage.cfPath() ); 76 qDebug( "Cf Path: " + storage.cfPath() );
77 } 77 }
78 if ( storage.hasSd() ) 78 if ( storage.hasSd() )
79 { 79 {
80 backupLocations.insert( "SD", storage.sdPath() ); 80 backupLocations.insert( "SD", storage.sdPath() );
81 qDebug( " Sd Path: " + storage.sdPath() ); 81 qDebug( " Sd Path: " + storage.sdPath() );
82 } 82 }
83 if ( storage.hasMmc() ) 83 if ( storage.hasMmc() )
84 { 84 {
85 backupLocations.insert( "MMC", storage.mmcPath() ); 85 backupLocations.insert( "MMC", storage.mmcPath() );
86 qDebug( "Mmc Path: " + storage.mmcPath() ); 86 qDebug( "Mmc Path: " + storage.mmcPath() );
87 } 87 }
88 88
89 Config config("BackupAndRestore"); 89 Config config("BackupAndRestore");
90 //read last locations 90 //read last locations
91 config.setGroup("LastLocation"); 91 config.setGroup("LastLocation");
92 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 92 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
93 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" ); 93 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" );
94 int locationIndex = 0; 94 int locationIndex = 0;
95 95
96 QMap<QString, QString>::Iterator it; 96 QMap<QString, QString>::Iterator it;
97 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) 97 for( it = backupLocations.begin(); it != backupLocations.end(); ++it )
98 { 98 {
99 storeToLocation->insertItem(it.key()); 99 storeToLocation->insertItem(it.key());
100 restoreSource->insertItem(it.key()); 100 restoreSource->insertItem(it.key());
101 101
102 //check for last locations 102 //check for last locations
103 if ( it.key() == lastStoreLocation ) 103 if ( it.key() == lastStoreLocation )
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index 7df41d4..c995d6e 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -32,120 +32,120 @@
32#include "settingstabwidget.h" 32#include "settingstabwidget.h"
33#include "ntptabwidget.h" 33#include "ntptabwidget.h"
34#include "predicttabwidget.h" 34#include "predicttabwidget.h"
35 35
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/datebookdb.h> 37#include <qpe/datebookdb.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include <qpe/qpedialog.h> 39#include <qpe/qpedialog.h>
40 40
41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43#endif 43#endif
44 44
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qmessagebox.h> 46#include <qmessagebox.h>
47#include <qsocket.h> 47#include <qsocket.h>
48#include <qstring.h> 48#include <qstring.h>
49#include <qtimer.h> 49#include <qtimer.h>
50 50
51MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) 51MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f )
52 : QDialog( 0x0, 0x0, TRUE, 0 ) 52 : QDialog( 0x0, 0x0, TRUE, 0 )
53{ 53{
54 setCaption( tr( "SystemTime" ) ); 54 setCaption( tr( "SystemTime" ) );
55 55
56 QVBoxLayout *layout = new QVBoxLayout( this ); 56 QVBoxLayout *layout = new QVBoxLayout( this );
57 layout->setMargin( 2 ); 57 layout->setMargin( 2 );
58 layout->setSpacing( 4 ); 58 layout->setSpacing( 4 );
59 59
60 // Create main tabbed control 60 // Create main tabbed control
61 mainWidget = new OTabWidget( this ); 61 mainWidget = new OTabWidget( this );
62 62
63 // Default object pointers to null 63 // Default object pointers to null
64 ntpProcess = 0x0; 64 ntpProcess = 0x0;
65 ntpTab = 0x0; 65 ntpTab = 0x0;
66 66
67 // Add tab widgets 67 // Add tab widgets
68 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) ); 68 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) );
69 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) ); 69 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) );
70 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) ); 70 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) );
71 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) ); 71 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) );
72 Config config( "ntp" ); 72 Config config( "ntp" );
73 config.setGroup( "settings" ); 73 config.setGroup( "settings" );
74 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) ); 74 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) );
75 slotDisplayPredictTab( config.readBoolEntry( "displayPredictTab", FALSE ) ); 75 slotDisplayPredictTab( config.readBoolEntry( "displayPredictTab", FALSE ) );
76 76
77 mainWidget->setCurrentTab( tr( "Time" ) ); 77 mainWidget->setCurrentTab( tr( "Time" ) );
78 layout->addWidget( mainWidget ); 78 layout->addWidget( mainWidget );
79 79
80 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 80 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
81 this, SLOT(slotQCopReceive(const QCString&, const QByteArray&)) ); 81 this, SLOT(slotQCopReceive(const QCString&,const QByteArray&)) );
82 82
83 83
84 // Create NTP socket 84 // Create NTP socket
85 ntpSock = new QSocket( this ); 85 ntpSock = new QSocket( this );
86 connect( ntpSock, SIGNAL(error(int)),SLOT(slotCheckNtp(int)) ); 86 connect( ntpSock, SIGNAL(error(int)),SLOT(slotCheckNtp(int)) );
87 slotProbeNTPServer(); 87 slotProbeNTPServer();
88 88
89 // Create timer for automatic time lookups 89 // Create timer for automatic time lookups
90 ntpTimer = new QTimer( this ); 90 ntpTimer = new QTimer( this );
91 91
92 // Connect everything together 92 // Connect everything together
93 connect( timeTab, SIGNAL(getNTPTime()), this, SLOT(slotGetNTPTime()) ); 93 connect( timeTab, SIGNAL(getNTPTime()), this, SLOT(slotGetNTPTime()) );
94 connect( timeTab, SIGNAL(tzChanged(const QString &)), predictTab, SLOT(slotTZChanged(const QString &)) ); 94 connect( timeTab, SIGNAL(tzChanged(const QString&)), predictTab, SLOT(slotTZChanged(const QString&)) );
95 connect( timeTab, SIGNAL(getPredictedTime()), predictTab, SLOT(slotSetPredictedTime()) ); 95 connect( timeTab, SIGNAL(getPredictedTime()), predictTab, SLOT(slotSetPredictedTime()) );
96 connect( formatTab, SIGNAL(show12HourTime(int)), timeTab, SLOT(slotUse12HourTime( int )) ); 96 connect( formatTab, SIGNAL(show12HourTime(int)), timeTab, SLOT(slotUse12HourTime(int)) );
97 connect( formatTab, SIGNAL(dateFormatChanged(const DateFormat &)), 97 connect( formatTab, SIGNAL(dateFormatChanged(const DateFormat&)),
98 timeTab, SLOT(slotDateFormatChanged(const DateFormat &)) ); 98 timeTab, SLOT(slotDateFormatChanged(const DateFormat&)) );
99 connect( formatTab, SIGNAL(weekStartChanged(int)), timeTab, SLOT(slotWeekStartChanged(int)) ); 99 connect( formatTab, SIGNAL(weekStartChanged(int)), timeTab, SLOT(slotWeekStartChanged(int)) );
100 connect( settingsTab, SIGNAL(ntpDelayChanged(int)), this, SLOT(slotNTPDelayChanged(int)) ); 100 connect( settingsTab, SIGNAL(ntpDelayChanged(int)), this, SLOT(slotNTPDelayChanged(int)) );
101 connect( settingsTab, SIGNAL(displayNTPTab(bool)), this, SLOT(slotDisplayNTPTab(bool)) ); 101 connect( settingsTab, SIGNAL(displayNTPTab(bool)), this, SLOT(slotDisplayNTPTab(bool)) );
102 connect( settingsTab, SIGNAL(displayPredictTab(bool)), this, SLOT(slotDisplayPredictTab(bool)) ); 102 connect( settingsTab, SIGNAL(displayPredictTab(bool)), this, SLOT(slotDisplayPredictTab(bool)) );
103 connect( predictTab, SIGNAL(setTime(const QDateTime &)), this, SLOT(slotSetTime(const QDateTime &)) ); 103 connect( predictTab, SIGNAL(setTime(const QDateTime&)), this, SLOT(slotSetTime(const QDateTime&)) );
104 104
105 // Do initial time server check 105 // Do initial time server check
106 slotNTPDelayChanged( config.readNumEntry( "ntpRefreshFreq", 1440 ) ); 106 slotNTPDelayChanged( config.readNumEntry( "ntpRefreshFreq", 1440 ) );
107 slotCheckNtp( -1 ); 107 slotCheckNtp( -1 );
108 108
109 // Display app 109 // Display app
110 //showMaximized(); 110 //showMaximized();
111 (void)new QPEDialogListener(this); 111 (void)new QPEDialogListener(this);
112} 112}
113 113
114MainWindow::~MainWindow() 114MainWindow::~MainWindow()
115{ 115{
116 if ( ntpProcess ) 116 if ( ntpProcess )
117 delete ntpProcess; 117 delete ntpProcess;
118} 118}
119 119
120void MainWindow::accept() 120void MainWindow::accept()
121{ 121{
122 // Turn off the screensaver (Note: needs to be encased in { } so that it deconstructs and sends) 122 // Turn off the screensaver (Note: needs to be encased in { } so that it deconstructs and sends)
123 { 123 {
124 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 124 QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
125 disableScreenSaver << 0 << 0 << 0; 125 disableScreenSaver << 0 << 0 << 0;
126 } 126 }
127 127
128 // Update the systemtime 128 // Update the systemtime
129 timeTab->saveSettings( TRUE ); 129 timeTab->saveSettings( TRUE );
130 130
131 // Save format options 131 // Save format options
132 formatTab->saveSettings( TRUE ); 132 formatTab->saveSettings( TRUE );
133 133
134 // Save settings options 134 // Save settings options
135 settingsTab->saveSettings(); 135 settingsTab->saveSettings();
136 136
137 // Since time has changed quickly load in the DateBookDB to allow the alarm server to get a better 137 // Since time has changed quickly load in the DateBookDB to allow the alarm server to get a better
138 // grip on itself (example re-trigger alarms for when we travel back in time). 138 // grip on itself (example re-trigger alarms for when we travel back in time).
139 DateBookDB db; 139 DateBookDB db;
140 140
141 // Turn back on the screensaver 141 // Turn back on the screensaver
142 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 142 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
143 enableScreenSaver << -1 << -1 << -1; 143 enableScreenSaver << -1 << -1 << -1;
144 144
145 // Exit app 145 // Exit app
146 qApp->quit(); 146 qApp->quit();
147} 147}
148 148
149void MainWindow::reject() 149void MainWindow::reject()
150{ 150{
151 // Reset time settings 151 // Reset time settings
diff --git a/noncore/settings/netsystemtime/settingstabwidget.cpp b/noncore/settings/netsystemtime/settingstabwidget.cpp
index 2a7e28d..ad80e05 100644
--- a/noncore/settings/netsystemtime/settingstabwidget.cpp
+++ b/noncore/settings/netsystemtime/settingstabwidget.cpp
@@ -33,102 +33,102 @@
33 33
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlayout.h> 37#include <qlayout.h>
38#include <qscrollview.h> 38#include <qscrollview.h>
39#include <qspinbox.h> 39#include <qspinbox.h>
40 40
41SettingsTabWidget::SettingsTabWidget( QWidget *parent ) 41SettingsTabWidget::SettingsTabWidget( QWidget *parent )
42 : QWidget( parent, 0x0, 0 ) 42 : QWidget( parent, 0x0, 0 )
43{ 43{
44 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 44 QVBoxLayout *tmpvb = new QVBoxLayout( this );
45 QScrollView *sv = new QScrollView( this ); 45 QScrollView *sv = new QScrollView( this );
46 tmpvb->addWidget( sv, 0, 0 ); 46 tmpvb->addWidget( sv, 0, 0 );
47 sv->setResizePolicy( QScrollView::AutoOneFit ); 47 sv->setResizePolicy( QScrollView::AutoOneFit );
48 sv->setFrameStyle( QFrame::NoFrame ); 48 sv->setFrameStyle( QFrame::NoFrame );
49 QWidget *container = new QWidget( sv->viewport() ); 49 QWidget *container = new QWidget( sv->viewport() );
50 sv->addChild( container ); 50 sv->addChild( container );
51 51
52 QGridLayout *layout = new QGridLayout( container ); 52 QGridLayout *layout = new QGridLayout( container );
53 layout->setMargin( 2 ); 53 layout->setMargin( 2 );
54 layout->setSpacing( 4 ); 54 layout->setSpacing( 4 );
55 55
56 // Time server selector 56 // Time server selector
57 layout->addWidget( new QLabel( tr( "Time server" ), container ), 0, 0 ); 57 layout->addWidget( new QLabel( tr( "Time server" ), container ), 0, 0 );
58 cbTimeServer = new QComboBox( TRUE, container ); 58 cbTimeServer = new QComboBox( TRUE, container );
59 layout->addMultiCellWidget( cbTimeServer, 1, 1, 0, 1 ); 59 layout->addMultiCellWidget( cbTimeServer, 1, 1, 0, 1 );
60 60
61 // Lookup delay selector 61 // Lookup delay selector
62 layout->addWidget( new QLabel( tr( "minutes between time updates" ), container ), 2, 1 ); 62 layout->addWidget( new QLabel( tr( "minutes between time updates" ), container ), 2, 1 );
63 sbNtpDelay = new QSpinBox( 1, 9999999, 1, container ); 63 sbNtpDelay = new QSpinBox( 1, 9999999, 1, container );
64 sbNtpDelay->setWrapping( TRUE ); 64 sbNtpDelay->setWrapping( TRUE );
65 sbNtpDelay->setMaximumWidth( 50 ); 65 sbNtpDelay->setMaximumWidth( 50 );
66 connect( sbNtpDelay, SIGNAL(valueChanged(int)), this, SIGNAL(ntpDelayChanged(int)) ); 66 connect( sbNtpDelay, SIGNAL(valueChanged(int)), this, SIGNAL(ntpDelayChanged(int)) );
67 layout->addWidget( sbNtpDelay, 2, 0 ); 67 layout->addWidget( sbNtpDelay, 2, 0 );
68 68
69 // Prediction delay selector 69 // Prediction delay selector
70 layout->addWidget( new QLabel( tr( "minutes between prediction updates" ), container ), 3, 1 ); 70 layout->addWidget( new QLabel( tr( "minutes between prediction updates" ), container ), 3, 1 );
71 sbPredictDelay = new QSpinBox( 42, 9999999, 1, container ); 71 sbPredictDelay = new QSpinBox( 42, 9999999, 1, container );
72 sbPredictDelay->setWrapping( TRUE ); 72 sbPredictDelay->setWrapping( TRUE );
73 sbPredictDelay->setMaximumWidth( 50 ); 73 sbPredictDelay->setMaximumWidth( 50 );
74 layout->addWidget( sbPredictDelay, 3, 0 ); 74 layout->addWidget( sbPredictDelay, 3, 0 );
75 75
76 // Space filler 76 // Space filler
77 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 4, 0 ); 77 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 4, 0 );
78 78
79 // Display time server information selector 79 // Display time server information selector
80 chNtpTab = new QCheckBox( tr( "Display time server information" ), container ); 80 chNtpTab = new QCheckBox( tr( "Display time server information" ), container );
81 connect( chNtpTab, SIGNAL( toggled( bool ) ), this, SIGNAL( displayNTPTab( bool ) ) ); 81 connect( chNtpTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayNTPTab(bool) ) );
82 layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 ); 82 layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 );
83 83
84 // Display time prediction information selector 84 // Display time prediction information selector
85 chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container ); 85 chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container );
86 connect( chPredictTab, SIGNAL( toggled( bool ) ), this, SIGNAL( displayPredictTab( bool ) ) ); 86 connect( chPredictTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayPredictTab(bool) ) );
87 layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 ); 87 layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 );
88 88
89 // Space filler 89 // Space filler
90 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 ); 90 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 );
91 91
92 // Initialize values 92 // Initialize values
93 QString ntpSrvsFile = QPEApplication::qpeDir(); 93 QString ntpSrvsFile = QPEApplication::qpeDir();
94 ntpSrvsFile.append( "etc/ntpservers" ); 94 ntpSrvsFile.append( "etc/ntpservers" );
95 Config ntpSrvs( ntpSrvsFile, Config::File ); 95 Config ntpSrvs( ntpSrvsFile, Config::File );
96 ntpSrvs.setGroup( "servers" ); 96 ntpSrvs.setGroup( "servers" );
97 int srvCount = ntpSrvs.readNumEntry( "count", 0 ); 97 int srvCount = ntpSrvs.readNumEntry( "count", 0 );
98 for ( int i = 0; i < srvCount; i++ ) 98 for ( int i = 0; i < srvCount; i++ )
99 { 99 {
100 ntpSrvs.setGroup( QString::number( i ) ); 100 ntpSrvs.setGroup( QString::number( i ) );
101 cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) ); 101 cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) );
102 } 102 }
103 if ( srvCount==0 ) 103 if ( srvCount==0 )
104 cbTimeServer->insertItem( "time.fu-berlin.de" ); 104 cbTimeServer->insertItem( "time.fu-berlin.de" );
105 105
106 Config config( "ntp" ); 106 Config config( "ntp" );
107 config.setGroup( "settings" ); 107 config.setGroup( "settings" );
108 sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) ); 108 sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) );
109 sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) ); 109 sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) );
110 cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) ); 110 cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) );
111 chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) ); 111 chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) );
112 chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) ); 112 chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) );
113} 113}
114 114
115SettingsTabWidget::~SettingsTabWidget() 115SettingsTabWidget::~SettingsTabWidget()
116{ 116{
117} 117}
118 118
119void SettingsTabWidget::saveSettings() 119void SettingsTabWidget::saveSettings()
120{ 120{
121 int srvCount = cbTimeServer->count(); 121 int srvCount = cbTimeServer->count();
122 bool serversChanged = TRUE; 122 bool serversChanged = TRUE;
123 int curSrv = cbTimeServer->currentItem(); 123 int curSrv = cbTimeServer->currentItem();
124 QString edit = cbTimeServer->currentText(); 124 QString edit = cbTimeServer->currentText();
125 for ( int i = 0; i < srvCount; i++ ) 125 for ( int i = 0; i < srvCount; i++ )
126 { 126 {
127 if ( edit == cbTimeServer->text( i ) ) 127 if ( edit == cbTimeServer->text( i ) )
128 serversChanged = FALSE; 128 serversChanged = FALSE;
129 } 129 }
130 if ( serversChanged ) 130 if ( serversChanged )
131 { 131 {
132 QString ntpSrvsFile = QPEApplication::qpeDir(); 132 QString ntpSrvsFile = QPEApplication::qpeDir();
133 ntpSrvsFile.append( "etc/ntpservers" ); 133 ntpSrvsFile.append( "etc/ntpservers" );
134 Config ntpSrvs( ntpSrvsFile, Config::File ); 134 Config ntpSrvs( ntpSrvsFile, Config::File );
diff --git a/noncore/settings/netsystemtime/timetabwidget.cpp b/noncore/settings/netsystemtime/timetabwidget.cpp
index 6f24462..1ea460e 100644
--- a/noncore/settings/netsystemtime/timetabwidget.cpp
+++ b/noncore/settings/netsystemtime/timetabwidget.cpp
@@ -57,97 +57,97 @@ TimeTabWidget::TimeTabWidget( QWidget *parent )
57 : QWidget( parent, 0x0, 0 ) 57 : QWidget( parent, 0x0, 0 )
58{ 58{
59 // Synchronize HW clock to systemtime 59 // Synchronize HW clock to systemtime
60 // This app will update systemtime 60 // This app will update systemtime
61 // - if Cancel is clicked, will reset systemtime to HW clock's time 61 // - if Cancel is clicked, will reset systemtime to HW clock's time
62 // - if Ok is clicked, will leave systemtime as is 62 // - if Ok is clicked, will leave systemtime as is
63 system("/sbin/hwclock --systohc --utc"); 63 system("/sbin/hwclock --systohc --utc");
64 64
65 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 65 QVBoxLayout *tmpvb = new QVBoxLayout( this );
66 QScrollView *sv = new QScrollView( this ); 66 QScrollView *sv = new QScrollView( this );
67 tmpvb->addWidget( sv, 0, 0 ); 67 tmpvb->addWidget( sv, 0, 0 );
68 sv->setResizePolicy( QScrollView::AutoOneFit ); 68 sv->setResizePolicy( QScrollView::AutoOneFit );
69 sv->setFrameStyle( QFrame::NoFrame ); 69 sv->setFrameStyle( QFrame::NoFrame );
70 QWidget *container = new QWidget( sv->viewport() ); 70 QWidget *container = new QWidget( sv->viewport() );
71 sv->addChild( container ); 71 sv->addChild( container );
72 72
73 QGridLayout *layout = new QGridLayout( container ); 73 QGridLayout *layout = new QGridLayout( container );
74 layout->setMargin( 2 ); 74 layout->setMargin( 2 );
75 layout->setSpacing( 4 ); 75 layout->setSpacing( 4 );
76 76
77 // Hours 77 // Hours
78 layout->addMultiCellWidget( new QLabel( tr( "Hour" ), container ), 1, 1, 0, 1 ); 78 layout->addMultiCellWidget( new QLabel( tr( "Hour" ), container ), 1, 1, 0, 1 );
79 sbHour = new QSpinBox( container ); 79 sbHour = new QSpinBox( container );
80 sbHour->setWrapping( TRUE ); 80 sbHour->setWrapping( TRUE );
81 layout->addMultiCellWidget( sbHour, 2, 2, 0, 1 ); 81 layout->addMultiCellWidget( sbHour, 2, 2, 0, 1 );
82 82
83 // Minutes 83 // Minutes
84 layout->addMultiCellWidget( new QLabel( tr( "Minute" ), container ), 1, 1, 2, 3 ); 84 layout->addMultiCellWidget( new QLabel( tr( "Minute" ), container ), 1, 1, 2, 3 );
85 sbMin = new QSpinBox( container ); 85 sbMin = new QSpinBox( container );
86 sbMin->setWrapping( TRUE ); 86 sbMin->setWrapping( TRUE );
87 sbMin->setMinValue( 0 ); 87 sbMin->setMinValue( 0 );
88 sbMin->setMaxValue( 59 ); 88 sbMin->setMaxValue( 59 );
89 layout->addMultiCellWidget( sbMin, 2, 2, 2, 3 ); 89 layout->addMultiCellWidget( sbMin, 2, 2, 2, 3 );
90 90
91 // AM/PM 91 // AM/PM
92 cbAmpm = new QComboBox( container ); 92 cbAmpm = new QComboBox( container );
93 cbAmpm->insertItem( tr( "AM" ), ValueAM ); 93 cbAmpm->insertItem( tr( "AM" ), ValueAM );
94 cbAmpm->insertItem( tr( "PM" ), ValuePM ); 94 cbAmpm->insertItem( tr( "PM" ), ValuePM );
95 layout->addMultiCellWidget( cbAmpm, 2, 2, 4, 5 ); 95 layout->addMultiCellWidget( cbAmpm, 2, 2, 4, 5 );
96 96
97 // Date 97 // Date
98 layout->addWidget( new QLabel( tr( "Date" ), container ), 4, 0 ); 98 layout->addWidget( new QLabel( tr( "Date" ), container ), 4, 0 );
99 btnDate = new DateButton( TRUE, container ); 99 btnDate = new DateButton( TRUE, container );
100 layout->addMultiCellWidget( btnDate, 4, 4, 1, 5 ); 100 layout->addMultiCellWidget( btnDate, 4, 4, 1, 5 );
101 101
102 // Timezone 102 // Timezone
103 layout->addMultiCellWidget( new QLabel( tr( "Time zone" ), container ), 6, 6, 0, 1 ); 103 layout->addMultiCellWidget( new QLabel( tr( "Time zone" ), container ), 6, 6, 0, 1 );
104 selTimeZone = new TimeZoneSelector( container ); 104 selTimeZone = new TimeZoneSelector( container );
105 connect( selTimeZone, SIGNAL(signalNewTz(const QString &)), this, SLOT(slotTZChanged(const QString &)) ); 105 connect( selTimeZone, SIGNAL(signalNewTz(const QString&)), this, SLOT(slotTZChanged(const QString&)) );
106 layout->addMultiCellWidget( selTimeZone, 6, 6, 2, 5 ); 106 layout->addMultiCellWidget( selTimeZone, 6, 6, 2, 5 );
107 107
108 // Space filler 108 // Space filler
109 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 ); 109 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 );
110 110
111 // Set NTP time button 111 // Set NTP time button
112 QPushButton *pb = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ), 112 QPushButton *pb = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ),
113 tr( "Get time from the network" ), container ); 113 tr( "Get time from the network" ), container );
114 connect( pb, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) ); 114 connect( pb, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) );
115 layout->addMultiCellWidget( pb, 8, 8, 0, 5 ); 115 layout->addMultiCellWidget( pb, 8, 8, 0, 5 );
116 116
117 // Set predicted time button 117 // Set predicted time button
118 pb = new QPushButton( Resource::loadPixmap( "netsystemtime/predicttab" ), tr( "Set predicted time" ), 118 pb = new QPushButton( Resource::loadPixmap( "netsystemtime/predicttab" ), tr( "Set predicted time" ),
119 container ); 119 container );
120 connect( pb, SIGNAL(clicked()), this, SIGNAL(getPredictedTime()) ); 120 connect( pb, SIGNAL(clicked()), this, SIGNAL(getPredictedTime()) );
121 layout->addMultiCellWidget( pb, 9, 9, 0, 5 ); 121 layout->addMultiCellWidget( pb, 9, 9, 0, 5 );
122 122
123 // Space filler at bottom of widget 123 // Space filler at bottom of widget
124 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 10, 0 ); 124 layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 10, 0 );
125 125
126 // Initialize values 126 // Initialize values
127 Config config( "locale" ); 127 Config config( "locale" );
128 config.setGroup( "Location" ); 128 config.setGroup( "Location" );
129 selTimeZone->setCurrentZone( config.readEntry( "Timezone", "America/New_York" ) ); 129 selTimeZone->setCurrentZone( config.readEntry( "Timezone", "America/New_York" ) );
130 use12HourTime = FALSE; 130 use12HourTime = FALSE;
131 setDateTime( QDateTime::currentDateTime() ); 131 setDateTime( QDateTime::currentDateTime() );
132} 132}
133 133
134TimeTabWidget::~TimeTabWidget() 134TimeTabWidget::~TimeTabWidget()
135{ 135{
136} 136}
137 137
138void TimeTabWidget::saveSettings( bool commit ) 138void TimeTabWidget::saveSettings( bool commit )
139{ 139{
140 if ( commit ) 140 if ( commit )
141 { 141 {
142 // Set timezone and announce to world 142 // Set timezone and announce to world
143 QString tz = selTimeZone->currentZone(); 143 QString tz = selTimeZone->currentZone();
144 Config config("locale"); 144 Config config("locale");
145 config.setGroup( "Location" ); 145 config.setGroup( "Location" );
146 config.writeEntry( "Timezone", tz ); 146 config.writeEntry( "Timezone", tz );
147 setenv( "TZ", tz, 1 ); 147 setenv( "TZ", tz, 1 );
148 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" ); 148 QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" );
149 setTimeZone << tz; 149 setTimeZone << tz;
150 150
151 // If controls have a valid date & time, update systemtime 151 // If controls have a valid date & time, update systemtime
152 int hour = sbHour->value(); 152 int hour = sbHour->value();
153 if ( use12HourTime && cbAmpm->currentItem() == ValuePM ) 153 if ( use12HourTime && cbAmpm->currentItem() == ValuePM )
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 698dfd3..ff65424 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1,77 +1,77 @@
1 1
2#include "interfaceinformationimp.h" 2#include "interfaceinformationimp.h"
3#include "interfaceadvanced.h" 3#include "interfaceadvanced.h"
4 4
5/* OPIE */ 5/* OPIE */
6#include <qpe/config.h> 6#include <qpe/config.h>
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9/* QT */ 9/* QT */
10#include <qcheckbox.h> 10#include <qcheckbox.h>
11#include <qpushbutton.h> 11#include <qpushbutton.h>
12#include <qlabel.h> 12#include <qlabel.h>
13#include <qgroupbox.h> 13#include <qgroupbox.h>
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15 15
16 16
17#ifdef QWS 17#ifdef QWS
18#else 18#else
19 #define showMaximized show 19 #define showMaximized show
20#endif 20#endif
21 21
22/** 22/**
23 * Constructor for the InterfaceInformationImp class. This class pretty much 23 * Constructor for the InterfaceInformationImp class. This class pretty much
24 * just display's information about the interface that is passed to it. 24 * just display's information about the interface that is passed to it.
25 */ 25 */
26InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) 26InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i)
27{ 27{
28 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 28 connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*)));
29 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); 29 connect(i, SIGNAL(updateMessage(const QString&)), this, SLOT(showMessage(const QString&)));
30 updateInterface(interface); 30 updateInterface(interface);
31 connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); 31 connect(startButton, SIGNAL(clicked()), interface, SLOT(start()));
32 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); 32 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop()));
33 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); 33 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart()));
34 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); 34 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh()));
35 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); 35 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced()));
36 Config cfg("networksettings", Config::User); 36 Config cfg("networksettings", Config::User);
37 cfg.setGroup("interface"); 37 cfg.setGroup("interface");
38 CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); 38 CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) );
39} 39}
40 40
41InterfaceInformationImp::~InterfaceInformationImp() 41InterfaceInformationImp::~InterfaceInformationImp()
42{ 42{
43 Config cfg("networksettings", Config::User); 43 Config cfg("networksettings", Config::User);
44 cfg.setGroup("interface"); 44 cfg.setGroup("interface");
45 cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); 45 cfg.writeEntry("silent", CheckBoxSilent->isChecked() );
46} 46}
47 47
48/** 48/**
49 * Update the interface information and buttons. 49 * Update the interface information and buttons.
50 * @param Intarface *i the interface to update (should be the one we already 50 * @param Intarface *i the interface to update (should be the one we already
51 * know about). 51 * know about).
52 */ 52 */
53void InterfaceInformationImp::updateInterface(Interface *) 53void InterfaceInformationImp::updateInterface(Interface *)
54{ 54{
55 if(interface->getStatus()) 55 if(interface->getStatus())
56 { 56 {
57 startButton->setEnabled(false); 57 startButton->setEnabled(false);
58 stopButton->setEnabled(true); 58 stopButton->setEnabled(true);
59 restartButton->setEnabled(true); 59 restartButton->setEnabled(true);
60 } 60 }
61 else 61 else
62 { 62 {
63 startButton->setEnabled(true); 63 startButton->setEnabled(true);
64 stopButton->setEnabled(false); 64 stopButton->setEnabled(false);
65 restartButton->setEnabled(false); 65 restartButton->setEnabled(false);
66 } 66 }
67 macAddressLabel->setText(interface->getMacAddress()); 67 macAddressLabel->setText(interface->getMacAddress());
68 ipAddressLabel->setText(interface->getIp()); 68 ipAddressLabel->setText(interface->getIp());
69 subnetMaskLabel->setText(interface->getSubnetMask()); 69 subnetMaskLabel->setText(interface->getSubnetMask());
70 broadcastLabel->setText(interface->getBroadcast()); 70 broadcastLabel->setText(interface->getBroadcast());
71} 71}
72 72
73/** 73/**
74 * Create the advanced widget. Fill it with the current interface's information. 74 * Create the advanced widget. Fill it with the current interface's information.
75 * Display it. 75 * Display it.
76 */ 76 */
77void InterfaceInformationImp::advanced() 77void InterfaceInformationImp::advanced()
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index b0a1dd9..1e16b97 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -52,97 +52,97 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
52 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); 52 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
53 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); 53 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
54 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); 54 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
55 55
56 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); 56 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
57 57
58 //FIXME: disable profiles for the moment: 58 //FIXME: disable profiles for the moment:
59 tabWidget->setTabEnabled( tab, false ); 59 tabWidget->setTabEnabled( tab, false );
60 60
61 // Load connections. 61 // Load connections.
62 // /usr/local/kde/lib/libinterfaces.la 62 // /usr/local/kde/lib/libinterfaces.la
63#ifdef QWS 63#ifdef QWS
64 loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); 64 loadModules(QPEApplication::qpeDir() + "plugins/networksettings");
65#else 65#else
66 loader = KLibLoader::self(); 66 loader = KLibLoader::self();
67 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); 67 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib"));
68#endif 68#endif
69 getAllInterfaces(); 69 getAllInterfaces();
70 70
71 Interfaces i; 71 Interfaces i;
72 QStringList list = i.getInterfaceList(); 72 QStringList list = i.getInterfaceList();
73 QMap<QString, Interface*>::Iterator it; 73 QMap<QString, Interface*>::Iterator it;
74 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) 74 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni )
75 { 75 {
76 /* 76 /*
77 * we skipped it in getAllInterfaces now 77 * we skipped it in getAllInterfaces now
78 * we need to ignore it as well 78 * we need to ignore it as well
79 */ 79 */
80 if (m_handledIfaces.contains( *ni) ) 80 if (m_handledIfaces.contains( *ni) )
81 { 81 {
82 qDebug("Not up iface handled by module"); 82 qDebug("Not up iface handled by module");
83 continue; 83 continue;
84 } 84 }
85 bool found = false; 85 bool found = false;
86 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) 86 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it )
87 { 87 {
88 if(it.key() == (*ni)) 88 if(it.key() == (*ni))
89 found = true; 89 found = true;
90 } 90 }
91 if(!found) 91 if(!found)
92 { 92 {
93 if(!(*ni).contains("_")) 93 if(!(*ni).contains("_"))
94 { 94 {
95 Interface *i = new Interface(this, *ni, false); 95 Interface *i = new Interface(this, *ni, false);
96 i->setAttached(false); 96 i->setAttached(false);
97 i->setHardwareName(tr("Disconnected")); 97 i->setHardwareName(tr("Disconnected"));
98 interfaceNames.insert(i->getInterfaceName(), i); 98 interfaceNames.insert(i->getInterfaceName(), i);
99 updateInterface(i); 99 updateInterface(i);
100 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 100 connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*)));
101 } 101 }
102 } 102 }
103 } 103 }
104 104
105 //getInterfaceList(); 105 //getInterfaceList();
106 connectionList->header()->hide(); 106 connectionList->header()->hide();
107 107
108 Config cfg("NetworkSetup"); 108 Config cfg("NetworkSetup");
109 profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); 109 profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All"));
110 for ( QStringList::Iterator it = profiles.begin(); 110 for ( QStringList::Iterator it = profiles.begin();
111 it != profiles.end(); ++it) 111 it != profiles.end(); ++it)
112 profilesList->insertItem((*it)); 112 profilesList->insertItem((*it));
113 currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); 113 currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All"));
114 advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); 114 advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false);
115 scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); 115 scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME);
116 116
117 QFile file(scheme); 117 QFile file(scheme);
118 if ( file.open(IO_ReadOnly) ) 118 if ( file.open(IO_ReadOnly) )
119 { // file opened successfully 119 { // file opened successfully
120 QTextStream stream( &file ); // use a text stream 120 QTextStream stream( &file ); // use a text stream
121 while ( !stream.eof() ) 121 while ( !stream.eof() )
122 { // until end of file... 122 { // until end of file...
123 QString line = stream.readLine(); // line of text excluding '\n' 123 QString line = stream.readLine(); // line of text excluding '\n'
124 if(line.contains("SCHEME")) 124 if(line.contains("SCHEME"))
125 { 125 {
126 line = line.mid(7, line.length()); 126 line = line.mid(7, line.length());
127 currentProfileLabel->setText(line); 127 currentProfileLabel->setText(line);
128 break; 128 break;
129 } 129 }
130 } 130 }
131 file.close(); 131 file.close();
132 } 132 }
133 makeChannel(); 133 makeChannel();
134} 134}
135 135
136/** 136/**
137 * Deconstructor. Save profiles. Delete loaded libraries. 137 * Deconstructor. Save profiles. Delete loaded libraries.
138 */ 138 */
139MainWindowImp::~MainWindowImp() 139MainWindowImp::~MainWindowImp()
140{ 140{
141 // Save profiles. 141 // Save profiles.
142 Config cfg("NetworkSetup"); 142 Config cfg("NetworkSetup");
143 cfg.setGroup("General"); 143 cfg.setGroup("General");
144 cfg.writeEntry("Profiles", profiles.join(" ")); 144 cfg.writeEntry("Profiles", profiles.join(" "));
145 145
146 // Delete all interfaces that don't have owners. 146 // Delete all interfaces that don't have owners.
147 QMap<Interface*, QListViewItem*>::Iterator iIt; 147 QMap<Interface*, QListViewItem*>::Iterator iIt;
148 for( iIt = items.begin(); iIt != items.end(); ++iIt ) 148 for( iIt = items.begin(); iIt != items.end(); ++iIt )
@@ -207,114 +207,114 @@ void MainWindowImp::getAllInterfaces()
207 procTs.readLine(); // eat a line 207 procTs.readLine(); // eat a line
208 while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) 208 while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null)
209 { 209 {
210 if((loc = line.find(":")) != -1) 210 if((loc = line.find(":")) != -1)
211 { 211 {
212 ifaces += line.left(loc); 212 ifaces += line.left(loc);
213 } 213 }
214 } 214 }
215 } 215 }
216 216
217 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) 217 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it)
218 { 218 {
219 int flags = 0; 219 int flags = 0;
220 if ( m_handledIfaces.contains( (*it) ) ) 220 if ( m_handledIfaces.contains( (*it) ) )
221 { 221 {
222 qDebug(" %s is handled by a module", (*it).latin1() ); 222 qDebug(" %s is handled by a module", (*it).latin1() );
223 continue; 223 continue;
224 } 224 }
225 // int family; 225 // int family;
226 i = NULL; 226 i = NULL;
227 227
228 strcpy(ifr.ifr_name, (*it).latin1()); 228 strcpy(ifr.ifr_name, (*it).latin1());
229 229
230 struct ifreq ifcopy; 230 struct ifreq ifcopy;
231 ifcopy = ifr; 231 ifcopy = ifr;
232 result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); 232 result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy);
233 flags = ifcopy.ifr_flags; 233 flags = ifcopy.ifr_flags;
234 i = new Interface(this, ifr.ifr_name, false); 234 i = new Interface(this, ifr.ifr_name, false);
235 i->setAttached(true); 235 i->setAttached(true);
236 if ((flags & IFF_UP) == IFF_UP) 236 if ((flags & IFF_UP) == IFF_UP)
237 i->setStatus(true); 237 i->setStatus(true);
238 else 238 else
239 i->setStatus(false); 239 i->setStatus(false);
240 240
241 if ((flags & IFF_BROADCAST) == IFF_BROADCAST) 241 if ((flags & IFF_BROADCAST) == IFF_BROADCAST)
242 i->setHardwareName("Ethernet"); 242 i->setHardwareName("Ethernet");
243 else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) 243 else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT)
244 i->setHardwareName("Point to Point"); 244 i->setHardwareName("Point to Point");
245 else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) 245 else if ((flags & IFF_MULTICAST) == IFF_MULTICAST)
246 i->setHardwareName("Multicast"); 246 i->setHardwareName("Multicast");
247 else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) 247 else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK)
248 i->setHardwareName("Loopback"); 248 i->setHardwareName("Loopback");
249 else 249 else
250 i->setHardwareName("Unknown"); 250 i->setHardwareName("Unknown");
251 251
252 qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); 252 qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name);
253 interfaceNames.insert(i->getInterfaceName(), i); 253 interfaceNames.insert(i->getInterfaceName(), i);
254 updateInterface(i); 254 updateInterface(i);
255 connect(i, SIGNAL(updateInterface(Interface *)), 255 connect(i, SIGNAL(updateInterface(Interface*)),
256 this, SLOT(updateInterface(Interface *))); 256 this, SLOT(updateInterface(Interface*)));
257 } 257 }
258 // now lets ask the plugins too ;) 258 // now lets ask the plugins too ;)
259 QMap<Module*, QLibrary*>::Iterator it; 259 QMap<Module*, QLibrary*>::Iterator it;
260 QList<Interface> ilist; 260 QList<Interface> ilist;
261 for( it = libraries.begin(); it != libraries.end(); ++it ) 261 for( it = libraries.begin(); it != libraries.end(); ++it )
262 { 262 {
263 if(it.key()) 263 if(it.key())
264 { 264 {
265 ilist = it.key()->getInterfaces(); 265 ilist = it.key()->getInterfaces();
266 for( i = ilist.first(); i != 0; i = ilist.next() ) 266 for( i = ilist.first(); i != 0; i = ilist.next() )
267 { 267 {
268 qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); 268 qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() );
269 interfaceNames.insert(i->getInterfaceName(), i); 269 interfaceNames.insert(i->getInterfaceName(), i);
270 updateInterface(i); 270 updateInterface(i);
271 connect(i, SIGNAL(updateInterface(Interface *)), 271 connect(i, SIGNAL(updateInterface(Interface*)),
272 this, SLOT(updateInterface(Interface *))); 272 this, SLOT(updateInterface(Interface*)));
273 } 273 }
274 } 274 }
275 } 275 }
276} 276}
277 277
278/** 278/**
279 * Load all modules that are found in the path 279 * Load all modules that are found in the path
280 * @param path a directory that is scaned for any plugins that can be loaded 280 * @param path a directory that is scaned for any plugins that can be loaded
281 * and attempts to load them 281 * and attempts to load them
282 */ 282 */
283void MainWindowImp::loadModules(const QString &path) 283void MainWindowImp::loadModules(const QString &path)
284{ 284{
285#ifdef DEBUG 285#ifdef DEBUG
286 qDebug("MainWindowImp::loadModules: %s", path.latin1()); 286 qDebug("MainWindowImp::loadModules: %s", path.latin1());
287#endif 287#endif
288 QDir d(path); 288 QDir d(path);
289 if(!d.exists()) 289 if(!d.exists())
290 return; 290 return;
291 291
292 // Don't want sym links 292 // Don't want sym links
293 d.setFilter( QDir::Files | QDir::NoSymLinks ); 293 d.setFilter( QDir::Files | QDir::NoSymLinks );
294 const QFileInfoList *list = d.entryInfoList(); 294 const QFileInfoList *list = d.entryInfoList();
295 QFileInfoListIterator it( *list ); 295 QFileInfoListIterator it( *list );
296 QFileInfo *fi; 296 QFileInfo *fi;
297 while ( (fi=it.current()) ) 297 while ( (fi=it.current()) )
298 { 298 {
299#ifdef QWS 299#ifdef QWS
300 if(fi->fileName().contains(".so")) 300 if(fi->fileName().contains(".so"))
301 { 301 {
302#else 302#else
303 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_")) 303 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_"))
304 { 304 {
305#endif 305#endif
306 loadPlugin(path + "/" + fi->fileName()); 306 loadPlugin(path + "/" + fi->fileName());
307 qDebug("loaded plugin: >%s< ",QString(path + "/" + fi->fileName()).latin1()); 307 qDebug("loaded plugin: >%s< ",QString(path + "/" + fi->fileName()).latin1());
308 } 308 }
309 ++it; 309 ++it;
310 } 310 }
311} 311}
312 312
313/** 313/**
314 * Attempt to load a function and resolve a function. 314 * Attempt to load a function and resolve a function.
315 * @param pluginFileName - the name of the file in which to attempt to load 315 * @param pluginFileName - the name of the file in which to attempt to load
316 * @param resolveString - function pointer to resolve 316 * @param resolveString - function pointer to resolve
317 * @return pointer to the function with name resolveString or NULL 317 * @return pointer to the function with name resolveString or NULL
318 */ 318 */
319Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString) 319Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString)
320{ 320{
@@ -667,82 +667,82 @@ void MainWindowImp::removeProfile()
667 break; 667 break;
668 } 668 }
669 } 669 }
670 } 670 }
671} 671}
672 672
673/** 673/**
674 * A new profile has been selected, change. 674 * A new profile has been selected, change.
675 * @param newProfile the new profile. 675 * @param newProfile the new profile.
676 */ 676 */
677void MainWindowImp::changeProfile() 677void MainWindowImp::changeProfile()
678{ 678{
679 if(profilesList->currentItem() == -1) 679 if(profilesList->currentItem() == -1)
680 { 680 {
681 QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok); 681 QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok);
682 return; 682 return;
683 } 683 }
684 QString newProfile = profilesList->text(profilesList->currentItem()); 684 QString newProfile = profilesList->text(profilesList->currentItem());
685 if(newProfile != currentProfileLabel->text()) 685 if(newProfile != currentProfileLabel->text())
686 { 686 {
687 currentProfileLabel->setText(newProfile); 687 currentProfileLabel->setText(newProfile);
688 QFile::remove(scheme); 688 QFile::remove(scheme);
689 QFile file(scheme); 689 QFile file(scheme);
690 if ( file.open(IO_ReadWrite) ) 690 if ( file.open(IO_ReadWrite) )
691 { 691 {
692 QTextStream stream( &file ); 692 QTextStream stream( &file );
693 stream << QString("SCHEME=%1").arg(newProfile); 693 stream << QString("SCHEME=%1").arg(newProfile);
694 file.close(); 694 file.close();
695 } 695 }
696 // restart all up devices? 696 // restart all up devices?
697 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) 697 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok)
698 { 698 {
699 // Go through them one by one 699 // Go through them one by one
700 QMap<Interface*, QListViewItem*>::Iterator it; 700 QMap<Interface*, QListViewItem*>::Iterator it;
701 for( it = items.begin(); it != items.end(); ++it ) 701 for( it = items.begin(); it != items.end(); ++it )
702 { 702 {
703 if(it.key()->getStatus() == true) 703 if(it.key()->getStatus() == true)
704 it.key()->restart(); 704 it.key()->restart();
705 } 705 }
706 } 706 }
707 } 707 }
708 // TODO change the profile in the modules 708 // TODO change the profile in the modules
709} 709}
710 710
711 711
712void MainWindowImp::makeChannel() 712void MainWindowImp::makeChannel()
713{ 713{
714 channel = new QCopChannel( "QPE/Application/networksettings", this ); 714 channel = new QCopChannel( "QPE/Application/networksettings", this );
715 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 715 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
716 this, SLOT(receive(const QCString&, const QByteArray&)) ); 716 this, SLOT(receive(const QCString&,const QByteArray&)) );
717} 717}
718 718
719void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) 719void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
720{ 720{
721 bool found = false; 721 bool found = false;
722 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 722 qDebug("MainWindowImp::receive QCop msg >"+msg+"<");
723 if (msg == "raise") 723 if (msg == "raise")
724 { 724 {
725 raise(); 725 raise();
726 return; 726 return;
727 } 727 }
728 728
729 QString dest = msg.left(msg.find("(")); 729 QString dest = msg.left(msg.find("("));
730 QCString param = msg.right(msg.length() - msg.find("(") - 1); 730 QCString param = msg.right(msg.length() - msg.find("(") - 1);
731 param = param.left( param.length() - 1 ); 731 param = param.left( param.length() - 1 );
732 qDebug("dest >%s< param >"+param+"<",dest.latin1()); 732 qDebug("dest >%s< param >"+param+"<",dest.latin1());
733 733
734 QMap<Module*, QLibrary*>::Iterator it; 734 QMap<Module*, QLibrary*>::Iterator it;
735 for( it = libraries.begin(); it != libraries.end(); ++it ) 735 for( it = libraries.begin(); it != libraries.end(); ++it )
736 { 736 {
737 qDebug("plugin >%s<", it.key()->type().latin1() ); 737 qDebug("plugin >%s<", it.key()->type().latin1() );
738 if(it.key()->type() == dest) 738 if(it.key()->type() == dest)
739 { 739 {
740 it.key()->receive( param, arg ); 740 it.key()->receive( param, arg );
741 found = true; 741 found = true;
742 } 742 }
743 } 743 }
744 744
745 745
746 if (found) QPEApplication::setKeepRunning(); 746 if (found) QPEApplication::setKeepRunning();
747 else qDebug("Huh what do ya want"); 747 else qDebug("Huh what do ya want");
748} 748}
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 7d21605..3b2393c 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -527,98 +527,98 @@ void IPWidget::hitIPSelect( int i )
527DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char *name ) 527DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char *name )
528 : QWidget(parent, name), _pppdata(pd) 528 : QWidget(parent, name), _pppdata(pd)
529{ 529{
530 QGridLayout *tl = new QGridLayout(this, 7, 2, 0 ); 530 QGridLayout *tl = new QGridLayout(this, 7, 2, 0 );
531 531
532 dnsdomain_label = new QLabel(tr("Domain name:"), this); 532 dnsdomain_label = new QLabel(tr("Domain name:"), this);
533 tl->addWidget(dnsdomain_label, 0, 0); 533 tl->addWidget(dnsdomain_label, 0, 0);
534 534
535 dnsdomain = new QLineEdit(this); 535 dnsdomain = new QLineEdit(this);
536 536
537 tl->addWidget(dnsdomain, 0, 1); 537 tl->addWidget(dnsdomain, 0, 1);
538 QString tmp = tr("If you enter a domain name here, this domain\n" 538 QString tmp = tr("If you enter a domain name here, this domain\n"
539 "name is used for your computer while you are\n" 539 "name is used for your computer while you are\n"
540 "connected. When the connection is closed, the\n" 540 "connected. When the connection is closed, the\n"
541 "original domain name of your computer is\n" 541 "original domain name of your computer is\n"
542 "restored.\n" 542 "restored.\n"
543 "\n" 543 "\n"
544 "If you leave this field blank, no changes are\n" 544 "If you leave this field blank, no changes are\n"
545 "made to the domain name."); 545 "made to the domain name.");
546 546
547 QWhatsThis::add(dnsdomain_label,tmp); 547 QWhatsThis::add(dnsdomain_label,tmp);
548 QWhatsThis::add(dnsdomain,tmp); 548 QWhatsThis::add(dnsdomain,tmp);
549 549
550 conf_label = new QLabel(tr("Configuration:"), this); 550 conf_label = new QLabel(tr("Configuration:"), this);
551 tl->addWidget(conf_label, 1, 0); 551 tl->addWidget(conf_label, 1, 0);
552 552
553 bg = new QButtonGroup("Group", this); 553 bg = new QButtonGroup("Group", this);
554 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); 554 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int)));
555 bg->hide(); 555 bg->hide();
556 556
557 autodns = new QRadioButton(tr("Automatic"), this); 557 autodns = new QRadioButton(tr("Automatic"), this);
558 bg->insert(autodns, 0); 558 bg->insert(autodns, 0);
559 tl->addWidget(autodns, 1, 1); 559 tl->addWidget(autodns, 1, 1);
560 if(!_pppdata->pppdVersionMin(2, 3, 7)) 560 if(!_pppdata->pppdVersionMin(2, 3, 7))
561 autodns->setEnabled(false); 561 autodns->setEnabled(false);
562 562
563 mandns = new QRadioButton(tr("Manual"), this); 563 mandns = new QRadioButton(tr("Manual"), this);
564 bg->insert(mandns, 1); 564 bg->insert(mandns, 1);
565 tl->addWidget(mandns, 2, 1); 565 tl->addWidget(mandns, 2, 1);
566 566
567 dns_label = new QLabel(tr("DNS IP address:"), this); 567 dns_label = new QLabel(tr("DNS IP address:"), this);
568 tl->addWidget(dns_label, 3, 0); 568 tl->addWidget(dns_label, 3, 0);
569 569
570 QHBoxLayout *l2 = new QHBoxLayout; 570 QHBoxLayout *l2 = new QHBoxLayout;
571 tl->addLayout(l2, 3, 1); 571 tl->addLayout(l2, 3, 1);
572 dnsipaddr = new IPLineEdit(this); 572 dnsipaddr = new IPLineEdit(this);
573 connect(dnsipaddr, SIGNAL(returnPressed()), 573 connect(dnsipaddr, SIGNAL(returnPressed()),
574 SLOT(adddns())); 574 SLOT(adddns()));
575 connect(dnsipaddr, SIGNAL(textChanged(const QString &)), 575 connect(dnsipaddr, SIGNAL(textChanged(const QString&)),
576 SLOT(DNS_Edit_Changed(const QString &))); 576 SLOT(DNS_Edit_Changed(const QString&)));
577 l2->addWidget(dnsipaddr, 1); 577 l2->addWidget(dnsipaddr, 1);
578 l2->addStretch(1); 578 l2->addStretch(1);
579 tmp = tr("<p>Allows you to specify a new DNS server to be\n" 579 tmp = tr("<p>Allows you to specify a new DNS server to be\n"
580 "used while you are connected. When the\n" 580 "used while you are connected. When the\n"
581 "connection is closed, this DNS entry will be\n" 581 "connection is closed, this DNS entry will be\n"
582 "removed again.\n" 582 "removed again.\n"
583 "\n" 583 "\n"
584 "To add a DNS server, type in the IP address of\n" 584 "To add a DNS server, type in the IP address of\n"
585 "the DNS server here and click on <b>Add</b>"); 585 "the DNS server here and click on <b>Add</b>");
586 586
587 QWhatsThis::add(dns_label, tmp); 587 QWhatsThis::add(dns_label, tmp);
588 QWhatsThis::add(dnsipaddr, tmp); 588 QWhatsThis::add(dnsipaddr, tmp);
589 589
590 QHBoxLayout *l1 = new QHBoxLayout; 590 QHBoxLayout *l1 = new QHBoxLayout;
591 tl->addLayout(l1, 4, 1); 591 tl->addLayout(l1, 4, 1);
592 add = new QPushButton(tr("Add"), this); 592 add = new QPushButton(tr("Add"), this);
593 connect(add, SIGNAL(clicked()), SLOT(adddns())); 593 connect(add, SIGNAL(clicked()), SLOT(adddns()));
594 l1->addWidget(add); 594 l1->addWidget(add);
595 // l1->addStretch(1); 595 // l1->addStretch(1);
596 QWhatsThis::add(add, 596 QWhatsThis::add(add,
597 tr("Click this button to add the DNS server\n" 597 tr("Click this button to add the DNS server\n"
598 "specified in the field above. The entry\n" 598 "specified in the field above. The entry\n"
599 "will then be added to the list below")); 599 "will then be added to the list below"));
600 600
601 remove = new QPushButton(tr("Remove"), this); 601 remove = new QPushButton(tr("Remove"), this);
602 connect(remove, SIGNAL(clicked()), SLOT(removedns())); 602 connect(remove, SIGNAL(clicked()), SLOT(removedns()));
603 l1->addWidget(remove); 603 l1->addWidget(remove);
604 QWhatsThis::add(remove, 604 QWhatsThis::add(remove,
605 tr("Click this button to remove the selected DNS\n" 605 tr("Click this button to remove the selected DNS\n"
606 "server entry from the list below")); 606 "server entry from the list below"));
607 607
608 servers_label = new QLabel(tr("DNS address list:"), this); 608 servers_label = new QLabel(tr("DNS address list:"), this);
609 servers_label->setAlignment(AlignTop|AlignLeft); 609 servers_label->setAlignment(AlignTop|AlignLeft);
610 tl->addWidget(servers_label, 5, 0); 610 tl->addWidget(servers_label, 5, 0);
611 611
612 dnsservers = new QListBox(this); 612 dnsservers = new QListBox(this);
613 dnsservers->setMinimumSize(150, 80); 613 dnsservers->setMinimumSize(150, 80);
614 connect(dnsservers, SIGNAL(highlighted(int)), 614 connect(dnsservers, SIGNAL(highlighted(int)),
615 SLOT(DNS_Entry_Selected(int))); 615 SLOT(DNS_Entry_Selected(int)));
616 tl->addWidget(dnsservers, 5, 1); 616 tl->addWidget(dnsservers, 5, 1);
617 tmp = tr("<p>This shows all defined DNS servers to use\n" 617 tmp = tr("<p>This shows all defined DNS servers to use\n"
618 "while you are connected. Use the <b>Add</b> and\n" 618 "while you are connected. Use the <b>Add</b> and\n"
619 "<b>Remove</b> buttons to modify the list"); 619 "<b>Remove</b> buttons to modify the list");
620 620
621 QWhatsThis::add(servers_label,tmp); 621 QWhatsThis::add(servers_label,tmp);
622 QWhatsThis::add(dnsservers,tmp); 622 QWhatsThis::add(dnsservers,tmp);
623 623
624 exdnsdisabled_toggle = new QCheckBox(tr("Disable DNS servers during connection"), this); 624 exdnsdisabled_toggle = new QCheckBox(tr("Disable DNS servers during connection"), this);
@@ -1139,73 +1139,73 @@ void ScriptWidget::insertButton()
1139 break; 1139 break;
1140 } 1140 }
1141 adjustScrollBar(); 1141 adjustScrollBar();
1142 se->setText(""); 1142 se->setText("");
1143} 1143}
1144 1144
1145 1145
1146void ScriptWidget::removeButton() 1146void ScriptWidget::removeButton()
1147{ 1147{
1148 if(sl->currentItem() >= 0) 1148 if(sl->currentItem() >= 0)
1149 { 1149 {
1150 int stlc = stl->currentItem(); 1150 int stlc = stl->currentItem();
1151 sl->removeItem(sl->currentItem()); 1151 sl->removeItem(sl->currentItem());
1152 stl->removeItem(stlc); 1152 stl->removeItem(stlc);
1153 adjustScrollBar(); 1153 adjustScrollBar();
1154 insert->setEnabled(sl->currentItem() != -1); 1154 insert->setEnabled(sl->currentItem() != -1);
1155 remove->setEnabled(sl->currentItem() != -1); 1155 remove->setEnabled(sl->currentItem() != -1);
1156 } 1156 }
1157} 1157}
1158 1158
1159 1159
1160 1160
1161///////////////////////////////////////////////////////////////////////////// 1161/////////////////////////////////////////////////////////////////////////////
1162// 1162//
1163// Used to specify a new phone number 1163// Used to specify a new phone number
1164// 1164//
1165///////////////////////////////////////////////////////////////////////////// 1165/////////////////////////////////////////////////////////////////////////////
1166PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) 1166PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1167 : QDialog(parent,"PhoneNumberDialog",true) 1167 : QDialog(parent,"PhoneNumberDialog",true)
1168{ 1168{
1169 setCaption( tr("Add Phone Number") ); 1169 setCaption( tr("Add Phone Number") );
1170 1170
1171 1171
1172 QVBoxLayout *layout = new QVBoxLayout( this ); 1172 QVBoxLayout *layout = new QVBoxLayout( this );
1173 layout->setSpacing( 3 ); 1173 layout->setSpacing( 3 );
1174 layout->setMargin( 3 ); 1174 layout->setMargin( 3 );
1175 1175
1176 // QHBox *hbox = new QHBox(this); 1176 // QHBox *hbox = new QHBox(this);
1177 // setMainWidget(hbox); 1177 // setMainWidget(hbox);
1178 1178
1179 // hbox->setSpacing( 2 );//KDialog::spacingHint()); 1179 // hbox->setSpacing( 2 );//KDialog::spacingHint());
1180 1180
1181 QLabel *label = new QLabel(this, tr("Enter a phone number:")); 1181 QLabel *label = new QLabel(this, tr("Enter a phone number:"));
1182 layout->addWidget( label ); 1182 layout->addWidget( label );
1183 1183
1184 le = new QLineEdit(this, "lineEdit"); 1184 le = new QLineEdit(this, "lineEdit");
1185 layout->addWidget( le ); 1185 layout->addWidget( le );
1186 1186
1187 connect(le, SIGNAL(textChanged(const QString &)), 1187 connect(le, SIGNAL(textChanged(const QString&)),
1188 this, SLOT(textChanged(const QString &))); 1188 this, SLOT(textChanged(const QString&)));
1189 1189
1190 le->setFocus(); 1190 le->setFocus();
1191 textChanged(""); 1191 textChanged("");
1192 1192
1193 1193
1194} 1194}
1195 1195
1196 1196
1197QString PhoneNumberDialog::phoneNumber() 1197QString PhoneNumberDialog::phoneNumber()
1198{ 1198{
1199 QString s = le->text(); 1199 QString s = le->text();
1200 1200
1201 return s; 1201 return s;
1202} 1202}
1203 1203
1204 1204
1205void PhoneNumberDialog::textChanged(const QString &s) 1205void PhoneNumberDialog::textChanged(const QString &s)
1206{ 1206{
1207 // enableButtonOK(s.length() > 0); 1207 // enableButtonOK(s.length() > 0);
1208} 1208}
1209 1209
1210 1210
1211//#include "edit.moc" 1211//#include "edit.moc"
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index ff1b11b..81dab38 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -39,98 +39,98 @@
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qlabel.h> 40#include <qlabel.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qpushbutton.h> 42#include <qpushbutton.h>
43#include <qslider.h> 43#include <qslider.h>
44#include <qspinbox.h> 44#include <qspinbox.h>
45#include <qwhatsthis.h> 45#include <qwhatsthis.h>
46 46
47/* STD */ 47/* STD */
48#include <termios.h> 48#include <termios.h>
49#include <string.h> 49#include <string.h>
50 50
51 51
52ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) 52ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
53 : QWidget(parent, name), _pppdata(pd) 53 : QWidget(parent, name), _pppdata(pd)
54{ 54{
55 int k; 55 int k;
56 56
57 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint()); 57 QGridLayout *tl = new QGridLayout(this, 8, 2, 0 );//, KDialog::spacingHint());
58 58
59 QLabel *label1; 59 QLabel *label1;
60 60
61 label1 = new QLabel(tr("Modem &name:"), this); 61 label1 = new QLabel(tr("Modem &name:"), this);
62 tl->addWidget(label1, 0, 0); 62 tl->addWidget(label1, 0, 0);
63 63
64 modemname = new QLineEdit(this, "modemName"); 64 modemname = new QLineEdit(this, "modemName");
65 modemname->setText( _pppdata->devname() ); 65 modemname->setText( _pppdata->devname() );
66 label1->setBuddy(modemname); 66 label1->setBuddy(modemname);
67 tl->addWidget(modemname, 0, 1); 67 tl->addWidget(modemname, 0, 1);
68 68
69 label1 = new QLabel(tr("Modem de&vice:"), this); 69 label1 = new QLabel(tr("Modem de&vice:"), this);
70 tl->addWidget(label1, 1, 0); 70 tl->addWidget(label1, 1, 0);
71 71
72 modemdevice = new QComboBox(false, this); 72 modemdevice = new QComboBox(false, this);
73 modemdevice->setEditable( true ); 73 modemdevice->setEditable( true );
74 modemdevice->setDuplicatesEnabled ( false ); 74 modemdevice->setDuplicatesEnabled ( false );
75 modemdevice->setInsertionPolicy( QComboBox::AtTop ); 75 modemdevice->setInsertionPolicy( QComboBox::AtTop );
76 label1->setBuddy(modemdevice); 76 label1->setBuddy(modemdevice);
77 77
78 Config cfg("NetworkSetupPPP"); 78 Config cfg("NetworkSetupPPP");
79 cfg.setGroup("Devices_General"); 79 cfg.setGroup("Devices_General");
80 QStringList devs = cfg.readListEntry("devices",','); 80 QStringList devs = cfg.readListEntry("devices",',');
81 if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0"; 81 if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0";
82 modemdevice->insertStringList( devs ); 82 modemdevice->insertStringList( devs );
83 tl->addWidget(modemdevice, 1, 1); 83 tl->addWidget(modemdevice, 1, 1);
84 84
85 // connect(modemdevice, SIGNAL(activated(int)), 85 // connect(modemdevice, SIGNAL(activated(int)),
86 // SLOT(setmodemdc(int))); 86 // SLOT(setmodemdc(int)));
87 // connect(modemdevice, SIGNAL(textChanged( const QString & ) ), 87 // connect(modemdevice, SIGNAL(textChanged(const QString&) ),
88 // SLOT( setmodemdc( const QString &) ) ); 88 // SLOT( setmodemdc(const QString&) ) );
89 89
90 QString tmp = tr("This specifies the serial port your modem is attached \n" 90 QString tmp = tr("This specifies the serial port your modem is attached \n"
91 "to. On Linux/x86, typically this is either /dev/ttyS0 \n" 91 "to. On Linux/x86, typically this is either /dev/ttyS0 \n"
92 "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n" 92 "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n"
93 "\n" 93 "\n"
94 "If you have an internal ISDN card with AT command\n" 94 "If you have an internal ISDN card with AT command\n"
95 "emulation (most cards under Linux support this), you\n" 95 "emulation (most cards under Linux support this), you\n"
96 "should select one of the /dev/ttyIx devices."); 96 "should select one of the /dev/ttyIx devices.");
97 97
98 QWhatsThis::add(label1,tmp); 98 QWhatsThis::add(label1,tmp);
99 QWhatsThis::add(modemdevice,tmp); 99 QWhatsThis::add(modemdevice,tmp);
100 100
101 101
102 label1 = new QLabel(tr("&Flow control:"), this); 102 label1 = new QLabel(tr("&Flow control:"), this);
103 tl->addWidget(label1, 2, 0); 103 tl->addWidget(label1, 2, 0);
104 104
105 flowcontrol = new QComboBox(false, this); 105 flowcontrol = new QComboBox(false, this);
106 label1->setBuddy(flowcontrol); 106 label1->setBuddy(flowcontrol);
107 flowcontrol->insertItem(tr("Hardware [CRTSCTS]")); 107 flowcontrol->insertItem(tr("Hardware [CRTSCTS]"));
108 flowcontrol->insertItem(tr("Software [XON/XOFF]")); 108 flowcontrol->insertItem(tr("Software [XON/XOFF]"));
109 flowcontrol->insertItem(tr("None")); 109 flowcontrol->insertItem(tr("None"));
110 tl->addWidget(flowcontrol, 2, 1); 110 tl->addWidget(flowcontrol, 2, 1);
111 // connect(flowcontrol, SIGNAL(activated(int)), 111 // connect(flowcontrol, SIGNAL(activated(int)),
112 // SLOT(setflowcontrol(int))); 112 // SLOT(setflowcontrol(int)));
113 113
114 tmp = tr("<p>Specifies how the serial port and modem\n" 114 tmp = tr("<p>Specifies how the serial port and modem\n"
115 "communicate. You should not change this unless\n" 115 "communicate. You should not change this unless\n"
116 "you know what you are doing.\n" 116 "you know what you are doing.\n"
117 "\n" 117 "\n"
118 "<b>Default</b>: CRTSCTS"); 118 "<b>Default</b>: CRTSCTS");
119 119
120 QWhatsThis::add(label1,tmp); 120 QWhatsThis::add(label1,tmp);
121 QWhatsThis::add(flowcontrol,tmp); 121 QWhatsThis::add(flowcontrol,tmp);
122 122
123 QLabel *labelenter = new QLabel(tr("&Line termination:"), this); 123 QLabel *labelenter = new QLabel(tr("&Line termination:"), this);
124 tl->addWidget(labelenter, 3, 0); 124 tl->addWidget(labelenter, 3, 0);
125 125
126 enter = new QComboBox(false, this); 126 enter = new QComboBox(false, this);
127 labelenter->setBuddy(enter); 127 labelenter->setBuddy(enter);
128 enter->insertItem("CR"); 128 enter->insertItem("CR");
129 enter->insertItem("LF"); 129 enter->insertItem("LF");
130 enter->insertItem("CR/LF"); 130 enter->insertItem("CR/LF");
131 tl->addWidget(enter, 3, 1); 131 tl->addWidget(enter, 3, 1);
132 // connect(enter, SIGNAL(activated(int)), SLOT(setenter(int))); 132 // connect(enter, SIGNAL(activated(int)), SLOT(setenter(int)));
133 tmp = tr("<p>Specifies how AT commands are sent to your\n" 133 tmp = tr("<p>Specifies how AT commands are sent to your\n"
134 "modem. Most modems will work fine with the\n" 134 "modem. Most modems will work fine with the\n"
135 "default <i>CR/LF</i>. If your modem does not react\n" 135 "default <i>CR/LF</i>. If your modem does not react\n"
136 "to the init string, you should try different\n" 136 "to the init string, you should try different\n"
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index e466358..e21bbc7 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -351,101 +351,101 @@ void KPPPWidget::shutDown() {
351 interruptConnection(); 351 interruptConnection();
352 saveMyself(); 352 saveMyself();
353} 353}
354 354
355void KPPPWidget::log_window_toggled(bool on) { 355void KPPPWidget::log_window_toggled(bool on) {
356 _pppdata->set_show_log_window(on); 356 _pppdata->set_show_log_window(on);
357} 357}
358 358
359 359
360 360
361 361
362// void KPPPWidget::resetaccounts() { 362// void KPPPWidget::resetaccounts() {
363// connectto_c->clear(); 363// connectto_c->clear();
364 364
365// int count = _pppdata->count(); 365// int count = _pppdata->count();
366 366
367// // enable/disable controls 367// // enable/disable controls
368// connectto_c->setEnabled(count > 0); 368// connectto_c->setEnabled(count > 0);
369// connect_b->setEnabled(count > 0); 369// connect_b->setEnabled(count > 0);
370// log->setEnabled(count > 0); 370// log->setEnabled(count > 0);
371// ID_Edit->setEnabled(count > 0); 371// ID_Edit->setEnabled(count > 0);
372// PW_Edit->setEnabled(count > 0); 372// PW_Edit->setEnabled(count > 0);
373 373
374// //load the accounts 374// //load the accounts
375// for(int i=0; i < count; i++) { 375// for(int i=0; i < count; i++) {
376// _pppdata->setAccountbyIndex(i); 376// _pppdata->setAccountbyIndex(i);
377// connectto_c->insertItem(_pppdata->accname()); 377// connectto_c->insertItem(_pppdata->accname());
378// } 378// }
379 379
380// //set the default account 380// //set the default account
381// if(!_pppdata->defaultAccount().isEmpty()) { 381// if(!_pppdata->defaultAccount().isEmpty()) {
382// for(int i=0; i < count; i++) 382// for(int i=0; i < count; i++)
383// if(_pppdata->defaultAccount() == connectto_c->text(i)) { 383// if(_pppdata->defaultAccount() == connectto_c->text(i)) {
384 // connectto_c->setCurrentItem(i); 384 // connectto_c->setCurrentItem(i);
385 // _pppdata->setAccountbyIndex(i); 385 // _pppdata->setAccountbyIndex(i);
386 386
387 // ID_Edit->setText(_pppdata->storedUsername()); 387 // ID_Edit->setText(_pppdata->storedUsername());
388 // PW_Edit->setText(_pppdata->storedPassword()); 388 // PW_Edit->setText(_pppdata->storedPassword());
389// } 389// }
390// } 390// }
391// else 391// else
392// if(count > 0) { 392// if(count > 0) {
393// _pppdata->setDefaultAccount(connectto_c->text(0)); 393// _pppdata->setDefaultAccount(connectto_c->text(0));
394// _pppdata->save(); 394// _pppdata->save();
395 // ID_Edit->setText(_pppdata->storedUsername()); 395 // ID_Edit->setText(_pppdata->storedUsername());
396 // PW_Edit->setText(_pppdata->storedPassword()); 396 // PW_Edit->setText(_pppdata->storedPassword());
397// } 397// }
398 398
399// connect(ID_Edit, SIGNAL(textChanged(const QString &)), 399// connect(ID_Edit, SIGNAL(textChanged(const QString&)),
400 // this, SLOT(usernameChanged(const QString &))); 400 // this, SLOT(usernameChanged(const QString&)));
401 401
402// connect(PW_Edit, SIGNAL(textChanged(const QString &)), 402// connect(PW_Edit, SIGNAL(textChanged(const QString&)),
403 // this, SLOT(passwordChanged(const QString &))); 403 // this, SLOT(passwordChanged(const QString&)));
404 404
405// if (ID_Edit->text().isEmpty()) 405// if (ID_Edit->text().isEmpty())
406// ID_Edit->setFocus(); 406// ID_Edit->setFocus();
407// else if (PW_Edit->text().isEmpty()) 407// else if (PW_Edit->text().isEmpty())
408// PW_Edit->setFocus(); 408// PW_Edit->setFocus();
409// } 409// }
410 410
411 411
412void KPPPWidget::interruptConnection() { 412void KPPPWidget::interruptConnection() {
413 // interrupt dial up 413 // interrupt dial up
414// 414//
415 415
416 if (con->isVisible()) 416 if (con->isVisible())
417 emit con->cancelbutton(); 417 emit con->cancelbutton();
418 418
419 // disconnect if online 419 // disconnect if online
420 if (_pppdata->pppdRunning()) 420 if (_pppdata->pppdRunning())
421 emit disconnect(); 421 emit disconnect();
422} 422}
423 423
424 424
425void KPPPWidget::sigPPPDDied() { 425void KPPPWidget::sigPPPDDied() {
426 qDebug( "Received a SIGUSR1" ); 426 qDebug( "Received a SIGUSR1" );
427 427
428 // if we are not connected pppdpid is -1 so have have to check for that 428 // if we are not connected pppdpid is -1 so have have to check for that
429 // in the followin line to make sure that we don't raise a false alarm 429 // in the followin line to make sure that we don't raise a false alarm
430 // such as would be the case when the log file viewer exits. 430 // such as would be the case when the log file viewer exits.
431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) { 431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) {
432 qDebug( "It was pppd that died" ); 432 qDebug( "It was pppd that died" );
433 433
434 // when we killpppd() on Cancel in ConnectWidget 434 // when we killpppd() on Cancel in ConnectWidget
435 // we set pppid to -1 so we won't 435 // we set pppid to -1 so we won't
436 // enter this block 436 // enter this block
437 437
438 // just to be sure 438 // just to be sure
439 439
440 Modem::modem->removeSecret(AUTH_PAP); 440 Modem::modem->removeSecret(AUTH_PAP);
441 Modem::modem->removeSecret(AUTH_CHAP); 441 Modem::modem->removeSecret(AUTH_CHAP);
442 442
443 _pppdata->setpppdRunning(false); 443 _pppdata->setpppdRunning(false);
444 444
445 qDebug( "Executing command on disconnect since pppd has died." ); 445 qDebug( "Executing command on disconnect since pppd has died." );
446 QApplication::flushX(); 446 QApplication::flushX();
447 execute_command(_pppdata->command_on_disconnect()); 447 execute_command(_pppdata->command_on_disconnect());
448 448
449// stopAccounting(); 449// stopAccounting();
450 450
451 con_win->stopClock(); 451 con_win->stopClock();
@@ -676,98 +676,98 @@ void KPPPWidget::disconnect() {
676// void KPPPWidget::helpbutton() { 676// void KPPPWidget::helpbutton() {
677// kapp->invokeHelp(); 677// kapp->invokeHelp();
678// } 678// }
679 679
680 680
681void KPPPWidget::quitbutton() { 681void KPPPWidget::quitbutton() {
682 if(_pppdata->pppdRunning()) { 682 if(_pppdata->pppdRunning()) {
683 int ok = QMessageBox::warning(this, 683 int ok = QMessageBox::warning(this,
684 QObject::tr("Exiting kPPP will close your PPP Session."), 684 QObject::tr("Exiting kPPP will close your PPP Session."),
685 QObject::tr("Quit kPPP?")); 685 QObject::tr("Quit kPPP?"));
686 if(ok == QMessageBox::Yes) { 686 if(ok == QMessageBox::Yes) {
687 Modem::modem->killPPPDaemon(); 687 Modem::modem->killPPPDaemon();
688 QApplication::flushX(); 688 QApplication::flushX();
689 execute_command(_pppdata->command_on_disconnect()); 689 execute_command(_pppdata->command_on_disconnect());
690 removedns(); 690 removedns();
691 Modem::modem->unlockdevice(); 691 Modem::modem->unlockdevice();
692 } 692 }
693 } else { 693 } else {
694 if (!_pppdata->accname().isEmpty() && !_pppdata->storePassword()) 694 if (!_pppdata->accname().isEmpty() && !_pppdata->storePassword())
695 _pppdata->setStoredPassword(""); 695 _pppdata->setStoredPassword("");
696 } 696 }
697 _pppdata->save(); 697 _pppdata->save();
698 qApp->quit(); 698 qApp->quit();
699} 699}
700 700
701 701
702// void KPPPWidget::rulesetLoadError() { 702// void KPPPWidget::rulesetLoadError() {
703// QMessageBox::warning(this,"error", ruleset_load_errmsg); 703// QMessageBox::warning(this,"error", ruleset_load_errmsg);
704// } 704// }
705 705
706 706
707// void KPPPWidget::startAccounting() { 707// void KPPPWidget::startAccounting() {
708// // volume accounting 708// // volume accounting
709// stats->totalbytes = 0; 709// stats->totalbytes = 0;
710 710
711// kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl; 711// kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl;
712 712
713// // load the ruleset 713// // load the ruleset
714// if(!_pppdata->AcctEnabled()) 714// if(!_pppdata->AcctEnabled())
715// return; 715// return;
716 716
717// QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile()); 717// QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile());
718// // if(::access(d.data(), X_OK) != 0) 718// // if(::access(d.data(), X_OK) != 0)
719// acct = new Accounting(this, stats); 719// acct = new Accounting(this, stats);
720// // else 720// // else
721// // acct = new ExecutableAccounting(this); 721// // acct = new ExecutableAccounting(this);
722 722
723// // connect to the accounting object 723// // connect to the accounting object
724// connect(acct, SIGNAL(changed(QString, QString)), 724// connect(acct, SIGNAL(changed(QString,QString)),
725 // con_win, SLOT(slotAccounting(QString, QString))); 725 // con_win, SLOT(slotAccounting(QString,QString)));
726 726
727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) { 727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) {
728// // QString s= QObject::tr("Can not load the accounting " 728// // QString s= QObject::tr("Can not load the accounting "
729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); 729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile());
730 730
731// // starting the messagebox with a timer will prevent us 731// // starting the messagebox with a timer will prevent us
732// // from blocking the calling function ConnectWidget::timerEvent 732// // from blocking the calling function ConnectWidget::timerEvent
733// ruleset_load_errmsg = s; 733// ruleset_load_errmsg = s;
734// QTimer::singleShot(0, this, SLOT(rulesetLoadError())); 734// QTimer::singleShot(0, this, SLOT(rulesetLoadError()));
735// return; 735// return;
736// } 736// }
737// //else 737// //else
738// // acct->slotStart(); 738// // acct->slotStart();
739// } 739// }
740 740
741// void KPPPWidget::stopAccounting() { 741// void KPPPWidget::stopAccounting() {
742// // store volume accounting 742// // store volume accounting
743// // if(stats->totalbytes != 0) 743// // if(stats->totalbytes != 0)
744// // _pppdata->setTotalBytes(stats->totalbytes); 744// // _pppdata->setTotalBytes(stats->totalbytes);
745 745
746// if(!_pppdata->AcctEnabled()) 746// if(!_pppdata->AcctEnabled())
747// return; 747// return;
748 748
749// // if(acct != 0) { 749// // if(acct != 0) {
750// // acct->slotStop(); 750// // acct->slotStop();
751// // delete acct; 751// // delete acct;
752// // acct = 0; 752// // acct = 0;
753// // } 753// // }
754// } 754// }
755 755
756 756
757// void KPPPWidget::showStats() { 757// void KPPPWidget::showStats() {
758// if(statdlg) { 758// if(statdlg) {
759// statdlg->show(); 759// statdlg->show();
760// statdlg->raise(); 760// statdlg->raise();
761// } 761// }
762// } 762// }
763 763
764 764
765void KPPPWidget::usernameChanged(const QString &) { 765void KPPPWidget::usernameChanged(const QString &) {
766 // store username for later use 766 // store username for later use
767 _pppdata->setStoredUsername(ID_Edit->text()); 767 _pppdata->setStoredUsername(ID_Edit->text());
768} 768}
769 769
770 770
771void KPPPWidget::passwordChanged(const QString &) { 771void KPPPWidget::passwordChanged(const QString &) {
772 // store the password if so requested 772 // store the password if so requested
773 if(_pppdata->storePassword()) 773 if(_pppdata->storePassword())
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp
index 66a4d82..d6d8d88 100644
--- a/noncore/settings/networksettings/ppp/pppdargs.cpp
+++ b/noncore/settings/networksettings/ppp/pppdargs.cpp
@@ -10,98 +10,98 @@
10 * Copyright (C) 1997 Jay Painter 10 * Copyright (C) 1997 Jay Painter
11 * 11 *
12 * 12 *
13 * This library is free software; you can redistribute it and/or 13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public 14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either 15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version. 16 * version 2 of the License, or (at your option) any later version.
17 * 17 *
18 * This library is distributed in the hope that it will be useful, 18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details. 21 * Library General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU Library General Public 23 * You should have received a copy of the GNU Library General Public
24 * License along with this program; if not, write to the Free 24 * License along with this program; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */ 26 */
27 27
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qapplication.h> 30#include <qapplication.h>
31#include "pppdargs.h" 31#include "pppdargs.h"
32#include "pppdata.h" 32#include "pppdata.h"
33 33
34 34
35PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name) 35PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name)
36 : QDialog(parent, name, TRUE), _pppdata(pd) 36 : QDialog(parent, name, TRUE), _pppdata(pd)
37{ 37{
38 setCaption(tr("Customize pppd Arguments")); 38 setCaption(tr("Customize pppd Arguments"));
39// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 39// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
40 QVBoxLayout *l = new QVBoxLayout(this, 10, 10); 40 QVBoxLayout *l = new QVBoxLayout(this, 10, 10);
41 QHBoxLayout *tl = new QHBoxLayout(10); 41 QHBoxLayout *tl = new QHBoxLayout(10);
42 l->addLayout(tl); 42 l->addLayout(tl);
43 QVBoxLayout *l1 = new QVBoxLayout(); 43 QVBoxLayout *l1 = new QVBoxLayout();
44 QVBoxLayout *l2 = new QVBoxLayout(); 44 QVBoxLayout *l2 = new QVBoxLayout();
45 tl->addLayout(l1, 1); 45 tl->addLayout(l1, 1);
46 tl->addLayout(l2, 0); 46 tl->addLayout(l2, 0);
47 47
48 QHBoxLayout *l11 = new QHBoxLayout(10); 48 QHBoxLayout *l11 = new QHBoxLayout(10);
49 l1->addLayout(l11); 49 l1->addLayout(l11);
50 50
51 argument_label = new QLabel(tr("Argument:"), this); 51 argument_label = new QLabel(tr("Argument:"), this);
52 l11->addWidget(argument_label); 52 l11->addWidget(argument_label);
53 53
54 argument = new QLineEdit(this); 54 argument = new QLineEdit(this);
55 connect(argument, SIGNAL(returnPressed()), 55 connect(argument, SIGNAL(returnPressed()),
56 SLOT(addbutton())); 56 SLOT(addbutton()));
57 l11->addWidget(argument); 57 l11->addWidget(argument);
58 connect(argument, SIGNAL(textChanged(const QString &)), 58 connect(argument, SIGNAL(textChanged(const QString&)),
59 this, SLOT(textChanged(const QString &))); 59 this, SLOT(textChanged(const QString&)));
60 60
61 arguments = new QListBox(this); 61 arguments = new QListBox(this);
62 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10); 62 arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10);
63 connect(arguments, SIGNAL(highlighted(int)), 63 connect(arguments, SIGNAL(highlighted(int)),
64 this, SLOT(itemSelected(int))); 64 this, SLOT(itemSelected(int)));
65 l1->addWidget(arguments, 1); 65 l1->addWidget(arguments, 1);
66 66
67 add = new QPushButton(tr("Add"), this); 67 add = new QPushButton(tr("Add"), this);
68 connect(add, SIGNAL(clicked()), SLOT(addbutton())); 68 connect(add, SIGNAL(clicked()), SLOT(addbutton()));
69 l2->addWidget(add); 69 l2->addWidget(add);
70 l2->addStretch(1); 70 l2->addStretch(1);
71 71
72 remove = new QPushButton(tr("Remove"), this); 72 remove = new QPushButton(tr("Remove"), this);
73 connect(remove, SIGNAL(clicked()), SLOT(removebutton())); 73 connect(remove, SIGNAL(clicked()), SLOT(removebutton()));
74 l2->addWidget(remove); 74 l2->addWidget(remove);
75 75
76 defaults = new QPushButton(tr("Defaults"), this); 76 defaults = new QPushButton(tr("Defaults"), this);
77 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton())); 77 connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton()));
78 l2->addWidget(defaults); 78 l2->addWidget(defaults);
79 79
80 l->addSpacing(5); 80 l->addSpacing(5);
81 81
82 82
83 //load info from gpppdata 83 //load info from gpppdata
84 init(); 84 init();
85 85
86 add->setEnabled(false); 86 add->setEnabled(false);
87 remove->setEnabled(false); 87 remove->setEnabled(false);
88 argument->setFocus(); 88 argument->setFocus();
89} 89}
90 90
91 91
92void PPPdArguments::addbutton() { 92void PPPdArguments::addbutton() {
93 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) { 93 if(!argument->text().isEmpty() && arguments->count() < MAX_PPPD_ARGUMENTS) {
94 arguments->insertItem(argument->text()); 94 arguments->insertItem(argument->text());
95 argument->setText(""); 95 argument->setText("");
96 } 96 }
97} 97}
98 98
99 99
100void PPPdArguments::removebutton() { 100void PPPdArguments::removebutton() {
101 if(arguments->currentItem() >= 0) 101 if(arguments->currentItem() >= 0)
102 arguments->removeItem(arguments->currentItem()); 102 arguments->removeItem(arguments->currentItem());
103} 103}
104 104
105 105
106void PPPdArguments::defaultsbutton() { 106void PPPdArguments::defaultsbutton() {
107 // all of this is a hack 107 // all of this is a hack
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index 92339d6..dd1db28 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -9,97 +9,97 @@
9#include <string.h> 9#include <string.h>
10 10
11#include <qapplication.h> 11#include <qapplication.h>
12#include <qfile.h> 12#include <qfile.h>
13#include <qdir.h> 13#include <qdir.h>
14#include <qdialog.h> 14#include <qdialog.h>
15#include <qtextstream.h> 15#include <qtextstream.h>
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17#include <qlineedit.h> 17#include <qlineedit.h>
18#include <qlabel.h> 18#include <qlabel.h>
19#include <qspinbox.h> 19#include <qspinbox.h>
20#include <qradiobutton.h> 20#include <qradiobutton.h>
21#include <qpushbutton.h> 21#include <qpushbutton.h>
22#include <qcheckbox.h> 22#include <qcheckbox.h>
23#include <qtabwidget.h> 23#include <qtabwidget.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qlistview.h> 25#include <qlistview.h>
26#include <qvbox.h> 26#include <qvbox.h>
27#include <qprogressbar.h> 27#include <qprogressbar.h>
28 28
29#ifdef QWS 29#ifdef QWS
30 #include <qpe/resource.h> 30 #include <qpe/resource.h>
31 #include <opie2/oprocess.h> 31 #include <opie2/oprocess.h>
32 #include <opie2/onetwork.h> 32 #include <opie2/onetwork.h>
33 #include <opie2/opcap.h> 33 #include <opie2/opcap.h>
34#else 34#else
35 #define OProcess KProcess 35 #define OProcess KProcess
36 #include <kprocess.h> 36 #include <kprocess.h>
37#endif 37#endif
38 38
39#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 39#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
40#define PREUP "/etc/network/if-pre-up.d/wireless-tools" 40#define PREUP "/etc/network/if-pre-up.d/wireless-tools"
41 41
42/** 42/**
43 * Constructor, read in the wireless.opts file for parsing later. 43 * Constructor, read in the wireless.opts file for parsing later.
44 */ 44 */
45WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { 45WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
46 interfaces = new Interfaces(); 46 interfaces = new Interfaces();
47 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 47 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
48 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 48 tabWidget->insertTab(interfaceSetup, "TCP/IP");
49 49
50 // Check sanity - the existance of the wireless-tools if-pre-up script 50 // Check sanity - the existance of the wireless-tools if-pre-up script
51 QFile file(QString(PREUP)); 51 QFile file(QString(PREUP));
52 if (file.exists()) { 52 if (file.exists()) {
53 qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); 53 qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools"));
54 } 54 }
55 55
56 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); 56 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) );
57 connect( netView, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectNetwork( QListViewItem* ) ) ); 57 connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) );
58 netView->setColumnAlignment( col_chn, AlignCenter ); 58 netView->setColumnAlignment( col_chn, AlignCenter );
59 netView->setItemMargin( 3 ); 59 netView->setItemMargin( 3 );
60 netView->setAllColumnsShowFocus( true ); 60 netView->setAllColumnsShowFocus( true );
61 61
62} 62}
63 63
64WLANImp::~WLANImp() { 64WLANImp::~WLANImp() {
65//FIXME: delete interfaces; 65//FIXME: delete interfaces;
66} 66}
67 67
68/** 68/**
69 * Change the profile for both wireless settings and network settings. 69 * Change the profile for both wireless settings and network settings.
70 */ 70 */
71void WLANImp::setProfile(const QString &profile){ 71void WLANImp::setProfile(const QString &profile){
72 interfaceSetup->setProfile(profile); 72 interfaceSetup->setProfile(profile);
73 parseOpts(); 73 parseOpts();
74} 74}
75 75
76void WLANImp::parseOpts() { 76void WLANImp::parseOpts() {
77 bool error; 77 bool error;
78 QString opt; 78 QString opt;
79 79
80 if (! interfaces->isInterfaceSet()) 80 if (! interfaces->isInterfaceSet())
81 return; 81 return;
82 82
83 83
84 opt = interfaces->getInterfaceOption("wireless_essid", error); 84 opt = interfaces->getInterfaceOption("wireless_essid", error);
85 if(opt == "any" || opt == "off" || opt.isNull()){ 85 if(opt == "any" || opt == "off" || opt.isNull()){
86 essid->setEditText("any"); 86 essid->setEditText("any");
87 } else { 87 } else {
88 essid->setEditText(opt); 88 essid->setEditText(opt);
89 } 89 }
90 90
91 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); 91 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace();
92 92
93 for ( int i = 0; i < mode->count(); i++) 93 for ( int i = 0; i < mode->count(); i++)
94 if ( mode->text( i ) == opt ) mode->setCurrentItem( i ); 94 if ( mode->text( i ) == opt ) mode->setCurrentItem( i );
95 95
96 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); 96 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace();
97 if (! opt.isNull()) { 97 if (! opt.isNull()) {
98 specifyAp->setChecked(true); 98 specifyAp->setChecked(true);
99 macEdit->setText(opt); 99 macEdit->setText(opt);
100 } 100 }
101 101
102 opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); 102 opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace();
103 if (! opt.isNull()) { 103 if (! opt.isNull()) {
104 specifyChan->setChecked(true); 104 specifyChan->setChecked(true);
105 networkChannel->setValue(opt.toInt()); 105 networkChannel->setValue(opt.toInt());
diff --git a/noncore/settings/packagemanager/filterdlg.cpp b/noncore/settings/packagemanager/filterdlg.cpp
index 0da9d19..eeed398 100644
--- a/noncore/settings/packagemanager/filterdlg.cpp
+++ b/noncore/settings/packagemanager/filterdlg.cpp
@@ -23,97 +23,97 @@
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "filterdlg.h" 30#include "filterdlg.h"
31 31
32FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, 32FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name,
33 const QString &server, const QString &destination, 33 const QString &server, const QString &destination,
34 OPackageManager::Status status, const QString &category ) 34 OPackageManager::Status status, const QString &category )
35 : QDialog( parent, QString::null, true ) 35 : QDialog( parent, QString::null, true )
36{ 36{
37 setCaption( tr( "Filter packages" ) ); 37 setCaption( tr( "Filter packages" ) );
38 38
39 QVBoxLayout *layout = new QVBoxLayout( this ); 39 QVBoxLayout *layout = new QVBoxLayout( this );
40 QScrollView *sv = new QScrollView( this ); 40 QScrollView *sv = new QScrollView( this );
41 layout->addWidget( sv, 0, 0 ); 41 layout->addWidget( sv, 0, 0 );
42 sv->setResizePolicy( QScrollView::AutoOneFit ); 42 sv->setResizePolicy( QScrollView::AutoOneFit );
43 sv->setFrameStyle( QFrame::NoFrame ); 43 sv->setFrameStyle( QFrame::NoFrame );
44 QWidget *container = new QWidget( sv->viewport() ); 44 QWidget *container = new QWidget( sv->viewport() );
45 sv->addChild( container ); 45 sv->addChild( container );
46 layout = new QVBoxLayout( container, 4, 4 ); 46 layout = new QVBoxLayout( container, 4, 4 );
47 47
48 // Category 48 // Category
49 m_categoryCB = new QCheckBox( tr( "Category:" ), container ); 49 m_categoryCB = new QCheckBox( tr( "Category:" ), container );
50 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) ); 50 connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) );
51 m_category = new QComboBox( container ); 51 m_category = new QComboBox( container );
52 m_category->insertStringList( pm->categories() ); 52 m_category->insertStringList( pm->categories() );
53 initItem( m_category, m_categoryCB, category ); 53 initItem( m_category, m_categoryCB, category );
54 layout->addWidget( m_categoryCB ); 54 layout->addWidget( m_categoryCB );
55 layout->addWidget( m_category ); 55 layout->addWidget( m_category );
56 56
57 // Package name 57 // Package name
58 m_nameCB = new QCheckBox( tr( "Names containing:" ), container ); 58 m_nameCB = new QCheckBox( tr( "Names containing:" ), container );
59 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) ); 59 connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) );
60 m_name = new QLineEdit( name, container ); 60 m_name = new QLineEdit( name, container );
61 if ( !name.isNull() ) 61 if ( !name.isNull() )
62 m_nameCB->setChecked( true ); 62 m_nameCB->setChecked( true );
63 m_name->setEnabled( !name.isNull() ); 63 m_name->setEnabled( !name.isNull() );
64 layout->addWidget( m_nameCB ); 64 layout->addWidget( m_nameCB );
65 layout->addWidget( m_name ); 65 layout->addWidget( m_name );
66 66
67 // Status 67 // Status
68 m_statusCB = new QCheckBox( tr( "With the status:" ), container ); 68 m_statusCB = new QCheckBox( tr( "With the status:" ), container );
69 connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) ); 69 connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) );
70 m_status = new QComboBox( container ); 70 m_status = new QComboBox( container );
71 connect( m_status, SIGNAL(activated(const QString &)), this, SLOT(slotStatusChanged(const QString &)) ); 71 connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) );
72 QString currStatus; 72 QString currStatus;
73 switch ( status ) 73 switch ( status )
74 { 74 {
75 case OPackageManager::All : currStatus = tr( "All" ); 75 case OPackageManager::All : currStatus = tr( "All" );
76 break; 76 break;
77 case OPackageManager::Installed : currStatus = tr( "Installed" ); 77 case OPackageManager::Installed : currStatus = tr( "Installed" );
78 break; 78 break;
79 case OPackageManager::NotInstalled : currStatus = tr( "Not installed" ); 79 case OPackageManager::NotInstalled : currStatus = tr( "Not installed" );
80 break; 80 break;
81 case OPackageManager::Updated : currStatus = tr( "Updated" ); 81 case OPackageManager::Updated : currStatus = tr( "Updated" );
82 break; 82 break;
83 default : currStatus = QString::null; 83 default : currStatus = QString::null;
84 }; 84 };
85 m_status->insertItem( tr( "All" ) ); 85 m_status->insertItem( tr( "All" ) );
86 m_status->insertItem( tr( "Installed" ) ); 86 m_status->insertItem( tr( "Installed" ) );
87 m_status->insertItem( tr( "Not installed" ) ); 87 m_status->insertItem( tr( "Not installed" ) );
88 m_status->insertItem( tr( "Updated" ) ); 88 m_status->insertItem( tr( "Updated" ) );
89 initItem( m_status, m_statusCB, currStatus ); 89 initItem( m_status, m_statusCB, currStatus );
90 layout->addWidget( m_statusCB ); 90 layout->addWidget( m_statusCB );
91 layout->addWidget( m_status ); 91 layout->addWidget( m_status );
92 92
93 // Server 93 // Server
94 m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container ); 94 m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container );
95 connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) ); 95 connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) );
96 m_server = new QComboBox( container ); 96 m_server = new QComboBox( container );
97 m_server->insertStringList( *(pm->servers()) ); 97 m_server->insertStringList( *(pm->servers()) );
98 initItem( m_server, m_serverCB, server ); 98 initItem( m_server, m_serverCB, server );
99 layout->addWidget( m_serverCB ); 99 layout->addWidget( m_serverCB );
100 layout->addWidget( m_server ); 100 layout->addWidget( m_server );
101 101
102 // Destination 102 // Destination
103 m_destCB = new QCheckBox( tr( "Installed on device at:" ), container ); 103 m_destCB = new QCheckBox( tr( "Installed on device at:" ), container );
104 connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) ); 104 connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) );
105 m_destination = new QComboBox( container ); 105 m_destination = new QComboBox( container );
106 m_destination->insertStringList( *(pm->destinations()) ); 106 m_destination->insertStringList( *(pm->destinations()) );
107 initItem( m_destination, m_destCB, destination ); 107 initItem( m_destination, m_destCB, destination );
108 layout->addWidget( m_destCB ); 108 layout->addWidget( m_destCB );
109 layout->addWidget( m_destination ); 109 layout->addWidget( m_destination );
110 110
111 //showMaximized(); 111 //showMaximized();
112} 112}
113 113
114void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection ) 114void FilterDlg::initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection )
115{ 115{
116 if ( !selection.isNull() ) 116 if ( !selection.isNull() )
117 { 117 {
118 checkBox->setChecked( true ); 118 checkBox->setChecked( true );
119 119
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 8fd960f..b334bca 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -73,130 +73,130 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
73{ 73{
74// setCaption( tr( "Package Manager" ) ); 74// setCaption( tr( "Package Manager" ) );
75 75
76 m_iconNull.fill( colorGroup().base() ); 76 m_iconNull.fill( colorGroup().base() );
77 77
78 connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) ); 78 connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) );
79 79
80 // Initialize widget stack, package list and status widget 80 // Initialize widget stack, package list and status widget
81 initStatusWidget(); 81 initStatusWidget();
82 initPackageList(); 82 initPackageList();
83 83
84 m_widgetStack.addWidget( &m_statusWidget, 2 ); 84 m_widgetStack.addWidget( &m_statusWidget, 2 );
85 m_widgetStack.addWidget( &m_packageList, 1 ); 85 m_widgetStack.addWidget( &m_packageList, 1 );
86 setCentralWidget( &m_widgetStack ); 86 setCentralWidget( &m_widgetStack );
87 87
88 // Initialize remaining user interface items 88 // Initialize remaining user interface items
89 initUI(); 89 initUI();
90 90
91 // Initialize package information 91 // Initialize package information
92 QTimer::singleShot( 100, this, SLOT( initPackageInfo() ) ); 92 QTimer::singleShot( 100, this, SLOT( initPackageInfo() ) );
93} 93}
94 94
95void MainWindow::closeEvent( QCloseEvent *event ) 95void MainWindow::closeEvent( QCloseEvent *event )
96{ 96{
97 // Close app only if either the package or status widgets are currently active 97 // Close app only if either the package or status widgets are currently active
98 bool close = m_widgetStack.visibleWidget() == &m_packageList || 98 bool close = m_widgetStack.visibleWidget() == &m_packageList ||
99 m_widgetStack.visibleWidget() == &m_statusWidget; 99 m_widgetStack.visibleWidget() == &m_statusWidget;
100 if ( close ) 100 if ( close )
101 { 101 {
102 // TODO - write out application configuration settings 102 // TODO - write out application configuration settings
103 103
104 // Write out package manager configuration settings 104 // Write out package manager configuration settings
105 m_packman.saveSettings(); 105 m_packman.saveSettings();
106 event->accept(); 106 event->accept();
107 } 107 }
108 else 108 else
109 { 109 {
110 delete m_widgetStack.visibleWidget(); 110 delete m_widgetStack.visibleWidget();
111 m_widgetStack.raiseWidget( &m_packageList ); 111 m_widgetStack.raiseWidget( &m_packageList );
112 event->ignore(); 112 event->ignore();
113 } 113 }
114} 114}
115 115
116void MainWindow::initPackageList() 116void MainWindow::initPackageList()
117{ 117{
118 m_packageList.addColumn( tr( "Packages" ) ); 118 m_packageList.addColumn( tr( "Packages" ) );
119 QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); 119 QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) );
120 QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); 120 QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold );
121 connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), 121 connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),
122 this, SLOT(slotDisplayPackageInfo(QListViewItem *)) ); 122 this, SLOT(slotDisplayPackageInfo(QListViewItem*)) );
123} 123}
124 124
125void MainWindow::initStatusWidget() 125void MainWindow::initStatusWidget()
126{ 126{
127 QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); 127 QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 );
128 128
129 m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 129 m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
130 layout->addWidget( &m_statusText ); 130 layout->addWidget( &m_statusText );
131 131
132 connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); 132 connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) );
133 connect( &m_packman, SIGNAL(statusText(const QString &)), this, SLOT(slotStatusText(const QString &)) ); 133 connect( &m_packman, SIGNAL(statusText(const QString&)), this, SLOT(slotStatusText(const QString&)) );
134 connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); 134 connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) );
135 135
136 layout->addWidget( &m_statusBar ); 136 layout->addWidget( &m_statusBar );
137} 137}
138 138
139void MainWindow::initUI() 139void MainWindow::initUI()
140{ 140{
141 // Build menu and tool bars 141 // Build menu and tool bars
142 setToolBarsMovable( false ); 142 setToolBarsMovable( false );
143 143
144 m_menuBar.setHorizontalStretchable( true ); 144 m_menuBar.setHorizontalStretchable( true );
145 QMenuBar *mb = new QMenuBar( &m_menuBar ); 145 QMenuBar *mb = new QMenuBar( &m_menuBar );
146 mb->setMargin( 0 ); 146 mb->setMargin( 0 );
147 147
148 // Find toolbar 148 // Find toolbar
149 addToolBar( &m_findBar, QMainWindow::Top, true ); 149 addToolBar( &m_findBar, QMainWindow::Top, true );
150 m_findBar.setHorizontalStretchable( true ); 150 m_findBar.setHorizontalStretchable( true );
151 m_findEdit = new QLineEdit( &m_findBar ); 151 m_findEdit = new QLineEdit( &m_findBar );
152 QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) ); 152 QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) );
153 m_findBar.setStretchableWidget( m_findEdit ); 153 m_findBar.setStretchableWidget( m_findEdit );
154 connect( m_findEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotFindChanged(const QString &)) ); 154 connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) );
155 155
156 // Packages menu 156 // Packages menu
157 QPopupMenu *popup = new QPopupMenu( this ); 157 QPopupMenu *popup = new QPopupMenu( this );
158 158
159 QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); 159 QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 );
160 a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); 160 a->setWhatsThis( tr( "Click here to update package lists from servers." ) );
161 connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); 161 connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) );
162 a->addTo( popup ); 162 a->addTo( popup );
163 a->addTo( &m_toolBar ); 163 a->addTo( &m_toolBar );
164 164
165 QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); 165 QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 );
166 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); 166 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) );
167 connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); 167 connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) );
168 actionUpgrade->addTo( popup ); 168 actionUpgrade->addTo( popup );
169 actionUpgrade->addTo( &m_toolBar ); 169 actionUpgrade->addTo( &m_toolBar );
170 170
171 QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); 171 QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" );
172 QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); 172 QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" );
173 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); 173 QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
174 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); 174 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) );
175 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); 175 connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) );
176 actionDownload->addTo( popup ); 176 actionDownload->addTo( popup );
177 actionDownload->addTo( &m_toolBar ); 177 actionDownload->addTo( &m_toolBar );
178 178
179 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); 179 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 );
180 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); 180 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) );
181 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); 181 connect( a, SIGNAL(activated()), this, SLOT(slotApply()) );
182 a->addTo( popup ); 182 a->addTo( popup );
183 a->addTo( &m_toolBar ); 183 a->addTo( &m_toolBar );
184 184
185 popup->insertSeparator(); 185 popup->insertSeparator();
186 186
187 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 187 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
188 a->setWhatsThis( tr( "Click here to configure this application." ) ); 188 a->setWhatsThis( tr( "Click here to configure this application." ) );
189 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); 189 connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) );
190 a->addTo( popup ); 190 a->addTo( popup );
191 mb->insertItem( tr( "Actions" ), popup ); 191 mb->insertItem( tr( "Actions" ), popup );
192 192
193 // View menu 193 // View menu
194 popup = new QPopupMenu( this ); 194 popup = new QPopupMenu( this );
195 195
196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); 196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
197 m_actionShowNotInstalled->setToggleAction( true ); 197 m_actionShowNotInstalled->setToggleAction( true );
198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); 198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) );
199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); 199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) );
200 m_actionShowNotInstalled->addTo( popup ); 200 m_actionShowNotInstalled->addTo( popup );
201 201
202 m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); 202 m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 );
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index 086e91b..1dc23a4 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -271,146 +271,146 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString &
271 else if ( key.isEmpty() && value.isEmpty() ) 271 else if ( key.isEmpty() && value.isEmpty() )
272 newPackage = true; 272 newPackage = true;
273 273
274 // Skip past all description lines 274 // Skip past all description lines
275 if ( key == "Description" ) 275 if ( key == "Description" )
276 { 276 {
277 line = t.readLine(); 277 line = t.readLine();
278 while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() ) 278 while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() )
279 line = t.readLine(); 279 line = t.readLine();
280 } 280 }
281 else 281 else
282 line = t.readLine(); 282 line = t.readLine();
283 } 283 }
284 284
285 f.close(); 285 f.close();
286 286
287 return pl; 287 return pl;
288} 288}
289 289
290bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, const QString &destination, 290bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, const QString &destination,
291 const QObject *receiver, const char *slotOutput, bool rawOutput ) 291 const QObject *receiver, const char *slotOutput, bool rawOutput )
292{ 292{
293 if ( command == OPackage::NotDefined ) 293 if ( command == OPackage::NotDefined )
294 return false; 294 return false;
295 295
296 // Set ipkg run-time options/arguments 296 // Set ipkg run-time options/arguments
297 m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS ); 297 m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS );
298 m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL ); 298 m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL );
299 // TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE ); 299 // TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE );
300 m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE ); 300 m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE );
301 m_ipkgArgs.verbosity = m_ipkgExecVerbosity; 301 m_ipkgArgs.verbosity = m_ipkgExecVerbosity;
302 if ( m_ipkgArgs.dest ) 302 if ( m_ipkgArgs.dest )
303 free( m_ipkgArgs.dest ); 303 free( m_ipkgArgs.dest );
304 if ( !destination.isNull() ) 304 if ( !destination.isNull() )
305 { 305 {
306 int len = destination.length() + 1; 306 int len = destination.length() + 1;
307 m_ipkgArgs.dest = (char *)malloc( len ); 307 m_ipkgArgs.dest = (char *)malloc( len );
308 strncpy( m_ipkgArgs.dest, destination, destination.length() ); 308 strncpy( m_ipkgArgs.dest, destination, destination.length() );
309 m_ipkgArgs.dest[ len - 1 ] = '\0'; 309 m_ipkgArgs.dest[ len - 1 ] = '\0';
310 } 310 }
311 else 311 else
312 m_ipkgArgs.dest = 0x0; 312 m_ipkgArgs.dest = 0x0;
313 313
314 // Connect output signal to widget 314 // Connect output signal to widget
315 315
316 if ( rawOutput ) 316 if ( rawOutput )
317 { 317 {
318// if ( slotOutput ) 318// if ( slotOutput )
319// connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 319// connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
320 } 320 }
321 else 321 else
322 { 322 {
323 // TODO - connect to local slot and parse output before emitting signalIpkgMessage 323 // TODO - connect to local slot and parse output before emitting signalIpkgMessage
324 } 324 }
325 325
326 switch( command ) 326 switch( command )
327 { 327 {
328 case OPackage::Update : { 328 case OPackage::Update : {
329 connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 329 connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
330 ipkg_lists_update( &m_ipkgArgs ); 330 ipkg_lists_update( &m_ipkgArgs );
331 }; 331 };
332 break; 332 break;
333 case OPackage::Upgrade : { 333 case OPackage::Upgrade : {
334 connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 334 connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
335 ipkg_packages_upgrade( &m_ipkgArgs ); 335 ipkg_packages_upgrade( &m_ipkgArgs );
336 }; 336 };
337 break; 337 break;
338 case OPackage::Install : { 338 case OPackage::Install : {
339 connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 339 connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
340 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) 340 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it )
341 { 341 {
342 ipkg_packages_install( &m_ipkgArgs, (*it) ); 342 ipkg_packages_install( &m_ipkgArgs, (*it) );
343 } 343 }
344 }; 344 };
345 break; 345 break;
346 case OPackage::Remove : { 346 case OPackage::Remove : {
347 connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 347 connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
348 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) 348 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it )
349 { 349 {
350 ipkg_packages_remove( &m_ipkgArgs, (*it), true ); 350 ipkg_packages_remove( &m_ipkgArgs, (*it), true );
351 } 351 }
352 }; 352 };
353 break; 353 break;
354 case OPackage::Download : { 354 case OPackage::Download : {
355 connect( this, SIGNAL(signalIpkgMessage(char *)), receiver, slotOutput ); 355 connect( this, SIGNAL(signalIpkgMessage(char*)), receiver, slotOutput );
356 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it ) 356 for ( QStringList::Iterator it = parameters->begin(); it != parameters->end(); ++it )
357 { 357 {
358 ipkg_packages_download( &m_ipkgArgs, (*it) ); 358 ipkg_packages_download( &m_ipkgArgs, (*it) );
359 } 359 }
360 }; 360 };
361 break; 361 break;
362 case OPackage::Info : { 362 case OPackage::Info : {
363 connect( this, SIGNAL(signalIpkgStatus(char *)), receiver, slotOutput ); 363 connect( this, SIGNAL(signalIpkgStatus(char*)), receiver, slotOutput );
364 ipkg_packages_info( &m_ipkgArgs, (*parameters->begin()), &fIpkgStatus, 0x0 ); 364 ipkg_packages_info( &m_ipkgArgs, (*parameters->begin()), &fIpkgStatus, 0x0 );
365 }; 365 };
366 break; 366 break;
367 case OPackage::Files : { 367 case OPackage::Files : {
368 connect( this, SIGNAL(signalIpkgList(char *)), receiver, slotOutput ); 368 connect( this, SIGNAL(signalIpkgList(char*)), receiver, slotOutput );
369 ipkg_package_files( &m_ipkgArgs, (*parameters->begin()), &fIpkgFiles, 0x0 ); 369 ipkg_package_files( &m_ipkgArgs, (*parameters->begin()), &fIpkgFiles, 0x0 );
370 }; 370 };
371 break; 371 break;
372 default : break; 372 default : break;
373 }; 373 };
374 374
375 return true; 375 return true;
376} 376}
377 377
378void OIpkg::ipkgMessage( char *msg ) 378void OIpkg::ipkgMessage( char *msg )
379{ 379{
380 emit signalIpkgMessage( msg ); 380 emit signalIpkgMessage( msg );
381} 381}
382 382
383void OIpkg::ipkgStatus( char *status ) 383void OIpkg::ipkgStatus( char *status )
384{ 384{
385 emit signalIpkgStatus( status ); 385 emit signalIpkgStatus( status );
386} 386}
387 387
388void OIpkg::ipkgList( char *filelist ) 388void OIpkg::ipkgList( char *filelist )
389{ 389{
390 emit signalIpkgList( filelist ); 390 emit signalIpkgList( filelist );
391} 391}
392 392
393void OIpkg::loadConfiguration() 393void OIpkg::loadConfiguration()
394{ 394{
395 if ( m_confInfo ) 395 if ( m_confInfo )
396 delete m_confInfo; 396 delete m_confInfo;
397 397
398 // Load configuration item list 398 // Load configuration item list
399 m_confInfo = new OConfItemList(); 399 m_confInfo = new OConfItemList();
400 400
401 QStringList confFiles; 401 QStringList confFiles;
402 QDir confDir( IPKG_CONF_DIR ); 402 QDir confDir( IPKG_CONF_DIR );
403 if ( confDir.exists() ) 403 if ( confDir.exists() )
404 { 404 {
405 confDir.setNameFilter( "*.conf" ); 405 confDir.setNameFilter( "*.conf" );
406 confDir.setFilter( QDir::Files ); 406 confDir.setFilter( QDir::Files );
407 confFiles = confDir.entryList( "*.conf", QDir::Files ); 407 confFiles = confDir.entryList( "*.conf", QDir::Files );
408 confFiles << IPKG_CONF; 408 confFiles << IPKG_CONF;
409 409
410 for ( QStringList::Iterator it = confFiles.begin(); it != confFiles.end(); ++it ) 410 for ( QStringList::Iterator it = confFiles.begin(); it != confFiles.end(); ++it )
411 { 411 {
412 // Create absolute file path if necessary 412 // Create absolute file path if necessary
413 QString absFile = (*it); 413 QString absFile = (*it);
414 if ( !absFile.startsWith( "/" ) ) 414 if ( !absFile.startsWith( "/" ) )
415 absFile.prepend( QString( IPKG_CONF_DIR ) + "/" ); 415 absFile.prepend( QString( IPKG_CONF_DIR ) + "/" );
416 416
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 4bc86fa..8ad0a3f 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -66,106 +66,106 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl )
66//TODO hide if zaurus- mono only 66//TODO hide if zaurus- mono only
67 67
68#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) 68#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX)
69//since ipaq and zaurus have particular 69//since ipaq and zaurus have particular
70//devices 70//devices
71 bool systemZaurus=FALSE; 71 bool systemZaurus=FALSE;
72 struct utsname name; /* check for embedix kernel running on the zaurus*/ 72 struct utsname name; /* check for embedix kernel running on the zaurus*/
73 if (uname(&name) != -1) {// TODO change this here,... 73 if (uname(&name) != -1) {// TODO change this here,...
74 QString release=name.release; 74 QString release=name.release;
75 if( release.find("embedix",0,TRUE) != -1) { 75 if( release.find("embedix",0,TRUE) != -1) {
76 qDebug("IS System Zaurus"); 76 qDebug("IS System Zaurus");
77 systemZaurus=TRUE; 77 systemZaurus=TRUE;
78 } 78 }
79 } 79 }
80 if(!systemZaurus) { 80 if(!systemZaurus) {
81 stereoCheckBox->setChecked(TRUE); 81 stereoCheckBox->setChecked(TRUE);
82 } 82 }
83 stereoCheckBox->setEnabled(FALSE); 83 stereoCheckBox->setEnabled(FALSE);
84 sixteenBitCheckBox->setEnabled(FALSE); 84 sixteenBitCheckBox->setEnabled(FALSE);
85#else 85#else
86#endif 86#endif
87 int sRate=cfg.readNumEntry("SizeLimit", 30); 87 int sRate=cfg.readNumEntry("SizeLimit", 30);
88 qDebug("%d",sRate); 88 qDebug("%d",sRate);
89 89
90 if(sRate ==30) 90 if(sRate ==30)
91 timeLimitComboBox->setCurrentItem(0); 91 timeLimitComboBox->setCurrentItem(0);
92 else if(sRate==20) 92 else if(sRate==20)
93 timeLimitComboBox->setCurrentItem(1); 93 timeLimitComboBox->setCurrentItem(1);
94 else if(sRate == 15) 94 else if(sRate == 15)
95 timeLimitComboBox->setCurrentItem(2); 95 timeLimitComboBox->setCurrentItem(2);
96 else if(sRate == 10) 96 else if(sRate == 10)
97 timeLimitComboBox->setCurrentItem(3); 97 timeLimitComboBox->setCurrentItem(3);
98 else if(sRate == 5) 98 else if(sRate == 5)
99 timeLimitComboBox->setCurrentItem(4); 99 timeLimitComboBox->setCurrentItem(4);
100 else 100 else
101 timeLimitComboBox->setCurrentItem(5); 101 timeLimitComboBox->setCurrentItem(5);
102 102
103 sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); 103 sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1));
104 104
105 cfg.setGroup("Defaults"); 105 cfg.setGroup("Defaults");
106 keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); 106 keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") );
107 107
108 updateStorageCombo(); 108 updateStorageCombo();
109 109
110 Config vmCfg("Vmemo"); 110 Config vmCfg("Vmemo");
111 vmCfg.setGroup("Defaults"); 111 vmCfg.setGroup("Defaults");
112 adpcmCheckBox->setChecked( vmCfg.readBoolEntry("use_ADPCM", 0)); 112 adpcmCheckBox->setChecked( vmCfg.readBoolEntry("use_ADPCM", 0));
113 113
114 connect( LocationComboBox,SIGNAL(activated(const QString &)), this, 114 connect( LocationComboBox,SIGNAL(activated(const QString&)), this,
115 SLOT( setLocation(const QString &))); 115 SLOT( setLocation(const QString&)));
116 connect( keyComboBox,SIGNAL(activated( int)), this, 116 connect( keyComboBox,SIGNAL(activated(int)), this,
117 SLOT( setKeyButton( int))); 117 SLOT( setKeyButton(int)));
118 connect( timeLimitComboBox,SIGNAL(activated( const QString &)), this, 118 connect( timeLimitComboBox,SIGNAL(activated(const QString&)), this,
119 SLOT( setSizeLimitButton(const QString &))); 119 SLOT( setSizeLimitButton(const QString&)));
120 connect( restartCheckBox,SIGNAL( toggled( bool)), this, 120 connect( restartCheckBox,SIGNAL( toggled(bool)), this,
121 SLOT( restartOpie( bool))); 121 SLOT( restartOpie(bool)));
122 connect( adpcmCheckBox,SIGNAL( toggled( bool)), this, 122 connect( adpcmCheckBox,SIGNAL( toggled(bool)), this,
123 SLOT( slotAdpcm( bool))); 123 SLOT( slotAdpcm(bool)));
124 124
125 // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 125 // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
126} 126}
127 127
128void SoundSettings::updateStorageCombo() { 128void SoundSettings::updateStorageCombo() {
129 129
130 Config config( "Vmemo" ); 130 Config config( "Vmemo" );
131 config.setGroup( "System" ); 131 config.setGroup( "System" );
132 QString loc = config.readEntry("RecLocation","/"); 132 QString loc = config.readEntry("RecLocation","/");
133 int i=0; 133 int i=0;
134 int set=0; 134 int set=0;
135 StorageInfo storageInfo; 135 StorageInfo storageInfo;
136 QString sName, sPath; 136 QString sName, sPath;
137 QStringList list; 137 QStringList list;
138 list << "Documents : "+QPEApplication::documentDir(); 138 list << "Documents : "+QPEApplication::documentDir();
139 list << "tmp : /tmp"; 139 list << "tmp : /tmp";
140 140
141 const QList<FileSystem> &fs = storageInfo.fileSystems(); 141 const QList<FileSystem> &fs = storageInfo.fileSystems();
142 QListIterator<FileSystem> it ( fs ); 142 QListIterator<FileSystem> it ( fs );
143 for( ; it.current(); ++it ){ 143 for( ; it.current(); ++it ){
144 const QString name = (*it)->name(); 144 const QString name = (*it)->name();
145 const QString path = (*it)->path(); 145 const QString path = (*it)->path();
146 qDebug("storage name "+name +" storage path is "+path); 146 qDebug("storage name "+name +" storage path is "+path);
147 list << name + ": " +path; 147 list << name + ": " +path;
148 if( loc.find( path,0,TRUE) != -1) 148 if( loc.find( path,0,TRUE) != -1)
149 set = i; 149 set = i;
150// if(dit.current()->file().find(path) != -1 ) storage=name; 150// if(dit.current()->file().find(path) != -1 ) storage=name;
151 i++; 151 i++;
152 } 152 }
153 153
154 LocationComboBox->insertStringList(list); 154 LocationComboBox->insertStringList(list);
155 qDebug("set item %d", set); 155 qDebug("set item %d", set);
156 LocationComboBox->setCurrentItem(set); 156 LocationComboBox->setCurrentItem(set);
157} 157}
158 158
159void SoundSettings::setLocation(const QString & string) { 159void SoundSettings::setLocation(const QString & string) {
160 Config config( "Vmemo" ); 160 Config config( "Vmemo" );
161 config.setGroup( "System" ); 161 config.setGroup( "System" );
162 config.writeEntry("RecLocation",string); 162 config.writeEntry("RecLocation",string);
163 qDebug("set location "+string); 163 qDebug("set location "+string);
164 config.write(); 164 config.write();
165} 165}
166 166
167void SoundSettings::cleanUp() { 167void SoundSettings::cleanUp() {
168 Config cfg("Vmemo"); 168 Config cfg("Vmemo");
169 cfg.writeEntry("Alert",AlertCheckBox->isChecked()); 169 cfg.writeEntry("Alert",AlertCheckBox->isChecked());
170 170
171 cfg.setGroup("Record"); 171 cfg.setGroup("Record");
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 0aeb251..d6ecec5 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -100,97 +100,97 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
100 100
101 test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox ); 101 test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox );
102 test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox ); 102 test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox );
103 test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox ); 103 test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox );
104 test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox ); 104 test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox );
105 test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox ); 105 test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox );
106 test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox ); 106 test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox );
107 test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox ); 107 test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox );
108 108
109 test_alu->setText( 1, "n/a" ); 109 test_alu->setText( 1, "n/a" );
110 test_fpu->setText( 1, "n/a" ); 110 test_fpu->setText( 1, "n/a" );
111 test_txt->setText( 1, "n/a" ); 111 test_txt->setText( 1, "n/a" );
112 test_gfx->setText( 1, "n/a" ); 112 test_gfx->setText( 1, "n/a" );
113 test_ram->setText( 1, "n/a" ); 113 test_ram->setText( 1, "n/a" );
114 test_sd->setText( 1, "n/a" ); 114 test_sd->setText( 1, "n/a" );
115 test_cf->setText( 1, "n/a" ); 115 test_cf->setText( 1, "n/a" );
116 116
117 test_alu->setText( 2, "n/a" ); 117 test_alu->setText( 2, "n/a" );
118 test_fpu->setText( 2, "n/a" ); 118 test_fpu->setText( 2, "n/a" );
119 test_txt->setText( 2, "n/a" ); 119 test_txt->setText( 2, "n/a" );
120 test_gfx->setText( 2, "n/a" ); 120 test_gfx->setText( 2, "n/a" );
121 test_ram->setText( 2, "n/a" ); 121 test_ram->setText( 2, "n/a" );
122 test_sd->setText( 2, "n/a" ); 122 test_sd->setText( 2, "n/a" );
123 test_cf->setText( 2, "n/a" ); 123 test_cf->setText( 2, "n/a" );
124 124
125 startButton = new QPushButton( tr( "&Start Tests!" ), this ); 125 startButton = new QPushButton( tr( "&Start Tests!" ), this );
126 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); 126 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
127 127
128 vb->addWidget( tests, 2 ); 128 vb->addWidget( tests, 2 );
129 129
130 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); 130 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" );
131 if ( f.open( IO_ReadOnly ) ) 131 if ( f.open( IO_ReadOnly ) )
132 { 132 {
133 machineCombo = new QComboBox( this ); 133 machineCombo = new QComboBox( this );
134 134
135 QTextStream ts( &f ); 135 QTextStream ts( &f );
136 while( !ts.eof() ) 136 while( !ts.eof() )
137 { 137 {
138 QString machline = ts.readLine(); 138 QString machline = ts.readLine();
139 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); 139 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline );
140 QString resline = ts.readLine(); 140 QString resline = ts.readLine();
141 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); 141 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
142 machineCombo->insertItem( machline ); 142 machineCombo->insertItem( machline );
143 } 143 }
144 144
145 QHBoxLayout* hb = new QHBoxLayout( vb ); 145 QHBoxLayout* hb = new QHBoxLayout( vb );
146 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); 146 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
147 hb->addWidget( machineCombo, 2 ); 147 hb->addWidget( machineCombo, 2 );
148 connect( machineCombo, SIGNAL( activated( int ) ), this, SLOT( machineActivated( int ) ) ); 148 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
149 } 149 }
150 150
151 vb->addWidget( startButton, 2 ); 151 vb->addWidget( startButton, 2 );
152} 152}
153 153
154 154
155BenchmarkInfo::~BenchmarkInfo() 155BenchmarkInfo::~BenchmarkInfo()
156{} 156{}
157 157
158 158
159void BenchmarkInfo::machineActivated( int index ) 159void BenchmarkInfo::machineActivated( int index )
160{ 160{
161 QStringList* results = machines[ machineCombo->text( index ) ]; 161 QStringList* results = machines[ machineCombo->text( index ) ];
162 if ( !results ) 162 if ( !results )
163 { 163 {
164 qDebug( "sysinfo: no results available." ); 164 qDebug( "sysinfo: no results available." );
165 return; 165 return;
166 } 166 }
167 QStringList::Iterator it = results->begin(); 167 QStringList::Iterator it = results->begin();
168 test_alu->setText( 2, *(it++) ); 168 test_alu->setText( 2, *(it++) );
169 test_fpu->setText( 2, *(it++) ); 169 test_fpu->setText( 2, *(it++) );
170 test_txt->setText( 2, *(it++) ); 170 test_txt->setText( 2, *(it++) );
171 test_gfx->setText( 2, *(it++) ); 171 test_gfx->setText( 2, *(it++) );
172 test_ram->setText( 2, *(it++) ); 172 test_ram->setText( 2, *(it++) );
173 test_sd->setText( 2, *(it++) ); 173 test_sd->setText( 2, *(it++) );
174 test_cf->setText( 2, *(it++) ); 174 test_cf->setText( 2, *(it++) );
175} 175}
176 176
177 177
178void BenchmarkInfo::run() 178void BenchmarkInfo::run()
179{ 179{
180 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); 180 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
181 qApp->processEvents(); 181 qApp->processEvents();
182 QTime t; 182 QTime t;
183 183
184 if ( test_alu->isOn() ) 184 if ( test_alu->isOn() )
185 { 185 {
186 int d = round( dhry_main( DHRYSTONE_RUNS ) ); 186 int d = round( dhry_main( DHRYSTONE_RUNS ) );
187 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) ); 187 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) );
188 test_alu->setOn( false ); 188 test_alu->setOn( false );
189 } 189 }
190 190
191 if ( test_fpu->isOn() ) 191 if ( test_fpu->isOn() )
192 { 192 {
193 t.start(); 193 t.start();
194 BenchFFT(); 194 BenchFFT();
195 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); 195 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) );
196 test_fpu->setOn( false ); 196 test_fpu->setOn( false );
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index 9cb8ad2..e688a29 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -9,98 +9,98 @@
9** 9**
10** Based on ProcessInfo by Dan Williams <williamsdr@acm.org> 10** Based on ProcessInfo by Dan Williams <williamsdr@acm.org>
11** 11**
12** This file may be distributed and/or modified under the terms of the 12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software 13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "modulesinfo.h" 22#include "modulesinfo.h"
23#include "detail.h" 23#include "detail.h"
24 24
25/* OPIE */ 25/* OPIE */
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27 27
28/* QT */ 28/* QT */
29#include <qfile.h> 29#include <qfile.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qmessagebox.h> 31#include <qmessagebox.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qwhatsthis.h> 33#include <qwhatsthis.h>
34 34
35ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 35ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
36 : QWidget( parent, name, fl ) 36 : QWidget( parent, name, fl )
37{ 37{
38 QGridLayout *layout = new QGridLayout( this ); 38 QGridLayout *layout = new QGridLayout( this );
39 layout->setSpacing( 4 ); 39 layout->setSpacing( 4 );
40 layout->setMargin( 4 ); 40 layout->setMargin( 4 );
41 41
42 ModulesView = new QListView( this ); 42 ModulesView = new QListView( this );
43 int colnum = ModulesView->addColumn( tr( "Module" ) ); 43 int colnum = ModulesView->addColumn( tr( "Module" ) );
44 colnum = ModulesView->addColumn( tr( "Size" ) ); 44 colnum = ModulesView->addColumn( tr( "Size" ) );
45 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 45 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
46 colnum = ModulesView->addColumn( tr( "Use#" ) ); 46 colnum = ModulesView->addColumn( tr( "Use#" ) );
47 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 47 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
48 colnum = ModulesView->addColumn( tr( "Used by" ) ); 48 colnum = ModulesView->addColumn( tr( "Used by" ) );
49 ModulesView->setAllColumnsShowFocus( TRUE ); 49 ModulesView->setAllColumnsShowFocus( TRUE );
50 layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 ); 50 layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 );
51 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) ); 51 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) );
52 52
53 // Test if we have /sbin/modinfo, and if so, allow module detail window 53 // Test if we have /sbin/modinfo, and if so, allow module detail window
54 if ( QFile::exists( "/sbin/modinfo" ) ) 54 if ( QFile::exists( "/sbin/modinfo" ) )
55 { 55 {
56 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); 56 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
57 connect( ModulesView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 57 connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
58 this, SLOT( viewModules( QListViewItem * ) ) ); 58 this, SLOT( viewModules(QListViewItem*) ) );
59 } 59 }
60 60
61 CommandCB = new QComboBox( FALSE, this ); 61 CommandCB = new QComboBox( FALSE, this );
62 CommandCB->insertItem( "modprobe -r" ); 62 CommandCB->insertItem( "modprobe -r" );
63 CommandCB->insertItem( "rmmod" ); 63 CommandCB->insertItem( "rmmod" );
64 // I can't think of other useful commands yet. Anyone? 64 // I can't think of other useful commands yet. Anyone?
65 layout->addWidget( CommandCB, 1, 0 ); 65 layout->addWidget( CommandCB, 1, 0 );
66 QWhatsThis::add( CommandCB, tr( "Select a command here and then click the Send button to the right to send the command to module selected above." ) ); 66 QWhatsThis::add( CommandCB, tr( "Select a command here and then click the Send button to the right to send the command to module selected above." ) );
67 67
68 QPushButton *btn = new QPushButton( this ); 68 QPushButton *btn = new QPushButton( this );
69 btn->setMinimumSize( QSize( 50, 24 ) ); 69 btn->setMinimumSize( QSize( 50, 24 ) );
70 btn->setMaximumSize( QSize( 50, 24 ) ); 70 btn->setMaximumSize( QSize( 50, 24 ) );
71 btn->setText( tr( "Send" ) ); 71 btn->setText( tr( "Send" ) );
72 connect( btn, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); 72 connect( btn, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) );
73 layout->addWidget( btn, 1, 1 ); 73 layout->addWidget( btn, 1, 1 );
74 QWhatsThis::add( btn, tr( "Click here to send the selected command to the module selected above." ) ); 74 QWhatsThis::add( btn, tr( "Click here to send the selected command to the module selected above." ) );
75 75
76 QTimer *t = new QTimer( this ); 76 QTimer *t = new QTimer( this );
77 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); 77 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) );
78 t->start( 5000 ); 78 t->start( 5000 );
79 79
80 updateData(); 80 updateData();
81 81
82 ModulesDtl = new Detail(); 82 ModulesDtl = new Detail();
83 QWhatsThis::add( ModulesDtl->detailView, tr( "This area shows detailed information about this module." ) ); 83 QWhatsThis::add( ModulesDtl->detailView, tr( "This area shows detailed information about this module." ) );
84} 84}
85 85
86ModulesInfo::~ModulesInfo() 86ModulesInfo::~ModulesInfo()
87{} 87{}
88 88
89void ModulesInfo::updateData() 89void ModulesInfo::updateData()
90{ 90{
91 char modname[64]; 91 char modname[64];
92 char usage[200]; 92 char usage[200];
93 int modsize, usecount; 93 int modsize, usecount;
94 94
95 QString selectedmod; 95 QString selectedmod;
96 QListViewItem *curritem = ModulesView->currentItem(); 96 QListViewItem *curritem = ModulesView->currentItem();
97 if ( curritem ) 97 if ( curritem )
98 { 98 {
99 selectedmod = curritem->text( 0 ); 99 selectedmod = curritem->text( 0 );
100 } 100 }
101 101
102 ModulesView->clear(); 102 ModulesView->clear();
103 103
104 FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r"); 104 FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r");
105 105
106 if ( procfile ) 106 if ( procfile )
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 2a90b0f..69b4ab5 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -6,98 +6,98 @@
6** Copyright (C) 2002, Dan Williams 6** Copyright (C) 2002, Dan Williams
7** williamsdr@acm.org 7** williamsdr@acm.org
8** http://draknor.net 8** http://draknor.net
9** 9**
10** This file may be distributed and/or modified under the terms of the 10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software 11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the 12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file. 13** packaging of this file.
14** 14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17** 17**
18**********************************************************************/ 18**********************************************************************/
19 19
20#include "processinfo.h" 20#include "processinfo.h"
21#include "detail.h" 21#include "detail.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25 25
26/* QT */ 26/* QT */
27#include <qdir.h> 27#include <qdir.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qmessagebox.h> 29#include <qmessagebox.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qwhatsthis.h> 31#include <qwhatsthis.h>
32 32
33/* STD */ 33/* STD */
34#include <sys/types.h> 34#include <sys/types.h>
35#include <signal.h> 35#include <signal.h>
36 36
37ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) 37ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
38 : QWidget( parent, name, fl ) 38 : QWidget( parent, name, fl )
39{ 39{
40 QGridLayout *layout = new QGridLayout( this ); 40 QGridLayout *layout = new QGridLayout( this );
41 layout->setSpacing( 4 ); 41 layout->setSpacing( 4 );
42 layout->setMargin( 4 ); 42 layout->setMargin( 4 );
43 43
44 44
45 ProcessView = new QListView( this, "ProcessView" ); 45 ProcessView = new QListView( this, "ProcessView" );
46 int colnum = ProcessView->addColumn( tr( "PID" ) ); 46 int colnum = ProcessView->addColumn( tr( "PID" ) );
47 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 47 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
48 colnum = ProcessView->addColumn( tr( "Command" ),96 ); 48 colnum = ProcessView->addColumn( tr( "Command" ),96 );
49 colnum = ProcessView->addColumn( tr( "Status" ) ); 49 colnum = ProcessView->addColumn( tr( "Status" ) );
50 colnum = ProcessView->addColumn( tr( "Time" ) ); 50 colnum = ProcessView->addColumn( tr( "Time" ) );
51 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 51 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
52 ProcessView->setAllColumnsShowFocus( TRUE ); 52 ProcessView->setAllColumnsShowFocus( TRUE );
53 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); 53 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold );
54 connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 54 connect( ProcessView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
55 this, SLOT( viewProcess( QListViewItem * ) ) ); 55 this, SLOT( viewProcess(QListViewItem*) ) );
56 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); 56 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 );
57 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) ); 57 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) );
58 58
59 SignalCB = new QComboBox( FALSE, this, "SignalCB" ); 59 SignalCB = new QComboBox( FALSE, this, "SignalCB" );
60 SignalCB->insertItem( " 1: SIGHUP" ); 60 SignalCB->insertItem( " 1: SIGHUP" );
61 SignalCB->insertItem( " 2: SIGINT" ); 61 SignalCB->insertItem( " 2: SIGINT" );
62 SignalCB->insertItem( " 3: SIGQUIT" ); 62 SignalCB->insertItem( " 3: SIGQUIT" );
63 SignalCB->insertItem( " 5: SIGTRAP" ); 63 SignalCB->insertItem( " 5: SIGTRAP" );
64 SignalCB->insertItem( " 6: SIGABRT" ); 64 SignalCB->insertItem( " 6: SIGABRT" );
65 SignalCB->insertItem( " 9: SIGKILL" ); 65 SignalCB->insertItem( " 9: SIGKILL" );
66 SignalCB->insertItem( "14: SIGALRM" ); 66 SignalCB->insertItem( "14: SIGALRM" );
67 SignalCB->insertItem( "15: SIGTERM" ); 67 SignalCB->insertItem( "15: SIGTERM" );
68 SignalCB->insertItem( "18: SIGCONT" ); 68 SignalCB->insertItem( "18: SIGCONT" );
69 SignalCB->insertItem( "19: SIGSTOP" ); 69 SignalCB->insertItem( "19: SIGSTOP" );
70 layout->addWidget( SignalCB, 1, 0 ); 70 layout->addWidget( SignalCB, 1, 0 );
71 QWhatsThis::add( SignalCB, tr( "Select a signal here and then click the Send button to the right to send to this process." ) ); 71 QWhatsThis::add( SignalCB, tr( "Select a signal here and then click the Send button to the right to send to this process." ) );
72 72
73 SendButton = new QPushButton( this, "SendButton" ); 73 SendButton = new QPushButton( this, "SendButton" );
74 SendButton->setMinimumSize( QSize( 50, 24 ) ); 74 SendButton->setMinimumSize( QSize( 50, 24 ) );
75 SendButton->setMaximumSize( QSize( 50, 24 ) ); 75 SendButton->setMaximumSize( QSize( 50, 24 ) );
76 SendButton->setText( tr( "Send" ) ); 76 SendButton->setText( tr( "Send" ) );
77 connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); 77 connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) );
78 layout->addWidget( SendButton, 1, 1 ); 78 layout->addWidget( SendButton, 1, 1 );
79 QWhatsThis::add( SendButton, tr( "Click here to send the selected signal to this process." ) ); 79 QWhatsThis::add( SendButton, tr( "Click here to send the selected signal to this process." ) );
80 80
81 QTimer *t = new QTimer( this ); 81 QTimer *t = new QTimer( this );
82 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); 82 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) );
83 t->start( 5000 ); 83 t->start( 5000 );
84 84
85 updateData(); 85 updateData();
86 86
87 ProcessDtl = new Detail(); 87 ProcessDtl = new Detail();
88 QWhatsThis::add( ProcessDtl->detailView, tr( "This area shows detailed information about this process." ) ); 88 QWhatsThis::add( ProcessDtl->detailView, tr( "This area shows detailed information about this process." ) );
89} 89}
90 90
91ProcessInfo::~ProcessInfo() 91ProcessInfo::~ProcessInfo()
92{} 92{}
93 93
94void ProcessInfo::updateData() 94void ProcessInfo::updateData()
95{ 95{
96 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime, 96 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime,
97 signal, blocked, sigignore, sigcatch; 97 signal, blocked, sigignore, sigcatch;
98 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode, 98 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode,
99 endcode, startstack, kstkesp, kstkeip, wchan; 99 endcode, startstack, kstkesp, kstkeip, wchan;
100 char state; 100 char state;
101 char comm[64]; 101 char comm[64];
102 102
103 QString selectedpid; 103 QString selectedpid;
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp
index ff5957c..15aeaf5 100644
--- a/noncore/settings/tabmanager/tabmanager.cpp
+++ b/noncore/settings/tabmanager/tabmanager.cpp
@@ -1,87 +1,87 @@
1#include "tabmanager.h" 1#include "tabmanager.h"
2#include "app.h" 2#include "app.h"
3#include "wait.h" 3#include "wait.h"
4#include "tabapplnk.h" 4#include "tabapplnk.h"
5 5
6#include <qpe/applnk.h> 6#include <qpe/applnk.h>
7#include <qdir.h> 7#include <qdir.h>
8#include <qfile.h> 8#include <qfile.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qlistview.h> 10#include <qlistview.h>
11#include <qheader.h> 11#include <qheader.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qlineedit.h> 13#include <qlineedit.h>
14#include <qlabel.h> 14#include <qlabel.h>
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <stdlib.h> 16#include <stdlib.h>
17#include <qpe/qcopenvelope_qws.h> 17#include <qpe/qcopenvelope_qws.h>
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21 21
22#define HOME_APP_DIR QPEApplication::qpeDir()+"/apps" 22#define HOME_APP_DIR QPEApplication::qpeDir()+"/apps"
23#define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info" 23#define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info"
24#define NEW_FOLDER "EmptyTab" 24#define NEW_FOLDER "EmptyTab"
25#define NEW_APPLICATION "NewApp" 25#define NEW_APPLICATION "NewApp"
26#define APPLICATION_EXTENSION ".desktop" 26#define APPLICATION_EXTENSION ".desktop"
27#define APPLICATION_EXTENSION_LENGTH 8 27#define APPLICATION_EXTENSION_LENGTH 8
28 28
29/** 29/**
30 * Constructor. Sets up signals. Performs initial scan of applications 30 * Constructor. Sets up signals. Performs initial scan of applications
31 * and tabs 31 * and tabs
32 */ 32 */
33TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ 33TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){
34 rescanFolder(HOME_APP_DIR); 34 rescanFolder(HOME_APP_DIR);
35 35
36 // Connect the signals and slots 36 // Connect the signals and slots
37 connect(tabList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(editItem(QListViewItem*))); 37 connect(tabList, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(editItem(QListViewItem*)));
38 (tabList->header())->hide(); 38 (tabList->header())->hide();
39 connect(tabList, SIGNAL(moveItem(QListViewItem *, QListViewItem *)), this, SLOT(moveApplication(QListViewItem *, QListViewItem *))); 39 connect(tabList, SIGNAL(moveItem(QListViewItem*,QListViewItem*)), this, SLOT(moveApplication(QListViewItem*,QListViewItem*)));
40} 40}
41 41
42/** 42/**
43 * If anything in the tab's have been changed then update the system or alert 43 * If anything in the tab's have been changed then update the system or alert
44 * the user. 44 * the user.
45 */ 45 */
46TabManager::~TabManager(){ 46TabManager::~TabManager(){
47 if(changed){ 47 if(changed){
48 // Prompt. 48 // Prompt.
49 //int answer = QMessageBox::warning(this, "Message", "Should your desktop be","Yes", "Cancel", 0, 1 ); 49 //int answer = QMessageBox::warning(this, "Message", "Should your desktop be","Yes", "Cancel", 0, 1 );
50 //if (answer) 50 //if (answer)
51 // return; 51 // return;
52 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 52 QCopEnvelope e("QPE/System", "linkChanged(QString)");
53 QString link; //we'll just send an empty string 53 QString link; //we'll just send an empty string
54 e << link; 54 e << link;
55 } 55 }
56} 56}
57 57
58/** 58/**
59 * Scans root directory for any tabs or applications. Will recursivly go down, 59 * Scans root directory for any tabs or applications. Will recursivly go down,
60 * but will not follow symlinks. 60 * but will not follow symlinks.
61 * @param directory - the directory to look in. 61 * @param directory - the directory to look in.
62 * @param parent - the parent to place any new tabs or apps into. If parent is 62 * @param parent - the parent to place any new tabs or apps into. If parent is
63 * NULL then the item is a tab and should be placed as a child of the window. 63 * NULL then the item is a tab and should be placed as a child of the window.
64 */ 64 */
65void TabManager::rescanFolder(QString directory, QListViewItem* parent){ 65void TabManager::rescanFolder(QString directory, QListViewItem* parent){
66 //qDebug(QString("rescanFolder: ") + directory.latin1()); 66 //qDebug(QString("rescanFolder: ") + directory.latin1());
67 67
68 QDir d; 68 QDir d;
69 d.setPath(directory); 69 d.setPath(directory);
70 // Show hidden files for .directories 70 // Show hidden files for .directories
71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
72 72
73 const QFileInfoList *list = d.entryInfoList(); 73 const QFileInfoList *list = d.entryInfoList();
74 QFileInfoListIterator it( *list ); // create list iterator 74 QFileInfoListIterator it( *list ); // create list iterator
75 QFileInfo *fi; // pointer for traversing 75 QFileInfo *fi; // pointer for traversing
76 76
77 while ( (fi=it.current()) ) { // for each file... 77 while ( (fi=it.current()) ) { // for each file...
78 // If it is a dir and not .. or . then add it as a tab and go down. 78 // If it is a dir and not .. or . then add it as a tab and go down.
79 if(fi->isDir()){ 79 if(fi->isDir()){
80 if(fi->fileName() != ".." && fi->fileName() != ".") { 80 if(fi->fileName() != ".." && fi->fileName() != ".") {
81 QListViewItem* newItem; 81 QListViewItem* newItem;
82 if(!parent) 82 if(!parent)
83 newItem = new QListViewItem(tabList, fi->fileName()); 83 newItem = new QListViewItem(tabList, fi->fileName());
84 else 84 else
85 newItem = new QListViewItem(parent, fi->fileName()); 85 newItem = new QListViewItem(parent, fi->fileName());
86 itemList.insert(newItem, directory + "/" + fi->fileName() + "/.directory" ); 86 itemList.insert(newItem, directory + "/" + fi->fileName() + "/.directory" );
87 rescanFolder(directory + "/" + fi->fileName(), newItem); 87 rescanFolder(directory + "/" + fi->fileName(), newItem);
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index 5411995..a1130d4 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -32,97 +32,97 @@ UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWind
32 accounts=new Passwd(); 32 accounts=new Passwd();
33 accounts->open();// This actually loads the files /etc/passwd & /etc/group into memory. 33 accounts->open();// This actually loads the files /etc/passwd & /etc/group into memory.
34 34
35 // Create the toolbar. 35 // Create the toolbar.
36 QToolBar *toolbar = new QToolBar(this,"Toolbar"); 36 QToolBar *toolbar = new QToolBar(this,"Toolbar");
37 toolbar->setHorizontalStretchable(1); // Is there any other way to get the toolbar to stretch of the full screen!? 37 toolbar->setHorizontalStretchable(1); // Is there any other way to get the toolbar to stretch of the full screen!?
38 adduserToolButton = new QToolButton(Resource::loadPixmap("usermanager/adduser"),"Add User",0,this,SLOT(addUser()),toolbar,"Add User"); 38 adduserToolButton = new QToolButton(Resource::loadPixmap("usermanager/adduser"),"Add User",0,this,SLOT(addUser()),toolbar,"Add User");
39 edituserToolButton = new QToolButton(Resource::loadPixmap("usermanager/edituser"),"Edit User",0,this,SLOT(editUser()),toolbar,"Edit User"); 39 edituserToolButton = new QToolButton(Resource::loadPixmap("usermanager/edituser"),"Edit User",0,this,SLOT(editUser()),toolbar,"Edit User");
40 deleteuserToolButton = new QToolButton(Resource::loadPixmap("usermanager/deleteuser"),"Delete User",0,this,SLOT(delUser()),toolbar,"Delete User"); 40 deleteuserToolButton = new QToolButton(Resource::loadPixmap("usermanager/deleteuser"),"Delete User",0,this,SLOT(delUser()),toolbar,"Delete User");
41 QToolButton *userstext = new QToolButton(0,"User",0,0,0,toolbar,"User"); 41 QToolButton *userstext = new QToolButton(0,"User",0,0,0,toolbar,"User");
42 userstext->setUsesTextLabel(true); 42 userstext->setUsesTextLabel(true);
43 toolbar->addSeparator(); 43 toolbar->addSeparator();
44 addgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/addgroup"),"Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group"); 44 addgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/addgroup"),"Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group");
45 editgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/editgroup"),"Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group"); 45 editgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/editgroup"),"Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group");
46 deletegroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/deletegroup"),"Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group"); 46 deletegroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/deletegroup"),"Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group");
47 QToolButton *groupstext = new QToolButton(0,"Group",0,0,0,toolbar,"Group"); 47 QToolButton *groupstext = new QToolButton(0,"Group",0,0,0,toolbar,"Group");
48 groupstext->setUsesTextLabel(true); 48 groupstext->setUsesTextLabel(true);
49 addToolBar(toolbar,"myToolBar"); 49 addToolBar(toolbar,"myToolBar");
50 50
51 // Add a tabwidget and all the tabs. 51 // Add a tabwidget and all the tabs.
52 myTabWidget = new QTabWidget(this,"My Tab Widget"); 52 myTabWidget = new QTabWidget(this,"My Tab Widget");
53 setupTabAccounts(); 53 setupTabAccounts();
54 setupTabAllUsers(); 54 setupTabAllUsers();
55 setupTabAllGroups(); 55 setupTabAllGroups();
56 userPopupMenu.insertItem("Copy",0); 56 userPopupMenu.insertItem("Copy",0);
57 57
58 getUsers(); // Fill out the iconview & listview with all users. 58 getUsers(); // Fill out the iconview & listview with all users.
59 getGroups(); // Fill out the group listview with all groups. 59 getGroups(); // Fill out the group listview with all groups.
60 60
61 setCentralWidget(myTabWidget); 61 setCentralWidget(myTabWidget);
62} 62}
63 63
64UserConfig::~UserConfig() { 64UserConfig::~UserConfig() {
65 accounts->close(); 65 accounts->close();
66 delete accounts; 66 delete accounts;
67} 67}
68 68
69void UserConfig::setupTabAccounts() { 69void UserConfig::setupTabAccounts() {
70 QWidget *tabpage = new QWidget(this); 70 QWidget *tabpage = new QWidget(this);
71 QVBoxLayout *layout = new QVBoxLayout(tabpage); 71 QVBoxLayout *layout = new QVBoxLayout(tabpage);
72 layout->setMargin(5); 72 layout->setMargin(5);
73 73
74 usersIconView=new QListView(tabpage,"users"); 74 usersIconView=new QListView(tabpage,"users");
75 usersIconView->addColumn("Icon"); 75 usersIconView->addColumn("Icon");
76 usersIconView->addColumn("Username"); 76 usersIconView->addColumn("Username");
77 usersIconView->setAllColumnsShowFocus(true); 77 usersIconView->setAllColumnsShowFocus(true);
78 layout->addWidget(usersIconView); 78 layout->addWidget(usersIconView);
79 79
80 connect(usersIconView,SIGNAL(returnPressed(QListViewItem *)),this,SLOT(showUserMenu(QListViewItem *))); 80 connect(usersIconView,SIGNAL(returnPressed(QListViewItem*)),this,SLOT(showUserMenu(QListViewItem*)));
81 81
82 myTabWidget->addTab(tabpage,"Users"); 82 myTabWidget->addTab(tabpage,"Users");
83} 83}
84 84
85void UserConfig::setupTabAllUsers() { 85void UserConfig::setupTabAllUsers() {
86 QWidget *tabpage = new QWidget(this); 86 QWidget *tabpage = new QWidget(this);
87 QVBoxLayout *layout = new QVBoxLayout(tabpage); 87 QVBoxLayout *layout = new QVBoxLayout(tabpage);
88 layout->setMargin(5); 88 layout->setMargin(5);
89 89
90 usersListView=new QListView(tabpage,"allusers"); 90 usersListView=new QListView(tabpage,"allusers");
91 usersListView->addColumn("UID"); 91 usersListView->addColumn("UID");
92 usersListView->addColumn("Login"); 92 usersListView->addColumn("Login");
93 usersListView->addColumn("Username"); 93 usersListView->addColumn("Username");
94 layout->addWidget(usersListView); 94 layout->addWidget(usersListView);
95 usersListView->setSorting(1,1); 95 usersListView->setSorting(1,1);
96 usersListView->setAllColumnsShowFocus(true); 96 usersListView->setAllColumnsShowFocus(true);
97 97
98 myTabWidget->addTab(tabpage,"All Users"); 98 myTabWidget->addTab(tabpage,"All Users");
99} 99}
100 100
101void UserConfig::setupTabAllGroups() { 101void UserConfig::setupTabAllGroups() {
102 QWidget *tabpage = new QWidget(this); 102 QWidget *tabpage = new QWidget(this);
103 QVBoxLayout *layout = new QVBoxLayout(tabpage); 103 QVBoxLayout *layout = new QVBoxLayout(tabpage);
104 layout->setMargin(5); 104 layout->setMargin(5);
105 105
106 groupsListView=new QListView(tabpage,"groups"); 106 groupsListView=new QListView(tabpage,"groups");
107 groupsListView->addColumn("GID"); 107 groupsListView->addColumn("GID");
108 groupsListView->addColumn("Groupname"); 108 groupsListView->addColumn("Groupname");
109 layout->addWidget(groupsListView); 109 layout->addWidget(groupsListView);
110 groupsListView->setSorting(1,1); 110 groupsListView->setSorting(1,1);
111 groupsListView->setAllColumnsShowFocus(true); 111 groupsListView->setAllColumnsShowFocus(true);
112 112
113 myTabWidget->addTab(tabpage,"All Groups"); 113 myTabWidget->addTab(tabpage,"All Groups");
114} 114}
115void UserConfig::getUsers() { 115void UserConfig::getUsers() {
116 QString mytext; 116 QString mytext;
117 QPixmap mypixmap; 117 QPixmap mypixmap;
118 QListViewItem *listviewitem; 118 QListViewItem *listviewitem;
119 119
120 // Empty the iconview & the listview. 120 // Empty the iconview & the listview.
121 usersIconView->clear(); 121 usersIconView->clear();
122 usersListView->clear(); 122 usersListView->clear();
123 123
124 // availableUID is used as a deposite for the next available UID on the system, this should start at an ID over 500. 124 // availableUID is used as a deposite for the next available UID on the system, this should start at an ID over 500.
125 availableUID=500; 125 availableUID=500;
126 for(QStringList::Iterator it=accounts->passwdStringList.begin(); it!=accounts->passwdStringList.end(); ++it) { 126 for(QStringList::Iterator it=accounts->passwdStringList.begin(); it!=accounts->passwdStringList.end(); ++it) {
127 accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.) 127 accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.)
128 if(accounts->pw_name.find(QRegExp("^#"),0)) {// Skip commented lines. 128 if(accounts->pw_name.find(QRegExp("^#"),0)) {// Skip commented lines.