summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-09 17:10:30 +0200
committerSimon Rettberg2015-10-09 17:10:30 +0200
commite9eb8c4a421c2c406e1ada4c866b2ae9268d647d (patch)
tree45df627da45839c86787aa1c4562ab99cc38db65 /src
parentMerge branch 'master' of dnbd3:openslx-ng/printergui (diff)
downloadprintergui-e9eb8c4a421c2c406e1ada4c866b2ae9268d647d.tar.gz
printergui-e9eb8c4a421c2c406e1ada4c866b2ae9268d647d.tar.xz
printergui-e9eb8c4a421c2c406e1ada4c866b2ae9268d647d.zip
[pwgui] Also use the grayed out fake background
Diffstat (limited to 'src')
-rw-r--r--src/backdrop.cpp (renamed from src/maingui/backdrop.cpp)0
-rw-r--r--src/backdrop.h (renamed from src/maingui/backdrop.h)0
-rw-r--r--src/maingui/main.cpp2
-rw-r--r--src/maingui/printergui.cpp10
-rw-r--r--src/pwgui/main.cpp11
-rw-r--r--src/pwgui/pwgui.cpp5
6 files changed, 22 insertions, 6 deletions
diff --git a/src/maingui/backdrop.cpp b/src/backdrop.cpp
index 4a907e8..4a907e8 100644
--- a/src/maingui/backdrop.cpp
+++ b/src/backdrop.cpp
diff --git a/src/maingui/backdrop.h b/src/backdrop.h
index b798a89..b798a89 100644
--- a/src/maingui/backdrop.h
+++ b/src/backdrop.h
diff --git a/src/maingui/main.cpp b/src/maingui/main.cpp
index 25f81a0..58ace07 100644
--- a/src/maingui/main.cpp
+++ b/src/maingui/main.cpp
@@ -2,7 +2,7 @@
#include <QMessageBox>
#include <fstream>
#include "printergui.h"
-#include "backdrop.h"
+#include "../backdrop.h"
#include <fcntl.h>
#include <sys/stat.h>
diff --git a/src/maingui/printergui.cpp b/src/maingui/printergui.cpp
index 21e03f4..0dd9e13 100644
--- a/src/maingui/printergui.cpp
+++ b/src/maingui/printergui.cpp
@@ -112,7 +112,15 @@ void PrinterGui::initializeUI()
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
this->move( desktopRect.width()/2-this->width()/2,
desktopRect.height()/2-this->height()/2);
- this->setWindowTitle(QString::fromUtf8("Drucken - %1").arg(this->user));
+ const char *docName;
+ docName = getenv("J");
+ if (docName == NULL) {
+ docName = getenv("N");
+ }
+ if (docName == NULL) {
+ docName = "Untitled";
+ }
+ this->setWindowTitle(QString::fromUtf8("Drucken - %1 [%2]").arg(this->user, QString::fromUtf8(docName)));
this->show();
this->showNormal();
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index b916259..65fd469 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -1,4 +1,5 @@
#include "pwgui.h"
+#include "../backdrop.h"
#include "config.h"
#include <QApplication>
#include <QMessageBox>
@@ -183,8 +184,14 @@ int main(int argc, char *argv[])
helper_dropprivs();
helper_copyenv();
QApplication a(argc, argv);
- PwGui w(pfd[1], creds);
- w.show();
+ Backdrop *bg = new Backdrop;
+ bg->show();
+ bg->raise();
+ bg->activateWindow();
+ bg->move(0, 0);
+ PwGui *w = new PwGui(pfd[1], creds);
+ bg->setMainWindow(w);
+ w->show();
exit(a.exec());
return CUPS_BACKEND_FAILED;
}
diff --git a/src/pwgui/pwgui.cpp b/src/pwgui/pwgui.cpp
index 193341b..b6130f0 100644
--- a/src/pwgui/pwgui.cpp
+++ b/src/pwgui/pwgui.cpp
@@ -29,6 +29,9 @@ PwGui::~PwGui()
void PwGui::initializeUI(char *user)
{
ui->setupUi(this);
+ this->setWindowModality(Qt::ApplicationModal);
+ // Put always on top
+ this->setWindowFlags(Qt::Dialog | Qt::WindowStaysOnTopHint);
// Prefill username
if (user != NULL) {
@@ -41,8 +44,6 @@ void PwGui::initializeUI(char *user)
/* Main Window properties */
- // Disable close button
- this->setWindowFlags((this->windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::WindowStaysOnTopHint);
// center dialog on screen center
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
this->move( desktopRect.width()/2-this->width()/2,