682 """ The file can be entered in a file selection dialog.</p>""" |
682 """ The file can be entered in a file selection dialog.</p>""" |
683 )) |
683 )) |
684 self.saveAsAct.triggered.connect(self.saveAsCurrentEditor) |
684 self.saveAsAct.triggered.connect(self.saveAsCurrentEditor) |
685 self.fileActions.append(self.saveAsAct) |
685 self.fileActions.append(self.saveAsAct) |
686 |
686 |
|
687 self.saveCopyAct = E5Action( |
|
688 QCoreApplication.translate('ViewManager', 'Save Copy'), |
|
689 UI.PixmapCache.getIcon("fileSaveCopy.png"), |
|
690 QCoreApplication.translate('ViewManager', 'Save &Copy...'), |
|
691 0, 0, self.saveActGrp, 'vm_file_save_copy') |
|
692 self.saveCopyAct.setStatusTip(QCoreApplication.translate( |
|
693 'ViewManager', 'Save a copy of the current file')) |
|
694 self.saveCopyAct.setWhatsThis(QCoreApplication.translate( |
|
695 'ViewManager', |
|
696 """<b>Save Copy</b>""" |
|
697 """<p>Save a copy of the contents of current editor window.""" |
|
698 """ The file can be entered in a file selection dialog.</p>""" |
|
699 )) |
|
700 self.saveCopyAct.triggered.connect(self.saveCopyCurrentEditor) |
|
701 self.fileActions.append(self.saveCopyAct) |
|
702 |
687 self.saveAllAct = E5Action( |
703 self.saveAllAct = E5Action( |
688 QCoreApplication.translate('ViewManager', 'Save all'), |
704 QCoreApplication.translate('ViewManager', 'Save all'), |
689 UI.PixmapCache.getIcon("fileSaveAll.png"), |
705 UI.PixmapCache.getIcon("fileSaveAll.png"), |
690 QCoreApplication.translate('ViewManager', 'Save a&ll'), |
706 QCoreApplication.translate('ViewManager', 'Save a&ll'), |
691 0, 0, self.saveActGrp, 'vm_file_save_all') |
707 0, 0, self.saveActGrp, 'vm_file_save_all') |
780 menu.addSeparator() |
796 menu.addSeparator() |
781 menu.addAction(self.findFileNameAct) |
797 menu.addAction(self.findFileNameAct) |
782 menu.addSeparator() |
798 menu.addSeparator() |
783 menu.addAction(self.saveAct) |
799 menu.addAction(self.saveAct) |
784 menu.addAction(self.saveAsAct) |
800 menu.addAction(self.saveAsAct) |
|
801 menu.addAction(self.saveCopyAct) |
785 menu.addAction(self.saveAllAct) |
802 menu.addAction(self.saveAllAct) |
786 self.exportersMenuAct = menu.addMenu(self.exportersMenu) |
803 self.exportersMenuAct = menu.addMenu(self.exportersMenu) |
787 menu.addSeparator() |
804 menu.addSeparator() |
788 menu.addAction(self.printPreviewAct) |
805 menu.addAction(self.printPreviewAct) |
789 menu.addAction(self.printAct) |
806 menu.addAction(self.printAct) |
816 tb.addAction(self.openAct) |
833 tb.addAction(self.openAct) |
817 tb.addAction(self.closeAct) |
834 tb.addAction(self.closeAct) |
818 tb.addSeparator() |
835 tb.addSeparator() |
819 tb.addAction(self.saveAct) |
836 tb.addAction(self.saveAct) |
820 tb.addAction(self.saveAsAct) |
837 tb.addAction(self.saveAsAct) |
|
838 tb.addAction(self.saveCopyAct) |
821 tb.addAction(self.saveAllAct) |
839 tb.addAction(self.saveAllAct) |
822 |
840 |
823 toolbarManager.addToolBar(tb, tb.windowTitle()) |
841 toolbarManager.addToolBar(tb, tb.windowTitle()) |
824 toolbarManager.addAction(self.printPreviewAct, tb.windowTitle()) |
842 toolbarManager.addAction(self.printPreviewAct, tb.windowTitle()) |
825 toolbarManager.addAction(self.printAct, tb.windowTitle()) |
843 toolbarManager.addAction(self.printAct, tb.windowTitle()) |
4856 """ |
4874 """ |
4857 if ed: |
4875 if ed: |
4858 ok = ed.saveFileAs() |
4876 ok = ed.saveFileAs() |
4859 if ok: |
4877 if ok: |
4860 self.setEditorName(ed, ed.getFileName()) |
4878 self.setEditorName(ed, ed.getFileName()) |
4861 else: |
|
4862 return |
|
4863 |
4879 |
4864 def saveAsCurrentEditor(self): |
4880 def saveAsCurrentEditor(self): |
4865 """ |
4881 """ |
4866 Public slot to save the contents of the current editor to a new file. |
4882 Public slot to save the contents of the current editor to a new file. |
4867 """ |
4883 """ |
4868 aw = self.activeWindow() |
4884 aw = self.activeWindow() |
4869 self.saveAsEditorEd(aw) |
4885 self.saveAsEditorEd(aw) |
|
4886 |
|
4887 def saveCopyEditorEd(self, ed): |
|
4888 """ |
|
4889 Public slot to save the contents of an editor to a new copy of |
|
4890 the file. |
|
4891 |
|
4892 @param ed editor to be saved |
|
4893 """ |
|
4894 if ed: |
|
4895 ed.saveFileCopy() |
|
4896 |
|
4897 def saveCopyCurrentEditor(self): |
|
4898 """ |
|
4899 Public slot to save the contents of the current editor to a new copy |
|
4900 of the file. |
|
4901 """ |
|
4902 aw = self.activeWindow() |
|
4903 self.saveCopyEditorEd(aw) |
4870 |
4904 |
4871 def saveEditorsList(self, editors): |
4905 def saveEditorsList(self, editors): |
4872 """ |
4906 """ |
4873 Public slot to save a list of editors. |
4907 Public slot to save a list of editors. |
4874 |
4908 |