summaryrefslogtreecommitdiff
path: root/core/settings
Unidiff
Diffstat (limited to 'core/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/menusettings.cpp4
-rw-r--r--core/settings/launcher/taskbarsettings.cpp4
-rw-r--r--core/settings/security/multiauthconfig.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp
index 2b64c47..55bf358 100644
--- a/core/settings/launcher/menusettings.cpp
+++ b/core/settings/launcher/menusettings.cpp
@@ -36,115 +36,115 @@
36 36
37#include <qdir.h> 37#include <qdir.h>
38#include <qlistview.h> 38#include <qlistview.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qheader.h> 40#include <qheader.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qwhatsthis.h> 43#include <qwhatsthis.h>
44 44
45#include <stdlib.h> 45#include <stdlib.h>
46 46
47 47
48MenuSettings::MenuSettings ( QWidget *parent, const char *name ) 48MenuSettings::MenuSettings ( QWidget *parent, const char *name )
49 : QWidget ( parent, name ) 49 : QWidget ( parent, name )
50{ 50{
51 m_applets_changed = false; 51 m_applets_changed = false;
52 52
53 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 53 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
54 54
55 QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); 55 QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this );
56 lay-> addWidget ( l ); 56 lay-> addWidget ( l );
57 57
58 m_list = new QListView ( this ); 58 m_list = new QListView ( this );
59 m_list-> addColumn ( "foobar" ); 59 m_list-> addColumn ( "foobar" );
60 m_list-> header ( )-> hide ( ); 60 m_list-> header ( )-> hide ( );
61 61
62 lay-> addWidget ( m_list ); 62 lay-> addWidget ( m_list );
63 63
64 m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); 64 m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this );
65 lay-> addWidget ( m_menutabs ); 65 lay-> addWidget ( m_menutabs );
66 66
67 m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this ); 67 m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this );
68 lay-> addWidget ( m_menusubpopup ); 68 lay-> addWidget ( m_menusubpopup );
69 69
70 QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); 70 QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." ));
71 QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); 71 QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." ));
72 72
73 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); 73 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
74 74
75 init ( ); 75 init ( );
76} 76}
77 77
78void MenuSettings::init ( ) 78void MenuSettings::init ( )
79{ 79{
80 Config cfg ( "StartMenu" ); 80 Config cfg ( "StartMenu" );
81 cfg. setGroup ( "Applets" ); 81 cfg. setGroup ( "Applets" );
82 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 82 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
83 83
84 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 84 QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
85#ifdef Q_OS_MACX 85#ifdef Q_OS_MACX
86 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 86 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
87#else 87#else
88 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 88 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
89#endif /* Q_OS_MACX */ 89#endif /* Q_OS_MACX */
90 90
91 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 91 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
92 QString name; 92 QString name;
93 QPixmap icon; 93 QPixmap icon;
94 MenuAppletInterface *iface = 0; 94 MenuAppletInterface *iface = 0;
95 95
96 QLibrary *lib = new QLibrary ( path + "/" + *it ); 96 QLibrary *lib = new QLibrary ( path + "/" + *it );
97 lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); 97 lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface );
98 if ( iface ) { 98 if ( iface ) {
99 QString lang = getenv( "LANG" ); 99 QString lang = getenv( "LANG" );
100 QTranslator *trans = new QTranslator ( qApp ); 100 QTranslator *trans = new QTranslator ( qApp );
101 QString type = (*it). left ((*it). find (".")); 101 QString type = (*it). left ((*it). find ("."));
102 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 102 QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
103 if ( trans-> load ( tfn )) 103 if ( trans-> load ( tfn ))
104 qApp-> installTranslator ( trans ); 104 qApp-> installTranslator ( trans );
105 else 105 else
106 delete trans; 106 delete trans;
107 name = iface-> name ( ); 107 name = iface-> name ( );
108 icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); 108 icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal );
109 iface-> release ( ); 109 iface-> release ( );
110 lib-> unload ( ); 110 lib-> unload ( );
111 111
112 QCheckListItem *item; 112 QCheckListItem *item;
113 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 113 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
114 if ( !icon. isNull ( )) 114 if ( !icon. isNull ( ))
115 item-> setPixmap ( 0, icon ); 115 item-> setPixmap ( 0, icon );
116 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 116 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
117 m_applets [*it] = item; 117 m_applets [*it] = item;
118 } else { 118 } else {
119 delete lib; 119 delete lib;
120 } 120 }
121 } 121 }
122 122
123 cfg. setGroup ( "Menu" ); 123 cfg. setGroup ( "Menu" );
124 m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) ); 124 m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) );
125 m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) ); 125 m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) );
126 m_menusubpopup->setEnabled( m_menutabs->isChecked() ); 126 m_menusubpopup->setEnabled( m_menutabs->isChecked() );
127 connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) ); 127 connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) );
128 128
129} 129}
130 130
131void MenuSettings::appletChanged() 131void MenuSettings::appletChanged()
132{ 132{
133 m_applets_changed = true; 133 m_applets_changed = true;
134} 134}
135 135
136void MenuSettings::accept ( ) 136void MenuSettings::accept ( )
137{ 137{
138 bool apps_changed = false; 138 bool apps_changed = false;
139 139
140 Config cfg ( "StartMenu" ); 140 Config cfg ( "StartMenu" );
141 cfg. setGroup ( "Applets" ); 141 cfg. setGroup ( "Applets" );
142 if ( m_applets_changed ) { 142 if ( m_applets_changed ) {
143 QStringList exclude; 143 QStringList exclude;
144 QMap <QString, QCheckListItem *>::Iterator it; 144 QMap <QString, QCheckListItem *>::Iterator it;
145 for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { 145 for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) {
146 if ( !(*it)-> isOn ( )) 146 if ( !(*it)-> isOn ( ))
147 exclude << it. key ( ); 147 exclude << it. key ( );
148 } 148 }
149 cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); 149 cfg. writeEntry ( "ExcludeApplets", exclude, ',' );
150 } 150 }
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index 8dd9e97..861ff3a 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -32,118 +32,118 @@
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <qpe/qlibrary.h> 33#include <qpe/qlibrary.h>
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35#include <qpe/taskbarappletinterface.h> 35#include <qpe/taskbarappletinterface.h>
36#include <qpe/qcopenvelope_qws.h> 36#include <qpe/qcopenvelope_qws.h>
37#include <opie2/odebug.h> 37#include <opie2/odebug.h>
38 38
39/* QT */ 39/* QT */
40#include <qdir.h> 40#include <qdir.h>
41#include <qlistview.h> 41#include <qlistview.h>
42#include <qheader.h> 42#include <qheader.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qlabel.h> 44#include <qlabel.h>
45#include <qwhatsthis.h> 45#include <qwhatsthis.h>
46 46
47/* STD */ 47/* STD */
48#include <stdlib.h> 48#include <stdlib.h>
49 49
50 50
51TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) 51TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
52 : QWidget ( parent, name ) 52 : QWidget ( parent, name )
53{ 53{
54 m_applets_changed = false; 54 m_applets_changed = false;
55 55
56 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 56 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
57 57
58 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); 58 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
59 lay-> addWidget ( l ); 59 lay-> addWidget ( l );
60 60
61 m_list = new QListView ( this ); 61 m_list = new QListView ( this );
62 m_list-> addColumn ( "foobar" ); 62 m_list-> addColumn ( "foobar" );
63 m_list-> header ( )-> hide ( ); 63 m_list-> header ( )-> hide ( );
64 64
65 lay-> addWidget ( m_list ); 65 lay-> addWidget ( m_list );
66 66
67 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." ));
68 68
69 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); 69 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
70 70
71 init ( ); 71 init ( );
72} 72}
73 73
74void TaskbarSettings::init ( ) 74void TaskbarSettings::init ( )
75{ 75{
76 Config cfg ( "Taskbar" ); 76 Config cfg ( "Taskbar" );
77 cfg. setGroup ( "Applets" ); 77 cfg. setGroup ( "Applets" );
78 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 78 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
79 79
80 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 80 QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
81#ifdef Q_OS_MACX 81#ifdef Q_OS_MACX
82 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 82 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
83#else 83#else
84 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 84 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
85#endif /* Q_OS_MACX */ 85#endif /* Q_OS_MACX */
86 86
87 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 87 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
88 QString name; 88 QString name;
89 QPixmap icon; 89 QPixmap icon;
90 TaskbarNamedAppletInterface *iface = 0; 90 TaskbarNamedAppletInterface *iface = 0;
91 91
92 owarn << "Load applet: " << (*it) << "" << oendl; 92 owarn << "Load applet: " << (*it) << "" << oendl;
93 QLibrary *lib = new QLibrary ( path + "/" + *it ); 93 QLibrary *lib = new QLibrary ( path + "/" + *it );
94 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); 94 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
95 owarn << "<1>" << oendl; 95 owarn << "<1>" << oendl;
96 if ( iface ) { 96 if ( iface ) {
97 owarn << "<2>" << oendl; 97 owarn << "<2>" << oendl;
98 QString lang = getenv( "LANG" ); 98 QString lang = getenv( "LANG" );
99 QTranslator *trans = new QTranslator ( qApp ); 99 QTranslator *trans = new QTranslator ( qApp );
100 QString type = (*it). left ((*it). find (".")); 100 QString type = (*it). left ((*it). find ("."));
101 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 101 QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
102 if ( trans-> load ( tfn )) 102 if ( trans-> load ( tfn ))
103 qApp-> installTranslator ( trans ); 103 qApp-> installTranslator ( trans );
104 else 104 else
105 delete trans; 105 delete trans;
106 name = iface-> name ( ); 106 name = iface-> name ( );
107 icon = iface-> icon ( ); 107 icon = iface-> icon ( );
108 iface-> release ( ); 108 iface-> release ( );
109 } 109 }
110 owarn << "<3>" << oendl; 110 owarn << "<3>" << oendl;
111 if ( !iface ) { 111 if ( !iface ) {
112 owarn << "<4>" << oendl; 112 owarn << "<4>" << oendl;
113 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); 113 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
114 114
115 if ( iface ) { 115 if ( iface ) {
116 owarn << "<5>" << oendl; 116 owarn << "<5>" << oendl;
117 name = (*it). mid ( 3 ); 117 name = (*it). mid ( 3 );
118 owarn << "Found applet: " << name << "" << oendl; 118 owarn << "Found applet: " << name << "" << oendl;
119#ifdef Q_OS_MACX 119#ifdef Q_OS_MACX
120 int sep = name. find( ".dylib" ); 120 int sep = name. find( ".dylib" );
121#else 121#else
122 int sep = name. find( ".so" ); 122 int sep = name. find( ".so" );
123#endif /* Q_OS_MACX */ 123#endif /* Q_OS_MACX */
124 if ( sep > 0 ) 124 if ( sep > 0 )
125 name. truncate ( sep ); 125 name. truncate ( sep );
126 sep = name. find ( "applet" ); 126 sep = name. find ( "applet" );
127 if ( sep == (int) name.length ( ) - 6 ) 127 if ( sep == (int) name.length ( ) - 6 )
128 name. truncate ( sep ); 128 name. truncate ( sep );
129 name[0] = name[0]. upper ( ); 129 name[0] = name[0]. upper ( );
130 iface-> release ( ); 130 iface-> release ( );
131 } 131 }
132 } 132 }
133 owarn << "<6>" << oendl; 133 owarn << "<6>" << oendl;
134 134
135 if ( iface ) { 135 if ( iface ) {
136 owarn << "<7>" << oendl; 136 owarn << "<7>" << oendl;
137 QCheckListItem *item; 137 QCheckListItem *item;
138 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 138 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
139 if ( !icon. isNull ( )) 139 if ( !icon. isNull ( ))
140 item-> setPixmap ( 0, icon ); 140 item-> setPixmap ( 0, icon );
141 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 141 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
142 m_applets [*it] = item; 142 m_applets [*it] = item;
143 } 143 }
144 lib-> unload ( ); 144 lib-> unload ( );
145 delete lib; 145 delete lib;
146 } 146 }
147} 147}
148 148
149void TaskbarSettings::appletChanged() 149void TaskbarSettings::appletChanged()
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp
index e545e17..45d691b 100644
--- a/core/settings/security/multiauthconfig.cpp
+++ b/core/settings/security/multiauthconfig.cpp
@@ -109,97 +109,97 @@ void MultiauthGeneralConfig::tryAuth()
109 QMessageBox confirmSave( 109 QMessageBox confirmSave(
110 tr("Attention"), 110 tr("Attention"),
111 "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" + 111 "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" +
112 tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>", 112 tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>",
113 QMessageBox::Warning, 113 QMessageBox::Warning,
114 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, 114 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton,
115 0, QString::null, TRUE, WStyle_StaysOnTop); 115 0, QString::null, TRUE, WStyle_StaysOnTop);
116 confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel")); 116 confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel"));
117 confirmSave.setButtonText(QMessageBox::Yes, tr("OK")); 117 confirmSave.setButtonText(QMessageBox::Yes, tr("OK"));
118 118
119 if ( confirmSave.exec() == QMessageBox::Yes) 119 if ( confirmSave.exec() == QMessageBox::Yes)
120 { 120 {
121 owarn << "writing config as user accepted" << oendl; 121 owarn << "writing config as user accepted" << oendl;
122 m_parentConfig->writeConfigs(); 122 m_parentConfig->writeConfigs();
123 owarn << "testing authentication" << oendl; 123 owarn << "testing authentication" << oendl;
124 // launch the authentication in testing mode 124 // launch the authentication in testing mode
125 Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow); 125 Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow);
126 } 126 }
127} 127}
128 128
129 129
130/// Builds and displays the Opie multi-authentication configuration dialog 130/// Builds and displays the Opie multi-authentication configuration dialog
131static void test_and_start() { 131static void test_and_start() {
132 Config pcfg("Security"); 132 Config pcfg("Security");
133 pcfg.setGroup( "Misc" ); 133 pcfg.setGroup( "Misc" );
134 bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); 134 bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true);
135 135
136 if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { 136 if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) {
137 owarn << "authentication failed, not showing opie-security" << oendl; 137 owarn << "authentication failed, not showing opie-security" << oendl;
138 exit( -1 ); 138 exit( -1 );
139 } 139 }
140} 140}
141 141
142 142
143 143
144 MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0) 144 MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0)
145: QDialog(par, w, TRUE, f), 145: QDialog(par, w, TRUE, f),
146 m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), 146 m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0),
147 m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), 147 m_generalConfig(0), m_loginWidget(0), m_syncWidget(0),
148 m_nbSuccessReq(0), m_plugins_changed(false) 148 m_nbSuccessReq(0), m_plugins_changed(false)
149{ 149{
150 /* Initializes the global configuration window 150 /* Initializes the global configuration window
151 */ 151 */
152 test_and_start(); 152 test_and_start();
153 153
154 /* Checks (and memorizes) if any authentication plugins are 154 /* Checks (and memorizes) if any authentication plugins are
155 * installed on the system 155 * installed on the system
156 */ 156 */
157 QString path = QPEApplication::qpeDir() + "/plugins/security"; 157 QString path = QPEApplication::qpeDir() + "plugins/security";
158 QDir dir( path, "lib*.so" ); 158 QDir dir( path, "lib*.so" );
159 QStringList list = dir.entryList(); 159 QStringList list = dir.entryList();
160 160
161 m_pluginsInstalled = ! list.isEmpty(); 161 m_pluginsInstalled = ! list.isEmpty();
162 if (m_pluginsInstalled == false) 162 if (m_pluginsInstalled == false)
163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; 163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl;
164 164
165 setCaption( tr( "Security configuration" ) ); 165 setCaption( tr( "Security configuration" ) );
166 QVBoxLayout *layout = new QVBoxLayout( this ); 166 QVBoxLayout *layout = new QVBoxLayout( this );
167 m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" ); 167 m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" );
168 layout->addWidget(m_mainTW); 168 layout->addWidget(m_mainTW);
169 169
170 if (m_pluginsInstalled) 170 if (m_pluginsInstalled)
171 { 171 {
172 m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); 172 m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget");
173 QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); 173 QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget);
174 pluginListLayout->setSpacing(6); 174 pluginListLayout->setSpacing(6);
175 pluginListLayout->setMargin(11); 175 pluginListLayout->setMargin(11);
176 QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget ); 176 QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget );
177 pluginListLayout->addWidget(pluginListTitle); 177 pluginListLayout->addWidget(pluginListTitle);
178 QHBox * pluginListHB = new QHBox(m_pluginListWidget); 178 QHBox * pluginListHB = new QHBox(m_pluginListWidget);
179 pluginListLayout->addWidget(pluginListHB); 179 pluginListLayout->addWidget(pluginListHB);
180 180
181 m_pluginListView = new QListView(pluginListHB); 181 m_pluginListView = new QListView(pluginListHB);
182 m_pluginListView->addColumn("PluginList"); 182 m_pluginListView->addColumn("PluginList");
183 m_pluginListView->header()->hide(); 183 m_pluginListView->header()->hide();
184 m_pluginListView->setSorting(-1); 184 m_pluginListView->setSorting(-1);
185 QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" )); 185 QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" ));
186 186
187 QVBox * pluginListVB = new QVBox(pluginListHB); 187 QVBox * pluginListVB = new QVBox(pluginListHB);
188 new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 188 new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
189 new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 189 new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
190 m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) ); 190 m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) );
191 191
192 connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) ); 192 connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) );
193 193
194 // general Opie multi-authentication configuration tab 194 // general Opie multi-authentication configuration tab
195 m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW); 195 m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW);
196 m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); 196 m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") );
197 197
198 } 198 }
199 // login settings page 199 // login settings page
200 m_loginWidget = new LoginBase(m_mainTW, "login config widget"); 200 m_loginWidget = new LoginBase(m_mainTW, "login config widget");
201 m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); 201 m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") );
202 202
203 // sync settings page 203 // sync settings page
204 m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); 204 m_syncWidget = new SyncBase( m_mainTW, "sync config widget" );
205 m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); 205 m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") );
@@ -329,97 +329,97 @@ void MultiauthConfig::readConfig()
329 329
330 pcfg->setGroup( "Plugins" ); 330 pcfg->setGroup( "Plugins" );
331 m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); 331 m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' );
332 m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); 332 m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' );
333 } 333 }
334 334
335 /* Login and Sync stuff */ 335 /* Login and Sync stuff */
336 pcfg->setGroup("Sync"); 336 pcfg->setGroup("Sync");
337 int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 337 int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
338 int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); 338 int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24);
339 339
340 pcfg->setGroup("SyncMode"); 340 pcfg->setGroup("SyncMode");
341 int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp 341 int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp
342 switch( mode ) { 342 switch( mode ) {
343 case 0x01: 343 case 0x01:
344 m_syncWidget->syncModeCombo->setCurrentItem( 0 ); 344 m_syncWidget->syncModeCombo->setCurrentItem( 0 );
345 break; 345 break;
346 case 0x02: 346 case 0x02:
347 default: 347 default:
348 m_syncWidget->syncModeCombo->setCurrentItem( 1 ); 348 m_syncWidget->syncModeCombo->setCurrentItem( 1 );
349 break; 349 break;
350 case 0x04: 350 case 0x04:
351 m_syncWidget->syncModeCombo->setCurrentItem( 2 ); 351 m_syncWidget->syncModeCombo->setCurrentItem( 2 );
352 break; 352 break;
353 } 353 }
354 /* 354 /*
355 cfg.setGroup("Remote"); 355 cfg.setGroup("Remote");
356 if ( telnetAvailable() ) 356 if ( telnetAvailable() )
357 telnet->setChecked(cfg.readEntry("allow_telnet")); 357 telnet->setChecked(cfg.readEntry("allow_telnet"));
358 else 358 else
359 telnet->hide(); 359 telnet->hide();
360 360
361 if ( sshAvailable() ) 361 if ( sshAvailable() )
362 ssh->setChecked(cfg.readEntry("allow_ssh")); 362 ssh->setChecked(cfg.readEntry("allow_ssh"));
363 else 363 else
364 ssh->hide(); 364 ssh->hide();
365 */ 365 */
366 366
367 // release the Config handler 367 // release the Config handler
368 delete pcfg; 368 delete pcfg;
369 // indeed, selectNet will open the config file... 369 // indeed, selectNet will open the config file...
370 selectNet(auth_peer,auth_peer_bits,TRUE); 370 selectNet(auth_peer,auth_peer_bits,TRUE);
371 371
372 connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)), 372 connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)),
373 this, SLOT(setSyncNet(const QString&))); 373 this, SLOT(setSyncNet(const QString&)));
374 374
375 375
376 376
377 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 377 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
378 Config loginCfg(configFile,Config::File); 378 Config loginCfg(configFile,Config::File);
379 379
380 loginCfg.setGroup("General"); 380 loginCfg.setGroup("General");
381 autoLoginName=loginCfg.readEntry("AutoLogin",""); 381 autoLoginName=loginCfg.readEntry("AutoLogin","");
382 382
383 if (autoLoginName.stripWhiteSpace().isEmpty()) { 383 if (autoLoginName.stripWhiteSpace().isEmpty()) {
384 autoLogin=false; 384 autoLogin=false;
385 } else { 385 } else {
386 autoLogin=true; 386 autoLogin=true;
387 } 387 }
388 388
389 389
390 connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); 390 connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
391 connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); 391 connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
392 connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); 392 connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults()));
393 connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); 393 connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry()));
394 394
395 loadUsers(); 395 loadUsers();
396 updateGUI(); 396 updateGUI();
397 397
398} 398}
399 399
400void MultiauthConfig::writeConfig() 400void MultiauthConfig::writeConfig()
401{ 401{
402 Config* pcfg = new Config("Security"); 402 Config* pcfg = new Config("Security");
403 403
404 if (m_pluginsInstalled) 404 if (m_pluginsInstalled)
405 { 405 {
406 pcfg->setGroup( "Plugins" ); 406 pcfg->setGroup( "Plugins" );
407 QStringList exclude; 407 QStringList exclude;
408 QStringList include; 408 QStringList include;
409 QStringList allPlugins; 409 QStringList allPlugins;
410 410
411 QListViewItemIterator list_it( m_pluginListView ); 411 QListViewItemIterator list_it( m_pluginListView );
412 412
413 // this makes sure the names get saved in the order selected 413 // this makes sure the names get saved in the order selected
414 for ( ; list_it.current(); ++list_it ) { 414 for ( ; list_it.current(); ++list_it ) {
415 QMap <QString, QCheckListItem *>::Iterator it; 415 QMap <QString, QCheckListItem *>::Iterator it;
416 for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) { 416 for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) {
417 if ( list_it.current() == (*it) && !(*it)-> isOn () ) { 417 if ( list_it.current() == (*it) && !(*it)-> isOn () ) {
418 exclude << it.key(); 418 exclude << it.key();
419 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ 419 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){
420 include << it.key(); 420 include << it.key();
421 } 421 }
422 if ( list_it.current() == (*it) ) { 422 if ( list_it.current() == (*it) ) {
423 allPlugins << it.key(); 423 allPlugins << it.key();
424 } 424 }
425 } 425 }
@@ -444,117 +444,117 @@ void MultiauthConfig::writeConfig()
444 QString sn = m_syncWidget->syncnet->currentText(); 444 QString sn = m_syncWidget->syncnet->currentText();
445 parseNet(sn,auth_peer,auth_peer_bits); 445 parseNet(sn,auth_peer,auth_peer_bits);
446 446
447 //this is the *selected* (active) net range 447 //this is the *selected* (active) net range
448 pcfg->writeEntry("auth_peer",auth_peer); 448 pcfg->writeEntry("auth_peer",auth_peer);
449 pcfg->writeEntry("auth_peer_bits",auth_peer_bits); 449 pcfg->writeEntry("auth_peer_bits",auth_peer_bits);
450 450
451 //write back all other net ranges in *cleartext* 451 //write back all other net ranges in *cleartext*
452 for (int i=0; i<10; i++) { 452 for (int i=0; i<10; i++) {
453 QString target; 453 QString target;
454 target.sprintf("net%d", i); 454 target.sprintf("net%d", i);
455 if ( i < m_syncWidget->syncnet->count() ) 455 if ( i < m_syncWidget->syncnet->count() )
456 pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); 456 pcfg->writeEntry(target, m_syncWidget->syncnet->text(i));
457 else // no more entry in the syncnet list -> we clear the line 457 else // no more entry in the syncnet list -> we clear the line
458 pcfg->writeEntry(target, ""); 458 pcfg->writeEntry(target, "");
459 } 459 }
460 460
461#ifdef ODP 461#ifdef ODP
462#error "Use 0,1,2 and use Launcher" 462#error "Use 0,1,2 and use Launcher"
463#endif 463#endif
464 /* keep the old code so we don't use currentItem directly */ 464 /* keep the old code so we don't use currentItem directly */
465 int value = 0x02; 465 int value = 0x02;
466 switch( m_syncWidget->syncModeCombo->currentItem() ) { 466 switch( m_syncWidget->syncModeCombo->currentItem() ) {
467 case 0: 467 case 0:
468 value = 0x01; 468 value = 0x01;
469 break; 469 break;
470 case 1: 470 case 1:
471 value = 0x02; 471 value = 0x02;
472 break; 472 break;
473 case 2: 473 case 2:
474 value = 0x04; 474 value = 0x04;
475 break; 475 break;
476 } 476 }
477 pcfg->setGroup("SyncMode"); 477 pcfg->setGroup("SyncMode");
478 pcfg->writeEntry( "Mode", value ); 478 pcfg->writeEntry( "Mode", value );
479 479
480 /* 480 /*
481 pcfg->setGroup("Remote"); 481 pcfg->setGroup("Remote");
482 if ( telnetAvailable() ) 482 if ( telnetAvailable() )
483 pcfg->writeEntry("allow_telnet",telnet->isChecked()); 483 pcfg->writeEntry("allow_telnet",telnet->isChecked());
484 if ( sshAvailable() ) 484 if ( sshAvailable() )
485 pcfg->writeEntry("allow_ssh",ssh->isChecked()); 485 pcfg->writeEntry("allow_ssh",ssh->isChecked());
486 // ### write ssh/telnet sys config files 486 // ### write ssh/telnet sys config files
487 */ 487 */
488 488
489 //release the Config handler 489 //release the Config handler
490 delete pcfg; 490 delete pcfg;
491 491
492 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 492 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
493 Config loginCfg(configFile,Config::File); 493 Config loginCfg(configFile,Config::File);
494 loginCfg.setGroup("General"); 494 loginCfg.setGroup("General");
495 495
496 if (autoLogin) { 496 if (autoLogin) {
497 loginCfg.writeEntry("AutoLogin",autoLoginName); 497 loginCfg.writeEntry("AutoLogin",autoLoginName);
498 } else { 498 } else {
499 loginCfg.removeEntry("AutoLogin"); 499 loginCfg.removeEntry("AutoLogin");
500 } 500 }
501 501
502} 502}
503 503
504/// slot used to record the fact plugins order has been modified 504/// slot used to record the fact plugins order has been modified
505void MultiauthConfig::pluginsChanged() { 505void MultiauthConfig::pluginsChanged() {
506 m_plugins_changed = true; 506 m_plugins_changed = true;
507} 507}
508 508
509/// loads each multiauth plugin 509/// loads each multiauth plugin
510void MultiauthConfig::loadPlugins() { 510void MultiauthConfig::loadPlugins() {
511 511
512 QString path = QPEApplication::qpeDir() + "/plugins/security"; 512 QString path = QPEApplication::qpeDir() + "plugins/security";
513 QDir dir( path, "lib*.so" ); 513 QDir dir( path, "lib*.so" );
514 514
515 QStringList list = dir.entryList(); 515 QStringList list = dir.entryList();
516 QStringList::Iterator it; 516 QStringList::Iterator it;
517 517
518 // temporary list used to sort plugins 518 // temporary list used to sort plugins
519 QMap<QString, MultiauthPlugin> sortList; 519 QMap<QString, MultiauthPlugin> sortList;
520 520
521 for ( it = list.begin(); it != list.end(); ++it ) { 521 for ( it = list.begin(); it != list.end(); ++it ) {
522 QInterfacePtr<MultiauthPluginInterface> iface; 522 QInterfacePtr<MultiauthPluginInterface> iface;
523 QLibrary *lib = new QLibrary( path + "/" + *it ); 523 QLibrary *lib = new QLibrary( path + "/" + *it );
524 QString libPath(path + "/" + *it); 524 QString libPath(path + "/" + *it);
525 525
526 if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 526 if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
527 MultiauthPlugin plugin; 527 MultiauthPlugin plugin;
528 plugin.library = lib; 528 plugin.library = lib;
529 plugin.iface = iface; 529 plugin.iface = iface;
530 plugin.name = QString(*it); 530 plugin.name = QString(*it);
531 531
532 // find out if plugins should be launched 532 // find out if plugins should be launched
533 if ( m_excludePlugins.grep( *it ).isEmpty() ) { 533 if ( m_excludePlugins.grep( *it ).isEmpty() ) {
534 plugin.active = true; 534 plugin.active = true;
535 } else { 535 } else {
536 plugin.active = false; 536 plugin.active = false;
537 } 537 }
538 538
539 plugin.pluginObject = plugin.iface->plugin(); 539 plugin.pluginObject = plugin.iface->plugin();
540 540
541 // "prebuffer" it in one more list, to get the sorting done 541 // "prebuffer" it in one more list, to get the sorting done
542 sortList.insert( plugin.name, plugin ); 542 sortList.insert( plugin.name, plugin );
543 543
544 // on first start the list is off course empty 544 // on first start the list is off course empty
545 if ( m_allPlugins.isEmpty() ) { 545 if ( m_allPlugins.isEmpty() ) {
546 pluginList.append( plugin ); 546 pluginList.append( plugin );
547 } 547 }
548 // if plugin is not yet in the list, add it to the layout too 548 // if plugin is not yet in the list, add it to the layout too
549 else if ( !m_allPlugins.contains( plugin.name ) ) { 549 else if ( !m_allPlugins.contains( plugin.name ) ) {
550 pluginList.append( plugin ); 550 pluginList.append( plugin );
551 } 551 }
552 552
553 } else { 553 } else {
554 delete lib; 554 delete lib;
555 } 555 }
556 556
557 } // end for 557 } // end for
558 558
559 // put m_allPlugins tempPlugin objects into pluginList 559 // put m_allPlugins tempPlugin objects into pluginList
560 if ( !m_allPlugins.isEmpty() ) { 560 if ( !m_allPlugins.isEmpty() ) {