summaryrefslogtreecommitdiffstats
path: root/src/pwgui/pwgui.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2014-02-07 01:48:59 +0100
committerSimon Rettberg2014-02-07 01:48:59 +0100
commit8ae112083bbe26848f41d09c95559acb96b3ccb0 (patch)
treec9e4408acff35a608e41540e221c4232fb1384a6 /src/pwgui/pwgui.cpp
parentLots of changes: Two binaries (selection/pw auth), qmake -> cmake, gitignore,... (diff)
downloadprintergui-8ae112083bbe26848f41d09c95559acb96b3ccb0.tar.gz
printergui-8ae112083bbe26848f41d09c95559acb96b3ccb0.tar.xz
printergui-8ae112083bbe26848f41d09c95559acb96b3ccb0.zip
Getting there, slowly:
- Check if the backend is invoked as a result of the printergui sending a printjob If not, just relay to the real backend and appear transparent If yes, copy environment from the printergui (X access etc) and show the username/password dialog. - Drop privileges whereever neccessary (when invoking backend, when showing GUI) TODO: Use pipe to send user/pass to backend from the GUI. Make OK and Cancel in the GUI work.
Diffstat (limited to 'src/pwgui/pwgui.cpp')
-rw-r--r--src/pwgui/pwgui.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/pwgui/pwgui.cpp b/src/pwgui/pwgui.cpp
index 31dd822..448cee8 100644
--- a/src/pwgui/pwgui.cpp
+++ b/src/pwgui/pwgui.cpp
@@ -5,20 +5,24 @@
#include <QDesktopWidget>
// ____________________________________________________________________________
-PwGui::PwGui(QWidget *parent) :
+PwGui::PwGui(int pfd, QWidget *parent) :
QMainWindow(parent),
- ui(new Ui::PwGui) {
+ ui(new Ui::PwGui),
+ pipefd(pfd)
+{
// Initialize UI
initializeUI();
}
// ____________________________________________________________________________
-PwGui::~PwGui() {
+PwGui::~PwGui()
+{
delete ui;
}
// ____________________________________________________________________________
-void PwGui::initializeUI() {
+void PwGui::initializeUI()
+{
ui->setupUi(this);
/*
@@ -43,14 +47,16 @@ void PwGui::initializeUI() {
}
/*
-void PwGui::on_buttonCancel_clicked() {
+void PwGui::on_buttonCancel_clicked()
+{
// Quit with code 1
QCoreApplication::instance()->exit(1);
}
*/
// ____________________________________________________________________________
-void PwGui::on_checkStatusTimer() {
+void PwGui::on_checkStatusTimer()
+{
static int retries = 0;
if (++retries > 20) {
QCoreApplication::instance()->quit();