def __init__(self, anagrafica, windowTitle, previewTemplate, tipo=None): GladeWidget.__init__(self, root='htmlviewer', path="htmlviewer.glade") self.windowTitle = windowTitle self.visualizzatore_html.set_title(windowTitle) self._anagrafica = anagrafica self._tipo = tipo self.bodyWidget = FilterWidget(owner=self, resultsElement='html') self.bodyWidget.filter_navigation_hbox.destroy() self.bodyWidget.info_label.set_markup("INSERT INFO") self.html_scrolledwindow.add_with_viewport( self.bodyWidget.getTopLevel()) self.print_on_screen_html = self.bodyWidget.resultsElement self._gtkHtmlDocuments = None self._previewTemplate = previewTemplate self.html = createHtmlObj(self) #Prendo tutti i dati dalla finestra di filtraggio, compresi i dati # di ordinamento e di batchSize self._changeOrderBy = self.bodyWidget._changeOrderBy self.orderBy = self.bodyWidget.orderBy self.batchSize = self.bodyWidget.batchSize self.offset = self.bodyWidget.offset self.numRecords = self.bodyWidget.numRecords self._filterClosure = self._anagrafica.filter._filterClosure self._filterCountClosure = self._anagrafica.filter._filterCountClosure self.placeWindow(self.visualizzatore_html) self.bodyWidget.generic_button.set_property('visible', False) def test(): self.html_code = "<html><body></body></html>" glib.idle_add(self.refresh)
def __init__(self, owner): GladeWidget.__init__(self, root='html_box', path='htmlviewerwidget.glade') self.detail = createHtmlObj(self) self.html_scrolledwindow.add(self.detail) self.html_scrolledwindow.show() self._owner = owner
def __init__(self, main, azienda): GladeWidget.__init__(self, root='notizie_frame', path='news_notebook.glade') # self.placeWindow(self.getTopLevel()) self.rowBackGround = None self.main = main self.main_wind = main self.aziendaStr = azienda or "" glib.idle_add(self.create_news_frame) self.htmlnewswidget = createHtmlObj(self) self.feed_scrolled.add(self.htmlnewswidget)
def __init__(self, mainnnn, azienda): GladeWidget.__init__(self, root='calendario_frame', path='calendario_notebook.glade') # self.placeWindow(self.getTopLevel()) self.rowBackGround = None self.mainoo = mainnnn self.aziendaStr = azienda or "" self.htmlPlanningWidget = createHtmlObj(self) self.planning_scrolled.add(self.htmlPlanningWidget) # self.create_planning_frame() # gobject.idle_add(self.create_planning_frame) self.create_planning_frame()
def draw(self): self.filterss = FilterWidget( owner=self, filtersElement=GladeWidget( root='scontrini_filter_table', path="VenditaDettaglio/gui/_scontrini_emessi_elements.glade", isModule=True), #resultsElement="scontrino" ) self.filters = self.filterss.filtersElement self.filterTopLevel = self.filterss.getTopLevel() filterElement = self.filterss.filter_frame filterElement.unparent() self.filter_viewport.add(filterElement) self.anagrafica_hpaned.set_position(350) resultElement = self.filterss.filter_list_vbox resultElement.unparent() self.anagrafica_results_viewport.add(resultElement) self.detail = createHtmlObj(self) self.detail_scrolled.add(self.detail) self.filterss.hbox1.destroy() self.filterss.filter_info_hbox.show() self.filterss.filter_info_label.set_text("") self.filters.id_articolo_filter_customcombobox.setId(self._idArticolo) if self._daData is None: self.filters.da_data_filter_entry.setNow() else: self.filters.da_data_filter_entry.set_text(self_daData) if self._aData is None: self.filters.a_data_filter_entry.setNow() else: self.filters.a_data_filter_entry.set_text(self_aData) fillComboboxMagazzini(self.filters.id_magazzino_filter_combobox) fillComboboxPos(self.filters.id_pos_filter_combobox) if hasattr(Environment.conf, "VenditaDettaglio"): if hasattr(Environment.conf.VenditaDettaglio, "magazzino"): findComboboxRowFromStr(self.filters.id_magazzino_filter_combobox, Environment.conf.VenditaDettaglio.magazzino,2) if hasattr(Environment.conf.VenditaDettaglio, "puntocassa"): findComboboxRowFromStr(self.filters.id_pos_filter_combobox, Environment.conf.VenditaDettaglio.puntocassa,2) else: if setconf("VenditaDettaglio", "magazzino_vendita"): findComboboxRowFromId(self.filters.id_magazzino_filter_combobox,setconf("VenditaDettaglio", "magazzino_vendita")) if setconf("VenditaDettaglio", "punto_cassa"): findComboboxRowFromId(self.filters.id_pos_filter_combobox, setconf("VenditaDettaglio", "punto_cassa")) self.refreshHtml() self.refresh()
def __init__(self, articolo): GladeWidget.__init__(self, root='creazione_taglie_colore', path='PromoWear/gui/creazione_varianti_taglia_colore.glade', isModule=True) self._loading = False self.placeWindow(self.getTopLevel()) self._treeViewModel = None self._articoloBase = articolo self._articoloPadre = articolo.articoloTagliaColore self.idGruppoTaglia = self._articoloBase.id_gruppo_taglia if self._articoloPadre is None: self._articoloPadre = ArticoloTagliaColore() self._articoliTagliaColore = self._articoloBase.articoliTagliaColore self._noValue = 'n/a' self._varianti = {} self._gruppoTaglia = None #self._gtkHtml = None self.order="color" self.filtered = True # Taglie attualmente presenti nella treeview self._taglie = [] # Verra` aggiornato al refresh della combobox gruppi taglia # Colori attualmente presenti nella treeview self.refreshColori() self.sizesAvailable() self.selected = False ## Dizionario che associa alla chiave (taglia,colore) l'id della variante self.group_size_label.set_markup('<span weight="bold">%s</span>' % (self._articoloBase.denominazione_gruppo_taglia,)) self.father_label.set_markup('Articolo: ' + '<span weight="bold">%s %s</span>' % (self._articoloBase.codice,self._articoloBase.denominazione)) # self._refreshHtml() self.html = createHtmlObj(self) self.anteprima_scrolled.add(self.html) html = "" renderHTML(self.html, html) self.rowBackGround = '#E6E6FF' self.rowBoldFont = 'arial bold 12' self.draw() self.__refresh()
def __init__(self, anagrafica, windowTitle, previewTemplate, veter=False): GladeWidget.__init__(self, root='htmlviewer', path="htmlviewer.glade") self.windowTitle = windowTitle self.visualizzatore_html.set_title(windowTitle) self._anagrafica = anagrafica self._veter = veter self.bodyWidget = FilterWidget(owner=self, resultsElement='html') self.bodyWidget.filter_navigation_hbox.destroy() self.bodyWidget.info_label.set_markup("INSERT INFO") self.html_scrolledwindow.add_with_viewport( self.bodyWidget.getTopLevel()) self.print_on_screen_html = self.bodyWidget.resultsElement self._gtkHtmlDocuments = None self._previewTemplate = previewTemplate self.html = createHtmlObj(self) #Prendo tutti i dati dalla finestra di filtraggio, compresi i dati # di ordinamento e di batchSize self._changeOrderBy = self.bodyWidget._changeOrderBy self.orderBy = self.bodyWidget.orderBy self.batchSize = self.bodyWidget.batchSize self.offset = self.bodyWidget.offset self.numRecords = self.bodyWidget.numRecords self._filterClosure = self._anagrafica.filter._filterClosure self._filterCountClosure = self._anagrafica.filter._filterCountClosure self.placeWindow(self.visualizzatore_html) self.bodyWidget.generic_button.set_property('visible', False) def test(): self.html_code = "<html><body></body></html>" #self.html.load_html_string(self.html_code, "file:///"+sys.path[0]+os.sep) #self.html.show() #renderHTML(self.print_on_screen_html, self.html_code) #generaButton = self.bodyWidget.generic_button #generaButton.connect('clicked', self.on_generic_button_clicked ) #generaButton.set_label("Genera Pdf Anteprima Html") #if Environment.pg3: #glib.idle_add(test) #else: #gobject.idle_add(test) if Environment.pg3: glib.idle_add(self.refresh) else: gobject.idle_add(self.refresh)
def getHtmlFilterResultsWidget(self): """ Return a treeview widget for filter results """ self.html = createHtmlObj(self) html = """<html><body></body></html>""" renderHTML(self.html, html) return self.html
def draw(self): self.detail = createHtmlObj(self) self.html_scrolledwindow.add(self.detail) self.refreshHtml()
def __init__(self, windowTitle, recordMenuLabel, filterElement, htmlHandler, reportHandler, editElement, labelHandler=None, path=None, aziendaStr=None, url_help="http://www.promogest.me/promoGest/faq"): if not path: path = "anagrafica_complessa_window.glade" GladeWidget.__init__(self, root='anagrafica_complessa_window', path=path) if aziendaStr is not None: self.anagrafica_complessa_window.set_title( windowTitle[:12] \ + ' su (' + \ aziendaStr \ + ') - ' + \ windowTitle[11:]) else: self.anagrafica_complessa_window.set_title(windowTitle) self.record_menu.get_child().set_label(recordMenuLabel) if self.anagrafica_complessa_window not in Environment.windowGroup: Environment.windowGroup.append(self.anagrafica_complessa_window) self.html = createHtmlObj(self) self.anagrafica_detail_scrolledwindow.add(self.html) self._setFilterElement(filterElement) self._setHtmlHandler(htmlHandler) self._setReportHandler(reportHandler) self._setEditElement(editElement) self._setLabelHandler(labelHandler) self._selectedDao = None if self.__class__.__name__ == 'AnagraficaDocumenti': from promogest.export import tracciati_disponibili for tracciato in tracciati_disponibili(): def build_menuitem(name): import string labe = "Esporta " + string.capwords(name.replace('_', ' ')) mi = gtk.MenuItem(label=labe) mi.show() mi.connect('activate', self.on_esporta_tracciato_menuitem_activate, (name,)) return mi self.menu3.append(build_menuitem(tracciato)) self.records_file_export.set_menu(self.menu3) # Initial (in)sensitive widgets textStatusBar = " ***** PromoGest - 070 8649705 -" \ + " www.promogest.me - [email protected] *****" context_id = self.pg2_statusbar.get_context_id( "anagrafica_complessa_windows") self.url_help = url_help self.pg2_statusbar.push(context_id, textStatusBar) self.record_delete_button.set_sensitive(False) self.record_delete_menu.set_sensitive(False) self.duplica_button.set_sensitive(False) self.record_edit_button.set_sensitive(False) self.record_edit_menu.set_sensitive(False) self.duplica_in_cliente.set_sensitive(False) self.duplica_in_fornitore.set_sensitive(False) # self.record_duplicate_menu.set_property('visible', False) # self.record_duplicate_menu.set_no_show_all(True) self.record_duplicate_menu.set_sensitive(False) self.duplica_button.set_sensitive(False) self.selected_record_print_button.set_sensitive(False) self.selected_record_print_menu.set_sensitive(False) if self.__class__.__name__ != 'AnagraficaListiniArticoli': self.modifiche_menu.destroy() if self.__class__.__name__ != 'AnagraficaDocumenti': self.strumenti_menu.destroy() self.email_toolbutton.destroy() self.segna_pagato_button.destroy() self.export_fatturapa_toolbutton.destroy() self.placeWindow(self.anagrafica_complessa_window) self.filter.draw() self.editElement.draw(cplx=True) self.email = "" if self.__class__.__name__ != "AnagraficaPrimaNota": self.info_anag_complessa_label.destroy() self.pbar_anag_complessa.set_property("visible", False) self.setFocus()