-rw-r--r-- | core/settings/launcher/doctabsettings.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.cpp | 2 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/main.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/taskbarsettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/security/main.cpp | 3 | ||||
-rw-r--r-- | core/settings/security/security.cpp | 1 |
9 files changed, 0 insertions, 16 deletions
diff --git a/core/settings/launcher/doctabsettings.cpp b/core/settings/launcher/doctabsettings.cpp index 8077b8c..179a7f9 100644 --- a/core/settings/launcher/doctabsettings.cpp +++ b/core/settings/launcher/doctabsettings.cpp | |||
@@ -1,71 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> | 4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
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 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | 32 | ||
35 | #include <qspinbox.h> | ||
36 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
37 | #include <qlayout.h> | 34 | #include <qlayout.h> |
38 | #include <qlabel.h> | 35 | #include <qlabel.h> |
39 | #include <qwhatsthis.h> | 36 | #include <qwhatsthis.h> |
40 | 37 | ||
41 | DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) | 38 | DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) |
42 | { | 39 | { |
43 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); | 40 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); |
44 | 41 | ||
45 | _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); | 42 | _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); |
46 | 43 | ||
47 | Config cfg( "Launcher" ); | 44 | Config cfg( "Launcher" ); |
48 | cfg.setGroup( "DocTab" ); | 45 | cfg.setGroup( "DocTab" ); |
49 | _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); | 46 | _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); |
50 | 47 | ||
51 | lay->addWidget( _enable ); | 48 | lay->addWidget( _enable ); |
52 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); | 49 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); |
53 | 50 | ||
54 | lay->addStretch(); | 51 | lay->addStretch(); |
55 | 52 | ||
56 | QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); | 53 | QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); |
57 | } | 54 | } |
58 | 55 | ||
59 | void DocTabSettings::appletChanged() | 56 | void DocTabSettings::appletChanged() |
60 | { | 57 | { |
61 | } | 58 | } |
62 | 59 | ||
63 | void DocTabSettings::accept() | 60 | void DocTabSettings::accept() |
64 | { | 61 | { |
65 | qDebug( "DocTabSettings::accept()" ); | 62 | qDebug( "DocTabSettings::accept()" ); |
66 | Config cfg( "Launcher" ); | 63 | Config cfg( "Launcher" ); |
67 | cfg.setGroup( "DocTab" ); | 64 | cfg.setGroup( "DocTab" ); |
68 | cfg.writeEntry( "Enable", _enable->isChecked() ); | 65 | cfg.writeEntry( "Enable", _enable->isChecked() ); |
69 | cfg.write(); | 66 | cfg.write(); |
70 | } | 67 | } |
71 | 68 | ||
diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp index 147a00d..e342c09 100644 --- a/core/settings/launcher/inputmethodsettings.cpp +++ b/core/settings/launcher/inputmethodsettings.cpp | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> | 4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
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 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | 32 | ||
35 | #include <qspinbox.h> | 33 | #include <qspinbox.h> |
36 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
37 | #include <qlayout.h> | 35 | #include <qlayout.h> |
38 | #include <qlabel.h> | 36 | #include <qlabel.h> |
39 | #include <qwhatsthis.h> | 37 | #include <qwhatsthis.h> |
40 | 38 | ||
41 | InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) | 39 | InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) |
42 | { | 40 | { |
43 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); | 41 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); |
44 | 42 | ||
45 | _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); | 43 | _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); |
46 | _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); | 44 | _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); |
47 | 45 | ||
48 | QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); | 46 | QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); |
49 | hbox->addWidget( new QLabel( "Initial Width:", this ) ); | 47 | hbox->addWidget( new QLabel( "Initial Width:", this ) ); |
50 | _size = new QSpinBox( 10, 100, 10, this ); | 48 | _size = new QSpinBox( 10, 100, 10, this ); |
51 | _size->setSuffix( "%" ); | 49 | _size->setSuffix( "%" ); |
52 | hbox->addWidget( _size ); | 50 | hbox->addWidget( _size ); |
53 | hbox->addStretch(); | 51 | hbox->addStretch(); |
54 | 52 | ||
55 | Config cfg( "Launcher" ); | 53 | Config cfg( "Launcher" ); |
56 | cfg.setGroup( "InputMethods" ); | 54 | cfg.setGroup( "InputMethods" ); |
57 | _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); | 55 | _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); |
58 | _float->setChecked( cfg.readBoolEntry( "Float", false ) ); | 56 | _float->setChecked( cfg.readBoolEntry( "Float", false ) ); |
59 | _size->setValue( cfg.readNumEntry( "Width", 100 ) ); | 57 | _size->setValue( cfg.readNumEntry( "Width", 100 ) ); |
60 | 58 | ||
61 | lay->addWidget( _resize ); | 59 | lay->addWidget( _resize ); |
62 | lay->addWidget( _float ); | 60 | lay->addWidget( _float ); |
63 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); | 61 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); |
64 | 62 | ||
65 | lay->addStretch(); | 63 | lay->addStretch(); |
66 | 64 | ||
67 | QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); | 65 | QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); |
68 | QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); | 66 | QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); |
69 | QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); | 67 | QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); |
70 | } | 68 | } |
71 | 69 | ||
72 | void InputMethodSettings::appletChanged() | 70 | void InputMethodSettings::appletChanged() |
73 | { | 71 | { |
74 | } | 72 | } |
75 | 73 | ||
76 | void InputMethodSettings::accept() | 74 | void InputMethodSettings::accept() |
77 | { | 75 | { |
78 | qDebug( "InputMethodSettings::accept()" ); | 76 | qDebug( "InputMethodSettings::accept()" ); |
79 | Config cfg( "Launcher" ); | 77 | Config cfg( "Launcher" ); |
80 | cfg.setGroup( "InputMethods" ); | 78 | cfg.setGroup( "InputMethods" ); |
81 | cfg.writeEntry( "Resize", _resize->isChecked() ); | 79 | cfg.writeEntry( "Resize", _resize->isChecked() ); |
82 | cfg.writeEntry( "Float", _float->isChecked() ); | 80 | cfg.writeEntry( "Float", _float->isChecked() ); |
83 | cfg.writeEntry( "Width", _size->value() ); | 81 | cfg.writeEntry( "Width", _size->value() ); |
84 | cfg.write(); | 82 | cfg.write(); |
85 | } | 83 | } |
86 | 84 | ||
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index e129849..5c11cc8 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -1,80 +1,79 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | =. This file is part of the OPIE Project | 3 | =. This file is part of the OPIE Project |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
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 <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qapplication.h> | ||
31 | 30 | ||
32 | #include <opie/otabwidget.h> | 31 | #include <opie/otabwidget.h> |
33 | 32 | ||
34 | #include "launchersettings.h" | 33 | #include "launchersettings.h" |
35 | #include "tabssettings.h" | 34 | #include "tabssettings.h" |
36 | #include "menusettings.h" | 35 | #include "menusettings.h" |
37 | #include "taskbarsettings.h" | 36 | #include "taskbarsettings.h" |
38 | #include "inputmethodsettings.h" | 37 | #include "inputmethodsettings.h" |
39 | #include "doctabsettings.h" | 38 | #include "doctabsettings.h" |
40 | 39 | ||
41 | LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) | 40 | LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) |
42 | : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) | 41 | : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) |
43 | { | 42 | { |
44 | setCaption ( tr( "Launcher Settings" )); | 43 | setCaption ( tr( "Launcher Settings" )); |
45 | 44 | ||
46 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 45 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
47 | 46 | ||
48 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 47 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
49 | lay-> addWidget ( tw ); | 48 | lay-> addWidget ( tw ); |
50 | 49 | ||
51 | m_tabs = new TabsSettings ( tw ); | 50 | m_tabs = new TabsSettings ( tw ); |
52 | m_taskbar = new TaskbarSettings ( tw ); | 51 | m_taskbar = new TaskbarSettings ( tw ); |
53 | m_menu = new MenuSettings ( tw ); | 52 | m_menu = new MenuSettings ( tw ); |
54 | m_imethods = new InputMethodSettings ( tw ); | 53 | m_imethods = new InputMethodSettings ( tw ); |
55 | m_doctab = new DocTabSettings ( tw ); | 54 | m_doctab = new DocTabSettings ( tw ); |
56 | 55 | ||
57 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); | 56 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); |
58 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); | 57 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); |
59 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); | 58 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
60 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); | 59 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); |
61 | tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); | 60 | tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); |
62 | tw-> setCurrentTab ( m_taskbar ); | 61 | tw-> setCurrentTab ( m_taskbar ); |
63 | } | 62 | } |
64 | 63 | ||
65 | void LauncherSettings::accept ( ) | 64 | void LauncherSettings::accept ( ) |
66 | { | 65 | { |
67 | m_taskbar-> accept ( ); | 66 | m_taskbar-> accept ( ); |
68 | m_menu-> accept ( ); | 67 | m_menu-> accept ( ); |
69 | m_tabs-> accept ( ); | 68 | m_tabs-> accept ( ); |
70 | m_imethods-> accept ( ); | 69 | m_imethods-> accept ( ); |
71 | m_doctab-> accept ( ); | 70 | m_doctab-> accept ( ); |
72 | 71 | ||
73 | QDialog::accept ( ); | 72 | QDialog::accept ( ); |
74 | } | 73 | } |
75 | 74 | ||
76 | void LauncherSettings::done ( int r ) | 75 | void LauncherSettings::done ( int r ) |
77 | { | 76 | { |
78 | QDialog::done ( r ); | 77 | QDialog::done ( r ); |
79 | close ( ); | 78 | close ( ); |
80 | } | 79 | } |
diff --git a/core/settings/launcher/main.cpp b/core/settings/launcher/main.cpp index 4cc1d35..bcfdcf6 100644 --- a/core/settings/launcher/main.cpp +++ b/core/settings/launcher/main.cpp | |||
@@ -1,35 +1,34 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
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 "launchersettings.h" | 28 | #include "launchersettings.h" |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | ||
31 | #include <opie/oapplicationfactory.h> | 30 | #include <opie/oapplicationfactory.h> |
32 | 31 | ||
33 | OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) | 32 | OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) |
34 | 33 | ||
35 | 34 | ||
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index de99a09..f79ad40 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -1,232 +1,229 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
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 <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <qpe/config.h> | ||
30 | #include <qpe/applnk.h> | ||
31 | 29 | ||
32 | #include <qlayout.h> | 30 | #include <qlayout.h> |
33 | #include <qvbox.h> | 31 | #include <qvbox.h> |
34 | #include <qtabbar.h> | 32 | #include <qtabbar.h> |
35 | #include <qiconview.h> | 33 | #include <qiconview.h> |
36 | #include <qapplication.h> | 34 | #include <qapplication.h> |
37 | #include <qlabel.h> | 35 | #include <qlabel.h> |
38 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
39 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
40 | #include <qpushbutton.h> | ||
41 | #include <qwhatsthis.h> | 38 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
43 | 40 | ||
44 | #include <opie/ofontselector.h> | 41 | #include <opie/ofontselector.h> |
45 | #include <opie/otabwidget.h> | 42 | #include <opie/otabwidget.h> |
46 | #include <opie/ocolorbutton.h> | 43 | #include <opie/ocolorbutton.h> |
47 | #include <opie/ofiledialog.h> | 44 | #include <opie/ofiledialog.h> |
48 | 45 | ||
49 | #include "tabdialog.h" | 46 | #include "tabdialog.h" |
50 | 47 | ||
51 | 48 | ||
52 | class SampleItem : public QIconViewItem { | 49 | class SampleItem : public QIconViewItem { |
53 | public: | 50 | public: |
54 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) | 51 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) |
55 | { | 52 | { |
56 | m_large = pix; | 53 | m_large = pix; |
57 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); | 54 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); |
58 | } | 55 | } |
59 | 56 | ||
60 | void sizeChange ( ) | 57 | void sizeChange ( ) |
61 | { | 58 | { |
62 | calcRect ( ); | 59 | calcRect ( ); |
63 | repaint ( ); | 60 | repaint ( ); |
64 | } | 61 | } |
65 | 62 | ||
66 | QPixmap *pixmap ( ) const | 63 | QPixmap *pixmap ( ) const |
67 | { | 64 | { |
68 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) | 65 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) |
69 | return (QPixmap *) &m_small; | 66 | return (QPixmap *) &m_small; |
70 | else | 67 | else |
71 | return (QPixmap *) &m_large; | 68 | return (QPixmap *) &m_large; |
72 | } | 69 | } |
73 | 70 | ||
74 | private: | 71 | private: |
75 | QPixmap m_large, m_small; | 72 | QPixmap m_large, m_small; |
76 | }; | 73 | }; |
77 | 74 | ||
78 | class SampleView : public QIconView { | 75 | class SampleView : public QIconView { |
79 | public: | 76 | public: |
80 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) | 77 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) |
81 | { | 78 | { |
82 | setItemsMovable ( false ); | 79 | setItemsMovable ( false ); |
83 | setAutoArrange ( true ); | 80 | setAutoArrange ( true ); |
84 | setSorting ( true ); | 81 | setSorting ( true ); |
85 | setFrameStyle ( QFrame::NoFrame ); | 82 | setFrameStyle ( QFrame::NoFrame ); |
86 | setSpacing ( 4 ); | 83 | setSpacing ( 4 ); |
87 | setMargin ( 0 ); | 84 | setMargin ( 0 ); |
88 | setSelectionMode ( QIconView::NoSelection ); | 85 | setSelectionMode ( QIconView::NoSelection ); |
89 | setBackgroundMode ( PaletteBase ); | 86 | setBackgroundMode ( PaletteBase ); |
90 | setViewMode ( TabConfig::Icon ); | 87 | setViewMode ( TabConfig::Icon ); |
91 | calculateGrid ( Bottom ); | 88 | calculateGrid ( Bottom ); |
92 | 89 | ||
93 | 90 | ||
94 | new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); | 91 | new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); |
95 | new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); | 92 | new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); |
96 | new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); | 93 | new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); |
97 | 94 | ||
98 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 95 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
99 | 96 | ||
100 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); | 97 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); |
101 | } | 98 | } |
102 | 99 | ||
103 | void setViewMode ( TabConfig::ViewMode m ) | 100 | void setViewMode ( TabConfig::ViewMode m ) |
104 | { | 101 | { |
105 | viewport ( )-> setUpdatesEnabled ( false ); | 102 | viewport ( )-> setUpdatesEnabled ( false ); |
106 | 103 | ||
107 | switch ( m ) { | 104 | switch ( m ) { |
108 | case TabConfig::List: | 105 | case TabConfig::List: |
109 | setItemTextPos( QIconView::Right ); | 106 | setItemTextPos( QIconView::Right ); |
110 | break; | 107 | break; |
111 | case TabConfig::Icon: | 108 | case TabConfig::Icon: |
112 | setItemTextPos( QIconView::Bottom ); | 109 | setItemTextPos( QIconView::Bottom ); |
113 | break; | 110 | break; |
114 | } | 111 | } |
115 | // hideOrShowItems ( false ); | 112 | // hideOrShowItems ( false ); |
116 | 113 | ||
117 | for ( QIconViewItem *it = firstItem ( ); it; it = it-> nextItem ( )) | 114 | for ( QIconViewItem *it = firstItem ( ); it; it = it-> nextItem ( )) |
118 | ((SampleItem *) it )-> sizeChange ( ); | 115 | ((SampleItem *) it )-> sizeChange ( ); |
119 | arrangeItemsInGrid ( true ); | 116 | arrangeItemsInGrid ( true ); |
120 | viewport ( )-> setUpdatesEnabled ( true ); | 117 | viewport ( )-> setUpdatesEnabled ( true ); |
121 | update ( ); | 118 | update ( ); |
122 | } | 119 | } |
123 | 120 | ||
124 | 121 | ||
125 | void setBackgroundType( TabConfig::BackgroundType t, const QString &val ) | 122 | void setBackgroundType( TabConfig::BackgroundType t, const QString &val ) |
126 | { | 123 | { |
127 | switch ( t ) { | 124 | switch ( t ) { |
128 | case TabConfig::Ruled: { | 125 | case TabConfig::Ruled: { |
129 | QPixmap bg ( width ( ), 9 ); | 126 | QPixmap bg ( width ( ), 9 ); |
130 | QPainter painter ( &bg ); | 127 | QPainter painter ( &bg ); |
131 | for ( int i = 0; i < 3; i++ ) { | 128 | for ( int i = 0; i < 3; i++ ) { |
132 | painter. setPen ( white ); | 129 | painter. setPen ( white ); |
133 | painter. drawLine ( 0, i*3, width()-1, i*3 ); | 130 | painter. drawLine ( 0, i*3, width()-1, i*3 ); |
134 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); | 131 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); |
135 | painter. setPen ( colorGroup().background().light(105) ); | 132 | painter. setPen ( colorGroup().background().light(105) ); |
136 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); | 133 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); |
137 | } | 134 | } |
138 | painter.end ( ); | 135 | painter.end ( ); |
139 | setBackgroundPixmap ( bg ); | 136 | setBackgroundPixmap ( bg ); |
140 | break; | 137 | break; |
141 | } | 138 | } |
142 | 139 | ||
143 | case TabConfig::SolidColor: { | 140 | case TabConfig::SolidColor: { |
144 | setBackgroundPixmap ( QPixmap ( )); | 141 | setBackgroundPixmap ( QPixmap ( )); |
145 | if ( val. isEmpty ( )) | 142 | if ( val. isEmpty ( )) |
146 | setBackgroundColor ( colorGroup ( ). base ( )); | 143 | setBackgroundColor ( colorGroup ( ). base ( )); |
147 | else | 144 | else |
148 | setBackgroundColor ( val ); | 145 | setBackgroundColor ( val ); |
149 | break; | 146 | break; |
150 | } | 147 | } |
151 | 148 | ||
152 | case TabConfig::Image: { | 149 | case TabConfig::Image: { |
153 | qDebug( "Loading image: %s", val.latin1() ); | 150 | qDebug( "Loading image: %s", val.latin1() ); |
154 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); | 151 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); |
155 | if ( bg. isNull ( )) { | 152 | if ( bg. isNull ( )) { |
156 | QImageIO imgio; | 153 | QImageIO imgio; |
157 | imgio. setFileName ( val ); | 154 | imgio. setFileName ( val ); |
158 | QSize ds = qApp-> desktop ( )-> size ( ); | 155 | QSize ds = qApp-> desktop ( )-> size ( ); |
159 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr | 156 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr |
160 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); | 157 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); |
161 | imgio. read ( ); | 158 | imgio. read ( ); |
162 | bg = imgio. image ( ); | 159 | bg = imgio. image ( ); |
163 | } | 160 | } |
164 | setBackgroundPixmap ( bg ); | 161 | setBackgroundPixmap ( bg ); |
165 | break; | 162 | break; |
166 | } | 163 | } |
167 | } | 164 | } |
168 | m_bgtype = t; | 165 | m_bgtype = t; |
169 | viewport ( )-> update ( ); | 166 | viewport ( )-> update ( ); |
170 | } | 167 | } |
171 | 168 | ||
172 | void setTextColor ( const QColor &tc ) | 169 | void setTextColor ( const QColor &tc ) |
173 | { | 170 | { |
174 | m_textcolor = tc; | 171 | m_textcolor = tc; |
175 | QColorGroup cg = colorGroup ( ); | 172 | QColorGroup cg = colorGroup ( ); |
176 | cg. setColor ( QColorGroup::Text, tc ); | 173 | cg. setColor ( QColorGroup::Text, tc ); |
177 | setPalette ( QPalette ( cg, cg, cg )); | 174 | setPalette ( QPalette ( cg, cg, cg )); |
178 | viewport ( )-> update ( ); | 175 | viewport ( )-> update ( ); |
179 | } | 176 | } |
180 | 177 | ||
181 | void setViewFont ( const QFont &f ) | 178 | void setViewFont ( const QFont &f ) |
182 | { | 179 | { |
183 | setFont ( f ); | 180 | setFont ( f ); |
184 | } | 181 | } |
185 | 182 | ||
186 | void setItemTextPos ( ItemTextPos pos ) | 183 | void setItemTextPos ( ItemTextPos pos ) |
187 | { | 184 | { |
188 | calculateGrid ( pos ); | 185 | calculateGrid ( pos ); |
189 | QIconView::setItemTextPos( pos ); | 186 | QIconView::setItemTextPos( pos ); |
190 | } | 187 | } |
191 | 188 | ||
192 | void calculateGrid ( ItemTextPos pos ) | 189 | void calculateGrid ( ItemTextPos pos ) |
193 | { | 190 | { |
194 | int dw = QApplication::desktop ( )-> width ( ); | 191 | int dw = QApplication::desktop ( )-> width ( ); |
195 | int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); | 192 | int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); |
196 | if ( pos == Bottom ) { | 193 | if ( pos == Bottom ) { |
197 | int cols = 3; | 194 | int cols = 3; |
198 | if ( viewerWidth <= 200 ) | 195 | if ( viewerWidth <= 200 ) |
199 | cols = 2; | 196 | cols = 2; |
200 | else if ( viewerWidth >= 400 ) | 197 | else if ( viewerWidth >= 400 ) |
201 | cols = viewerWidth/96; | 198 | cols = viewerWidth/96; |
202 | setSpacing ( 4 ); | 199 | setSpacing ( 4 ); |
203 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); | 200 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); |
204 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); | 201 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); |
205 | } | 202 | } |
206 | else { | 203 | else { |
207 | int cols = 2; | 204 | int cols = 2; |
208 | if ( viewerWidth < 150 ) | 205 | if ( viewerWidth < 150 ) |
209 | cols = 1; | 206 | cols = 1; |
210 | else if ( viewerWidth >= 400 ) | 207 | else if ( viewerWidth >= 400 ) |
211 | cols = viewerWidth / 150; | 208 | cols = viewerWidth / 150; |
212 | setSpacing ( 2 ); | 209 | setSpacing ( 2 ); |
213 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); | 210 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); |
214 | setGridY ( fontMetrics ( ). height ( ) + 2 ); | 211 | setGridY ( fontMetrics ( ). height ( ) + 2 ); |
215 | } | 212 | } |
216 | } | 213 | } |
217 | 214 | ||
218 | void paletteChange( const QPalette &p ) | 215 | void paletteChange( const QPalette &p ) |
219 | { | 216 | { |
220 | static bool excllock = false; | 217 | static bool excllock = false; |
221 | 218 | ||
222 | if ( excllock ) | 219 | if ( excllock ) |
223 | return; | 220 | return; |
224 | excllock = true; | 221 | excllock = true; |
225 | 222 | ||
226 | unsetPalette ( ); | 223 | unsetPalette ( ); |
227 | QIconView::paletteChange ( p ); | 224 | QIconView::paletteChange ( p ); |
228 | if ( m_bgtype == TabConfig::Ruled ) | 225 | if ( m_bgtype == TabConfig::Ruled ) |
229 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 226 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
230 | QColorGroup cg = colorGroup ( ); | 227 | QColorGroup cg = colorGroup ( ); |
231 | cg.setColor ( QColorGroup::Text, m_textcolor ); | 228 | cg.setColor ( QColorGroup::Text, m_textcolor ); |
232 | setPalette ( QPalette ( cg, cg, cg )); | 229 | setPalette ( QPalette ( cg, cg, cg )); |
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 3d8b456..a3d31a5 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp | |||
@@ -1,222 +1,221 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
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 "tabssettings.h" | 28 | #include "tabssettings.h" |
29 | 29 | ||
30 | #include <qpe/qpeapplication.h> | ||
31 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
32 | #include <qpe/applnk.h> | 31 | #include <qpe/applnk.h> |
33 | #include <qpe/mimetype.h> | 32 | #include <qpe/mimetype.h> |
34 | #include <qpe/qcopenvelope_qws.h> | 33 | #include <qpe/qcopenvelope_qws.h> |
35 | #include <qpe/config.h> | 34 | #include <qpe/config.h> |
36 | 35 | ||
37 | #include <qlistbox.h> | 36 | #include <qlistbox.h> |
38 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
39 | #include <qlayout.h> | 38 | #include <qlayout.h> |
40 | #include <qlabel.h> | 39 | #include <qlabel.h> |
41 | #include <qwhatsthis.h> | 40 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | 41 | #include <qcheckbox.h> |
43 | 42 | ||
44 | #include "tabdialog.h" | 43 | #include "tabdialog.h" |
45 | 44 | ||
46 | #include <stdlib.h> | 45 | #include <stdlib.h> |
47 | #include <qmessagebox.h> | 46 | #include <qmessagebox.h> |
48 | 47 | ||
49 | 48 | ||
50 | #define GLOBALID ".global." | 49 | #define GLOBALID ".global." |
51 | 50 | ||
52 | 51 | ||
53 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 52 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) |
54 | : QWidget ( parent, name ) | 53 | : QWidget ( parent, name ) |
55 | { | 54 | { |
56 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); | 55 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); |
57 | 56 | ||
58 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); | 57 | QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); |
59 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); | 58 | lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); |
60 | 59 | ||
61 | m_list = new QListBox ( this ); | 60 | m_list = new QListBox ( this ); |
62 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); | 61 | lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); |
63 | 62 | ||
64 | QWhatsThis::add ( m_list, tr( "foobar" )); | 63 | QWhatsThis::add ( m_list, tr( "foobar" )); |
65 | 64 | ||
66 | QPushButton *p1, *p2, *p3; | 65 | QPushButton *p1, *p2, *p3; |
67 | p1 = new QPushButton ( tr( "New" ), this ); | 66 | p1 = new QPushButton ( tr( "New" ), this ); |
68 | lay-> addWidget ( p1, 1, 1 ); | 67 | lay-> addWidget ( p1, 1, 1 ); |
69 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); | 68 | connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); |
70 | 69 | ||
71 | p2 = new QPushButton ( tr( "Edit" ), this ); | 70 | p2 = new QPushButton ( tr( "Edit" ), this ); |
72 | lay-> addWidget ( p2, 2, 1 ); | 71 | lay-> addWidget ( p2, 2, 1 ); |
73 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); | 72 | connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); |
74 | 73 | ||
75 | p3 = new QPushButton ( tr( "Delete" ), this ); | 74 | p3 = new QPushButton ( tr( "Delete" ), this ); |
76 | lay-> addWidget ( p3, 3, 1 ); | 75 | lay-> addWidget ( p3, 3, 1 ); |
77 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); | 76 | connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); |
78 | 77 | ||
79 | lay-> setRowStretch ( 4, 10 ); | 78 | lay-> setRowStretch ( 4, 10 ); |
80 | 79 | ||
81 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); | 80 | m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); |
82 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); | 81 | lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); |
83 | 82 | ||
84 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); | 83 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); |
85 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); | 84 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); |
86 | 85 | ||
87 | p1-> setEnabled ( false ); | 86 | p1-> setEnabled ( false ); |
88 | p3-> setEnabled ( false ); | 87 | p3-> setEnabled ( false ); |
89 | 88 | ||
90 | init ( ); | 89 | init ( ); |
91 | 90 | ||
92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | 91 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); |
93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 92 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | 93 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); |
95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 94 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); | 95 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); |
97 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); | 96 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); |
98 | } | 97 | } |
99 | 98 | ||
100 | void TabsSettings::init ( ) | 99 | void TabsSettings::init ( ) |
101 | { | 100 | { |
102 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); | 101 | AppLnkSet rootFolder( MimeType::appsFolderName ( )); |
103 | QStringList types = rootFolder. types ( ); | 102 | QStringList types = rootFolder. types ( ); |
104 | 103 | ||
105 | m_list-> insertItem ( tr( "All Tabs" )); | 104 | m_list-> insertItem ( tr( "All Tabs" )); |
106 | m_ids << GLOBALID; | 105 | m_ids << GLOBALID; |
107 | 106 | ||
108 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { | 107 | for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { |
109 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); | 108 | m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); |
110 | m_ids << *it; | 109 | m_ids << *it; |
111 | } | 110 | } |
112 | QImage img ( Resource::loadImage ( "DocsIcon" )); | 111 | QImage img ( Resource::loadImage ( "DocsIcon" )); |
113 | QPixmap pix; | 112 | QPixmap pix; |
114 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); | 113 | pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); |
115 | m_list-> insertItem ( pix, tr( "Documents" )); | 114 | m_list-> insertItem ( pix, tr( "Documents" )); |
116 | m_ids += "Documents"; // No tr | 115 | m_ids += "Documents"; // No tr |
117 | 116 | ||
118 | Config cfg ( "Launcher" ); | 117 | Config cfg ( "Launcher" ); |
119 | 118 | ||
120 | readTabSettings ( cfg ); | 119 | readTabSettings ( cfg ); |
121 | 120 | ||
122 | cfg. setGroup ( "GUI" ); | 121 | cfg. setGroup ( "GUI" ); |
123 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); | 122 | m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); |
124 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); | 123 | m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); |
125 | } | 124 | } |
126 | 125 | ||
127 | 126 | ||
128 | void TabsSettings::readTabSettings ( Config &cfg ) | 127 | void TabsSettings::readTabSettings ( Config &cfg ) |
129 | { | 128 | { |
130 | QString grp ( "Tab %1" ); // No tr | 129 | QString grp ( "Tab %1" ); // No tr |
131 | m_tabs. clear ( ); | 130 | m_tabs. clear ( ); |
132 | 131 | ||
133 | TabConfig global_def; | 132 | TabConfig global_def; |
134 | global_def. m_view = TabConfig::Icon; | 133 | global_def. m_view = TabConfig::Icon; |
135 | global_def. m_bg_type = TabConfig::Ruled; | 134 | global_def. m_bg_type = TabConfig::Ruled; |
136 | global_def. m_bg_image = "launcher/opie-background"; | 135 | global_def. m_bg_image = "launcher/opie-background"; |
137 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); | 136 | global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); |
138 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); | 137 | global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); |
139 | global_def. m_font_use = false; | 138 | global_def. m_font_use = false; |
140 | global_def. m_font_family = font ( ). family ( ); | 139 | global_def. m_font_family = font ( ). family ( ); |
141 | global_def. m_font_size = font ( ). pointSize ( ); | 140 | global_def. m_font_size = font ( ). pointSize ( ); |
142 | global_def. m_font_weight = 50; | 141 | global_def. m_font_weight = 50; |
143 | global_def. m_font_italic = false; | 142 | global_def. m_font_italic = false; |
144 | global_def. m_changed = false; | 143 | global_def. m_changed = false; |
145 | 144 | ||
146 | 145 | ||
147 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 146 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
148 | TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; | 147 | TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; |
149 | 148 | ||
150 | cfg. setGroup ( grp. arg ( *it )); | 149 | cfg. setGroup ( grp. arg ( *it )); |
151 | 150 | ||
152 | QString view = cfg. readEntry ( "View" ); | 151 | QString view = cfg. readEntry ( "View" ); |
153 | if ( view == "Icon" ) // No tr | 152 | if ( view == "Icon" ) // No tr |
154 | tc. m_view = TabConfig::Icon; | 153 | tc. m_view = TabConfig::Icon; |
155 | if ( view == "List" ) // No tr | 154 | if ( view == "List" ) // No tr |
156 | tc. m_view = TabConfig::List; | 155 | tc. m_view = TabConfig::List; |
157 | 156 | ||
158 | QString bgType = cfg. readEntry ( "BackgroundType" ); | 157 | QString bgType = cfg. readEntry ( "BackgroundType" ); |
159 | if ( bgType == "Image" ) | 158 | if ( bgType == "Image" ) |
160 | tc. m_bg_type = TabConfig::Image; | 159 | tc. m_bg_type = TabConfig::Image; |
161 | else if ( bgType == "SolidColor" ) | 160 | else if ( bgType == "SolidColor" ) |
162 | tc. m_bg_type = TabConfig::SolidColor; | 161 | tc. m_bg_type = TabConfig::SolidColor; |
163 | else if ( bgType == "Image" ) // No tr | 162 | else if ( bgType == "Image" ) // No tr |
164 | tc. m_bg_type = TabConfig::Image; | 163 | tc. m_bg_type = TabConfig::Image; |
165 | 164 | ||
166 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); | 165 | tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); |
167 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); | 166 | tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); |
168 | tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); | 167 | tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); |
169 | QStringList f = cfg. readListEntry ( "Font", ',' ); | 168 | QStringList f = cfg. readListEntry ( "Font", ',' ); |
170 | if ( f. count ( ) == 4 ) { | 169 | if ( f. count ( ) == 4 ) { |
171 | tc. m_font_use = true; | 170 | tc. m_font_use = true; |
172 | tc. m_font_family = f [0]; | 171 | tc. m_font_family = f [0]; |
173 | tc. m_font_size = f [1]. toInt ( ); | 172 | tc. m_font_size = f [1]. toInt ( ); |
174 | tc. m_font_weight = f [2]. toInt ( ); | 173 | tc. m_font_weight = f [2]. toInt ( ); |
175 | tc. m_font_italic = ( f [3]. toInt ( )); | 174 | tc. m_font_italic = ( f [3]. toInt ( )); |
176 | } | 175 | } |
177 | m_tabs [*it] = tc; | 176 | m_tabs [*it] = tc; |
178 | } | 177 | } |
179 | 178 | ||
180 | // if all tabs have the same config, then initialize the GLOBALID tab to these values | 179 | // if all tabs have the same config, then initialize the GLOBALID tab to these values |
181 | 180 | ||
182 | TabConfig *first = 0; | 181 | TabConfig *first = 0; |
183 | bool same = true; | 182 | bool same = true; |
184 | 183 | ||
185 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 184 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
186 | if ( *it == GLOBALID ) | 185 | if ( *it == GLOBALID ) |
187 | continue; | 186 | continue; |
188 | else if ( !first ) | 187 | else if ( !first ) |
189 | first = &m_tabs [*it]; | 188 | first = &m_tabs [*it]; |
190 | else | 189 | else |
191 | same &= ( *first == m_tabs [*it] ); | 190 | same &= ( *first == m_tabs [*it] ); |
192 | } | 191 | } |
193 | if ( same ) { | 192 | if ( same ) { |
194 | m_tabs [GLOBALID] = *first; | 193 | m_tabs [GLOBALID] = *first; |
195 | m_tabs [GLOBALID]. m_changed = true; | 194 | m_tabs [GLOBALID]. m_changed = true; |
196 | } | 195 | } |
197 | } | 196 | } |
198 | 197 | ||
199 | 198 | ||
200 | void TabsSettings::accept ( ) | 199 | void TabsSettings::accept ( ) |
201 | { | 200 | { |
202 | Config cfg ( "Launcher" ); | 201 | Config cfg ( "Launcher" ); |
203 | 202 | ||
204 | // Launcher Tab | 203 | // Launcher Tab |
205 | QString grp ( "Tab %1" ); // No tr | 204 | QString grp ( "Tab %1" ); // No tr |
206 | 205 | ||
207 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { | 206 | for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { |
208 | TabConfig &tc = m_tabs [*it]; | 207 | TabConfig &tc = m_tabs [*it]; |
209 | 208 | ||
210 | if ( !tc. m_changed ) | 209 | if ( !tc. m_changed ) |
211 | continue; | 210 | continue; |
212 | 211 | ||
213 | cfg. setGroup ( grp. arg ( *it )); | 212 | cfg. setGroup ( grp. arg ( *it )); |
214 | switch ( tc. m_view ) { | 213 | switch ( tc. m_view ) { |
215 | case TabConfig::Icon: | 214 | case TabConfig::Icon: |
216 | cfg.writeEntry ( "View", "Icon" ); | 215 | cfg.writeEntry ( "View", "Icon" ); |
217 | break; | 216 | break; |
218 | case TabConfig::List: | 217 | case TabConfig::List: |
219 | cfg.writeEntry ( "View", "List" ); | 218 | cfg.writeEntry ( "View", "List" ); |
220 | break; | 219 | break; |
221 | } | 220 | } |
222 | 221 | ||
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index d03ea49..badb98f 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp | |||
@@ -1,173 +1,172 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
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 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | 32 | #include <qpe/qlibrary.h> |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/taskbarappletinterface.h> | 34 | #include <qpe/taskbarappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qcheckbox.h> | ||
40 | #include <qheader.h> | 39 | #include <qheader.h> |
41 | #include <qlayout.h> | 40 | #include <qlayout.h> |
42 | #include <qlabel.h> | 41 | #include <qlabel.h> |
43 | #include <qwhatsthis.h> | 42 | #include <qwhatsthis.h> |
44 | 43 | ||
45 | #include <stdlib.h> | 44 | #include <stdlib.h> |
46 | 45 | ||
47 | 46 | ||
48 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) | 47 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) |
49 | : QWidget ( parent, name ) | 48 | : QWidget ( parent, name ) |
50 | { | 49 | { |
51 | m_applets_changed = false; | 50 | m_applets_changed = false; |
52 | 51 | ||
53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 52 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
54 | 53 | ||
55 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); | 54 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); |
56 | lay-> addWidget ( l ); | 55 | lay-> addWidget ( l ); |
57 | 56 | ||
58 | m_list = new QListView ( this ); | 57 | m_list = new QListView ( this ); |
59 | m_list-> addColumn ( "foobar" ); | 58 | m_list-> addColumn ( "foobar" ); |
60 | m_list-> header ( )-> hide ( ); | 59 | m_list-> header ( )-> hide ( ); |
61 | 60 | ||
62 | lay-> addWidget ( m_list ); | 61 | lay-> addWidget ( m_list ); |
63 | 62 | ||
64 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); | 63 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); |
65 | 64 | ||
66 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 65 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); |
67 | 66 | ||
68 | init ( ); | 67 | init ( ); |
69 | } | 68 | } |
70 | 69 | ||
71 | void TaskbarSettings::init ( ) | 70 | void TaskbarSettings::init ( ) |
72 | { | 71 | { |
73 | Config cfg ( "Taskbar" ); | 72 | Config cfg ( "Taskbar" ); |
74 | cfg. setGroup ( "Applets" ); | 73 | cfg. setGroup ( "Applets" ); |
75 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 74 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
76 | 75 | ||
77 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 76 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
78 | #ifdef Q_OS_MACX | 77 | #ifdef Q_OS_MACX |
79 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | 78 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); |
80 | #else | 79 | #else |
81 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 80 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
82 | #endif /* Q_OS_MACX */ | 81 | #endif /* Q_OS_MACX */ |
83 | 82 | ||
84 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 83 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
85 | QString name; | 84 | QString name; |
86 | QPixmap icon; | 85 | QPixmap icon; |
87 | TaskbarNamedAppletInterface *iface = 0; | 86 | TaskbarNamedAppletInterface *iface = 0; |
88 | 87 | ||
89 | qWarning("Load applet: %s", (*it).latin1() ); | 88 | qWarning("Load applet: %s", (*it).latin1() ); |
90 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 89 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
91 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); | 90 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); |
92 | qWarning("<1>"); | 91 | qWarning("<1>"); |
93 | if ( iface ) { | 92 | if ( iface ) { |
94 | qWarning("<2>"); | 93 | qWarning("<2>"); |
95 | QString lang = getenv( "LANG" ); | 94 | QString lang = getenv( "LANG" ); |
96 | QTranslator *trans = new QTranslator ( qApp ); | 95 | QTranslator *trans = new QTranslator ( qApp ); |
97 | QString type = (*it). left ((*it). find (".")); | 96 | QString type = (*it). left ((*it). find (".")); |
98 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 97 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
99 | if ( trans-> load ( tfn )) | 98 | if ( trans-> load ( tfn )) |
100 | qApp-> installTranslator ( trans ); | 99 | qApp-> installTranslator ( trans ); |
101 | else | 100 | else |
102 | delete trans; | 101 | delete trans; |
103 | name = iface-> name ( ); | 102 | name = iface-> name ( ); |
104 | icon = iface-> icon ( ); | 103 | icon = iface-> icon ( ); |
105 | iface-> release ( ); | 104 | iface-> release ( ); |
106 | } | 105 | } |
107 | qWarning("<3>"); | 106 | qWarning("<3>"); |
108 | if ( !iface ) { | 107 | if ( !iface ) { |
109 | qWarning("<4>"); | 108 | qWarning("<4>"); |
110 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); | 109 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); |
111 | 110 | ||
112 | if ( iface ) { | 111 | if ( iface ) { |
113 | qWarning("<5>"); | 112 | qWarning("<5>"); |
114 | name = (*it). mid ( 3 ); | 113 | name = (*it). mid ( 3 ); |
115 | qWarning("Found applet: %s", name.latin1() ); | 114 | qWarning("Found applet: %s", name.latin1() ); |
116 | #ifdef Q_OS_MACX | 115 | #ifdef Q_OS_MACX |
117 | int sep = name. find( ".dylib" ); | 116 | int sep = name. find( ".dylib" ); |
118 | #else | 117 | #else |
119 | int sep = name. find( ".so" ); | 118 | int sep = name. find( ".so" ); |
120 | #endif /* Q_OS_MACX */ | 119 | #endif /* Q_OS_MACX */ |
121 | if ( sep > 0 ) | 120 | if ( sep > 0 ) |
122 | name. truncate ( sep ); | 121 | name. truncate ( sep ); |
123 | sep = name. find ( "applet" ); | 122 | sep = name. find ( "applet" ); |
124 | if ( sep == (int) name.length ( ) - 6 ) | 123 | if ( sep == (int) name.length ( ) - 6 ) |
125 | name. truncate ( sep ); | 124 | name. truncate ( sep ); |
126 | name[0] = name[0]. upper ( ); | 125 | name[0] = name[0]. upper ( ); |
127 | iface-> release ( ); | 126 | iface-> release ( ); |
128 | } | 127 | } |
129 | } | 128 | } |
130 | qWarning("<6>"); | 129 | qWarning("<6>"); |
131 | 130 | ||
132 | if ( iface ) { | 131 | if ( iface ) { |
133 | qWarning("<7>"); | 132 | qWarning("<7>"); |
134 | QCheckListItem *item; | 133 | QCheckListItem *item; |
135 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 134 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
136 | if ( !icon. isNull ( )) | 135 | if ( !icon. isNull ( )) |
137 | item-> setPixmap ( 0, icon ); | 136 | item-> setPixmap ( 0, icon ); |
138 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 137 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
139 | m_applets [*it] = item; | 138 | m_applets [*it] = item; |
140 | } | 139 | } |
141 | lib-> unload ( ); | 140 | lib-> unload ( ); |
142 | delete lib; | 141 | delete lib; |
143 | } | 142 | } |
144 | } | 143 | } |
145 | 144 | ||
146 | void TaskbarSettings::appletChanged() | 145 | void TaskbarSettings::appletChanged() |
147 | { | 146 | { |
148 | m_applets_changed = true; | 147 | m_applets_changed = true; |
149 | } | 148 | } |
150 | 149 | ||
151 | void TaskbarSettings::accept ( ) | 150 | void TaskbarSettings::accept ( ) |
152 | { | 151 | { |
153 | Config cfg ( "Taskbar" ); | 152 | Config cfg ( "Taskbar" ); |
154 | cfg. setGroup ( "Applets" ); | 153 | cfg. setGroup ( "Applets" ); |
155 | 154 | ||
156 | if ( m_applets_changed ) { | 155 | if ( m_applets_changed ) { |
157 | QStringList exclude; | 156 | QStringList exclude; |
158 | QMap <QString, QCheckListItem *>::Iterator it; | 157 | QMap <QString, QCheckListItem *>::Iterator it; |
159 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { | 158 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { |
160 | if ( !(*it)-> isOn ( )) | 159 | if ( !(*it)-> isOn ( )) |
161 | exclude << it. key ( ); | 160 | exclude << it. key ( ); |
162 | } | 161 | } |
163 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); | 162 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); |
164 | } | 163 | } |
165 | cfg. writeEntry ( "SafeMode", false ); | 164 | cfg. writeEntry ( "SafeMode", false ); |
166 | cfg. write ( ); | 165 | cfg. write ( ); |
167 | 166 | ||
168 | if ( m_applets_changed ) { | 167 | if ( m_applets_changed ) { |
169 | QCopEnvelope e ( "QPE/TaskBar", "reloadApplets()" ); | 168 | QCopEnvelope e ( "QPE/TaskBar", "reloadApplets()" ); |
170 | m_applets_changed = false; | 169 | m_applets_changed = false; |
171 | } | 170 | } |
172 | } | 171 | } |
173 | 172 | ||
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index 3141fb8..aed8ab2 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp | |||
@@ -1,32 +1,29 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/qpeapplication.h> | ||
22 | #include <qpe/qcopenvelope_qws.h> | ||
23 | #include <qpe/global.h> | ||
24 | 21 | ||
25 | #include "security.h" | 22 | #include "security.h" |
26 | 23 | ||
27 | #include <opie/oapplicationfactory.h> | 24 | #include <opie/oapplicationfactory.h> |
28 | 25 | ||
29 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) | 26 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) |
30 | 27 | ||
31 | 28 | ||
32 | 29 | ||
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index d7871b3..7bb14cd 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp | |||
@@ -1,225 +1,224 @@ | |||
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 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/password.h> | 24 | #include <qpe/password.h> |
25 | #include <qpe/qpedialog.h> | 25 | #include <qpe/qpedialog.h> |
26 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
27 | 27 | ||
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qlistview.h> | ||
34 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
35 | 34 | ||
36 | Security::Security( QWidget* parent, const char* name, WFlags fl ) | 35 | Security::Security( QWidget* parent, const char* name, WFlags fl ) |
37 | : SecurityBase( parent, name, TRUE, WStyle_ContextHelp ) | 36 | : SecurityBase( parent, name, TRUE, WStyle_ContextHelp ) |
38 | { | 37 | { |
39 | valid=FALSE; | 38 | valid=FALSE; |
40 | Config cfg("Security"); | 39 | Config cfg("Security"); |
41 | cfg.setGroup("Passcode"); | 40 | cfg.setGroup("Passcode"); |
42 | passcode = cfg.readEntry("passcode"); | 41 | passcode = cfg.readEntry("passcode"); |
43 | passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); | 42 | passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); |
44 | cfg.setGroup("Sync"); | 43 | cfg.setGroup("Sync"); |
45 | int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 | 44 | int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 |
46 | int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); | 45 | int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); |
47 | selectNet(auth_peer,auth_peer_bits,TRUE); | 46 | selectNet(auth_peer,auth_peer_bits,TRUE); |
48 | 47 | ||
49 | connect(syncnet, SIGNAL(textChanged(const QString&)), | 48 | connect(syncnet, SIGNAL(textChanged(const QString&)), |
50 | this, SLOT(setSyncNet(const QString&))); | 49 | this, SLOT(setSyncNet(const QString&))); |
51 | 50 | ||
52 | cfg.setGroup("Sync"); | 51 | cfg.setGroup("Sync"); |
53 | QString sa = cfg.readEntry("syncapp","Qtopia"); | 52 | QString sa = cfg.readEntry("syncapp","Qtopia"); |
54 | 53 | ||
55 | for (int i=0; i<syncapp->count(); i++) { | 54 | for (int i=0; i<syncapp->count(); i++) { |
56 | if ( syncapp->text(i) == sa ) { | 55 | if ( syncapp->text(i) == sa ) { |
57 | syncapp->setCurrentItem(i); | 56 | syncapp->setCurrentItem(i); |
58 | } | 57 | } |
59 | } | 58 | } |
60 | 59 | ||
61 | /* | 60 | /* |
62 | cfg.setGroup("Remote"); | 61 | cfg.setGroup("Remote"); |
63 | if ( telnetAvailable() ) | 62 | if ( telnetAvailable() ) |
64 | telnet->setChecked(cfg.readEntry("allow_telnet")); | 63 | telnet->setChecked(cfg.readEntry("allow_telnet")); |
65 | else | 64 | else |
66 | telnet->hide(); | 65 | telnet->hide(); |
67 | 66 | ||
68 | if ( sshAvailable() ) | 67 | if ( sshAvailable() ) |
69 | ssh->setChecked(cfg.readEntry("allow_ssh")); | 68 | ssh->setChecked(cfg.readEntry("allow_ssh")); |
70 | else | 69 | else |
71 | ssh->hide(); | 70 | ssh->hide(); |
72 | */ | 71 | */ |
73 | 72 | ||
74 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 73 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
75 | Config loginCfg(configFile,Config::File); | 74 | Config loginCfg(configFile,Config::File); |
76 | 75 | ||
77 | loginCfg.setGroup("General"); | 76 | loginCfg.setGroup("General"); |
78 | autoLoginName=loginCfg.readEntry("AutoLogin",""); | 77 | autoLoginName=loginCfg.readEntry("AutoLogin",""); |
79 | 78 | ||
80 | if (autoLoginName.stripWhiteSpace().isEmpty()) { | 79 | if (autoLoginName.stripWhiteSpace().isEmpty()) { |
81 | autoLogin=false; | 80 | autoLogin=false; |
82 | } else { | 81 | } else { |
83 | autoLogin=true; | 82 | autoLogin=true; |
84 | } | 83 | } |
85 | 84 | ||
86 | cfg.setGroup("SyncMode"); | 85 | cfg.setGroup("SyncMode"); |
87 | int mode = cfg.readNumEntry("Mode",2); // Default to Sharp | 86 | int mode = cfg.readNumEntry("Mode",2); // Default to Sharp |
88 | syncModeCombo->setCurrentItem( mode - 1 ); | 87 | syncModeCombo->setCurrentItem( mode - 1 ); |
89 | 88 | ||
90 | //since nobody knows what this is and it doesn't do anything, i'll hide it # CoreDump | 89 | //since nobody knows what this is and it doesn't do anything, i'll hide it # CoreDump |
91 | // is this work-in-progress or can it be removed? | 90 | // is this work-in-progress or can it be removed? |
92 | syncModeCombo->hide(); | 91 | syncModeCombo->hide(); |
93 | 92 | ||
94 | connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); | 93 | connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); |
95 | connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); | 94 | connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); |
96 | connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode())); | 95 | connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode())); |
97 | connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode())); | 96 | connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode())); |
98 | connect(syncapp,SIGNAL(activated(int)), this, SLOT(changeSyncApp())); | 97 | connect(syncapp,SIGNAL(activated(int)), this, SLOT(changeSyncApp())); |
99 | connect(restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); | 98 | connect(restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); |
100 | connect(deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); | 99 | connect(deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); |
101 | 100 | ||
102 | loadUsers(); | 101 | loadUsers(); |
103 | updateGUI(); | 102 | updateGUI(); |
104 | 103 | ||
105 | dl = new QPEDialogListener(this); | 104 | dl = new QPEDialogListener(this); |
106 | showMaximized(); | 105 | showMaximized(); |
107 | } | 106 | } |
108 | 107 | ||
109 | Security::~Security() | 108 | Security::~Security() |
110 | { | 109 | { |
111 | } | 110 | } |
112 | 111 | ||
113 | void Security::deleteListEntry() | 112 | void Security::deleteListEntry() |
114 | { | 113 | { |
115 | syncnet->removeItem(syncnet->currentItem()); | 114 | syncnet->removeItem(syncnet->currentItem()); |
116 | } | 115 | } |
117 | 116 | ||
118 | void Security::restoreDefaults() | 117 | void Security::restoreDefaults() |
119 | { | 118 | { |
120 | QMessageBox unrecbox( | 119 | QMessageBox unrecbox( |
121 | tr("Attention"), | 120 | tr("Attention"), |
122 | tr("<p>All user-defined net ranges will be lost."), | 121 | tr("<p>All user-defined net ranges will be lost."), |
123 | QMessageBox::Warning, | 122 | QMessageBox::Warning, |
124 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, | 123 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, |
125 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 124 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
126 | unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); | 125 | unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); |
127 | unrecbox.setButtonText(QMessageBox::Yes, tr("Ok")); | 126 | unrecbox.setButtonText(QMessageBox::Yes, tr("Ok")); |
128 | 127 | ||
129 | if ( unrecbox.exec() == QMessageBox::Yes) | 128 | if ( unrecbox.exec() == QMessageBox::Yes) |
130 | { | 129 | { |
131 | syncnet->clear(); | 130 | syncnet->clear(); |
132 | insertDefaultRanges(); | 131 | insertDefaultRanges(); |
133 | } | 132 | } |
134 | } | 133 | } |
135 | 134 | ||
136 | void Security::insertDefaultRanges() | 135 | void Security::insertDefaultRanges() |
137 | { | 136 | { |
138 | syncnet->insertItem( tr( "192.168.129.0/24" ) ); | 137 | syncnet->insertItem( tr( "192.168.129.0/24" ) ); |
139 | syncnet->insertItem( tr( "192.168.1.0/24" ) ); | 138 | syncnet->insertItem( tr( "192.168.1.0/24" ) ); |
140 | syncnet->insertItem( tr( "192.168.0.0/16" ) ); | 139 | syncnet->insertItem( tr( "192.168.0.0/16" ) ); |
141 | syncnet->insertItem( tr( "172.16.0.0/12" ) ); | 140 | syncnet->insertItem( tr( "172.16.0.0/12" ) ); |
142 | syncnet->insertItem( tr( "10.0.0.0/8" ) ); | 141 | syncnet->insertItem( tr( "10.0.0.0/8" ) ); |
143 | syncnet->insertItem( tr( "1.0.0.0/8" ) ); | 142 | syncnet->insertItem( tr( "1.0.0.0/8" ) ); |
144 | syncnet->insertItem( tr( "Any" ) ); | 143 | syncnet->insertItem( tr( "Any" ) ); |
145 | syncnet->insertItem( tr( "None" ) ); | 144 | syncnet->insertItem( tr( "None" ) ); |
146 | } | 145 | } |
147 | 146 | ||
148 | void Security::updateGUI() | 147 | void Security::updateGUI() |
149 | { | 148 | { |
150 | bool empty = passcode.isEmpty(); | 149 | bool empty = passcode.isEmpty(); |
151 | 150 | ||
152 | changepasscode->setText( empty ? tr("Set passcode" ) | 151 | changepasscode->setText( empty ? tr("Set passcode" ) |
153 | : tr("Change passcode" ) ); | 152 | : tr("Change passcode" ) ); |
154 | passcode_poweron->setEnabled( !empty ); | 153 | passcode_poweron->setEnabled( !empty ); |
155 | clearpasscode->setEnabled( !empty ); | 154 | clearpasscode->setEnabled( !empty ); |
156 | 155 | ||
157 | autologinToggle->setChecked(autoLogin); | 156 | autologinToggle->setChecked(autoLogin); |
158 | userlist->setEnabled(autoLogin); | 157 | userlist->setEnabled(autoLogin); |
159 | } | 158 | } |
160 | 159 | ||
161 | 160 | ||
162 | void Security::show() | 161 | void Security::show() |
163 | { | 162 | { |
164 | //valid=FALSE; | 163 | //valid=FALSE; |
165 | setEnabled(FALSE); | 164 | setEnabled(FALSE); |
166 | SecurityBase::show(); | 165 | SecurityBase::show(); |
167 | if ( passcode.isEmpty() ) { | 166 | if ( passcode.isEmpty() ) { |
168 | // could insist... | 167 | // could insist... |
169 | //changePassCode(); | 168 | //changePassCode(); |
170 | //if ( passcode.isEmpty() ) | 169 | //if ( passcode.isEmpty() ) |
171 | //reject(); | 170 | //reject(); |
172 | } else { | 171 | } else { |
173 | if (!valid) // security passcode was not asked yet, so ask now | 172 | if (!valid) // security passcode was not asked yet, so ask now |
174 | { | 173 | { |
175 | QString pc = enterPassCode(tr("Enter passcode")); | 174 | QString pc = enterPassCode(tr("Enter passcode")); |
176 | if ( pc != passcode ) { | 175 | if ( pc != passcode ) { |
177 | QMessageBox::critical(this, tr("Passcode incorrect"), | 176 | QMessageBox::critical(this, tr("Passcode incorrect"), |
178 | tr("The passcode entered is incorrect.\nAccess denied")); | 177 | tr("The passcode entered is incorrect.\nAccess denied")); |
179 | reject(); | 178 | reject(); |
180 | return; | 179 | return; |
181 | } | 180 | } |
182 | } | 181 | } |
183 | } | 182 | } |
184 | setEnabled(TRUE); | 183 | setEnabled(TRUE); |
185 | valid=TRUE; | 184 | valid=TRUE; |
186 | } | 185 | } |
187 | 186 | ||
188 | void Security::accept() | 187 | void Security::accept() |
189 | { | 188 | { |
190 | applySecurity(); | 189 | applySecurity(); |
191 | QDialog::accept(); | 190 | QDialog::accept(); |
192 | QCopEnvelope env("QPE/System", "securityChanged()" ); | 191 | QCopEnvelope env("QPE/System", "securityChanged()" ); |
193 | } | 192 | } |
194 | 193 | ||
195 | void Security::done(int r) | 194 | void Security::done(int r) |
196 | { | 195 | { |
197 | QDialog::done(r); | 196 | QDialog::done(r); |
198 | close(); | 197 | close(); |
199 | } | 198 | } |
200 | 199 | ||
201 | void Security::selectNet(int auth_peer,int auth_peer_bits, bool update) | 200 | void Security::selectNet(int auth_peer,int auth_peer_bits, bool update) |
202 | { | 201 | { |
203 | QString sn; | 202 | QString sn; |
204 | if ( auth_peer_bits == 0 && auth_peer == 0 ) { | 203 | if ( auth_peer_bits == 0 && auth_peer == 0 ) { |
205 | sn = tr("Any"); | 204 | sn = tr("Any"); |
206 | } else if ( auth_peer_bits == 32 && auth_peer == 0 ) { | 205 | } else if ( auth_peer_bits == 32 && auth_peer == 0 ) { |
207 | sn = tr("None"); | 206 | sn = tr("None"); |
208 | } else { | 207 | } else { |
209 | sn = | 208 | sn = |
210 | QString::number((auth_peer>>24)&0xff) + "." | 209 | QString::number((auth_peer>>24)&0xff) + "." |
211 | + QString::number((auth_peer>>16)&0xff) + "." | 210 | + QString::number((auth_peer>>16)&0xff) + "." |
212 | + QString::number((auth_peer>>8)&0xff) + "." | 211 | + QString::number((auth_peer>>8)&0xff) + "." |
213 | + QString::number((auth_peer>>0)&0xff) + "/" | 212 | + QString::number((auth_peer>>0)&0xff) + "/" |
214 | + QString::number(auth_peer_bits); | 213 | + QString::number(auth_peer_bits); |
215 | } | 214 | } |
216 | 215 | ||
217 | //insert user-defined list of netranges upon start | 216 | //insert user-defined list of netranges upon start |
218 | if (update) { | 217 | if (update) { |
219 | //User selected/active netrange first | 218 | //User selected/active netrange first |
220 | syncnet->insertItem( tr( sn ) ); | 219 | syncnet->insertItem( tr( sn ) ); |
221 | 220 | ||
222 | Config cfg("Security"); | 221 | Config cfg("Security"); |
223 | cfg.setGroup("Sync"); | 222 | cfg.setGroup("Sync"); |
224 | 223 | ||
225 | //set up defaults if needed, if someone manually deletes net0 he'll get a suprise hehe | 224 | //set up defaults if needed, if someone manually deletes net0 he'll get a suprise hehe |