Changeset b3051eb


Ignore:
Timestamp:
07/31/13 02:23:09 (14 months ago)
Author:
yurkis <yurkis@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
ab8473d
Parents:
0f0d3e6
Message:

Fix qsudo password input box behaviour

Location:
src-qt4/qsudo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/qsudo/mainwindow.cpp

    r115c84c rb3051eb  
    1717#include <QTextStream> 
    1818#include <QApplication> 
     19#include <QDialogButtonBox> 
     20#include <QPushButton> 
    1921#include "mainwindow.h" 
    2022#include "../config.h" 
     
    3335  connect(buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(slotButtonClicked(QAbstractButton *))); 
    3436  connect(passwordLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); 
     37  connect(passwordLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotPwdTextChanged(QString))); 
     38 
     39  QPushButton* btn= buttonBox->button(QDialogButtonBox::Ok); 
     40  if (btn) 
     41      btn->setEnabled(false); 
    3542} 
    3643 
    3744void MainWindow::slotReturnPressed() 
    3845{ 
    39   testPass(); 
     46    if (passwordLineEdit->text().length()) 
     47        testPass(); 
    4048} 
    4149 
     
    6775     if ( tries == 0 ) 
    6876       exit(1); 
     77     passwordLineEdit->setText(""); 
    6978  } else { 
    7079     startSudo(); 
     
    103112  QTextStream cout(stdout);  
    104113  cout << sudoProc->readAllStandardOutput(); 
     114} 
     115 
     116void MainWindow::slotPwdTextChanged(const QString &text) 
     117{ 
     118    QPushButton* btn= buttonBox->button(QDialogButtonBox::Ok); 
     119    if (btn) 
     120        btn->setEnabled(text.length()?true:false); 
    105121} 
    106122 
  • src-qt4/qsudo/mainwindow.h

    r115c84c rb3051eb  
    2525    void slotPrintStdErr(); 
    2626    void slotPrintStdOut(); 
     27    void slotPwdTextChanged ( const QString & text ); 
     28 
    2729 
    2830private: 
Note: See TracChangeset for help on using the changeset viewer.