diff options
Diffstat (limited to 'kcontrol/tdm/tdm-users.cpp')
-rw-r--r-- | kcontrol/tdm/tdm-users.cpp | 78 |
1 files changed, 43 insertions, 35 deletions
diff --git a/kcontrol/tdm/tdm-users.cpp b/kcontrol/tdm/tdm-users.cpp index fe2f31c65..5195c3bfd 100644 --- a/kcontrol/tdm/tdm-users.cpp +++ b/kcontrol/tdm/tdm-users.cpp @@ -48,7 +48,7 @@ extern KSimpleConfig *config; TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) : TQWidget(parent, name) { -#ifdef __linux__ +#ifdef Q_OS_LINUX struct stat st; if (!stat( "/etc/debian_version", &st )) { /* debian */ defminuid = "1000"; @@ -66,10 +66,18 @@ TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) defminuid = "500"; defmaxuid = "65000"; } -#else +#elif defined(Q_OS_SOLARIS) + struct stat st; + if (stat( "/etc/dilos_version_build", &st ) == 0) { /* DilOS */ + defminuid = "1000"; + } else { /* other illumos distro */ + defminuid = "100"; + } + defmaxuid = "60000"; +#else /* default */ defminuid = "1000"; defmaxuid = "65000"; -#endif +#endif /* default */ // We assume that $kde_datadir/tdm exists, but better check for pics/ and pics/users, // and create them if necessary. @@ -85,30 +93,30 @@ TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) TQString wtstr; - minGroup = new TQGroupBox( 2, Qt::Horizontal, i18n("System U&IDs"), this ); + minGroup = new TQGroupBox( 2, TQt::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) ); + TQValidator *valid = new TQIntValidator( 0, 999999, 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()) ); + connect( leminuid, TQ_SIGNAL(textChanged( const TQString & )), TQ_SLOT(slotChanged()) ); + connect( leminuid, TQ_SIGNAL(textChanged( const TQString & )), TQ_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()) ); + connect(lemaxuid, TQ_SIGNAL(textChanged( const TQString & )), TQ_SLOT(slotChanged()) ); + connect(lemaxuid, TQ_SIGNAL(textChanged( const TQString & )), TQ_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()) ); + usrGroup = new TQButtonGroup( 5, TQt::Vertical, i18n("Users"), this ); + connect( usrGroup, TQ_SIGNAL(clicked( int )), TQ_SLOT(slotShowOpts()) ); + connect( usrGroup, TQ_SIGNAL(clicked( int )), TQ_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.") ); @@ -121,7 +129,7 @@ TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) "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()) ); + connect( cbusrsrt, TQ_SIGNAL(toggled( bool )), TQ_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.") ); @@ -132,27 +140,27 @@ TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) 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()) ); + connect( optinlv, TQ_SIGNAL(clicked( TQListViewItem * )), + TQ_SLOT(slotUpdateOptIn( TQListViewItem * )) ); + connect( optinlv, TQ_SIGNAL(clicked( TQListViewItem * )), + TQ_SLOT(slotChanged()) ); optoutlv = new TDEListView( 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()) ); + connect( optoutlv, TQ_SIGNAL(clicked( TQListViewItem * )), + TQ_SLOT(slotUpdateOptOut( TQListViewItem * )) ); + connect( optoutlv, TQ_SIGNAL(clicked( TQListViewItem * )), + TQ_SLOT(slotChanged()) ); - faceGroup = new TQButtonGroup( 5, Qt::Vertical, i18n("User Image Source"), this ); + faceGroup = new TQButtonGroup( 5, TQt::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()) ); + connect( faceGroup, TQ_SIGNAL(clicked( int )), TQ_SLOT(slotFaceOpts()) ); + connect( faceGroup, TQ_SIGNAL(clicked( int )), TQ_SLOT(slotChanged()) ); rbadmonly = new TQRadioButton( i18n("Admin"), faceGroup ); rbprefadm = new TQRadioButton( i18n("Admin, user"), faceGroup ); rbprefusr = new TQRadioButton( i18n("User, admin"), faceGroup ); @@ -162,29 +170,29 @@ TDMUsersWidget::TDMUsersWidget(TQWidget *parent, const char *name) 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()) ); + connect( usercombo, TQ_SIGNAL(activated( int )), + TQ_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()) ); + connect( userbutton, TQ_SIGNAL(clicked()), + TQ_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()) ); + connect( rstuserbutton, TQ_SIGNAL(clicked()), + TQ_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 ); + hlpl->addMultiCellWidget( userbutton, 1,1, 0,1, TQt::AlignHCenter ); + hlpl->addMultiCellWidget( rstuserbutton, 2,2, 0,1, TQt::AlignHCenter ); TQHBoxLayout *main = new TQHBoxLayout( this, 10 ); @@ -219,7 +227,7 @@ void TDMUsersWidget::makeReadOnly() rbprefusr->setEnabled(false); rbusronly->setEnabled(false); wstack->setEnabled(false); - disconnect( userbutton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUserButtonClicked()) ); + disconnect( userbutton, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotUserButtonClicked()) ); userbutton->setAcceptDrops(false); rstuserbutton->setEnabled(false); } @@ -264,7 +272,7 @@ void TDMUsersWidget::slotUserSelected() rstuserbutton->setEnabled( false ); } if (!p.isNull()) { - userbutton->setPixmap( p.smoothScale( 48, 48, TQ_ScaleMin ) ); + userbutton->setPixmap( p.smoothScale( 48, 48, TQImage::ScaleMin ) ); } } @@ -288,7 +296,7 @@ void TDMUsersWidget::changeUserPix(const TQString &pix) return; } - p = p.smoothScale( 48, 48, TQ_ScaleMin ); + p = p.smoothScale( 48, 48, TQImage::ScaleMin ); TQString userpix = m_userPixDir + user + ".face.icon"; if (!p.save( userpix, "PNG" )) KMessageBox::sorry(this, |