Пример #1
0
def run_app(args):
    ## GUI
    app = QApplication(sys.argv)
    app.setApplicationName("Hanlendar")
    app.setOrganizationName("arnet")
    ### app.setOrganizationDomain("www.my-org.com")
    app.setQuitOnLastWindowClosed(False)

    ## disable Alt key switching to application menu
    app.setStyle(MenuStyle())

    setup_interrupt_handling()

    window = MainWindow()
    if args.blocksave is True:
        window.disableSaving()
    window.loadSettings()
    window.loadData()

    if args.minimized is False:
        window.show()

    exitCode = app.exec_()

    if exitCode == 0:
        window.saveAll()

    return exitCode
Пример #2
0
task2 = Task()
task2.title = "Task 1"
task2.description = "Description"
task2.completed = 0
task2.priority = 3
task2.setDefaultDateTime( taskDate + timedelta( hours=6 ) )

task3 = Task()
task3.title = "Full Day Task"
task3.description = "Description"
task3.completed = 0
task3.priority = 3
task3.startDateTime = taskDate             - timedelta( days=2 )
task3.dueDateTime   = task3.startDateTime  + timedelta( days=4 )

setup_interrupt_handling()

widget = DayListWidget()
widget.showCompletedTasks()
widget.resize( 800, 600 )
widget.setTasks( [task1, task2, task3], taskDate.date() )
widget.show()

root_path = get_root_path()
renderToPixmap( widget, root_path + "/tmp/daylistwidget-big.png" )

# print( "Dialog return:", dialogCode )
# print( "Created task:", dialog.task )

sys.exit( app.exec_() )