示例#1
0
            sizex = X - 40
        if Y < 670:
            sizey = Y - 40
        self.frame = MainWindow(pos=(20, 20), size=(sizex, sizey))
        QLiveLib.setVar("MainWindow", self.frame)
        if hasattr(self, "filenames"):
            self.frame.loadFile(QLiveLib.ensureNFD(self.filenames[0]))
            
    def MacOpenFiles(self, filenames):
        if type(filenames) != ListType:
            filenames = [filenames]
        self.filenames = filenames

    def MacReopenApp(self):
        try:
            self.frame.Raise()
        except:
            pass

if __name__ == "__main__":

    QLiveLib.loadVars()
    qlfile = None
    if len(sys.argv) > 1:
        qlfile = sys.argv[1]

    app = QLiveApp()
    if qlfile:
        wx.CallAfter(app.frame.loadFile, QLiveLib.ensureNFD(qlfile))
    app.MainLoop()
示例#2
0
文件: QLive.py 项目: belangeo/qlive
            sizey = Y - 40
        self.frame = MainWindow(pos=(20, 20), size=(sizex, sizey))
        QLiveLib.setVar("MainWindow", self.frame)
        if hasattr(self, "filenames"):
            if len(self.filenames) > 0:
                self.frame.loadFile(QLiveLib.ensureNFD(self.filenames[0]))

    def MacOpenFiles(self, filenames):
        if type(filenames) != list:
            filenames = [filenames]
        filenames = [f for f in filenames if f.endswith(".qlp")]
        self.filenames = filenames

    def MacReopenApp(self):
        try:
            self.frame.Raise()
        except:
            pass

if __name__ == "__main__":

    QLiveLib.loadVars()
    qlfile = None
    if len(sys.argv) > 1:
        if sys.argv[1].endswith(".qlp"):
            qlfile = sys.argv[1]

    app = QLiveApp()
    if qlfile:
        wx.CallAfter(app.frame.loadFile, QLiveLib.ensureNFD(qlfile))
    app.MainLoop()