def main(): """The pyview main entry point""" global folderHelper, window # Build command line parser cmdLine = CommandLine(LocalizedVersion()) options = cmdLine.getOptions() # Load image format plugins ImageFormats.loadImageFormatPlugins() # Get initial directory folderHelper = FolderHelper(options) folderHelper.setLastOpenedFile(options.initialFile) startDir = folderHelper.getFileDialogInitialDirectory() # Get and configure App object app = QtGui.QApplication(sys.argv) #QtGui.QApplication.setStyle(QtGui.QStyleFactory.create("Cleanlooks")) # Create and set window window = MainWindow() window.setFileDialogDirectory(startDir) window.centerWindow() # Connections window.connect(window, QtCore.SIGNAL("openFileFinished(char*, bool)"), onFileLoaded) # Show the window window.show() # Load initial file if options.initialFile: window.openFile(options.initialFile) # Start the application return app.exec_()
#!/usr/bin/env python3 import signal from gi.repository import Gtk from gui.MainWindow import MainWindow win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() signal.signal(signal.SIGINT, signal.SIG_DFL) Gtk.main()