summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Schneider2013-10-08 13:56:26 +0200
committerManuel Schneider2013-10-08 13:56:26 +0200
commit9fade0d6096807ed207c9a2c8d634251301a8e9a (patch)
treec4eb712f8f2213cef77748a6a2de81e18824544a
parentBuilds now a lowercase letter binary (diff)
downloadprintergui-9fade0d6096807ed207c9a2c8d634251301a8e9a.tar.gz
printergui-9fade0d6096807ed207c9a2c8d634251301a8e9a.tar.xz
printergui-9fade0d6096807ed207c9a2c8d634251301a8e9a.zip
Widgets disabled by default. A failed printjob spawns error dialog
-rw-r--r--src/main.cpp1
-rw-r--r--src/mainwindow.cpp9
-rw-r--r--src/mainwindow.ui27
3 files changed, 34 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2b97c95..4186bc5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,6 +2,7 @@
#include <fstream>
#include "mainwindow.h"
+
int main(int argc, char *argv[])
{
// First check parameter count
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index cc40d5e..2c56da2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1,7 +1,6 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
-#include <pwd.h>
-
+ #include <QMessageBox>
MainWindow::MainWindow(char *argv[], QWidget *parent) :
@@ -268,7 +267,11 @@ void MainWindow::on_buttonPrint_clicked()
NULL,
dest->num_options,
dest->options))
- return; // TODO ERROR OUTPUT
+ {
+ QMessageBox msgBox;
+ msgBox.setText(cupsLastErrorString());
+ msgBox.exec();
+ }
else // Quit with code 0
QCoreApplication::instance()->quit();
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index 0a56de6..022275e 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -38,6 +38,9 @@
<layout class="QHBoxLayout" name="horizontalLayoutUser">
<item>
<widget class="QLabel" name="labelUser">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>User:</string>
</property>
@@ -48,6 +51,9 @@
</item>
<item>
<widget class="QLineEdit" name="lineEditUser">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -60,6 +66,9 @@
</item>
<item row="2" column="0">
<widget class="QComboBox" name="comboBoxColor">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<item>
<property name="text">
<string>Graustufen</string>
@@ -74,6 +83,9 @@
</item>
<item row="3" column="0">
<widget class="QComboBox" name="comboBoxSides">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<item>
<property name="text">
<string>Simplex</string>
@@ -95,6 +107,9 @@
<layout class="QHBoxLayout" name="horizontalLayoutPass">
<item>
<widget class="QLabel" name="labelPass">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>Password:</string>
</property>
@@ -105,6 +120,9 @@
</item>
<item>
<widget class="QLineEdit" name="lineEditPass">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -135,6 +153,9 @@
</item>
<item>
<widget class="QPushButton" name="buttonPrint">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -152,6 +173,9 @@
<layout class="QHBoxLayout" name="horizontalLayoutCopies">
<item>
<widget class="QLabel" name="labelCopies">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>Anzahl Kopien:</string>
</property>
@@ -162,6 +186,9 @@
</item>
<item>
<widget class="QLineEdit" name="lineEditCopies">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>