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:
Vassilii Khachaturov
2013-08-21 14:41:12 +00:00
parent 192e32cdf4
commit baae86787c
11 changed files with 28 additions and 26 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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