Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
kdebase4-wallpapers
kdm-fix-generic-greeter.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdm-fix-generic-greeter.diff of Package kdebase4-wallpapers
Subject: Fix broken KDM layout with fingerprint support From: Lubos Lunak Patch-upstream: not yet Bug: bnc#533189 Relates: kdm-fix-labelcolors.diff, same-pam-generic-classic.diff --- workspace/kdm/kfrontend/kgreeter.cpp.sav 2010-03-05 17:58:35.000000000 +0100 +++ workspace/kdm/kfrontend/kgreeter.cpp 2010-03-05 17:59:26.000000000 +0100 @@ -915,8 +915,6 @@ KThemedGreeter::KThemedGreeter( KdmTheme timed_label = themer->findNode( "timed-label" ); KdmItem *itm; - if ((itm = themer->findNode( "pam-message" ))) // done via msgboxes - itm->setVisible( false ); if ((itm = themer->findNode( "language_button" ))) // not implemented yet itm->setVisible( false ); --- workspace/kdm/kfrontend/themes/greeter.dtd.sav 2010-03-05 17:58:35.000000000 +0100 +++ workspace/kdm/kfrontend/themes/greeter.dtd 2010-03-05 17:59:26.000000000 +0100 @@ -19,9 +19,9 @@ Items with these IDs get special treatme caps-lock-warning | xauth-warning | pam-error | timed-label | login_button | session_button | system_button Items with these IDs might get special treatment by conversation plugins: - talker | domain-entry | user-entry | pw-entry + talker | domain-entry | user-entry | pw-entry | pam-message Items with these IDs are always hidden: - pam-message | language_button + language_button --> <!ATTLIST item --- workspace/libs/kdm/kgreet_generic.cpp.sav 2009-01-30 09:39:18.000000000 +0100 +++ workspace/libs/kdm/kgreet_generic.cpp 2010-03-05 17:59:26.000000000 +0100 @@ -41,24 +41,13 @@ extern KDE_EXPORT KGreeterPluginInfo kgr static int echoMode; -class KDMPasswordEdit : public KLineEdit { -public: - KDMPasswordEdit( QWidget *parent = 0 ) : KLineEdit( parent ) - { - if (::echoMode == -1) - setPasswordMode( true ); - else - setEchoMode( ::echoMode ? Password : NoEcho ); - setContextMenuPolicy( Qt::NoContextMenu ); - } -}; - KGenericGreeter::KGenericGreeter( KGreeterPluginHandler *_handler, QWidget *parent, const QString &_fixedEntity, Function _func, Context _ctx ) : QObject(), KGreeterPlugin( _handler ), + m_label( 0 ), m_lineEdit( 0 ), fixedUser( _fixedEntity ), func( _func ), @@ -66,22 +55,45 @@ KGenericGreeter::KGenericGreeter( KGreet exp( -1 ), running( false ) { - m_parentWidget = new QWidget( parent ); - m_parentWidget->setObjectName( "talker" ); - // XXX set some minimal size - widgetList << m_parentWidget; - m_grid = new QGridLayout( m_parentWidget ); - m_grid->setMargin( 0 ); + QGridLayout *grid = 0; + if (!_handler->gplugHasNode( "pam-message" ) || + !_handler->gplugHasNode( "pam-prompt" )) { + parent = new QWidget( parent ); + parent->setObjectName( "talker" ); + widgetList << parent; + grid = new QGridLayout( parent ); + grid->setMargin( 0 ); + } if (ctx == ExUnlock || ctx == ExChangeTok) fixedUser = KUser().loginName(); + + m_label = new QLabel( parent ); + if( grid ) { + m_label->setMinimumWidth( + m_label->fontMetrics().width( "A username" ) ); + grid->addWidget( m_label, 0, 0 ); + } else { + m_label->setObjectName( "pam-message" ); + widgetList << m_label; + } + m_lineEdit = new KLineEdit( parent ); + m_label->setBuddy( m_lineEdit ); + if( grid ) { + m_lineEdit->setMinimumWidth( + m_lineEdit->fontMetrics().width( "This is a long password" ) ); + grid->addWidget( m_lineEdit, 0, 1 ); + } else { + m_lineEdit->setObjectName( "pam-prompt" ); + widgetList << m_lineEdit; + } } // virtual KGenericGreeter::~KGenericGreeter() { abort(); - delete m_parentWidget; + qDeleteAll( widgetList ); } void // virtual @@ -127,8 +139,7 @@ KGenericGreeter::setEnabled( bool enable { // assert( func == Authenticate && ctx == Shutdown ); // XXX this is likely to bear some bogosity - foreach (QWidget *w, m_children) - w->setEnabled( enable ); + m_lineEdit->setEnabled( enable ); if (enable && m_lineEdit) m_lineEdit->setFocus(); } @@ -143,9 +154,7 @@ KGenericGreeter::textMessage( const char revive(); QString qtext = QString::fromUtf8( text ); m_infoMsgs.append( qtext ); - QLabel *label = new QLabel( qtext, m_parentWidget ); - m_grid->addWidget( label, m_line++, 0, 1, 2 ); - m_children.append( label ); + m_label->setText( qtext ); return true; } @@ -168,15 +177,19 @@ KGenericGreeter::textPrompt( const char revive(); else m_infoMsgs.clear(); - - QLabel *label = new QLabel( QString::fromUtf8( prompt ).trimmed() ); - m_grid->addWidget( label, m_line, 0 ); - m_children.append( label ); m_echo = echo; + + m_label->setText( QString::fromUtf8( prompt ).trimmed()); + m_lineEdit->setContextMenuPolicy( Qt::NoContextMenu ); + m_lineEdit->setCompletionObject( 0 ); + m_lineEdit->disconnect( this ); + m_lineEdit->clear(); + m_lineEdit->setPasswordMode( false ); + m_lineEdit->setEchoMode( QLineEdit::Normal ); if (echo) { - m_lineEdit = new KLineEdit; - m_lineEdit->setContextMenuPolicy( Qt::NoContextMenu ); if (!exp) { + if (m_label->text().isEmpty()) + m_label->setText( i18n("&Username:")); if (!m_users.isEmpty()) { KCompletion *userNamesCompletion = new KCompletion; userNamesCompletion->setItems( m_users ); @@ -187,20 +200,18 @@ KGenericGreeter::textPrompt( const char if (!curUser.isEmpty()) { m_lineEdit->setText( curUser ); m_lineEdit->selectAll(); - connect( m_lineEdit, SIGNAL(selectionChanged()), SLOT(slotChanged()) ); } connect( m_lineEdit, SIGNAL(editingFinished()), SLOT(slotLoginLostFocus()) ); } connect( m_lineEdit, SIGNAL(editingFinished()), SLOT(slotChanged()) ); connect( m_lineEdit, SIGNAL(textChanged( const QString & )), SLOT(slotChanged()) ); } else { - m_lineEdit = new KDMPasswordEdit; + if (::echoMode == -1) + m_lineEdit->setPasswordMode( true ); + else + m_lineEdit->setEchoMode( ::echoMode ? QLineEdit::Password : QLineEdit::NoEcho ); + connect( m_lineEdit, SIGNAL(editingFinished()), SLOT(slotChanged()) ); } - m_lineEdit->setMinimumWidth( - m_lineEdit->fontMetrics().width( "This is a long password" ) ); - m_grid->addWidget( m_lineEdit, m_line, 1 ); - m_children.append( m_lineEdit ); - m_lineEdit->show(); m_lineEdit->setFocus(); } @@ -235,7 +246,6 @@ KGenericGreeter::next() if (m_lineEdit) { m_lineEdit->setEnabled( false ); QString text = m_lineEdit->text(); - m_lineEdit = 0; handler->gplugReturnText( text.toLocal8Bit(), !m_echo ? KGreeterPluginHandler::IsSecret : @@ -272,8 +282,7 @@ KGenericGreeter::failed() revive(); handler->gplugMsgBox( QMessageBox::Information, text ); } else { - foreach (QWidget *w, m_children) - w->setEnabled( false ); + m_lineEdit->setEnabled( false ); } exp = -1; running = false; @@ -283,12 +292,9 @@ void // virtual KGenericGreeter::revive() { // assert( !running ); - foreach (QWidget *w, m_children) - w->deleteLater(); - m_children.clear(); m_infoMsgs.clear(); - m_lineEdit = 0; - m_line = 0; + m_lineEdit->clear(); + m_lineEdit->setEnabled( true ); } void // virtual --- workspace/libs/kdm/kgreet_generic.h.sav 2008-09-29 11:21:52.000000000 +0200 +++ workspace/libs/kdm/kgreet_generic.h 2010-03-05 17:59:26.000000000 +0100 @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fi #include <QObject> -class QGridLayout; class QWidget; class KLineEdit; @@ -68,10 +67,9 @@ class KGenericGreeter : public QObject, void slotChanged(); private: - QGridLayout *m_grid; QList<QWidget *> m_children; + QLabel *m_label; KLineEdit *m_lineEdit; - QWidget *m_parentWidget; QList<QString> m_infoMsgs; QString fixedUser, curUser; QStringList m_users; --- workspace/kdm/kfrontend/themes/oxygen-air/oxygen-air.xml.sav 2009-10-02 10:19:23.000000000 +0200 +++ workspace/kdm/kfrontend/themes/oxygen-air/oxygen-air.xml 2010-02-23 15:06:51.856126479 +0100 @@ -27,11 +27,12 @@ <stock type="welcome-label"/> </item> - <item type="rect" id="user-field"> + <item type="rect" id="talker"> <pos anchor="c" x="50%" y="43%" width="400" height="144"/> <box orientation="vertical" spacing="0" homogeneous="true"> - <item type="pixmap" butoon="true"> + <item type="pixmap" button="true"> + <show type="!plugin-specific-generic"/> <normal file="user-entry.png"/> <prelight file="user-entry-li.png"/> <active file="user-entry-li.png"/> @@ -39,18 +40,32 @@ </item> <item type="entry" id="user-entry"> + <show type="!plugin-specific-generic"/> <pos anchor="c" x="52%" y="0%" width="110" height="22"/> </item> <item type="pixmap"> + <show type="!plugin-specific-generic"/> <normal file="pw-entry.png"/> <prelight file="pw-entry-li.png"/> <pos anchor="c" x="50%" y="100%"/> </item> <item type="entry" id="pw-entry"> + <show type="!plugin-specific-generic"/> <pos anchor="c" x="52%" y="0%" width="110" height="22"/> </item> + + <item type="label" id="pam-message"> + <show type="plugin-specific-generic"/> + <pos anchor="n" x="50%" y="30%" width="90%" height="22"/> + <text> </text> + </item> + + <item type="entry" id="pam-prompt"> + <show type="plugin-specific-generic"/> + <pos anchor="c" x="50%" y="30%" width="90%" height="22"/> + </item> </box> </item>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor