gwenhywfar  5.10.1
gui_dialogs.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Fri Feb 07 2003
3  copyright : (C) 2021 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 /* included from gui.c */
26 
27 
28 
30 {
31  assert(gui);
32  DBG_INFO(GWEN_LOGDOMAIN, "Using own callbacks in gui %p", gui);
33  gui->progressStartFn=GWEN_Gui_DialogBased_ProgressStart;
34  gui->progressAdvanceFn=GWEN_Gui_DialogBased_ProgressAdvance;
35  gui->progressSetTotalFn=GWEN_Gui_DialogBased_ProgressSetTotal;
36  gui->progressLogFn=GWEN_Gui_DialogBased_ProgressLog;
37  gui->progressEndFn=GWEN_Gui_DialogBased_ProgressEnd;
38  gui->inputBoxFn=GWEN_Gui_DialogBased_InputBox;
39  gui->messageBoxFn=GWEN_Gui_DialogBased_MessageBox;
40  gui->showBoxFn=GWEN_Gui_DialogBased_ShowBox;
41  gui->hideBoxFn=GWEN_Gui_DialogBased_HideBox;
42 }
43 
44 
45 
47 {
48  GWEN_PROGRESS_DATA *highest=NULL;
50  GWEN_DIALOG *dlg=NULL;
51 
52  t=pd;
53  while (t) {
54  highest=t;
55  t=GWEN_ProgressData_Tree_GetParent(t);
56  }
57 
58  /* highest must always be visible */
59  if (GWEN_ProgressData_GetShown(highest)==0)
60  GWEN_ProgressData_SetShown(highest, 1);
61 
62  dlg=GWEN_ProgressData_GetDialog(highest);
63  if (dlg==NULL) {
64  int rv;
65 
66  /* need to create dialog for it */
68  if (dlg==NULL) {
69  DBG_ERROR(GWEN_LOGDOMAIN, "Unable to create progress dialog, maybe data not installed?");
70  return GWEN_ERROR_INTERNAL;
71  }
74 
77 
78  rv=GWEN_Gui_OpenDialog(dlg, 0);
79  if (rv<0) {
80  DBG_ERROR(GWEN_LOGDOMAIN, "Unable to openDialog: %d", rv);
81  GWEN_Dialog_free(dlg);
82  return rv;
83  }
84 
85  DBG_INFO(GWEN_LOGDOMAIN, "Setting new firstprogress: %08x",
88  GWEN_ProgressData_SetDialog(highest, dlg);
89  }
90 
91  if (pd!=highest) {
92  DBG_INFO(GWEN_LOGDOMAIN, "Setting new second progress: %08x",
97  }
98 
99  GWEN_Gui_RunDialog(dlg, 0);
100 
101  return 0;
102 }
103 
104 
105 
106 
108 {
109  if (GWEN_ProgressData_GetShown(pd)==0) {
111  double dt;
112  time_t t1;
113 
114  t1=time(0);
115  dt=difftime(t1, GWEN_ProgressData_GetStartTime(pd));
116  if ((int)dt>=GWEN_GUI_DELAY_SECS) {
117  DBG_INFO(GWEN_LOGDOMAIN, "Progress %08x open for %d secs, showing",
118  GWEN_ProgressData_GetId(pd), (int) dt);
120  }
121  }
122  else
124  }
125 
126  if (GWEN_ProgressData_GetShown(pd)==1) {
129  }
130  }
131 }
132 
133 
134 
136  uint32_t progressFlags,
137  const char *title,
138  const char *text,
139  uint64_t total,
140  uint32_t guiid)
141 {
142  GWEN_PROGRESS_DATA *pdParent=NULL;
143  GWEN_PROGRESS_DATA *pd;
144  uint32_t id;
145 
146  id=++(gui->nextProgressId);
147 
148  DBG_DEBUG(GWEN_LOGDOMAIN, "ProgressStart: flags=%08x, title=[%s], total=%08x, guiid=%08x",
149  progressFlags, title?title:"(none)", (uint32_t) total, guiid);
150 
151  if (guiid==0) {
152  guiid=gui->lastProgressId;
153  }
154 
155  if (guiid) {
156  pdParent=GWEN_ProgressData_Tree_FindProgressById(gui->progressDataTree, guiid);
157  if (pdParent==NULL) {
158  DBG_WARN(GWEN_LOGDOMAIN, "Parent progress by id %08x not found", guiid);
159  DBG_DEBUG(GWEN_LOGDOMAIN, "Title: [%s], Text: [%s]",
160  title?title:"no title",
161  text?text:"no text");
162  }
163  }
164 
165  pd=GWEN_ProgressData_new(gui, id, progressFlags, title, text, total);
166  assert(pd);
167  GWEN_ProgressData_SetPreviousId(pd, gui->lastProgressId);
168  if (pdParent)
169  GWEN_ProgressData_Tree_AddChild(pdParent, pd);
170  else
171  GWEN_ProgressData_Tree_Add(gui->progressDataTree, pd);
172 
174 
175  gui->lastProgressId=id;
176 
177  return id;
178 }
179 
180 
181 
183 {
184  GWEN_PROGRESS_DATA *pd;
185  /*uint32_t parentPid=0;*/
186 
187  DBG_DEBUG(GWEN_LOGDOMAIN, "ProgressEnd: guiid=%08x", pid);
188 
189  if (pid==0) {
190  pid=gui->lastProgressId;
191  if (pid==0) {
192  DBG_INFO(GWEN_LOGDOMAIN, "Last active progress not available");
193  return GWEN_ERROR_INVALID;
194  }
195  }
196 
197  pd=GWEN_ProgressData_Tree_FindProgressById(gui->progressDataTree, pid);
198  if (pd==NULL) {
199  DBG_ERROR(GWEN_LOGDOMAIN, "Progress by id %08x not found", pid);
200  return GWEN_ERROR_INVALID;
201  }
202  else {
203  GWEN_DIALOG *dlg;
204  GWEN_PROGRESS_DATA *previousPd;
205 
206  /* set previous progress id */
207  gui->lastProgressId=GWEN_ProgressData_GetPreviousId(pd);
208 
209  /* find next highest active progress */
210  previousPd=GWEN_ProgressData_Tree_GetParent(pd);
211  /*if (previousPd)
212  parentPid=GWEN_ProgressData_GetId(previousPd);*/
213  while (previousPd) {
214  if (GWEN_ProgressData_GetShown(previousPd))
215  break;
216  previousPd=GWEN_ProgressData_Tree_GetParent(previousPd);
217  }
218 
220  if (dlg) {
221  GWEN_PROGRESS_DATA *primary;
222  GWEN_PROGRESS_DATA *secondary;
223 
225  secondary=GWEN_DlgProgress_GetSecondProgress(dlg);
226 
227  /* force update of progress bar */
228  GWEN_DlgProgress_Advanced(dlg, pd);
229  GWEN_Gui_RunDialog(dlg, 0);
230 
231  if (primary==pd) {
232  int rv;
233 
234  DBG_DEBUG(GWEN_LOGDOMAIN, "Progress %08x is primary, closing dialog",
236 
237  if (secondary) {
238  DBG_WARN(GWEN_LOGDOMAIN, "There is still a secondary progress!");
240  GWEN_ProgressData_SetDialog(secondary, NULL);
241  }
242 
243  /* this is the primary progress, with this closed we can also
244  * close the dialog */
245  DBG_INFO(GWEN_LOGDOMAIN, "Closing progress dialog");
246  GWEN_DlgProgress_AddLogText(dlg, GWEN_LoggerLevel_Info, I18N("Operation finished, you can now close this window."));
247 
248  // run dialog until end, close then
250  if (GWEN_DlgProgress_GetStayOpen(dlg)) {
251  rv=GWEN_Gui_RunDialog(dlg, 1);
252  if (rv<0) {
253  DBG_ERROR(GWEN_LOGDOMAIN, "Unable to runDialog: %d", rv);
254  /*GWEN_Dialog_free(dlg);
255  return rv;*/
256  }
257  }
258 
259  rv=GWEN_Gui_CloseDialog(dlg);
260  if (rv<0) {
261  DBG_ERROR(GWEN_LOGDOMAIN, "Unable to closeDialog: %d", rv);
262  GWEN_Dialog_free(dlg);
263  return rv;
264  }
265  GWEN_Dialog_free(dlg);
266  }
267  else if (secondary==pd) {
268  /* t is maybe the next higher progress, it will become the second progress */
269  if (previousPd && previousPd!=GWEN_DlgProgress_GetFirstProgress(dlg)) {
270  DBG_DEBUG(GWEN_LOGDOMAIN, "Progress %08x becomes new second progress",
271  GWEN_ProgressData_GetId(previousPd));
274  }
275  else {
276  DBG_INFO(GWEN_LOGDOMAIN, "No next secondary progress");
278  }
279  }
280  else {
281  DBG_ERROR(GWEN_LOGDOMAIN, "Progress %08x is neither primary nor secondary, SNH",
283  }
284  }
285  else {
286  DBG_DEBUG(GWEN_LOGDOMAIN, "Progress %08x has no dialog", GWEN_ProgressData_GetId(pd));
287  }
288 
290  GWEN_ProgressData_Tree_Del(pd);
292  }
293 
294  return 0;
295 }
296 
297 
298 
299 int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressAdvance(GWEN_GUI *gui, uint32_t pid, uint64_t progress)
300 {
301  GWEN_PROGRESS_DATA *pd;
302  int aborted=0;
303 
304  if (pid==0) {
305  pid=gui->lastProgressId;
306  if (pid==0) {
307  DBG_INFO(GWEN_LOGDOMAIN, "Last active progress not available");
308  return GWEN_ERROR_INVALID;
309  }
310  }
311 
312  pd=GWEN_ProgressData_Tree_FindProgressById(gui->progressDataTree, pid);
313  if (pd==NULL) {
314  DBG_ERROR(GWEN_LOGDOMAIN, "Progress by id %08x not found", pid);
315  return GWEN_ERROR_INVALID;
316  }
317  else {
318  GWEN_DIALOG *dlg;
319 
320  if (progress==GWEN_GUI_PROGRESS_ONE)
321  progress=GWEN_ProgressData_GetCurrent(pd)+1;
322  else if (progress==GWEN_GUI_PROGRESS_NONE)
323  progress=GWEN_ProgressData_GetCurrent(pd);
324  GWEN_ProgressData_SetCurrent(pd, progress);
326 
328  if (dlg) {
329  time_t t0;
330  time_t t1;
331 
333  t1=time(0);
334  if (t0!=t1) {
335  GWEN_DlgProgress_Advanced(dlg, pd);
336  GWEN_Gui_RunDialog(dlg, 0);
338  }
339  }
340  aborted=GWEN_ProgressData_GetAborted(pd);
341  }
342 
343  if (aborted)
345  return 0;
346 }
347 
348 
349 
350 int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressSetTotal(GWEN_GUI *gui, uint32_t pid, uint64_t total)
351 {
352  GWEN_PROGRESS_DATA *pd;
353  int aborted=0;
354 
355  if (pid==0) {
356  pid=gui->lastProgressId;
357  if (pid==0) {
358  DBG_INFO(GWEN_LOGDOMAIN, "Last active progress not available");
359  return GWEN_ERROR_INVALID;
360  }
361  }
362 
363  pd=GWEN_ProgressData_Tree_FindProgressById(gui->progressDataTree, pid);
364  if (pd==NULL) {
365  DBG_ERROR(GWEN_LOGDOMAIN, "Progress by id %08x not found", pid);
366  return GWEN_ERROR_INVALID;
367  }
368  else {
369  GWEN_DIALOG *dlg;
370 
371  GWEN_ProgressData_SetTotal(pd, total);
373 
375  if (dlg) {
376  time_t t0;
377  time_t t1;
378 
380  t1=time(0);
381  if (t0!=t1) {
383  GWEN_Gui_RunDialog(dlg, 0);
385  }
386  }
387  aborted=GWEN_ProgressData_GetAborted(pd);
388  }
389 
390  if (aborted)
392  return 0;
393 }
394 
395 
396 
398  uint32_t pid,
399  GWEN_LOGGER_LEVEL level,
400  const char *text)
401 {
402  assert(gui);
403 
404  /* only show messages with log level lower or equal threshold */
405  if (level<=gui->minProgressLogLevel) {
406  GWEN_PROGRESS_DATA *pd;
407  int aborted=0;
408 
409  if (pid==0) {
410  pid=gui->lastProgressId;
411  if (pid==0) {
412  DBG_INFO(GWEN_LOGDOMAIN, "Last active progress not available");
413  return GWEN_ERROR_INVALID;
414  }
415  }
416 
417  pd=GWEN_ProgressData_Tree_FindProgressById(gui->progressDataTree, pid);
418  if (pd==NULL) {
419  DBG_ERROR(GWEN_LOGDOMAIN, "Progress by id %08x not found", pid);
420  return GWEN_ERROR_INVALID;
421  }
422  else {
423  GWEN_DIALOG *dlg;
424 
425  if (level<=GWEN_LoggerLevel_Notice)
427  if (level<=GWEN_LoggerLevel_Warning)
430 
432  if (dlg) {
433  if (level<=GWEN_LoggerLevel_Warning) {
436  }
437 
438  GWEN_DlgProgress_AddLogText(dlg, level, text);
439  GWEN_Gui_RunDialog(dlg, 0);
440  }
441  else
442  GWEN_ProgressData_AddLogText(pd, level, text);
443 
444  aborted=GWEN_ProgressData_GetAborted(pd);
445  }
446 
447  if (aborted)
449  }
450  return 0;
451 }
452 
453 
454 
456  uint32_t flags,
457  const char *title,
458  const char *text,
459  char *buffer,
460  int minLen,
461  int maxLen,
462  GWEN_UNUSED uint32_t guiid)
463 {
464  GWEN_DIALOG *dlg;
465  int rv;
466 
467  dlg=GWEN_DlgInput_new(flags, title, text, minLen, maxLen);
468  if (dlg==NULL) {
469  DBG_ERROR(GWEN_LOGDOMAIN, "Could not create dialog");
470  return GWEN_ERROR_INTERNAL;
471  }
472 
473  rv=GWEN_Gui_ExecDialog(dlg, 0);
474  if (rv==1) {
475  rv=GWEN_DlgInput_CopyInput(dlg, buffer, maxLen);
476  if (rv<0) {
477  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
478  GWEN_Dialog_free(dlg);
479  return rv;
480  }
482  rv=1;
483  else
484  rv=0;
485  GWEN_Dialog_free(dlg);
486  return rv;
487  }
488  else {
489  DBG_ERROR(GWEN_LOGDOMAIN, "User aborted");
490  GWEN_Dialog_free(dlg);
492  }
493 }
494 
495 
496 
498  uint32_t flags,
499  const char *title,
500  const char *text,
501  const char *b1,
502  const char *b2,
503  const char *b3,
504  GWEN_UNUSED uint32_t guiid)
505 {
506  GWEN_DIALOG *dlg;
507  int rv;
508 
509  dlg=GWEN_DlgMessage_new(flags, title, text, b1, b2, b3);
510  if (dlg==NULL) {
511  DBG_ERROR(GWEN_LOGDOMAIN, "Could not create dialog");
512  return GWEN_ERROR_INTERNAL;
513  }
514 
515  GWEN_Gui_ExecDialog(dlg, 0);
517  GWEN_Dialog_free(dlg);
518  return rv;
519 }
520 
521 
522 
524  uint32_t flags,
525  const char *title,
526  const char *text,
527  uint32_t guiid)
528 {
529  GWEN_DIALOG *dlg;
530  int rv;
531  uint32_t id;
532 
533  id=++(gui->nextDialogId);
534 
535  dlg=GWEN_DlgShowBox_new(flags, title, text);
536  if (dlg==NULL) {
537  DBG_ERROR(GWEN_LOGDOMAIN, "Could not create dialog");
538  return 0;
539  }
540 
541  GWEN_Dialog_SetGuiId(dlg, id);
542 
543  rv=GWEN_Gui_OpenDialog(dlg, guiid);
544  if (rv<0) {
545  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
546  GWEN_Dialog_free(dlg);
547  return 0;
548  }
549 
550  GWEN_Dialog_List_Add(dlg, gui->activeDialogs);
551 
552  return id;
553 }
554 
555 
556 
558 {
559  GWEN_DIALOG *dlg;
560 
561  if (id) {
562  dlg=GWEN_Dialog_List_First(gui->activeDialogs);
563  while (dlg) {
564  if (GWEN_Dialog_GetGuiId(dlg)==id)
565  break;
566  dlg=GWEN_Dialog_List_Next(dlg);
567  }
568  }
569  else
570  dlg=GWEN_Dialog_List_Last(gui->activeDialogs);
571 
572  if (dlg) {
573  int rv;
574 
575  rv=GWEN_Gui_CloseDialog(dlg);
576  if (rv<0) {
577  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
578  }
580  GWEN_Dialog_free(dlg);
581  }
582 }
583 
584 
585 
int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressAdvance(GWEN_GUI *gui, uint32_t pid, uint64_t progress)
Definition: gui_dialogs.c:299
GWEN_DIALOG * GWEN_ProgressData_GetDialog(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:275
#define I18N(m)
Definition: error.c:42
GWEN_DIALOG * GWEN_DlgInput_new(uint32_t flags, const char *title, const char *text, int minLen, int maxLen)
Definition: dlg_input.c:34
GWENHYWFAR_API int GWEN_Gui_OpenDialog(GWEN_DIALOG *dlg, uint32_t guiid)
Definition: gui_virtual.c:571
int GWEN_ProgressData_GetShown(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:227
void GWEN_DlgProgress_SetStayOpen(GWEN_DIALOG *dlg, int b)
Definition: dlg_progress.c:97
#define GWEN_ERROR_INVALID
Definition: error.h:67
GWEN_DIALOG * GWEN_Dialog_List_Next(const GWEN_DIALOG *element)
int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressSetTotal(GWEN_GUI *gui, uint32_t pid, uint64_t total)
Definition: gui_dialogs.c:350
int GWEN_DlgInput_CopyInput(GWEN_DIALOG *dlg, char *buffer, int size)
Definition: dlg_input.c:379
GWEN_PROGRESS_DATA * GWEN_DlgProgress_GetSecondProgress(const GWEN_DIALOG *dlg)
Definition: dlg_progress.c:206
int GWENHYWFAR_CB GWEN_Gui_DialogBased_InputBox(GWEN_UNUSED GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, char *buffer, int minLen, int maxLen, GWEN_UNUSED uint32_t guiid)
Definition: gui_dialogs.c:455
GWEN_LOGGER_LEVEL
Definition: logger.h:64
uint32_t GWEN_ProgressData_GetFlags(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:105
GWEN_DIALOG * GWEN_Dialog_List_First(const GWEN_DIALOG_LIST *l)
#define NULL
Definition: binreloc.c:300
void GWEN_DlgProgress_TotalChanged(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
Definition: dlg_progress.c:353
uint32_t GWEN_ProgressData_GetId(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:81
int GWENHYWFAR_CB GWEN_Gui_DialogBased_MessageBox(GWEN_UNUSED GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3, GWEN_UNUSED uint32_t guiid)
Definition: gui_dialogs.c:497
#define GWEN_GUI_PROGRESS_DELAY
Definition: gui.h:192
void GWEN_ProgressData_AddLogText(GWEN_PROGRESS_DATA *pd, GWEN_UNUSED GWEN_LOGGER_LEVEL level, const char *s)
Definition: progressdata.c:201
#define DBG_WARN(dbg_logger, format, args...)
Definition: debug.h:125
#define GWEN_LOGDOMAIN
Definition: logger.h:35
GWENHYWFAR_API int GWEN_Gui_ExecDialog(GWEN_DIALOG *dlg, uint32_t guiid)
Definition: gui_virtual.c:559
struct GWEN_DIALOG GWEN_DIALOG
Definition: dialog.h:54
GWEN_DIALOG * GWEN_DlgProgress_new(void)
Definition: dlg_progress.c:39
void GWEN_Dialog_List_Add(GWEN_DIALOG *element, GWEN_DIALOG_LIST *list)
void GWEN_DlgProgress_SetAllowClose(GWEN_DIALOG *dlg, int b)
Definition: dlg_progress.c:80
time_t GWEN_ProgressData_GetCheckTime(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:259
int GWENHYWFAR_CB GWEN_Gui_ShowProgress(GWEN_PROGRESS_DATA *pd)
Definition: gui_dialogs.c:46
#define GWEN_GUI_PROGRESS_ONE
Definition: gui.h:376
int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressEnd(GWEN_GUI *gui, uint32_t pid)
Definition: gui_dialogs.c:182
void GWEN_DlgProgress_SetSecondProgress(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
Definition: dlg_progress.c:219
void GWEN_ProgressData_SetCheckTime(GWEN_PROGRESS_DATA *pd, time_t t)
Definition: progressdata.c:267
#define GWEN_GUI_PROGRESS_NONE
Definition: gui.h:368
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
#define DBG_DEBUG(dbg_logger, format, args...)
Definition: debug.h:214
int GWEN_ProgressData_GetAborted(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:211
uint32_t GWENHYWFAR_CB GWEN_Gui_DialogBased_ShowBox(GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, uint32_t guiid)
Definition: gui_dialogs.c:523
uint64_t GWEN_ProgressData_GetCurrent(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:153
GWEN_PROGRESS_DATA * GWEN_DlgProgress_GetFirstProgress(const GWEN_DIALOG *dlg)
Definition: dlg_progress.c:155
void GWEN_Dialog_SetGuiId(GWEN_DIALOG *dlg, uint32_t guiid)
Definition: dialog.c:202
void GWEN_ProgressData_SetCurrent(GWEN_PROGRESS_DATA *pd, uint64_t i)
Definition: progressdata.c:161
GWEN_PROGRESS_DATA * GWEN_ProgressData_Tree_FindProgressById(GWEN_PROGRESS_DATA_TREE *pt, uint32_t id)
Definition: progressdata.c:291
void GWEN_DlgProgress_SetShowLog(GWEN_DIALOG *dlg, int b)
Definition: dlg_progress.c:123
int GWEN_DlgMessage_GetResponse(const GWEN_DIALOG *dlg)
Definition: dlg_message.c:112
void GWEN_DlgProgress_AddLogText(GWEN_DIALOG *dlg, GWEN_LOGGER_LEVEL level, const char *s)
Definition: dlg_progress.c:246
int GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressLog(GWEN_GUI *gui, uint32_t pid, GWEN_LOGGER_LEVEL level, const char *text)
Definition: gui_dialogs.c:397
void GWEN_Gui_UseDialogs(GWEN_GUI *gui)
Definition: gui_dialogs.c:29
int GWEN_DlgInput_GetFlagAllowStore(GWEN_DIALOG *dlg)
Definition: dlg_input.c:404
GWEN_DIALOG * GWEN_DlgMessage_new(uint32_t flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3)
Definition: dlg_message.c:34
#define GWEN_GUI_PROGRESS_KEEP_OPEN
Definition: gui.h:198
GWEN_DIALOG * GWEN_DlgShowBox_new(uint32_t flags, const char *title, const char *text)
Definition: dlg_showbox.c:38
GWENHYWFAR_API int GWEN_Gui_CloseDialog(GWEN_DIALOG *dlg)
Definition: gui_virtual.c:583
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
void GWEN_Dialog_List_Del(GWEN_DIALOG *element)
#define GWEN_GUI_PROGRESS_SHOW_LOG
Definition: gui.h:193
struct GWEN_PROGRESS_DATA GWEN_PROGRESS_DATA
void GWEN_ProgressData_SetTotal(GWEN_PROGRESS_DATA *pd, uint64_t i)
Definition: progressdata.c:169
#define DBG_INFO(dbg_logger, format, args...)
Definition: debug.h:181
uint32_t GWENHYWFAR_CB GWEN_Gui_DialogBased_ProgressStart(GWEN_GUI *gui, uint32_t progressFlags, const char *title, const char *text, uint64_t total, uint32_t guiid)
Definition: gui_dialogs.c:135
void GWEN_Gui_DialogBased_CheckShow(GWEN_UNUSED GWEN_GUI *gui, GWEN_PROGRESS_DATA *pd)
Definition: gui_dialogs.c:107
void GWENHYWFAR_CB GWEN_Gui_DialogBased_HideBox(GWEN_GUI *gui, uint32_t id)
Definition: gui_dialogs.c:557
struct GWEN_GUI GWEN_GUI
Definition: gui.h:176
GWEN_PROGRESS_DATA * GWEN_ProgressData_new(GWEN_GUI *gui, uint32_t id, uint32_t progressFlags, const char *title, const char *text, uint64_t total)
Definition: progressdata.c:31
void GWEN_Dialog_free(GWEN_DIALOG *dlg)
Definition: dialog.c:137
void GWEN_ProgressData_SetPreviousId(GWEN_PROGRESS_DATA *pd, uint32_t i)
Definition: progressdata.c:97
uint32_t GWEN_Dialog_GetGuiId(const GWEN_DIALOG *dlg)
Definition: dialog.c:192
#define GWEN_ERROR_INTERNAL
Definition: error.h:125
void GWEN_DlgProgress_Advanced(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
Definition: dlg_progress.c:326
#define GWEN_ERROR_USER_ABORTED
Definition: error.h:65
void GWEN_ProgressData_SetShown(GWEN_PROGRESS_DATA *pd, int i)
Definition: progressdata.c:235
uint32_t GWEN_ProgressData_GetPreviousId(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:89
void GWEN_ProgressData_SetDialog(GWEN_PROGRESS_DATA *pd, GWEN_DIALOG *dlg)
Definition: progressdata.c:283
void GWEN_ProgressData_AddFlags(GWEN_PROGRESS_DATA *pd, uint32_t fl)
Definition: progressdata.c:113
GWEN_DIALOG * GWEN_Dialog_List_Last(const GWEN_DIALOG_LIST *l)
GWENHYWFAR_API int GWEN_Gui_RunDialog(GWEN_DIALOG *dlg, int untilEnd)
Definition: gui_virtual.c:595
int GWEN_DlgProgress_GetStayOpen(const GWEN_DIALOG *dlg)
Definition: dlg_progress.c:110
void GWEN_DlgProgress_SetFirstProgress(GWEN_DIALOG *dlg, GWEN_PROGRESS_DATA *pd)
Definition: dlg_progress.c:168
time_t GWEN_ProgressData_GetStartTime(const GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:243
#define GWEN_UNUSED
#define GWEN_GUI_DELAY_SECS
Definition: gui.h:183
void GWEN_ProgressData_free(GWEN_PROGRESS_DATA *pd)
Definition: progressdata.c:60