def __init__(self, argv, locale=None, gui=True): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() icons.install() self.notifier = QtCore.QObject() self.notifier.connect(self.notifier, SIGNAL('update_files()'), self._update_files, Qt.QueuedConnection) # Call _update_files when inotify detects changes inotify.observer(self._update_files_notifier) if gui: self._app = current(tuple(argv)) self._app.setWindowIcon(icons.cola()) self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """) else: self._app = QtCore.QCoreApplication(argv)
def __init__(self, argv, locale=None, gui=True, git_path=None): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() # Call _update_files when inotify detects changes inotify.observer(_update_files) # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) if gui: self._app = instance(tuple(argv), git_path) self._app.setWindowIcon(qtutils.git_icon()) else: self._app = QtCore.QCoreApplication(argv) self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """)
def __init__(self, argv, locale=None, gui=True): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) if gui: self._app = instance(tuple(argv)) self._app.setWindowIcon(qtutils.git_icon()) else: self._app = QtCore.QCoreApplication(argv) self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """)
def __init__(self, argv, locale=None, gui=True, git_path=None): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() self.notifier = QtCore.QObject() self.notifier.connect(self.notifier, SIGNAL('update_files'), self._update_files) # Call _update_files when inotify detects changes inotify.observer(self._update_files_notifier) # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) if gui: self._app = current(tuple(argv), git_path) self._app.setWindowIcon(qtutils.git_icon()) self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """) else: self._app = QtCore.QCoreApplication(argv)
def __init__(self, argv, locale=None, gui=True): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() self.notifier = QtCore.QObject() self.notifier.connect(self.notifier, SIGNAL("update_files()"), self._update_files, Qt.QueuedConnection) # Call _update_files when inotify detects changes inotify.observer(self._update_files_notifier) # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) if gui: self._app = current(tuple(argv)) self._app.setWindowIcon(qtutils.git_icon()) self._app.setStyleSheet( """ QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """ ) else: self._app = QtCore.QCoreApplication(argv)
def __init__(self, argv, locale=None, gui=True): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() icons.install() QtCore.QObject.connect(fsmonitor.instance(), SIGNAL('files_changed'), self._update_files) if gui: self._app = current(tuple(argv)) self._app.setWindowIcon(icons.cola()) else: self._app = QtCore.QCoreApplication(argv)
def __init__(self, argv, locale=None, gui=True): cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() icons.install() QtCore.QObject.connect(fsmonitor.current(), SIGNAL('files_changed'), self._update_files) if gui: self._app = current(tuple(argv)) self._app.setWindowIcon(icons.cola()) else: self._app = QtCore.QCoreApplication(argv)
def __init__(self, argv, locale=None, gui=True): """Initialize our QApplication for translation """ cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) # monkey-patch Qt's translate() to use our translate() if gui: self._app = instance(tuple(argv)) self._app.setWindowIcon(qtutils.git_icon()) self._translate_base = QtGui.QApplication.translate QtGui.QApplication.translate = self.translate else: self._app = QtCore.QCoreApplication(argv) self._translate_base = QtCore.QCoreApplication.translate QtCore.QCoreApplication.translate = self.translate if not hasattr(self._app, 'setStyleSheet'): self._app.setStyleSheet = lambda x: None self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """) # Make file descriptors binary for win32 utils.set_binary(sys.stdin) utils.set_binary(sys.stdout) utils.set_binary(sys.stderr)
def __init__(self, argv, locale=None, gui=True): """Initialize our QApplication for translation """ cfgactions.install() i18n.install(locale) qtcompat.install() qtutils.install() # Add the default style dir so that we find our icons icon_dir = resources.icon_dir() qtcompat.add_search_path(os.path.basename(icon_dir), icon_dir) # monkey-patch Qt's translate() to use our translate() if gui: self._app = instance(tuple(argv)) self._app.setWindowIcon(qtutils.git_icon()) self._translate_base = QtGui.QApplication.translate QtGui.QApplication.translate = self.translate else: self._app = QtCore.QCoreApplication(argv) self._translate_base = QtCore.QCoreApplication.translate QtCore.QCoreApplication.translate = self.translate self._app.setStyleSheet(""" QMainWindow::separator { width: 3px; height: 3px; } QMainWindow::separator:hover { background: white; } """) # Make file descriptors binary for win32 utils.set_binary(sys.stdin) utils.set_binary(sys.stdout) utils.set_binary(sys.stderr)