diff options
Diffstat (limited to 'kcontrol/tdm')
-rw-r--r-- | kcontrol/tdm/AUTHORS | 6 | ||||
-rw-r--r-- | kcontrol/tdm/CMakeLists.txt | 40 | ||||
-rw-r--r-- | kcontrol/tdm/ChangeLog | 16 | ||||
-rw-r--r-- | kcontrol/tdm/Makefile.am | 19 | ||||
-rw-r--r-- | kcontrol/tdm/background.cpp | 111 | ||||
-rw-r--r-- | kcontrol/tdm/background.h | 50 | ||||
-rw-r--r-- | kcontrol/tdm/kbackedcombobox.cpp | 40 | ||||
-rw-r--r-- | kcontrol/tdm/kbackedcombobox.h | 38 | ||||
-rw-r--r-- | kcontrol/tdm/main.cpp | 342 | ||||
-rw-r--r-- | kcontrol/tdm/main.h | 83 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-appear.cpp | 554 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-appear.h | 97 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-conv.cpp | 362 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-conv.h | 84 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-font.cpp | 134 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-font.h | 57 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-shut.cpp | 227 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-shut.h | 64 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-users.cpp | 500 | ||||
-rw-r--r-- | kcontrol/tdm/tdm-users.h | 106 | ||||
-rw-r--r-- | kcontrol/tdm/tdm.desktop | 243 |
21 files changed, 3173 insertions, 0 deletions
diff --git a/kcontrol/tdm/AUTHORS b/kcontrol/tdm/AUTHORS new file mode 100644 index 000000000..3b7927243 --- /dev/null +++ b/kcontrol/tdm/AUTHORS @@ -0,0 +1,6 @@ +TDM - The KDE Display Manager - written by Steffen Hansen <hansen@kde.org> + +The KDE Display Manager Configuration module - +written by Thomas Tanghus <tanghus@earthling.net> + +Currently maintend by Oswald Buddenhagen <ossi@kde.org> diff --git a/kcontrol/tdm/CMakeLists.txt b/kcontrol/tdm/CMakeLists.txt new file mode 100644 index 000000000..004282250 --- /dev/null +++ b/kcontrol/tdm/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kcontrol/background + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +##### other data ################################ + +install( FILES tdm.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### kcm_tdm (module) ########################## + +set_source_files_properties( background.cpp PROPERTIES COMPILE_FLAGS -DKDE_CONFDIR=\\"${TDE_CONFIG_DIR}\\" ) +set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS -DKDE_CONFDIR=\\"${TDE_CONFIG_DIR}\\" ) + +tde_add_kpart( kcm_tdm AUTOMOC + SOURCES + background.cpp tdm-appear.cpp tdm-font.cpp tdm-shut.cpp + tdm-users.cpp tdm-conv.cpp main.cpp kbackedcombobox.cpp + LINK kcmbgnd-static bgnd-static knewstuff-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/kcontrol/tdm/ChangeLog b/kcontrol/tdm/ChangeLog new file mode 100644 index 000000000..d49bb2548 --- /dev/null +++ b/kcontrol/tdm/ChangeLog @@ -0,0 +1,16 @@ +2002-07-11 Oswald Buddenhagen <ossi@kde.org> + * Reworked "Users" and "Convenience" tabs + +2001-01-15 Oswald Buddenhagen <ossi@kde.org> + * Several new fields in different tabs for some new features + +2000-12-06 Oswald Buddenhagen <ossi@kde.org> + * New "Convenience" tab supporting the new automation features + * Some changes to the "Users" tab + * Few bug fixes + +1998-04-28 Thomas Tanghus <tanghus@earthling.net> + * Improved geometry management. + +1998-05-14 Thomas Tanghus <tanghus@earthling.net> + * Fixed bug with "ShutDownButton=...". diff --git a/kcontrol/tdm/Makefile.am b/kcontrol/tdm/Makefile.am new file mode 100644 index 000000000..e6193d7df --- /dev/null +++ b/kcontrol/tdm/Makefile.am @@ -0,0 +1,19 @@ +kde_module_LTLIBRARIES = kcm_tdm.la + +# _don't_ add a theme configurator!! +kcm_tdm_la_SOURCES = background.cpp tdm-appear.cpp tdm-font.cpp tdm-shut.cpp \ + tdm-users.cpp tdm-conv.cpp main.cpp kbackedcombobox.cpp + +kcm_tdm_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -module -avoid-version -no-undefined +kcm_tdm_la_LIBADD = $(top_builddir)/kcontrol/background/libkcmbgnd.la $(top_builddir)/kcontrol/background/libbgnd.la $(LIB_KIO) $(LIB_KNEWSTUFF) + +AM_CPPFLAGS= -I$(top_builddir)/kcontrol/background \ + -I$(top_srcdir)/kcontrol/background \ + -I$(top_srcdir)/kdesktop $(all_includes) + +METASOURCES = AUTO + +messages: + $(XGETTEXT) $(kcm_tdm_la_SOURCES) -o $(podir)/tdmconfig.pot + +xdg_apps_DATA = tdm.desktop diff --git a/kcontrol/tdm/background.cpp b/kcontrol/tdm/background.cpp new file mode 100644 index 000000000..4078bd393 --- /dev/null +++ b/kcontrol/tdm/background.cpp @@ -0,0 +1,111 @@ +/* vi: ts=8 sts=4 sw=4 + * + * This file is part of the KDE project, module kcmdisplay. + * Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl> + * + * Modified 2000.07.14 by Brad Hughes <bhughes@trolltech.com> + * Improve layout and consistency with KDesktop's background selection + * + * Based on old backgnd.cpp: + * + * Copyright (c) Martin R. Jones 1996 + * Converted to a kcc module by Matthias Hoelzer 1997 + * Gradient backgrounds by Mark Donohoe 1997 + * Pattern backgrounds by Stephan Kulow 1998 + * Randomizing & dnd & new display modes by Matej Koss 1998 + * + * You can Freely distribute this program under the GNU General Public + * License. See the file "COPYING" for the exact licensing terms. + */ + +#include <config.h> + +#include <unistd.h> +#include <sys/types.h> + +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> + +#include <kdebug.h> +#include <klocale.h> +#include <dcopclient.h> +#include "../background/bgsettings.h" +#include "../background/bgdialog.h" +#include "background.h" +#include <tqcheckbox.h> +#include <ksimpleconfig.h> +#include <kdialog.h> + +extern KSimpleConfig *config; + +KBackground::KBackground(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ + + // Enabling checkbox + m_pCBEnable = new TQCheckBox( i18n("E&nable background"), this ); + TQWhatsThis::add( m_pCBEnable, + i18n("If this is checked, TDM will use the settings below for the background." + " If it is disabled, you have to look after the background yourself." + " This is done by running some program (possibly xsetroot) in the script" + " specified in the Setup= option in tdmrc (usually Xsetup).") ); + config->setGroup( "X-*-Greeter" ); + m_simpleConf=new KSimpleConfig(config->readEntry( "BackgroundCfg",KDE_CONFDIR "/tdm/backgroundrc" ) ); + m_background = new BGDialog( this, m_simpleConf, false ); + + connect(m_background, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + + // Top layout + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint() ); + top->addWidget(m_pCBEnable); + top->addWidget(m_background); + top->addStretch(); + connect( m_pCBEnable, TQT_SIGNAL(toggled( bool )), TQT_SLOT(slotEnableChanged()) ); +} + +KBackground::~KBackground() +{ + delete m_simpleConf; +} + +void KBackground::slotEnableChanged() +{ + bool en = m_pCBEnable->isChecked(); + m_background->setEnabled( en ); + emit changed ( true ); +} + +void KBackground::makeReadOnly() +{ + m_pCBEnable->setEnabled(false); + m_background->makeReadOnly(); +} + +void KBackground::load() +{ + m_pCBEnable->setChecked( config->readBoolEntry( "UseBackground", true ) ); + m_background->load(false); + slotEnableChanged(); + emit changed(false); +} + + +void KBackground::save() +{ + kdDebug() << "Saving stuff..." << endl; + config->writeEntry( "UseBackground", m_pCBEnable->isChecked() ); + m_background->save(); + emit changed(false); +} + + +void KBackground::defaults() +{ + m_pCBEnable->setChecked( true ); + slotEnableChanged(); + m_background->defaults(); + emit changed(true); +} + +#include "background.moc" diff --git a/kcontrol/tdm/background.h b/kcontrol/tdm/background.h new file mode 100644 index 000000000..2e5182b16 --- /dev/null +++ b/kcontrol/tdm/background.h @@ -0,0 +1,50 @@ +/* vi: ts=8 sts=4 sw=4 + * + * This file is part of the KDE project, module kcmdisplay. + * Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl> + * + * You can Freely distribute this program under the GNU General Public + * License. See the file "COPYING" for the exact licensing terms. + */ + +#ifndef __Bgnd_h_Included__ +#define __Bgnd_h_Included__ + +#include <tqobject.h> +#include <tqwidget.h> + + +class KSimpleConfig; +class BGDialog; +class KGlobalBackgroundSettings; +class TQCheckBox; +class TQLabel; + +class KBackground: public TQWidget +{ + Q_OBJECT +public: + KBackground(TQWidget *parent=0, const char *name=0); + ~KBackground(); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); +signals: + void changed(bool); + +private slots: + void slotEnableChanged(); +private: + void init(); + void apply(); + + TQCheckBox *m_pCBEnable; + TQLabel *m_pMLabel; + KSimpleConfig *m_simpleConf; + BGDialog *m_background; +}; + + +#endif // __Bgnd_h_Included__ diff --git a/kcontrol/tdm/kbackedcombobox.cpp b/kcontrol/tdm/kbackedcombobox.cpp new file mode 100644 index 000000000..1ba598e49 --- /dev/null +++ b/kcontrol/tdm/kbackedcombobox.cpp @@ -0,0 +1,40 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 2004-2005 Oswald Buddenhagen <ossi@kde.org> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kbackedcombobox.h" + +void KBackedComboBox::insertItem( const TQString &id, const TQString &name ) +{ + id2name[id] = name; + name2id[name] = id; + KComboBox::insertItem( name ); +} + +void KBackedComboBox::setCurrentId( const TQString &id ) +{ + if (id2name.contains( id )) + setCurrentItem( id2name[id] ); + else + setCurrentItem( 0 ); +} + +const TQString &KBackedComboBox::currentId() const +{ + return name2id[currentText()]; +} diff --git a/kcontrol/tdm/kbackedcombobox.h b/kcontrol/tdm/kbackedcombobox.h new file mode 100644 index 000000000..1ec1d2a72 --- /dev/null +++ b/kcontrol/tdm/kbackedcombobox.h @@ -0,0 +1,38 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 2004-2005 Oswald Buddenhagen <ossi@kde.org> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KBACKEDCOMBOBOX_H +#define KBACKEDCOMBOBOX_H + +#include <kcombobox.h> + +class KBackedComboBox : public KComboBox { + +public: + KBackedComboBox( TQWidget *parent ) : KComboBox( false, parent ) {} + void insertItem( const TQString &id, const TQString &name ); + void setCurrentId( const TQString &id ); + const TQString ¤tId() const; + +private: + TQMap<TQString,TQString> id2name, name2id; + +}; + +#endif // KBACKEDCOMBOBOX_H diff --git a/kcontrol/tdm/main.cpp b/kcontrol/tdm/main.cpp new file mode 100644 index 000000000..de4ea0fc7 --- /dev/null +++ b/kcontrol/tdm/main.cpp @@ -0,0 +1,342 @@ +/* + * main.cpp + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <config.h> + +#include <tqlayout.h> + +#include <kaboutdata.h> +#include <kgenericfactory.h> +#include <kimageio.h> +#include <kmessagebox.h> +#include <kurldrag.h> + +#include "tdm-appear.h" +#include "tdm-font.h" +#include "tdm-users.h" +#include "tdm-shut.h" +#include "tdm-conv.h" + +#include "main.h" +#include "background.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <locale.h> +#include <pwd.h> +#include <grp.h> + +typedef KGenericFactory<TDModule, TQWidget> TDMFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_tdm, TDMFactory("tdmconfig") ) + +KURL *decodeImgDrop(TQDropEvent *e, TQWidget *wdg) +{ + KURL::List uris; + + if (KURLDrag::decode(e, uris) && (uris.count() > 0)) { + KURL *url = new KURL(uris.first()); + + KImageIO::registerFormats(); + if( KImageIO::canRead(KImageIO::type(url->fileName())) ) + return url; + + TQStringList qs = TQStringList::split('\n', KImageIO::pattern()); + qs.remove(qs.begin()); + + TQString msg = i18n( "%1 " + "does not appear to be an image file.\n" + "Please use files with these extensions:\n" + "%2") + .arg(url->fileName()) + .arg(qs.join("\n")); + KMessageBox::sorry( wdg, msg); + delete url; + } + return 0; +} + +KSimpleConfig *config; + +TDModule::TDModule(TQWidget *parent, const char *name, const TQStringList &) + : KCModule(TDMFactory::instance(), parent, name) + , minshowuid(0) + , maxshowuid(0) + , updateOK(false) +{ + KAboutData *about = + new KAboutData(I18N_NOOP("kcmtdm"), I18N_NOOP("KDE Login Manager Config Module"), + 0, 0, KAboutData::License_GPL, + I18N_NOOP("(c) 1996 - 2005 The TDM Authors")); + + about->addAuthor("Thomas Tanghus", I18N_NOOP("Original author"), "tanghus@earthling.net"); + about->addAuthor("Steffen Hansen", 0, "hansen@kde.org"); + about->addAuthor("Oswald Buddenhagen", I18N_NOOP("Current maintainer"), "ossi@kde.org"); + + setQuickHelp( i18n( "<h1>Login Manager</h1> In this module you can configure the " + "various aspects of the KDE Login Manager. This includes " + "the look and feel as well as the users that can be " + "selected for login. Note that you can only make changes " + "if you run the module with superuser rights. If you have not started the KDE " + "Control Center with superuser rights (which is absolutely the right thing to " + "do, by the way), click on the <em>Modify</em> button to acquire " + "superuser rights. You will be asked for the superuser password." + "<h2>Appearance</h2> On this tab page, you can configure how " + "the Login Manager should look, which language it should use, and which " + "GUI style it should use. The language settings made here have no influence on " + "the user's language settings." + "<h2>Font</h2>Here you can choose the fonts that the Login Manager should use " + "for various purposes like greetings and user names. " + "<h2>Background</h2>If you want to set a special background for the login " + "screen, this is where to do it." + "<h2>Shutdown</h2> Here you can specify who is allowed to shutdown/reboot the machine " + "and whether a boot manager should be used." + "<h2>Users</h2>On this tab page, you can select which users the Login Manager " + "will offer you for logging in." + "<h2>Convenience</h2> Here you can specify a user to be logged in automatically, " + "users not needing to provide a password to log in, and other convenience features.<br>" + "Note, that these settings are security holes by their nature, so use them very carefully.")); + + setAboutData( about ); + + setlocale( LC_COLLATE, "C" ); + + KGlobal::locale()->insertCatalogue("kcmbackground"); + + TQStringList sl; + TQMap<gid_t,TQStringList> tgmap; + TQMap<gid_t,TQStringList>::Iterator tgmapi; + TQMap<gid_t,TQStringList>::ConstIterator tgmapci; + TQMap<TQString, QPair<int,TQStringList> >::Iterator umapi; + + struct passwd *ps; + for (setpwent(); (ps = getpwent()); ) { + TQString un( TQFile::decodeName( ps->pw_name ) ); + if (usermap.find( un ) == usermap.end()) { + usermap.insert( un, QPair<int,TQStringList>( ps->pw_uid, sl ) ); + if ((tgmapi = tgmap.find( ps->pw_gid )) != tgmap.end()) + (*tgmapi).append( un ); + else + tgmap[ps->pw_gid] = un; + } + } + endpwent(); + + struct group *grp; + for (setgrent(); (grp = getgrent()); ) { + TQString gn( TQFile::decodeName( grp->gr_name ) ); + bool delme = false; + if ((tgmapi = tgmap.find( grp->gr_gid )) != tgmap.end()) { + if ((*tgmapi).count() == 1 && (*tgmapi).first() == gn) + delme = true; + else + for (TQStringList::ConstIterator it = (*tgmapi).begin(); + it != (*tgmapi).end(); ++it) + usermap[*it].second.append( gn ); + tgmap.remove( tgmapi ); + } + if (!*grp->gr_mem || + (delme && !grp->gr_mem[1] && gn == TQFile::decodeName( *grp->gr_mem ))) + continue; + do { + TQString un( TQFile::decodeName( *grp->gr_mem ) ); + if ((umapi = usermap.find( un )) != usermap.end()) { + if ((*umapi).second.find( gn ) == (*umapi).second.end()) + (*umapi).second.append( gn ); + } else + kdWarning() << "group '" << gn << "' contains unknown user '" << un << "'" << endl; + } while (*++grp->gr_mem); + } + endgrent(); + + for (tgmapci = tgmap.begin(); tgmapci != tgmap.end(); ++tgmapci) + kdWarning() << "user(s) '" << tgmapci.data().join(",") + << "' have unknown GID " << tgmapci.key() << endl; + + struct stat st; + if( stat( KDE_CONFDIR "/tdm/tdmdistrc" ,&st ) == 0) { + config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmdistrc" )); + } + else { + config = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/tdm/tdmrc" )); + } + + TQVBoxLayout *top = new TQVBoxLayout(this); + tab = new TQTabWidget(this); + + // ***** + // _don't_ add a theme configurator until the theming engine is _really_ done!! + // ***** + + appearance = new TDMAppearanceWidget(this); + tab->addTab(appearance, i18n("A&ppearance")); + connect(appearance, TQT_SIGNAL(changed(bool)), TQT_SIGNAL( changed(bool))); + + font = new TDMFontWidget(this); + tab->addTab(font, i18n("&Font")); + connect(font, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + + background = new KBackground(this); + tab->addTab(background, i18n("&Background")); + connect(background, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + + sessions = new TDMSessionsWidget(this); + tab->addTab(sessions, i18n("&Shutdown")); + connect(sessions, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + + users = new TDMUsersWidget(this, 0); + tab->addTab(users, i18n("&Users")); + connect(users, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + connect(users, TQT_SIGNAL(setMinMaxUID(int,int)), TQT_SLOT(slotMinMaxUID(int,int))); + connect(this, TQT_SIGNAL(addUsers(const TQMap<TQString,int> &)), users, TQT_SLOT(slotAddUsers(const TQMap<TQString,int> &))); + connect(this, TQT_SIGNAL(delUsers(const TQMap<TQString,int> &)), users, TQT_SLOT(slotDelUsers(const TQMap<TQString,int> &))); + connect(this, TQT_SIGNAL(clearUsers()), users, TQT_SLOT(slotClearUsers())); + + convenience = new TDMConvenienceWidget(this, 0); + tab->addTab(convenience, i18n("Con&venience")); + connect(convenience, TQT_SIGNAL(changed(bool)), TQT_SIGNAL(changed(bool))); + connect(this, TQT_SIGNAL(addUsers(const TQMap<TQString,int> &)), convenience, TQT_SLOT(slotAddUsers(const TQMap<TQString,int> &))); + connect(this, TQT_SIGNAL(delUsers(const TQMap<TQString,int> &)), convenience, TQT_SLOT(slotDelUsers(const TQMap<TQString,int> &))); + connect(this, TQT_SIGNAL(clearUsers()), convenience, TQT_SLOT(slotClearUsers())); + + load(); + if (getuid() != 0 || !config->checkConfigFilesWritable( true )) { + appearance->makeReadOnly(); + font->makeReadOnly(); + background->makeReadOnly(); + users->makeReadOnly(); + sessions->makeReadOnly(); + convenience->makeReadOnly(); + } + top->addWidget(tab); +} + +TDModule::~TDModule() +{ + delete config; +} + +void TDModule::load() +{ + appearance->load(); + font->load(); + background->load(); + users->load(); + sessions->load(); + convenience->load(); + propagateUsers(); +} + + +void TDModule::save() +{ + appearance->save(); + font->save(); + background->save(); + users->save(); + sessions->save(); + convenience->save(); + config->sync(); +} + + +void TDModule::defaults() +{ + if ( getuid() == 0 ) + { + appearance->defaults(); + font->defaults(); + background->defaults(); + users->defaults(); + sessions->defaults(); + convenience->defaults(); + propagateUsers(); + } +} + +void TDModule::propagateUsers() +{ + groupmap.clear(); + emit clearUsers(); + TQMap<TQString,int> lusers; + TQMapConstIterator<TQString, QPair<int,TQStringList> > it; + TQStringList::ConstIterator jt; + TQMap<TQString,int>::Iterator gmapi; + for (it = usermap.begin(); it != usermap.end(); ++it) { + int uid = it.data().first; + if (!uid || (uid >= minshowuid && uid <= maxshowuid)) { + lusers[it.key()] = uid; + for (jt = it.data().second.begin(); jt != it.data().second.end(); ++jt) + if ((gmapi = groupmap.find( *jt )) == groupmap.end()) { + groupmap[*jt] = 1; + lusers['@' + *jt] = -uid; + } else + (*gmapi)++; + } + } + emit addUsers(lusers); + updateOK = true; +} + +void TDModule::slotMinMaxUID(int min, int max) +{ + if (updateOK) { + TQMap<TQString,int> alusers, dlusers; + TQMapConstIterator<TQString, QPair<int,TQStringList> > it; + TQStringList::ConstIterator jt; + TQMap<TQString,int>::Iterator gmapi; + for (it = usermap.begin(); it != usermap.end(); ++it) { + int uid = it.data().first; + if (!uid) continue; + if ((uid >= minshowuid && uid <= maxshowuid) && + !(uid >= min && uid <= max)) { + dlusers[it.key()] = uid; + for (jt = it.data().second.begin(); + jt != it.data().second.end(); ++jt) { + gmapi = groupmap.find( *jt ); + if (!--(*gmapi)) { + groupmap.remove( gmapi ); + dlusers['@' + *jt] = -uid; + } + } + } else + if ((uid >= min && uid <= max) && + !(uid >= minshowuid && uid <= maxshowuid)) { + alusers[it.key()] = uid; + for (jt = it.data().second.begin(); + jt != it.data().second.end(); ++jt) + if ((gmapi = groupmap.find( *jt )) == groupmap.end()) { + groupmap[*jt] = 1; + alusers['@' + *jt] = -uid; + } else + (*gmapi)++; + } + } + emit delUsers(dlusers); + emit addUsers(alusers); + } + minshowuid = min; + maxshowuid = max; +} + +#include "main.moc" diff --git a/kcontrol/tdm/main.h b/kcontrol/tdm/main.h new file mode 100644 index 000000000..d613f9c4e --- /dev/null +++ b/kcontrol/tdm/main.h @@ -0,0 +1,83 @@ +/* + * main.h + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __tdm_main_h +#define __tdm_main_h + +#include <tqtabwidget.h> +#include <tqmap.h> + +#include <kcmodule.h> + +class TDMAppearanceWidget; +class TDMFontWidget; +class TDMSessionsWidget; +class TDMUsersWidget; +class TDMConvenienceWidget; +class KBackground; + +class TDModule : public KCModule +{ + Q_OBJECT + +public: + + TDModule(TQWidget *parent, const char *name, const TQStringList &); + ~TDModule(); + + void load(); + void save(); + void defaults(); + +public slots: + + void slotMinMaxUID(int min, int max); + +signals: + + void clearUsers(); + void addUsers(const TQMap<TQString,int> &); + void delUsers(const TQMap<TQString,int> &); + +private: + + TQTabWidget *tab; + + TDMAppearanceWidget *appearance; + KBackground *background; + TDMFontWidget *font; + TDMSessionsWidget *sessions; + TDMUsersWidget *users; + TDMConvenienceWidget *convenience; + + TQMap<TQString, QPair<int,TQStringList> > usermap; + TQMap<TQString,int> groupmap; + int minshowuid, maxshowuid; + bool updateOK; + + void propagateUsers(); + +}; + +#endif + diff --git a/kcontrol/tdm/tdm-appear.cpp b/kcontrol/tdm/tdm-appear.cpp new file mode 100644 index 000000000..cdd5f2fc9 --- /dev/null +++ b/kcontrol/tdm/tdm-appear.cpp @@ -0,0 +1,554 @@ +/* + This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997-1998 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include <unistd.h> +#include <sys/types.h> + + +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqwhatsthis.h> +#include <tqvalidator.h> +#include <tqstylefactory.h> +#include <tqcheckbox.h> +#include <tqstyle.h> + +#include <klocale.h> +#include <klineedit.h> +#include <kimageio.h> +#include <kcombobox.h> +#include <kmessagebox.h> +#include <kstandarddirs.h> +#include <kio/netaccess.h> +#include <kiconloader.h> +#include <kurldrag.h> +#include <kimagefilepreview.h> + +#include "tdm-appear.h" +#include "kbackedcombobox.h" + +extern KSimpleConfig *config; + + +TDMAppearanceWidget::TDMAppearanceWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ + TQString wtstr; + + TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialog::marginHint(), + KDialog::spacingHint(), "vbox"); + TQGroupBox *group = new TQGroupBox(i18n("Appearance"), this); + vbox->addWidget(group); + + TQGridLayout *grid = new TQGridLayout( group, 5, 2, KDialog::marginHint(), + KDialog::spacingHint(), "grid"); + grid->addRowSpacing(0, group->fontMetrics().height()); + grid->setColStretch(0, 1); + grid->setColStretch(1, 1); + + TQHBoxLayout *hlay = new TQHBoxLayout( KDialog::spacingHint() ); + grid->addMultiCellLayout(hlay, 1,1, 0,1); + greetstr_lined = new KLineEdit(group); + TQLabel *label = new TQLabel(greetstr_lined, i18n("&Greeting:"), group); + hlay->addWidget(label); + connect(greetstr_lined, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + hlay->addWidget(greetstr_lined); + wtstr = i18n("This is the \"headline\" for TDM's login window. You may want to " + "put some nice greeting or information about the operating system here.<p>" + "TDM will substitute the following character pairs with the " + "respective contents:<br><ul>" + "<li>%d -> current display</li>" + "<li>%h -> host name, possibly with domain name</li>" + "<li>%n -> node name, most probably the host name without domain name</li>" + "<li>%s -> the operating system</li>" + "<li>%r -> the operating system's version</li>" + "<li>%m -> the machine (hardware) type</li>" + "<li>%% -> a single %</li>" + "</ul>" ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( greetstr_lined, wtstr ); + + + TQGridLayout *hglay = new TQGridLayout( 3, 4, KDialog::spacingHint() ); + grid->addMultiCellLayout(hglay, 2,4, 0,0); + + label = new TQLabel(i18n("Logo area:"), group); + hglay->addWidget(label, 0, 0); + TQVBoxLayout *vlay = new TQVBoxLayout( KDialog::spacingHint() ); + hglay->addMultiCellLayout(vlay, 0,0, 1,2); + noneRadio = new TQRadioButton( i18n("logo area", "&None"), group ); + clockRadio = new TQRadioButton( i18n("Show cloc&k"), group ); + logoRadio = new TQRadioButton( i18n("Sho&w logo"), group ); + TQButtonGroup *buttonGroup = new TQButtonGroup( group ); + label->setBuddy( buttonGroup ); + connect( buttonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotAreaRadioClicked(int)) ); + connect( buttonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(changed()) ); + buttonGroup->hide(); + buttonGroup->insert(noneRadio, KdmNone); + buttonGroup->insert(clockRadio, KdmClock); + buttonGroup->insert(logoRadio, KdmLogo); + vlay->addWidget(noneRadio); + vlay->addWidget(clockRadio); + vlay->addWidget(logoRadio); + wtstr = i18n("You can choose to display a custom logo (see below), a clock or no logo at all."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( noneRadio, wtstr ); + TQWhatsThis::add( logoRadio, wtstr ); + TQWhatsThis::add( clockRadio, wtstr ); + + logoLabel = new TQLabel(i18n("&Logo:"), group); + logobutton = new TQPushButton(group); + logoLabel->setBuddy( logobutton ); + logobutton->setAutoDefault(false); + logobutton->setAcceptDrops(true); + logobutton->installEventFilter(this); // for drag and drop + connect(logobutton, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogoButtonClicked())); + hglay->addWidget(logoLabel, 1, 0); + hglay->addWidget(logobutton, 1, 1, Qt::AlignCenter); + hglay->addRowSpacing(1, 110); + wtstr = i18n("Click here to choose an image that TDM will display. " + "You can also drag and drop an image onto this button " + "(e.g. from Konqueror)."); + TQWhatsThis::add( logoLabel, wtstr ); + TQWhatsThis::add( logobutton, wtstr ); + hglay->addRowSpacing( 2, KDialog::spacingHint()); + hglay->setColStretch( 3, 1); + + + hglay = new TQGridLayout( 2, 3, KDialog::spacingHint() ); + grid->addLayout(hglay, 2, 1); + + label = new TQLabel(i18n("Position:"), group); + hglay->addMultiCellWidget(label, 0,1, 0,0, Qt::AlignVCenter); + TQValidator *posValidator = new TQIntValidator(0, 100, TQT_TQOBJECT(group)); + TQLabel *xLineLabel = new TQLabel(i18n("&X:"), group); + hglay->addWidget(xLineLabel, 0, 1); + xLineEdit = new TQLineEdit (group); + connect( xLineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( changed() )); + hglay->addWidget(xLineEdit, 0, 2); + xLineLabel->setBuddy(xLineEdit); + xLineEdit->setValidator(posValidator); + TQLabel *yLineLabel = new TQLabel(i18n("&Y:"), group); + hglay->addWidget(yLineLabel, 1, 1); + yLineEdit = new TQLineEdit (group); + connect( yLineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( changed() )); + hglay->addWidget(yLineEdit, 1, 2); + yLineLabel->setBuddy(yLineEdit); + yLineEdit->setValidator(posValidator); + wtstr = i18n("Here you specify the relative coordinates (in percent) of the login dialog's <em>center</em>."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( xLineLabel, wtstr ); + TQWhatsThis::add( xLineEdit, wtstr ); + TQWhatsThis::add( yLineLabel, wtstr ); + TQWhatsThis::add( yLineEdit, wtstr ); + hglay->setColStretch( 3, 1); + hglay->setRowStretch( 2, 1); + + + hglay = new TQGridLayout( 2, 3, KDialog::spacingHint() ); + grid->addLayout(hglay, 3, 1); + hglay->setColStretch(3, 1); + + compositorcombo = new KBackedComboBox(group); + compositorcombo->insertItem( "", i18n("None") ); + compositorcombo->insertItem( "kompmgr", i18n("Trinity compositor") ); + label = new TQLabel(compositorcombo, i18n("Compositor:"), group); + connect(compositorcombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hglay->addWidget(label, 0, 0); + hglay->addWidget(compositorcombo, 0, 1); + wtstr = i18n("Choose a compositor to be used in TDM. Note that the chosen compositor will continue to run after login."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( compositorcombo, wtstr ); + + guicombo = new KBackedComboBox(group); + guicombo->insertItem( "", i18n("<default>") ); + loadGuiStyles(guicombo); + guicombo->listBox()->sort(); + label = new TQLabel(guicombo, i18n("GUI s&tyle:"), group); + connect(guicombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hglay->addWidget(label, 1, 0); + hglay->addWidget(guicombo, 1, 1); + wtstr = i18n("You can choose a basic GUI style here that will be " + "used by TDM only."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( guicombo, wtstr ); + + colcombo = new KBackedComboBox(group); + colcombo->insertItem( "", i18n("<default>") ); + loadColorSchemes(colcombo); + colcombo->listBox()->sort(); + label = new TQLabel(colcombo, i18n("&Color scheme:"), group); + connect(colcombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hglay->addWidget(label, 2, 0); + hglay->addWidget(colcombo, 2, 1); + wtstr = i18n("You can choose a basic Color Scheme here that will be " + "used by TDM only."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( colcombo, wtstr ); + + echocombo = new KBackedComboBox(group); + echocombo->insertItem("NoEcho", i18n("No Echo")); + echocombo->insertItem("OneStar", i18n("One Star")); + echocombo->insertItem("ThreeStars", i18n("Three Stars")); + label = new TQLabel(echocombo, i18n("Echo &mode:"), group); + connect(echocombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hglay->addWidget(label, 3, 0); + hglay->addWidget(echocombo, 3, 1); + wtstr = i18n("You can choose whether and how TDM shows your password when you type it."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( echocombo, wtstr ); + + + // The Language group box + group = new TQGroupBox(0, Qt::Vertical, i18n("Locale"), this); + vbox->addWidget(group); + + langcombo = new KLanguageButton(group); + loadLanguageList(langcombo); + connect(langcombo, TQT_SIGNAL(activated(const TQString &)), TQT_SLOT(changed())); + label = new TQLabel(langcombo, i18n("Languag&e:"), group); + TQGridLayout *hbox = new TQGridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); + hbox->setColStretch(1, 1); + hbox->addWidget(label, 1, 0); + hbox->addWidget(langcombo, 1, 1); + wtstr = i18n("Here you can choose the language used by TDM. This setting does not affect" + " a user's personal settings; that will take effect after login."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( langcombo, wtstr ); + + + // The SAK group box + group = new TQGroupBox(0, Qt::Vertical, i18n("Secure Attention Key"), this); + vbox->addWidget(group); + + sakbox = new TQCheckBox( i18n("Enable Secure Attention Key"), group ); + connect( sakbox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()) ); + TQGridLayout *hbox2 = new TQGridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); + hbox2->setColStretch(1, 1); + hbox2->addWidget(sakbox, 1, 0); + wtstr = i18n("Here you can enable or disable the Secure Attention Key [SAK] anti-spoofing measure."); + TQWhatsThis::add( sakbox, wtstr ); + + + vbox->addStretch(1); + +} + +void TDMAppearanceWidget::makeReadOnly() +{ + disconnect( logobutton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLogoButtonClicked()) ); + logobutton->setAcceptDrops(false); + greetstr_lined->setReadOnly(true); + noneRadio->setEnabled(false); + clockRadio->setEnabled(false); + logoRadio->setEnabled(false); + xLineEdit->setEnabled(false); + yLineEdit->setEnabled(false); + compositorcombo->setEnabled(false); + guicombo->setEnabled(false); + colcombo->setEnabled(false); + echocombo->setEnabled(false); + langcombo->setEnabled(false); + sakbox->setEnabled(false); +} + +void TDMAppearanceWidget::loadLanguageList(KLanguageButton *combo) +{ + TQStringList langlist = KGlobal::dirs()->findAllResources("locale", + TQString::fromLatin1("*/entry.desktop")); + langlist.sort(); + for ( TQStringList::ConstIterator it = langlist.begin(); + it != langlist.end(); ++it ) + { + TQString fpath = (*it).left((*it).length() - 14); + int index = fpath.findRev('/'); + TQString nid = fpath.mid(index + 1); + + KSimpleConfig entry(*it); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name")); + combo->insertLanguage(nid, name, TQString::fromLatin1("l10n/"), TQString::null); + } +} + +void TDMAppearanceWidget::loadColorSchemes(KBackedComboBox *combo) +{ + // XXX: Global + local schemes + TQStringList list = KGlobal::dirs()-> + findAllResources("data", "kdisplay/color-schemes/*.kcsrc", false, true); + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + { + KSimpleConfig config(*it, true); + config.setGroup("Color Scheme"); + + TQString str; + if (!(str = config.readEntry("Name")).isEmpty() || + !(str = config.readEntry("name")).isEmpty()) + { + TQString str2 = (*it).mid( (*it).findRev( '/' ) + 1 ); // strip off path + str2.setLength( str2.length() - 6 ); // strip off ".kcsrc + combo->insertItem( str2, str ); + } + } +} + +void TDMAppearanceWidget::loadGuiStyles(KBackedComboBox *combo) +{ + // XXX: Global + local schemes + TQStringList list = KGlobal::dirs()-> + findAllResources("data", "kstyle/themes/*.themerc", false, true); + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + { + KSimpleConfig config(*it, true); + + if (!(config.hasGroup("KDE") && config.hasGroup("Misc"))) + continue; + + config.setGroup("Desktop Entry"); + if (config.readBoolEntry("Hidden", false)) + continue; + + config.setGroup("KDE"); + TQString str2 = config.readEntry("WidgetStyle"); + if (str2.isNull()) + continue; + + config.setGroup("Misc"); + combo->insertItem( str2, config.readEntry("Name") ); + } +} + +bool TDMAppearanceWidget::setLogo(TQString logo) +{ + TQString flogo = logo.isEmpty() ? + locate("data", TQString::fromLatin1("tdm/pics/kdelogo.png") ) : + logo; + TQImage p(flogo); + if (p.isNull()) + return false; + if (p.width() > 100 || p.height() > 100) + p = p.smoothScale(100, 100, TQ_ScaleMin); + logobutton->setPixmap(p); + uint bd = style().pixelMetric( TQStyle::PM_ButtonMargin ) * 2; + logobutton->setFixedSize(p.width() + bd, p.height() + bd); + logopath = logo; + return true; +} + + +void TDMAppearanceWidget::slotLogoButtonClicked() +{ + KImageIO::registerFormats(); + KFileDialog dialogue(locate("data", TQString::fromLatin1("tdm/pics/")), + KImageIO::pattern( KImageIO::Reading ), + this, 0, true); + dialogue.setOperationMode( KFileDialog::Opening ); + dialogue.setMode( KFile::File | KFile::LocalOnly ); + + KImageFilePreview* imagePreview = new KImageFilePreview( &dialogue ); + dialogue.setPreviewWidget( imagePreview ); + if (dialogue.exec() == TQDialog::Accepted) { + if ( setLogo(dialogue.selectedFile()) ) { + changed(); + } + } +} + + +void TDMAppearanceWidget::slotAreaRadioClicked(int id) +{ + logobutton->setEnabled( id == KdmLogo ); + logoLabel->setEnabled( id == KdmLogo ); +} + + +bool TDMAppearanceWidget::eventFilter(TQObject *, TQEvent *e) +{ + if (e->type() == TQEvent::DragEnter) { + iconLoaderDragEnterEvent((TQDragEnterEvent *) e); + return true; + } + + if (e->type() == TQEvent::Drop) { + iconLoaderDropEvent((TQDropEvent *) e); + return true; + } + + return false; +} + +void TDMAppearanceWidget::iconLoaderDragEnterEvent(TQDragEnterEvent *e) +{ + e->accept(KURLDrag::canDecode(e)); +} + + +KURL *decodeImgDrop(TQDropEvent *e, TQWidget *wdg); + +void TDMAppearanceWidget::iconLoaderDropEvent(TQDropEvent *e) +{ + KURL pixurl; + bool istmp; + + KURL *url = decodeImgDrop(e, this); + if (url) { + + // we gotta check if it is a non-local file and make a tmp copy at the hd. + if(!url->isLocalFile()) { + pixurl.setPath(KGlobal::dirs()->resourceDirs("data").last() + + "tdm/pics/" + url->fileName()); + KIO::NetAccess::copy(*url, pixurl, parentWidget()); + istmp = true; + } else { + pixurl = *url; + istmp = false; + } + + // By now url should be "file:/..." + if (!setLogo(pixurl.path())) { + KIO::NetAccess::del(pixurl, parentWidget()); + TQString msg = i18n("There was an error loading the image:\n" + "%1\n" + "It will not be saved.") + .arg(pixurl.path()); + KMessageBox::sorry(this, msg); + } + + delete url; + } +} + + +void TDMAppearanceWidget::save() +{ + config->setGroup("X-*-Greeter"); + + config->writeEntry("GreetString", greetstr_lined->text()); + + config->writeEntry("LogoArea", noneRadio->isChecked() ? "None" : + logoRadio->isChecked() ? "Logo" : "Clock" ); + + config->writeEntry("LogoPixmap", KGlobal::iconLoader()->iconPath(logopath, KIcon::Desktop, true)); + + config->writeEntry("Compositor", compositorcombo->currentId()); + + config->writeEntry("GUIStyle", guicombo->currentId()); + + config->writeEntry("ColorScheme", colcombo->currentId()); + + config->writeEntry("EchoMode", echocombo->currentId()); + + config->writeEntry("GreeterPos", xLineEdit->text() + ',' + yLineEdit->text()); + + config->writeEntry("Language", langcombo->current()); + + config->writeEntry("UseSAK", sakbox->isChecked()); +} + + +void TDMAppearanceWidget::load() +{ + config->setGroup("X-*-Greeter"); + + // Read the greeting string + greetstr_lined->setText(config->readEntry("GreetString", i18n("Welcome to %n"))); + + // Regular logo or clock + TQString logoArea = config->readEntry("LogoArea", "Logo" ); + if (logoArea == "Clock") { + clockRadio->setChecked(true); + slotAreaRadioClicked(KdmClock); + } else if (logoArea == "Logo") { + logoRadio->setChecked(true); + slotAreaRadioClicked(KdmLogo); + } else { + noneRadio->setChecked(true); + slotAreaRadioClicked(KdmNone); + } + + // See if we use alternate logo + setLogo(config->readEntry("LogoPixmap")); + + // Check the current compositor type + compositorcombo->setCurrentId(config->readEntry("Compositor")); + + // Check the GUI type + guicombo->setCurrentId(config->readEntry("GUIStyle")); + + // Check the Color Scheme + colcombo->setCurrentId(config->readEntry("ColorScheme")); + + // Check the echo mode + echocombo->setCurrentId(config->readEntry("EchoMode", "OneStar")); + + TQStringList sl = config->readListEntry( "GreeterPos" ); + if (sl.count() != 2) { + xLineEdit->setText( "50" ); + yLineEdit->setText( "50" ); + } else { + xLineEdit->setText( sl.first() ); + yLineEdit->setText( sl.last() ); + } + + // get the language + langcombo->setCurrentItem(config->readEntry("Language", "C")); + + // See if the SAK is enabled + sakbox->setChecked(config->readBoolEntry("UseSAK", true)); +} + + +void TDMAppearanceWidget::defaults() +{ + greetstr_lined->setText( i18n("Welcome to %n") ); + logoRadio->setChecked( true ); + slotAreaRadioClicked( KdmLogo ); + setLogo( "" ); + compositorcombo->setCurrentId( "" ); + guicombo->setCurrentId( "" ); + colcombo->setCurrentId( "" ); + echocombo->setCurrentItem( "OneStar" ); + + xLineEdit->setText( "50" ); + yLineEdit->setText( "50" ); + + langcombo->setCurrentItem( "en_US" ); +} + +TQString TDMAppearanceWidget::quickHelp() const +{ + return i18n("<h1>TDM - Appearance</h1> Here you can configure the basic appearance" + " of the TDM login manager, i.e. a greeting string, an icon etc.<p>" + " For further refinement of TDM's appearance, see the \"Font\" and \"Background\" " + " tabs."); +} + + +void TDMAppearanceWidget::changed() +{ + emit changed(true); +} + +#include "tdm-appear.moc" diff --git a/kcontrol/tdm/tdm-appear.h b/kcontrol/tdm/tdm-appear.h new file mode 100644 index 000000000..0d4047e10 --- /dev/null +++ b/kcontrol/tdm/tdm-appear.h @@ -0,0 +1,97 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef __TDMAPPEAR_H__ +#define __TDMAPPEAR_H__ + + +#include <tqdir.h> +#include <tqimage.h> +#include <tqfileinfo.h> +#include <tqpushbutton.h> + +#include <kcolorbutton.h> +#include <kurl.h> +#include <kfiledialog.h> + + +#include "klanguagebutton.h" + +class TQComboBox; +class KBackedComboBox; +class TQLabel; +class TQRadioButton; +class TQLineEdit; +class KLineEdit; + + +class TDMAppearanceWidget : public TQWidget +{ + Q_OBJECT + +public: + TDMAppearanceWidget(TQWidget *parent, const char *name=0); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); + TQString quickHelp() const; + + void loadColorSchemes(KBackedComboBox *combo); + void loadGuiStyles(KBackedComboBox *combo); + void loadLanguageList(KLanguageButton *combo); + + bool eventFilter(TQObject *, TQEvent *); + +signals: + void changed( bool state ); + +protected: + void iconLoaderDragEnterEvent(TQDragEnterEvent *event); + void iconLoaderDropEvent(TQDropEvent *event); + bool setLogo(TQString logo); + +private slots: + void slotAreaRadioClicked(int id); + void slotLogoButtonClicked(); + void changed(); + +private: + enum { KdmNone, KdmClock, KdmLogo }; + TQLabel *logoLabel; + TQPushButton *logobutton; + KLineEdit *greetstr_lined; + TQString logopath; + TQRadioButton *noneRadio; + TQRadioButton *clockRadio; + TQRadioButton *logoRadio; + TQLineEdit *xLineEdit; + TQLineEdit *yLineEdit; + KBackedComboBox *compositorcombo; + KBackedComboBox *guicombo; + KBackedComboBox *colcombo; + KBackedComboBox *echocombo; + KLanguageButton *langcombo; + TQCheckBox *sakbox; + +}; + +#endif diff --git a/kcontrol/tdm/tdm-conv.cpp b/kcontrol/tdm/tdm-conv.cpp new file mode 100644 index 000000000..64b8b9727 --- /dev/null +++ b/kcontrol/tdm/tdm-conv.cpp @@ -0,0 +1,362 @@ +/* This file is part of the KDE Display Manager Configuration package + + Copyright (C) 2000 Oswald Buddenhagen <ossi@kde.org> + Based on several other files. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <unistd.h> +#include <sys/types.h> + + +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqhgroupbox.h> +#include <tqvgroupbox.h> +#include <tqvbuttongroup.h> +#include <tqwhatsthis.h> +#include <tqheader.h> + +#include <kdialog.h> +#include <ksimpleconfig.h> +#include <klocale.h> + +#include "tdm-conv.h" + +extern KSimpleConfig *config; + +TDMConvenienceWidget::TDMConvenienceWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ + TQString wtstr; + + TQLabel *paranoia = new TQLabel( i18n("<qt><center><font color=red><big><b>Attention!<br>Read help!</b></big></font></center></qt>"), this ); + + TQSizePolicy vpref( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); + + alGroup = new TQVGroupBox( i18n("Enable Au&to-Login"), this ); + alGroup->setCheckable( true ); + alGroup->setSizePolicy( vpref ); + + TQWhatsThis::add( alGroup, i18n("Turn on the auto-login feature." + " This applies only to TDM's graphical login." + " Think twice before enabling this!") ); + connect(alGroup, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + + TQWidget *hlpw1 = new TQWidget( alGroup ); + userlb = new KComboBox( hlpw1 ); + u_label = new TQLabel( userlb, i18n("Use&r:"), hlpw1 ); + TQGridLayout *hlpl1 = new TQGridLayout(hlpw1, 2, 2, 0, KDialog::spacingHint()); + hlpl1->setColStretch(2, 1); + hlpl1->addWidget(u_label, 0, 0); + hlpl1->addWidget(userlb, 0, 1); + connect(userlb, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotChanged())); + wtstr = i18n("Select the user to be logged in automatically."); + TQWhatsThis::add( u_label, wtstr ); + TQWhatsThis::add( userlb, wtstr ); + delaysb = new TQSpinBox( 0, 3600, 5, hlpw1 ); + delaysb->setSpecialValueText( i18n("delay", "none") ); + delaysb->setSuffix( i18n("seconds", " s") ); + d_label = new TQLabel( delaysb, i18n("D&elay:"), hlpw1 ); + hlpl1->addWidget(d_label, 1, 0); + hlpl1->addWidget(delaysb, 1, 1); + connect(delaysb, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChanged())); + wtstr = i18n("The delay (in seconds) before the automatic login kicks in. " + "This feature is also known as \"timed login\"."); + TQWhatsThis::add( d_label, wtstr ); + TQWhatsThis::add( delaysb, wtstr ); + againcb = new TQCheckBox( i18n("P&ersistent"), alGroup ); + connect( againcb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged()) ); + TQWhatsThis::add( againcb, i18n("Normally, automatic login is performed only " + "when TDM starts up. If this is checked, automatic login will kick in " + "after finishing a session as well.") ); + autoLockCheck = new TQCheckBox( i18n("Loc&k session"), alGroup ); + connect( autoLockCheck, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged()) ); + TQWhatsThis::add( autoLockCheck, i18n("If checked, the automatically started session " + "will be locked immediately (provided it is a KDE session). This can " + "be used to obtain a super-fast login restricted to one user.") ); + + + puGroup = new TQVButtonGroup(i18n("Preselect User"), this ); + puGroup->setSizePolicy( vpref ); + + connect(puGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotPresChanged())); + connect(puGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotChanged())); + npRadio = new TQRadioButton(i18n("preselected user", "&None"), puGroup); + ppRadio = new TQRadioButton(i18n("Prev&ious"), puGroup); + TQWhatsThis::add( ppRadio, i18n("Preselect the user that logged in previously. " + "Use this if this computer is usually used several consecutive times by one user.") ); + spRadio = new TQRadioButton(i18n("Specif&y"), puGroup); + TQWhatsThis::add( spRadio, i18n("Preselect the user specified in the combo box below. " + "Use this if this computer is predominantly used by a certain user.") ); + TQWidget *hlpw = new TQWidget(puGroup); + puserlb = new KComboBox(true, hlpw); + pu_label = new TQLabel(puserlb, i18n("Us&er:"), hlpw); + connect(puserlb, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotChanged())); + wtstr = i18n("Select the user to be preselected for login. " + "This box is editable, so you can specify an arbitrary non-existent " + "user to mislead possible attackers."); + TQWhatsThis::add( pu_label, wtstr ); + TQWhatsThis::add( puserlb, wtstr ); + TQBoxLayout *hlpl = new TQHBoxLayout(hlpw, 0, KDialog::spacingHint()); + hlpl->addWidget(pu_label); + hlpl->addWidget(puserlb); + hlpl->addStretch( 1 ); + cbjumppw = new TQCheckBox(i18n("Focus pass&word"), puGroup); + TQWhatsThis::add( cbjumppw, i18n("When this option is on, TDM will place the cursor " + "in the password field instead of the user field after preselecting a user. " + "Use this to save one key press per login, if the preselection usually does not need to " + "be changed.") ); + connect(cbjumppw, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + + npGroup = new TQVGroupBox(i18n("Enable Password-&Less Logins"), this ); + npGroup->setCheckable( true ); + + TQWhatsThis::add( npGroup, i18n("When this option is checked, the checked users from" + " the list below will be allowed to log in without entering their" + " password. This applies only to TDM's graphical login." + " Think twice before enabling this!") ); + + connect(npGroup, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + + pl_label = new TQLabel(i18n("No password re&quired for:"), npGroup); + npuserlv = new KListView(npGroup); + pl_label->setBuddy(npuserlv); + npuserlv->addColumn(TQString::null); + npuserlv->header()->hide(); + npuserlv->setResizeMode(TQListView::LastColumn); + TQWhatsThis::add(npuserlv, i18n("Check all users you want to allow a password-less login for." + " Entries denoted with '@' are user groups. Checking a group is like checking all users in that group.")); + connect( npuserlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotChanged()) ); + + btGroup = new TQVGroupBox( i18n("Miscellaneous"), this ); + + cbarlen = new TQCheckBox(i18n("Automatically log in again after &X server crash"), btGroup); + TQWhatsThis::add( cbarlen, i18n("When this option is on, a user will be" + " logged in again automatically when their session is interrupted by an" + " X server crash; note that this can open a security hole: if you use" + " a screen locker than KDE's integrated one, this will make" + " circumventing a password-secured screen lock possible.") ); + connect(cbarlen, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + + TQGridLayout *main = new TQGridLayout(this, 5, 2, 10); + main->addWidget(paranoia, 0, 0); + main->addWidget(alGroup, 1, 0); + main->addWidget(puGroup, 2, 0); + main->addMultiCellWidget(npGroup, 0,3, 1,1); + main->addMultiCellWidget(btGroup, 4,4, 0,1); + main->setColStretch(0, 1); + main->setColStretch(1, 2); + main->setRowStretch(3, 1); + + connect( userlb, TQT_SIGNAL(activated( const TQString & )), + TQT_SLOT(slotSetAutoUser( const TQString & )) ); + connect( puserlb, TQT_SIGNAL(textChanged( const TQString & )), + TQT_SLOT(slotSetPreselUser( const TQString & )) ); + connect( npuserlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotUpdateNoPassUser( TQListViewItem * )) ); + +} + +void TDMConvenienceWidget::makeReadOnly() +{ + ((TQWidget*)alGroup->child("qt_groupbox_checkbox"))->setEnabled(false); + userlb->setEnabled(false); + delaysb->setEnabled(false); + againcb->setEnabled(false); + autoLockCheck->setEnabled(false); + ((TQWidget*)npGroup->child("qt_groupbox_checkbox"))->setEnabled(false); + npuserlv->setEnabled(false); + cbarlen->setEnabled(false); + npRadio->setEnabled(false); + ppRadio->setEnabled(false); + spRadio->setEnabled(false); + puserlb->setEnabled(false); + cbjumppw->setEnabled(false); +} + +void TDMConvenienceWidget::slotPresChanged() +{ + bool en = spRadio->isChecked(); + pu_label->setEnabled(en); + puserlb->setEnabled(en); + cbjumppw->setEnabled(!npRadio->isChecked()); +} + +void TDMConvenienceWidget::save() +{ + config->setGroup("X-:0-Core"); + config->writeEntry( "AutoLoginEnable", alGroup->isChecked() ); + config->writeEntry( "AutoLoginUser", userlb->currentText() ); + config->writeEntry( "AutoLoginDelay", delaysb->value() ); + config->writeEntry( "AutoLoginAgain", againcb->isChecked() ); + config->writeEntry( "AutoLoginLocked", autoLockCheck->isChecked() ); + + config->setGroup("X-:*-Core"); + config->writeEntry( "NoPassEnable", npGroup->isChecked() ); + config->writeEntry( "NoPassUsers", noPassUsers ); + + config->setGroup("X-*-Core"); + config->writeEntry( "AutoReLogin", cbarlen->isChecked() ); + + config->setGroup("X-:*-Greeter"); + config->writeEntry( "PreselectUser", npRadio->isChecked() ? "None" : + ppRadio->isChecked() ? "Previous" : + "Default" ); + config->writeEntry( "DefaultUser", puserlb->currentText() ); + config->writeEntry( "FocusPasswd", cbjumppw->isChecked() ); +} + + +void TDMConvenienceWidget::load() +{ + config->setGroup("X-:0-Core"); + bool alenable = config->readBoolEntry( "AutoLoginEnable", false); + autoUser = config->readEntry( "AutoLoginUser" ); + delaysb->setValue( config->readNumEntry( "AutoLoginDelay", 0 ) ); + againcb->setChecked( config->readBoolEntry( "AutoLoginAgain", false ) ); + autoLockCheck->setChecked( config->readBoolEntry( "AutoLoginLocked", false ) ); + if (autoUser.isEmpty()) + alenable=false; + alGroup->setChecked( alenable ); + + config->setGroup("X-:*-Core"); + npGroup->setChecked(config->readBoolEntry( "NoPassEnable", false) ); + noPassUsers = config->readListEntry( "NoPassUsers"); + + config->setGroup("X-*-Core"); + cbarlen->setChecked(config->readBoolEntry( "AutoReLogin", false) ); + + config->setGroup("X-:*-Greeter"); + TQString presstr = config->readEntry( "PreselectUser", "None" ); + if (presstr == "Previous") + ppRadio->setChecked(true); + else if (presstr == "Default") + spRadio->setChecked(true); + else + npRadio->setChecked(true); + preselUser = config->readEntry( "DefaultUser" ); + cbjumppw->setChecked(config->readBoolEntry( "FocusPasswd", false) ); + + slotPresChanged(); +} + + +void TDMConvenienceWidget::defaults() +{ + alGroup->setChecked(false); + delaysb->setValue(0); + againcb->setChecked(false); + autoLockCheck->setChecked(false); + npRadio->setChecked(true); + npGroup->setChecked(false); + cbarlen->setChecked(false); + cbjumppw->setChecked(false); + autoUser = ""; + preselUser = ""; + noPassUsers.clear(); + + slotPresChanged(); +} + + +void TDMConvenienceWidget::slotChanged() +{ + emit changed(true); +} + +void TDMConvenienceWidget::slotSetAutoUser( const TQString &user ) +{ + autoUser = user; +} + +void TDMConvenienceWidget::slotSetPreselUser( const TQString &user ) +{ + preselUser = user; +} + +void TDMConvenienceWidget::slotUpdateNoPassUser( TQListViewItem *item ) +{ + if ( !item ) + return; + TQCheckListItem *itm = (TQCheckListItem *)item; + TQStringList::iterator it = noPassUsers.find( itm->text() ); + if (itm->isOn()) { + if (it == noPassUsers.end()) + noPassUsers.append( itm->text() ); + } else { + if (it != noPassUsers.end()) + noPassUsers.remove( it ); + } +} + +void TDMConvenienceWidget::slotClearUsers() +{ + userlb->clear(); + puserlb->clear(); + npuserlv->clear(); + if (!autoUser.isEmpty()) + userlb->insertItem(autoUser); + if (!preselUser.isEmpty()) + puserlb->insertItem(preselUser); +} + +void TDMConvenienceWidget::slotAddUsers(const TQMap<TQString,int> &users) +{ + TQMapConstIterator<TQString,int> it; + for (it = users.begin(); it != users.end(); ++it) { + if (it.data() > 0) { + if (it.key() != autoUser) + userlb->insertItem(it.key()); + if (it.key() != preselUser) + puserlb->insertItem(it.key()); + } + if (it.data() != 0) + (new TQCheckListItem(npuserlv, it.key(), TQCheckListItem::CheckBox))-> + setOn(noPassUsers.find(it.key()) != noPassUsers.end()); + } + + if (userlb->listBox()) + userlb->listBox()->sort(); + + if (puserlb->listBox()) + puserlb->listBox()->sort(); + + npuserlv->sort(); + userlb->setCurrentItem(autoUser); + puserlb->setCurrentItem(preselUser); +} + +void TDMConvenienceWidget::slotDelUsers(const TQMap<TQString,int> &users) +{ + TQMapConstIterator<TQString,int> it; + for (it = users.begin(); it != users.end(); ++it) { + if (it.data() > 0) { + if (it.key() != autoUser && userlb->listBox()) + delete userlb->listBox()-> + findItem( it.key(), ExactMatch | CaseSensitive ); + if (it.key() != preselUser && puserlb->listBox()) + delete puserlb->listBox()-> + findItem( it.key(), ExactMatch | CaseSensitive ); + } + if (it.data() != 0) + delete npuserlv->findItem( it.key(), 0 ); + } +} + +#include "tdm-conv.moc" diff --git a/kcontrol/tdm/tdm-conv.h b/kcontrol/tdm/tdm-conv.h new file mode 100644 index 000000000..3f8dda974 --- /dev/null +++ b/kcontrol/tdm/tdm-conv.h @@ -0,0 +1,84 @@ +/* This file is part of the KDE Display Manager Configuration package + + Copyright (C) 2000 Oswald Buddenhagen <ossi@kde.org> + Based on several other files. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __TDMCONV_H__ +#define __TDMCONV_H__ + +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqimage.h> +#include <tqgroupbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> + +#include <klistbox.h> +#include <kcombobox.h> +#include <kcolorbutton.h> +#include <klistview.h> +#include <kurl.h> + +#include <pwd.h> + + +class TDMConvenienceWidget : public TQWidget +{ + Q_OBJECT + +public: + TDMConvenienceWidget(TQWidget *parent=0, const char *name=0); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); + +public slots: + void slotClearUsers(); + void slotAddUsers(const TQMap<TQString,int> &); + void slotDelUsers(const TQMap<TQString,int> &); + + +signals: + void changed( bool state ); + +private slots: + void slotPresChanged(); + void slotChanged(); + void slotSetAutoUser( const TQString &user ); + void slotSetPreselUser( const TQString &user ); + void slotUpdateNoPassUser( TQListViewItem *item ); + +private: + TQGroupBox *alGroup, *puGroup, *npGroup, *btGroup; + TQCheckBox *againcb, *cbarlen, *cbjumppw, *autoLockCheck; + TQRadioButton *npRadio, *ppRadio, *spRadio; + KComboBox *userlb, *puserlb; + TQSpinBox *delaysb; + KListView *npuserlv; + TQLabel *u_label, *d_label, *pu_label, *w_label, *n_label, *pl_label; + TQString autoUser, preselUser; + TQStringList noPassUsers; +}; + +#endif + + diff --git a/kcontrol/tdm/tdm-font.cpp b/kcontrol/tdm/tdm-font.cpp new file mode 100644 index 000000000..9947101c1 --- /dev/null +++ b/kcontrol/tdm/tdm-font.cpp @@ -0,0 +1,134 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <unistd.h> +#include <sys/types.h> + + +#include <tqapplication.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> + +#include <kdialog.h> +#include <ksimpleconfig.h> +#include <kfontrequester.h> +#include <klocale.h> + +#include "tdm-font.h" + + +extern KSimpleConfig *config; + +TDMFontWidget::TDMFontWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ + TQGridLayout *ml = new TQGridLayout(this, 5, 2, KDialog::marginHint(), KDialog::spacingHint()); + TQLabel *label = new TQLabel(i18n("&General:"), this); + stdFontChooser = new KFontRequester(this); + label->setBuddy(stdFontChooser); + TQWhatsThis::add( stdFontChooser, i18n("This changes the font which is used for all the text in the login manager except for the greeting and failure messages.") ); + connect(stdFontChooser, TQT_SIGNAL(fontSelected(const TQFont&)),this,TQT_SLOT(configChanged())); + ml->addWidget(label, 1, 0); + ml->addWidget(stdFontChooser, 1, 1); + + label = new TQLabel(i18n("&Failures:"), this); + failFontChooser = new KFontRequester(this); + label->setBuddy(failFontChooser); + TQWhatsThis::add( failFontChooser, i18n("This changes the font which is used for failure messages in the login manager.") ); + connect(failFontChooser, TQT_SIGNAL(fontSelected(const TQFont&)),this,TQT_SLOT(configChanged())); + ml->addWidget(label, 2, 0); + ml->addWidget(failFontChooser, 2, 1); + + label = new TQLabel(i18n("Gree&ting:"), this); + greetingFontChooser = new KFontRequester(this); + label->setBuddy(greetingFontChooser); + TQWhatsThis::add( greetingFontChooser, i18n("This changes the font which is used for the login manager's greeting.") ); + connect(greetingFontChooser, TQT_SIGNAL(fontSelected(const TQFont&)),this,TQT_SLOT(configChanged())); + ml->addWidget(label, 3, 0); + ml->addWidget(greetingFontChooser, 3, 1); + + aacb = new TQCheckBox (i18n("Use anti-aliasing for fonts"), this); + TQWhatsThis::add( aacb, i18n("If you check this box and your X-Server has the Xft extension, " + "fonts will be antialiased (smoothed) in the login dialog.") ); + connect(aacb, TQT_SIGNAL(toggled ( bool )),this,TQT_SLOT(configChanged())); + ml->addMultiCellWidget(aacb, 4, 4, 0, 1); + ml->setRowStretch(5, 10); +} + +void TDMFontWidget::makeReadOnly() +{ + stdFontChooser->button()->setEnabled(false); + failFontChooser->button()->setEnabled(false); + greetingFontChooser->button()->setEnabled(false); + aacb->setEnabled(false); +} + +void TDMFontWidget::configChanged() +{ + emit changed(true); +} + +void TDMFontWidget::set_def() +{ + stdFontChooser->setFont(TQFont("Sans Serif", 10)); + failFontChooser->setFont(TQFont("Sans Serif", 10, TQFont::Bold)); + greetingFontChooser->setFont(TQFont("Sans Serif", 22)); +} + +void TDMFontWidget::save() +{ + config->setGroup("X-*-Greeter"); + + // write font + config->writeEntry("StdFont", stdFontChooser->font()); + config->writeEntry("GreetFont", greetingFontChooser->font()); + config->writeEntry("FailFont", failFontChooser->font()); + config->writeEntry("AntiAliasing", aacb->isChecked()); +} + + +void TDMFontWidget::load() +{ + set_def(); + + config->setGroup("X-*-Greeter"); + + // Read the fonts + TQFont font = stdFontChooser->font(); + stdFontChooser->setFont(config->readFontEntry("StdFont", &font)); + font = failFontChooser->font(); + failFontChooser->setFont(config->readFontEntry("FailFont", &font)); + font = greetingFontChooser->font(); + greetingFontChooser->setFont(config->readFontEntry("GreetFont", &font)); + + aacb->setChecked(config->readBoolEntry("AntiAliasing")); +} + + +void TDMFontWidget::defaults() +{ + set_def(); + aacb->setChecked(true); +} + +#include "tdm-font.moc" diff --git a/kcontrol/tdm/tdm-font.h b/kcontrol/tdm/tdm-font.h new file mode 100644 index 000000000..67b2c864d --- /dev/null +++ b/kcontrol/tdm/tdm-font.h @@ -0,0 +1,57 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __TDMFONT_H__ +#define __TDMFONT_H__ + +#include <tqwidget.h> + +class KFontRequester; +class TQCheckBox; + +class TDMFontWidget : public TQWidget +{ + Q_OBJECT + +public: + TDMFontWidget(TQWidget *parent=0, const char *name=0); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); + +signals: + void changed( bool state ); + +protected slots: + void configChanged(); + void set_def(); + +private: + TQCheckBox *aacb; + KFontRequester *greetingFontChooser; + KFontRequester *failFontChooser; + KFontRequester *stdFontChooser; +}; + + +#endif + + diff --git a/kcontrol/tdm/tdm-shut.cpp b/kcontrol/tdm/tdm-shut.cpp new file mode 100644 index 000000000..434b55ae2 --- /dev/null +++ b/kcontrol/tdm/tdm-shut.cpp @@ -0,0 +1,227 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997-1998 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <unistd.h> +#include <sys/types.h> + + +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> + +#include <ksimpleconfig.h> +#include <karrowbutton.h> +#include <klineedit.h> +#include <klocale.h> +#include <kdialog.h> +#include <kurlrequester.h> + +#include "tdm-shut.h" +#include "kbackedcombobox.h" + +extern KSimpleConfig *config; + + +TDMSessionsWidget::TDMSessionsWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ + TQString wtstr; + + + TQGroupBox *group0 = new TQGroupBox( i18n("Allow Shutdown"), this ); + + sdlcombo = new TQComboBox( FALSE, group0 ); + sdllabel = new TQLabel (sdlcombo, i18n ("&Local:"), group0); + sdlcombo->insertItem(i18n("Everybody"), SdAll); + sdlcombo->insertItem(i18n("Only Root"), SdRoot); + sdlcombo->insertItem(i18n("Nobody"), SdNone); + connect(sdlcombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + sdrcombo = new TQComboBox( FALSE, group0 ); + sdrlabel = new TQLabel (sdrcombo, i18n ("&Remote:"), group0); + sdrcombo->insertItem(i18n("Everybody"), SdAll); + sdrcombo->insertItem(i18n("Only Root"), SdRoot); + sdrcombo->insertItem(i18n("Nobody"), SdNone); + connect(sdrcombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + TQWhatsThis::add( group0, i18n("Here you can select who is allowed to shutdown" + " the computer using TDM. You can specify different values for local (console) and remote displays. " + "Possible values are:<ul>" + " <li><em>Everybody:</em> everybody can shutdown the computer using TDM</li>" + " <li><em>Only root:</em> TDM will only allow shutdown after the user has entered the root password</li>" + " <li><em>Nobody:</em> nobody can shutdown the computer using TDM</li></ul>") ); + + + TQGroupBox *group1 = new TQGroupBox( i18n("Commands"), this ); + + shutdown_lined = new KURLRequester(group1); + TQLabel *shutdown_label = new TQLabel(shutdown_lined, i18n("H&alt:"), group1); + connect(shutdown_lined, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + wtstr = i18n("Command to initiate the system halt. Typical value: /sbin/halt"); + TQWhatsThis::add( shutdown_label, wtstr ); + TQWhatsThis::add( shutdown_lined, wtstr ); + + restart_lined = new KURLRequester(group1); + TQLabel *restart_label = new TQLabel(restart_lined, i18n("Reb&oot:"), group1); + connect(restart_lined, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); + wtstr = i18n("Command to initiate the system reboot. Typical value: /sbin/reboot"); + TQWhatsThis::add( restart_label, wtstr ); + TQWhatsThis::add( restart_lined, wtstr ); + + + TQGroupBox *group4 = new TQGroupBox( i18n("Miscellaneous"), this ); + + bm_combo = new KBackedComboBox( group4 ); + bm_combo->insertItem("None", i18n("boot manager", "None")); + bm_combo->insertItem("Grub", i18n("Grub")); +#if defined(__linux__) && ( defined(__i386__) || defined(__amd64__) ) + bm_combo->insertItem("Lilo", i18n("Lilo")); +#endif + TQLabel *bm_label = new TQLabel( bm_combo, i18n("Boot manager:"), group4 ); + connect(bm_combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + wtstr = i18n("Enable boot options in the \"Shutdown...\" dialog."); + TQWhatsThis::add( bm_label, wtstr ); + TQWhatsThis::add( bm_combo, wtstr ); + + TQBoxLayout *main = new TQVBoxLayout( this, 10 ); + TQGridLayout *lgroup0 = new TQGridLayout( group0, 1, 1, 10); + TQGridLayout *lgroup1 = new TQGridLayout( group1, 1, 1, 10); + TQGridLayout *lgroup4 = new TQGridLayout( group4, 1, 1, 10); + + main->addWidget(group0); + main->addWidget(group1); + main->addWidget(group4); + main->addStretch(); + + lgroup0->addRowSpacing(0, group0->fontMetrics().height()/2); + lgroup0->addColSpacing(2, KDialog::spacingHint() * 2); + lgroup0->setColStretch(1, 1); + lgroup0->setColStretch(4, 1); + lgroup0->addWidget(sdllabel, 1, 0); + lgroup0->addWidget(sdlcombo, 1, 1); + lgroup0->addWidget(sdrlabel, 1, 3); + lgroup0->addWidget(sdrcombo, 1, 4); + + lgroup1->addRowSpacing(0, group1->fontMetrics().height()/2); + lgroup1->addColSpacing(2, KDialog::spacingHint() * 2); + lgroup1->setColStretch(1, 1); + lgroup1->setColStretch(4, 1); + lgroup1->addWidget(shutdown_label, 1, 0); + lgroup1->addWidget(shutdown_lined, 1, 1); + lgroup1->addWidget(restart_label, 1, 3); + lgroup1->addWidget(restart_lined, 1, 4); + + lgroup4->addRowSpacing(0, group4->fontMetrics().height()/2); + lgroup4->addWidget(bm_label, 1, 0); + lgroup4->addWidget(bm_combo, 1, 1); + lgroup4->setColStretch(2, 1); + + main->activate(); + +} + +void TDMSessionsWidget::makeReadOnly() +{ + sdlcombo->setEnabled(false); + sdrcombo->setEnabled(false); + + restart_lined->lineEdit()->setReadOnly(true); + restart_lined->button()->setEnabled(false); + shutdown_lined->lineEdit()->setReadOnly(true); + shutdown_lined->button()->setEnabled(false); + + bm_combo->setEnabled(false); +} + +void TDMSessionsWidget::writeSD(TQComboBox *combo) +{ + TQString what; + switch (combo->currentItem()) { + case SdAll: what = "All"; break; + case SdRoot: what = "Root"; break; + default: what = "None"; break; + } + config->writeEntry( "AllowShutdown", what); +} + +void TDMSessionsWidget::save() +{ + config->setGroup("X-:*-Core"); + writeSD(sdlcombo); + + config->setGroup("X-*-Core"); + writeSD(sdrcombo); + + config->setGroup("Shutdown"); + config->writeEntry("HaltCmd", shutdown_lined->url(), true); + config->writeEntry("RebootCmd", restart_lined->url(), true); + + config->writeEntry("BootManager", bm_combo->currentId()); +} + +void TDMSessionsWidget::readSD(TQComboBox *combo, TQString def) +{ + TQString str = config->readEntry("AllowShutdown", def); + SdModes sdMode; + if(str == "All") + sdMode = SdAll; + else if(str == "Root") + sdMode = SdRoot; + else + sdMode = SdNone; + combo->setCurrentItem(sdMode); +} + +void TDMSessionsWidget::load() +{ + config->setGroup("X-:*-Core"); + readSD(sdlcombo, "All"); + + config->setGroup("X-*-Core"); + readSD(sdrcombo, "Root"); + + config->setGroup("Shutdown"); + restart_lined->setURL(config->readEntry("RebootCmd", "/sbin/reboot")); + shutdown_lined->setURL(config->readEntry("HaltCmd", "/sbin/poweroff")); + + bm_combo->setCurrentId(config->readEntry("BootManager", "None")); +} + + + +void TDMSessionsWidget::defaults() +{ + restart_lined->setURL("/sbin/reboot"); + shutdown_lined->setURL("/sbin/poweroff"); + + sdlcombo->setCurrentItem(SdAll); + sdrcombo->setCurrentItem(SdRoot); + + bm_combo->setCurrentId("None"); +} + + +void TDMSessionsWidget::changed() +{ + emit changed(true); +} + +#include "tdm-shut.moc" diff --git a/kcontrol/tdm/tdm-shut.h b/kcontrol/tdm/tdm-shut.h new file mode 100644 index 000000000..bbc6fdc29 --- /dev/null +++ b/kcontrol/tdm/tdm-shut.h @@ -0,0 +1,64 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __TDMSESS_H__ +#define __TDMSESS_H__ + + +#include <tqstring.h> + +class TQComboBox; +class TQCheckBox; +class KURLRequester; +class KBackedComboBox; + +class TDMSessionsWidget : public TQWidget +{ + Q_OBJECT + +public: + TDMSessionsWidget(TQWidget *parent=0, const char *name=0); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); + + enum SdModes { SdAll, SdRoot, SdNone }; + +signals: + void changed( bool state ); + +protected slots: + void changed(); + +private: + void readSD (TQComboBox *, TQString); + void writeSD (TQComboBox *); + + TQComboBox *sdlcombo, *sdrcombo; + TQLabel *sdllabel, *sdrlabel; + KURLRequester *restart_lined, *shutdown_lined; + KBackedComboBox *bm_combo; +}; + + +#endif + + diff --git a/kcontrol/tdm/tdm-users.cpp b/kcontrol/tdm/tdm-users.cpp new file mode 100644 index 000000000..f4b48b9a6 --- /dev/null +++ b/kcontrol/tdm/tdm-users.cpp @@ -0,0 +1,500 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <unistd.h> +#include <sys/types.h> + +#include <tqstyle.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqvalidator.h> +#include <tqwhatsthis.h> +#include <tqvgroupbox.h> +#include <tqpushbutton.h> + +#include <kfiledialog.h> +#include <kimageio.h> +#include <kimagefilepreview.h> +#include <kio/netaccess.h> +#include <klocale.h> +#include <kstandarddirs.h> +#include <kmessagebox.h> +#include <kurldrag.h> + +#include "tdm-users.h" + +#include <sys/stat.h> + + +extern KSimpleConfig *config; + +TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) +{ +#ifdef __linux__ + struct stat st; + if (!stat( "/etc/debian_version", &st )) { /* debian */ + defminuid = "1000"; + defmaxuid = "29999"; + } else if (!stat( "/usr/portage", &st )) { /* gentoo */ + defminuid = "1000"; + defmaxuid = "65000"; + } else if (!stat( "/etc/mandrake-release", &st )) { /* mandrake - check before redhat! */ + defminuid = "500"; + defmaxuid = "65000"; + } else if (!stat( "/etc/redhat-release", &st )) { /* redhat */ + defminuid = "100"; + defmaxuid = "65000"; + } else /* if (!stat( "/etc/SuSE-release", &st )) */ { /* suse */ + defminuid = "500"; + defmaxuid = "65000"; + } +#else + defminuid = "1000"; + defmaxuid = "65000"; +#endif + + // We assume that $kde_datadir/tdm exists, but better check for pics/ and pics/users, + // and create them if necessary. + config->setGroup( "X-*-Greeter" ); + m_userPixDir = config->readEntry( "FaceDir", KGlobal::dirs()->resourceDirs("data").last() + "tdm/faces" ) + '/'; + m_notFirst = false; + TQDir testDir( m_userPixDir ); + if ( !testDir.exists() && !testDir.mkdir( testDir.absPath() ) && !geteuid() ) + KMessageBox::sorry( this, i18n("Unable to create folder %1").arg( testDir.absPath() ) ); + chmod( TQFile::encodeName( m_userPixDir ), 0755 ); + + m_defaultText = i18n("<default>"); + + TQString wtstr; + + minGroup = new TQGroupBox( 2, Qt::Horizontal, i18n("System U&IDs"), this ); + TQWhatsThis::add( minGroup, i18n("Users with a UID (numerical user identification) outside this range will not be listed by TDM and this setup dialog." + " Note that users with the UID 0 (typically root) are not affected by this and must be" + " explicitly hidden in \"Not hidden\" mode.")); + TQSizePolicy sp_ign_fix( TQSizePolicy::Ignored, TQSizePolicy::Fixed ); + TQValidator *valid = new TQIntValidator( 0, 999999, TQT_TQOBJECT(minGroup) ); + TQLabel *minlab = new TQLabel( i18n("Below:"), minGroup ); + leminuid = new KLineEdit( minGroup ); + minlab->setBuddy( leminuid ); + leminuid->setSizePolicy( sp_ign_fix ); + leminuid->setValidator( valid ); + connect( leminuid, TQT_SIGNAL(textChanged( const TQString & )), TQT_SLOT(slotChanged()) ); + connect( leminuid, TQT_SIGNAL(textChanged( const TQString & )), TQT_SLOT(slotMinMaxChanged()) ); + TQLabel *maxlab = new TQLabel( i18n("Above:"), minGroup ); + lemaxuid = new KLineEdit( minGroup ); + maxlab->setBuddy( lemaxuid ); + lemaxuid->setSizePolicy( sp_ign_fix ); + lemaxuid->setValidator( valid ); + connect(lemaxuid, TQT_SIGNAL(textChanged( const TQString & )), TQT_SLOT(slotChanged()) ); + connect(lemaxuid, TQT_SIGNAL(textChanged( const TQString & )), TQT_SLOT(slotMinMaxChanged()) ); + + usrGroup = new TQButtonGroup( 5, Qt::Vertical, i18n("Users"), this ); + connect( usrGroup, TQT_SIGNAL(clicked( int )), TQT_SLOT(slotShowOpts()) ); + connect( usrGroup, TQT_SIGNAL(clicked( int )), TQT_SLOT(slotChanged()) ); + cbshowlist = new TQCheckBox( i18n("Show list"), usrGroup ); + TQWhatsThis::add( cbshowlist, i18n("If this option is checked, TDM will show a list of users," + " so users can click on their name or image rather than typing in their login.") ); + cbcomplete = new TQCheckBox( i18n("Autocompletion"), usrGroup ); + TQWhatsThis::add( cbcomplete, i18n("If this option is checked, TDM will automatically complete" + " user names while they are typed in the line edit.") ); + cbinverted = new TQCheckBox( i18n("Inverse selection"), usrGroup ); + TQWhatsThis::add( cbinverted, i18n("This option specifies how the users for \"Show list\" and \"Autocompletion\"" + " are selected in the \"Select users and groups\" list: " + "If not checked, select only the checked users. " + "If checked, select all non-system users, except the checked ones.")); + cbusrsrt = new TQCheckBox( i18n("Sor&t users"), usrGroup ); + connect( cbusrsrt, TQT_SIGNAL(toggled( bool )), TQT_SLOT(slotChanged()) ); + TQWhatsThis::add( cbusrsrt, i18n("If this is checked, TDM will alphabetically sort the user list." + " Otherwise users are listed in the order they appear in the password file.") ); + + wstack = new TQWidgetStack( this ); + s_label = new TQLabel( wstack, i18n("S&elect users and groups:"), this ); + optinlv = new KListView( this ); + optinlv->addColumn( i18n("Selected Users") ); + optinlv->setResizeMode( TQListView::LastColumn ); + TQWhatsThis::add( optinlv, i18n("TDM will show all checked users. Entries denoted with '@' are user groups. Checking a group is like checking all users in that group.") ); + wstack->addWidget( optinlv ); + connect( optinlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotUpdateOptIn( TQListViewItem * )) ); + connect( optinlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotChanged()) ); + optoutlv = new KListView( this ); + optoutlv->addColumn( i18n("Hidden Users") ); + optoutlv->setResizeMode( TQListView::LastColumn ); + TQWhatsThis::add( optoutlv, i18n("TDM will show all non-checked non-system users. Entries denoted with '@' are user groups. Checking a group is like checking all users in that group.") ); + wstack->addWidget( optoutlv ); + connect( optoutlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotUpdateOptOut( TQListViewItem * )) ); + connect( optoutlv, TQT_SIGNAL(clicked( TQListViewItem * )), + TQT_SLOT(slotChanged()) ); + + faceGroup = new TQButtonGroup( 5, Qt::Vertical, i18n("User Image Source"), this ); + TQWhatsThis::add( faceGroup, i18n("Here you can specify where TDM will obtain the images that represent users." + " \"Admin\" represents the global folder; these are the pictures you can set below." + " \"User\" means that TDM should read the user's $HOME/.face.icon file." + " The two selections in the middle define the order of preference if both sources are available.") ); + connect( faceGroup, TQT_SIGNAL(clicked( int )), TQT_SLOT(slotFaceOpts()) ); + connect( faceGroup, TQT_SIGNAL(clicked( int )), TQT_SLOT(slotChanged()) ); + rbadmonly = new TQRadioButton( i18n("Admin"), faceGroup ); + rbprefadm = new TQRadioButton( i18n("Admin, user"), faceGroup ); + rbprefusr = new TQRadioButton( i18n("User, admin"), faceGroup ); + rbusronly = new TQRadioButton( i18n("User"), faceGroup ); + + TQGroupBox *picGroup = new TQVGroupBox( i18n("User Images"), this ); + TQWidget *hlpw = new TQWidget( picGroup ); + usercombo = new KComboBox( hlpw ); + TQWhatsThis::add( usercombo, i18n("The user the image below belongs to.") ); + connect( usercombo, TQT_SIGNAL(activated( int )), + TQT_SLOT(slotUserSelected()) ); + TQLabel *userlabel = new TQLabel( usercombo, i18n("User:"), hlpw ); + userbutton = new TQPushButton( hlpw ); + userbutton->setAcceptDrops( true ); + userbutton->installEventFilter( this ); // for drag and drop + uint sz = style().pixelMetric( TQStyle::PM_ButtonMargin ) * 2 + 48; + userbutton->setFixedSize( sz, sz ); + connect( userbutton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotUserButtonClicked()) ); + TQToolTip::add( userbutton, i18n("Click or drop an image here") ); + TQWhatsThis::add( userbutton, i18n("Here you can see the image assigned to the user selected in the combo box above. Click on the image button to select from a list" + " of images or drag and drop your own image on to the button (e.g. from Konqueror).") ); + rstuserbutton = new TQPushButton( i18n("Unset"), hlpw ); + TQWhatsThis::add( rstuserbutton, i18n("Click this button to make TDM use the default image for the selected user.") ); + connect( rstuserbutton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotUnsetUserPix()) ); + TQGridLayout *hlpl = new TQGridLayout( hlpw, 3, 2, 0, KDialog::spacingHint() ); + hlpl->addWidget( userlabel, 0, 0 ); +// hlpl->addSpacing( KDialog::spacingHint() ); + hlpl->addWidget( usercombo, 0, 1 ); + hlpl->addMultiCellWidget( userbutton, 1,1, 0,1, Qt::AlignHCenter ); + hlpl->addMultiCellWidget( rstuserbutton, 2,2, 0,1, Qt::AlignHCenter ); + + TQHBoxLayout *main = new TQHBoxLayout( this, 10 ); + + TQVBoxLayout *lLayout = new TQVBoxLayout( main, 10 ); + lLayout->addWidget( minGroup ); + lLayout->addWidget( usrGroup ); + lLayout->addStretch( 1 ); + + TQVBoxLayout *mLayout = new TQVBoxLayout( main, 10 ); + mLayout->addWidget( s_label ); + mLayout->addWidget( wstack ); + mLayout->setStretchFactor( wstack, 1 ); + main->setStretchFactor( mLayout, 1 ); + + TQVBoxLayout *rLayout = new TQVBoxLayout( main, 10 ); + rLayout->addWidget( faceGroup ); + rLayout->addWidget( picGroup ); + rLayout->addStretch( 1 ); + +} + +void TDMUsersWidget::makeReadOnly() +{ + leminuid->setReadOnly(true); + lemaxuid->setReadOnly(true); + cbshowlist->setEnabled(false); + cbcomplete->setEnabled(false); + cbinverted->setEnabled(false); + cbusrsrt->setEnabled(false); + rbadmonly->setEnabled(false); + rbprefadm->setEnabled(false); + rbprefusr->setEnabled(false); + rbusronly->setEnabled(false); + wstack->setEnabled(false); + disconnect( userbutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUserButtonClicked()) ); + userbutton->setAcceptDrops(false); + rstuserbutton->setEnabled(false); +} + +void TDMUsersWidget::slotShowOpts() +{ + bool en = cbshowlist->isChecked() || cbcomplete->isChecked(); + cbinverted->setEnabled( en ); + cbusrsrt->setEnabled( en ); + wstack->setEnabled( en ); + wstack->raiseWidget( cbinverted->isChecked() ? optoutlv : optinlv ); + en = cbshowlist->isChecked(); + faceGroup->setEnabled( en ); + if (!en) { + usercombo->setEnabled( false ); + userbutton->setEnabled( false ); + rstuserbutton->setEnabled( false ); + } else + slotFaceOpts(); +} + +void TDMUsersWidget::slotFaceOpts() +{ + bool en = !rbusronly->isChecked(); + usercombo->setEnabled( en ); + userbutton->setEnabled( en ); + if (en) + slotUserSelected(); + else + rstuserbutton->setEnabled( false ); +} + +void TDMUsersWidget::slotUserSelected() +{ + TQString user = usercombo->currentText(); + TQImage p; + if (user != m_defaultText && + p.load( m_userPixDir + user + ".face.icon" )) { + rstuserbutton->setEnabled( !getuid() ); + } else { + p.load( m_userPixDir + ".default.face.icon" ); + rstuserbutton->setEnabled( false ); + } + userbutton->setPixmap( p.smoothScale( 48, 48, TQ_ScaleMin ) ); +} + + +void TDMUsersWidget::changeUserPix(const TQString &pix) +{ + TQString user( usercombo->currentText() ); + if (user == m_defaultText) + { + user = ".default"; + if (KMessageBox::questionYesNo(this, i18n("Save image as default image?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::cancel()) + != KMessageBox::Yes) + return; + } + + TQImage p( pix ); + if (p.isNull()) { + KMessageBox::sorry( this, + i18n("There was an error loading the image\n" + "%1").arg( pix ) ); + return; + } + + p = p.smoothScale( 48, 48, TQ_ScaleMin ); + TQString userpix = m_userPixDir + user + ".face.icon"; + if (!p.save( userpix, "PNG" )) + KMessageBox::sorry(this, + i18n("There was an error saving the image:\n%1") + .arg( userpix ) ); + else + chmod( TQFile::encodeName( userpix ), 0644 ); + + slotUserSelected(); +} + +void TDMUsersWidget::slotUserButtonClicked() +{ + KFileDialog dlg(m_notFirst ? TQString::null : + KGlobal::dirs()->resourceDirs("data").last() + "tdm/pics/users", + KImageIO::pattern( KImageIO::Reading ), + this, 0, true); + dlg.setOperationMode( KFileDialog::Opening ); + dlg.setCaption( i18n("Choose Image") ); + dlg.setMode( KFile::File | KFile::LocalOnly ); + + KImageFilePreview *ip = new KImageFilePreview( &dlg ); + dlg.setPreviewWidget( ip ); + if (dlg.exec() != TQDialog::Accepted) + return; + m_notFirst = true; + + changeUserPix( dlg.selectedFile() ); +} + +void TDMUsersWidget::slotUnsetUserPix() +{ + TQFile::remove( m_userPixDir + usercombo->currentText() + ".face.icon" ); + slotUserSelected(); +} + +bool TDMUsersWidget::eventFilter(TQObject *, TQEvent *e) +{ + if (e->type() == TQEvent::DragEnter) { + TQDragEnterEvent *ee = (TQDragEnterEvent *) e; + ee->accept( KURLDrag::canDecode(ee) ); + return true; + } + + if (e->type() == TQEvent::Drop) { + userButtonDropEvent((TQDropEvent *) e); + return true; + } + + return false; +} + +KURL *decodeImgDrop(TQDropEvent *e, TQWidget *wdg); + +void TDMUsersWidget::userButtonDropEvent(TQDropEvent *e) +{ + KURL *url = decodeImgDrop(e, this); + if (url) { + TQString pixpath; + KIO::NetAccess::download(*url, pixpath, parentWidget()); + changeUserPix( pixpath ); + KIO::NetAccess::removeTempFile(pixpath); + delete url; + } +} + +void TDMUsersWidget::save() +{ + config->setGroup( "X-*-Greeter" ); + + config->writeEntry( "MinShowUID", leminuid->text() ); + config->writeEntry( "MaxShowUID", lemaxuid->text() ); + + config->writeEntry( "UserList", cbshowlist->isChecked() ); + config->writeEntry( "UserCompletion", cbcomplete->isChecked() ); + config->writeEntry( "ShowUsers", + cbinverted->isChecked() ? "NotHidden" : "Selected" ); + config->writeEntry( "SortUsers", cbusrsrt->isChecked() ); + + config->writeEntry( "HiddenUsers", hiddenUsers ); + config->writeEntry( "SelectedUsers", selectedUsers ); + + config->writeEntry( "FaceSource", + rbadmonly->isChecked() ? "AdminOnly" : + rbprefadm->isChecked() ? "PreferAdmin" : + rbprefusr->isChecked() ? "PreferUser" : "UserOnly" ); +} + + +void TDMUsersWidget::updateOptList( TQListViewItem *item, TQStringList &list ) +{ + if ( !item ) + return; + TQCheckListItem *itm = (TQCheckListItem *)item; + TQStringList::iterator it = list.find( itm->text() ); + if (itm->isOn()) { + if (it == list.end()) + list.append( itm->text() ); + } else { + if (it != list.end()) + list.remove( it ); + } +} + +void TDMUsersWidget::slotUpdateOptIn( TQListViewItem *item ) +{ + updateOptList( item, selectedUsers ); +} + +void TDMUsersWidget::slotUpdateOptOut( TQListViewItem *item ) +{ + updateOptList( item, hiddenUsers ); +} + +void TDMUsersWidget::slotClearUsers() +{ + optinlv->clear(); + optoutlv->clear(); + usercombo->clear(); + usercombo->insertItem( m_defaultText ); +} + +void TDMUsersWidget::slotAddUsers(const TQMap<TQString,int> &users) +{ + TQMapConstIterator<TQString,int> it; + for (it = users.begin(); it != users.end(); ++it) { + const TQString *name = &it.key(); + (new TQCheckListItem(optinlv, *name, TQCheckListItem::CheckBox))-> + setOn(selectedUsers.find(*name) != selectedUsers.end()); + (new TQCheckListItem(optoutlv, *name, TQCheckListItem::CheckBox))-> + setOn(hiddenUsers.find(*name) != hiddenUsers.end()); + if ((*name)[0] != '@') + usercombo->insertItem(*name); + } + optinlv->sort(); + optoutlv->sort(); + if (usercombo->listBox()) + usercombo->listBox()->sort(); +} + +void TDMUsersWidget::slotDelUsers(const TQMap<TQString,int> &users) +{ + TQMapConstIterator<TQString,int> it; + for (it = users.begin(); it != users.end(); ++it) { + const TQString *name = &it.key(); + if (usercombo->listBox()) + delete usercombo->listBox()->findItem( *name, ExactMatch | CaseSensitive ); + delete optinlv->findItem( *name, 0 ); + delete optoutlv->findItem( *name, 0 ); + } +} + +void TDMUsersWidget::load() +{ + TQString str; + + config->setGroup("X-*-Greeter"); + + selectedUsers = config->readListEntry( "SelectedUsers"); + hiddenUsers = config->readListEntry( "HiddenUsers"); + + leminuid->setText(config->readEntry("MinShowUID", defminuid)); + lemaxuid->setText(config->readEntry("MaxShowUID", defmaxuid)); + + cbshowlist->setChecked( config->readBoolEntry( "UserList", true ) ); + cbcomplete->setChecked( config->readBoolEntry( "UserCompletion", false ) ); + cbinverted->setChecked( config->readEntry( "ShowUsers" ) != "Selected" ); + cbusrsrt->setChecked(config->readBoolEntry("SortUsers", true)); + + TQString ps = config->readEntry( "FaceSource" ); + if (ps == TQString::fromLatin1("UserOnly")) + rbusronly->setChecked(true); + else if (ps == TQString::fromLatin1("PreferUser")) + rbprefusr->setChecked(true); + else if (ps == TQString::fromLatin1("PreferAdmin")) + rbprefadm->setChecked(true); + else + rbadmonly->setChecked(true); + + slotUserSelected(); + + slotShowOpts(); + slotFaceOpts(); +} + +void TDMUsersWidget::defaults() +{ + leminuid->setText( defminuid ); + lemaxuid->setText( defmaxuid ); + cbshowlist->setChecked( true ); + cbcomplete->setChecked( false ); + cbinverted->setChecked( true ); + cbusrsrt->setChecked( true ); + rbadmonly->setChecked( true ); + hiddenUsers.clear(); + selectedUsers.clear(); + slotShowOpts(); + slotFaceOpts(); +} + +void TDMUsersWidget::slotMinMaxChanged() +{ + emit setMinMaxUID( leminuid->text().toInt(), lemaxuid->text().toInt() ); +} + +void TDMUsersWidget::slotChanged() +{ + emit changed(true); +} + +#include "tdm-users.moc" diff --git a/kcontrol/tdm/tdm-users.h b/kcontrol/tdm/tdm-users.h new file mode 100644 index 000000000..8a87c28dd --- /dev/null +++ b/kcontrol/tdm/tdm-users.h @@ -0,0 +1,106 @@ +/* This file is part of the KDE Display Manager Configuration package + Copyright (C) 1997 Thomas Tanghus (tanghus@earthling.net) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __TDMUSERS_H__ +#define __TDMUSERS_H__ + +#include <tqwidget.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqimage.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqwidgetstack.h> + +#include <klineedit.h> +#include <klistview.h> +#include <kcombobox.h> +#include <kurl.h> + +#include <pwd.h> + + +class TDMUsersWidget : public TQWidget +{ + Q_OBJECT + +public: + TDMUsersWidget( TQWidget *parent = 0, const char *name = 0 ); + + void load(); + void save(); + void defaults(); + void makeReadOnly(); + + bool eventFilter( TQObject *o, TQEvent *e ); + +public slots: + void slotClearUsers(); + void slotAddUsers( const TQMap<TQString,int> & ); + void slotDelUsers( const TQMap<TQString,int> & ); + +signals: + void changed( bool state ); + void setMinMaxUID( int, int ); + +private slots: + void slotMinMaxChanged(); + void slotShowOpts(); + void slotUpdateOptIn( TQListViewItem *item ); + void slotUpdateOptOut( TQListViewItem *item ); + void slotUserSelected(); + void slotUnsetUserPix(); + void slotFaceOpts(); + void slotUserButtonClicked(); + void slotChanged(); + +private: + void updateOptList( TQListViewItem *item, TQStringList &list ); + void userButtonDropEvent( TQDropEvent *e ); + void changeUserPix( const TQString & ); + + TQGroupBox *minGroup; // top left + TQLineEdit *leminuid, *lemaxuid; + + TQButtonGroup *usrGroup; // right below + TQCheckBox *cbshowlist, *cbcomplete, *cbinverted, *cbusrsrt; + + TQLabel *s_label; // middle + TQWidgetStack *wstack; + KListView *optoutlv, *optinlv; + + TQButtonGroup *faceGroup; // right + TQRadioButton *rbadmonly, *rbprefadm, *rbprefusr, *rbusronly; + + KComboBox *usercombo; // right below + TQPushButton *userbutton; + TQPushButton *rstuserbutton; + + TQString m_userPixDir; + TQString m_defaultText; + TQStringList hiddenUsers, selectedUsers; + TQString defminuid, defmaxuid; + + bool m_notFirst; +}; + +#endif + + diff --git a/kcontrol/tdm/tdm.desktop b/kcontrol/tdm/tdm.desktop new file mode 100644 index 000000000..978918ec4 --- /dev/null +++ b/kcontrol/tdm/tdm.desktop @@ -0,0 +1,243 @@ +[Desktop Entry] +Exec=kcmshell tdm +Icon=tdmconfig +Type=Application +DocPath=tdm/index.html#configuring-tdm + +X-KDE-SubstituteUID=true + +X-KDE-Library=tdm +X-KDE-RootOnly=true + +X-KDE-ParentApp=kcontrol + +Name=Login Manager +Name[af]=Aanteken Bestuurder +Name[ar]=مسيير تسجيل الدخول +Name[az]=İclas Açma İdarəcisi +Name[be]=Кіраўнік уваходу +Name[bg]=Вход в системата +Name[bn]=লগ-ইন ম্যানেজার +Name[br]=Merour ereañ +Name[bs]=Login menadžer +Name[ca]=Gestor d'accés +Name[cs]=Správce přihlášení +Name[csb]=Menedżer logòwaniô +Name[cy]=Rheolydd Mewngofnodi +Name[da]=Login-håndtering +Name[de]=Anmeldungsmanager +Name[el]=Διαχειριστής σύνδεσης +Name[eo]=Salutilo +Name[es]=Gestor de acceso +Name[et]=Sisselogimise haldur +Name[eu]=Saio-hasieraren kudeatzailea +Name[fa]=مدیر ورود +Name[fi]=Sisäänkirjautumisasetukset +Name[fr]=Gestionnaire de connexion +Name[fy]=Oanmeldskerm +Name[ga]=Bainisteoir Logála Isteach +Name[gl]=Xestor de Login +Name[he]=מנהל הכניסה למערכת +Name[hi]=लॉगइन प्रबंधक +Name[hr]=Upravljanje prijavljivanjem +Name[hu]=Bejelentkező felület (TDM) +Name[id]=Manajer Login +Name[is]=Innstimplunarstjóri +Name[it]=Gestione degli accessi +Name[ja]=ログインマネージャ +Name[ka]=შესვლის მენეჯერი +Name[kk]=Жүйеге кіруді басқару +Name[km]=កម្មវិធីគ្រប់គ្រងការចូល +Name[ko]=로그인 관리자 +Name[lo]=ຈັດການລັອກອິນ +Name[lt]=Registravimosi tvarkyklė +Name[lv]=Pieteikšanās Menedžeris +Name[mk]=Менаџер на најави +Name[mn]=Нэвтрэлт удирдагч +Name[ms]=Pengurus Login +Name[mt]=Manager tal-Login +Name[nb]=Innloggingsbehandler +Name[nds]=Anmellen-Schirm +Name[ne]=लगइन प्रबन्धक +Name[nl]=Aanmeldscherm +Name[nn]=Innloggingshandsamar +Name[nso]=Molaodi wa Tseno +Name[oc]=Gestionari de connexion +Name[pa]=ਲਾਗ ਮੈਨੇਜਰ +Name[pl]=Menedżer logowania +Name[pt]=Gestor de Autenticação +Name[pt_BR]=Gerenciador de Login +Name[ro]=Managerul de logare +Name[ru]=Менеджер входа в систему +Name[rw]=Mugenga w'Ifashayinjira +Name[se]=Sisačálihangieđahalli +Name[sk]=Správca prihlásenia +Name[sl]=Upravitelj prijav +Name[sr]=Менаџер пријављивања +Name[sr@Latn]=Menadžer prijavljivanja +Name[sv]=Inloggningshanterare +Name[ta]=நுழைவு மேலாளர் +Name[te]=లాగిన్ అభికర్త +Name[tg]=Мудири вуруд +Name[th]=ตัวจัดการการล็อกอิน +Name[tr]=Giriş Yöneticisi +Name[tt]=Kerü İdäçese +Name[uk]=Менеджер реєстрації +Name[uz]=Kirish boshqaruvchisi +Name[uz@cyrillic]=Кириш бошқарувчиси +Name[ven]=Mulanguli wa u loga +Name[vi]=Trình quản lí Đăng nhập +Name[wa]=Manaedjeu d' elodjaedje +Name[xh]=Umphathi Wegama elithile +Name[zh_CN]=登录管理器 +Name[zh_TW]=登錄管理程式 +Name[zu]=Imenenja yokungena ngaphakathi + +Comment=Configure the login manager (TDM) +Comment[af]=Konfigureer die aanteken bestuurder (Kdm) +Comment[ar]=إعداد مسيير الدخول (TDM) +Comment[az]=Giriş İdarəçisi (TDM) Qurğuları +Comment[be]=Настаўленні кіраўніка ўваходу (TDM) +Comment[bg]=Настройване на графичната системата за вход +Comment[bn]=লগ-ইন ম্যানেজার কনফিগার করুন +Comment[br]=Kefluniañ ar merour ereañ (TDM) +Comment[bs]=Podesite menadžer prijavom (TDM) +Comment[ca]=Configura el gestor d'accés (TDM) +Comment[cs]=Nastavení správce přihlášení (TDM) +Comment[csb]=Kònfigùracëjô menedżera logòwaniô (TDM) +Comment[cy]=Ffurfweddu y rheolydd mewngofnodi (TDM) +Comment[da]=Indstil indlogningshåndtering (TDM) +Comment[de]=Anmeldungsmanager TDM einrichten +Comment[el]=Ρυθμίστε το διαχειριστή σύνδεσης (TDM) +Comment[eo]=Agordu la salutadminstrilon (TDM) +Comment[es]=Configura el gestor de acceso (TDM) +Comment[et]=Sisselogimise halduri seadistamine (TDM) +Comment[eu]=Konfiguratu saio-hasieraren kudeatzailea (TDM) +Comment[fa]=پیکربندی مدیر ورود (TDM) +Comment[fi]=Sisäänkirjautumisasetukset +Comment[fr]=Configuration du gestionnaire de connexion (TDM) +Comment[fy]=Hjir kinne jo it oanmeldskerm ynstelle (TDM) +Comment[ga]=Cumraigh an bainisteoir logála isteach (TDM) +Comment[gl]=Configurar o xestor de início (TDM) +Comment[he]=שינוי הגדרות מנהל הכניסה למערכת (TDM) +Comment[hi]=लॉगइन प्रबंधक कॉन्फ़िगर करें (केडीएम) +Comment[hr]=Konfiguriranje upravljanja prijavljivanja (TDM) +Comment[hu]=A KDE grafikus bejelentkező felületének beállításai +Comment[is]=Stilla innstimplunarstjórann (TDM) +Comment[it]=Configurazione della gestione degli accessi (TDM) +Comment[ja]=ログインマネージャ (TDM) の設定 +Comment[ka]=შევლის მენეჯერის კონფიგურირება (TDM) +Comment[kk]=Жүйеге кіруді басқаруын (TDM) баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធកម្មវិធីគ្រប់គ្រងការចូល (TDM) +Comment[ko]=로그인 관리자 TDM 설정 +Comment[lo]=ປັບແຕ່ງປລັກອິນແລະການເຊື່ອມ ຕໍ່ສຳລັບລະບົບ KDB +Comment[lt]=Konfigūruoti registravimos tvarkyklę (TDM) +Comment[lv]=Konfigure pieteiksanās menedžeri TDM +Comment[mk]=Конфигурирајте го менаџерот на најави (TDM) +Comment[mn]=Нэвтрэлт удирдагч TDM тохируулах +Comment[ms]=Konfigur pengurus login (TDM) +Comment[mt]=Ikkonfigura l-manager tal-logins (TDM) +Comment[nb]=Tilpass innlogingsbehandler (TDM) +Comment[nds]=Den Anmellen-Schirm instellen (TDM) +Comment[ne]=लगइन प्रबन्धक (TDM) कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u het aanmeldscherm (TDM) instellen +Comment[nn]=Set opp innloggingshandsamaren (TDM) +Comment[nso]=Beakanya molaodoi wa tseno (TDM) +Comment[pa]=ਲਾਗਆਨ ਮੈਨੇਜਰ ਸੰਰਚਨਾ(TDM) +Comment[pl]=Konfiguracja menedżera logowania (TDM) +Comment[pt]=Configuração do gestor de autenticação (TDM) +Comment[pt_BR]=Configura o gerenciador de login (TDM) +Comment[ro]=Configurează managerul de logare grafică (TDM) +Comment[ru]=Настройка менеджера входа в систему (TDM) +Comment[rw]=Kuboneza mugenga w'ifashayinjira (TDM) +Comment[se]=Heivet sisačálihangieđahalli (TDM) +Comment[sk]=Nastavenie správcu prihlásenia (TDM) +Comment[sl]=Nastavitve upravitelja prijav (TDM) +Comment[sr]=Подешавање менаџера за пријављивање (TDM) +Comment[sr@Latn]=Podešavanje menadžera za prijavljivanje (TDM) +Comment[sv]=Anpassa inloggningshanteraren (TDM) +Comment[ta]=புகுபதிகை மேலாளரை அமை (TDM) +Comment[tg]=Танзими мудири вуруд (TDM) +Comment[th]=ปรับแต่งเครื่องมือจัดการการล็อกอิน (TDM) +Comment[tr]=Giriş yöneticisini yapılandır (TDM) +Comment[tt]=Kerü idäräçen caylaw urını (TDM) +Comment[uk]=Налаштування менеджера реєстрації (TDM) +Comment[uz]=Tizimga kirish boshqaruvchisini (TDM) moslash +Comment[uz@cyrillic]=Тизимга кириш бошқарувчисини (TDM) мослаш +Comment[ven]=Ni nga dzudzanya mulanguli wau loga (TDM) +Comment[vi]=Cấu hình trình đăng nhập (TDM) +Comment[wa]=Apontyî l' manaedjeu d' elodjaedje (TDM) +Comment[xh]=Qwalasela umphathi wegama elithile (TDM) +Comment[zh_CN]=配置登录管理器(TDM) +Comment[zh_TW]=設定登入管理程式 (TDM) +Comment[zu]=Hlanganisela imenenja yokungena ngaphakathi (TDM) + +Keywords=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart +Keywords[ar]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,مدير العرض,المستخدمون مستخدمون,المستخدمين,مستخدمين,دخول,الدخول,تحية,التحية,اللغة,المظهر, البلد,الخطوط,الخط,خطوط,خط,خلفية,ورق حائط,جلسات,اغلاق,اعادة تشغيل +Keywords[az]=tdm,görünüş idarəçi,xdm,istifadəçilər,iclas açma,qarşılama,loqo,tərzlər,dil,ölkə,yazı növləri,arxa plan,divar kağızları,iclaslar,qapat,təkrar başlat +Keywords[be]=кіраўнік дысплея,кіраўнік уваходу,карыстальнікі,уваход,запрашэнне,лагатып,стылі,стыль,мова,краіна,шрыфты,фон,шпалеры,сесіі,сесія,выключэнне,перазагрузка,tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart +Keywords[bg]=графична, система, вход, влизане, включване, потребител, tdm, display manager, xdm, users, login, greeting, Logo, styles, language, country, fonts, background, wallpapers, sessions, shutdown, restart +Keywords[ca]=tdm,administrador de la pantalla,xdm,usuaris,accés,salutació,Logo,estils,llengua,país,lletres,fons,tapissos,sessions,apagar,reiniciar +Keywords[cs]=tdm,Správce obrazovky,xdm,Uživatelé,Přihlášení,Uvítání,Logo,Styly,Jazyk,Země,Písma,pozadí,Tapety,Relace,Sezení,Vypnutí,Restart +Keywords[csb]=tdm,menedżer ekranu,xdm,brëkòwnicë,logòwanié,przëwitanié,Logò,sztéle,jãzëk,kraj,fòntë,spódk,tapetë,spòdlë,sesëje,zamkniãce systemë,resztart,zôczãce robòtë +Keywords[cy]=tdm,rheolydd y dangosydd,xdm,defnyddwyr,mewngofnodi,cyfarchiad,Logo,arddulliau,iaith,gwlad,ffontiau,cefndir,papurau wal,sesiynau,cau,ailgychwyn +Keywords[da]=tdm,skærmhåndtering,xdm,brugere,login,hilsen,Logo,stil, sprog,land,skrifttyper,baggrund,tapeter,sessioner,luk ned,genstart +Keywords[de]=Kdm,Display Manager,Xdm,Benutzer,Login,Logo,Stile,Sprachen,Länder,Schriften,Hintergründe,Hintergrundbilder,Beenden,Neustart +Keywords[el]=tdm,διαχειριστής οθόνης,xdm,χρήστες,σύνδεση,χαιρετισμός,Λογότυπο,στυλ,γλώσσα,χώρα,γραμματοσειρές,φόντο,ταπετσαρίες,συνεδρίες,τερματισμός,επανεκκίνηση +Keywords[eo]=tdm,ekrano,,xdm,uzantoj,saluto,emblemo,stilo,lingvo,lando,tiparo,fono,tapeto,seanco,adaiaŭo,relanĉo +Keywords[es]=tdm,gestor de pantalla,xdm,usuarios,entrada,acceso,saludo,Logo,estilos,idioma,país,tipos de letra,fondo,tapices,sesiones,apagar,reiniciar +Keywords[et]=tdm,ekraanihaldur,xdm,kasutajad,sisselogimine,tervitus,logo,stiil,keel,riik,fondid,taust,taustapilt,seansid,töö lõpetamine,taaskäivitamine +Keywords[eu]=tdm,pantaila kudeatzailea,xdm,erabiltzaileak,Saio hasiera,agurra,Logoa,estiloak,hizkuntza, herrialdea,letra-tipoak,atzeko planoa,horma-irudiak,saioak,itzali,berrabiarazi +Keywords[fa]=tdm، مدیر نمایش، xdm، کاربران، ورود، تبریک، آرمِ، سبک، زبان، کشور، قلمها، زمینه، کاغذهای دیواری، نشستها، تعطیل، بازآغازی +Keywords[fi]=tdm,näytönhallinta ,xdm,käyttäjät,sisäänkirjautuminen,tervehdys,Logo,tyylit,kieli,maa,kirjasimet,tausta,istunnot,sammutus,uudelleenkäynnistys +Keywords[fr]=tdm,gestionnaire d'affichage,xdm,utilisateurs,login,connexion,bienvenue,message de bienvenue,Logo,styles,langue,pays,style,police,fond d'écran,papier peint,session,arrêt,logout,redémarrage,reboot +Keywords[fy]=tdm,display manager,xdm,users,login,begroeting,oanmelde,brûkers,Oanmeldbehearder,logo,stylen,taal,language,country,lân,fonts,lettertypen,eftergrûn,wallpapers,behang,sesjes,shutdown,restart,ôfslute,opnij begjinne,oanmelde +Keywords[ga]=tdm,bainisteoir scáileáin,xdm,úsáideoirí,logáil isteach,fáilte,Lógó,stíleanna,teanga,tír,clónna,clófhoirne,cúlra,cúlbhrait,seisiúin,múchadh,atosú +Keywords[gl]=tdm,xestor de entrada,xdm,usuarios,identificación,Logo,estilos,lingua,país,fontes,fondo,papeis tapiz,sesións,apagado,reinício +Keywords[he]=משתמשים,כניסה למערכת,כניסה,לוגו,סגנונות,שפה,מדינה,גופנים,רקע,טפטים,הפעלות,כיבוי,הפעלה,מחדש,מנהל,תצוגה,display,manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart +Keywords[hi]=केडीएम,प्रकटन प्रबंधक,एक्स-डीएम,उपयोक्ता,लॉगइन,शुभकामनाएँ,लोगो,पृष्ठभूमि,वालपेपर्स,सत्र,बन्द, फिर से चालू +Keywords[hr]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,upravljanje zaslona,korisnici,prijava,pozdrav,stilovi,jezik,država,zemlja,fontovi,pozadina,pozadina radne površine,sesije,gašenje,ponovno pokretanje +Keywords[hu]=tdm,képernyőkezelő,xdm,felhasználók,bejelentkezés,üdvözlés,embléma,stílusok,nyelv,ország,betűtípusok,háttér,tapéták,munkafolyamatok,leállítás,újraindítás +Keywords[is]=tdm,skjár,gluggastjóri,innskráning,innstimplun,snið,tungumál,land,letur,bakgrunnur,bakgrunnar,veggfóður,setur,slökkva,endurræsa +Keywords[it]=tdm,display manager,gestione degli utenti,xdm,utenti,login,accesso,benvenuto,logo,stile,lingua,stato,paese,tipi di carattere,sfondo,immagine di sfondo,sessioni,riavvio,spegnimento,gestione degli accessi +Keywords[ja]=tdm,ディスプレイマネージャ,xdm,ユーザ,ログイン,あいさつ,ロゴ,スタイル,言語,国,フォント,背景,壁紙,セッション,シャットダウン,再起動 +Keywords[km]=tdm,កម្មវិធីគ្រប់គ្រងការបង្ហាញ,xdm,អ្នកប្រើ,ចូល,ស្វាគមន៍,រូបសញ្ញា,រចនាប័ទ្ម,ភាសា,ប្រទេស,ពុម្ពអក្សរ,ផ្ទៃខាងក្រោយ,ក្រដាសបិទជញ្ជាំង,សម័យ,បិទ,ចាប់ផ្ដើមឡើងវិញ +Keywords[lt]=tdm,display manager,ekrano tvarkyklė,xdm,users,naudotojai,login,registracija,greeting,pasveikinimas,Logo, styles,stiliai,language,country,fonts,background,wallpapers,sessions, shutdown,restart +Keywords[lv]=tdm,displeja menedžeris,xdm,lietotāji,pieteikšanās,apsveikums,Logo,stili,valoda,valsts,fonti,fons,tapetes,sesijas,nošaut,pārstartēt +Keywords[mk]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,менаџер на екран,корисници,најава,поздрав,Лого,стилови,јазик,земја,фонтови,подлога,позадина,сесии,исклучување,рестартирање +Keywords[mn]=Kdm,Display Manager,Xdm,Хэрэглэгч,Login,Logo,Хэлбэр,Хэл,Улс,Бичиг,Дэвсгэр,Дэвсгэр зураг,Дуусгах,Шинээр эхлүүлэх +Keywords[mt]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,merħba,lingwa,pajjiż,sfond,itfi,irristartja +Keywords[nb]=tdm,skjermbehandler,xdm,brukere,innlogging,velkomst,logo,stiler,språk,land,skrifttyper,bakgrunn,bakgrunnsbilde,økter,skru av,slå av,omstart +Keywords[nds]=tdm,Startschirm,xdm,Bruker,anmellen,greeting,Logo,Stilen,Spraak,Land,Schriftoorden,Achtergrund,Tapeten,Törns,Utmaken,Nieg starten +Keywords[ne]=tdm, प्रदर्शन प्रबन्धक, xdm, प्रयोगकर्ताहरू, लगइन, अभिवादन, परिचायक चिन्ह, शैलीहरू, भाषा, देश, फन्टहरू, पृष्ठभूमि,वालपेपरहरू, सत्र, बन्द गर्नुहोस्, फेरि सुरु गर्नुहोस् +Keywords[nl]=tdm,display manager,xdm,users,login,begroeting,inloggen,gebruikers,loginbeheerder,logo,stijlen,taal,language,country,land,fonts,lettertypen,achtergrond,wallpapers,behang,sessies,shutdown,restart,afsluiten,herstarten,aanmelden,opstarten +Keywords[nn]=tdm,xdm,brukarar,innlogging,helsing,logo,stil,språk,land,skrifttypar,bakgrunn,bakgrunnsbilete,økt,avslutt,slå av,omstart +Keywords[nso]=tdm,molaodi wa pontsho,xdm,badirisi,tseno,madume,Logo,mekgwa,leleme,naga,difonto,bokamorago,di-wallpaper,ditiragalo,timo,thomaleswa +Keywords[pa]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart, ਲੋਗੋ, ਭਾਸ਼ਾ, ਦੇਸ਼, ਫੋਂਟ, ਲਾਗਿੰਨ, ਉਪਭੋਗੀ,ਸ਼ੈਸ਼ਨ +Keywords[pl]=tdm,menedżer ekranu,xdm,użytkownicy,logowanie,powitanie,Logo,style,jezyk,kraj,czcionki,tło,tapety,sesje,zamknięcie systemu,restart,rozpoczęcie pracy +Keywords[pt]=tdm,gestor de 'logins',xdm,utilizadores,saudação,logótipo,estilos,língua,país,tipos de letra,fundo,papéis de parede,sessões,terminar,reiniciar +Keywords[pt_BR]=tdm,gerenciador de tela, xdm,usuários,login,saudação,Logo,estilos,linguagem,país,fontes, papéis de parede,sessões,desligar,reiniciar +Keywords[ro]=tdm,manager de ecran,xdm,utilizatori,logare,întîmpinare,logo,stiluri,limbaj,țară,fonturi,fundal,imagini de fundal,sesiuni,oprire,restartare +Keywords[ru]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,перезагрузка,сеанс,шрифты,страна,фон,стили,обои +Keywords[rw]=tdm,kwerekana umuyobozi,xdm,abakoresha,ifashayinjira,gusuhuza,ikirango,imisusire,ururimi,igihugu,imyandikire,mbuganyuma,impapurorukuta,imikoro,kuzimya,kongera gutangiza +Keywords[se]=tdm,xdm,geavaheaddjit,sisačáliheapmi,dearvvuođat,logo,stiila,giella,riika, fonttat,duogáš,duogášgovva,bargovuorut,heaittihit,časkit eret,ođđasit álggahit +Keywords[sk]=tdm,správca obrazovky,Login manažér,správca prihlásenia,xdm,používatelia,prihlásenie,login,privítanie,logo,štýly,jazyk,krajina,pozadie,tapety,sedenia,vypnutie,reset,reštart +Keywords[sl]=tdm,upravitelj zaslona,upravljalnik,xdm,uporabniki,prijava,login,pozdrav,logo,slogi,jezik,država,pisave,ozadje,tapete,seje,ugasnitev,vnovičen zagon +Keywords[sr]=tdm,display manager,xdm,users,login,greeting,Лого,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,менаџер,пријављивање,стил,језик,земља,фонтови,позадина,сесије,гашење +Keywords[sr@Latn]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,menadžer,prijavljivanje,stil,jezik,zemlja,fontovi,pozadina,sesije,gašenje +Keywords[sv]=tdm,display manager,xdm,användare,inloggning,välkomsttext,Logo,stilar,språk,land,teckensnitt,bakgrund,skrivbordsunderlägg,sessioner,stäng av,starta om +Keywords[ta]=கேடிஎம்,காட்சி மேலாளர்,xdm,பயன்படுத்துபவர்,உள்நுழை,வாழ்த்து,சின்னம்,பாணிகள்,மொழி,நாடு,எழுத்துருக்கள்,பின்னணி,வால்பேப்பர்கள்,பகுதிகள்,முடித்தல்,தொடங்குதல் +Keywords[th]=tdm,ตัวจัดการจอแสดงผล,xdm,ผู้ใช้,ล็อกอิน, ทักทาย,โลโก้,รูปแบบ,ภาษา,ประเทศ,แบบอักษร,พื้นหลัง, วอลล์เปเปอร์,วาระ,ปิด,เริ่มการทำงานใหม่ +Keywords[tr]=tdm,görüntü yönetici,xdm,kullanıcılar,oturum açma,karşılama,logo,stiller,dil,ülke,yazı tipleri,artalan,duvar kağıtları,oturumlar,kapat,tekrar başlat +Keywords[uk]=tdm,менеджер дисплеїв,xdm,користувачі,реєстрація,привітання,логотип,стилі,мова,країна,шрифти,тло,шпалери,сеанси,вимикання,перезапуск +Keywords[uz]=tdm,kirish boshqaruvchisi,xdm,foydalanuvchilar,kirish,salomlashish,Belgi,uslublar,til,davlat,shriftlar,orqa fon,seanslar,oʻchirish,oʻchirib-yoqish +Keywords[uz@cyrillic]=tdm,кириш бошқарувчиси,xdm,фойдаланувчилар,кириш,саломлашиш,Белги,услублар,тил,давлат,шрифтлар,орқа фон,сеанслар,ўчириш,ўчириб-ёқиш +Keywords[ven]=tdm,mulanguli wau vhonisa,xdm,vhashumisi,u loga,dzindumeliso,logo,zwitaela,luambo,shango,fontu,murahu,mabammbiri a luvhondoni,tshitenwa,thutha,thomolosa +Keywords[vi]=tdm,quản lý hiển thị,xdm,người dùng,đăng nhập,chào hỏi,Biểu trưng,kiểu,ngôn ngữ,quốc gia,phông chữ,nền,ảnh nền,phiên đăng nhập,tắt máy,khởi động lại +Keywords[wa]=tdm,manaedjeu d' håynaedje,xdm,uzeus,login,wilikom,greeting,Logo,styles,stîles,lingaedje,payi,fontes,fond,fond del waitroûle,sessions,distinde,dislodjî,elodjî,s' elodjî,renonder +Keywords[xh]=tdm,umphathi womboniso,xdm,abasebenzisi,igama elithile,umbuliso,ilogo,iintlobo,ulwimi,ilizwe,ubungakanani bamagama, imvelaphi,amaphepha odonga,iintlanganiso,vala,qala kwakhona +Keywords[zh_CN]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,显示管理器,用户,登录,欢迎辞,标志,风格,语言,国家,字体,背景,墙纸,会话,关机,重启动 +Keywords[zh_TW]=tdm,display manager,xdm,users,login,greeting,Logo,styles,language,country,fonts,background,wallpapers,sessions,shutdown,restart,顯示管理程式,使用者,登入,歡迎,風格,語言,國家,字型,背景,底圖,工作階段,關機,重新啟動 +Keywords[zu]=tdm,Imenenja yokuveza,xdm,abasebenzisi,ukungena ngaphakathi,isibingelelo,Isiqubulo,izitayela,ulimi,izwe,izinhlobo zamagama, inkundla yangemuva,emaphepha ezindonga,iziqendu,vala,phinda uqale + +Categories=Qt;KDE;X-KDE-settings-system; |