示例#1
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = MainUi()
     self.ui.setupUi(self)
     self.ui.btn1.clicked.connect(self.switchbm)
     self.ui.spinBox1.setMinimum(1)
     self.ui.spinBox1.setMaximum(100000000)
     self.ui.spinBox1.valueChanged.connect(self.exchange)
     self.ui.comboBox1.currentIndexChanged.connect(self.exchange)
     self.ui.comboBox2.currentIndexChanged.connect(self.exchange)
     self.setcombo()
示例#2
0
    def startup(self):
        self.ui = MainUi()
        self.ui.setupUi(self)

        self.ui.options_button.clicked.connect(
            lambda: self.ui.uistack.setCurrentWidget(self.ui.optionspage))
        self.ui.back_to_books.clicked.connect(
            lambda: self.ui.uistack.setCurrentWidget(self.ui.bookpage))
        self.ui.back_to_books.clicked.connect(self.ui.bookpage.setFocus)

        self.searchTimer = None

        self.config = self.init_config()

        self.setup_authentication()
        self.setup_inventory()
        self.ui.bookpage.setFocus()
示例#3
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_()