From 21e57a7f1da4dd34ee401a8d28662ac7d93ed6b4 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Thu, 15 Oct 2009 10:38:47 +0200 Subject: [PATCH] Ora capisce l'utente che sta lanciando il programma e ha l'immagine --- DrPrintBackend.py | 2 +- DrPrintGui/Input.py | 4 ++-- DrPrintGui/MainWin.py | 16 +++++++++++++++- setup.py | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/DrPrintBackend.py b/DrPrintBackend.py index afa790a..190f5f2 100644 --- a/DrPrintBackend.py +++ b/DrPrintBackend.py @@ -54,7 +54,7 @@ class Backend(gobject.GObject): ## Da a if not page_range == None: - cmd_opts += "-o page-ranges=%s" % page_range + cmd_opts += "-o page-ranges=%s " % page_range ## Orientazione (se è vuoto è verticale) if not orientation == "": diff --git a/DrPrintGui/Input.py b/DrPrintGui/Input.py index 27cedbf..d7a6ac3 100644 --- a/DrPrintGui/Input.py +++ b/DrPrintGui/Input.py @@ -1,6 +1,6 @@ ## This library provides User Input fields -import gtk, pygtk, gobject +import gtk, pygtk, gobject, os class LeftAlignedLabel(gtk.Alignment): @@ -35,7 +35,7 @@ class UsernameField(gtk.Entry): gtk.Entry.__init__(self) - self.set_text( "Utente" ) + self.set_text( os.getlogin() ) class PasswordField(gtk.Entry): diff --git a/DrPrintGui/MainWin.py b/DrPrintGui/MainWin.py index e8258f2..0d4903d 100644 --- a/DrPrintGui/MainWin.py +++ b/DrPrintGui/MainWin.py @@ -8,6 +8,8 @@ __author__ = 'Leonardo Robol ' import gtk, pygtk +import os +import sys from Input import AuthBlock, PrinterSettingsBlock, PrintButton, LeftAlignedLabel, PageRangeBlock, OrientationSelect, SidesSelect from Dialogs import ErrorDialog @@ -40,14 +42,26 @@ class MainWin(gtk.Window): layout_box = gtk.VBox() layout_box.set_spacing( self.default_spacing ) + # Inseriamo l'immagine di Dr Print + drprint_img = gtk.image_new_from_file("/usr/share/drprint/drprint_gui.png") + # Qualche istruzinoe preliminare label = gtk.Label() label.set_markup("Come usare questo programma:\n\ 1) Inserire nome utente e password \n2) Scegliere il file da stampare e la\ stampante \n3) Premere il tasto stampa") - layout_box.pack_start( label , 20 ) + hbox = gtk.HBox(); + hbox.show() + hbox.set_spacing(self.default_spacing) + + hbox.pack_start(drprint_img) + drprint_img.show() + + hbox.pack_start( label ) label.show() + + layout_box.pack_start(hbox, 20) label = LeftAlignedLabel("Autenticazione (sui computer dell'Aula 4)") layout_box.pack_start( label ) diff --git a/setup.py b/setup.py index e1d6774..9286b82 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ setup (name='DrPrint', packages = ['DrPrintGui'], py_modules=['DrPrintBackend'], data_files=[('bin', ['drprint']), + ('share/drprint',['drprint_gui.png']), ('share/applications',['drprint.desktop']), - ('share/pixmaps', ['drprint.svg']) ], + ('share/pixmaps', ['drprint.png']) ], ) -- 2.1.4