def initView(self): if not isMacintoshComputer(): self.setMenuBar(self.app_controller.menu_bar) self._initSubViews() self._restoreWindowState() self._initSignalsConnections() self.content_view.current_editor_view.setFocus()
def _createMenuBar(self): self.menu_bar = QMenuBar() self._createFileMenu() self._createEditMenu() # set menu bar of about and preferences windows if we're not on Mac OS X if not isMacintoshComputer(): self.preferences_controller.view.setMenuBar(self.menu_bar) self.about_controller.view.setMenuBar(self.menu_bar)
def defaultPDFToImageCommand(): if PreferencesModel.DEFAULT_PDF_TO_IMAGE_COMMAND is None: if isMacintoshComputer(): sips_path = findCommandLocation(defaults.DEFAULT_MAC_PDF_TO_IMAGE_COMMAND) PreferencesModel.DEFAULT_PDF_TO_IMAGE_COMMAND = defaults.DEFAULT_MAC_PDF_TO_IMAGE_ARGS % sips_path else: convert_path = findCommandLocation(defaults.DEFAULT_PDF_TO_IMAGE_COMMAND) PreferencesModel.DEFAULT_PDF_TO_IMAGE_COMMAND = defaults.DEFAULT_PDF_TO_IMAGE_ARGS % convert_path return PreferencesModel.DEFAULT_PDF_TO_IMAGE_COMMAND
def initDialog(self): self.name = self.old_name self.code = self.old_code self.setWindowTitle(self.dialogTitle()) if isMacintoshComputer(): self.setWindowFlags(Qt.Sheet) else: self.setModal(True) self._initConnections() self._initWidgets() self._initLayout()
def start(): app = QApplication(sys.argv) app.setOrganizationName(globals.ORGANIZATION_NAME) app.setOrganizationDomain(globals.ORGANIZATION_DOMAIN) app.setApplicationName(globals.APPLICATION_NAME) if isMacintoshComputer(): # add /opt/local/bin to PATH to find pdflatex binary -- useful for Mac plateform using Macports os.environ['PATH'] = os.environ.get('PATH', '/usr/bin') + ':/opt/local/bin' app.setQuitOnLastWindowClosed(False) app_controller = ControllerFactory.createAppController() args = app.arguments()[1:] if len(args) > 0: for file_path in args: app_controller.open(file_path) else: app_controller.new() app.exec_() app_controller.quit()