Exemplo n.º 1
0
def main():
    '''
    try:
        import psyco
    except ImportError:
        print('Warning: module "psyco" not found. It could speed up execution.')
        psyco_found=False
    else:
        psyco.full()
        print('Using module "psyco" to speed up execution.')
        psyco_found=True'''
    statusIconMode = 2
    action = ''
    if ui.showMain:
        action = 'show'
    if len(sys.argv)>1:
        if sys.argv[1] in ('--no-tray-icon', '--no-status-icon'):
            statusIconMode = 0
            action = 'show'
        elif sys.argv[1]=='--hide':
            action = ''
        elif sys.argv[1]=='--show':
            action = 'show'
        #elif sys.argv[1]=='--html':#????????????
        #    action = 'html'
        #elif sys.argv[1]=='--svg':#????????????
        #    action = 'svg'
    ###############################
    ui.init()
    ###############################
    checkEventsReadOnly(False)
    ## right place? FIXME
    if core.BRANCH == 'master' and versionLessThan(event_lib.info.version, '2.3.0'):
        from scal3.ui_gtk.event.bulk_save_timezone import BulkSaveTimeZoneDialog
        BulkSaveTimeZoneDialog(parent=None).run()
    event_lib.info.updateAndSave()
    ###############################
    mainWin = MainWin(statusIconMode=statusIconMode)
    #if action=='html':
    #    mainWin.exportHtml('calendar.html') ## exportHtml(path, months, title)
    #    sys.exit(0)
    #elif action=='svg':
    #    mainWin.export.exportSvg('%s/2010-01.svg'%core.deskDir, [(2010, 1)])
    #    sys.exit(0)
    if action=='show' or not mainWin.sicon:
        mainWin.present()
    ##ud.rootWindow.set_cursor(gdk.Cursor.new(gdk.CursorType.LEFT_PTR))#???????????
    #mainWin.app.run(None)
    ex = 0
    try:
        ex = gtk.main()
    except KeyboardInterrupt:
        print('You pressed Control+C, Goodbye')
        core.stopRunningThreads()
    except Exception as e:
        core.stopRunningThreads()
        raise e
    return ex
Exemplo n.º 2
0
def main():
	"""
	try:
		import psyco
	except ImportError:
		print("Warning: module "psyco" not found. It could speed up execution.")
		psyco_found=False
	else:
		psyco.full()
		print("Using module "psyco" to speed up execution.")
		psyco_found=True"""
	statusIconMode = 2
	action = ""
	if ui.showMain:
		action = "show"
	if len(sys.argv) > 1:
		if sys.argv[1] in ("--no-tray-icon", "--no-status-icon"):
			statusIconMode = 0
			action = "show"
		elif sys.argv[1] == "--hide":
			action = ""
		elif sys.argv[1] == "--show":
			action = "show"
		#elif sys.argv[1] == "--html":#????????????
		#	action = "html"
		#elif sys.argv[1] == "--svg":#????????????
		#	action = "svg"
	###############################
	ui.init()
	###############################
	listener.dateChange.add(hijri_gtk.HijriMonthsExpirationListener())
	hijri_gtk.checkHijriMonthsExpiration()
	###############################
	checkEventsReadOnly(False)
	## right place? FIXME
	event_lib.info.updateAndSave()
	###############################
	mainWin = MainWin(statusIconMode=statusIconMode)
	#if action == "html":
	#	mainWin.exportHtml("calendar.html") ## exportHtml(path, months, title)
	#	sys.exit(0)
	#elif action == "svg":
	#	mainWin.export.exportSvg("%s/2010-01.svg"%core.deskDir, [(2010, 1)])
	#	sys.exit(0)
	if action == "show" or not mainWin.sicon:
		mainWin.present()
	#ud.rootWindow.set_cursor(gdk.Cursor.new(gdk.CursorType.LEFT_PTR))
	# ^ FIXME
	#mainWin.app.run(None)
	signal.signal(signal.SIGINT, mainWin.quit)
	return gtk.main()
Exemplo n.º 3
0
def main():
	"""
	try:
		import psyco
	except ImportError:
		print("Warning: module "psyco" not found. It could speed up execution.")
		psyco_found=False
	else:
		psyco.full()
		print("Using module "psyco" to speed up execution.")
		psyco_found=True"""
	statusIconMode = 2
	action = ""
	if ui.showMain:
		action = "show"
	if len(sys.argv) > 1:
		if sys.argv[1] in ("--no-tray-icon", "--no-status-icon"):
			statusIconMode = 0
			action = "show"
		elif sys.argv[1] == "--hide":
			action = ""
		elif sys.argv[1] == "--show":
			action = "show"
		#elif sys.argv[1] == "--html":#????????????
		#	action = "html"
		#elif sys.argv[1] == "--svg":#????????????
		#	action = "svg"
	###############################
	ui.init()
	###############################
	listener.dateChange.add(hijri_gtk.HijriMonthsExpirationListener())
	hijri_gtk.checkHijriMonthsExpiration()
	###############################
	checkEventsReadOnly(False)
	## right place? FIXME
	event_lib.info.updateAndSave()
	###############################
	mainWin = MainWin(statusIconMode=statusIconMode)
	#if action == "html":
	#	mainWin.exportHtml("calendar.html") ## exportHtml(path, months, title)
	#	sys.exit(0)
	#elif action == "svg":
	#	mainWin.export.exportSvg("%s/2010-01.svg"%core.deskDir, [(2010, 1)])
	#	sys.exit(0)
	if action == "show" or not mainWin.sicon:
		mainWin.present()
	#ud.rootWindow.set_cursor(gdk.Cursor.new(gdk.CursorType.LEFT_PTR))
	# ^ FIXME
	#mainWin.app.run(None)
	signal.signal(signal.SIGINT, mainWin.quit)
	return gtk.main()
Exemplo n.º 4
0
def main():
	'''
	try:
		import psyco
	except ImportError:
		print('Warning: module "psyco" not found. It could speed up execution.')
		psyco_found=False
	else:
		psyco.full()
		print('Using module "psyco" to speed up execution.')
		psyco_found=True'''
	statusIconMode = 2
	action = ''
	if ui.showMain:
		action = 'show'
	if len(sys.argv)>1:
		if sys.argv[1] in ('--no-tray-icon', '--no-status-icon'):
			statusIconMode = 0
			action = 'show'
		elif sys.argv[1]=='--hide':
			action = ''
		elif sys.argv[1]=='--show':
			action = 'show'
		#elif sys.argv[1]=='--html':#????????????
		#	action = 'html'
		#elif sys.argv[1]=='--svg':#????????????
		#	action = 'svg'
	###############################
	ui.init()
	###############################
	checkEventsReadOnly(False)
	## right place? FIXME
	event_lib.info.updateAndSave()
	###############################
	mainWin = MainWin(statusIconMode=statusIconMode)
	#if action=='html':
	#	mainWin.exportHtml('calendar.html') ## exportHtml(path, months, title)
	#	sys.exit(0)
	#elif action=='svg':
	#	mainWin.export.exportSvg('%s/2010-01.svg'%core.deskDir, [(2010, 1)])
	#	sys.exit(0)
	if action=='show' or not mainWin.sicon:
		mainWin.present()
	##ud.rootWindow.set_cursor(gdk.Cursor.new(gdk.CursorType.LEFT_PTR))#???????????
	#mainWin.app.run(None)
	signal.signal(signal.SIGINT, mainWin.quit)
	return gtk.main()
Exemplo n.º 5
0
        self._widget = YearWheel(self.closeClicked)
        self.connect('key-press-event', self._widget.onKeyPress)
        self.add(self._widget)
        self._widget.show()
        self.appendItem(self._widget)

    def closeClicked(self, arg=None, event=None):
        if ui.mainWin:
            self.hide()
        else:
            self.destroy()
            core.stopRunningThreads()
            gtk.main_quit()
        return True

    def onButtonPress(self, obj, gevent):
        if gevent.button == 1:
            self.begin_move_drag(gevent.button, int(gevent.x_root),
                                 int(gevent.y_root), gevent.time)
            return True
        return False


if __name__ == '__main__':
    #locale_man.langActive = ''
    #_ = locale_man.loadTranslator()
    ui.init()
    win = YearWheelWindow()
    win.show()
    gtk.main()
Exemplo n.º 6
0
			self.destroy()
			core.stopRunningThreads()
			gtk.main_quit()
		return True
	def onButtonPress(self, obj, gevent):
		if gevent.button==1:
			self.begin_move_drag(gevent.button, int(gevent.x_root), int(gevent.y_root), gevent.time)
			return True
		return False



if __name__=='__main__':
	#locale_man.langActive = ''
	#_ = locale_man.loadTranslator()
	ui.init()
	win = YearWheelWindow()
	win.show()
	gtk.main()