[neon/backports-focal/libgwenhywfar/Neon/release] /: New upstream version 5.9.0
Micha Lenk
null at kde.org
Mon Feb 21 16:25:55 GMT 2022
Git commit c9841ae096eee7d65daa7159347cc94f3c495d1c by Micha Lenk.
Committed on 16/02/2022 at 20:17.
Pushed by jriddell into branch 'Neon/release'.
New upstream version 5.9.0
M +27 -21 ChangeLog
M +6 -6 configure
M +6 -6 configure.ac
M +6 -7 gui/fox16/fox16_gui_dialog.cpp
M +1 -1 gwenhywfar.spec
M +164 -0 src/gui/dialog.c
M +66 -0 src/gui/dialog.h
M +4 -4 src/ressource.rc
M +4 -4 src/version.h
M +13 -0 tools/gwenbuild/parser/parser.c
https://invent.kde.org/neon/backports-focal/libgwenhywfar/commit/c9841ae096eee7d65daa7159347cc94f3c495d1c
diff --git a/ChangeLog b/ChangeLog
index 5e83036..a64483c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+------------------------------------------------------------------
+2022-02-03 21:23:35 +0100 Martin Preuss
+Fox16 dialog: Improved handling of setIntProperty() in lists.
+
+------------------------------------------------------------------
+2022-02-03 21:23:00 +0100 Martin Preuss
+GWEN_Dialog: Fixed a bug.
+
+------------------------------------------------------------------
+2022-02-03 00:05:42 +0100 Martin Preuss
+Incremented version. Change setup of GWENHYWFAR_VERSION_RELEASE_STRING.
+Remove the ".r" part from the version string in case of GIT versions.
+Makes it easier to specify minimum versions for modules looked up by
+pkg-config.
+
+------------------------------------------------------------------
+2022-02-03 00:04:10 +0100 Martin Preuss
+dialog: Added convenience functions concerning lists often used in dialogs.
+- GWEN_Dialog_ListWriteColumnSettings()
+- GWEN_Dialog_ListReadColumnSettings()
+- GWEN_Dialog_ListGetFirstColumnData()
+- GWEN_Dialog_ListGetItemMatchingFirstColumn()
+
+------------------------------------------------------------------
+2022-01-13 22:35:49 +0100 Martin Preuss
+Merge branch 'rel-5.8.2'
+
------------------------------------------------------------------
2022-01-13 22:14:01 +0100 Martin Preuss
Prepared release 5.8.2
@@ -485,24 +512,3 @@ searched and added.
------------------------------------------------------------------
2021-06-25 02:15:51 +0200 Martin Preuss
gwenbuild: Add help entry "-d".
-
-------------------------------------------------------------------
-2021-06-25 02:15:28 +0200 Martin Preuss
-gwbuild: keep permissions when writing file via <writeFile>.
-
-------------------------------------------------------------------
-2021-05-16 23:24:13 +0200 Christian Stimming
-minor windows fix (but more windows issues still remain)
-
-------------------------------------------------------------------
-2021-05-16 23:21:18 +0200 Christian Stimming
-Add include flags for out-of-source build
-
-------------------------------------------------------------------
-2021-05-16 23:13:24 +0200 Christian Stimming
-Windows: Fix erroneous assignment statement
-At least the compiler shows it as warning, from c7e26c35
-
-------------------------------------------------------------------
-2021-05-06 21:36:25 +0200 Martin Preuss
-Added some ideas to TODO.
diff --git a/configure b/configure
index 557478e..fcf8150 100755
--- a/configure
+++ b/configure
@@ -2939,8 +2939,8 @@ ac_config_headers="$ac_config_headers config.h"
# versions
#
GWENHYWFAR_VERSION_MAJOR=5
-GWENHYWFAR_VERSION_MINOR=8
-GWENHYWFAR_VERSION_PATCHLEVEL=2
+GWENHYWFAR_VERSION_MINOR=9
+GWENHYWFAR_VERSION_PATCHLEVEL=0
GWENHYWFAR_VERSION_BUILD=0
GWENHYWFAR_VERSION_TAG="stable"
@@ -2950,9 +2950,9 @@ GWENHYWFAR_VERSION_TAG="stable"
#
# SO version for Gwenhywfar
#
-GWENHYWFAR_SO_CURRENT="87"
-GWENHYWFAR_SO_AGE="8"
-GWENHYWFAR_SO_REVISION="2"
+GWENHYWFAR_SO_CURRENT="88"
+GWENHYWFAR_SO_AGE="9"
+GWENHYWFAR_SO_REVISION="0"
GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
@@ -2984,7 +2984,7 @@ OHBCI_VERSION_STRING="0.1.0"
#
case "$GWENHYWFAR_VERSION_TAG" in
cvs|svn|git)
- GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.r${GWENHYWFAR_VERSION_BUILD}"
+ GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.${GWENHYWFAR_VERSION_BUILD}"
;;
stable)
GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
diff --git a/configure.ac b/configure.ac
index c081f29..290fbfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,8 +28,8 @@ AC_CONFIG_HEADERS([config.h])
# versions
#
GWENHYWFAR_VERSION_MAJOR=5
-GWENHYWFAR_VERSION_MINOR=8
-GWENHYWFAR_VERSION_PATCHLEVEL=2
+GWENHYWFAR_VERSION_MINOR=9
+GWENHYWFAR_VERSION_PATCHLEVEL=0
GWENHYWFAR_VERSION_BUILD=0
dnl "stable", "rcX", "betaX", "cvs"
GWENHYWFAR_VERSION_TAG="stable"
@@ -40,9 +40,9 @@ GWENHYWFAR_VERSION_TAG="stable"
#
# SO version for Gwenhywfar
#
-GWENHYWFAR_SO_CURRENT="87"
-GWENHYWFAR_SO_AGE="8"
-GWENHYWFAR_SO_REVISION="2"
+GWENHYWFAR_SO_CURRENT="88"
+GWENHYWFAR_SO_AGE="9"
+GWENHYWFAR_SO_REVISION="0"
GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
@@ -74,7 +74,7 @@ OHBCI_VERSION_STRING="0.1.0"
#
case "$GWENHYWFAR_VERSION_TAG" in
cvs|svn|git)
- GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.r${GWENHYWFAR_VERSION_BUILD}"
+ GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL.${GWENHYWFAR_VERSION_BUILD}"
;;
stable)
GWENHYWFAR_VERSION_RELEASE_STRING="$GWENHYWFAR_VERSION_MAJOR.$GWENHYWFAR_VERSION_MINOR.$GWENHYWFAR_VERSION_PATCHLEVEL"
diff --git a/gui/fox16/fox16_gui_dialog.cpp b/gui/fox16/fox16_gui_dialog.cpp
index 6f02544..e12fbd8 100644
--- a/gui/fox16/fox16_gui_dialog.cpp
+++ b/gui/fox16/fox16_gui_dialog.cpp
@@ -295,20 +295,19 @@ int FOX16_GuiDialog::setIntProperty(GWEN_WIDGET *w,
case GWEN_Widget_TypeListBox: {
FOX16_GuiSortingList *f;
FXFoldingItem *fi;
- int i=0;
f=(FOX16_GuiSortingList*)GWEN_Widget_GetImplData(w, FOX16_DIALOG_WIDGET_REAL);
assert(f);
switch(prop) {
case GWEN_DialogProperty_Value:
- fi=f->getFirstItem();
- while(fi && i<value) {
- fi=fi->getNext();
- i++;
+ fi=f->getItem(value);
+ if (fi) {
+ f->killSelection();
+ f->setCurrentItem(fi, doSignal?TRUE:FALSE);
+ f->selectItem(fi);
+ f->makeItemVisible(fi);
}
- if (fi && i==value)
- f->setCurrentItem(fi, doSignal?TRUE:FALSE);
else {
DBG_ERROR(GWEN_LOGDOMAIN, "Value %d out of range", value);
return GWEN_ERROR_INVALID;
diff --git a/gwenhywfar.spec b/gwenhywfar.spec
index dd84305..88802aa 100644
--- a/gwenhywfar.spec
+++ b/gwenhywfar.spec
@@ -3,7 +3,7 @@
%define name gwenhywfar
-%define version 5.8.2
+%define version 5.9.0
%define rpm_cxxflags \"-O2 -march=i486 -mcpu=i586\"
%define rpm_cflags \"-O2 -march=i486 -mcpu=i586\"
diff --git a/src/gui/dialog.c b/src/gui/dialog.c
index 483f38c..e15b6b8 100644
--- a/src/gui/dialog.c
+++ b/src/gui/dialog.c
@@ -41,6 +41,7 @@
#include <assert.h>
#include <ctype.h>
+#include <strings.h>
GWEN_INHERIT_FUNCTIONS(GWEN_DIALOG)
@@ -1009,3 +1010,166 @@ GWEN_DB_NODE *GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg)
+
+void GWEN_Dialog_ListWriteColumnSettings(GWEN_DIALOG *dlg,
+ const char *widgetName,
+ const char *variablePrefix,
+ int maxColumns,
+ int minColumnSize,
+ GWEN_DB_NODE *dbPrefs)
+{
+ GWEN_BUFFER *nameBuf;
+ uint32_t posInBuffer;
+ int i;
+
+ nameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+ GWEN_Buffer_AppendString(nameBuf, variablePrefix);
+ posInBuffer=GWEN_Buffer_GetPos(nameBuf);
+
+ /* write column sizes */
+ GWEN_Buffer_AppendString(nameBuf, "columns");
+ GWEN_DB_DeleteVar(dbPrefs, GWEN_Buffer_GetStart(nameBuf));
+ for (i=0; i<maxColumns; i++) {
+ int j;
+
+ j=GWEN_Dialog_GetIntProperty(dlg, "wiz_importer_list", GWEN_DialogProperty_ColumnWidth, i, -1);
+ if (j<minColumnSize)
+ j=minColumnSize;
+ GWEN_DB_SetIntValue(dbPrefs, GWEN_DB_FLAGS_DEFAULT, GWEN_Buffer_GetStart(nameBuf), j);
+ }
+
+ /* determine column to sort by */
+ GWEN_Buffer_Crop(nameBuf, 0, posInBuffer);
+ GWEN_Buffer_AppendString(nameBuf, "sortbycolumn");
+ GWEN_DB_SetIntValue(dbPrefs, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_Buffer_GetStart(nameBuf), -1);
+ for (i=0; i<maxColumns; i++) {
+ int j;
+
+ j=GWEN_Dialog_GetIntProperty(dlg, widgetName, GWEN_DialogProperty_SortDirection, i, GWEN_DialogSortDirection_None);
+ if (j!=GWEN_DialogSortDirection_None) {
+
+ GWEN_DB_SetIntValue(dbPrefs, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_Buffer_GetStart(nameBuf), i);
+
+ GWEN_Buffer_Crop(nameBuf, 0, posInBuffer);
+ GWEN_Buffer_AppendString(nameBuf, "sortdir");
+ GWEN_DB_SetIntValue(dbPrefs,
+ GWEN_DB_FLAGS_OVERWRITE_VARS,
+ GWEN_Buffer_GetStart(nameBuf),
+ (j==GWEN_DialogSortDirection_Up)?1:0);
+ break;
+ }
+ }
+ GWEN_Buffer_free(nameBuf);
+}
+
+
+
+void GWEN_Dialog_ListReadColumnSettings(GWEN_DIALOG *dlg,
+ const char *widgetName,
+ const char *variablePrefix,
+ int maxColumns,
+ int minColumnSize,
+ GWEN_DB_NODE *dbPrefs)
+{
+ GWEN_BUFFER *nameBuf;
+ uint32_t posInBuffer;
+ int i;
+ int j;
+
+ nameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+ GWEN_Buffer_AppendString(nameBuf, variablePrefix);
+ posInBuffer=GWEN_Buffer_GetPos(nameBuf);
+
+ /* read column sizes */
+ GWEN_Buffer_AppendString(nameBuf, "columns");
+ for (i=0; i<maxColumns; i++) {
+ j=GWEN_DB_GetIntValue(dbPrefs, GWEN_Buffer_GetStart(nameBuf), i, -1);
+ if (j<minColumnSize)
+ j=minColumnSize;
+ GWEN_Dialog_SetIntProperty(dlg, widgetName, GWEN_DialogProperty_ColumnWidth, i, j, 0);
+ }
+
+ /* determine column to sort by */
+ GWEN_Buffer_Crop(nameBuf, 0, posInBuffer);
+ GWEN_Buffer_AppendString(nameBuf, "sortbycolumn");
+ i=GWEN_DB_GetIntValue(dbPrefs, GWEN_Buffer_GetStart(nameBuf), 0, -1);
+ GWEN_Buffer_Crop(nameBuf, 0, posInBuffer);
+ GWEN_Buffer_AppendString(nameBuf, "sortdir");
+ j=GWEN_DB_GetIntValue(dbPrefs, GWEN_Buffer_GetStart(nameBuf), 0, -1);
+ if (i>=0 && j>=0)
+ GWEN_Dialog_SetIntProperty(dlg, widgetName, GWEN_DialogProperty_SortDirection, i, j, 0);
+ GWEN_Buffer_free(nameBuf);
+}
+
+
+
+char *GWEN_Dialog_ListGetFirstColumnData(GWEN_DIALOG *dlg, const char *widgetName, int row)
+{
+ const char *s;
+
+ s=GWEN_Dialog_GetCharProperty(dlg, widgetName, GWEN_DialogProperty_Value, row, NULL);
+ if (s && *s) {
+ const char *p;
+
+ p=strchr(s, '\t');
+ if (p) {
+ int len;
+
+ len=(int)(p-s);
+ if (len) {
+ char *res;
+
+ res=(char *) malloc(len+1);
+ assert(res);
+ memmove(res, s, len);
+ res[len]=0;
+ return res;
+ }
+ }
+ else
+ /* no tab, use the whole line */
+ return strdup(s);
+ }
+
+ return NULL;
+}
+
+
+
+int GWEN_Dialog_ListGetItemMatchingFirstColumn(GWEN_DIALOG *dlg, const char *widgetName, const char *dataToMatch)
+{
+ if (dataToMatch) {
+ int idx;
+ int lengthOfDataToMatch;
+
+ lengthOfDataToMatch=strlen(dataToMatch);
+ for (idx=0; ; idx++) {
+ const char *s;
+
+ s=GWEN_Dialog_GetCharProperty(dlg, widgetName, GWEN_DialogProperty_Value, idx, NULL);
+ if (s && *s) {
+ const char *p;
+
+ p=strchr(s, '\t');
+ if (p) {
+ int len;
+
+ len=(int)(p-s);
+ if (len && len==lengthOfDataToMatch && strncasecmp(s, dataToMatch, len)==0)
+ return idx;
+ }
+ else if (strcasecmp(s, dataToMatch)==0)
+ return idx;
+ }
+ else
+ break;
+ }
+ }
+
+ return -1;
+}
+
+
+
+
+
diff --git a/src/gui/dialog.h b/src/gui/dialog.h
index 98875f4..91de8d9 100644
--- a/src/gui/dialog.h
+++ b/src/gui/dialog.h
@@ -511,6 +511,72 @@ const char *GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s);
/*@}*/
+
+/** @name Convenience Functions
+ *
+ */
+/*@{*/
+
+/**
+ * Write current config of a list widget supporting columns (like GWEN_Widget_TypeListBox).
+ *
+ * @param dlg dialog containing the widget to handle
+ * @param widgetName name of the widget to handle
+ * @param variablePrefix prefix for the different settings, this will be prepended to the variable names used in
+ * the given dbPrefs settings. The following variable names will be used:
+ * - $(prefix)columns: one value for each column stating the column width
+ * - $(prefix)sortbycolumn: Index of the column to sort the list by (in most cases indicated in the GUI)
+ * - $(prefix)sortdir: Sort direction (GWEN_DialogSortDirection_Up or GWEN_DialogSortDirection_Down)
+ * @param maxColumns maximum number of columns to handle
+ * @param minColumnSize minimum width of each column
+ * @param dbPrefs GWEN_DB_NODE to store the settings in
+ */
+GWENHYWFAR_API
+void GWEN_Dialog_ListWriteColumnSettings(GWEN_DIALOG *dlg,
+ const char *widgetName,
+ const char *variablePrefix,
+ int maxColumns,
+ int minColumnSize,
+ GWEN_DB_NODE *dbPrefs);
+
+
+GWENHYWFAR_API
+void GWEN_Dialog_ListReadColumnSettings(GWEN_DIALOG *dlg,
+ const char *widgetName,
+ const char *variablePrefix,
+ int maxColumns,
+ int minColumnSize,
+ GWEN_DB_NODE *dbPrefs);
+
+/**
+ * Get the content of the first column of a given list entry (or whole content if only single column).
+ *
+ * @return NULL or pointer to the content (caller is responsible for freeing the pointer)
+ * @param dlg dialog containing the widget to handle
+ * @param widgetName name of the widget to handle
+ * @param row index of the list item (beginning with 0)
+ */
+GWENHYWFAR_API
+char *GWEN_Dialog_ListGetFirstColumnData(GWEN_DIALOG *dlg, const char *widgetName, int row);
+
+
+/**
+ * Return index of list element whose content of the first column matches the given string.
+ *
+ * The idea is to have the first column of a list entry contain a unique id by which the list can be searched.
+ *
+ * @return -1 if none found, index otherwise (starting with 0)
+ * @param dlg dialog containing the widget to handle
+ * @param widgetName name of the widget to handle
+ * @param dataToMatch string to match against
+ */
+GWENHYWFAR_API
+int GWEN_Dialog_ListGetItemMatchingFirstColumn(GWEN_DIALOG *dlg, const char *widgetName, const char *dataToMatch);
+
+/*@}*/
+
+
+
#ifdef __cplusplus
}
#endif
diff --git a/src/ressource.rc b/src/ressource.rc
index 9d56981..28e7a57 100644
--- a/src/ressource.rc
+++ b/src/ressource.rc
@@ -43,8 +43,8 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Version
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 5, 8, 2, 0
- PRODUCTVERSION 5, 8, 2, 0
+ FILEVERSION 5, 9, 0, 0
+ PRODUCTVERSION 5, 9, 0, 0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L // Windows NT
@@ -58,14 +58,14 @@ BEGIN
//VALUE "Comments", "\0"
VALUE "CompanyName", " Aquamaniac\0"
VALUE "FileDescription", "Multi purpose library\0"
- VALUE "FileVersion", "v5.8.2\0"
+ VALUE "FileVersion", "v5.9.0\0"
VALUE "InternalName", "Gwenhywfar\0"
VALUE "LegalCopyright", "Copyright � 2003 by Martin Preuss\0"
VALUE "LegalTrademarks", "Aquamaniac\0"
VALUE "OriginalFilename", "GWENHYWFAR32.DLL\0"
//VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Gwenhywfar\0"
- VALUE "ProductVersion", "v5.8.2stable-0\0"
+ VALUE "ProductVersion", "v5.9.0stable-0\0"
VALUE "Author", "Martin Preuss\0"
VALUE "Email", "martin at libchipcard.de\0"
VALUE "Homepage", "http://gwenhywfar.sf.net/\0"
diff --git a/src/version.h b/src/version.h
index e21b50d..d16d9af 100644
--- a/src/version.h
+++ b/src/version.h
@@ -31,12 +31,12 @@
#define GWEN_VERSION_MAJOR 5
#define GWENHYWFAR_VERSION_MAJOR 5
-#define GWENHYWFAR_VERSION_MINOR 8
-#define GWENHYWFAR_VERSION_PATCHLEVEL 2
+#define GWENHYWFAR_VERSION_MINOR 9
+#define GWENHYWFAR_VERSION_PATCHLEVEL 0
#define GWENHYWFAR_VERSION_BUILD 0
#define GWENHYWFAR_VERSION_TAG "stable"
-#define GWENHYWFAR_VERSION_FULL_STRING "5.8.2stable-0"
-#define GWENHYWFAR_VERSION_STRING "5.8.2"
+#define GWENHYWFAR_VERSION_FULL_STRING "5.9.0stable-0"
+#define GWENHYWFAR_VERSION_STRING "5.9.0"
#define GWENHYWFAR_SO_EFFECTIVE 79
#define GWENHYWFAR_SO_EFFECTIVE_STR "79"
diff --git a/tools/gwenbuild/parser/parser.c b/tools/gwenbuild/parser/parser.c
index e235c25..1a71053 100644
--- a/tools/gwenbuild/parser/parser.c
+++ b/tools/gwenbuild/parser/parser.c
@@ -688,14 +688,23 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
const char *fileName;
GWEN_BUFFER *fileNameBuffer;
GWB_FILE *file;
+ const char *installPath;
int rv;
+ rv=GWEN_XMLNode_ExpandProperties(xmlNode, GWB_Context_GetVars(currentContext));
+ if (rv<0) {
+ DBG_INFO(NULL, "here (%d)", rv);
+ return rv;
+ }
+
fileName=GWEN_XMLNode_GetProperty(xmlNode, "name", NULL);
if (!(fileName && *fileName)) {
DBG_ERROR(NULL, "No name for <writeFile>");
return GWEN_ERROR_GENERIC;
}
+ installPath=GWEN_XMLNode_GetProperty(xmlNode, "install", NULL);
+
fileNameBuffer=_getSourcePathForFileName(currentContext, fileName);
GWEN_Buffer_AppendString(fileNameBuffer, ".in");
@@ -711,6 +720,10 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
GWB_Context_GetCurrentRelativeDir(currentContext),
fileName);
GWB_File_AddFlags(file, GWB_FILE_FLAGS_GENERATED);
+ if (installPath && *installPath) {
+ GWB_File_AddFlags(file, GWB_FILE_FLAGS_INSTALL);
+ GWB_File_SetInstallPath(file, installPath);
+ }
/* add input file */
GWEN_Buffer_Reset(fileNameBuffer);
More information about the Neon-commits
mailing list