Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Sat, 24 May 2014 13:05:14 UTC
Commit: b487d8dea3c2c3d448431ae91e06470b43d7d6bc
https://github.com/geany/geany/commit/b487d8dea3c2c3d448431ae91e06470b43d7d…
Log Message:
-----------
infobars: Do not show reload and resave messages more than once since only the
last one (respectively) is significant to the user.
Modified Paths:
--------------
src/document.c
src/documentprivate.h
Modified: src/document.c
52 lines changed, 36 insertions(+), 16 deletions(-)
===================================================================
@@ -3148,6 +3148,8 @@ static void on_monitor_reload_file_response(GtkWidget *bar, gint response_id, Ge
if (response_id == GTK_RESPONSE_ACCEPT)
document_reload_file(doc, doc->encoding);
+
+ doc->priv->info_bars[MSG_TYPE_RELOAD] = NULL;
}
@@ -3155,16 +3157,22 @@ static void monitor_reload_file(GeanyDocument *doc)
{
gchar *base_name = g_path_get_basename(doc->file_name);
- document_show_message(doc, GTK_MESSAGE_QUESTION, on_monitor_reload_file_response,
- _("_Reload"), GTK_RESPONSE_ACCEPT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL, GTK_RESPONSE_NONE,
- _("Do you want to reload it?"),
- _("The file '%s' on the disk is more recent than the current buffer."),
- base_name);
+ /* show this message only once */
+ if (doc->priv->info_bars[MSG_TYPE_RELOAD] == NULL)
+ {
+ GtkWidget *bar;
- protect_document(doc);
+ bar = document_show_message(doc, GTK_MESSAGE_QUESTION, on_monitor_reload_file_response,
+ _("_Reload"), GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL, GTK_RESPONSE_NONE,
+ _("Do you want to reload it?"),
+ _("The file '%s' on the disk is more recent than the current buffer."),
+ base_name);
+ protect_document(doc);
+ doc->priv->info_bars[MSG_TYPE_RELOAD] = bar;
+ }
g_free(base_name);
}
@@ -3186,20 +3194,31 @@ static void on_monitor_resave_missing_file_response(GtkWidget *bar,
/* don't prompt more than once */
SETPTR(doc->real_path, NULL);
}
+
+ doc->priv->info_bars[MSG_TYPE_RESAVE] = NULL;
}
static void monitor_resave_missing_file(GeanyDocument *doc)
{
- document_show_message(doc, GTK_MESSAGE_WARNING, on_monitor_resave_missing_file_response,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL, GTK_RESPONSE_NONE,
- _("Try to resave the file?"),
- _("File \"%s\" was not found on disk!"),
- doc->file_name);
+ GtkWidget *bar;
- protect_document(doc);
+ if (doc->priv->info_bars[MSG_TYPE_RESAVE] == NULL)
+ {
+ GtkWidget *bar;
+
+ bar = document_show_message(doc, GTK_MESSAGE_WARNING,
+ on_monitor_resave_missing_file_response,
+ GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL, GTK_RESPONSE_NONE,
+ _("Try to resave the file?"),
+ _("File \"%s\" was not found on disk!"),
+ doc->file_name);
+
+ protect_document(doc);
+ doc->priv->info_bars[MSG_TYPE_RESAVE] = bar;
+ }
}
@@ -3253,6 +3272,7 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
}
else if (doc->priv->mtime < st.st_mtime)
{
+ /* make sure the user is not prompted again after he cancelled the "reload file?" message */
doc->priv->mtime = st.st_mtime;
monitor_reload_file(doc);
/* doc may be closed now */
Modified: src/documentprivate.h
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -53,6 +53,13 @@ typedef struct FileEncoding
}
FileEncoding;
+enum
+{
+ MSG_TYPE_RELOAD,
+ MSG_TYPE_RESAVE,
+
+ NUM_MSG_TYPES
+};
/* Private GeanyDocument fields */
typedef struct GeanyDocumentPrivate
@@ -89,6 +96,8 @@ typedef struct GeanyDocumentPrivate
/* Whether it's temoporarily protected (read-only and saving is prevented). Does
* not imply doc->readonly as writable files can be protected */
gint protected;
+ /* Save pointer to info bars allowing to cancel them programatically (to avoid multiple ones) */
+ GtkWidget *info_bars[NUM_MSG_TYPES];
}
GeanyDocumentPrivate;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Sat, 24 May 2014 13:05:08 UTC
Commit: e469aa6acc76fb47194c322efef3d4f900f990a2
https://github.com/geany/geany/commit/e469aa6acc76fb47194c322efef3d4f900f99…
Log Message:
-----------
Use document_show_message() when a file is removed from disk
The close button is removed from the dialog also since the user can easily
choose to close the document normally.
Setting default response removed since it's not working yet.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
38 lines changed, 17 insertions(+), 21 deletions(-)
===================================================================
@@ -3126,37 +3126,33 @@ static void monitor_reload_file(GeanyDocument *doc)
}
-static gboolean monitor_resave_missing_file(GeanyDocument *doc)
+static void on_monitor_resave_missing_file_response(GtkWidget *bar,
+ gint response_id,
+ GeanyDocument *doc)
{
- gboolean want_reload = FALSE;
gboolean file_saved = FALSE;
- gint ret;
- ret = dialogs_show_prompt(NULL,
- _("Close _without saving"), GTK_RESPONSE_CLOSE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
- _("Try to resave the file?"),
- _("File \"%s\" was not found on disk!"),
- doc->file_name);
- if (ret == GTK_RESPONSE_ACCEPT)
- {
+ if (response_id == GTK_RESPONSE_ACCEPT)
file_saved = dialogs_show_save_as();
- want_reload = TRUE;
- }
- else if (ret == GTK_RESPONSE_CLOSE)
- {
- document_close(doc);
- }
- if (ret != GTK_RESPONSE_CLOSE && ! file_saved)
+
+ if (!file_saved)
{
- /* file is missing - set unsaved state */
document_set_text_changed(doc, TRUE);
/* don't prompt more than once */
SETPTR(doc->real_path, NULL);
}
+}
+
- return want_reload;
+static void monitor_resave_missing_file(GeanyDocument *doc)
+{
+ document_show_message(doc, GTK_MESSAGE_WARNING, on_monitor_resave_missing_file_response,
+ GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL, GTK_RESPONSE_NONE,
+ _("Try to resave the file?"),
+ _("File \"%s\" was not found on disk!"),
+ doc->file_name);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Sat, 24 May 2014 12:47:57 UTC
Commit: 667c35a004aeabfb254da3d91186b8f523869cf0
https://github.com/geany/geany/commit/667c35a004aeabfb254da3d91186b8f523869…
Log Message:
-----------
Use document_show_message() when a file is externally modified
Two other related changes are that document_set_text_changed() is used to
indicate that the buffer is different from what's on disk and also that
the 'Close' button has been removed from the dialog since the user can easily
just close the document themselves the normal way.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
26 lines changed, 14 insertions(+), 12 deletions(-)
===================================================================
@@ -2989,7 +2989,6 @@ gboolean document_close_all(void)
}
-
/* *
* Shows a message related to a document.
*
@@ -3102,25 +3101,28 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
return info_widget;
}
+static void on_monitor_reload_file_response(GtkWidget *bar, gint response_id, GeanyDocument *doc)
+{
+ if (response_id == GTK_RESPONSE_ACCEPT)
+ document_reload_file(doc, doc->encoding);
+}
+
+
static void monitor_reload_file(GeanyDocument *doc)
{
gchar *base_name = g_path_get_basename(doc->file_name);
- gint ret;
- /* we use No instead of Cancel to avoid mnemonic clash */
- ret = dialogs_show_prompt(NULL,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
- GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
+ document_show_message(doc, GTK_MESSAGE_QUESTION, on_monitor_reload_file_response,
_("_Reload"), GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL, GTK_RESPONSE_NONE,
_("Do you want to reload it?"),
- _("The file '%s' on the disk is more recent than\nthe current buffer."),
+ _("The file '%s' on the disk is more recent than the current buffer."),
base_name);
- g_free(base_name);
- if (ret == GTK_RESPONSE_ACCEPT)
- document_reload_file(doc, doc->encoding);
- else if (ret == GTK_RESPONSE_CLOSE)
- document_close(doc);
+ document_set_text_changed(doc, TRUE);
+
+ g_free(base_name);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Thu, 22 May 2014 01:34:09 UTC
Commit: 46affaf19eab08712174faac8638d4428c9e6516
https://github.com/geany/geany/commit/46affaf19eab08712174faac8638d4428c9e6…
Log Message:
-----------
Update Scintilla to 3.4.2 final release
No code changes.
Modified Paths:
--------------
scintilla/lexers/LexCPP.cxx
scintilla/lexers/LexFortran.cxx
scintilla/lexers/LexPerl.cxx
scintilla/lexers/LexRuby.cxx
scintilla/src/AutoComplete.h
scintilla/src/Editor.cxx
scintilla/src/RESearch.cxx
Modified: scintilla/lexers/LexCPP.cxx
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -723,13 +723,13 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
// Inside inactive preprocessor declaration, state will be reset anyway at the end of this block.
if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) {
// Prevent SCE_C_STRINGEOL from leaking back to previous line which
- // ends with a line continuation by locking in the state upto this position.
+ // ends with a line continuation by locking in the state up to this position.
sc.SetState(sc.state);
}
if ((MaskActive(sc.state) == SCE_C_PREPROCESSOR) && (!continuationLine)) {
sc.SetState(SCE_C_DEFAULT|activitySet);
}
- // Reset states to begining of colourise so no surprises
+ // Reset states to beginning of colourise so no surprises
// if different sets of lines lexed.
visibleChars = 0;
lastWordWasUUID = false;
Modified: scintilla/lexers/LexFortran.cxx
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
// Scintilla source code edit control
/** @file LexFortran.cxx
** Lexer for Fortran.
- ** Writen by Chuan-jian Shen, Last changed Sep. 2003
+ ** Written by Chuan-jian Shen, Last changed Sep. 2003
**/
// Copyright 1998-2001 by Neil Hodgson <neilh(a)scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
Modified: scintilla/lexers/LexPerl.cxx
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -662,7 +662,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
} else if (initStyle == SCE_PL_POD
|| initStyle == SCE_PL_POD_VERB
) {
- // POD backtracking finds preceeding blank lines and goes back past them
+ // POD backtracking finds preceding blank lines and goes back past them
int ln = styler.GetLine(startPos);
if (ln > 0) {
initStyle = styler.StyleAt(styler.LineStart(--ln));
@@ -1159,12 +1159,12 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
sc.ForwardSetState(SCE_PL_DEFAULT);
HereDoc.State = 3;
} else {
- // invalid indentifier; inexact fallback, but hey
+ // invalid identifier; inexact fallback, but hey
sc.ChangeState(SCE_PL_IDENTIFIER);
sc.SetState(SCE_PL_DEFAULT);
}
} else {
- sc.ChangeState(SCE_PL_DEFAULT); // invalid indentifier
+ sc.ChangeState(SCE_PL_DEFAULT); // invalid identifier
}
backFlag = BACK_NONE;
break;
Modified: scintilla/lexers/LexRuby.cxx
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -731,7 +731,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
// If anyone runs into this problem, I recommend raising this
// value slightly higher to replacing the fixed array with a linked
- // list. Keep in mind this code will be called everytime the lexer
+ // list. Keep in mind this code will be called every time the lexer
// is invoked.
#define INNER_STRINGS_MAX_COUNT 5
Modified: scintilla/src/AutoComplete.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -65,7 +65,7 @@ class AutoComplete {
void SetSeparator(char separator_);
char GetSeparator() const;
- /// The typesep character is used for seperating the word from the type
+ /// The typesep character is used for separating the word from the type
void SetTypesep(char separator_);
char GetTypesep() const;
Modified: scintilla/src/Editor.cxx
8 lines changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -1219,7 +1219,7 @@ so the caret can move in the same direction longer before the policy is applied
If even is not set, instead of having symmetrical UZs,
the left and bottom UZs are extended up to right and top UZs respectively.
-This way, we favour the displaying of useful information: the begining of lines,
+This way, we favour the displaying of useful information: the beginning of lines,
where most code reside, and the lines after the caret, eg. the body of a function.
| | | | |
@@ -3846,7 +3846,7 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
vsPrint.rightMarginWidth = 0;
vsPrint.Refresh(*surfaceMeasure, pdoc->tabInChars);
- // Determining width must hapen after fonts have been realised in Refresh
+ // Determining width must happen after fonts have been realised in Refresh
int lineNumberWidth = 0;
if (lineNumberIndex >= 0) {
lineNumberWidth = static_cast<int>(surfaceMeasure->WidthText(vsPrint.styles[STYLE_LINENUMBER].font,
@@ -6409,7 +6409,7 @@ void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifie
doubleClick = true;
} else if (selectionType == selWord) {
// Since we ended up here, we're inside a *triple* click, which should always select
- // whole line irregardless of word wrap being enabled or not.
+ // whole line regardless of word wrap being enabled or not.
selectionType = selWholeLine;
} else {
selectionType = selChar;
@@ -6837,7 +6837,7 @@ bool Editor::Idle() {
// Add more idle things to do here, but make sure idleDone is
// set correctly before the function returns. returning
- // false will stop calling this idle funtion until SetIdle() is
+ // false will stop calling this idle function until SetIdle() is
// called again.
idleDone = wrappingDone; // && thatDone && theOtherThingDone...
Modified: scintilla/src/RESearch.cxx
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -784,7 +784,7 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
c = *(ap+1);
while ((lp < endp) && (static_cast<unsigned char>(ci.CharAt(lp)) != c))
lp++;
- if (lp >= endp) /* if EOS, fail, else fall thru. */
+ if (lp >= endp) /* if EOS, fail, else fall through. */
return 0;
default: /* regular matching all the way. */
while (lp < endp) {
@@ -814,7 +814,7 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
*
* special case optimizations: (nfa[n], nfa[n+1])
* CLO ANY
- * We KNOW .* will match everything upto the
+ * We KNOW .* will match everything up to the
* end of line. Thus, directly go to the end of
* line, without recursive PMatch calls. As in
* the other closure cases, the remaining pattern
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).