source: src-qt4/qsudo/mainwindow.cpp @ b633c064

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since b633c064 was b633c064, checked in by Kris Moore <kris@…>, 9 months ago

Add new qsudo "sudo" password helper app

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/****************************************************************************
2** ui.h extension file, included from the uic-generated form implementation.
3**
4** If you want to add, delete, or rename functions or slots, use
5** Qt Designer to update this file, preserving your code.
6**
7** You should not define a constructor or destructor in this file.
8** Instead, write your code in functions called init() and destroy().
9** These will automatically be called by the form's constructor and
10** destructor.
11*****************************************************************************/
12#include <QDebug>
13#include <QDir>
14#include <QString>
15#include <QTextStream>
16#include "mainwindow.h"
17#include "../config.h"
18
19void MainWindow::ProgramInit()
20{
21  connect(buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(slotButtonClicked(QAbstractButton *)));
22  connect(passwordLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
23}
24
25void MainWindow::slotReturnPressed()
26{
27  QTextStream cout(stdout);
28  cout << passwordLineEdit->text();
29  close();
30}
31
32void MainWindow::slotButtonClicked(QAbstractButton *myBut)
33{
34  if ( buttonBox->buttonRole(myBut) == QDialogButtonBox::AcceptRole ){
35    QTextStream cout(stdout);
36    cout << passwordLineEdit->text();
37  }
38  close();
39}
Note: See TracBrowser for help on using the repository browser.