Ejemplo n.º 1
0
                    action="store_true")
parser.add_argument("-i", "--imitate",
                    help="Show and immediately close the main window.",
                    action="store_true")

args = parser.parse_args()

app = QApplication(sys.argv)

if args.settings:
    from settingsdialog import SettingsDialog
    g = SettingsDialog()
else:
    try:
        g = MainUi()
    except Exception as err:
        print("An exception has occured!")
        print("Try opening the settings dialog with -s parameter and resaving the settings.",
              "You may have to delete your settings file as last resort."
            )
        raise err

g.show()

if args.imitate: sys.exit()

rect = app.desktop().screenGeometry()
g.move(rect.center() - g.rect().center())

app.exec_()
Ejemplo n.º 2
0
parser.add_argument("-i",
                    "--imitate",
                    help="Show and immediately close the main window.",
                    action="store_true")

args = parser.parse_args()

app = QApplication(sys.argv)

if args.settings:
    from settingsdialog import SettingsDialog
    g = SettingsDialog()
else:
    try:
        g = MainUi()
    except Exception as err:
        print("An exception has occured!")
        print(
            "Try opening the settings dialog with -s parameter and resaving the settings.",
            "You may have to delete your settings file as last resort.")
        raise err

g.show()

if args.imitate: sys.exit()

rect = app.desktop().screenGeometry()
g.move(rect.center() - g.rect().center())

app.exec_()