Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferyto committed Mar 13, 2018
2 parents d90e354 + e5160d8 commit 2e82827
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 30 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.2 (2018-03-13)
* Fixed auto-closing gedit if there are no windows to restore (#1)
* Fixed (potentially) affecting the translations of other plugins

## 0.1.1 (2017-10-13)
* Added .pot file

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Reopen closed windows and optionally restore windows between sessions
<https://github.com/jefferyto/gedit-ex-mortis>
0.1.1
0.1.2

All bug reports, feature requests and miscellaneous comments are welcome
at the [project issue tracker][].
Expand Down Expand Up @@ -62,7 +62,7 @@ Inspired by:

## License

Copyright &copy; 2017 Jeffery To <jeffery.to@gmail.com>
Copyright &copy; 2017-2018 Jeffery To <jeffery.to@gmail.com>

Available under GNU General Public License version 3

Expand Down
4 changes: 2 additions & 2 deletions ex-mortis.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Name=Ex-Mortis
Description=Reopen closed windows and optionally restore windows between sessions
Icon=window-new
Authors=Jeffery To <jeffery.to@gmail.com>
Copyright=Copyright © 2017 Jeffery To
Copyright=Copyright © 2017-2018 Jeffery To
Website=https://github.com/jefferyto/gedit-ex-mortis
Version=0.1.1
Version=0.1.2
18 changes: 9 additions & 9 deletions ex-mortis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# __init__.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -39,8 +39,7 @@
try:
import gettext
gettext.bindtextdomain('gedit-ex-mortis', LOCALE_PATH)
gettext.textdomain('gedit-ex-mortis')
_ = gettext.gettext
_ = lambda s: gettext.dgettext('gedit-ex-mortis', s)
except:
_ = lambda s: s

Expand Down Expand Up @@ -434,6 +433,7 @@ class ExMortisConfigurable(GObject.Object, PeasGtk.Configurable):

__gtype_name__ = 'ExMortisConfigurable'


def do_create_configure_widget(self):
if log.query(log.INFO):
Gedit.debug_plugin_message(log.format(""))
Expand All @@ -452,14 +452,14 @@ def do_create_configure_widget(self):
)

widget.set_active(settings.restore_between_sessions)
widget._settings = settings

else:
widget = Gtk.Box()
widget.add(Gtk.Label.new(_("Could not load settings schema")))

widget.set_border_width(5)
widget = Gtk.Label.new(_("Could not load settings schema"))

widget._settings = settings
box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
box.set_border_width(5)
box.add(widget)

return widget
return box

2 changes: 1 addition & 1 deletion ex-mortis/closingmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# closingmixin.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down
5 changes: 2 additions & 3 deletions ex-mortis/existingmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# existingmixin.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand All @@ -29,8 +29,7 @@
try:
import gettext
gettext.bindtextdomain('gedit-ex-mortis', LOCALE_PATH)
gettext.textdomain('gedit-ex-mortis')
_ = gettext.gettext
_ = lambda s: gettext.dgettext('gedit-ex-mortis', s)
except:
_ = lambda s: s

Expand Down
2 changes: 1 addition & 1 deletion ex-mortis/locale/gedit-ex-mortis.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: gedit-ex-mortis 0.1.1\n"
"Project-Id-Version: gedit-ex-mortis 0.1.2\n"
"POT-Creation-Date: 2017-10-13 22:50+0800\n"
"PO-Revision-Date: 2017-10-13 22:50+0800\n"
"Last-Translator: Jeffery To <jeffery.to@gmail.com>\n"
Expand Down
11 changes: 5 additions & 6 deletions ex-mortis/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# log.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -97,14 +97,13 @@ def query(log_level):

return highest(log_level) <= output_level

def prefix(log_level=None):
def name(log_level=None):
if log_level is None:
log_level = last_queried_level

name = LEVELS_TO_NAMES[highest(log_level)] if log_level is not None else 'unknown'

return '[' + name + '] '
return LEVELS_TO_NAMES[highest(log_level)] if log_level is not None else 'unknown'

def format(message, *args):
return prefix() + (message % tuple(debug_str(arg) for arg in args))
msg = message % tuple(debug_str(arg) for arg in args)
return "[%s] %s" % (name(), msg)

10 changes: 7 additions & 3 deletions ex-mortis/quittingmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# quittingmixin.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -339,7 +339,7 @@ def restore_windows(self, window_manager, settings, do_restore):

settings.remove_window(window_id)

if do_restore:
if do_restore and states:
if log.query(log.MESSAGE):
Gedit.debug_plugin_message(log.format("restoring %s windows", len(states)))

Expand Down Expand Up @@ -372,10 +372,14 @@ def restore_windows(self, window_manager, settings, do_restore):
for window, state in zip(windows, states):
self.setup_restore_window(window, state)

else:
elif not do_restore:
if log.query(log.MESSAGE):
Gedit.debug_plugin_message(log.format("not restoring windows"))

else:
if log.query(log.MESSAGE):
Gedit.debug_plugin_message(log.format("no windows to restore"))

def setup_restore_window(self, window, state=None):
if log.query(log.INFO):
Gedit.debug_plugin_message(log.format("%s", window))
Expand Down
2 changes: 1 addition & 1 deletion ex-mortis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# settings.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion ex-mortis/windowmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# windowmanager.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion ex-mortis/windowstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# windowstate.py
# This file is part of Ex-Mortis, a plugin for gedit
#
# Copyright (C) 2017 Jeffery To <jeffery.to@gmail.com>
# Copyright (C) 2017-2018 Jeffery To <jeffery.to@gmail.com>
# https://github.com/jefferyto/gedit-ex-mortis
#
# This program is free software: you can redistribute it and/or modify
Expand Down

0 comments on commit 2e82827

Please sign in to comment.