Busy cursor for split and merge

This commit is contained in:
Kovid Goyal 2013-11-26 21:02:58 +05:30
parent 4077030da1
commit 170b16b74b

View File

@ -565,6 +565,8 @@ class Boss(QObject):
def split_requested(self, name, loc):
if not self.check_dirtied():
return
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
try:
self.add_savepoint(_('Split %s') % self.gui.elided_text(name))
try:
bottom_name = split(current_container(), name, loc)
@ -573,10 +575,14 @@ class Boss(QObject):
raise
self.apply_container_update_to_gui()
self.edit_file(bottom_name, 'html')
finally:
QApplication.restoreOverrideCursor()
def merge_requested(self, category, names, master):
if not self.check_dirtied():
return
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
try:
self.add_savepoint(_('Merge files into %s') % self.gui.elided_text(master))
try:
merge(current_container(), category, names, master)
@ -586,6 +592,8 @@ class Boss(QObject):
self.apply_container_update_to_gui()
if master in editors:
self.show_editor(master)
finally:
QApplication.restoreOverrideCursor()
def sync_editor_to_preview(self, name, lnum):
editor = self.edit_file(name, 'html')