Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
72aa76d2
Commit
72aa76d2
authored
May 13, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wow error message dialog, double UTF-8 coversion avoided
parent
f613b27d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
xtt/lib/cow/gtk/cow_wow_gtk.cpp
xtt/lib/cow/gtk/cow_wow_gtk.cpp
+12
-6
xtt/lib/cow/gtk/cow_wow_gtk.h
xtt/lib/cow/gtk/cow_wow_gtk.h
+1
-1
xtt/lib/cow/src/cow_wow.h
xtt/lib/cow/src/cow_wow.h
+2
-1
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
+1
-1
xtt/lib/xtt/src/xtt_hist.cpp
xtt/lib/xtt/src/xtt_hist.cpp
+0
-2
No files found.
xtt/lib/cow/gtk/cow_wow_gtk.cpp
View file @
72aa76d2
...
@@ -323,7 +323,7 @@ static gboolean displayerror_remove_cb( void *data)
...
@@ -323,7 +323,7 @@ static gboolean displayerror_remove_cb( void *data)
return
FALSE
;
return
FALSE
;
}
}
void
CoWowGtk
::
DisplayError
(
const
char
*
title
,
const
char
*
text
)
void
CoWowGtk
::
DisplayError
(
const
char
*
title
,
const
char
*
text
,
lng_eCoding
coding
)
{
{
GtkWidget
*
parent
=
m_parent
;
GtkWidget
*
parent
=
m_parent
;
if
(
parent
)
{
if
(
parent
)
{
...
@@ -331,15 +331,21 @@ void CoWowGtk::DisplayError( const char *title, const char *text)
...
@@ -331,15 +331,21 @@ void CoWowGtk::DisplayError( const char *title, const char *text)
parent
=
gtk_widget_get_parent
(
parent
);
parent
=
gtk_widget_get_parent
(
parent
);
}
}
char
*
textutf8
=
g_convert
(
text
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
char
*
ctext
;
if
(
textutf8
[
0
]
==
'%'
)
if
(
coding
!=
lng_eCoding_UTF_8
)
{
textutf8
[
0
]
=
' '
;
ctext
=
g_convert
(
text
,
-
1
,
"UTF-8"
,
"ISO8859-1"
,
NULL
,
NULL
,
NULL
);
if
(
ctext
[
0
]
==
'%'
)
ctext
[
0
]
=
' '
;
}
else
ctext
=
(
char
*
)
text
;
GtkWidget
*
dialog
=
gtk_message_dialog_new
(
GTK_WINDOW
(
parent
),
GtkWidget
*
dialog
=
gtk_message_dialog_new
(
GTK_WINDOW
(
parent
),
GTK_DIALOG_MODAL
,
GTK_DIALOG_MODAL
,
GTK_MESSAGE_ERROR
,
GTK_MESSAGE_ERROR
,
GTK_BUTTONS_OK
,
textutf8
);
GTK_BUTTONS_OK
,
ctext
);
g_free
(
textutf8
);
if
(
coding
!=
lng_eCoding_UTF_8
)
g_free
(
ctext
);
g_signal_connect
(
dialog
,
"response"
,
g_signal_connect
(
dialog
,
"response"
,
G_CALLBACK
(
displayerror_ok_cb
),
NULL
);
G_CALLBACK
(
displayerror_ok_cb
),
NULL
);
gtk_window_set_title
(
GTK_WINDOW
(
dialog
),
title
);
gtk_window_set_title
(
GTK_WINDOW
(
dialog
),
title
);
...
...
xtt/lib/cow/gtk/cow_wow_gtk.h
View file @
72aa76d2
...
@@ -126,7 +126,7 @@ class CoWowGtk : public CoWow {
...
@@ -126,7 +126,7 @@ class CoWowGtk : public CoWow {
void
(
*
questionbox_ok
)
(
void
*
,
void
*
),
void
(
*
questionbox_ok
)
(
void
*
,
void
*
),
void
(
*
questionbox_cancel
)
(
void
*
,
void
*
),
void
(
*
questionbox_cancel
)
(
void
*
,
void
*
),
void
*
data
);
void
*
data
);
void
DisplayError
(
const
char
*
title
,
const
char
*
text
);
void
DisplayError
(
const
char
*
title
,
const
char
*
text
,
lng_eCoding
coding
=
lng_eCoding_ISO8859_1
);
void
DisplayText
(
const
char
*
title
,
const
char
*
text
,
int
width
=
0
,
int
height
=
0
);
void
DisplayText
(
const
char
*
title
,
const
char
*
text
,
int
width
=
0
,
int
height
=
0
);
void
CreateInputDialog
(
void
*
ctx
,
const
char
*
title
,
const
char
*
text
,
void
CreateInputDialog
(
void
*
ctx
,
const
char
*
title
,
const
char
*
text
,
void
(
*
inputdialogbox_ok
)
(
void
*
,
void
*
,
char
*
),
void
(
*
inputdialogbox_ok
)
(
void
*
,
void
*
,
char
*
),
...
...
xtt/lib/cow/src/cow_wow.h
View file @
72aa76d2
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include <string.h>
#include <string.h>
#include "co_wow_msg.h"
#include "co_wow_msg.h"
#include "co_lng.h"
typedef
enum
{
typedef
enum
{
wow_eFileSelType_
,
wow_eFileSelType_
,
...
@@ -117,7 +118,7 @@ class CoWow {
...
@@ -117,7 +118,7 @@ class CoWow {
void
(
*
questionbox_ok
)
(
void
*
,
void
*
),
void
(
*
questionbox_ok
)
(
void
*
,
void
*
),
void
(
*
questionbox_cancel
)
(
void
*
,
void
*
),
void
(
*
questionbox_cancel
)
(
void
*
,
void
*
),
void
*
data
)
{}
void
*
data
)
{}
virtual
void
DisplayError
(
const
char
*
title
,
const
char
*
text
)
{}
virtual
void
DisplayError
(
const
char
*
title
,
const
char
*
text
,
lng_eCoding
coding
=
lng_eCoding_ISO8859_1
)
{}
virtual
void
DisplayText
(
const
char
*
title
,
const
char
*
text
,
int
width
=
0
,
int
height
=
0
)
{}
virtual
void
DisplayText
(
const
char
*
title
,
const
char
*
text
,
int
width
=
0
,
int
height
=
0
)
{}
virtual
void
CreateInputDialog
(
void
*
ctx
,
const
char
*
title
,
const
char
*
text
,
virtual
void
CreateInputDialog
(
void
*
ctx
,
const
char
*
title
,
const
char
*
text
,
void
(
*
inputdialogbox_ok
)
(
void
*
,
void
*
,
char
*
),
void
(
*
inputdialogbox_ok
)
(
void
*
,
void
*
,
char
*
),
...
...
xtt/lib/xtt/gtk/xtt_ge_gtk.cpp
View file @
72aa76d2
...
@@ -152,7 +152,7 @@ void XttGeGtk::message_dialog_cb( void *ge_ctx, const char *text)
...
@@ -152,7 +152,7 @@ void XttGeGtk::message_dialog_cb( void *ge_ctx, const char *text)
char
title
[
80
];
char
title
[
80
];
strcpy
(
title
,
Lng
::
translate
(
"Message"
));
strcpy
(
title
,
Lng
::
translate
(
"Message"
));
wow
.
DisplayError
(
title
,
Lng
::
translate
(
text
));
wow
.
DisplayError
(
title
,
Lng
::
translate
(
text
)
,
Lng
::
translatefile_coding
()
);
// g_object_set( ((XttGeGtk *)ge)->message_dia_widget, "visible", TRUE, NULL);
// g_object_set( ((XttGeGtk *)ge)->message_dia_widget, "visible", TRUE, NULL);
// gtk_label_set_text( GTK_LABEL(((XttGeGtk *)ge)->message_dia_label), text);
// gtk_label_set_text( GTK_LABEL(((XttGeGtk *)ge)->message_dia_label), text);
...
...
xtt/lib/xtt/src/xtt_hist.cpp
View file @
72aa76d2
...
@@ -52,7 +52,6 @@ using namespace std;
...
@@ -52,7 +52,6 @@ using namespace std;
#include <string>
#include <string>
#include <vector>
#include <vector>
extern
"C"
{
#include "co_cdh.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_time.h"
#include "cow_wow.h"
#include "cow_wow.h"
...
@@ -64,7 +63,6 @@ extern "C" {
...
@@ -64,7 +63,6 @@ extern "C" {
#include "rt_elog.h"
#include "rt_elog.h"
#include "co_dcli.h"
#include "co_dcli.h"
#include <db.h>
#include <db.h>
}
#include <deque>
#include <deque>
#include <algorithm>
#include <algorithm>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment