Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Fri, 30 Oct 2015 14:30:14 UTC
Commit: 9b458b9fd5332570e9d94a21059180dbaa2d8fd4
https://github.com/geany/geany/commit/9b458b9fd5332570e9d94a21059180dbaa2d8…
Log Message:
-----------
document: Revert 6f5d5db and d6d4728
Now that there is a proper user indication for the "maintain history on
reload" feature we can toggle it on by default. The setting is also renamed
so that the default is effective for everyone (this was the plan).
Modified Paths:
--------------
doc/geany.txt
src/keyfile.c
Modified: doc/geany.txt
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2652,7 +2652,7 @@ use_gio_unsafe_file_saving Whether to use GIO as the unsafe file t
correctly on some complex setups.
gio_unsafe_save_backup Make a backup when using GIO unsafe file false immediately
saving. Backup is named `filename~`.
-keep_edit_history_on_reload_125 Whether to maintain the edit history when false immediately
+keep_edit_history_on_reload Whether to maintain the edit history when true immediately
reloading a file, and allow the operation
to be reverted.
**Filetype related**
Modified: src/keyfile.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -234,7 +234,7 @@ static void init_pref_groups(void)
stash_group_add_boolean(group, &file_prefs.use_gio_unsafe_file_saving,
"use_gio_unsafe_file_saving", TRUE);
stash_group_add_boolean(group, &file_prefs.keep_edit_history_on_reload,
- "keep_edit_history_on_reload_125", FALSE);
+ "keep_edit_history_on_reload", TRUE);
stash_group_add_boolean(group, &file_prefs.show_keep_edit_history_on_reload_msg,
"show_keep_edit_history_on_reload_msg", TRUE);
/* for backwards-compatibility */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Fri, 30 Oct 2015 14:23:44 UTC
Commit: b1e9c4f3b6655517f0ebf6eccabfc75cd7090f96
https://github.com/geany/geany/commit/b1e9c4f3b6655517f0ebf6eccabfc75cd7090…
Log Message:
-----------
document: show informational doc message after first reload
6f5d5db and d6d4728 disabled "maintain history on reload" by default,
with the intention to reenable it when we have a better method to
make it discoverable for the user. This was necessary since it became
enabled by default but could be surprising given Geany warned about
losing data before.
This commit tries to resolve the discoverability, by providing an
informational doc message that is shown once to the user, after the first
reload. The doc message also gives the option to disable this feature.
Modified Paths:
--------------
src/document.c
src/document.h
src/documentprivate.h
src/keyfile.c
Modified: src/document.c
34 lines changed, 34 insertions(+), 0 deletions(-)
===================================================================
@@ -1575,6 +1575,24 @@ void document_open_files(const GSList *filenames, gboolean readonly, GeanyFilety
}
+static void on_keep_edit_history_on_reload_response(GtkWidget *bar, gint response_id, GeanyDocument *doc)
+{
+ if (response_id == GTK_RESPONSE_NO)
+ {
+ file_prefs.keep_edit_history_on_reload = FALSE;
+ document_reload_force(doc, doc->encoding);
+ }
+ else if (response_id == GTK_RESPONSE_CANCEL)
+ {
+ /* this condition cannot be reached via info bar buttons, but by our code
+ * to replace this bar with a higher priority one */
+ file_prefs.show_keep_edit_history_on_reload_msg = TRUE;
+ }
+ doc->priv->info_bars[MSG_TYPE_POST_RELOAD] = NULL;
+ gtk_widget_destroy(bar);
+}
+
+
/**
* Reloads the document with the specified file encoding.
* @a forced_enc or @c NULL to auto-detect the file encoding.
@@ -1589,6 +1607,7 @@ gboolean document_reload_force(GeanyDocument *doc, const gchar *forced_enc)
{
gint pos = 0;
GeanyDocument *new_doc;
+ GtkWidget *bar;
g_return_val_if_fail(doc != NULL, FALSE);
@@ -1600,6 +1619,21 @@ gboolean document_reload_force(GeanyDocument *doc, const gchar *forced_enc)
pos = sci_get_current_position(doc->editor->sci);
new_doc = document_open_file_full(doc, NULL, pos, doc->readonly, doc->file_type, forced_enc);
+ if (file_prefs.keep_edit_history_on_reload && file_prefs.show_keep_edit_history_on_reload_msg)
+ {
+ bar = document_show_message(doc, GTK_MESSAGE_INFO,
+ on_keep_edit_history_on_reload_response,
+ GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ _("Discard history"), GTK_RESPONSE_NO,
+ NULL, 0, _("The buffer's previous state is stored in the history and "
+ "undoing restores it. You can disable this by discarding the history upon "
+ "reload. This message will not be displayed again but "
+ "Your choice can be changed in the various preferences."),
+ _("The file has been reloaded."));
+ doc->priv->info_bars[MSG_TYPE_POST_RELOAD] = bar;
+ file_prefs.show_keep_edit_history_on_reload_msg = FALSE;
+ }
+
return (new_doc != NULL);
}
Modified: src/document.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -65,6 +65,7 @@ typedef struct GeanyFilePrefs
gchar *extract_filetype_regex; /* regex to extract filetype on opening */
gboolean tab_close_switch_to_mru;
gboolean keep_edit_history_on_reload; /* Keep undo stack upon, and allow undoing of, document reloading. */
+ gboolean show_keep_edit_history_on_reload_msg; /* whether to show the message introducing the above feature */
}
GeanyFilePrefs;
Modified: src/documentprivate.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -65,6 +65,7 @@ enum
{
MSG_TYPE_RELOAD,
MSG_TYPE_RESAVE,
+ MSG_TYPE_POST_RELOAD,
NUM_MSG_TYPES
};
Modified: src/keyfile.c
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -235,6 +235,8 @@ static void init_pref_groups(void)
"use_gio_unsafe_file_saving", TRUE);
stash_group_add_boolean(group, &file_prefs.keep_edit_history_on_reload,
"keep_edit_history_on_reload_125", FALSE);
+ stash_group_add_boolean(group, &file_prefs.show_keep_edit_history_on_reload_msg,
+ "show_keep_edit_history_on_reload_msg", TRUE);
/* for backwards-compatibility */
stash_group_add_integer(group, &editor_prefs.indentation->hard_tab_width,
"indent_hard_tab_width", 8);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Wed, 28 Oct 2015 22:53:57 UTC
Commit: aab231c0c77d0612d9fe7752b26ba985e044bf80
https://github.com/geany/www.geany.org/commit/aab231c0c77d0612d9fe7752b26ba…
Log Message:
-----------
Add 'dump_database' management command
Modified Paths:
--------------
geany/management/commands/dump_database.py
Modified: geany/management/commands/dump_database.py
31 lines changed, 31 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# LICENCE: This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.core.management import BaseCommand, call_command
+
+
+########################################################################
+class Command(BaseCommand):
+ help = "Dump the database (excluding users, sessions and logs)"
+
+ #----------------------------------------------------------------------
+ def handle(self, *args, **options):
+ call_command(
+ 'dumpdata',
+ '--exclude', 'auth.user',
+ '--exclude', 'sessions.session',
+ '--exclude', 'admin.logentry',
+ '--exclude', 'pastebin.snippet',
+ '--indent', '2',
+ '--output', 'database.json')
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Wed, 28 Oct 2015 22:21:37 UTC
Commit: dcefe7dd1e9eadbf93f154b93bee598e53632139
https://github.com/geany/www.geany.org/commit/dcefe7dd1e9eadbf93f154b93bee5…
Log Message:
-----------
Silence warning of deprecated TEMPLATE_CONTEXT_PROCESSORS setting
While this setting is deprecated since Django 1.8, we still need to define it
for the current version of Mezzanine.
See https://github.com/stephenmcd/mezzanine/issues/1364.
Modified Paths:
--------------
geany/settings.py
Modified: geany/settings.py
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -273,6 +273,7 @@
},
},
]
+# compability for Mezzanine which still requires this setting
TEMPLATE_CONTEXT_PROCESSORS = TEMPLATES[0]['OPTIONS']['context_processors']
# List of finder classes that know how to find static files in
@@ -463,6 +464,14 @@
}
+###################
+# IGNORE WARNINGS #
+###################
+SILENCED_SYSTEM_CHECKS = (
+ '1_8.W001' # TEMPLATE_CONTEXT_PROCESSORS setting required for Mezzanine
+)
+
+
##################
# LOCAL SETTINGS #
##################
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sun, 25 Oct 2015 21:51:11 UTC
Commit: d3b2a97510fdceb8aeed486d571cc2e3feadc614
https://github.com/geany/www.geany.org/commit/d3b2a97510fdceb8aeed486d571cc…
Log Message:
-----------
Migrate Pygments CSS update script into a management command
Same behavior but now cleanly integrated into Django as management command:
python manage.py generate_snippets_css
Modified Paths:
--------------
pastebin/management/commands/generate_snippets_css.py
pastebin/static/css/pygments.css
Modified: pastebin/management/commands/generate_snippets_css.py
21 lines changed, 12 insertions(+), 9 deletions(-)
===================================================================
@@ -1,25 +1,28 @@
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
-#
# LICENCE: This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
-#
+#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from django.core.management.base import BaseCommand
from pygments.formatters import HtmlFormatter
-f = open('pastebin/static/css/pygments.css', 'w')
-
-# You can change style and the html class here:
-f.write(HtmlFormatter(style='colorful').get_style_defs('.code'))
+########################################################################
+class Command(BaseCommand):
+ help = "Regenerate CSS for snippet sxntax highlighting py Pygments"
+ requires_system_checks = False
-f.close()
+ #----------------------------------------------------------------------
+ def handle(self, *args, **options):
+ with open('pastebin/static/css/pygments.css', 'w') as css_file:
+ # You can change style and the html class here:
+ css_file.write(HtmlFormatter(style='colorful').get_style_defs('.code'))
Modified: pastebin/static/css/pygments.css
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -40,6 +40,7 @@
.code .nv { color: #996633 } /* Name.Variable */
.code .ow { color: #000000; font-weight: bold } /* Operator.Word */
.code .w { color: #bbbbbb } /* Text.Whitespace */
+.code .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
.code .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
.code .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
.code .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).