def __init__(self, *args): QApplication.__init__(self, *args) # Setup appication self.setApplicationName('openshot') self.setApplicationVersion(info.SETUP['version']) # self.setWindowIcon(QIcon("xdg/openshot.svg")) # Init settings self.settings = settings.SettingStore() try: self.settings.load() except Exception as ex: log.error("Couldn't load user settings. Exiting.\n{}".format(ex)) exit() # Init translation system language.init_language() # Tests of project data loading/saving self.project = project_data.ProjectDataStore() # Init Update Manager self.updates = updates.UpdateManager() # It is important that the project is the first listener if the key gets update self.updates.add_listener(self.project) # Load ui theme if not set by OS ui_util.load_theme() # Track which dockable window received a context menu self.context_menu_object = None # Set Experimental Dark Theme if self.settings.get("theme") == "Humanity: Dark": # Only set if dark theme selected self.setStyle(QStyleFactory.create("Fusion")) darkPalette = self.palette() darkPalette.setColor(QPalette.Window, QColor(53, 53, 53)) darkPalette.setColor(QPalette.WindowText, Qt.white) darkPalette.setColor(QPalette.Base, QColor(25, 25, 25)) darkPalette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ToolTipBase, Qt.white) darkPalette.setColor(QPalette.ToolTipText, Qt.white) darkPalette.setColor(QPalette.Text, Qt.white) darkPalette.setColor(QPalette.Button, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ButtonText, Qt.white) darkPalette.setColor(QPalette.BrightText, Qt.red) darkPalette.setColor(QPalette.Link, QColor(42, 130, 218)) darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218)) darkPalette.setColor(QPalette.HighlightedText, Qt.black) self.setPalette(darkPalette) self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }") # Create main window from windows.main_window import MainWindow self.window = MainWindow() self.window.show()
def __init__(self, *argv): QApplication.__init__(self, *argv) from market.api.api import MarketAPI from market.database.database import MarketDatabase from market.database.backends import MemoryBackend from market.models.user import User from market.models.role import Role self._api = MarketAPI(MarketDatabase(MemoryBackend())) # Create users user, _, _ = self._api.create_user() bank_role = Role.FINANCIAL_INSTITUTION.value bank1, _, _ = self._api.create_user() bank2, _, _ = self._api.create_user() bank3, _, _ = self._api.create_user() bank4, _, _ = self._api.create_user() bank1.role_id = bank_role bank2.role_id = bank_role bank3.role_id = bank_role bank4.role_id = bank_role self._api.db.put(User.type, bank1.id, bank1) self._api.db.put(User.type, bank2.id, bank2) self._api.db.put(User.type, bank3.id, bank3) self._api.db.put(User.type, bank4.id, bank4) self.user = user self.bank1 = bank1 self.bank2 = bank2 self.bank3 = bank3 self.bank4 = bank4
def __init__(self, argv): QApplication.__init__(self, argv) QApplication.setWindowIcon( QIcon('UI/images/taskhive-symbol-yellow.svg')) import ctypes myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
def __init__(self, argv): """ Constructor """ QApplication.__init__(self, argv) self.__objectRegistry = {} self.__pluginObjectRegistry = {}
def __init__(self, options): """ Initializes the main window with the Music libraries manager and the download manager in the menu bar. If there are no music paths defined it hides itself. """ QApplication.__init__(self) self.options = options self.do_not_refresh = False menu_bar = self.menuBar() music_menu = menu_bar.addMenu('&Music') edit_libraries_action = QAction('&Library folders', self) edit_libraries_action.triggered.connect(self.call_libraries_manager) download_action = QAction('&Download music', self) download_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_D)) download_action.triggered.connect(self.call_download_manager) playlist_action = QAction('&Configure playlist', self) playlist_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_P)) playlist_action.triggered.connect(self.call_playlist_manager) music_menu.addAction(edit_libraries_action) music_menu.addAction(download_action) music_menu.addAction(playlist_action) if len(self.options['paths']['music_path']) < 1: self.do_not_refresh = True self.hide()
def __init__(self, argv): QApplication.__init__(self, argv) self.view = View(self) self.model = Model(self) self.view.disableModes(self.model.workspace.getPossibleModes()) self.reloadStops() self.exec_()
def __init__(self): QApplication.__init__(self, sys.argv) self.logWin = QMainWindow() self.logWin.setMinimumSize(100, 100) self.logWin.setWindowTitle('Sign in IPM') self.logWin.setWindowIcon(self.style().standardIcon(QStyle.SP_ComputerIcon)) self.cw = QWidget(self.logWin) self.logWin.setCentralWidget(self.cw) self.gl = QGridLayout(self.logWin) self.cw.setLayout(self.gl) self.gl.addWidget(QLabel('Login:'******'Password:'******'Log in', self.logWin) self.gl.addWidget(self.btn, 2, 0) self.btn.clicked.connect(self.on_click_login) self.tray = QSystemTrayIcon(self.logWin) self.tray.setIcon(self.style().standardIcon(QStyle.SP_ComputerIcon)) self.logWin.show() self.tray.show()
def __init__(self): QApplication.__init__(self, sys.argv) interface = RecordingAppInterface() record = Record(interface) interface.btnRecord.param = self.refresh_app interface.btnRecord.setAction(record.recordAudio) interface.btnStop.setAction(record.stopAudio) sys.exit(self.exec_())
def __init__(self, args): QApplication.__init__(self, args) self.args = args self.read_list = ('bmp', 'gif', 'ico', 'jpg', 'jpeg', 'png', 'pbm', 'pgm', 'ppm', 'xbm', 'xpm', 'svg', 'svgz', 'mng', 'wbmp', 'tga', 'tif', 'tiff') self.write_list = ('bmp', 'ico', 'jpg', 'jpeg', 'pbm', 'pgm', 'png', 'wbmp', 'tif', 'tiff', 'ppm', 'xbm', 'xpm')
def __init__(self, icon, **kwargs): QApplication.__init__(self, sys.argv) self._icon = QIcon(icon) self.tray_icon = QSystemTrayIcon() self.tray_icon.setIcon(self._icon) self.menu = SubMenu() self.tray_icon.setContextMenu(self.menu) self.tray_icon.show()
def __init__(self, conf_path, args, instance_name="default"): QApplication.__init__(self, args) self.__class__.INSTANCE = self self.instance_name = instance_name if (version.opengl_vendor() == 'nouveau' and not (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or 'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ)): sys.exit("You are using the nouveau graphics driver but it" " has issues with multithreaded opengl. You must" " use another driver or set the variable environment" " QT_XCB_FORCE_SOFTWARE_OPENGL to force software" " opengl. Note that it might be slow, depending" " on your hardware.") if version.is_mac: self.setAttribute(Qt.AA_MacDontSwapCtrlAndMeta) self._conf_path = conf_path if not os.path.isdir(self.profiles_path()): os.makedirs(self.profiles_path()) self._interceptor = UrlInterceptor(self) self._download_manager = DownloadManager(self) self.profile = default_profile() self.profile.enable(self) settings = QWebEngineSettings.globalSettings() settings.setAttribute( QWebEngineSettings.LinksIncludedInFocusChain, False, ) settings.setAttribute( QWebEngineSettings.PluginsEnabled, True, ) settings.setAttribute( QWebEngineSettings.FullScreenSupportEnabled, True, ) settings.setAttribute( QWebEngineSettings.JavascriptCanOpenWindows, True, ) if version.min_qt_version >= (5, 8): settings.setAttribute( QWebEngineSettings.FocusOnNavigationEnabled, False, ) self.installEventFilter(LOCAL_KEYMAP_SETTER) self.setQuitOnLastWindowClosed(False) self.network_manager = QNetworkAccessManager(self)
def __init__(self): QApplication.__init__(self, ['']) ################# init GUI ################################ self.spk = spike_denoiser() self.ae = AutoEncoder_GM() self.dmg = data_manager(self.spk, self.ae) self.gui = GUI(self.dmg) #------------------- self.loadStyle()
def __init__(self, title, args, parser): QApplication.__init__(self, args) qmlRegisterType(RadialBar, "SDK", 1, 0, "RadialBar") self._qquickview = _QQuickView() self._qquickview.setTitle(title) parsed_args = parser.parse_args() self._rfid_card = parsed_args.rfid_card # Debug only so the app can work without a RFID card reader self._engine = self._qquickview.engine()
def __init__(self, qt_args, parsed_args): QApplication.__init__(self, qt_args) self.args = parsed_args self.read_list = ('bmp', 'gif', 'ico', 'jpg', 'jpeg', 'png', 'pbm', 'pgm', 'ppm', 'xbm', 'xpm', 'svg', 'svgz', 'mng', 'wbmp', 'tga', 'tif', 'tiff') self.write_list = ('bmp', 'ico', 'jpg', 'jpeg', 'pbm', 'pgm', 'png', 'wbmp', 'tif', 'tiff', 'ppm', 'xbm', 'xpm')
def __init__(self): QApplication.__init__(self, sys.argv) self.loop = QEventLoop(self) asyncio.set_event_loop(self.loop) self.userClient = EchoClientProtocol(self.loop, 'user') self.loop.create_task(self.start()) self.gui = Gui(self.loop, self.userClient) self.loop.run_forever()
def __init__(self, args): QApplication.__init__(self, args) self.tachyReader = TachyReader(QSerialPort.Baud9600) self.tachyReader.setPort('COM10') self.pollingThread = QThread() self.tachyReader.moveToThread(self.pollingThread) self.pollingThread.start() self.tachyReader.lineReceived.connect(self.vertexReceived) self.tachyReader.beginListening() self.lineCount = 0
def __init__(self, config, args): QApplication.__init__(self, args) self.setStyle('fusion') self.setWindowIcon(QIcon(get_resource_path('icons/favicon.png'))) self._default_palette = self.palette() gui = GUI(self, config) gui.connect_action(self.set_dark_palette, self.set_default_palette) atexit.register(gui.before_exit) gui.redraw_palette(config.dark_mode)
def __init__(self, icon, fallback_icon_path, **kwargs): """Create a TrayIcon instance.""" QApplication.__init__(self, sys.argv) self._fallback_icon = QIcon(fallback_icon_path) self._icon = QIcon.fromTheme(icon, self._fallback_icon) self.tray_icon = QSystemTrayIcon() self.tray_icon.setIcon(self._icon) self.menu = SubMenu() self.tray_icon.setContextMenu(self.menu) self.tray_icon.show()
def __init__(self): QApplication.__init__(self, sys.argv) self.loop = QEventLoop(self) asyncio.set_event_loop(self.loop) self.client = Client(self.loop, f'user-{int(random()*10000)}') self.loop.create_task(self.start()) self.gui = MyWindow(self.loop, self.client) self.gui.show() self.loop.run_forever()
def __init__(self, icon): QApplication.__init__(self, sys.argv) # Init QSystemTrayIcon self.icon = QIcon(icon) self.tray_icon = QSystemTrayIcon() self.tray_icon.setIcon(self.icon) self.menu = QMenu() self.menu_items = [] self.tray_icon.setContextMenu(self.menu) self.tray_icon.show()
def __init__(self): QApplication.__init__(self, ['']) #------------------- self.loadStyle() ################# init GUI ################################ self.spk = spike_denoiser() self.ae = sorter() self.dmg = data_manager(self.spk, self.ae) self.gui = GUI_behaviour(self.dmg) # -- close app -- sys.exit(self.exec_())
def __init__(self, *args, application_home=None, locale_dir=None): QApplication.__init__(self, *args) self.logger = logging.getLogger(__name__) self.ctrl = Ctrl(application_home, locale_dir) self.logger.info("Starting application") self.logger.info("application_home=%s" % self.ctrl.application_home) self.logger.info("locale_dir=%s" % self.ctrl.locale_dir) self.logger.info(_("Language was set to locale en-US")) self.main_window = WMain() self.aboutToQuit.connect(self.__before_close__)
def __init__(self, *args, **kwargs): QApplication.__init__(self, []) self._args = (args, kwargs) self._window = None self.error_signal.connect(self.__error) self.connected_signal.connect(self.__connected) self.login_signal.connect(self.__logged_in) self.hello_signal.connect(self.__hello) self.aboutToQuit.connect(self.stop)
def __init__(self, argv): QApplication.__init__(self, argv) self.res_man = StringResourceManager(self) self.entity_classes_register = dict() self.register_entity_classes([Entity, StaticEntity, Place]) if "-n" in argv: self.save_enabled = False else: self.save_enabled = True
def __init__(self, debug=False, profile='main', sslverify=True, enableOrbital=False, progName=None, cmdArgs={}): QApplication.__init__(self, sys.argv) QCoreApplication.setApplicationName(GALACTEEK_NAME) self.dbConfigured.connectTo(self.onDbConfigured) self.setQuitOnLastWindowClosed(False) self._cmdArgs = cmdArgs self._debugEnabled = debug self._appProfile = profile self._loop = None self._executor = None self._ipfsClient = None self._ipfsOpMain = None self._ipfsd = None self._sslverify = sslverify self._progName = progName self._progCid = None self._system = platform.system() self._urlSchemes = {} self._shuttingDown = False self._icons = {} self._ipfsIconsCache = {} self._ipfsIconsCacheMax = 32 self.enableOrbital = enableOrbital self.orbitConnector = None self.translator = None self.mainWindow = None self.feedFollowerTask = None self.webProfiles = {} self.ipfsCtx = IPFSContext(self) self.peersTracker = peers.PeersTracker(self.ipfsCtx) self.desktopWidget = QDesktopWidget() self.desktopGeometry = self.desktopWidget.screenGeometry() self.setWindowIcon(getIcon('galacteek.png')) self.setupAsyncLoop() self.setupPaths()
def __init__(self, renderer, title): QApplication.__init__(self, sys.argv) self.window = QMainWindow() self.window.setWindowTitle(title) self.window.resize(800,600) # Get OpenGL 4.1 context glformat = QGLFormat() glformat.setVersion(4, 1) glformat.setProfile(QGLFormat.CoreProfile) glformat.setDoubleBuffer(False) self.glwidget = MyGlWidget(renderer, glformat, self) self.window.setCentralWidget(self.glwidget) self.window.show()
def __init__(self): QApplication.__init__(self, sys.argv) self.app_service.app_model.application = self self.setStyle(QtWidgets.QStyleFactory.create('Fusion')) self.setWindowIcon( QtGui.QIcon(self.configuration.main_window.icon_path)) self.setQuitOnLastWindowClosed(False) self.windows = [] # create main window self.windows.append(MainWindow())
def __init__(self, args): QApplication.__init__(self, args) self.__class__.INSTANCE = self if (opengl_vendor() == 'nouveau' and not (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or 'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ)): sys.exit("You are using the nouveau graphics driver but it" " has issues with multithreaded opengl. You must" " use another driver or set the variable environment" " QT_XCB_FORCE_SOFTWARE_OPENGL to force software" " opengl. Note that it might be slow, depending" " on your hardware.") with open(os.path.join(THIS_DIR, "app_style.css")) as f: self.setStyleSheet(f.read()) self._setup_conf_paths() self._adblock_thread = None self._interceptor = UrlInterceptor(self) self.adblock_update() self._download_manager = DownloadManager(self) self.profile = default_profile() self.profile.enable(self) self.aboutToQuit.connect(self.profile.save_session) self.installEventFilter(GLOBAL_EVENT_FILTER) settings = QWebEngineSettings.globalSettings() settings.setAttribute( QWebEngineSettings.LinksIncludedInFocusChain, False, ) settings.setAttribute( QWebEngineSettings.PluginsEnabled, True, ) settings.setAttribute( QWebEngineSettings.FullScreenSupportEnabled, True, ) settings.setAttribute( QWebEngineSettings.JavascriptCanOpenWindows, True, ) _app_requires()
def __init__(self, *args, device=None): QApplication.__init__(self, *args) self.cs8 = CS8State() cs8_panel = CS8_Panel(cs8=self.cs8) cs8_panel.setWindowTitle('CS8 Monitoring') cs8_panel.show() if not device: sys.exit() self.cats_dev = DeviceProxy(device) update_timer = QTimer() update_timer.timeout.connect(self.update_status) update_timer.start(500) sys.exit(self.exec_())
def __init__(self): QApplication.__init__(self, sys.argv) loop = QEventLoop(self) self.loop = loop asyncio.set_event_loop(self.loop) self.gui = LoginDialogControl() self.gui.show() exit_code = self.exec_() if exit_code == 888: self.restart_program() else: sys.exit() loop.run_forever()
def __init__(self, args): QApplication.__init__(self, args) self.__class__.INSTANCE = self if (opengl_vendor() == 'nouveau' and not (os.environ.get('LIBGL_ALWAYS_SOFTWARE') == '1' or 'QT_XCB_FORCE_SOFTWARE_OPENGL' in os.environ)): sys.exit("You are using the nouveau graphics driver but it" " has issues with multithreaded opengl. You must" " use another driver or set the variable environment" " QT_XCB_FORCE_SOFTWARE_OPENGL to force software" " opengl. Note that it might be slow, depending" " on your hardware.") self._setup_conf_paths() self._interceptor = UrlInterceptor(self) self._download_manager = DownloadManager(self) self.profile = default_profile() self.profile.enable(self) settings = QWebEngineSettings.globalSettings() settings.setAttribute( QWebEngineSettings.LinksIncludedInFocusChain, False, ) settings.setAttribute( QWebEngineSettings.PluginsEnabled, True, ) settings.setAttribute( QWebEngineSettings.FullScreenSupportEnabled, True, ) settings.setAttribute( QWebEngineSettings.JavascriptCanOpenWindows, True, ) self.installEventFilter(LOCAL_KEYMAP_SETTER) self.setQuitOnLastWindowClosed(False) self.network_manager = QNetworkAccessManager(self) _app_requires()
def __init__(self, *args, **kw): QApplication.__init__(self, *args, **kw) BaseApplication.__init__(self) self.view = qtutils.create_form( "main.ui", opengl={"graphicsView": ChimeraGraphics}, connections={ "actionOpen.triggered": self.open, "actionQuit.triggered": self.quit, "lineEdit.textChanged": self.save_command, "lineEdit.returnPressed": self.process_command, "graphicsViewGL.mousePress": self.mouse_press, "graphicsViewGL.mouseRelease": self.mouse_release, "graphicsViewGL.mouseMove": self.mouse_drag, # TODO: why are't these needed? #"graphicsViewGL.keyPress": "lineEdit.event", #"graphicsViewGL.keyRelease": "lineEdit.event", }) self.view.setWindowTitle(self.applicationName()) self.statusbar = self.find_object("statusbar") assert self.statusbar is not None self.graphics = self.find_object("graphicsViewGL") assert self.graphics is not None self.graphics.makeCurrent() self.graphics.setFocusPolicy(Qt.WheelFocus) self.line_edit = self.find_object("lineEdit") assert self.line_edit is not None self.completer = QCompleter(self.line_edit) self.completer.setModel(QStringListModel(self.completer)) #self.completer.setCompletionMode(QCompleter.PopupCompletion) self.line_edit.setCompleter(self.completer) self._mouse_mode = None self.view.show() self.cursors = { # TODO: custom cursors "pick": Qt.PointingHandCursor, "vsphere_z": Qt.IBeamCursor, "vsphere_rot": Qt.ClosedHandCursor, "translate": Qt.SizeAllCursor, } self.timer = QTimer(self.view) self.active_timer = False from chimera2.trackchanges import track from chimera2 import scene track.add_handler(scene.View, self._update_cb)
def __init__(self, argv, catalog): QApplication.__init__(self, argv) self.aboutToQuit.connect(self.cleanup) self.control = QLocalServer(self) self.control.newConnection.connect(self.onControlConnect) self.mainwindow = None self.catalog = '%s-pds.socket' % catalog self._init_translations() self.readyToRun = self.control.listen(self.catalog) if not self.readyToRun: if self.sendToInstance('show-mainwindow'): sys.exit() else: self.control.removeServer(self.catalog) self.readyToRun = self.control.listen(self.catalog)
def __init__(self, win_id, *argv): logfunc = logging.info logfunc(sys._getframe().f_code.co_name + '()') QApplication.__init__(self, *argv) self._id = win_id self._activation_window = None self._activate_on_message = False # Is there another instance running? self._outSocket = QLocalSocket() self._outSocket.connectToServer(self._id) self._isRunning = self._outSocket.waitForConnected() self._outStream = None self._inSocket = None self._inStream = None self._server = None if self._isRunning: # Yes, there is. self._outStream = QTextStream(self._outSocket) self._outStream.setCodec('UTF-8') else: # No, there isn't, at least not properly. # Cleanup any past, crashed server. error = self._outSocket.error() logfunc(LOGVARSTR % ('self._outSocket.error()', error)) if error == QLocalSocket.ConnectionRefusedError: logfunc('received QLocalSocket.ConnectionRefusedError; ' + \ 'removing server.') self.close() QLocalServer.removeServer(self._id) self._outSocket = None self._server = QLocalServer() self._server.listen(self._id) self._server.newConnection.connect(self._on_new_connection) logfunc(sys._getframe().f_code.co_name + '(): returning')
def __init__(self, args, **kwargs): super(GuiApplicationBase, self).__init__(args=args, **kwargs) # Fixme: Why ? self._logger.debug("QApplication " + str(sys.argv)) QApplication.__init__(self, sys.argv) self._logger.debug('GuiApplicationBase ' + str(args) + ' ' + str(kwargs)) self.setAttribute(Qt.AA_EnableHighDpiScaling) # from . import BabelRessource rcc_path = ConfigInstall.Path.join_share_directory('babel.rcc') self._logger.debug('Load ressource {}'.format(rcc_path)) if not QResource.registerResource(str(rcc_path)): self._logger.debug('Failed to load ressource {}'.format(rcc_path)) # self._display_splash_screen() self._main_window = None self._initialise_qml_engine() self._init_actions()
def __init__(self, argv=[]): QApplication.__init__(self, argv) self.widget = KEyesWidget()
def __init__(self): QApplication.__init__(self, sys.argv) self._window = None
def __init__(self, *arg, **kwarg): QApplication.__init__(self, *arg, **kwarg) self.appWindow = AppMainWindow()
def __init__(self, opts): QApplication.__init__(self, []) self.opts = opts self.initUI()
def __init__(self, args): QApplication.__init__(self,args) self.window = Window() sys.exit(self.exec_())
def __init__(self, *args, mode=None): QApplication.__init__(self, *args) # Log some basic system info try: v = openshot.GetVersion() log.info("openshot-qt version: %s" % info.VERSION) log.info("libopenshot version: %s" % v.ToString()) log.info("platform: %s" % platform.platform()) log.info("processor: %s" % platform.processor()) log.info("machine: %s" % platform.machine()) log.info("python version: %s" % platform.python_version()) log.info("qt5 version: %s" % QT_VERSION_STR) log.info("pyqt5 version: %s" % PYQT_VERSION_STR) except: pass # Setup appication self.setApplicationName('openshot') self.setApplicationVersion(info.SETUP['version']) # Init settings self.settings = settings.SettingStore() try: self.settings.load() except Exception as ex: log.error("Couldn't load user settings. Exiting.\n{}".format(ex)) exit() # Init translation system language.init_language() # Tests of project data loading/saving self.project = project_data.ProjectDataStore() # Init Update Manager self.updates = updates.UpdateManager() # It is important that the project is the first listener if the key gets update self.updates.add_listener(self.project) # Load ui theme if not set by OS ui_util.load_theme() # Start libopenshot logging thread self.logger_libopenshot = logger_libopenshot.LoggerLibOpenShot() self.logger_libopenshot.start() # Track which dockable window received a context menu self.context_menu_object = None # Set unique install id (if blank) if not self.settings.get("unique_install_id"): self.settings.set("unique_install_id", str(uuid4())) # Track 1st launch metric import classes.metrics classes.metrics.track_metric_screen("initial-launch-screen") # Set Font for any theme if self.settings.get("theme") != "No Theme": # Load embedded font try: log.info("Setting font to %s" % os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_id = QFontDatabase.addApplicationFont(os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_family = QFontDatabase.applicationFontFamilies(font_id)[0] font = QFont(font_family) font.setPointSizeF(10.5) QApplication.setFont(font) except Exception as ex: log.error("Error setting Ubuntu-R.ttf QFont: %s" % str(ex)) # Set Experimental Dark Theme if self.settings.get("theme") == "Humanity: Dark": # Only set if dark theme selected log.info("Setting custom dark theme") self.setStyle(QStyleFactory.create("Fusion")) darkPalette = self.palette() darkPalette.setColor(QPalette.Window, QColor(53, 53, 53)) darkPalette.setColor(QPalette.WindowText, Qt.white) darkPalette.setColor(QPalette.Base, QColor(25, 25, 25)) darkPalette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ToolTipBase, Qt.white) darkPalette.setColor(QPalette.ToolTipText, Qt.white) darkPalette.setColor(QPalette.Text, Qt.white) darkPalette.setColor(QPalette.Button, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ButtonText, Qt.white) darkPalette.setColor(QPalette.BrightText, Qt.red) darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218)) darkPalette.setColor(QPalette.HighlightedText, Qt.black) darkPalette.setColor(QPalette.Disabled, QPalette.Text, QColor(104, 104, 104)) self.setPalette(darkPalette) self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 0px solid white; }") # Create main window from windows.main_window import MainWindow self.window = MainWindow(mode) log.info('Process command-line arguments: %s' % args) if len(args[0]) == 2: path = args[0][1] if ".osp" in path: # Auto load project passed as argument self.window.open_project(path) else: # Auto import media file self.window.filesTreeView.add_file(path) # Reset undo/redo history self.updates.reset() self.window.updateStatusChanged(False, False)
def __init__(self, *args, mode=None): QApplication.__init__(self, *args) # Log some basic system info try: v = openshot.GetVersion() log.info("openshot-qt version: %s" % info.VERSION) log.info("libopenshot version: %s" % v.ToString()) log.info("platform: %s" % platform.platform()) log.info("processor: %s" % platform.processor()) log.info("machine: %s" % platform.machine()) log.info("python version: %s" % platform.python_version()) log.info("qt5 version: %s" % QT_VERSION_STR) log.info("pyqt5 version: %s" % PYQT_VERSION_STR) except: pass # Setup application self.setApplicationName('openshot') self.setApplicationVersion(info.SETUP['version']) # Init settings self.settings = settings.SettingStore() self.settings.load() # Init and attach exception handler from classes import exceptions sys.excepthook = exceptions.ExceptionHandler # Init translation system language.init_language() # Detect minimum libopenshot version _ = self._tr libopenshot_version = openshot.GetVersion().ToString() if mode != "unittest" and libopenshot_version < info.MINIMUM_LIBOPENSHOT_VERSION: QMessageBox.warning(None, _("Wrong Version of libopenshot Detected"), _("<b>Version %(minimum_version)s is required</b>, but %(current_version)s was detected. Please update libopenshot or download our latest installer.") % {"minimum_version": info.MINIMUM_LIBOPENSHOT_VERSION, "current_version": libopenshot_version}) # Stop launching and exit sys.exit() # Tests of project data loading/saving self.project = project_data.ProjectDataStore() # Init Update Manager self.updates = updates.UpdateManager() # It is important that the project is the first listener if the key gets update self.updates.add_listener(self.project) # Load ui theme if not set by OS ui_util.load_theme() # Start libopenshot logging thread self.logger_libopenshot = logger_libopenshot.LoggerLibOpenShot() self.logger_libopenshot.start() # Track which dockable window received a context menu self.context_menu_object = None # Set Font for any theme if self.settings.get("theme") != "No Theme": # Load embedded font try: log.info("Setting font to %s" % os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_id = QFontDatabase.addApplicationFont(os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_family = QFontDatabase.applicationFontFamilies(font_id)[0] font = QFont(font_family) font.setPointSizeF(10.5) QApplication.setFont(font) except Exception as ex: log.error("Error setting Ubuntu-R.ttf QFont: %s" % str(ex)) # Set Experimental Dark Theme if self.settings.get("theme") == "Humanity: Dark": # Only set if dark theme selected log.info("Setting custom dark theme") self.setStyle(QStyleFactory.create("Fusion")) darkPalette = self.palette() darkPalette.setColor(QPalette.Window, QColor(53, 53, 53)) darkPalette.setColor(QPalette.WindowText, Qt.white) darkPalette.setColor(QPalette.Base, QColor(25, 25, 25)) darkPalette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ToolTipBase, Qt.white) darkPalette.setColor(QPalette.ToolTipText, Qt.white) darkPalette.setColor(QPalette.Text, Qt.white) darkPalette.setColor(QPalette.Button, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ButtonText, Qt.white) darkPalette.setColor(QPalette.BrightText, Qt.red) darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218)) darkPalette.setColor(QPalette.HighlightedText, Qt.black) darkPalette.setColor(QPalette.Disabled, QPalette.Text, QColor(104, 104, 104)) self.setPalette(darkPalette) self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 0px solid white; }") # Create main window from windows.main_window import MainWindow self.window = MainWindow(mode) # Reset undo/redo history self.updates.reset() self.window.updateStatusChanged(False, False) log.info('Process command-line arguments: %s' % args) if len(args[0]) == 2: path = args[0][1] if ".osp" in path: # Auto load project passed as argument self.window.OpenProjectSignal.emit(path) else: # Auto import media file self.window.filesTreeView.add_file(path) else: # Recover backup file (this can't happen until after the Main Window has completely loaded) self.window.RecoverBackup.emit()
def __init__(self, *args): QApplication.__init__(self, *args) # Setup appication self.setApplicationName('openshot') self.setApplicationVersion(info.SETUP['version']) # Init settings self.settings = settings.SettingStore() try: self.settings.load() except Exception as ex: log.error("Couldn't load user settings. Exiting.\n{}".format(ex)) exit() # Init translation system language.init_language() # Tests of project data loading/saving self.project = project_data.ProjectDataStore() # Init Update Manager self.updates = updates.UpdateManager() # It is important that the project is the first listener if the key gets update self.updates.add_listener(self.project) # Load ui theme if not set by OS ui_util.load_theme() # Track which dockable window received a context menu self.context_menu_object = None # Set Font for any theme if self.settings.get("theme") != "No Theme": # Load embedded font log.info("Setting font to %s" % os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_id = QFontDatabase.addApplicationFont(os.path.join(info.IMAGES_PATH, "fonts", "Ubuntu-R.ttf")) font_family = QFontDatabase.applicationFontFamilies(font_id)[0] font = QFont(font_family) font.setPointSizeF(10.5) QApplication.setFont(font) # Set Experimental Dark Theme if self.settings.get("theme") == "Humanity: Dark": # Only set if dark theme selected log.info("Setting custom dark theme") self.setStyle(QStyleFactory.create("Fusion")) darkPalette = self.palette() darkPalette.setColor(QPalette.Window, QColor(53, 53, 53)) darkPalette.setColor(QPalette.WindowText, Qt.white) darkPalette.setColor(QPalette.Base, QColor(25, 25, 25)) darkPalette.setColor(QPalette.AlternateBase, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ToolTipBase, Qt.white) darkPalette.setColor(QPalette.ToolTipText, Qt.white) darkPalette.setColor(QPalette.Text, Qt.white) darkPalette.setColor(QPalette.Button, QColor(53, 53, 53)) darkPalette.setColor(QPalette.ButtonText, Qt.white) darkPalette.setColor(QPalette.BrightText, Qt.red) darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218)) darkPalette.setColor(QPalette.HighlightedText, Qt.black) self.setPalette(darkPalette) self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 0px solid white; }") # Create main window from windows.main_window import MainWindow self.window = MainWindow() self.window.show() # Load new/blank project (which sets default profile) self.project.load("") log.info('Process command-line arguments: %s' % args) if len(args[0]) == 2: path = args[0][1] if ".osp" in path: # Auto load project passed as argument self.window.open_project(path) else: # Auto import media file self.window.filesTreeView.add_file(path)
def __init__(self): QApplication.__init__(self, sys.argv) QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps) QApplication.setQuitOnLastWindowClosed(False)
def __init__(self, *args): QApplication.__init__(self, *args) self.main = MainWindow()
def __init__(self): QApplication.__init__(self, []) self.window = QWidget()
def __init__(self, args): QApplication.__init__(self,args) tets = Test() sys.exit(self.exec_())
def __init__(self, argv): QApplication.__init__(self, argv) self.setOrganizationName(App.ORGANIZATION) self.setApplicationName(App.NAME)
def __init__(self, *args): QApplication.__init__(self, *args) self.main = MainWindow() # self.connect(self, SIGNAL("lastWindowClosed()"), self.byebye ) self.main.show()