summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/button/remapdlg.cpp16
-rw-r--r--core/settings/citytime/citytime.cpp6
-rw-r--r--core/settings/citytime/citytimebase.cpp10
-rw-r--r--core/settings/citytime/zonemap.cpp12
-rw-r--r--core/settings/launcher/doctabsettings.cpp6
-rw-r--r--core/settings/launcher/inputmethodsettings.cpp6
-rw-r--r--core/settings/launcher/tabdialog.cpp18
-rw-r--r--core/settings/launcher/taskbarsettings.cpp22
-rw-r--r--core/settings/light-and-power/light.cpp7
-rw-r--r--core/settings/security/security.cpp8
-rw-r--r--core/settings/security/security.pro2
-rw-r--r--core/symlinker/main.cpp34
-rw-r--r--core/symlinker/symlinker.pro2
-rw-r--r--core/tools/quicklauncher/main.cpp19
14 files changed, 111 insertions, 57 deletions
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp
index 4effebc..cadb955 100644
--- a/core/settings/button/remapdlg.cpp
+++ b/core/settings/button/remapdlg.cpp
@@ -1,30 +1,36 @@
1
2#include "remapdlg.h"
3#include "buttonutils.h"
4
5/* OPIE */
6#include <opie2/odebug.h>
7
8/* QT */
1#include <qlistview.h> 9#include <qlistview.h>
2#include <qcombobox.h> 10#include <qcombobox.h>
3#include <qtimer.h> 11#include <qtimer.h>
4 12
5#include "remapdlg.h"
6#include "buttonutils.h"
7 13
8 14
9using namespace Opie::Core; 15using namespace Opie::Core;
10class NoSortItem : public QListViewItem { 16class NoSortItem : public QListViewItem {
11public: 17public:
12 NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 ) 18 NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 )
13 : QListViewItem ( lv, str, s1, s2 ) 19 : QListViewItem ( lv, str, s1, s2 )
14 { 20 {
15 m_key = QString ( QChar ( 'a' + pos )); 21 m_key = QString ( QChar ( 'a' + pos ));
16 m_def = false; 22 m_def = false;
17 } 23 }
18 24
19 void setDefault ( bool b ) 25 void setDefault ( bool b )
20 { 26 {
21 m_def = b; 27 m_def = b;
22 } 28 }
23 29
24 virtual QString key ( int /*column*/, bool /*ascending*/ ) const 30 virtual QString key ( int /*column*/, bool /*ascending*/ ) const
25 { 31 {
26 return m_key; 32 return m_key;
27 } 33 }
28 34
29 virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) 35 virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
30 { 36 {
@@ -87,58 +93,58 @@ RemapDlg::~RemapDlg ( )
87} 93}
88 94
89void RemapDlg::delayedInit ( ) 95void RemapDlg::delayedInit ( )
90{ 96{
91 bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); 97 bool b = w_list-> viewport ( )-> isUpdatesEnabled ( );
92 w_list-> viewport ( )-> setUpdatesEnabled ( false ); 98 w_list-> viewport ( )-> setUpdatesEnabled ( false );
93 99
94 ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); 100 ButtonUtils::inst ( )-> insertAppLnks ( m_map_show );
95 101
96 w_list-> viewport ( )-> setUpdatesEnabled ( b ); 102 w_list-> viewport ( )-> setUpdatesEnabled ( b );
97 103
98 m_map_show-> repaint ( ); 104 m_map_show-> repaint ( );
99} 105}
100 106
101void RemapDlg::itemChanged ( QListViewItem *it ) 107void RemapDlg::itemChanged ( QListViewItem *it )
102{ 108{
103 bool enabled = false; 109 bool enabled = false;
104 OQCopMessage m; 110 OQCopMessage m;
105 111
106 m_current = it; 112 m_current = it;
107 113
108 if ( it == m_map_none ) 114 if ( it == m_map_none )
109 { 115 {
110 m_msg = m = OQCopMessage ( "ignore", 0 ); 116 m_msg = m = OQCopMessage ( "ignore", 0 );
111 qDebug ("***ignoring"); 117 odebug << "***ignoring" << oendl;
112 } 118 }
113 else if ( it == m_map_preset ) 119 else if ( it == m_map_preset )
114 { 120 {
115 m_msg = m = m_msg_preset; 121 m_msg = m = m_msg_preset;
116 qDebug ("***Preset"); 122 odebug << "***Preset" << oendl;
117 } 123 }
118 else if ( it && !it-> childCount ( ) ) 124 else if ( it && !it-> childCount ( ) )
119 { 125 {
120 qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); 126 odebug << "***Custom: " << it-> text ( 1 ). latin1 ( ) << " " << it-> text ( 2 ). latin1 ( ) << oendl;
121 enabled = ( it == m_map_custom ); 127 enabled = ( it == m_map_custom );
122 m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); 128 m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( ));
123 } 129 }
124 130
125 w_channel-> setEnabled ( enabled ); 131 w_channel-> setEnabled ( enabled );
126 w_message-> setEnabled ( enabled ); 132 w_message-> setEnabled ( enabled );
127 133
128 w_channel-> setEditText ( m. channel ( )); 134 w_channel-> setEditText ( m. channel ( ));
129//hack for if user has typed in a message, such as 'suspend()' 135//hack for if user has typed in a message, such as 'suspend()'
130//so raise() is always present 136//so raise() is always present
131 if(m. message ( ) != "raise()") 137 if(m. message ( ) != "raise()")
132 w_message->insertItem("raise()"); 138 w_message->insertItem("raise()");
133 w_message-> setEditText ( m. message ( )); 139 w_message-> setEditText ( m. message ( ));
134} 140}
135 141
136void RemapDlg::textChanged ( const QString &str ) 142void RemapDlg::textChanged ( const QString &str )
137{ 143{
138 if ( !m_current ) 144 if ( !m_current )
139 return; 145 return;
140 146
141 QComboBox *which = (QComboBox *) sender ( ); 147 QComboBox *which = (QComboBox *) sender ( );
142 148
143 if ( which == w_channel ) 149 if ( which == w_channel )
144 m_current-> setText ( 1, str ); 150 m_current-> setText ( 1, str );
diff --git a/core/settings/citytime/citytime.cpp b/core/settings/citytime/citytime.cpp
index 721285d..d73bda1 100644
--- a/core/settings/citytime/citytime.cpp
+++ b/core/settings/citytime/citytime.cpp
@@ -2,72 +2,76 @@
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// changes by Maximilian Reiss <harlekin@handhelds.org> 21// changes by Maximilian Reiss <harlekin@handhelds.org>
22 22
23#include "zonemap.h" 23#include "zonemap.h"
24#include "citytime.h" 24#include "citytime.h"
25 25
26/* OPIE */
26#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
27#include <qpe/config.h> 28#include <qpe/config.h>
28#include <qpe/tzselect.h> 29#include <qpe/tzselect.h>
29#if !defined(QT_NO_COP) 30#if !defined(QT_NO_COP)
30#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
31#endif 32#endif
33#include <opie2/odebug.h>
32 34
35/* QT */
33#include <qlabel.h> 36#include <qlabel.h>
34#include <qmessagebox.h> 37#include <qmessagebox.h>
35#include <qtoolbutton.h> 38#include <qtoolbutton.h>
36#include <qlayout.h> 39#include <qlayout.h>
37 40
41/* STD */
38#include <stdlib.h> 42#include <stdlib.h>
39 43
40CityTime::CityTime( QWidget *parent, const char* name, 44CityTime::CityTime( QWidget *parent, const char* name,
41 WFlags fl ) 45 WFlags fl )
42 : CityTimeBase( parent, name, fl ), 46 : CityTimeBase( parent, name, fl ),
43 strRealTz(0), 47 strRealTz(0),
44 bAdded(false) 48 bAdded(false)
45{ 49{
46 Config config( "qpe" ); 50 Config config( "qpe" );
47 config.setGroup( "Time" ); 51 config.setGroup( "Time" );
48 bWhichClock = config.readBoolEntry( "AMPM", TRUE ); 52 bWhichClock = config.readBoolEntry( "AMPM", TRUE );
49 qDebug( QString("%1").arg(bWhichClock) ); 53 odebug << QString("%1").arg(bWhichClock) << oendl;
50 frmMap->changeClock( bWhichClock ); 54 frmMap->changeClock( bWhichClock );
51 55
52 char *pEnv; 56 char *pEnv;
53 pEnv = NULL; 57 pEnv = NULL;
54 pEnv = getenv("TZ"); 58 pEnv = getenv("TZ");
55 if ( pEnv ) 59 if ( pEnv )
56 strRealTz = pEnv; 60 strRealTz = pEnv;
57 pEnv = NULL; 61 pEnv = NULL;
58 pEnv = getenv("HOME"); 62 pEnv = getenv("HOME");
59 if ( pEnv ) 63 if ( pEnv )
60 strHome = pEnv; 64 strHome = pEnv;
61 // append the labels to their respective lists... 65 // append the labels to their respective lists...
62 listCities.setAutoDelete( true ); 66 listCities.setAutoDelete( true );
63 listTimes.setAutoDelete( true ); 67 listTimes.setAutoDelete( true );
64 68
65 listCities.append( cmdCity1 ); 69 listCities.append( cmdCity1 );
66 listCities.append( cmdCity2 ); 70 listCities.append( cmdCity2 );
67 listCities.append( cmdCity3 ); 71 listCities.append( cmdCity3 );
68 72
69 listTimes.append( lblCTime1 ); 73 listTimes.append( lblCTime1 );
70 listTimes.append( lblCTime2 ); 74 listTimes.append( lblCTime2 );
71 listTimes.append( lblCTime3 ); 75 listTimes.append( lblCTime3 );
72 76
73 77
diff --git a/core/settings/citytime/citytimebase.cpp b/core/settings/citytime/citytimebase.cpp
index 323929b..77cb91d 100644
--- a/core/settings/citytime/citytimebase.cpp
+++ b/core/settings/citytime/citytimebase.cpp
@@ -1,33 +1,37 @@
1 1
2 2
3// changes by Maximilian Reiss <harlekin@handhelds.org> 3// changes by Maximilian Reiss <harlekin@handhelds.org>
4 4
5#include "citytimebase.h" 5#include "citytimebase.h"
6#include "zonemap.h"
7
8/* OPIE */
9#include <opie2/odebug.h>
6 10
11/* QT */
7#include <qlabel.h> 12#include <qlabel.h>
8#include <qtoolbutton.h> 13#include <qtoolbutton.h>
9#include "zonemap.h"
10#include <qlayout.h> 14#include <qlayout.h>
11#include <qwhatsthis.h> 15#include <qwhatsthis.h>
12 16
13 17
14/* 18/*
15 * Constructs a CityTimeBase which is a child of 'parent', with the 19 * Constructs a CityTimeBase which is a child of 'parent', with the
16 * name 'name' and widget flags set to 'f' 20 * name 'name' and widget flags set to 'f'
17 */ 21 */
18CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags ) 22CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags )
19 : QWidget( parent, name, WStyle_ContextHelp ) 23 : QWidget( parent, name, WStyle_ContextHelp )
20{ 24{
21 if ( !name ) 25 if ( !name )
22 setName( "CityTimeBase" ); 26 setName( "CityTimeBase" );
23 setCaption( tr( "City Time" ) ); 27 setCaption( tr( "City Time" ) );
24 CityTimeBaseLayout = new QVBoxLayout( this ); 28 CityTimeBaseLayout = new QVBoxLayout( this );
25 CityTimeBaseLayout->setSpacing( 3 ); 29 CityTimeBaseLayout->setSpacing( 3 );
26 CityTimeBaseLayout->setMargin( 0 ); 30 CityTimeBaseLayout->setMargin( 0 );
27 31
28 frmMap = new ZoneMap( this, "frmMap" ); 32 frmMap = new ZoneMap( this, "frmMap" );
29 frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) ); 33 frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) );
30 CityTimeBaseLayout->addWidget( frmMap ); 34 CityTimeBaseLayout->addWidget( frmMap );
31 35
32 buttonWidget = new QWidget( this ); 36 buttonWidget = new QWidget( this );
33 QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) ); 37 QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) );
@@ -380,32 +384,32 @@ bool CityTimeBase::event( QEvent* ev )
380 QFont cmdCity1_font( cmdCity1->font() ); 384 QFont cmdCity1_font( cmdCity1->font() );
381 cmdCity1_font.setBold( TRUE ); 385 cmdCity1_font.setBold( TRUE );
382 cmdCity1->setFont( cmdCity1_font ); 386 cmdCity1->setFont( cmdCity1_font );
383 QFont lblCTime7_font( lblCTime7->font() ); 387 QFont lblCTime7_font( lblCTime7->font() );
384 lblCTime7_font.setPointSize( 10 ); 388 lblCTime7_font.setPointSize( 10 );
385 lblCTime7->setFont( lblCTime7_font ); 389 lblCTime7->setFont( lblCTime7_font );
386 QFont lblCTime4_font( lblCTime4->font() ); 390 QFont lblCTime4_font( lblCTime4->font() );
387 lblCTime4_font.setPointSize( 10 ); 391 lblCTime4_font.setPointSize( 10 );
388 lblCTime4->setFont( lblCTime4_font ); 392 lblCTime4->setFont( lblCTime4_font );
389 QFont cmdCity5_font( cmdCity5->font() ); 393 QFont cmdCity5_font( cmdCity5->font() );
390 cmdCity5_font.setBold( TRUE ); 394 cmdCity5_font.setBold( TRUE );
391 cmdCity5->setFont( cmdCity5_font ); 395 cmdCity5->setFont( cmdCity5_font );
392 QFont lblCTime3_font( lblCTime3->font() ); 396 QFont lblCTime3_font( lblCTime3->font() );
393 lblCTime3_font.setPointSize( 10 ); 397 lblCTime3_font.setPointSize( 10 );
394 lblCTime3->setFont( lblCTime3_font ); 398 lblCTime3->setFont( lblCTime3_font );
395 QFont cmdCity9_font( cmdCity9->font() ); 399 QFont cmdCity9_font( cmdCity9->font() );
396 cmdCity9_font.setBold( TRUE ); 400 cmdCity9_font.setBold( TRUE );
397 cmdCity9->setFont( cmdCity9_font ); 401 cmdCity9->setFont( cmdCity9_font );
398 } 402 }
399 return ret; 403 return ret;
400} 404}
401 405
402void CityTimeBase::beginNewTz() 406void CityTimeBase::beginNewTz()
403{ 407{
404 qWarning( "CityTimeBase::beginNewTz(): Not implemented yet!" ); 408 owarn << "CityTimeBase::beginNewTz(): Not implemented yet!" << oendl;
405} 409}
406 410
407void CityTimeBase::slotNewTz(const QString &, const QString &) 411void CityTimeBase::slotNewTz(const QString &, const QString &)
408{ 412{
409 qWarning( "CityTimeBase::slotNewTz(const QString &, const QString &): Not implemented yet!" ); 413 owarn << "CityTimeBase::slotNewTz(const QString &, const QString &): Not implemented yet!" << oendl;
410} 414}
411 415
diff --git a/core/settings/citytime/zonemap.cpp b/core/settings/citytime/zonemap.cpp
index b6843d2..e4a25ef 100644
--- a/core/settings/citytime/zonemap.cpp
+++ b/core/settings/citytime/zonemap.cpp
@@ -2,62 +2,66 @@
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// changes by Maximilian Reiss <harlekin@handhelds.org> 21// changes by Maximilian Reiss <harlekin@handhelds.org>
22 22
23#include "sun.h" 23#include "sun.h"
24#include "zonemap.h" 24#include "zonemap.h"
25 25
26/* OPIE */
26#include <qpe/resource.h> 27#include <qpe/resource.h>
27#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
29#include <opie2/odebug.h>
28 30
31/* QT */
29#include <qfile.h> 32#include <qfile.h>
30#include <qlabel.h> 33#include <qlabel.h>
31#include <qmessagebox.h> 34#include <qmessagebox.h>
32#include <qtextstream.h> 35#include <qtextstream.h>
33#include <qtimer.h> 36#include <qtimer.h>
34#include <qtoolbutton.h> 37#include <qtoolbutton.h>
35#include <qlayout.h> 38#include <qlayout.h>
36#include <qhbox.h> 39#include <qhbox.h>
37#include <qlistview.h> 40#include <qlistview.h>
38#include <qwhatsthis.h> 41#include <qwhatsthis.h>
39 42
43/* STD */
40#include <limits.h> 44#include <limits.h>
41 45
42// the map file... 46// the map file...
43static const char strZONEINFO[] = "/usr/share/zoneinfo/zone.tab"; 47static const char strZONEINFO[] = "/usr/share/zoneinfo/zone.tab";
44static const char strMAP[] = "citytime/simple_grid_400"; 48static const char strMAP[] = "citytime/simple_grid_400";
45 49
46// the maximum distance we'll allow the pointer to be away from a city 50// the maximum distance we'll allow the pointer to be away from a city
47// and still show the city's time 51// and still show the city's time
48static const int iTHRESHOLD = 50000; 52static const int iTHRESHOLD = 50000;
49 53
50// The label offset (how far away from pointer) 54// The label offset (how far away from pointer)
51static const int iLABELOFFSET = 8; 55static const int iLABELOFFSET = 8;
52 56
53// the size of the dot to draw, and where to start it 57// the size of the dot to draw, and where to start it
54static const int iCITYSIZE = 3; 58static const int iCITYSIZE = 3;
55const int iCITYOFFSET = 2; 59const int iCITYOFFSET = 2;
56 60
57// the darkening function 61// the darkening function
58static inline void darken( QImage *pImage, int start, int stop, int row ); 62static inline void darken( QImage *pImage, int start, int stop, int row );
59static void dayNight( QImage *pImage ); 63static void dayNight( QImage *pImage );
60 64
61ZoneField::ZoneField( const QString& strLine ) 65ZoneField::ZoneField( const QString& strLine )
62{ 66{
63 // make a bunch of RegExp's to match the data from the line 67 // make a bunch of RegExp's to match the data from the line
@@ -109,52 +113,52 @@ ZoneField::ZoneField( const QString& strLine )
109 _x *= 60; 113 _x *= 60;
110 tmp %= 10000; 114 tmp %= 10000;
111 _x += tmp / 100; 115 _x += tmp / 100;
112 _x *= 60; 116 _x *= 60;
113 tmp %= 100; 117 tmp %= 100;
114 _x += tmp; 118 _x += tmp;
115 } 119 }
116 } 120 }
117 iStart = regCountry.match( strLine, 0, &iLen ); 121 iStart = regCountry.match( strLine, 0, &iLen );
118 // help with the shortcoming in 2.x regexp... 122 // help with the shortcoming in 2.x regexp...
119 iStop = strLine.findRev( '/' ); 123 iStop = strLine.findRev( '/' );
120 if ( iStart >= 0 ) { 124 if ( iStart >= 0 ) {
121 iLen = (iStop - iStart) + 1; 125 iLen = (iStop - iStart) + 1;
122 strCountry = strLine.mid( iStart, iLen ); 126 strCountry = strLine.mid( iStart, iLen );
123 } 127 }
124 // now match the city... 128 // now match the city...
125 iStart = regCity.match( strLine, iStart + iLen, &iLen ); 129 iStart = regCity.match( strLine, iStart + iLen, &iLen );
126 if ( iStart >= 0 ) { 130 if ( iStart >= 0 ) {
127 strCity = strLine.mid( iStart, iLen ); 131 strCity = strLine.mid( iStart, iLen );
128 } 132 }
129} 133}
130 134
131void ZoneField::showStructure( void ) const 135void ZoneField::showStructure( void ) const
132{ 136{
133 qDebug( "Country: %s", strCountry.latin1() ); 137 odebug << "Country: " << strCountry << "" << oendl;
134 qDebug( "City: %s", strCity.latin1() ); 138 odebug << "City: " << strCity << "" << oendl;
135 qDebug( "x: %d", _x ); 139 odebug << "x: " << _x << "" << oendl;
136 qDebug( "y: %d\n", _y ); 140 odebug << "y: " << _y << "\n" << oendl;
137} 141}
138 142
139ZoneMap::ZoneMap( QWidget *parent, const char* name ) 143ZoneMap::ZoneMap( QWidget *parent, const char* name )
140 : QScrollView( parent, name ), 144 : QScrollView( parent, name ),
141 pLast( 0 ), 145 pLast( 0 ),
142 pRepaint( 0 ), 146 pRepaint( 0 ),
143 ox( 0 ), 147 ox( 0 ),
144 oy( 0 ), 148 oy( 0 ),
145 drawableW( -1 ), 149 drawableW( -1 ),
146 drawableH( -1 ), 150 drawableH( -1 ),
147 bZoom( FALSE ), 151 bZoom( FALSE ),
148 bIllum( TRUE ), 152 bIllum( TRUE ),
149 cursor( 0 ) 153 cursor( 0 )
150{ 154{
151 viewport()->setFocusPolicy( StrongFocus ); 155 viewport()->setFocusPolicy( StrongFocus );
152 156
153 // set mouse tracking so we can use the mouse move event 157 // set mouse tracking so we can use the mouse move event
154 zones.setAutoDelete( true ); 158 zones.setAutoDelete( true );
155 // get the map loaded 159 // get the map loaded
156 // just set the current image to point 160 // just set the current image to point
157 pixCurr = new QPixmap(); 161 pixCurr = new QPixmap();
158 162
159 QPixmap pixZoom = Resource::loadPixmap( "mag" ); 163 QPixmap pixZoom = Resource::loadPixmap( "mag" );
160 164
diff --git a/core/settings/launcher/doctabsettings.cpp b/core/settings/launcher/doctabsettings.cpp
index 179a7f9..dfdc9be 100644
--- a/core/settings/launcher/doctabsettings.cpp
+++ b/core/settings/launcher/doctabsettings.cpp
@@ -7,62 +7,66 @@
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "doctabsettings.h" 29#include "doctabsettings.h"
30 30
31/* OPIE */
31#include <qpe/config.h> 32#include <qpe/config.h>
33#include <opie2/odebug.h>
32 34
35/* QT */
33#include <qcheckbox.h> 36#include <qcheckbox.h>
34#include <qlayout.h> 37#include <qlayout.h>
35#include <qlabel.h> 38#include <qlabel.h>
36#include <qwhatsthis.h> 39#include <qwhatsthis.h>
37 40
41
38DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) 42DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name )
39{ 43{
40 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); 44 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
41 45
42 _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); 46 _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this );
43 47
44 Config cfg( "Launcher" ); 48 Config cfg( "Launcher" );
45 cfg.setGroup( "DocTab" ); 49 cfg.setGroup( "DocTab" );
46 _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); 50 _enable->setChecked( cfg.readBoolEntry( "Enable", true ) );
47 51
48 lay->addWidget( _enable ); 52 lay->addWidget( _enable );
49 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); 53 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) );
50 54
51 lay->addStretch(); 55 lay->addStretch();
52 56
53 QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); 57 QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) );
54} 58}
55 59
56void DocTabSettings::appletChanged() 60void DocTabSettings::appletChanged()
57{ 61{
58} 62}
59 63
60void DocTabSettings::accept() 64void DocTabSettings::accept()
61{ 65{
62 qDebug( "DocTabSettings::accept()" ); 66 odebug << "DocTabSettings::accept()" << oendl;
63 Config cfg( "Launcher" ); 67 Config cfg( "Launcher" );
64 cfg.setGroup( "DocTab" ); 68 cfg.setGroup( "DocTab" );
65 cfg.writeEntry( "Enable", _enable->isChecked() ); 69 cfg.writeEntry( "Enable", _enable->isChecked() );
66 cfg.write(); 70 cfg.write();
67} 71}
68 72
diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp
index e342c09..0422075 100644
--- a/core/settings/launcher/inputmethodsettings.cpp
+++ b/core/settings/launcher/inputmethodsettings.cpp
@@ -7,78 +7,82 @@
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "inputmethodsettings.h" 29#include "inputmethodsettings.h"
30 30
31/* OPIE */
31#include <qpe/config.h> 32#include <qpe/config.h>
33#include <opie2/odebug.h>
32 34
35/* QT */
33#include <qspinbox.h> 36#include <qspinbox.h>
34#include <qcheckbox.h> 37#include <qcheckbox.h>
35#include <qlayout.h> 38#include <qlayout.h>
36#include <qlabel.h> 39#include <qlabel.h>
37#include <qwhatsthis.h> 40#include <qwhatsthis.h>
38 41
42
39InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) 43InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name )
40{ 44{
41 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); 45 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
42 46
43 _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); 47 _resize = new QCheckBox( tr( "Resize application on Popup" ), this );
44 _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); 48 _float = new QCheckBox( tr( "Enable floating and resizing" ), this );
45 49
46 QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); 50 QHBoxLayout* hbox = new QHBoxLayout( lay, 4 );
47 hbox->addWidget( new QLabel( "Initial Width:", this ) ); 51 hbox->addWidget( new QLabel( "Initial Width:", this ) );
48 _size = new QSpinBox( 10, 100, 10, this ); 52 _size = new QSpinBox( 10, 100, 10, this );
49 _size->setSuffix( "%" ); 53 _size->setSuffix( "%" );
50 hbox->addWidget( _size ); 54 hbox->addWidget( _size );
51 hbox->addStretch(); 55 hbox->addStretch();
52 56
53 Config cfg( "Launcher" ); 57 Config cfg( "Launcher" );
54 cfg.setGroup( "InputMethods" ); 58 cfg.setGroup( "InputMethods" );
55 _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); 59 _resize->setChecked( cfg.readBoolEntry( "Resize", true ) );
56 _float->setChecked( cfg.readBoolEntry( "Float", false ) ); 60 _float->setChecked( cfg.readBoolEntry( "Float", false ) );
57 _size->setValue( cfg.readNumEntry( "Width", 100 ) ); 61 _size->setValue( cfg.readNumEntry( "Width", 100 ) );
58 62
59 lay->addWidget( _resize ); 63 lay->addWidget( _resize );
60 lay->addWidget( _float ); 64 lay->addWidget( _float );
61 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); 65 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) );
62 66
63 lay->addStretch(); 67 lay->addStretch();
64 68
65 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); 69 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) );
66 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); 70 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) );
67 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); 71 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
68} 72}
69 73
70void InputMethodSettings::appletChanged() 74void InputMethodSettings::appletChanged()
71{ 75{
72} 76}
73 77
74void InputMethodSettings::accept() 78void InputMethodSettings::accept()
75{ 79{
76 qDebug( "InputMethodSettings::accept()" ); 80 odebug << "InputMethodSettings::accept()" << oendl;
77 Config cfg( "Launcher" ); 81 Config cfg( "Launcher" );
78 cfg.setGroup( "InputMethods" ); 82 cfg.setGroup( "InputMethods" );
79 cfg.writeEntry( "Resize", _resize->isChecked() ); 83 cfg.writeEntry( "Resize", _resize->isChecked() );
80 cfg.writeEntry( "Float", _float->isChecked() ); 84 cfg.writeEntry( "Float", _float->isChecked() );
81 cfg.writeEntry( "Width", _size->value() ); 85 cfg.writeEntry( "Width", _size->value() );
82 cfg.write(); 86 cfg.write();
83} 87}
84 88
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index 763b360..546e229 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -4,68 +4,70 @@
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "tabdialog.h"
29
30/* OPIE */
28#include <qpe/resource.h> 31#include <qpe/resource.h>
32#include <opie2/ofontselector.h>
33#include <opie2/otabwidget.h>
34#include <opie2/ocolorbutton.h>
35#include <opie2/ofiledialog.h>
36#include <opie2/odebug.h>
29 37
38/* QT */
30#include <qlayout.h> 39#include <qlayout.h>
31#include <qvbox.h> 40#include <qvbox.h>
32#include <qtabbar.h> 41#include <qtabbar.h>
33#include <qiconview.h> 42#include <qiconview.h>
34#include <qapplication.h> 43#include <qapplication.h>
35#include <qlabel.h> 44#include <qlabel.h>
36#include <qradiobutton.h> 45#include <qradiobutton.h>
37#include <qbuttongroup.h> 46#include <qbuttongroup.h>
38#include <qwhatsthis.h> 47#include <qwhatsthis.h>
39#include <qcheckbox.h> 48#include <qcheckbox.h>
40 49
41#include <opie2/ofontselector.h>
42#include <opie2/otabwidget.h>
43#include <opie2/ocolorbutton.h>
44#include <opie2/ofiledialog.h>
45
46#include "tabdialog.h"
47
48 50
49using namespace Opie::Ui; 51using namespace Opie::Ui;
50class SampleItem : public QIconViewItem { 52class SampleItem : public QIconViewItem {
51public: 53public:
52 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) 54 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text )
53 { 55 {
54 m_large = pix; 56 m_large = pix;
55 m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); 57 m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 ));
56 } 58 }
57 59
58 void sizeChange ( ) 60 void sizeChange ( )
59 { 61 {
60 calcRect ( ); 62 calcRect ( );
61 repaint ( ); 63 repaint ( );
62 } 64 }
63 65
64 QPixmap *pixmap ( ) const 66 QPixmap *pixmap ( ) const
65 { 67 {
66 if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) 68 if ( iconView ( )-> itemTextPos ( ) == QIconView::Right )
67 return (QPixmap *) &m_small; 69 return (QPixmap *) &m_small;
68 else 70 else
69 return (QPixmap *) &m_large; 71 return (QPixmap *) &m_large;
70 } 72 }
71 73
@@ -127,49 +129,49 @@ public:
127 QPixmap bg ( width ( ), 9 ); 129 QPixmap bg ( width ( ), 9 );
128 QPainter painter ( &bg ); 130 QPainter painter ( &bg );
129 for ( int i = 0; i < 3; i++ ) { 131 for ( int i = 0; i < 3; i++ ) {
130 painter. setPen ( white ); 132 painter. setPen ( white );
131 painter. drawLine ( 0, i*3, width()-1, i*3 ); 133 painter. drawLine ( 0, i*3, width()-1, i*3 );
132 painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); 134 painter. drawLine ( 0, i*3+1, width()-1, i*3+1 );
133 painter. setPen ( colorGroup().background().light(105) ); 135 painter. setPen ( colorGroup().background().light(105) );
134 painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); 136 painter. drawLine ( 0, i*3+2, width()-1, i*3+2 );
135 } 137 }
136 painter.end ( ); 138 painter.end ( );
137 setBackgroundPixmap ( bg ); 139 setBackgroundPixmap ( bg );
138 break; 140 break;
139 } 141 }
140 142
141 case TabConfig::SolidColor: { 143 case TabConfig::SolidColor: {
142 setBackgroundPixmap ( QPixmap ( )); 144 setBackgroundPixmap ( QPixmap ( ));
143 if ( val. isEmpty ( )) 145 if ( val. isEmpty ( ))
144 setBackgroundColor ( colorGroup ( ). base ( )); 146 setBackgroundColor ( colorGroup ( ). base ( ));
145 else 147 else
146 setBackgroundColor ( val ); 148 setBackgroundColor ( val );
147 break; 149 break;
148 } 150 }
149 151
150 case TabConfig::Image: { 152 case TabConfig::Image: {
151 qDebug( "Loading image: %s", val.latin1() ); 153 odebug << "Loading image: " << val << "" << oendl;
152 QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); 154 QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val ));
153 if ( bg. isNull ( )) { 155 if ( bg. isNull ( )) {
154 QImageIO imgio; 156 QImageIO imgio;
155 imgio. setFileName ( val ); 157 imgio. setFileName ( val );
156 QSize ds = qApp-> desktop ( )-> size ( ); 158 QSize ds = qApp-> desktop ( )-> size ( );
157 QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr 159 QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr
158 imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); 160 imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( ));
159 imgio. read ( ); 161 imgio. read ( );
160 bg = imgio. image ( ); 162 bg = imgio. image ( );
161 } 163 }
162 setBackgroundPixmap ( bg ); 164 setBackgroundPixmap ( bg );
163 break; 165 break;
164 } 166 }
165 } 167 }
166 m_bgtype = t; 168 m_bgtype = t;
167 viewport ( )-> update ( ); 169 viewport ( )-> update ( );
168 } 170 }
169 171
170 void setTextColor ( const QColor &tc ) 172 void setTextColor ( const QColor &tc )
171 { 173 {
172 m_textcolor = tc; 174 m_textcolor = tc;
173 QColorGroup cg = colorGroup ( ); 175 QColorGroup cg = colorGroup ( );
174 cg. setColor ( QColorGroup::Text, tc ); 176 cg. setColor ( QColorGroup::Text, tc );
175 setPalette ( QPalette ( cg, cg, cg )); 177 setPalette ( QPalette ( cg, cg, cg ));
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index 43886c9..8dd9e97 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -7,150 +7,154 @@
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "taskbarsettings.h" 29#include "taskbarsettings.h"
30 30
31/* OPIE */
31#include <qpe/config.h> 32#include <qpe/config.h>
32#include <qpe/qlibrary.h> 33#include <qpe/qlibrary.h>
33#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
34#include <qpe/taskbarappletinterface.h> 35#include <qpe/taskbarappletinterface.h>
35#include <qpe/qcopenvelope_qws.h> 36#include <qpe/qcopenvelope_qws.h>
37#include <opie2/odebug.h>
36 38
39/* QT */
37#include <qdir.h> 40#include <qdir.h>
38#include <qlistview.h> 41#include <qlistview.h>
39#include <qheader.h> 42#include <qheader.h>
40#include <qlayout.h> 43#include <qlayout.h>
41#include <qlabel.h> 44#include <qlabel.h>
42#include <qwhatsthis.h> 45#include <qwhatsthis.h>
43 46
47/* STD */
44#include <stdlib.h> 48#include <stdlib.h>
45 49
46 50
47TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) 51TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
48 : QWidget ( parent, name ) 52 : QWidget ( parent, name )
49{ 53{
50 m_applets_changed = false; 54 m_applets_changed = false;
51 55
52 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 56 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
53 57
54 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); 58 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
55 lay-> addWidget ( l ); 59 lay-> addWidget ( l );
56 60
57 m_list = new QListView ( this ); 61 m_list = new QListView ( this );
58 m_list-> addColumn ( "foobar" ); 62 m_list-> addColumn ( "foobar" );
59 m_list-> header ( )-> hide ( ); 63 m_list-> header ( )-> hide ( );
60 64
61 lay-> addWidget ( m_list ); 65 lay-> addWidget ( m_list );
62 66
63 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); 67 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." ));
64 68
65 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); 69 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
66 70
67 init ( ); 71 init ( );
68} 72}
69 73
70void TaskbarSettings::init ( ) 74void TaskbarSettings::init ( )
71{ 75{
72 Config cfg ( "Taskbar" ); 76 Config cfg ( "Taskbar" );
73 cfg. setGroup ( "Applets" ); 77 cfg. setGroup ( "Applets" );
74 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 78 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
75 79
76 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 80 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
77#ifdef Q_OS_MACX 81#ifdef Q_OS_MACX
78 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 82 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
79#else 83#else
80 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 84 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
81#endif /* Q_OS_MACX */ 85#endif /* Q_OS_MACX */
82 86
83 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 87 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
84 QString name; 88 QString name;
85 QPixmap icon; 89 QPixmap icon;
86 TaskbarNamedAppletInterface *iface = 0; 90 TaskbarNamedAppletInterface *iface = 0;
87 91
88 qWarning("Load applet: %s", (*it).latin1() ); 92 owarn << "Load applet: " << (*it) << "" << oendl;
89 QLibrary *lib = new QLibrary ( path + "/" + *it ); 93 QLibrary *lib = new QLibrary ( path + "/" + *it );
90 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); 94 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
91 qWarning("<1>"); 95 owarn << "<1>" << oendl;
92 if ( iface ) { 96 if ( iface ) {
93 qWarning("<2>"); 97 owarn << "<2>" << oendl;
94 QString lang = getenv( "LANG" ); 98 QString lang = getenv( "LANG" );
95 QTranslator *trans = new QTranslator ( qApp ); 99 QTranslator *trans = new QTranslator ( qApp );
96 QString type = (*it). left ((*it). find (".")); 100 QString type = (*it). left ((*it). find ("."));
97 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 101 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
98 if ( trans-> load ( tfn )) 102 if ( trans-> load ( tfn ))
99 qApp-> installTranslator ( trans ); 103 qApp-> installTranslator ( trans );
100 else 104 else
101 delete trans; 105 delete trans;
102 name = iface-> name ( ); 106 name = iface-> name ( );
103 icon = iface-> icon ( ); 107 icon = iface-> icon ( );
104 iface-> release ( ); 108 iface-> release ( );
105 } 109 }
106 qWarning("<3>"); 110 owarn << "<3>" << oendl;
107 if ( !iface ) { 111 if ( !iface ) {
108 qWarning("<4>"); 112 owarn << "<4>" << oendl;
109 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); 113 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
110 114
111 if ( iface ) { 115 if ( iface ) {
112 qWarning("<5>"); 116 owarn << "<5>" << oendl;
113 name = (*it). mid ( 3 ); 117 name = (*it). mid ( 3 );
114 qWarning("Found applet: %s", name.latin1() ); 118 owarn << "Found applet: " << name << "" << oendl;
115#ifdef Q_OS_MACX 119#ifdef Q_OS_MACX
116 int sep = name. find( ".dylib" ); 120 int sep = name. find( ".dylib" );
117#else 121#else
118 int sep = name. find( ".so" ); 122 int sep = name. find( ".so" );
119#endif /* Q_OS_MACX */ 123#endif /* Q_OS_MACX */
120 if ( sep > 0 ) 124 if ( sep > 0 )
121 name. truncate ( sep ); 125 name. truncate ( sep );
122 sep = name. find ( "applet" ); 126 sep = name. find ( "applet" );
123 if ( sep == (int) name.length ( ) - 6 ) 127 if ( sep == (int) name.length ( ) - 6 )
124 name. truncate ( sep ); 128 name. truncate ( sep );
125 name[0] = name[0]. upper ( ); 129 name[0] = name[0]. upper ( );
126 iface-> release ( ); 130 iface-> release ( );
127 } 131 }
128 } 132 }
129 qWarning("<6>"); 133 owarn << "<6>" << oendl;
130 134
131 if ( iface ) { 135 if ( iface ) {
132 qWarning("<7>"); 136 owarn << "<7>" << oendl;
133 QCheckListItem *item; 137 QCheckListItem *item;
134 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 138 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
135 if ( !icon. isNull ( )) 139 if ( !icon. isNull ( ))
136 item-> setPixmap ( 0, icon ); 140 item-> setPixmap ( 0, icon );
137 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 141 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
138 m_applets [*it] = item; 142 m_applets [*it] = item;
139 } 143 }
140 lib-> unload ( ); 144 lib-> unload ( );
141 delete lib; 145 delete lib;
142 } 146 }
143} 147}
144 148
145void TaskbarSettings::appletChanged() 149void TaskbarSettings::appletChanged()
146{ 150{
147 m_applets_changed = true; 151 m_applets_changed = true;
148} 152}
149 153
150void TaskbarSettings::accept ( ) 154void TaskbarSettings::accept ( )
151{ 155{
152 Config cfg ( "Taskbar" ); 156 Config cfg ( "Taskbar" );
153 cfg. setGroup ( "Applets" ); 157 cfg. setGroup ( "Applets" );
154 158
155 if ( m_applets_changed ) { 159 if ( m_applets_changed ) {
156 QStringList exclude; 160 QStringList exclude;
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index d64a063..424a64c 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -8,56 +8,59 @@
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "light.h" 29#include "light.h"
30#include "sensor.h" 30#include "sensor.h"
31 31
32/* OPIE */
32#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34#include <opie2/odebug.h>
33 35
34#include <qpe/config.h> 36#include <qpe/config.h>
35#include <qpe/power.h> 37#include <qpe/power.h>
36#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 38#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
37#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
38#endif 40#endif
39 41
42/* QT */
40#include <qlabel.h> 43#include <qlabel.h>
41#include <qcheckbox.h> 44#include <qcheckbox.h>
42#include <qtabwidget.h> 45#include <qtabwidget.h>
43#include <qslider.h> 46#include <qslider.h>
44#include <qspinbox.h> 47#include <qspinbox.h>
45#include <qpushbutton.h> 48#include <qpushbutton.h>
46#include <qgroupbox.h> 49#include <qgroupbox.h>
47#include <qcombobox.h> 50#include <qcombobox.h>
48 51
49 52
50 53
51using namespace Opie::Core; 54using namespace Opie::Core;
52 55
53LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) 56LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
54 : LightSettingsBase( parent, name, false, WStyle_ContextHelp ) 57 : LightSettingsBase( parent, name, false, WStyle_ContextHelp )
55{ 58{
56 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( ); 59 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( );
57 m_cres = ODevice::inst ( )-> displayContrastResolution ( ); 60 m_cres = ODevice::inst ( )-> displayContrastResolution ( );
58 61
59 // check whether to show the light sensor stuff 62 // check whether to show the light sensor stuff
60 63
61 if ( !ODevice::inst ( )-> hasLightSensor ( )) { 64 if ( !ODevice::inst ( )-> hasLightSensor ( )) {
62 auto_brightness-> hide ( ); 65 auto_brightness-> hide ( );
63 CalibrateLightSensor-> hide ( ); 66 CalibrateLightSensor-> hide ( );
@@ -212,61 +215,61 @@ void LightSettings::calibrateSensorAC ( )
212 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); 215 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int)));
213 QPEApplication::execDialog ( s ); 216 QPEApplication::execDialog ( s );
214 delete s; 217 delete s;
215} 218}
216 219
217void LightSettings::setBacklight ( int bright ) 220void LightSettings::setBacklight ( int bright )
218{ 221{
219 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 222 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
220 e << bright; 223 e << bright;
221 224
222 if ( bright != -1 ) { 225 if ( bright != -1 ) {
223 m_resettimer-> stop ( ); 226 m_resettimer-> stop ( );
224 m_resettimer-> start ( 4000, true ); 227 m_resettimer-> start ( 4000, true );
225 } 228 }
226} 229}
227 230
228void LightSettings::setContrast ( int contr ) 231void LightSettings::setContrast ( int contr )
229{ 232{
230 if (contr == -1) contr = m_oldcontrast; 233 if (contr == -1) contr = m_oldcontrast;
231 ODevice::inst ( )-> setDisplayContrast(contr); 234 ODevice::inst ( )-> setDisplayContrast(contr);
232} 235}
233 236
234void LightSettings::setFrequency ( int index ) 237void LightSettings::setFrequency ( int index )
235{ 238{
236 qWarning("LightSettings::setFrequency(%d)", index); 239 owarn << "LightSettings::setFrequency(" << index << ")" << oendl;
237 ODevice::inst ( )-> setCurrentCpuFrequency(index); 240 ODevice::inst ( )-> setCurrentCpuFrequency(index);
238} 241}
239 242
240void LightSettings::resetBacklight ( ) 243void LightSettings::resetBacklight ( )
241{ 244{
242 setBacklight ( -1 ); 245 setBacklight ( -1 );
243 setContrast ( -1 ); 246 setContrast ( -1 );
244} 247}
245 248
246void LightSettings::setCloseHingeAction ( int index ) 249void LightSettings::setCloseHingeAction ( int index )
247{ 250{
248 qWarning("LightSettings::setCloseHingeStatus(%d)", index); 251 owarn << "LightSettings::setCloseHingeStatus(" << index << ")" << oendl;
249} 252}
250 253
251void LightSettings::accept ( ) 254void LightSettings::accept ( )
252{ 255{
253 Config config ( "apm" ); 256 Config config ( "apm" );
254 257
255 // bat 258 // bat
256 config. setGroup ( "Battery" ); 259 config. setGroup ( "Battery" );
257 config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( )); 260 config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( ));
258 config. writeEntry ( "Dim", interval_dim-> value ( )); 261 config. writeEntry ( "Dim", interval_dim-> value ( ));
259 config. writeEntry ( "LightOff", interval_lightoff-> value ( )); 262 config. writeEntry ( "LightOff", interval_lightoff-> value ( ));
260 config. writeEntry ( "Suspend", interval_suspend-> value ( )); 263 config. writeEntry ( "Suspend", interval_suspend-> value ( ));
261 config. writeEntry ( "Brightness", brightness-> value () ); 264 config. writeEntry ( "Brightness", brightness-> value () );
262 if (m_cres) 265 if (m_cres)
263 config. writeEntry ( "Contrast", contrast-> value () ); 266 config. writeEntry ( "Contrast", contrast-> value () );
264 config. writeEntry ( "Freq", frequency->currentItem() ); 267 config. writeEntry ( "Freq", frequency->currentItem() );
265 config. writeEntry ( "CloseHingeAction", closeHingeAction->currentItem() ); 268 config. writeEntry ( "CloseHingeAction", closeHingeAction->currentItem() );
266 269
267 // ac 270 // ac
268 config. setGroup ( "AC" ); 271 config. setGroup ( "AC" );
269 config. writeEntry ( "LcdOffOnly", LcdOffOnly_ac-> isChecked ( )); 272 config. writeEntry ( "LcdOffOnly", LcdOffOnly_ac-> isChecked ( ));
270 config. writeEntry ( "Dim", interval_dim_ac-> value ( )); 273 config. writeEntry ( "Dim", interval_dim_ac-> value ( ));
271 config. writeEntry ( "LightOff", interval_lightoff_ac-> value ( )); 274 config. writeEntry ( "LightOff", interval_lightoff_ac-> value ( ));
272 config. writeEntry ( "Suspend", interval_suspend_ac-> value ( )); 275 config. writeEntry ( "Suspend", interval_suspend_ac-> value ( ));
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index 4eddb55..b917aea 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -1,58 +1,64 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of Qtopia Environment.
5 ** 5 **
6 ** This file may be distributed and/or modified under the terms of the 6 ** This file may be distributed and/or modified under the terms of the
7 ** GNU General Public License version 2 as published by the Free Software 7 ** GNU General Public License version 2 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.GPL included in the 8 ** Foundation and appearing in the file LICENSE.GPL included in the
9 ** packaging of this file. 9 ** packaging of this file.
10 ** 10 **
11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 ** 13 **
14 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 14 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
15 ** 15 **
16 ** Contact info@trolltech.com if any conditions of this licensing are 16 ** Contact info@trolltech.com if any conditions of this licensing are
17 ** not clear to you. 17 ** not clear to you.
18 ** 18 **
19 **********************************************************************/ 19 **********************************************************************/
20#include "security.h" 20#include "security.h"
21 21
22/* OPIE */
22#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
23#include <qpe/config.h> 24#include <qpe/config.h>
24#include <qpe/password.h> 25#include <qpe/password.h>
25#include <qpe/qpedialog.h> 26#include <qpe/qpedialog.h>
26#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
28#include <opie2/odebug.h>
27 29
30/* QT */
28#include <qcheckbox.h> 31#include <qcheckbox.h>
29#include <qpushbutton.h> 32#include <qpushbutton.h>
30#include <qcombobox.h> 33#include <qcombobox.h>
31#include <qmessagebox.h> 34#include <qmessagebox.h>
32#include <qfile.h> 35#include <qfile.h>
33#include <qtextstream.h> 36#include <qtextstream.h>
34 37
38
39using namespace Opie::Core;
40
35 Security::Security( QWidget* parent, const char* name, WFlags fl ) 41 Security::Security( QWidget* parent, const char* name, WFlags fl )
36: SecurityBase( parent, name, TRUE, WStyle_ContextHelp ) 42: SecurityBase( parent, name, TRUE, WStyle_ContextHelp )
37{ 43{
38 valid=FALSE; 44 valid=FALSE;
39 Config cfg("Security"); 45 Config cfg("Security");
40 cfg.setGroup("Passcode"); 46 cfg.setGroup("Passcode");
41 passcode = cfg.readEntry("passcode"); 47 passcode = cfg.readEntry("passcode");
42 passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); 48 passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE));
43 cfg.setGroup("Sync"); 49 cfg.setGroup("Sync");
44 int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 50 int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
45 int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); 51 int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24);
46 selectNet(auth_peer,auth_peer_bits,TRUE); 52 selectNet(auth_peer,auth_peer_bits,TRUE);
47 53
48 connect(syncnet, SIGNAL(textChanged(const QString&)), 54 connect(syncnet, SIGNAL(textChanged(const QString&)),
49 this, SLOT(setSyncNet(const QString&))); 55 this, SLOT(setSyncNet(const QString&)));
50 56
51 57
52 58
53 /* 59 /*
54 cfg.setGroup("Remote"); 60 cfg.setGroup("Remote");
55 if ( telnetAvailable() ) 61 if ( telnetAvailable() )
56 telnet->setChecked(cfg.readEntry("allow_telnet")); 62 telnet->setChecked(cfg.readEntry("allow_telnet"));
57 else 63 else
58 telnet->hide(); 64 telnet->hide();
@@ -236,49 +242,49 @@ void Security::selectNet(int auth_peer,int auth_peer_bits, bool update)
236 netrange = cfg.readEntry(target,""); 242 netrange = cfg.readEntry(target,"");
237 if (! netrange.isEmpty()){ 243 if (! netrange.isEmpty()){
238 //make sure we have no "twin" entries 244 //make sure we have no "twin" entries
239 for (int i=0; i<syncnet->count(); i++) { 245 for (int i=0; i<syncnet->count(); i++) {
240 if ( syncnet->text(i) == netrange ) { 246 if ( syncnet->text(i) == netrange ) {
241 already_there=TRUE; 247 already_there=TRUE;
242 } 248 }
243 } 249 }
244 if (! already_there) { 250 if (! already_there) {
245 syncnet->insertItem( tr( netrange ) ); 251 syncnet->insertItem( tr( netrange ) );
246 } else { 252 } else {
247 already_there=FALSE; 253 already_there=FALSE;
248 } 254 }
249 } 255 }
250 } 256 }
251 } 257 }
252 } 258 }
253 259
254 for (int i=0; i<syncnet->count(); i++) { 260 for (int i=0; i<syncnet->count(); i++) {
255 if ( syncnet->text(i).left(sn.length()) == sn ) { 261 if ( syncnet->text(i).left(sn.length()) == sn ) {
256 syncnet->setCurrentItem(i); 262 syncnet->setCurrentItem(i);
257 return; 263 return;
258 } 264 }
259 } 265 }
260 qDebug("No match for \"%s\"",sn.latin1()); 266 odebug << "No match for \"" << sn << "\"" << oendl;
261} 267}
262 268
263void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits) 269void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits)
264{ 270{
265 auth_peer=0; 271 auth_peer=0;
266 if ( sn == tr("Any") ) { 272 if ( sn == tr("Any") ) {
267 auth_peer = 0; 273 auth_peer = 0;
268 auth_peer_bits = 0; 274 auth_peer_bits = 0;
269 } else if ( sn == tr("None") ) { 275 } else if ( sn == tr("None") ) {
270 auth_peer = 0; 276 auth_peer = 0;
271 auth_peer_bits = 32; 277 auth_peer_bits = 32;
272 } else { 278 } else {
273 int x=0; 279 int x=0;
274 for (int i=0; i<4; i++) { 280 for (int i=0; i<4; i++) {
275 int nx = sn.find(QChar(i==3 ? '/' : '.'),x); 281 int nx = sn.find(QChar(i==3 ? '/' : '.'),x);
276 auth_peer = (auth_peer<<8)|sn.mid(x,nx-x).toInt(); 282 auth_peer = (auth_peer<<8)|sn.mid(x,nx-x).toInt();
277 x = nx+1; 283 x = nx+1;
278 } 284 }
279 uint n = (uint)sn.find(' ',x)-x; 285 uint n = (uint)sn.find(' ',x)-x;
280 auth_peer_bits = sn.mid(x,n).toInt(); 286 auth_peer_bits = sn.mid(x,n).toInt();
281 } 287 }
282} 288}
283 289
284void Security::loadUsers ( void ) 290void Security::loadUsers ( void )
diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro
index 4a29ee2..4c1e68b 100644
--- a/core/settings/security/security.pro
+++ b/core/settings/security/security.pro
@@ -1,10 +1,10 @@
1 CONFIG += qt warn_on quick-app 1 CONFIG += qt warn_on quick-app
2 HEADERS = security.h 2 HEADERS = security.h
3 SOURCES = security.cpp main.cpp 3 SOURCES = security.cpp main.cpp
4 INTERFACES= securitybase.ui 4 INTERFACES= securitybase.ui
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= ../$(OPIEDIR)/include 6 DEPENDPATH+= ../$(OPIEDIR)/include
7LIBS += -lqpe 7LIBS += -lqpe -lopiecore2
8 TARGET = security 8 TARGET = security
9 9
10include ( $(OPIEDIR)/include.pro ) 10include ( $(OPIEDIR)/include.pro )
diff --git a/core/symlinker/main.cpp b/core/symlinker/main.cpp
index 6a04980..96e7f3c 100644
--- a/core/symlinker/main.cpp
+++ b/core/symlinker/main.cpp
@@ -1,179 +1,185 @@
1
2/* OPIE */
3#include <opie2/odebug.h>
4
5/* QT */
1#include <qapplication.h> 6#include <qapplication.h>
2#include <qfile.h> 7#include <qfile.h>
3#include <qfileinfo.h> 8#include <qfileinfo.h>
4#include <qdir.h> 9#include <qdir.h>
5#include <qtextstream.h> 10#include <qtextstream.h>
6#include <qstringlist.h> 11#include <qstringlist.h>
7 12
13/* STD */
8#include <stdlib.h> 14#include <stdlib.h>
9#include <unistd.h> //symlink() 15#include <unistd.h> //symlink()
10#include <sys/stat.h> // mkdir() 16#include <sys/stat.h> // mkdir()
11 17
12#include <sys/vfs.h> 18#include <sys/vfs.h>
13#include <mntent.h> 19#include <mntent.h>
14#include <errno.h> 20#include <errno.h>
15 21
16static const char *listDir = "/usr/lib/ipkg/externinfo/"; 22static const char *listDir = "/usr/lib/ipkg/externinfo/";
17 23
18static void createSymlinks( const QString &location, const QString &package ) 24static void createSymlinks( const QString &location, const QString &package )
19{ 25{
20 26
21 QFile inFile( location + "/usr/lib/ipkg/info/" + package + ".list" ); 27 QFile inFile( location + "/usr/lib/ipkg/info/" + package + ".list" );
22 mkdir( "/usr/lib/ipkg", 0777 ); 28 mkdir( "/usr/lib/ipkg", 0777 );
23 mkdir( listDir, 0777 ); 29 mkdir( listDir, 0777 );
24 30
25 QFile outFile( listDir + package + ".list"); 31 QFile outFile( listDir + package + ".list");
26 32
27// qDebug( "createSymlinks %s -> %s", inFile.name().ascii(), outFile.name().ascii() ); 33// odebug << "createSymlinks " << inFile.name().ascii() << " -> " << outFile.name().ascii() << "" << oendl;
28 34
29 35
30 36
31 if ( inFile.open(IO_ReadOnly) && outFile.open(IO_WriteOnly)) { 37 if ( inFile.open(IO_ReadOnly) && outFile.open(IO_WriteOnly)) {
32 QTextStream in(&inFile); 38 QTextStream in(&inFile);
33 QTextStream out(&outFile); 39 QTextStream out(&outFile);
34 40
35 QString s; 41 QString s;
36 while ( !in.eof() ) { // until end of file... 42 while ( !in.eof() ) { // until end of file...
37 s = in.readLine(); // line of text excluding '\n' 43 s = in.readLine(); // line of text excluding '\n'
38 // qDebug( "Read: %s", s.ascii() ); 44// odebug << "Read: " << s.ascii() << "" << oendl;
39 if (s.find(location,0,true) >= 0){ 45 if (s.find(location,0,true) >= 0){
40 // qDebug( "Found!" ); 46// odebug << "Found!" << oendl;
41 s = s.replace(location,""); 47 s = s.replace(location,"");
42 } 48 }
43 // qDebug( "Read after: %s", s.ascii() ); 49// odebug << "Read after: " << s.ascii() << "" << oendl;
44 50
45 // for s, do link/mkdir. 51 // for s, do link/mkdir.
46 if ( s.right(1) == "/" ) { 52 if ( s.right(1) == "/" ) {
47 // qDebug("do mkdir for %s", s.ascii()); 53// odebug << "do mkdir for " << s.ascii() << "" << oendl;
48 mkdir( s.ascii(), 0777 ); 54 mkdir( s.ascii(), 0777 );
49 //possible optimization: symlink directories 55 //possible optimization: symlink directories
50 //that don't exist already. -- Risky. 56 //that don't exist already. -- Risky.
51 } else { 57 } else {
52 // qDebug("do symlink for %s", s.ascii()); 58// odebug << "do symlink for " << s.ascii() << "" << oendl;
53 QFileInfo ffi( s ); 59 QFileInfo ffi( s );
54 //Don't try to symlink if a regular file exists already 60 //Don't try to symlink if a regular file exists already
55 if ( !ffi.exists() || ffi.isSymLink() ) { 61 if ( !ffi.exists() || ffi.isSymLink() ) {
56 if (symlink( (location+s).ascii(), s.ascii() ) != 0){ 62 if (symlink( (location+s).ascii(), s.ascii() ) != 0){
57 if (errno == ENOENT){ 63 if (errno == ENOENT){
58 // perror("Symlink Failed! "); 64 // perror("Symlink Failed! ");
59 QString e=s.ascii(); 65 QString e=s.ascii();
60 e = e.replace(ffi.fileName(),""); 66 e = e.replace(ffi.fileName(),"");
61 // qDebug("DirName : %s",e.ascii() ); 67// odebug << "DirName : " << e.ascii() << "" << oendl;
62 system ( QString("mkdir -p ")+e.ascii() ); 68 system ( QString("mkdir -p ")+e.ascii() );
63 if (symlink( (location+s).ascii(), s.ascii() ) != 0) 69 if (symlink( (location+s).ascii(), s.ascii() ) != 0)
64 qDebug ("Big problem creating symlink and directory"); 70 odebug << "Big problem creating symlink and directory" << oendl;
65 } 71 }
66 } 72 }
67 // qDebug ( "Created %s" ,s.ascii() ); 73 // qDebug ( "Created %s" ,s.ascii() );
68 out << s << "\n"; 74 out << s << "\n";
69 } else { 75 } else {
70 qDebug( "%s exists already, not symlinked", s.ascii() ); 76 odebug << "" << s.ascii() << " exists already, not symlinked" << oendl;
71 } 77 }
72 } 78 }
73 } 79 }
74 inFile.close(); 80 inFile.close();
75 outFile.close(); 81 outFile.close();
76 } 82 }
77} 83}
78 84
79 85
80 86
81static void removeSymlinks( const QString &package ) 87static void removeSymlinks( const QString &package )
82{ 88{
83 QFile inFile( listDir + package + ".list" ); 89 QFile inFile( listDir + package + ".list" );
84 90
85 if ( inFile.open(IO_ReadOnly) ) { 91 if ( inFile.open(IO_ReadOnly) ) {
86 QTextStream in(&inFile); 92 QTextStream in(&inFile);
87 93
88 QString s; 94 QString s;
89 while ( !in.eof() ) { // until end of file... 95 while ( !in.eof() ) { // until end of file...
90 s = in.readLine(); // line of text excluding '\n' 96 s = in.readLine(); // line of text excluding '\n'
91 // qDebug("remove symlink %s", s.ascii()); 97// odebug << "remove symlink " << s.ascii() << "" << oendl;
92 QFileInfo ffi( s ); 98 QFileInfo ffi( s );
93 //Confirm that it's still a symlink. 99 //Confirm that it's still a symlink.
94 if ( ffi.isSymLink() ){ 100 if ( ffi.isSymLink() ){
95 unlink( s.ascii() ); 101 unlink( s.ascii() );
96 // qDebug ( "Removed %s", s.ascii() );} 102 // qDebug ( "Removed %s", s.ascii() );}
97 // else 103 // else
98 // qDebug( "Not removed %s", s.ascii() ); 104// odebug << "Not removed " << s.ascii() << "" << oendl;
99 } 105 }
100 } 106 }
101 inFile.close(); 107 inFile.close();
102 inFile.remove(); 108 inFile.remove();
103 } 109 }
104} 110}
105 111
106 112
107 113
108/* 114/*
109 Slightly hacky: we can't use StorageInfo, since we don't have a 115 Slightly hacky: we can't use StorageInfo, since we don't have a
110 QApplication. We look for filesystems that have the directory 116 QApplication. We look for filesystems that have the directory
111 /usr/lib/ipkg/info, and assume that they are removable media 117 /usr/lib/ipkg/info, and assume that they are removable media
112 with packages installed. This is safe even if eg. /usr is on a 118 with packages installed. This is safe even if eg. /usr is on a
113 separate filesystem, since then we would be testing for 119 separate filesystem, since then we would be testing for
114 /usr/usr/lib/ipkg/info, which should not exist. (And if it 120 /usr/usr/lib/ipkg/info, which should not exist. (And if it
115 does they deserve to have it treated as removable.) 121 does they deserve to have it treated as removable.)
116 */ 122 */
117 123
118static void updateSymlinks() 124static void updateSymlinks()
119{ 125{
120 QDir lists( listDir ); 126 QDir lists( listDir );
121 QStringList knownPackages = lists.entryList( "*.list" ); // No tr 127 QStringList knownPackages = lists.entryList( "*.list" ); // No tr
122 128
123 struct mntent *me; 129 struct mntent *me;
124 FILE *mntfp = setmntent( "/etc/mtab", "r" ); 130 FILE *mntfp = setmntent( "/etc/mtab", "r" );
125 131
126 if ( mntfp ) { 132 if ( mntfp ) {
127 while ( (me = getmntent( mntfp )) != 0 ) { 133 while ( (me = getmntent( mntfp )) != 0 ) {
128 QString root = me->mnt_dir; 134 QString root = me->mnt_dir;
129 if ( root == "/" ) 135 if ( root == "/" )
130 continue; 136 continue;
131 137
132 QString info = root + "/usr/lib/ipkg/info"; 138 QString info = root + "/usr/lib/ipkg/info";
133 QDir infoDir( info ); 139 QDir infoDir( info );
134 // qDebug( "looking at %s", info.ascii() ); 140// odebug << "looking at " << info.ascii() << "" << oendl;
135 if ( infoDir.isReadable() ) { 141 if ( infoDir.isReadable() ) {
136 const QFileInfoList *packages = infoDir.entryInfoList( "*.list" ); // No tr 142 const QFileInfoList *packages = infoDir.entryInfoList( "*.list" ); // No tr
137 QFileInfoListIterator it( *packages ); 143 QFileInfoListIterator it( *packages );
138 QFileInfo *fi; 144 QFileInfo *fi;
139 while (( fi = *it )) { 145 while (( fi = *it )) {
140 ++it; 146 ++it;
141 if ( knownPackages.contains( fi->fileName() ) ) { 147 if ( knownPackages.contains( fi->fileName() ) ) {
142 // qDebug( "found %s and we've seen it before", fi->fileName().latin1() ); 148// odebug << "found " << fi->fileName() << " and we've seen it before" << oendl;
143 knownPackages.remove( fi->fileName() ); 149 knownPackages.remove( fi->fileName() );
144 } else { 150 } else {
145 //it's a new one 151 //it's a new one
146 createSymlinks( root, fi->baseName() ); 152 createSymlinks( root, fi->baseName() );
147 } 153 }
148 154
149 } 155 }
150 156
151 } 157 }
152 } 158 }
153 endmntent( mntfp ); 159 endmntent( mntfp );
154 } 160 }
155 161
156 for ( QStringList::Iterator it = knownPackages.begin(); 162 for ( QStringList::Iterator it = knownPackages.begin();
157 it != knownPackages.end(); ++it ) { 163 it != knownPackages.end(); ++it ) {
158 // strip ".info" off the end. 164 // strip ".info" off the end.
159 removeSymlinks( (*it).left((*it).length()-5) ); 165 removeSymlinks( (*it).left((*it).length()-5) );
160 } 166 }
161} 167}
162 168
163 169
164 170
165int main( int argc, char *argv[] ) 171int main( int argc, char *argv[] )
166{ 172{
167 QApplication a( argc, argv, QApplication::Tty ); 173 QApplication a( argc, argv, QApplication::Tty );
168 174
169 QString command = argc > 1 ? argv[1] : "update"; // No tr 175 QString command = argc > 1 ? argv[1] : "update"; // No tr
170 176
171 if ( command == "update" ) // No tr 177 if ( command == "update" ) // No tr
172 updateSymlinks(); 178 updateSymlinks();
173 else if ( command == "create" && argc > 3 ) // No tr 179 else if ( command == "create" && argc > 3 ) // No tr
174 createSymlinks( argv[2], argv[3] ); 180 createSymlinks( argv[2], argv[3] );
175 else if ( command == "remove" && argc > 2 ) // No tr 181 else if ( command == "remove" && argc > 2 ) // No tr
176 removeSymlinks( argv[2] ); 182 removeSymlinks( argv[2] );
177 else 183 else
178 qWarning( "Argument error" ); 184 owarn << "Argument error" << oendl;
179} 185}
diff --git a/core/symlinker/symlinker.pro b/core/symlinker/symlinker.pro
index f850d46..50ad785 100644
--- a/core/symlinker/symlinker.pro
+++ b/core/symlinker/symlinker.pro
@@ -1,15 +1,15 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 4
5 HEADERS = 5 HEADERS =
6 SOURCES = main.cpp 6 SOURCES = main.cpp
7 INTERFACES= 7 INTERFACES=
8 8
9 TARGET = opie-update-symlinks 9 TARGET = opie-update-symlinks
10INCLUDEPATH += $(OPIEDIR)/include 10INCLUDEPATH += $(OPIEDIR)/include
11DEPENDPATH += $(OPIEDIR)/include . 11DEPENDPATH += $(OPIEDIR)/include .
12LIBS += -lqpe 12LIBS += -lqpe -lopiecore2
13 13
14include ( $(OPIEDIR)/include.pro ) 14include ( $(OPIEDIR)/include.pro )
15 15
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp
index d467d6e..c2467fb 100644
--- a/core/tools/quicklauncher/main.cpp
+++ b/core/tools/quicklauncher/main.cpp
@@ -1,64 +1,71 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "dropins.h"
22
23/* OPIE */
24#include <opie2/odebug.h>
25
26/* QT */
21#include <qpainter.h> 27#include <qpainter.h>
22#include <qstrlist.h> 28#include <qstrlist.h>
23#include <qtimer.h> 29#include <qtimer.h>
24#include <qguardedptr.h> 30#include <qguardedptr.h>
25#include <qcopchannel_qws.h> 31#include <qcopchannel_qws.h>
26#define QTOPIA_INTERNAL_INITAPP 32#define QTOPIA_INTERNAL_INITAPP
27 33
28#ifdef private 34#ifdef private
29# undef private 35# undef private
30#endif 36#endif
31#define private public 37#define private public
32#include <qtopia/qpeapplication.h> 38#include <qtopia/qpeapplication.h>
33#undef private 39#undef private
40
41/* STD */
34#include <stdio.h> 42#include <stdio.h>
35#include <stdlib.h> 43#include <stdlib.h>
36#include <sys/types.h> 44#include <sys/types.h>
37#include <sys/stat.h> 45#include <sys/stat.h>
38#include <unistd.h> 46#include <unistd.h>
39 47
40#include "dropins.h"
41 48
42using QuickPrivate::PluginLoader; 49using QuickPrivate::PluginLoader;
43 50
44static QPEApplication *app = 0; 51static QPEApplication *app = 0;
45static PluginLoader *loader = 0; 52static PluginLoader *loader = 0;
46static ApplicationInterface *appIface = 0; 53static ApplicationInterface *appIface = 0;
47static QGuardedPtr<QWidget> mainWindow; 54static QGuardedPtr<QWidget> mainWindow;
48 55
49#ifdef _OS_LINUX_ 56#ifdef _OS_LINUX_
50static char **argv0 = 0; 57static char **argv0 = 0;
51static int argv_lth; 58static int argv_lth;
52extern char **environ; 59extern char **environ;
53#ifndef SPT_BUFSIZE 60#ifndef SPT_BUFSIZE
54#define SPT_BUFSIZE 2048 61#define SPT_BUFSIZE 2048
55#endif 62#endif
56#include <stdarg.h> 63#include <stdarg.h>
57using namespace Opie::Ui; 64using namespace Opie::Ui;
58void setproctitle (const char *fmt,...) { 65void setproctitle (const char *fmt,...) {
59 int i; 66 int i;
60 char buf[SPT_BUFSIZE]; 67 char buf[SPT_BUFSIZE];
61 va_list ap; 68 va_list ap;
62 69
63 if (!argv0) 70 if (!argv0)
64 return; 71 return;
@@ -90,144 +97,144 @@ public:
90 ch += QString::number(getpid()); 97 ch += QString::number(getpid());
91 qlChannel = new QCopChannel( ch, this); 98 qlChannel = new QCopChannel( ch, this);
92 connect( qlChannel, SIGNAL(received(const QCString&,const QByteArray&)), 99 connect( qlChannel, SIGNAL(received(const QCString&,const QByteArray&)),
93 this, SLOT(message(const QCString&,const QByteArray&)) ); 100 this, SLOT(message(const QCString&,const QByteArray&)) );
94 } 101 }
95 102
96 static void exec( int /*argc*/, char **argv ) 103 static void exec( int /*argc*/, char **argv )
97 { 104 {
98 QString appName = argv[0]; 105 QString appName = argv[0];
99 int sep = appName.findRev( '/' ); 106 int sep = appName.findRev( '/' );
100 if ( sep > 0 ) 107 if ( sep > 0 )
101 appName = appName.mid( sep+1 ); 108 appName = appName.mid( sep+1 );
102 109
103 appIface = 0; 110 appIface = 0;
104 if ( loader->queryInterface(appName, IID_QtopiaApplication, (QUnknownInterface**)&appIface) == QS_OK ) { 111 if ( loader->queryInterface(appName, IID_QtopiaApplication, (QUnknownInterface**)&appIface) == QS_OK ) {
105 mainWindow = appIface->createMainWindow( appName ); 112 mainWindow = appIface->createMainWindow( appName );
106 } 113 }
107 if ( mainWindow ) { 114 if ( mainWindow ) {
108 if ( mainWindow->metaObject()->slotNames().contains("setDocument(const QString&)") ) { 115 if ( mainWindow->metaObject()->slotNames().contains("setDocument(const QString&)") ) {
109 app->showMainDocumentWidget( mainWindow ); 116 app->showMainDocumentWidget( mainWindow );
110 } else { 117 } else {
111 app->showMainWidget( mainWindow ); 118 app->showMainWidget( mainWindow );
112 } 119 }
113 } else { 120 } else {
114 qWarning( "Could not create application main window" ); 121 owarn << "Could not create application main window" << oendl;
115 exit(-1); 122 exit(-1);
116 } 123 }
117 } 124 }
118 125
119private slots: 126private slots:
120 void message(const QCString &msg, const QByteArray & data) 127 void message(const QCString &msg, const QByteArray & data)
121 { 128 {
122 QStrList argList; 129 QStrList argList;
123 130
124 if ( msg == "execute(QStrList)" ) { 131 if ( msg == "execute(QStrList)" ) {
125 delete qlChannel; 132 delete qlChannel;
126 QDataStream stream( data, IO_ReadOnly ); 133 QDataStream stream( data, IO_ReadOnly );
127 QStrList argList; 134 QStrList argList;
128 stream >> argList; 135 stream >> argList;
129 qDebug( "QuickLauncher execute: %s", argList.at(0) ); 136 odebug << "QuickLauncher execute: " << argList.at(0) << "" << oendl;
130 doQuickLaunch( argList ); 137 doQuickLaunch( argList );
131 delete this; 138 delete this;
132 } else if ( msg == "execute(QString)" ) { 139 } else if ( msg == "execute(QString)" ) {
133 delete qlChannel; 140 delete qlChannel;
134 QDataStream stream( data, IO_ReadOnly ); 141 QDataStream stream( data, IO_ReadOnly );
135 QString arg; 142 QString arg;
136 stream >> arg; 143 stream >> arg;
137 qDebug( "QuickLauncher execute: %s", arg.latin1() ); 144 odebug << "QuickLauncher execute: " << arg << "" << oendl;
138 QStrList argList; 145 QStrList argList;
139 argList.append( arg.utf8() ); 146 argList.append( arg.utf8() );
140 doQuickLaunch( argList ); 147 doQuickLaunch( argList );
141 delete this; 148 delete this;
142 } 149 }
143 } 150 }
144 151
145private: 152private:
146 void doQuickLaunch( QStrList &argList ) 153 void doQuickLaunch( QStrList &argList )
147 { 154 {
148 static int myargc = argList.count(); 155 static int myargc = argList.count();
149 static char **myargv = new char *[myargc + 1]; 156 static char **myargv = new char *[myargc + 1];
150 for ( int j = 0; j < myargc; j++ ) { 157 for ( int j = 0; j < myargc; j++ ) {
151 myargv[j] = new char [strlen(argList.at(j))+1]; 158 myargv[j] = new char [strlen(argList.at(j))+1];
152 strcpy( myargv[j], argList.at(j) ); 159 strcpy( myargv[j], argList.at(j) );
153 } 160 }
154 myargv[myargc] = NULL; 161 myargv[myargc] = NULL;
155#ifdef _OS_LINUX_ 162#ifdef _OS_LINUX_
156 // Change name of process 163 // Change name of process
157 setproctitle(myargv[0]); 164 setproctitle(myargv[0]);
158#endif 165#endif
159 166
160 connect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); 167 connect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit()));
161 app->exit_loop(); 168 app->exit_loop();
162 app->initApp( myargc, myargv ); 169 app->initApp( myargc, myargv );
163 exec( myargc, myargv ); 170 exec( myargc, myargv );
164 } 171 }
165 172
166private: 173private:
167 QCopChannel *qlChannel; 174 QCopChannel *qlChannel;
168}; 175};
169 176
170int main( int argc, char** argv ) 177int main( int argc, char** argv )
171{ 178{
172 app = new QPEApplication( argc, argv ); 179 app = new QPEApplication( argc, argv );
173 180
174 loader = new PluginLoader( "application" ); 181 loader = new PluginLoader( "application" );
175 182
176 unsetenv( "LD_BIND_NOW" ); 183 unsetenv( "LD_BIND_NOW" );
177 184
178 QCString arg0 = argv[0]; 185 QCString arg0 = argv[0];
179 int sep = arg0.findRev( '/' ); 186 int sep = arg0.findRev( '/' );
180 if ( sep > 0 ) 187 if ( sep > 0 )
181 arg0 = arg0.mid( sep+1 ); 188 arg0 = arg0.mid( sep+1 );
182 if ( arg0 != "quicklauncher" ) { 189 if ( arg0 != "quicklauncher" ) {
183 qDebug( "QuickLauncher invoked as: %s", arg0.data() ); 190 odebug << "QuickLauncher invoked as: " << arg0.data() << "" << oendl;
184 QuickLauncher::exec( argc, argv ); 191 QuickLauncher::exec( argc, argv );
185 } else { 192 } else {
186#ifdef _OS_LINUX_ 193#ifdef _OS_LINUX_
187 // Setup to change proc title 194 // Setup to change proc title
188 int i; 195 int i;
189 char **envp = environ; 196 char **envp = environ;
190 /* Move the environment so we can reuse the memory. 197 /* Move the environment so we can reuse the memory.
191 * (Code borrowed from sendmail.) */ 198 * (Code borrowed from sendmail.) */
192 for (i = 0; envp[i] != NULL; i++) 199 for (i = 0; envp[i] != NULL; i++)
193 continue; 200 continue;
194 environ = (char **) malloc(sizeof(char *) * (i + 1)); 201 environ = (char **) malloc(sizeof(char *) * (i + 1));
195 if (environ == NULL) 202 if (environ == NULL)
196 return -1; 203 return -1;
197 for (i = 0; envp[i] != NULL; i++) 204 for (i = 0; envp[i] != NULL; i++)
198 if ((environ[i] = strdup(envp[i])) == NULL) 205 if ((environ[i] = strdup(envp[i])) == NULL)
199 return -1; 206 return -1;
200 environ[i] = NULL; 207 environ[i] = NULL;
201 208
202 argv0 = argv; 209 argv0 = argv;
203 if (i > 0) 210 if (i > 0)
204 argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0]; 211 argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0];
205 else 212 else
206 argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0]; 213 argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0];
207#endif 214#endif
208 (void)new QuickLauncher(); 215 (void)new QuickLauncher();
209 qDebug( "QuickLauncher running" ); 216 odebug << "QuickLauncher running" << oendl;
210 // Pre-load default fonts 217 // Pre-load default fonts
211 QFontMetrics fm( QApplication::font() ); 218 QFontMetrics fm( QApplication::font() );
212 fm.ascent(); // causes font load. 219 fm.ascent(); // causes font load.
213 QFont f( QApplication::font() ); 220 QFont f( QApplication::font() );
214 f.setWeight( QFont::Bold ); 221 f.setWeight( QFont::Bold );
215 QFontMetrics fmb( f ); 222 QFontMetrics fmb( f );
216 fmb.ascent(); // causes font load. 223 fmb.ascent(); // causes font load.
217 224
218 // Each of the following force internal structures/internal 225 // Each of the following force internal structures/internal
219 // initialization to be performed. This may mean allocating 226 // initialization to be performed. This may mean allocating
220 // memory that is not needed by all applications. 227 // memory that is not needed by all applications.
221#if 0 228#if 0
222 TimeZone::current().isValid(); // popuplate timezone cache 229 TimeZone::current().isValid(); // popuplate timezone cache
223 TimeString::currentDateFormat(); // create internal structures 230 TimeString::currentDateFormat(); // create internal structures
224 TimeString::currentAMPM(); 231 TimeString::currentAMPM();
225#endif 232#endif
226 Resource::loadIconSet("new"); // do internal init 233 Resource::loadIconSet("new"); // do internal init
227 234
228 /* make sure libopie gets lined in */ 235 /* make sure libopie gets lined in */
229 { 236 {
230 Opie::Ui::OWait item; 237 Opie::Ui::OWait item;
231 } 238 }
232 239
233 // Create a widget to force initialization of title bar images, etc. 240 // Create a widget to force initialization of title bar images, etc.