Modificato l'inserimento del numero delle pagine

Leonardo Robol [2009-09-29 16:47]
Modificato l'inserimento del numero delle pagine
Filename
DrPrintBackend.py
DrPrintGui/Input.py
diff --git a/DrPrintBackend.py b/DrPrintBackend.py
index a400399..a4b2a4a 100644
--- a/DrPrintBackend.py
+++ b/DrPrintBackend.py
@@ -50,19 +50,19 @@ class Backend(gobject.GObject):

         ## Pagine logiche per pagine
         if not page_per_page == 1:
-            cmd_opts += "number-up=%s " % str(page_per_page)
+            cmd_opts += "-o number-up=%s " % str(page_per_page)

         ## Da a
         if not page_range == None:
-            cmd_opts += "page-ranges=%s" % page_range
+            cmd_opts += "-o page-ranges=%s" % page_range

         ## Orientazione (se è vuoto è verticale)
         if not orientation == "":
-            cmd_opts += "%s " % orientation
+            cmd_opts += "-o %s " % orientation

         ## Se ci sono opzioni dai il -o e specificale
         if not cmd_opts == "":
-            cmd = cmd + "-o %s" % cmd_opts
+            cmd = cmd + "%s" % cmd_opts


         ## Diamo il comando sul canale e infiliamo il file
diff --git a/DrPrintGui/Input.py b/DrPrintGui/Input.py
index d03564a..6205820 100644
--- a/DrPrintGui/Input.py
+++ b/DrPrintGui/Input.py
@@ -278,14 +278,17 @@ class PageRangeBlock(gtk.VBox):
         return self.range_field.get_text()


-class CopiesField(gtk.Entry):
+class CopiesField(gtk.SpinButton):

     def __init__(self):

-        gtk.Entry.__init__(self)
+        gtk.SpinButton.__init__(self)
+        self.set_digits(0)
+        self.set_increments(1,10)
+        self.set_range(0,999)

     def get_copies(self):
-        return self.get_text()
+        return str(self.get_value())



@@ -301,27 +304,27 @@ class OrientationSelect(gtk.HBox):
         label.show()

         # I radio button :)
-        landscape = gtk.RadioButton(None,
+        self.landscape = gtk.RadioButton(None,
                                       "Orizzontale",
                                       True)

-        portrait  = gtk.RadioButton(landscape,
+        self.portrait  = gtk.RadioButton(self.landscape,
                                       "Verticale",
                                       True)
-        self.pack_start(landscape)
-        self.pack_start(portrait)
+        self.pack_start(self.landscape)
+        self.pack_start(self.portrait)

-        landscape.show ()
-        portrait.show  ()
+        self.landscape.show ()
+        self.portrait.show  ()

-        portrait.set_active(True)
+        self.portrait.set_active(True)

     def get_orientation(self):

-        if self.landscape.is_active():
+        if self.landscape.get_active():
             return "landscape"

-        if self.portrait.is_active():
+        if self.portrait.get_active():
             return ""

         ## Questo non dovrebbe succedere
ViewGit