summaryrefslogtreecommitdiffstats
path: root/src/pwgui/main.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-08 19:33:33 +0200
committerSimon Rettberg2015-10-08 19:33:33 +0200
commita163f2b5431ab8b274e7ac2e4b7dbf2299675905 (patch)
tree1a9e935ddf5c201cc268a89b647821b6c2c2d50d /src/pwgui/main.cpp
parentmove msgBox closer to center :) TOFIX (diff)
downloadprintergui-a163f2b5431ab8b274e7ac2e4b7dbf2299675905.tar.gz
printergui-a163f2b5431ab8b274e7ac2e4b7dbf2299675905.tar.xz
printergui-a163f2b5431ab8b274e7ac2e4b7dbf2299675905.zip
Add fullscreen bg to printergui; preserve job name
Diffstat (limited to 'src/pwgui/main.cpp')
-rw-r--r--src/pwgui/main.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index edd594c..5dd5a07 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -282,13 +282,21 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char *
}
}
setenv("DEVICE_URI", uri, 1);
- ERROR("DEVICE_URI: '%s'", uri);
+
char *args[8];
args[0] = uri;
args[1] = jobid;
args[2] = user;
- args[3] = title;
+ // Fix job title if possible
+ if (strncmp(title, "gui-", 4) == 0) {
+ args[3] = strchr(title, ' ');
+ if (args[3] == NULL) {
+ args[3] = title;
+ }
+ } else {
+ args[3] = title;
+ }
args[4] = copies;
args[5] = options;
args[6] = file;
@@ -316,7 +324,7 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char *
if (strstr(buffer, "Unable to get printer status (Unauthorized)") != NULL) {
needAuth = true;
if (kill(pid, SIGTERM) < 0) {
- ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, errno);
+ ERROR("Sending SIGTERM to backend %d failed: %d\n", (int)pid, (int)errno);
}
break;
} else if (strstr(buffer, "Destination printer does not exist") != NULL) {