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 42 GWEN_DLGPROGRESS *xdlg;
47 "gwenhywfar/dialogs/dlg_progress.dlg");
68 GWEN_DLGPROGRESS *xdlg;
70 xdlg=(GWEN_DLGPROGRESS *) p;
82 GWEN_DLGPROGRESS *xdlg;
99 GWEN_DLGPROGRESS *xdlg;
112 GWEN_DLGPROGRESS *xdlg;
118 return xdlg->stayOpen;
125 GWEN_DLGPROGRESS *xdlg;
131 if (xdlg->showLog!=b) {
139 i=xdlg->withLogWidth;
144 i=xdlg->withLogHeight;
157 GWEN_DLGPROGRESS *xdlg;
163 return xdlg->firstProgress;
170 GWEN_DLGPROGRESS *xdlg;
176 xdlg->firstProgress=pd;
179 if (xdlg->firstProgress) {
208 GWEN_DLGPROGRESS *xdlg;
214 return xdlg->secondProgress;
221 GWEN_DLGPROGRESS *xdlg;
227 xdlg->secondProgress=pd;
230 if (xdlg->secondProgress) {
250 GWEN_DLGPROGRESS *xdlg;
328 GWEN_DLGPROGRESS *xdlg;
335 if (pd==xdlg->firstProgress)
337 else if (pd==xdlg->secondProgress)
355 GWEN_DLGPROGRESS *xdlg;
362 if (pd==xdlg->firstProgress)
364 else if (pd==xdlg->secondProgress)
382 GWEN_DLGPROGRESS *xdlg;
399 i=xdlg->withLogWidth;
403 i=xdlg->withLogHeight;
423 if (xdlg->firstProgress) {
440 if (xdlg->secondProgress) {
457 GWEN_DLGPROGRESS *xdlg;
487 "dialog_width_nolog",
494 "dialog_height_nolog",
504 GWEN_DLGPROGRESS *xdlg;
510 if (strcasecmp(sender,
"closeButton")==0) {
513 else if (strcasecmp(sender,
"abortButton")==0) {
514 if (xdlg->firstProgress)
516 if (xdlg->secondProgress)
536 GWEN_DLGPROGRESS *xdlg;
561 if (xdlg->allowClose==0)
void GWENHYWFAR_CB GWEN_DlgProgress_FreeData(GWEN_UNUSED void *bp, void *p)
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 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.
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
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)
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)
#define GWEN_INHERIT(bt, t)
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)
#define GWEN_INHERIT_SETDATA(bt, t, element, data, fn)
GWEN_DIALOG * GWEN_Dialog_CreateAndLoadWithPath(const char *dialogId, const char *pmLibName, const char *pmDataDir, const char *fileName)
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)