-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
184 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Reopen closed windows and optionally restore windows between sessions | ||
<https://github.com/jefferyto/gedit-ex-mortis> | ||
0.1.2 | ||
0.2.0 | ||
|
||
All bug reports, feature requests and miscellaneous comments are welcome | ||
at the [project issue tracker][]. | ||
|
@@ -52,7 +52,10 @@ i.e. only unsaved or blank documents, will not be reopenable. | |
open in the previous session will be reopened when gedit is started | ||
again. (Default: Disabled) | ||
|
||
## Development | ||
## Contributing | ||
|
||
Please base changes on, and open pull requests against, the `develop` | ||
branch. | ||
|
||
The code in `ex-mortis/utils` comes from [python-gtk-utils][]; changes | ||
should ideally be contributed to that project, then pulled back into | ||
|
@@ -66,7 +69,7 @@ Inspired by: | |
|
||
## License | ||
|
||
Copyright © 2017-2018 Jeffery To <[email protected]> | ||
Copyright © 2017-2019 Jeffery To <[email protected]> | ||
|
||
Available under GNU General Public License version 3 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,9 @@ Module=ex-mortis | |
IAge=3 | ||
Name=Ex-Mortis | ||
Description=Reopen closed windows and optionally restore windows between sessions | ||
Description[ru]=Переоткрывает закрытые окна и восстанавливает окна между сессиями | ||
Icon=window-new | ||
Authors=Jeffery To <[email protected]> | ||
Copyright=Copyright © 2017-2018 Jeffery To | ||
Copyright=Copyright © 2017-2019 Jeffery To | ||
Website=https://github.com/jefferyto/gedit-ex-mortis | ||
Version=0.1.2 | ||
Version=0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# __init__.py | ||
# This file is part of Ex-Mortis, a plugin for gedit | ||
# | ||
# Copyright (C) 2017-2018 Jeffery To <[email protected]> | ||
# Copyright (C) 2017-2019 Jeffery To <[email protected]> | ||
# https://github.com/jefferyto/gedit-ex-mortis | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
@@ -61,8 +61,9 @@ def do_activate(self): | |
Gedit.debug_plugin_message(log.format("")) | ||
|
||
app = self.app | ||
is_primary = not (app.get_flags() & Gio.ApplicationFlags.NON_UNIQUE) | ||
window_manager = ExMortisWindowManager() | ||
settings = ExMortisSettings() | ||
settings = ExMortisSettings(is_primary) | ||
|
||
# app | ||
connect_handlers( | ||
|
@@ -102,6 +103,8 @@ def do_activate(self): | |
'app.reopen-closed-window', ['<Primary><Shift>N'] | ||
) | ||
menu_ext = self.extend_menu('app-commands-section') | ||
if not menu_ext: | ||
menu_ext = self.extend_menu('file-section') | ||
menu_item = Gio.MenuItem.new( | ||
_("Reopen Closed _Window"), 'app.reopen-closed-window' | ||
) | ||
|
@@ -133,7 +136,7 @@ def do_activate(self): | |
# windows | ||
windows = app.get_main_windows() | ||
|
||
self.restore_windows( | ||
self.handle_restore_data( | ||
window_manager, settings, | ||
settings.restore_between_sessions and not windows | ||
) | ||
|
@@ -220,7 +223,7 @@ def setup_window(self, window, is_existing=False): | |
|
||
window_manager.track_window(window) | ||
|
||
self.setup_restore_window(window) | ||
self.setup_restore_window(window_manager, window) | ||
|
||
if self.is_saving_window_states(): | ||
self.bind_window_settings(window_manager, settings, window) | ||
|
@@ -438,13 +441,18 @@ def do_create_configure_widget(self): | |
if log.query(log.INFO): | ||
Gedit.debug_plugin_message(log.format("")) | ||
|
||
app = Gedit.App.get_default() | ||
is_primary = not (app.get_flags() & Gio.ApplicationFlags.NON_UNIQUE) | ||
settings = ExMortisSettings() | ||
|
||
if settings.can_save: | ||
widget = Gtk.CheckButton.new_with_label( | ||
_("Restore windows between sessions") | ||
) | ||
|
||
if not is_primary: | ||
widget.set_sensitive(False) | ||
|
||
create_bindings( | ||
self, settings, widget, | ||
{'restore_between_sessions': 'active'}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# closingmixin.py | ||
# This file is part of Ex-Mortis, a plugin for gedit | ||
# | ||
# Copyright (C) 2017-2018 Jeffery To <[email protected]> | ||
# Copyright (C) 2017-2019 Jeffery To <[email protected]> | ||
# https://github.com/jefferyto/gedit-ex-mortis | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# existingmixin.py | ||
# This file is part of Ex-Mortis, a plugin for gedit | ||
# | ||
# Copyright (C) 2017-2018 Jeffery To <[email protected]> | ||
# Copyright (C) 2017-2019 Jeffery To <[email protected]> | ||
# https://github.com/jefferyto/gedit-ex-mortis | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: gedit-ex-mortis 0.1.2\n" | ||
"POT-Creation-Date: 2018-03-13 21:31+0800\n" | ||
"Project-Id-Version: gedit-ex-mortis 0.2.0\n" | ||
"POT-Creation-Date: 2019-03-22 04:12+0800\n" | ||
"PO-Revision-Date: 2017-10-13 22:50+0800\n" | ||
"Last-Translator: Jeffery To <[email protected]>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 2.0.4\n" | ||
"X-Generator: Poedit 2.1.1\n" | ||
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n" | ||
"X-Poedit-Basepath: ..\n" | ||
"X-Poedit-SearchPath-0: .\n" | ||
"X-Poedit-SearchPathExcluded-0: schemas\n" | ||
"X-Poedit-SearchPathExcluded-1: utils\n" | ||
|
||
#: __init__.py:106 | ||
#: __init__.py:109 | ||
msgid "Reopen Closed _Window" | ||
msgstr "" | ||
|
||
#: __init__.py:445 existingmixin.py:87 | ||
#: __init__.py:450 existingmixin.py:87 | ||
msgid "Restore windows between sessions" | ||
msgstr "" | ||
|
||
#: __init__.py:458 | ||
#: __init__.py:466 | ||
msgid "Could not load settings schema" | ||
msgstr "" | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: gedit-ex-mortis 0.2.0\n" | ||
"POT-Creation-Date: 2019-03-22 04:12+0800\n" | ||
"PO-Revision-Date: 2019-03-22 04:15+0800\n" | ||
"Last-Translator: Habetdin\n" | ||
"Language-Team: Russian\n" | ||
"Language: ru\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 2.1.1\n" | ||
|
||
#: __init__.py:109 | ||
msgid "Reopen Closed _Window" | ||
msgstr "Пе_реоткрыть закрытое окно" | ||
|
||
#: __init__.py:450 existingmixin.py:87 | ||
msgid "Restore windows between sessions" | ||
msgstr "Восстанавливать окна между сессиями" | ||
|
||
#: __init__.py:466 | ||
msgid "Could not load settings schema" | ||
msgstr "Ошибка при загрузке схемы настроек" | ||
|
||
#: existingmixin.py:67 | ||
msgid "_Quit" | ||
msgstr "З_авершить" | ||
|
||
#: existingmixin.py:68 | ||
msgid "_Ignore" | ||
msgstr "И_гнорировать" | ||
|
||
#: existingmixin.py:77 | ||
msgid "" | ||
"This window cannot be reopened if closed. Restart gedit to fully enable Ex-" | ||
"Mortis." | ||
msgstr "" | ||
"Это окно не может быть восстановлено после закрытия. Перезапустите gedit для " | ||
"полноценной активации Ex-Mortis." | ||
|
||
#: existingmixin.py:88 | ||
msgid "Application menu" | ||
msgstr "меню приложения" | ||
|
||
#: existingmixin.py:88 | ||
msgid "File menu" | ||
msgstr "меню Файл" | ||
|
||
#: existingmixin.py:89 | ||
#, python-brace-format | ||
msgid "" | ||
"To restore this window, enable \"{pref_name}\" in Ex-Mortis' preferences, " | ||
"and quit gedit by selecting Quit in the {menu_name} or in this message." | ||
msgstr "" | ||
"Для восстановления данного окна включите в настройках Ex-Mortis " | ||
"\"{pref_name}\" и выйдите из gedit, выбрав Завершить в {menu_name} или в " | ||
"этом сообщении." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# log.py | ||
# This file is part of Ex-Mortis, a plugin for gedit | ||
# | ||
# Copyright (C) 2017-2018 Jeffery To <[email protected]> | ||
# Copyright (C) 2017-2019 Jeffery To <[email protected]> | ||
# https://github.com/jefferyto/gedit-ex-mortis | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
@@ -53,7 +53,7 @@ | |
if name in NAMES_TO_LEVELS: | ||
output_level = NAMES_TO_LEVELS[name] | ||
|
||
# set by query(), used by prefix() | ||
# set by query(), used by name() | ||
last_queried_level = None | ||
|
||
|
||
|
Oops, something went wrong.