Skip to content

Commit 50aaa10

Browse files
author
root
committed
[Client]progressbar update
1 parent fc2983d commit 50aaa10

File tree

4 files changed

+104
-71
lines changed

4 files changed

+104
-71
lines changed

src/glade/bxr_plover

24 Bytes
Binary file not shown.

src/glade/main.c

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,30 @@
2323
#include "decode.c"
2424

2525
#define MAX_ERROR_MSG 0x1000
26-
#define MAX_CNTF 50 // 최대 검출 파일 개수 //
26+
#define MAX_CNTF 50 // 최대 검출 파일 개수 //
2727

2828
typedef struct Data_storage
2929
{
30-
char fname[20]; // 파일 이름 //
31-
uint jcnt; // 주민번호 개수 //
32-
uint dcnt; // 운전면허 개수 //
33-
uint fgcnt; // 외국인등록번호 개수 //
34-
uint pcnt; // 여권번호 개수 //
35-
uint fsize; // 파일 크기 //
36-
char stat; // 파일 상태 //
37-
char fpath[300]; // 파일 경로 //
30+
char fname[20]; // 파일 이름 //
31+
uint jcnt; // 주민번호 개수 //
32+
uint dcnt; // 운전면허 개수 //
33+
uint fgcnt; // 외국인등록번호 개수 //
34+
uint pcnt; // 여권번호 개수 //
35+
uint fsize; // 파일 크기 //
36+
char stat; // 파일 상태 //
37+
char fpath[300]; // 파일 경로 //
3838

3939

4040
}data_storage;
4141

42-
data_storage ds[MAX_CNTF]; // 파일기준의 data구조체 //
42+
data_storage ds[MAX_CNTF]; // 파일기준의 data구조체 //
4343

44-
static gchar *path; // 파일경로 //
45-
static int cntf = 0; // 파일개수 cnt //
46-
static char chkfname[20];
47-
static int chk_tf; // chk_true or false //
48-
//uint data_flag = 1; // 어떤종류의 민감정보인지 확인하기위한 flag //
44+
static gchar *path; // 검사 파일경로 //
45+
static gchar *vsf_path; // 검사결과 리스트 선택 파일경로 //
46+
static int cntf = 0; // 파일개수 cnt //
47+
static char chk_fname[20]; // 정규식돌고있는 파일이름 //
48+
static int chk_tf; // chk_true or false //
49+
//uint data_flag = 1; // 민감정보 종류 확인 flag //
4950

5051

5152
GtkWidget *detect_window,
@@ -72,11 +73,11 @@ void d_folder_btn_clicked (GtkButton *d_folder_btn, gpointer *data);
7273
void d_close_btn_clicked (GtkButton *d_close_btn, gpointer *data);
7374
void d_detect_entry_activate (GtkEntry *d_detect_entry, gpointer *data);
7475

75-
gboolean view_selection_func (GtkTreeSelection *selection,
76-
GtkTreeModel *model,
77-
GtkTreePath *path,
78-
gboolean path_currently_selected,
79-
gpointer userdata);
76+
gboolean view_selection_func (GtkTreeSelection *selection,
77+
GtkTreeModel *model,
78+
GtkTreePath *path,
79+
gboolean path_currently_selected,
80+
gpointer userdata);
8081

8182
static GtkTreeModel *create_and_fill_model (void);
8283
static GtkWidget *create_view_and_model (void);
@@ -179,15 +180,15 @@ char match_regex_jnfg (regex_t *r, const char *to_match, char *filepath, struct
179180
// 주민번호 유효성 통과 //
180181
if (jtmp == chk)
181182
{
182-
int res = strcmp(chkfname, file->d_name); // 같은파일 = 0 //
183+
int res = strcmp(chk_fname, file->d_name); // 같은파일 = 0 //
183184

184185
if (res != 0)
185186
{
186187
cntf++;
187188
}
188189

189190
// 읽고있는중인 파일 이름 저장 //
190-
strcpy(chkfname, file->d_name);
191+
strcpy(chk_fname, file->d_name);
191192

192193
// 검출된 주민등록번호의 수 //
193194
ds[cntf].jcnt++;
@@ -204,15 +205,15 @@ char match_regex_jnfg (regex_t *r, const char *to_match, char *filepath, struct
204205
// 외국인등록번호 유효성 통과 //
205206
if (fgtmp == chk)
206207
{
207-
int res = strcmp(chkfname, file->d_name); // 같은파일 = 0 //
208+
int res = strcmp(chk_fname, file->d_name); // 같은파일 = 0 //
208209

209210
if (res != 0)
210211
{
211212
cntf++;
212213
}
213214

214215
// 읽고있는중인 파일 이름 저장 //
215-
strcpy(chkfname, file->d_name);
216+
strcpy(chk_fname, file->d_name);
216217

217218
// 검출된 외국인등록번호의 수 //
218219
ds[cntf].fgcnt++;
@@ -268,15 +269,15 @@ char match_regex_d (regex_t *r, const char *to_match, char *filepath, struct dir
268269
//운전면허 정규식 검사 통과//
269270
if (i == 0)
270271
{
271-
int res = strcmp(chkfname, file->d_name); //같은파일 = 0 //
272+
int res = strcmp(chk_fname, file->d_name); //같은파일 = 0 //
272273

273274
if (res != 0)
274275
{
275276
cntf++;
276277
}
277278

278279
// 읽고있는중인 파일 이름 저장 //
279-
strcpy(chkfname, file->d_name);
280+
strcpy(chk_fname, file->d_name);
280281

281282
// 검출된 운전면허의 수 //
282283
ds[cntf].dcnt++;
@@ -332,15 +333,15 @@ char match_regex_p (regex_t *r, const char *to_match, char *filepath, struct dir
332333
// 운전면허 정규식 검사 통과 //
333334
if (i == 0)
334335
{
335-
int res = strcmp(chkfname, file->d_name); // 같은파일 = 0 //
336+
int res = strcmp(chk_fname, file->d_name); // 같은파일 = 0 //
336337

337338
if (res != 0)
338339
{
339340
cntf++;
340341
}
341342

342343
// 읽고있는중인 파일 이름 저장 //
343-
strcpy(chkfname, file->d_name);
344+
strcpy(chk_fname, file->d_name);
344345

345346
// 검출된 운전면허의 수 //
346347
ds[cntf].pcnt++;
@@ -465,7 +466,7 @@ int scan_dir (gchar *path)
465466
memset(buffer, 0, sizeof(buffer));
466467
fclose(fp);
467468
printf("Close FILE\n");
468-
chkfname[0] = 0; // 초기화 //
469+
chk_fname[0] = 0; // 초기화 //
469470
}
470471
}
471472
closedir(dp);
@@ -807,21 +808,19 @@ view_selection_func (GtkTreeSelection *selection,
807808

808809
if (gtk_tree_model_get_iter(model, &iter, path))
809810
{
810-
gchar *name;
811-
812-
gtk_tree_model_get(model, &iter, d_treeview_filelocation, &name, -1);
811+
gtk_tree_model_get(model, &iter, d_treeview_filelocation, &vsf_path, -1);
813812

814813
if (!path_currently_selected)
815814
{
816-
g_print ("%s is going to be selected.\n", name);
815+
g_print ("%s 선택.\n", vsf_path);
817816
}
818817

819818
else
820819
{
821-
g_print ("%s is going to be unselected.\n", name);
820+
g_print ("%s 선택 해제.\n", vsf_path);
822821
}
823822

824-
g_free(name);
823+
g_free(vsf_path);
825824
}
826825

827826
return TRUE; /* allow selection state to change */

src/glade/main.glade

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<property name="can_focus">False</property>
4242
<child>
4343
<object class="GtkEntry" id="d_detect_entry">
44-
<property name="width_request">272</property>
44+
<property name="width_request">267</property>
4545
<property name="height_request">40</property>
4646
<property name="visible">True</property>
4747
<property name="can_focus">True</property>
@@ -50,7 +50,7 @@
5050
<signal name="activate" handler="d_detect_entry_activate" swapped="no"/>
5151
</object>
5252
<packing>
53-
<property name="x">120</property>
53+
<property name="x">125</property>
5454
<property name="y">154</property>
5555
</packing>
5656
</child>
@@ -168,6 +168,7 @@
168168
<property name="height_request">270</property>
169169
<property name="visible">True</property>
170170
<property name="can_focus">True</property>
171+
<property name="margin_bottom">36</property>
171172
<property name="shadow_type">in</property>
172173
<child>
173174
<placeholder/>
@@ -178,6 +179,19 @@
178179
<property name="y">10</property>
179180
</packing>
180181
</child>
182+
<child>
183+
<object class="GtkProgressBar" id="d_progressbar">
184+
<property name="width_request">620</property>
185+
<property name="height_request">30</property>
186+
<property name="visible">True</property>
187+
<property name="can_focus">False</property>
188+
<property name="show_text">True</property>
189+
</object>
190+
<packing>
191+
<property name="x">20</property>
192+
<property name="y">280</property>
193+
</packing>
194+
</child>
181195
</object>
182196
<packing>
183197
<property name="expand">False</property>
@@ -206,6 +220,7 @@
206220
</object>
207221
<packing>
208222
<property name="x">148</property>
223+
<property name="y">9</property>
209224
</packing>
210225
</child>
211226
<child>
@@ -223,6 +238,7 @@
223238
</object>
224239
<packing>
225240
<property name="x">272</property>
241+
<property name="y">9</property>
226242
</packing>
227243
</child>
228244
<child>
@@ -240,6 +256,7 @@
240256
</object>
241257
<packing>
242258
<property name="x">396</property>
259+
<property name="y">9</property>
243260
</packing>
244261
</child>
245262
<child>
@@ -252,7 +269,7 @@
252269
</object>
253270
<packing>
254271
<property name="x">150</property>
255-
<property name="y">2</property>
272+
<property name="y">10</property>
256273
</packing>
257274
</child>
258275
<child>
@@ -265,7 +282,7 @@
265282
</object>
266283
<packing>
267284
<property name="x">274</property>
268-
<property name="y">2</property>
285+
<property name="y">10</property>
269286
</packing>
270287
</child>
271288
<child>
@@ -278,7 +295,7 @@
278295
</object>
279296
<packing>
280297
<property name="x">398</property>
281-
<property name="y">2</property>
298+
<property name="y">10</property>
282299
</packing>
283300
</child>
284301
</object>

0 commit comments

Comments
 (0)