Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/printtoolbar.py
diff options
context:
space:
mode:
authoriwikiwi <iwikiwi@localhost.localdomain>2009-06-30 06:30:26 (GMT)
committer iwikiwi <iwikiwi@localhost.localdomain>2009-06-30 06:30:26 (GMT)
commit1d5d2e992192d79d6e90dd13da4a566bc9cc66ef (patch)
treed5b11b525c68ecee3af4c99327cbdd8dc31e324b /printtoolbar.py
parent56b0fb8b6e01540f36b32236cdc6b064346bae6b (diff)
A gtk version of printscript.py; A cups verion of printscript.py, final version of printerdeviceicon, allworking
Diffstat (limited to 'printtoolbar.py')
-rw-r--r--printtoolbar.py86
1 files changed, 83 insertions, 3 deletions
diff --git a/printtoolbar.py b/printtoolbar.py
index 2132b16..386042b 100644
--- a/printtoolbar.py
+++ b/printtoolbar.py
@@ -41,7 +41,8 @@ class PrintToolbar(gtk.Toolbar):
self._evince_view = evince_view
self._document = None
-
+ self._title = title
+ self._path = tempfile
self._pdf = ToolButton('document-save')
self._pdf.set_tooltip(_('save-PDF'))
@@ -64,12 +65,91 @@ class PrintToolbar(gtk.Toolbar):
self._USB.connect('clicked', self.printing)
def printing(self, widget):
- printdialog = PrinterSetup(self._title, self._path)
+ justPrint = JustPrint(self._title, self._path)
+ justPrint.Printit()
+
+ def setTitlePath(self, title, path):
+ self._title = title
+ self._path = path
+
+class PrintSetupToolbar(gtk.Toolbar):
+ __gtype_name__= 'PrintSetupToolbar'
+
+
+ def __init__(self, evince_view, title=None, tempfile=None):
+ gtk.Toolbar.__init__(self)
+
+ self._evince_view = evince_view
+ self._document = None
+ self._title = title
+ self._path = tempfile
+
+ total_page_item = gtk.ToolItem()
+
+ self._noOfPagesL = gtk.Label('Select Pages ')
+ self._noOfPagesL.show()
+ total_page_item.add(self._noOfPagesL)
+ total_page_item.show()
+ self.insert(total_page_item, -1)
+ self._noOfPagesTB = gtk.Entry()
+ self._noOfPagesTB.connect("activate", self.TBfunction,
+ gtk.RESPONSE_OK)
+ self._noOfPagesTB.set_editable(True)
+ self._noOfPagesTB.show()
+ total_page_item1 = gtk.ToolItem()
+
+ total_page_item1.add(self._noOfPagesTB)
+ total_page_item1.show()
+ self.insert(total_page_item1, -1)
+ printerEnumerationObj = EnumeratePrinters()
+ printerObjList = printerEnumerationObj.getPrinter()
+ self._printerComboBox = gtk.combo_box_new_text()
+ self._printerComboBox.append_text('Printer:')
+
+ for printer in printerObjList:
+
+ self._printerComboBox.append_text(printer)
+
+ self._printerComboBox.connect('changed', self.changed_cb)
+ self._printerComboBox.set_active(0)
+ self._printerComboBox.show()
+ total_page_item2 = gtk.ToolItem()
+ total_page_item2.add(self._printerComboBox)
+ total_page_item2.show()
+ self.insert(total_page_item2, -1)
+
+ self._USB = ToolButton('printer')
+ self._USB.set_tooltip(_('printer'))
+ self._USB.props.sensitive = True
+ self.insert(self._USB, -1)
+ self._USB.show()
+
+ self._USB.connect('clicked', self.printing)
+
+ def TBfunction(self, widget, entry):
+
+ entry_text = widget.get_text()
+ self.justPrint = JustPrint(self._title, self._path)
+ self.justPrint.setRange(entry_text)
+
+ def changed_cb(self, combobox):
+
+ model = combobox.get_model()
+ index = combobox.get_active()
+ if index:
+ self._printerToSet = model[index][0]
+ self.justPrint.setPrinter(self._printerToSet)
+ return
+
+
+ def printing(self, widget):
+
+ self.justPrint.printIt()
def setTitlePath(self, title, path):
+
self._title = title
self._path = path
-
class ReadToolbar(gtk.Toolbar):
__gtype_name__ = 'ReadToolbar'