Skip to content

Commit 7a5dc42

Browse files
committed
updated
1 parent 3d89fd9 commit 7a5dc42

File tree

4 files changed

+52
-11
lines changed

4 files changed

+52
-11
lines changed

libs/util/CProgressDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ gint CProgressDlg::show(GtkWindow* pWindow, gpointer user_data, const char* msg,
297297

298298

299299
if ( get_working() ) {
300-
__LOGT__( TAG, "show(): working... SKIP" );
300+
//__LOGT__( TAG, "show(): working... SKIP" );
301301
return ret_spinner_dlg;
302302
}
303303

libs/util/CThreadTask.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,47 @@ Last modified: Nov 28, 2014
3131
-----------------------------------------------------------------
3232
1. Build:
3333
$ g++ ... -D__LINUX__ -D_REENTRANT -lpthread -lrt
34+
35+
36+
2. Usage: (a trivial example)
37+
void* Cxxx::inBackground(std::vector<void*>* pvecVal) {
38+
__LOGT__( TAG, "inBackground()" );
39+
40+
// TEST
41+
for ( int i = 0; i < 10; i++ ) {
42+
__LOGT__( TAG, "inBackground(): i = %d", i );
43+
update( (void*)"#---update---#" );
44+
}
45+
46+
if ( pvecVal && (pvecVal->size() > 0) ) {
47+
std::vector<void*>::iterator iter;
48+
//for ( iter = pvecVal->begin(); iter != pvecVal->end(); iter++ ) {
49+
// __LOGT__( TAG, "inBackground(): str -> %s", (char*)(*iter) );
50+
//}
51+
52+
__LOGT__( TAG, "inBackground(): str[0] -> %s", (char*)(*pvecVal)[0] );
53+
__LOGT__( TAG, "inBackground(): str[1] -> %s", (char*)(*pvecVal)[1] );
54+
__LOGT__( TAG, "inBackground(): str[2] -> %d", (int)(*pvecVal)[2] );
55+
__LOGT__( TAG, "inBackground(): str[3] -> %s", (char*)(*pvecVal)[3] );
56+
}
57+
58+
return ((void*)true);
59+
}
60+
61+
void Cxxx::progressUpdate(void* pVal) {
62+
__LOGT__( TAG, "progressUpdate()" );
63+
64+
char* pStr = reinterpret_cast<char*>(pVal);
65+
if ( pStr )
66+
__LOGT__( TAG, "%s", pStr );
67+
}
68+
69+
void Cxxx::postExecute(void* pResult, void* pExtraVal) {
70+
__LOGT__( TAG, "postExecute()" );
71+
72+
int result = reinterpret_cast<int>(pResult);
73+
__LOGT__( TAG, "postExecute(): result = %s", (result? "TRUE" : "FALSE") );
74+
}
3475
-------------------------------------------------------------- */
3576

3677

libs/util/CToastMsgDlg.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Author: Ho-Jung Kim (godmode2k@hotmail.com)
55
Date: Since Nov 28, 2014
66
Filename: CToastMsgDlg.cpp
77
8-
Last modified: Jan 22, 2015
8+
Last modified: May 28, 2015
99
License:
1010
1111
*
@@ -195,7 +195,7 @@ bool CToastMsgDlg::show(GtkWindow* pWindow, gpointer user_data,
195195
//__LOGT__( TAG, "show()" );
196196

197197
if ( get_working() ) {
198-
__LOGT__( TAG, "show(): working... SKIP" );
198+
//__LOGT__( TAG, "show(): working... SKIP" );
199199
return false;
200200
}
201201

@@ -328,14 +328,14 @@ bool CToastMsgDlg::show(GtkWindow* pWindow, gpointer user_data,
328328
//__LOGT__( TAG, "show(): new toast window x = %d, y = %d", msgWindow_x, msgWindow_y );
329329

330330
msgWindow_x += DEFAULT_TOAST_WINDOW_WIDTH_CENTER_POS( windowSize.width, msgWindowSize.width );
331-
if ( pos == e_toastMsgShowDelay_TOP ) {
331+
if ( pos == e_toastMsgShowPos_TOP ) {
332332
// None
333333
}
334-
else if ( pos == e_toastMsgShowDelay_BOTTOM ) {
334+
else if ( pos == e_toastMsgShowPos_BOTTOM ) {
335335
msgWindow_y += DEFAULT_TOAST_WINDOW_BOTTOM_POS( windowSize.height, msgWindowSize.height );
336336
}
337337
else {
338-
// e_toastMsgShowDelay_CENTER
338+
// e_toastMsgShowPos_CENTER
339339
// ...
340340

341341
msgWindow_y += DEFAULT_TOAST_WINDOW_HEIGHT_CENTER_POS( windowSize.height, msgWindowSize.height );

libs/util/CToastMsgDlg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Author: Ho-Jung Kim (godmode2k@hotmail.com)
88
Date: Since Nov 28, 2014
99
Filename: CToastMsgDlg.h
1010
11-
Last modified: Jan 6, 2015
11+
Last modified: May 28, 2015
1212
License:
1313
1414
*
@@ -114,9 +114,9 @@ typedef enum _e_ToastMsgShowDelay_t {
114114
} e_ToastMsgShowDelay_t;
115115

116116
typedef enum _e_ToastMsgShowPosition_t {
117-
e_toastMsgShowDelay_TOP = 0,
118-
e_toastMsgShowDelay_CENTER,
119-
e_toastMsgShowDelay_BOTTOM
117+
e_toastMsgShowPos_TOP = 0,
118+
e_toastMsgShowPos_CENTER,
119+
e_toastMsgShowPos_BOTTOM
120120
} e_ToastMsgShowPos_t;
121121

122122
#ifdef __cplusplus
@@ -226,7 +226,7 @@ class CToastMsgDlg : public CThreadTask {
226226

227227
virtual bool show(GtkWindow* pWindow, gpointer user_data = NULL,
228228
const char* msg = NULL, e_ToastMsgShowDelay_t delay = e_toastMsgShowDelay_SHORT,
229-
e_ToastMsgShowPos_t pos = e_toastMsgShowDelay_CENTER);
229+
e_ToastMsgShowPos_t pos = e_toastMsgShowPos_CENTER);
230230
virtual void task_in_thread(void);
231231
void destroy_ui(void);
232232
void stop(void);

0 commit comments

Comments
 (0)