6953: remove "undo history warning" under CLI
To remove the meaningless "undo history warning" when a BatchTool is run from cli (e.g., "check"), we add to BatchTool constructor an extra argument to get the uistate, and only produce the GUI warning if there is GUI. svn: r22894
This commit is contained in:
@@ -78,7 +78,7 @@ class ChangeNames(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||
self.set_window(gtk.Window(),gtk.Label(),'')
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class ChangeTypes(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ def cross_table_duplicates(db):
|
||||
class Check(tool.BatchTool):
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class EventNames(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
|
||||
if not self.fail:
|
||||
uistate.set_busy_cursor(True)
|
||||
|
||||
@@ -417,7 +417,7 @@ class ExtractCity(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.set_window(gtk.Window(), gtk.Label(), '')
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
|
||||
if not self.fail:
|
||||
uistate.set_busy_cursor(True)
|
||||
|
||||
@@ -94,7 +94,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow.ManagedWindow):
|
||||
self.dbstate = dbstate
|
||||
self.set_window(gtk.Window(), gtk.Label(), '')
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
|
||||
if not self.fail:
|
||||
uistate.set_busy_cursor(True)
|
||||
|
||||
@@ -107,7 +107,7 @@ class PatchNames(tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.set_window(gtk.Window(), gtk.Label(), '')
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ _parseformat = re.compile('.*%(\d+)[^\d]+')
|
||||
#-------------------------------------------------------------------------
|
||||
class ReorderIds(tool.BatchTool):
|
||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class TestcaseGenerator(tool.BatchTool):
|
||||
if dbstate.db.readonly:
|
||||
return
|
||||
|
||||
tool.BatchTool.__init__(self, dbstate, options_class, name)
|
||||
tool.BatchTool.__init__(self, dbstate, uistate, options_class, name)
|
||||
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user