Exemple #1
0
    def _initToolBarActions(self, toolbar):
        actions_group = QActionGroup(self)
        show_source_action = ActionFactory.createAction(
            toolbar,
            "Source",
            "Show LaTeX source editor",
            shortcut=QKeySequence.SelectStartOfLine,
            slot=self.showSourceView,
            checkable=True)
        show_preamble_action = ActionFactory.createAction(
            toolbar,
            "Preamble",
            "Show LaTeX preamble editor",
            shortcut=QKeySequence.SelectEndOfLine,
            slot=self.showPreambleView,
            checkable=True)
        self.actions[actions.SHOW_SOURCE] = show_source_action
        self.actions[actions.SHOW_PREAMBLE] = show_preamble_action

        show_source_action.setChecked(True)
        actions_group.addAction(show_source_action)
        actions_group.addAction(show_preamble_action)

        ToolBarFactory.addItemsToToolBar(
            (self.app_controller.actions[actions.PREVIEW],
             ("Copy", self.app_controller.actions[actions.COPY_MENU]),
             ("Snippets", self.app_controller.actions[actions.SNIPPETS_MENU]),
             None, show_source_action, show_preamble_action, QLabel()),
            toolbar)
Exemple #2
0
	def _initToolBarActions(self, toolbar):
		actions_group = QActionGroup(self)
		show_logs_action = ActionFactory.createAction(toolbar, "Logs", "Show LaTeX preview logs", shortcut="Ctrl+L", slot=self.showLogsView, checkable=True)
		show_errors_action = ActionFactory.createAction(toolbar, "Errors", "Show LaTeX preview errors", shortcut="Ctrl+E", slot=self.showErrorsView, checkable=True)
		self.actions[actions.SHOW_LOGS] = show_logs_action
		self.actions[actions.SHOW_ERRORS] = show_errors_action

		actions_group.addAction(show_logs_action)
		actions_group.addAction(show_errors_action)
		ToolBarFactory.addItemsToToolBar((None, show_logs_action, show_errors_action, QLabel()), toolbar)
Exemple #3
0
	def _initToolBarActions(self, toolbar):
		actions_group = QActionGroup(self)
		show_source_action = ActionFactory.createAction(toolbar, "Source", "Show LaTeX source editor", shortcut=QKeySequence.SelectStartOfLine, slot=self.showSourceView, checkable=True)
		show_preamble_action = ActionFactory.createAction(toolbar, "Preamble", "Show LaTeX preamble editor", shortcut=QKeySequence.SelectEndOfLine, slot=self.showPreambleView, checkable=True)
		self.actions[actions.SHOW_SOURCE] = show_source_action
		self.actions[actions.SHOW_PREAMBLE] = show_preamble_action

		show_source_action.setChecked(True)
		actions_group.addAction(show_source_action)
		actions_group.addAction(show_preamble_action)

		ToolBarFactory.addItemsToToolBar((
			self.app_controller.actions[actions.PREVIEW],
			("Copy", self.app_controller.actions[actions.COPY_MENU]),
			("Snippets", self.app_controller.actions[actions.SNIPPETS_MENU]),
			None, show_source_action, show_preamble_action,
			QLabel()), toolbar)
Exemple #4
0
	def loadSnippets(self):
		snippets_menu = self.actions[actions.SNIPPETS_MENU]
		snippets_menu.clear()
		snippets = Preferences.getSnippets()
		for snippet_name in sorted(snippets.iterkeys()):
			snippet_code = snippets[snippet_name]
			action = ActionFactory.createAction(self, snippet_name, "Insert \"%s\" Snippet" % snippet_name, None, self.insertSnippet)
			action.setData(QVariant(snippet_code))
			snippets_menu.addAction(action)
Exemple #5
0
	def _initToolBarActions(self):
		show_editor_action = ActionFactory.createAction(self.toolbar, "Editor", "Show editor's preferences", shortcut=None, slot=self.showEditorPreferences, checkable=True)
		show_document_action = ActionFactory.createAction(self.toolbar, "Document", "Show document's preferences", shortcut=None, slot=self.showDocumentPreferences, checkable=True)
		show_preview_action = ActionFactory.createAction(self.toolbar, "Preview", "Show preview's preferences", shortcut=None, slot=self.showPreviewPreferences, checkable=True)
		show_snippets_action = ActionFactory.createAction(self.toolbar, "Snippets", "Show snippets preferences", shortcut=None, slot=self.showSnippetsPreferences, checkable=True)
		self.actions[PreferencesView.SHOW_EDITOR_ACTION] = show_editor_action
		self.actions[PreferencesView.SHOW_DOCUMENT_ACTION] = show_document_action
		self.actions[PreferencesView.SHOW_PREVIEW_ACTION] = show_preview_action
		self.actions[PreferencesView.SHOW_SNIPPETS_ACTION] = show_snippets_action

		actions_group = QActionGroup(self)
		actions_group.addAction(show_editor_action)
		actions_group.addAction(show_document_action)
		actions_group.addAction(show_preview_action)
		actions_group.addAction(show_snippets_action)
		ToolBarFactory.addItemsToToolBar(
			(None, show_editor_action, show_document_action, show_preview_action, show_snippets_action, None),
			self.toolbar)
Exemple #6
0
    def _initToolBarActions(self):
        show_editor_action = ActionFactory.createAction(
            self.toolbar,
            "Editor",
            "Show editor's preferences",
            shortcut=None,
            slot=self.showEditorPreferences,
            checkable=True)
        show_document_action = ActionFactory.createAction(
            self.toolbar,
            "Document",
            "Show document's preferences",
            shortcut=None,
            slot=self.showDocumentPreferences,
            checkable=True)
        show_preview_action = ActionFactory.createAction(
            self.toolbar,
            "Preview",
            "Show preview's preferences",
            shortcut=None,
            slot=self.showPreviewPreferences,
            checkable=True)
        show_snippets_action = ActionFactory.createAction(
            self.toolbar,
            "Snippets",
            "Show snippets preferences",
            shortcut=None,
            slot=self.showSnippetsPreferences,
            checkable=True)
        self.actions[PreferencesView.SHOW_EDITOR_ACTION] = show_editor_action
        self.actions[
            PreferencesView.SHOW_DOCUMENT_ACTION] = show_document_action
        self.actions[PreferencesView.SHOW_PREVIEW_ACTION] = show_preview_action
        self.actions[
            PreferencesView.SHOW_SNIPPETS_ACTION] = show_snippets_action

        actions_group = QActionGroup(self)
        actions_group.addAction(show_editor_action)
        actions_group.addAction(show_document_action)
        actions_group.addAction(show_preview_action)
        actions_group.addAction(show_snippets_action)
        ToolBarFactory.addItemsToToolBar(
            (None, show_editor_action, show_document_action,
             show_preview_action, show_snippets_action, None), self.toolbar)
Exemple #7
0
    def _initToolBarActions(self, toolbar):
        actions_group = QActionGroup(self)
        show_logs_action = ActionFactory.createAction(
            toolbar,
            "Logs",
            "Show LaTeX preview logs",
            shortcut="Ctrl+L",
            slot=self.showLogsView,
            checkable=True)
        show_errors_action = ActionFactory.createAction(
            toolbar,
            "Errors",
            "Show LaTeX preview errors",
            shortcut="Ctrl+E",
            slot=self.showErrorsView,
            checkable=True)
        self.actions[actions.SHOW_LOGS] = show_logs_action
        self.actions[actions.SHOW_ERRORS] = show_errors_action

        actions_group.addAction(show_logs_action)
        actions_group.addAction(show_errors_action)
        ToolBarFactory.addItemsToToolBar(
            (None, show_logs_action, show_errors_action, QLabel()), toolbar)
Exemple #8
0
 def _createActions(self):
     self.actions[actions.ABOUT] = ActionFactory.createAction(
         self, "About", "About the application", None, self.about)
     self.actions[actions.CLOSE] = ActionFactory.createAction(
         self, "Close", "Close the window", QKeySequence.Close, self.close)
     self.actions[actions.COPY] = ActionFactory.createAction(
         self, "Copy", "Copy selected item", QKeySequence.Copy, self.copy)
     self.actions[actions.COPY_SOURCE] = ActionFactory.createAction(
         self, "Copy Source", "Copy the TikZ source", "Ctrl+Shift+C",
         self.copySource)
     self.actions[actions.COPY_PREAMBLE] = ActionFactory.createAction(
         self, "Copy Preamble", "Copy the preamble", "Ctrl+Shift+P",
         self.copyPreamble)
     self.actions[
         actions.COPY_PREAMBLE_AND_SOURCE] = ActionFactory.createAction(
             self, "Copy Preamble and Source",
             "Copy the TikZ source with preamble", None,
             self.copyPreambleAndSource)
     self.actions[actions.CUT] = ActionFactory.createAction(
         self, "Cut", "Cut selected item", QKeySequence.Cut, self.cut)
     self.actions[actions.NEW] = ActionFactory.createAction(
         self, "New", "Create a new document", QKeySequence.New, self.new)
     self.actions[actions.OPEN] = ActionFactory.createAction(
         self, "Open", "Open an existing document", QKeySequence.Open,
         self.open)
     self.actions[actions.PASTE] = ActionFactory.createAction(
         self, "Paste", "Paste content of clipboard", QKeySequence.Paste,
         self.paste)
     self.actions[actions.PREFERENCES] = ActionFactory.createAction(
         self, "Preferences", "Show the preferences window",
         QKeySequence.Preferences, self.showPreferences)
     self.actions[actions.PREFERENCES].setMenuRole(QAction.PreferencesRole)
     self.actions[actions.PREVIEW] = ActionFactory.createAction(
         self, "Preview", "Preview the document", QKeySequence.Print,
         self.preview)
     self.actions[actions.REDO] = ActionFactory.createAction(
         self, "Redo", "Redo last action", QKeySequence.Redo, self.redo)
     self.actions[actions.QUIT] = ActionFactory.createAction(
         self, "Quit", "Quit the application", QKeySequence.Quit, self.quit)
     self.actions[actions.SAVE] = ActionFactory.createAction(
         self, "Save", "Save the document", QKeySequence.Save, self.save)
     self.actions[actions.SAVE_ALL] = ActionFactory.createAction(
         self, "Save All", "Save all documents", None, self.saveAll)
     self.actions[actions.SAVE_AS] = ActionFactory.createAction(
         self, "Save As...", "Save the document as...", QKeySequence.SaveAs,
         self.saveAs)
     self.actions[actions.UNDO] = ActionFactory.createAction(
         self, "Undo", "Undo last action", QKeySequence.Undo, self.undo)
Exemple #9
0
	def _createActions(self):
		self.actions[actions.ABOUT] = ActionFactory.createAction(self, "About", "About the application", None, self.about)
		self.actions[actions.CLOSE] = ActionFactory.createAction(self, "Close", "Close the window", QKeySequence.Close, self.close)
		self.actions[actions.COPY] = ActionFactory.createAction(self, "Copy", "Copy selected item", QKeySequence.Copy, self.copy)
		self.actions[actions.COPY_SOURCE] = ActionFactory.createAction(self, "Copy Source", "Copy the TikZ source", "Ctrl+Shift+C", self.copySource)
		self.actions[actions.COPY_PREAMBLE] = ActionFactory.createAction(self, "Copy Preamble", "Copy the preamble", "Ctrl+Shift+P", self.copyPreamble)
		self.actions[actions.COPY_PREAMBLE_AND_SOURCE] = ActionFactory.createAction(self, "Copy Preamble and Source", "Copy the TikZ source with preamble", None, self.copyPreambleAndSource)
		self.actions[actions.CUT] = ActionFactory.createAction(self, "Cut", "Cut selected item", QKeySequence.Cut, self.cut)
		self.actions[actions.NEW] = ActionFactory.createAction(self, "New", "Create a new document", QKeySequence.New, self.new)
		self.actions[actions.OPEN] = ActionFactory.createAction(self, "Open", "Open an existing document", QKeySequence.Open, self.open)
		self.actions[actions.PASTE] = ActionFactory.createAction(self, "Paste", "Paste content of clipboard", QKeySequence.Paste, self.paste)
		self.actions[actions.PREFERENCES] = ActionFactory.createAction(self, "Preferences", "Show the preferences window", QKeySequence.Preferences, self.showPreferences)
		self.actions[actions.PREFERENCES].setMenuRole(QAction.PreferencesRole)
		self.actions[actions.PREVIEW] = ActionFactory.createAction(self, "Preview", "Preview the document", QKeySequence.Print, self.preview)
		self.actions[actions.REDO] = ActionFactory.createAction(self, "Redo", "Redo last action", QKeySequence.Redo, self.redo)
		self.actions[actions.QUIT] = ActionFactory.createAction(self, "Quit", "Quit the application", QKeySequence.Quit, self.quit)
		self.actions[actions.SAVE] = ActionFactory.createAction(self, "Save", "Save the document", QKeySequence.Save, self.save)
		self.actions[actions.SAVE_ALL] = ActionFactory.createAction(self, "Save All", "Save all documents", None, self.saveAll)
		self.actions[actions.SAVE_AS] = ActionFactory.createAction(self, "Save As...", "Save the document as...", QKeySequence.SaveAs, self.saveAs)
		self.actions[actions.UNDO] = ActionFactory.createAction(self, "Undo", "Undo last action", QKeySequence.Undo, self.undo)