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 | |||
@@ -92,187 +92,187 @@ public: | |||
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 | ||
104 | private: | 104 | private: |
105 | ulong ref; | 105 | ulong ref; |
106 | }; | 106 | }; |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | 114 | QWidget *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 | ||
173 | QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | 173 | QWidget *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 | ||
222 | QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) | 222 | QWidget *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 | ||
238 | QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | 238 | QWidget *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." ) ); |
@@ -291,92 +291,92 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
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" ); |
@@ -458,65 +458,65 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
458 | 458 | ||
459 | 459 | ||
460 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 460 | Appearance::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 | ||
495 | Appearance::~Appearance() | 495 | Appearance::~Appearance() |
496 | {} | 496 | {} |
497 | 497 | ||
498 | void Appearance::tabChanged ( QWidget *w ) | 498 | void 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 | ||
509 | void Appearance::accept ( ) | 509 | void 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 | } |
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 | |||
@@ -62,95 +62,95 @@ public: | |||
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 | ||
74 | private: | 74 | private: |
75 | bool hl; | 75 | bool hl; |
76 | QString text; | 76 | QString text; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) | 80 | SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) |
81 | { | 81 | { |
82 | init(); | 82 | init(); |
83 | } | 83 | } |
84 | 84 | ||
85 | QSize SampleWindow::sizeHint() const | 85 | QSize SampleWindow::sizeHint() const |
86 | { | 86 | { |
87 | return container->sizeHint() + QSize( 10, 35 ); | 87 | return container->sizeHint() + QSize( 10, 35 ); |
88 | } | 88 | } |
89 | 89 | ||
90 | void SampleWindow::setFont( const QFont &f ) | 90 | void 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 | ||
97 | static void setStyleRecursive ( QWidget *w, QStyle *s ) | 97 | static 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 | ||
112 | void SampleWindow::setStyle2 ( QStyle *sty, const QPalette &pal ) | 112 | void 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 | ||
128 | void SampleWindow::setDecoration( WindowDecorationInterface *i ) | 128 | void 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 | ||
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 | |||
@@ -46,66 +46,66 @@ InputDialog :: InputDialog( const QString &label, QWidget* parent, const char* n | |||
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 | ||
91 | InputDialog::~InputDialog() | 91 | InputDialog::~InputDialog() |
92 | { | 92 | { |
93 | } | 93 | } |
94 | 94 | ||
95 | void InputDialog :: setText( const QString &text ) | 95 | void 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 | ||
101 | QString InputDialog :: getText() | 101 | QString InputDialog :: getText() |
102 | { | 102 | { |
103 | return lineEdit->text(); | 103 | return lineEdit->text(); |
104 | } | 104 | } |
105 | 105 | ||
106 | QString InputDialog::getText( const QString &caption, const QString &label, | 106 | QString 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 ); |
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 | |||
@@ -143,66 +143,66 @@ InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManag | |||
143 | 143 | ||
144 | displayAvailableSpace( destination->currentText() ); | 144 | displayAvailableSpace( destination->currentText() ); |
145 | } | 145 | } |
146 | 146 | ||
147 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *title ) | 147 | InstallDlgImpl::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 | ||
157 | InstallDlgImpl::~InstallDlgImpl() | 157 | InstallDlgImpl::~InstallDlgImpl() |
158 | { | 158 | { |
159 | if ( pIpkg ) | 159 | if ( pIpkg ) |
160 | delete pIpkg; | 160 | delete pIpkg; |
161 | } | 161 | } |
162 | 162 | ||
163 | void InstallDlgImpl :: init( bool displayextrainfo ) | 163 | void 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 | ||
207 | void InstallDlgImpl :: optionsSelected() | 207 | void InstallDlgImpl :: optionsSelected() |
208 | { | 208 | { |
@@ -249,87 +249,87 @@ void InstallDlgImpl :: optionsSelected() | |||
249 | 249 | ||
250 | void InstallDlgImpl :: installSelected() | 250 | void 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 | { |
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 | |||
@@ -259,72 +259,72 @@ void Ipkg :: removeStatusEntry() | |||
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 | ||
276 | int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | 276 | int 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 | ||
313 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | 313 | void 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 ) ); |
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 | |||
@@ -71,82 +71,82 @@ extern int compareVersions( const char *v1, const char *v2 ); | |||
71 | 71 | ||
72 | MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) | 72 | MainWindow :: 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 | ||
@@ -236,109 +236,109 @@ MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
243 | MainWindow :: ~MainWindow() | 243 | MainWindow :: ~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 | ||
251 | void MainWindow :: initMainWidget() | 251 | void 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 | ||
281 | void MainWindow :: initProgressWidget() | 281 | void 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 | ||
295 | void MainWindow :: init() | 295 | void 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 | ||
325 | void MainWindow :: setDocument( const QString &doc ) | 325 | void 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() ) |
@@ -741,96 +741,96 @@ void MainWindow :: searchForPackage( const QString &text ) | |||
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 | ||
756 | void MainWindow :: updateServer() | 756 | void 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 | ||
781 | void MainWindow :: upgradePackages() | 781 | void 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 | ||
811 | void MainWindow :: downloadPackage() | 811 | void 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 | ||
@@ -877,147 +877,147 @@ void MainWindow :: downloadPackage() | |||
877 | void MainWindow :: downloadSelectedPackages() | 877 | void 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 | ||
925 | void MainWindow :: downloadRemotePackage() | 925 | void 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 | ||
954 | void MainWindow :: applyChanges() | 954 | void 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 |
1002 | InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | 1002 | InstallData *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 |
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 | |||
@@ -82,123 +82,123 @@ SettingsImpl :: ~SettingsImpl() | |||
82 | { | 82 | { |
83 | } | 83 | } |
84 | 84 | ||
85 | bool SettingsImpl :: showDlg() | 85 | bool 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 | ||
94 | QWidget *SettingsImpl :: initServerTab() | 94 | QWidget *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 | ||
152 | QWidget *SettingsImpl :: initDestinationTab() | 152 | QWidget *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() ) ); |
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 | |||
@@ -21,67 +21,67 @@ | |||
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 | ||
41 | const QString tempFileName = "/tmp/backup.err"; | 41 | const QString tempFileName = "/tmp/backup.err"; |
42 | 42 | ||
43 | 43 | ||
44 | BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) | 44 | BackupAndRestore::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 | } |
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 | |||
@@ -48,88 +48,88 @@ | |||
48 | #include <qstring.h> | 48 | #include <qstring.h> |
49 | #include <qtimer.h> | 49 | #include <qtimer.h> |
50 | 50 | ||
51 | MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) | 51 | MainWindow::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 | ||
114 | MainWindow::~MainWindow() | 114 | MainWindow::~MainWindow() |
115 | { | 115 | { |
116 | if ( ntpProcess ) | 116 | if ( ntpProcess ) |
117 | delete ntpProcess; | 117 | delete ntpProcess; |
118 | } | 118 | } |
119 | 119 | ||
120 | void MainWindow::accept() | 120 | void 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(); |
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 | |||
@@ -49,70 +49,70 @@ SettingsTabWidget::SettingsTabWidget( QWidget *parent ) | |||
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 | ||
115 | SettingsTabWidget::~SettingsTabWidget() | 115 | SettingsTabWidget::~SettingsTabWidget() |
116 | { | 116 | { |
117 | } | 117 | } |
118 | 118 | ||
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 | |||
@@ -73,65 +73,65 @@ TimeTabWidget::TimeTabWidget( QWidget *parent ) | |||
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 | ||
134 | TimeTabWidget::~TimeTabWidget() | 134 | TimeTabWidget::~TimeTabWidget() |
135 | { | 135 | { |
136 | } | 136 | } |
137 | 137 | ||
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,61 +1,61 @@ | |||
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 | */ |
26 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) | 26 | InterfaceInformationImp::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 | ||
41 | InterfaceInformationImp::~InterfaceInformationImp() | 41 | InterfaceInformationImp::~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 | */ |
53 | void InterfaceInformationImp::updateInterface(Interface *) | 53 | void 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 |
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 | |||
@@ -68,65 +68,65 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi | |||
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 | } |
@@ -223,82 +223,82 @@ void MainWindowImp::getAllInterfaces() | |||
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 | */ |
283 | void MainWindowImp::loadModules(const QString &path) | 283 | void 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 | { |
@@ -683,66 +683,66 @@ void MainWindowImp::changeProfile() | |||
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 | ||
712 | void MainWindowImp::makeChannel() | 712 | void 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 | ||
719 | void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) | 719 | void 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 | |||
@@ -543,66 +543,66 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha | |||
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); |
@@ -1155,57 +1155,57 @@ void ScriptWidget::removeButton() | |||
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 | ///////////////////////////////////////////////////////////////////////////// |
1166 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | 1166 | PhoneNumberDialog::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 | ||
1197 | QString PhoneNumberDialog::phoneNumber() | 1197 | QString 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 | ||
1205 | void PhoneNumberDialog::textChanged(const QString &s) | 1205 | void 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 | |||
@@ -55,66 +55,66 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
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); |
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 | |||
@@ -367,69 +367,69 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
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 | ||
412 | void KPPPWidget::interruptConnection() { | 412 | void 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 | ||
425 | void KPPPWidget::sigPPPDDied() { | 425 | void 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 |
@@ -692,66 +692,66 @@ void KPPPWidget::quitbutton() { | |||
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() { |
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 | |||
@@ -26,66 +26,66 @@ | |||
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 | ||
35 | PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name) | 35 | PPPdArguments::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 | ||
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 | |||
@@ -25,65 +25,65 @@ | |||
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 | */ |
45 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { | 45 | WLANImp::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 | ||
64 | WLANImp::~WLANImp() { | 64 | WLANImp::~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 | */ |
71 | void WLANImp::setProfile(const QString &profile){ | 71 | void WLANImp::setProfile(const QString &profile){ |
72 | interfaceSetup->setProfile(profile); | 72 | interfaceSetup->setProfile(profile); |
73 | parseOpts(); | 73 | parseOpts(); |
74 | } | 74 | } |
75 | 75 | ||
76 | void WLANImp::parseOpts() { | 76 | void 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 | } |
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 | |||
@@ -39,65 +39,65 @@ FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name, | |||
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 ); |
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 | |||
@@ -89,98 +89,98 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | |||
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 | ||
95 | void MainWindow::closeEvent( QCloseEvent *event ) | 95 | void 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 | ||
116 | void MainWindow::initPackageList() | 116 | void 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 | ||
125 | void MainWindow::initStatusWidget() | 125 | void 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 | ||
139 | void MainWindow::initUI() | 139 | void 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 | ||
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 | |||
@@ -287,114 +287,114 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & | |||
287 | return pl; | 287 | return pl; |
288 | } | 288 | } |
289 | 289 | ||
290 | bool OIpkg::executeCommand( OPackage::Command command, QStringList *parameters, const QString &destination, | 290 | bool 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 | ||
378 | void OIpkg::ipkgMessage( char *msg ) | 378 | void OIpkg::ipkgMessage( char *msg ) |
379 | { | 379 | { |
380 | emit signalIpkgMessage( msg ); | 380 | emit signalIpkgMessage( msg ); |
381 | } | 381 | } |
382 | 382 | ||
383 | void OIpkg::ipkgStatus( char *status ) | 383 | void OIpkg::ipkgStatus( char *status ) |
384 | { | 384 | { |
385 | emit signalIpkgStatus( status ); | 385 | emit signalIpkgStatus( status ); |
386 | } | 386 | } |
387 | 387 | ||
388 | void OIpkg::ipkgList( char *filelist ) | 388 | void OIpkg::ipkgList( char *filelist ) |
389 | { | 389 | { |
390 | emit signalIpkgList( filelist ); | 390 | emit signalIpkgList( filelist ); |
391 | } | 391 | } |
392 | 392 | ||
393 | void OIpkg::loadConfiguration() | 393 | void 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 | ||
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 | |||
@@ -82,74 +82,74 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | |||
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 | ||
128 | void SoundSettings::updateStorageCombo() { | 128 | void 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); |
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 | |||
@@ -116,65 +116,65 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | |||
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 | ||
155 | BenchmarkInfo::~BenchmarkInfo() | 155 | BenchmarkInfo::~BenchmarkInfo() |
156 | {} | 156 | {} |
157 | 157 | ||
158 | 158 | ||
159 | void BenchmarkInfo::machineActivated( int index ) | 159 | void 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 | ||
178 | void BenchmarkInfo::run() | 178 | void 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! <" ); |
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 | |||
@@ -25,66 +25,66 @@ | |||
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 | ||
35 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | 35 | ModulesInfo::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 | ||
86 | ModulesInfo::~ModulesInfo() | 86 | ModulesInfo::~ModulesInfo() |
87 | {} | 87 | {} |
88 | 88 | ||
89 | void ModulesInfo::updateData() | 89 | void ModulesInfo::updateData() |
90 | { | 90 | { |
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 | |||
@@ -22,66 +22,66 @@ | |||
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 | ||
37 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | 37 | ProcessInfo::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(); |
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 | |||
@@ -5,67 +5,67 @@ | |||
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 | */ |
33 | TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ | 33 | TabManager::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 | */ |
46 | TabManager::~TabManager(){ | 46 | TabManager::~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 | */ |
65 | void TabManager::rescanFolder(QString directory, QListViewItem* parent){ | 65 | void 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); |
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 | |||
@@ -48,65 +48,65 @@ UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWind | |||
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 | ||
64 | UserConfig::~UserConfig() { | 64 | UserConfig::~UserConfig() { |
65 | accounts->close(); | 65 | accounts->close(); |
66 | delete accounts; | 66 | delete accounts; |
67 | } | 67 | } |
68 | 68 | ||
69 | void UserConfig::setupTabAccounts() { | 69 | void 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 | ||
85 | void UserConfig::setupTabAllUsers() { | 85 | void 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 | ||
101 | void UserConfig::setupTabAllGroups() { | 101 | void 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 | ||