From 0812020209440476d68fbbbab809266750228360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 28 May 2013 20:48:43 +0000 Subject: [PATCH] [CONFIGURATION] * NEW: Update VERSION file. [DEVELOPMENT ENVIRONMENT] * BUG: If the desktop password wallet is not available, do not crash anymore, but display an error message instead. [INTERPRETER] * BUG: Some fixes in Application_Error method management. [GB.EVAL.HIGHLIGHT] * BUG: Some fixes in HTML highlighting. [GB.QT.4.EXT] * NEW: Editor: jumping to the next procedure from the current one now goes to the end of the file. git-svn-id: svn://localhost/gambas/trunk@5684 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- VERSION | 2 +- app/src/gambas3/.lang/.pot | 29 ++++++++++++------- app/src/gambas3/.project | 2 +- .../.src/Connection/MConnection.module | 25 ++++++++++++++-- app/src/gambas3/.src/Editor/CUndo.class | 2 +- comp/src/gb.eval.highlight/.settings | 19 ++---------- .../.src/HighlightHTML.module | 5 ++-- .../.src/HighlightJavascript.module | 4 ++- gb.db.odbc/src/main.c | 8 ++--- gb.desktop/src/gb.desktop/.project | 4 +-- .../gb.desktop/.src/_Desktop_Passwords.class | 2 +- gb.qt4/src/ext/gview.cpp | 27 ++++++++++++----- main/gbx/gb_error.c | 16 ++++++---- 13 files changed, 92 insertions(+), 53 deletions(-) diff --git a/VERSION b/VERSION index fbcbf7380..dbb20528d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.0 \ No newline at end of file +3.4.90 \ No newline at end of file diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 67ddb63f8..fba8e2755 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -987,35 +987,36 @@ msgstr "" msgid "unlimited" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:93 MErrorMessage.module:47 +#: FConnectionEditor.class:571 MConnection.module:114 MErrorMessage.module:47 msgid "Boolean" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:85 +#: FConnectionEditor.class:571 MConnection.module:106 msgid "Integer" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:87 +#: FConnectionEditor.class:571 MConnection.module:108 msgid "Long" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:97 +#: FConnectionEditor.class:571 MConnection.module:118 msgid "Serial" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:89 +#: FConnectionEditor.class:571 MConnection.module:110 msgid "Float" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:95 MErrorMessage.module:155 +#: FConnectionEditor.class:571 MConnection.module:116 MErrorMessage.module:155 msgid "String" msgstr "" -#: FConnectionEditor.class:571 FProjectVersion.class:280 MConnection.module:91 +#: FConnectionEditor.class:571 FProjectVersion.class:280 +#: MConnection.module:112 msgid "Date" msgstr "" -#: FConnectionEditor.class:571 MConnection.module:99 +#: FConnectionEditor.class:571 MConnection.module:120 msgid "Blob" msgstr "" @@ -3298,7 +3299,7 @@ msgstr "" msgid "Please enter the name of the new table." msgstr "" -#: FNewTable.class:59 MConnection.module:269 +#: FNewTable.class:59 MConnection.module:290 msgid "Table '&1' already exists." msgstr "" @@ -4887,7 +4888,15 @@ msgstr "" msgid "Unknown" msgstr "" -#: MConnection.module:282 +#: MConnection.module:47 +msgid "Unable to retrieve password." +msgstr "" + +#: MConnection.module:62 +msgid "Unable to save password." +msgstr "" + +#: MConnection.module:303 msgid "Cannot create table '&1'." msgstr "" diff --git a/app/src/gambas3/.project b/app/src/gambas3/.project index 6f2edbff2..ec7deffd7 100644 --- a/app/src/gambas3/.project +++ b/app/src/gambas3/.project @@ -3,7 +3,7 @@ Title=Gambas 3 Startup=Project Icon=img/logo/logo-ide.png -Version=3.4.0 +Version=3.4.90 VersionFile=1 Component=gb.image Component=gb.qt4 diff --git a/app/src/gambas3/.src/Connection/MConnection.module b/app/src/gambas3/.src/Connection/MConnection.module index b49e2f3ba..17c12196c 100644 --- a/app/src/gambas3/.src/Connection/MConnection.module +++ b/app/src/gambas3/.src/Connection/MConnection.module @@ -2,6 +2,8 @@ Public Password As New Collection +Private $bError As Boolean + Public Sub InitFrom(hConn As Connection, hConfig As Object, sName As String, Optional bWithDatabase As Boolean) hConn.Type = LCase(hConfig["Connection/Type"]) @@ -20,6 +22,19 @@ Public Sub InitFrom(hConn As Connection, hConfig As Object, sName As String, Opt End +Private Sub ErrorMessage(sMsg As String, sError As String) + + If sError Then + If Not $bError Then + $bError = True + Message.Error(sMsg & "\n\n" & sError) + Endif + Else + $bError = False + Endif + +End + Public Sub LoadPassword(sName As String, bDesktop As Boolean) As String Dim sPassword As String @@ -27,7 +42,9 @@ Public Sub LoadPassword(sName As String, bDesktop As Boolean) As String sPassword = Password[sName] If Not sPassword Then If bDesktop Then - sPassword = Desktop.Passwords[Project.Name &/ "Connection" &/ sName] + Error.Clear + Try sPassword = Desktop.Passwords[Project.Name &/ "Connection" &/ sName] + ErrorMessage(("Unable to retrieve password."), Error.Text) Password[sName] = sPassword Endif Endif @@ -39,7 +56,11 @@ End Public Sub SavePassword(sName As String, sPassword As String, (bDesktop) As Boolean) Password[sName] = sPassword - If sPassword Then Desktop.Passwords[Project.Name &/ "Connection" &/ sName] = sPassword + If sPassword Then + Error.Clear + Try Desktop.Passwords[Project.Name &/ "Connection" &/ sName] = sPassword + ErrorMessage(("Unable to save password."), Error.Text) + Endif End diff --git a/app/src/gambas3/.src/Editor/CUndo.class b/app/src/gambas3/.src/Editor/CUndo.class index b08f5b40c..471969a56 100644 --- a/app/src/gambas3/.src/Editor/CUndo.class +++ b/app/src/gambas3/.src/Editor/CUndo.class @@ -5,7 +5,7 @@ Public Struct UndoCommand Arg As Variant[] End Struct -Private Const DEBUG_ME As Boolean = True +Private Const DEBUG_ME As Boolean = False Private Enum CONTEXT_NONE, CONTEXT_UNDO, CONTEXT_REDO diff --git a/comp/src/gb.eval.highlight/.settings b/comp/src/gb.eval.highlight/.settings index 47b3a32b4..87d5cdd19 100644 --- a/comp/src/gb.eval.highlight/.settings +++ b/comp/src/gb.eval.highlight/.settings @@ -19,22 +19,9 @@ SearchString=True [OpenFile] Active=1 -File[1]=".src/HighlightHTML.module:239.0" -File[2]=".src/HighlightSQL.module:63.0" -File[3]=".src/Main.module:56.2" -File[4]=".src/Highlight.class:6.18" -File[5]=".src/HighlightDiff.module:0.0" -File[6]=".src/HighlightCSS.module:208.18" -File[7]="css/properties:176.0" -File[8]=".src/Helper.module:0.0" -File[9]="sql/datatypes:0.0" -File[10]="sql/functions:0.0" -File[11]="sql/keywords:0.0" -File[12]="sql/operators:0.0" -File[13]=".src/HighlightJavascript.module:29.4" -File[14]=".src/HighlightC.module:0.0" -File[15]=".src/HighlightCPlusPlus.module:0.0" -Count=15 +File[1]=".src/HighlightHTML.module:336.4" +File[2]=".src/HighlightJavascript.module:29.4" +Count=2 [Watches] Count=0 diff --git a/comp/src/gb.eval.highlight/.src/HighlightHTML.module b/comp/src/gb.eval.highlight/.src/HighlightHTML.module index 5f13ad943..91fc17454 100644 --- a/comp/src/gb.eval.highlight/.src/HighlightHTML.module +++ b/comp/src/gb.eval.highlight/.src/HighlightHTML.module @@ -463,15 +463,16 @@ READ_CODE: Highlight.AlternateState = False iTagCode = 0 Inc I + PopHighlightState + iNextState = Highlight.State Else $sBufferAfter &= AnalyzeCode(String.Mid$(sText, iStart)) iTagCode = TAG_CODE iTagMode = Highlight.Tag iNextState = Highlight.State + PopHighlightState Endif - PopHighlightState - Return READ_CODE_COMMENT: diff --git a/comp/src/gb.eval.highlight/.src/HighlightJavascript.module b/comp/src/gb.eval.highlight/.src/HighlightJavascript.module index 977e37f3a..6ae597009 100644 --- a/comp/src/gb.eval.highlight/.src/HighlightJavascript.module +++ b/comp/src/gb.eval.highlight/.src/HighlightJavascript.module @@ -54,7 +54,9 @@ Public Sub Run() If HighlightHTML.AllowCode And If sCar = "<" And String.Mid$(sText, iPos, 2) = "<%" Then HighlightHTML.MeetCodeAt = iPos - Break + Highlight.State = iState + Highlight.Tag = iTag + Return Endif If iState = Highlight.Normal Then diff --git a/gb.db.odbc/src/main.c b/gb.db.odbc/src/main.c index 9c50616c7..f9a882b7a 100644 --- a/gb.db.odbc/src/main.c +++ b/gb.db.odbc/src/main.c @@ -776,16 +776,16 @@ fflush(stderr); if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) { - GB.Error("ODBC - Error - cannor allocate the handle"); + GB.Error("Cannot allocate statement handle"); return retcode; } - retcode =SQLSetStmtAttr(odbcres->odbcStatHandle, SQL_ATTR_CURSOR_SCROLLABLE, (SQLPOINTER) SQL_SCROLLABLE, 0); + retcode = SQLSetStmtAttr(odbcres->odbcStatHandle, SQL_ATTR_CURSOR_SCROLLABLE, (SQLPOINTER) SQL_SCROLLABLE, 0); if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) { - odbcres->Cursor_Scrollable=SQL_FALSE; + odbcres->Cursor_Scrollable = SQL_FALSE; } else odbcres->Cursor_Scrollable=SQL_TRUE; @@ -799,7 +799,7 @@ fflush(stderr); if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) { SQLFreeHandle(SQL_HANDLE_STMT, odbcres->odbcStatHandle); - GB.Error("Error executing the statement"); + GB.Error("Error while executing the statement"); return retcode; } diff --git a/gb.desktop/src/gb.desktop/.project b/gb.desktop/src/gb.desktop/.project index f86bec500..ac00548cd 100644 --- a/gb.desktop/src/gb.desktop/.project +++ b/gb.desktop/src/gb.desktop/.project @@ -1,8 +1,8 @@ # Gambas Project File 3.0 -# Compiled with Gambas 3.4.0 +# Compiled with Gambas 3.4.90 Title=Desktop-neutral routines from Portland project Startup=Main -Version=3.4.0 +Version=3.4.90 VersionFile=1 Component=gb.image Component=gb.gui diff --git a/gb.desktop/src/gb.desktop/.src/_Desktop_Passwords.class b/gb.desktop/src/gb.desktop/.src/_Desktop_Passwords.class index 4d6642fda..64571c8e4 100644 --- a/gb.desktop/src/gb.desktop/.src/_Desktop_Passwords.class +++ b/gb.desktop/src/gb.desktop/.src/_Desktop_Passwords.class @@ -15,7 +15,7 @@ Private Sub OpenWallet() If $bOpen Then Return - Select Case Desktop.Type + Select Case Desktop.Type Case "KDE" diff --git a/gb.qt4/src/ext/gview.cpp b/gb.qt4/src/ext/gview.cpp index dc1162f34..de96d41c6 100644 --- a/gb.qt4/src/ext/gview.cpp +++ b/gb.qt4/src/ext/gview.cpp @@ -1681,7 +1681,11 @@ void GEditor::cursorUp(bool shift, bool ctrl, bool alt) } } else if (ctrl) - cursorGoto(doc->getPreviousLimit(y), xx, shift); + { + int yl = doc->getPreviousLimit(y); + if (yl >= 0) + cursorGoto(yl, xx, shift); + } else cursorGoto(viewToReal(realToView(y) - 1), xx, shift); } @@ -1733,7 +1737,14 @@ void GEditor::cursorDown(bool shift, bool ctrl, bool alt) else if (!ctrl) cursorGoto(QMIN(numLines() - 1, viewToReal(realToView(y) + 1)), xx, shift); else - cursorGoto(doc->getNextLimit(y), xx, shift); + { + int yl = doc->getNextLimit(y); + + if (yl >= 0) + cursorGoto(yl, xx, shift); + else + cursorGoto(numLines(), 0, shift); + } } void GEditor::movePreviousSameIndent(bool shift) @@ -2714,15 +2725,17 @@ QVariant GEditor::inputMethodQuery(Qt::InputMethodQuery property) const return QRect(px, py, 1, _cellh); } case Qt::ImFont: - return font(); + return font(); case Qt::ImCursorPosition: - return QVariant(x); + return QVariant(x); case Qt::ImSurroundingText: - return QVariant(doc->getLine(y).getString()); + return QVariant(doc->getLine(y).getString()); case Qt::ImCurrentSelection: - return QVariant(doc->getSelectedText(_insertMode).getString()); + return QVariant(QString()); + case Qt::ImAnchorPosition: + return QVariant(x); default: - return QVariant(); + return QVariant(); } } diff --git a/main/gbx/gb_error.c b/main/gbx/gb_error.c index 4027c2154..c20faa5ca 100644 --- a/main/gbx/gb_error.c +++ b/main/gbx/gb_error.c @@ -617,20 +617,27 @@ void ERROR_print(void) DEBUG_print_backtrace(ERROR_backtrace); } -void ERROR_save(ERROR_INFO *save, ERROR_INFO *last) +static void ERROR_copy(ERROR_INFO *save, ERROR_INFO *last) { ERROR_reset(save); *save = ERROR_current->info; - CLEAR(&ERROR_current->info); if (last) { ERROR_reset(last); *last = ERROR_last; - CLEAR(&ERROR_last); } } +void ERROR_save(ERROR_INFO *save, ERROR_INFO *last) +{ + ERROR_copy(save, last); + + CLEAR(&ERROR_current->info); + if (last) + CLEAR(&ERROR_last); +} + void ERROR_restore(ERROR_INFO *save, ERROR_INFO *last) { ERROR_reset(&ERROR_current->info); @@ -709,11 +716,10 @@ void ERROR_hook(void) if (handle_error) { no_rec = TRUE; - ERROR_save(&save, &last); + ERROR_copy(&save, &last); TRY { - ERROR_restore(&save, &last); EXEC_public_desc(PROJECT_class, NULL, handle_error, 0); } CATCH