18 #include <gwenhywfar/debug.h> 20 #include <QMessageBox> 21 #include <QApplication> 22 #include <QFileDialog> 31 ,_parentWidget(
NULL) {
47 _pushedParents.push_back(_parentWidget);
54 if (!_pushedParents.empty()) {
55 _parentWidget=_pushedParents.back();
56 _pushedParents.pop_back();
73 while ((p=strchr(p,
'<'))) {
78 if (toupper(*t)==
'H') {
80 if (toupper(*t)==
'T') {
82 if (toupper(*t)==
'M') {
84 if (toupper(*t)==
'L') {
86 if (toupper(*t)==
'>') {
100 while ((p2=strchr(p2,
'<'))) {
105 if (toupper(*t)==
'/') {
107 if (toupper(*t)==
'H') {
109 if (toupper(*t)==
'T') {
111 if (toupper(*t)==
'M') {
113 if (toupper(*t)==
'L') {
115 if (toupper(*t)==
'>') {
128 return QLatin1String(
"<qt>")+QString::fromUtf8(p, p2-p)+QLatin1String(
"</qt>");
130 return QString::fromUtf8(text);
137 QWidget *owner=qApp->activeWindow();
140 if (!(qt4Dlg.
setup(owner))) {
151 QWidget *owner=qApp->activeWindow();
156 if (!(qt4Dlg->
setup(owner))) {
186 return qt4Dlg->
runDialog((untilEnd==0)?
false:
true);
194 const char *patterns,
201 QWidget *owner=qApp->activeWindow();
204 sCaption=QString::fromUtf8(caption);
214 str=QString::fromUtf8(s1, s2-s1);
215 str.replace(
',',
' ');
216 str.replace(
';',
' ');
221 str=QString::fromUtf8(s1);
222 str.replace(
',',
' ');
223 str.replace(
';',
' ');
240 str=QFileDialog::getOpenFileName(owner, sCaption, sPath, sPatterns);
244 str=QFileDialog::getSaveFileName(owner, sCaption, sPath, sPatterns);
248 str=QFileDialog::getExistingDirectory(owner, sCaption, sPath);
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
uint32_t GWEN_Buffer_GetUsedBytes(const GWEN_BUFFER *bf)
virtual int closeDialog(GWEN_DIALOG *dlg)
static QT4_GuiDialog * getDialog(GWEN_DIALOG *dlg)
void GWEN_Gui_AddFlags(GWEN_GUI *gui, uint32_t fl)
int runDialog(bool untilEnd)
struct GWEN_DIALOG GWEN_DIALOG
virtual int execDialog(GWEN_DIALOG *dlg, uint32_t guiid)
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
void pushParentWidget(QWidget *w)
static QString extractHtml(const char *text)
GWENHYWFAR_API void GWEN_Gui_UseDialogs(GWEN_GUI *gui)
#define GWEN_ERROR_ABORTED
A C++ binding for the C module GWEN_GUI.
#define GWEN_ERROR_GENERIC
#define GWEN_GUI_FLAGS_DIALOGSUPPORTED
virtual int getFileName(const char *caption, GWEN_GUI_FILENAME_TYPE fnt, uint32_t flags, const char *patterns, GWEN_BUFFER *pathBuffer, uint32_t guiid)
bool setup(QWidget *parentWindow)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
virtual int openDialog(GWEN_DIALOG *dlg, uint32_t guiid)
#define DBG_ERROR(dbg_logger, format, args...)
virtual int runDialog(GWEN_DIALOG *dlg, int untilEnd)
void GWEN_Gui_SetName(GWEN_GUI *gui, const char *name)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)