本文整理汇总了Python中promogest.ui.GladeWidget.GladeWidget.getTopLevel方法的典型用法代码示例。如果您正苦于以下问题:Python GladeWidget.getTopLevel方法的具体用法?Python GladeWidget.getTopLevel怎么用?Python GladeWidget.getTopLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类promogest.ui.GladeWidget.GladeWidget
的用法示例。
在下文中一共展示了GladeWidget.getTopLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_credits_menu_activate
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
def on_credits_menu_activate(self, widget):
creditsDialog = GladeWidget(root='credits_dialog', path="credits_dialog.glade", callbacks_proxy=self)
creditsDialog.getTopLevel().set_transient_for(self.getTopLevel())
creditsDialog.getTopLevel().show_all()
response = creditsDialog.credits_dialog.run()
if response == GTK_RESPONSE_OK:
creditsDialog.credits_dialog.destroy()
示例2: on_credits_menu_activate
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
def on_credits_menu_activate(self, widget):
creditsDialog = GladeWidget(root='credits_dialog',path="credits_dialog.glade", callbacks_proxy=self)
creditsDialog.getTopLevel().set_transient_for(self.getTopLevel())
info = "%s Build: %s" % (Environment.VERSIONE, Environment.rev_locale)
creditsDialog.versione_label.set_markup(info)
creditsDialog.getTopLevel().show_all()
response = creditsDialog.credits_dialog.run()
if response == GTK_RESPONSE_OK:
creditsDialog.credits_dialog.destroy()
示例3: on_licenza_menu_activate
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
def on_licenza_menu_activate(self, widget):
licenzaDialog = GladeWidget(root='licenza_dialog',path="licenza_dialog.glade", callbacks_proxy=self)
licenzaDialog.getTopLevel().set_transient_for(self.getTopLevel())
licenseText = ''
try:
lines = open('./LICENSE').readlines()
for l in lines:
licenseText += l
except:
licenseText = _('Lavori in corso ....')
print 'License file not found (LICENSE).'
textBuffer = licenzaDialog.licenza_textview.get_buffer()
textBuffer.set_text(licenseText)
licenzaDialog.licenza_textview.set_buffer(textBuffer)
licenzaDialog.getTopLevel().show_all()
response = licenzaDialog.licenza_dialog.run()
if response == GTK_RESPONSE_OK:
licenzaDialog.licenza_dialog.destroy()
示例4: showPrintingDialog
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
def showPrintingDialog():
if self.__cancelOperation:
# Operation has been cancelled, do nothing
return
progressDialog.getTopLevel().destroy()
gobject.source_remove(self.__pulseSourceTag)
printDialog = GladeWidget(root='records_print_dialog',
path='records_print_dialog.glade',
callbacks_proxy=self)
printDialog.getTopLevel().set_transient_for(self.getTopLevel())
printDialog.getTopLevel().set_modal(True)
if "/" in self._pdfName:
self._pdfName = self._pdfName.split("/")[1]
printDialog.records_print_dialog_description_label.set_text(
self._pdfName)
printDialog.email_destinatario_entry.set_text(self.email)
printDialog.records_print_dialog_size_label.set_text(str(
len(self.__pdfReport) / 1024) + ' Kb')
printDialog.placeWindow(printDialog.getTopLevel())
printDialog.getTopLevel().show_all()
self.printDialog = printDialog
return False
示例5: AnagraficaEdit
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
class AnagraficaEdit(GladeWidget):
""" Interfaccia di editing dell'anagrafica """
def __init__(self, anagrafica, windowTitle,
root=None,path=None, isModule=False,
url_help="http://www.promogest.me/promoGest/faq"):
GladeWidget.__init__(self, root=root,
path=path, isModule=isModule)
self.url_help = url_help
self._anagrafica = anagrafica
self._widgetFirstFocus = None
self._isSensitive = True
self._windowTitle = windowTitle
self.dao = None
def on_help_button_activate(self, widget):
webbrowser.open_new_tab(self.url_help)
def setVisible(self, isVisible):
""" Make the window visible/invisible """
self._isSensitive = isVisible
if isVisible:
self.dialog = GladeWidget(
root='anagrafica_complessa_detail_dialog',
callbacks_proxy=self,
path='anagrafica_complessa_detail_dialog.glade')
self.dialogTopLevel = self.dialog.getTopLevel()
self.dialogTopLevel.set_title(self._windowTitle)
self.dialogTopLevel.get_content_area().pack_start(self.getTopLevel(), True, True, 0)
self.dialog.ok_button.connect('grab_focus', self.on_ok_button_grab_focus)
Environment.windowGroup.append(self.dialogTopLevel)
self.dialogTopLevel.set_transient_for(self._anagrafica.getTopLevel())
self.placeWindow(self.dialogTopLevel)
self.dialogTopLevel.show_all()
self.setFocus()
else:
if self.dialogTopLevel in Environment.windowGroup:
Environment.windowGroup.remove(self.dialogTopLevel)
self.dialogTopLevel.get_content_area().remove(self.getTopLevel())
self.on_top_level_closed()
self.dialogTopLevel.destroy()
def draw(self):
"""
Disegna i contenuti del dettaglio anagrafica. Metodo invocato
una sola volta, dopo la costruzione dell'oggetto
"""
raise NotImplementedError
def clear(self):
""" Svuota tutti i campi di input del dettaglio anagrafica """
raise NotImplementedError
def setDao(self, dao):
""" Visualizza il Dao specificato """
raise NotImplementedError
def saveDao(self, tipo=None):
""" Salva il Dao attualmente selezionato """
raise NotImplementedError
def setFocus(self, widget=None):
if widget is None:
self._widgetFirstFocus.grab_focus()
else:
widget.grab_focus()
def on_ok_button_grab_focus(self, button):
if self.dialog.ok_button.is_focus():
self.on_anagrafica_complessa_detail_dialog_response(self.dialog, GTK_RESPONSE_OK)
def on_anagrafica_complessa_detail_dialog_response(self, dialog, responseId):
""" Main function connected with ok applica and cancel in Anagrafica Edit"""
if responseId == GTK_RESPONSE_CANCEL:
#self.clearDao()
self.setVisible(False)
elif responseId == GTK_RESPONSE_OK:
self.saveDao(tipo=GTK_RESPONSE_OK)
self._anagrafica.filter.refresh()
self._anagrafica.filter.selectCurrentDao()
self._anagrafica.filter.getSelectedDao()
if self._anagrafica.__class__.__name__ == 'AnagraficaDocumenti' and setconf("Documenti", "save_new_doc"):
self.setDao(None)
else:
self.setVisible(False)
elif responseId == GTK_RESPONSE_APPLY:
self.saveDao(tipo=GTK_RESPONSE_APPLY)
self._anagrafica.filter.refresh()
self._anagrafica.filter.selectCurrentDao()
def on_anagrafica_complessa_detail_dialog_close(self, dialog, event=None):
if YesNoDialog(msg='Confermi la chiusura ?', transient=self.dialogTopLevel):
self.setVisible(False)
else:
return True
示例6: _handlePrinting
# 需要导入模块: from promogest.ui.GladeWidget import GladeWidget [as 别名]
# 或者: from promogest.ui.GladeWidget.GladeWidget import getTopLevel [as 别名]
def _handlePrinting(self, pdfGenerator, report,
daos=None, label=None,
returnResults=None, classic=False, template_file=False):
# FIXME: refactor this mess!!!
# tiro su la finestrella con la progress bar
progressDialog = GladeWidget(root='records_print_progress_dialog',
callbacks_proxy=self,
path='records_print_progress_dialog.glade')
progressDialog.getTopLevel().set_transient_for(self.getTopLevel())
progressDialog.getTopLevel().show_all()
pbar = progressDialog.records_print_progress_bar
pbar.set_text('Lettura dati')
self.__pulseSourceTag = None
self.__cancelOperation = False
self.__pdfGenerator = pdfGenerator
self.__returnResults = returnResults
self.__pdfReport = None
self._reportType = report
self._template_file = template_file
self._classic = classic
self.label = label
# tipo report ma anche opzione label
self._pdfName = str(pdfGenerator.defaultFileName)
self._folder = setconf("General", "cartella_predefinita") or ""
if self._folder == '':
if os.name == 'posix':
self._folder = os.environ['HOME']
elif os.name == 'nt':
self._folder = os.environ['USERPROFILE']
def showPrintingDialog():
if self.__cancelOperation:
# Operation has been cancelled, do nothing
return
progressDialog.getTopLevel().destroy()
gobject.source_remove(self.__pulseSourceTag)
printDialog = GladeWidget(root='records_print_dialog',
path='records_print_dialog.glade',
callbacks_proxy=self)
printDialog.getTopLevel().set_transient_for(self.getTopLevel())
printDialog.getTopLevel().set_modal(True)
if "/" in self._pdfName:
self._pdfName = self._pdfName.split("/")[1]
printDialog.records_print_dialog_description_label.set_text(
self._pdfName)
printDialog.email_destinatario_entry.set_text(self.email)
printDialog.records_print_dialog_size_label.set_text(str(
len(self.__pdfReport) / 1024) + ' Kb')
printDialog.placeWindow(printDialog.getTopLevel())
printDialog.getTopLevel().show_all()
self.printDialog = printDialog
return False
def progressCB(results, prevLen, totalLen):
if self.__cancelOperation:
raise Exception('Operation cancelled, thread killed')
# Let's schedule progress bar update from the main thread
def updateProgressBarIdle():
if self.__cancelOperation:
# Progress bar is being destroyed, do nothing
return
if results:
frac = len(results) / float(totalLen)
pbar.set_fraction(frac)
return False
gobject.idle_add(updateProgressBarIdle)
if len(results) == totalLen:
# We're done: let's switch progress bar type from the
# main thread
def renewProgressBarIdle():
pbar.set_pulse_step(0.07)
pbar.set_text('Creazione della stampa')
# Let's also schedule the progress bar pulsing from
# the main thread
def pulsePBar():
pbar.pulse()
return True
self.__pulseSourceTag = gobject.timeout_add(33, pulsePBar)
return False
gobject.idle_add(renewProgressBarIdle)
# In the end, let's launch the template rendering thread
def renderingThread():
""" Questo è il thread di conversione e
generazione della stampa"""
operationName = ""
#.........这里部分代码省略.........