コード例 #1
0
ファイル: boss.py プロジェクト: kmshi/calibre
 def pretty_print(self, current):
     if current:
         ed = self.gui.central.current_editor
         for name, x in editors.iteritems():
             if x is ed:
                 break
         ed.pretty_print(name)
     else:
         self.commit_all_editors_to_container()
         with BusyCursor():
             self.add_savepoint(_('Beautify files'))
             pretty_all(current_container())
             self.update_editors_from_container()
             self.set_modified()
コード例 #2
0
ファイル: boss.py プロジェクト: CharlesSong/calibre
 def pretty_print(self, current):
     if current:
         ed = self.gui.central.current_editor
         for name, x in editors.iteritems():
             if x is ed:
                 break
         ed.pretty_print(name)
     else:
         self.commit_all_editors_to_container()
         with BusyCursor():
             self.add_savepoint(_('Beautify files'))
             pretty_all(current_container())
             self.update_editors_from_container()
             self.set_modified()
コード例 #3
0
ファイル: boss.py プロジェクト: Gondulf/calibre
 def pretty_print(self, current):
     if current:
         ed = self.gui.central.current_editor
         for name, x in editors.iteritems():
             if x is ed:
                 break
         ed.pretty_print(name)
     else:
         if not self.check_dirtied():
             return
         QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
         try:
             self.add_savepoint(_('Beautify files'))
             pretty_all(current_container())
             self.update_editors_from_container()
             self.set_modified()
         finally:
             QApplication.restoreOverrideCursor()