diff --git a/pysollib/actions.py b/pysollib/actions.py index 79463f83..cac2e3ae 100644 --- a/pysollib/actions.py +++ b/pysollib/actions.py @@ -21,7 +21,6 @@ # # ---------------------------------------------------------------------------## -import locale import os from pysollib.gamedb import GI @@ -566,20 +565,17 @@ class PysolMenubar(PysolMenubarTk): fn = os.path.normpath(fn) if not text.endswith(os.linesep): text += os.linesep - enc = locale.getpreferredencoding() try: with open(fn, 'at') as fh: - fh.write(text.encode(enc, 'replace')) + fh.write(d.text) except Exception as err: - d = MfxExceptionDialog( - self.top, err, - text=_("Error while writing to file")) + MfxExceptionDialog( + self.top, err, text=_("Error while writing to file")) else: - d = MfxMessageDialog( + MfxMessageDialog( self.top, title=_("%s Info") % TITLE, bitmap="info", text=_("Comments were appended to\n\n%(filename)s") % {'filename': fn}) - self._setCommentMenu(bool(game.gsaveinfo.comment)) # # Game menu - statistics diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index 4e2e7c16..cebc589b 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -781,7 +781,7 @@ class Game(object): def getGameNumber(self, format): s = self.random.getSeedAsStr() if format: - return "# " + s + return "#" + s return s # this is called from within createGame() diff --git a/pysollib/kivy/menubar.py b/pysollib/kivy/menubar.py index 4734197e..13741273 100644 --- a/pysollib/kivy/menubar.py +++ b/pysollib/kivy/menubar.py @@ -2059,9 +2059,6 @@ class PysolMenubarTk: # LB: not used return - def _setCommentMenu(self, v): - return - def _setPauseMenu(self, v): self.tkopt.pause.value = v diff --git a/pysollib/pysolgtk/menubar.py b/pysollib/pysolgtk/menubar.py index da4a90ec..82d25069 100644 --- a/pysollib/pysolgtk/menubar.py +++ b/pysollib/pysolgtk/menubar.py @@ -762,10 +762,6 @@ class PysolMenubarTk: def updateAll(self, *event): self.app.canvas.updateAll() - def _setCommentMenu(self, v): - # FIXME - pass - def _setPauseMenu(self, v): # FIXME pass diff --git a/pysollib/ui/tktile/menubar.py b/pysollib/ui/tktile/menubar.py index becd8c39..c0b2fd84 100644 --- a/pysollib/ui/tktile/menubar.py +++ b/pysollib/ui/tktile/menubar.py @@ -291,7 +291,6 @@ class PysolMenubarTkCommon: self.tkopt = Struct( gameid=tkinter.IntVar(), gameid_popular=tkinter.IntVar(), - comment=tkinter.BooleanVar(), autofaceup=tkinter.BooleanVar(), autodrop=tkinter.BooleanVar(), autodeal=tkinter.BooleanVar(), @@ -438,7 +437,6 @@ class PysolMenubarTkCommon: tkopt = self.tkopt tkopt.gameid.set(game.id) tkopt.gameid_popular.set(game.id) - tkopt.comment.set(bool(game.gsaveinfo.comment)) tkopt.pause.set(self.game.pause) if game.canFindCard(): self._connect_game_find_card_dialog(game) @@ -621,8 +619,8 @@ class PysolMenubarTkCommon: label=n_("Log..."), command=lambda: self.mPlayerStats(mode=103)) menu.add_separator() - menu.add_checkbutton( - label=n_("&Comments..."), variable=self.tkopt.comment, + menu.add_command( + label=n_("&Comments..."), command=self.mEditGameComment) menu = MfxMenu(self.menubar, label=n_("&Assist")) @@ -1400,9 +1398,6 @@ class PysolMenubarTkCommon: w = getattr(self.app.toolbar, path + "_button") w["state"] = s - def _setCommentMenu(self, v): - self.tkopt.comment.set(v) - def _setPauseMenu(self, v): self.tkopt.pause.set(v)