Fix broken ask_for_help().

This commit is contained in:
Andrey Golovizin 2014-09-11 23:40:00 +02:00
parent f771722d0b
commit 1f91582ccd
3 changed files with 4 additions and 4 deletions

View file

@ -69,7 +69,7 @@ class Document(object):
try: try:
glyph_data = self.glyphdb[glyph] glyph_data = self.glyphdb[glyph]
except KeyError: except KeyError:
text, bold, italic = self.ui.ask_for_help(glyph) text, bold, italic = self.ui.ask_for_help(glyph, self.last_style.bold, self.last_style.italic)
glyph_data = self.glyphdb.add_glyph(glyph, text, bold, italic) glyph_data = self.glyphdb.add_glyph(glyph, text, bold, italic)
self.last_style = glyph_data.style self.last_style = glyph_data.style
return glyph_data return glyph_data

View file

@ -44,8 +44,8 @@ class GUIProxy(QObject, BaseUI):
def process_events(self): def process_events(self):
qApp.processEvents() qApp.processEvents()
def ask_for_help(self, unknown_glyph): def ask_for_help(self, unknown_glyph, bold, italic):
self.unknownGlyph.emit(unknown_glyph, self.last_style.bold, self.last_style.italic) self.unknownGlyph.emit(unknown_glyph, bold, italic)
return self.receive_help() return self.receive_help()
def give_help(self, *args): def give_help(self, *args):

View file

@ -15,7 +15,7 @@
class BaseUI(object): class BaseUI(object):
def ask_for_help(self, unknown_glyph): def ask_for_help(self, unknown_glyph, bold, italic):
raise NotImplementedError raise NotImplementedError
def turn_page(self, page): def turn_page(self, page):