15 #define DISABLE_DEBUGLOG
18 #include "dlg_progress_p.h"
20 #include <gwenhywfar/gwenhywfar.h>
21 #include <gwenhywfar/pathmanager.h>
22 #include <gwenhywfar/debug.h>
23 #include <gwenhywfar/text.h>
27 #define DIALOG_MINWIDTH 520
28 #define DIALOG_MINHEIGHT 400
29 #define DIALOG_MINHEIGHT_NOLOG 100
41 GWEN_DLGPROGRESS *xdlg;
56 "gwenhywfar/dialogs/dlg_progress.dlg",
84 GWEN_DLGPROGRESS *xdlg;
86 xdlg=(GWEN_DLGPROGRESS*) p;
97 GWEN_DLGPROGRESS *xdlg;
113 GWEN_DLGPROGRESS *xdlg;
125 GWEN_DLGPROGRESS *xdlg;
131 return xdlg->stayOpen;
137 GWEN_DLGPROGRESS *xdlg;
143 if (xdlg->showLog!=b) {
151 i=xdlg->withLogWidth;
156 i=xdlg->withLogHeight;
168 GWEN_DLGPROGRESS *xdlg;
174 return xdlg->firstProgress;
180 GWEN_DLGPROGRESS *xdlg;
186 xdlg->firstProgress=pd;
189 if (xdlg->firstProgress) {
217 GWEN_DLGPROGRESS *xdlg;
223 return xdlg->secondProgress;
229 GWEN_DLGPROGRESS *xdlg;
235 xdlg->secondProgress=pd;
238 if (xdlg->secondProgress) {
257 GWEN_DLGPROGRESS *xdlg;
331 GWEN_DLGPROGRESS *xdlg;
338 if (pd==xdlg->firstProgress)
340 else if (pd==xdlg->secondProgress)
357 GWEN_DLGPROGRESS *xdlg;
364 if (pd==xdlg->firstProgress)
366 else if (pd==xdlg->secondProgress)
383 GWEN_DLGPROGRESS *xdlg;
400 i=xdlg->withLogWidth;
404 i=xdlg->withLogHeight;
424 if (xdlg->firstProgress) {
441 if (xdlg->secondProgress) {
457 GWEN_DLGPROGRESS *xdlg;
487 "dialog_width_nolog",
494 "dialog_height_nolog",
503 GWEN_DLGPROGRESS *xdlg;
509 if (strcasecmp(sender,
"closeButton")==0) {
512 else if (strcasecmp(sender,
"abortButton")==0) {
513 if (xdlg->firstProgress)
515 if (xdlg->secondProgress)
533 const char *sender) {
534 GWEN_DLGPROGRESS *xdlg;
559 if (xdlg->allowClose==0)
struct GWEN_TIME GWEN_TIME
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
#define GWEN_DB_FLAGS_OVERWRITE_VARS
struct GWEN_DB_NODE GWEN_DB_NODE
void GWEN_DlgProgress_SetStayOpen(GWEN_DIALOG *dlg, int b)
#define GWEN_PM_SYSDATADIR
uint32_t GWEN_Buffer_GetUsedBytes(const GWEN_BUFFER *bf)
int GWENHYWFAR_CB GWEN_DlgProgress_SignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
GWEN_PROGRESS_DATA * GWEN_DlgProgress_GetSecondProgress(const GWEN_DIALOG *dlg)
void GWEN_DlgProgress_Init(GWEN_DIALOG *dlg)
#define GWEN_FREE_OBJECT(varname)
void GWEN_DlgProgress_TotalChanged(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
uint32_t GWEN_ProgressData_GetId(const GWEN_PROGRESS_DATA *pd)
GWEN_DIALOG_SIGNALHANDLER GWEN_Dialog_SetSignalHandler(GWEN_DIALOG *dlg, GWEN_DIALOG_SIGNALHANDLER fn)
GWEN_DB_NODE * GWEN_Dialog_GetPreferences(const GWEN_DIALOG *dlg)
const char * GWEN_ProgressData_GetText(const GWEN_PROGRESS_DATA *pd)
int GWEN_DlgProgress_HandleActivated(GWEN_DIALOG *dlg, const char *sender)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
struct GWEN_DIALOG GWEN_DIALOG
GWEN_DIALOG * GWEN_DlgProgress_new(void)
void GWEN_DlgProgress_SetAllowClose(GWEN_DIALOG *dlg, int b)
void GWEN_DlgProgress_SetSecondProgress(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
#define GWEN_NEW_OBJECT(typ, varname)
GWENHYWFAR_API int GWEN_Time_toString(const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf)
int GWEN_Dialog_GetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int defaultProperty)
uint64_t GWEN_ProgressData_GetCurrent(const GWEN_PROGRESS_DATA *pd)
void GWEN_DlgProgress_Fini(GWEN_DIALOG *dlg)
GWEN_PROGRESS_DATA * GWEN_DlgProgress_GetFirstProgress(const GWEN_DIALOG *dlg)
#define GWEN_ERROR_GENERIC
void GWENHYWFAR_CB GWEN_DlgProgress_FreeData(void *bp, void *p)
void GWEN_DlgProgress_SetShowLog(GWEN_DIALOG *dlg, int b)
int GWEN_Text_EscapeXmlToBuffer(const char *src, GWEN_BUFFER *buf)
void GWEN_DlgProgress_AddLogText(GWEN_DIALOG *dlg, GWEN_LOGGER_LEVEL level, const char *s)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
uint64_t GWEN_ProgressData_GetTotal(const GWEN_PROGRESS_DATA *pd)
#define DIALOG_MINHEIGHT_NOLOG
#define DBG_ERROR(dbg_logger, format, args...)
int GWEN_Dialog_SetIntProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
GWEN_DIALOG * GWEN_Dialog_new(const char *dialogId)
void GWEN_ProgressData_SetAborted(GWEN_PROGRESS_DATA *pd, int i)
struct GWEN_PROGRESS_DATA GWEN_PROGRESS_DATA
int GWEN_Dialog_SetCharProperty(GWEN_DIALOG *dlg, const char *name, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
const char * GWEN_ProgressData_GetTitle(const GWEN_PROGRESS_DATA *pd)
#define DBG_INFO(dbg_logger, format, args...)
int GWEN_DB_GetIntValue(GWEN_DB_NODE *n, const char *path, int idx, int defVal)
void GWEN_Dialog_free(GWEN_DIALOG *dlg)
#define GWEN_INHERIT(bt, t)
int GWEN_Dialog_ReadXmlFile(GWEN_DIALOG *dlg, const char *fname)
int GWEN_DB_SetIntValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, int val)
void GWEN_DlgProgress_Advanced(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
int GWEN_PathManager_FindFile(const char *destLib, const char *pathName, const char *fileName, GWEN_BUFFER *fbuf)
#define GWEN_INHERIT_SETDATA(bt, t, element, data, fn)
int GWEN_DlgProgress_GetStayOpen(const GWEN_DIALOG *dlg)
GWENHYWFAR_API GWEN_TIME * GWEN_CurrentTime(void)
void GWEN_DlgProgress_SetFirstProgress(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
#define GWEN_INHERIT_GETDATA(bt, t, element)