1313static gchar * path ; // 검사 파일경로 //
1414static gchar * name ; // 등록 유저이름 //
1515static gchar * job ; // 등록 직급이름 //
16- static gchar * vs_dept ; // 등록 부서이름 //
16+ static gchar * vs_dept ; // 등록 부서이름 //
1717
1818static int chk_fcnt = -1 ; // 파일개수 cnt //
1919static char chk_fname [100 ]; // 정규식돌고있는 파일이름 //
2020static char chk_fpath [1024 ]; // 검출 결과에서 선택한 파일경로 //
21- static char chk_uuid [40 ]; // UUID 저장 //
21+ static char chk_uuid [40 ]; // UUID 저장 //
2222static uint chk_fsize ; // 검출 결과에서 선택한 파일크기 //
23- static int chk_df = 0 ; // chk data flag //
24- static const char * chk_ver ; // chk version //
23+ static int chk_df = 0 ; // chk data flag //
24+ static const char * chk_ver ; // chk version //
2525
26- GtkBuilder * builder ;
2726
2827GtkWidget * main_window ,
2928 * m_userinfo_label ,
@@ -32,20 +31,27 @@ GtkWidget *main_window,
3231 * e_jobtitle_cbxtext ,
3332 * e_verion_label ,
3433 * detect_window ,
35- * setting_window ,
3634 * department_window ,
3735 * d_progressbar_status ,
3836 * d_progressbar ,
37+ * setting_window ,
3938 * window ;
4039
4140GtkEntry * e_name_entry ,
42- * e_jobtitle_entry ,
43- * e_department_entry ,
44- * d_detect_entry ;
41+ * e_jobtitle_entry ,
42+ * e_department_entry ,
43+ * d_detect_entry ,
44+ * s_detect_entry ,
45+ * s_ip_entry ,
46+ * s_port_entry ;
4547
4648GtkScrolledWindow * d_scrolledwindow ,
4749 * dept_scrolledwindow ;
4850
51+ GtkWidget * filechooserdialog ;
52+
53+ GtkBuilder * builder ;
54+
4955
5056char * b64_encode (const unsigned char * src , size_t len , char * enc );
5157
@@ -63,7 +69,7 @@ void e_name_entry_activate (GtkEntry *e_name_entry, gpointer *data);
6369static GtkTreeModel * e_create_and_fill_model (void );
6470static GtkWidget * e_create_view_and_model (void );
6571
66- gboolean e_view_selection_func (GtkTreeSelection * selection ,
72+ gboolean e_view_selection_func (GtkTreeSelection * selection ,
6773 GtkTreeModel * model ,
6874 GtkTreePath * path ,
6975 gboolean path_currently_selected ,
@@ -83,7 +89,7 @@ void d_folder_btn_clicked (GtkButton *d_folder_btn, gpointer *data);
8389void d_close_btn_clicked (GtkButton * d_close_btn , gpointer * data );
8490void d_detect_entry_activate (GtkEntry * d_detect_entry , gpointer * data );
8591
86- gboolean d_view_selection_func (GtkTreeSelection * selection ,
92+ gboolean d_view_selection_func (GtkTreeSelection * selection ,
8793 GtkTreeModel * model ,
8894 GtkTreePath * path ,
8995 gboolean path_currently_selected ,
@@ -94,7 +100,13 @@ static GtkWidget *d_create_view_and_model (void);
94100/* end of detect_window */
95101
96102// setting_window #sf //
103+ void s_ok_btn_clicked (GtkButton * s_ok_btn , gpointer * data );
97104void s_cloese_btn_clicked (GtkButton * s_cloese_btn , gpointer * data );
105+ void s_folder_btn_clicked (GtkButton * s_folder_btn , gpointer * data );
106+ void s_usrchg_btn_clicked (GtkButton * s_usrchg_btn , gpointer * data );
107+ void s_detect_entry_activate (GtkEntry * s_detect_entry , gpointer * data );
108+ void s_ip_entry_activate (GtkEntry * s_ip_entry , gpointer * data );
109+ void s_port_entry_activate (GtkEntry * s_port_entry , gpointer * data );
98110/* end of setting_window */
99111
100112
@@ -116,12 +128,12 @@ int func_UsrChk()
116128
117129 if (chk_df == 1 )
118130 {
119- gtk_widget_show (enrollment_window ); // 사용자 등록 창 //
131+ gtk_widget_show (enrollment_window ); // 사용자 등록 창 //
120132 gtk_main ();
121133 }
122134 if (chk_df == 2 )
123135 {
124- gtk_widget_show (main_window ); // 메인 창 //
136+ gtk_widget_show (main_window ); // 메인 창 //
125137 gtk_main ();
126138 }
127139
@@ -973,32 +985,30 @@ void d_detect_entry_activate (GtkEntry *d_detect_entry, gpointer *data)
973985{
974986 path = (gchar * )gtk_entry_get_text (d_detect_entry );
975987 g_print ("선택한 폴더 위치: %s\n" , path );
976-
988+
977989 return ;
978990}
979991
980992
981993void d_folder_btn_clicked (GtkButton * d_folder_btn , gpointer * data )
982994{
983- GtkWidget * d_filechooserdialog ;
984-
985- d_filechooserdialog = gtk_file_chooser_dialog_new ("Open File" , GTK_WINDOW (data ), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ,
995+ filechooserdialog = gtk_file_chooser_dialog_new ("Open File" , GTK_WINDOW (data ), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ,
986996 ("_선택" ), GTK_RESPONSE_ACCEPT , NULL );
987997
988- gtk_widget_show_all (d_filechooserdialog );
998+ gtk_widget_show_all (filechooserdialog );
989999
990- gint resp = gtk_dialog_run (GTK_DIALOG (d_filechooserdialog ));
1000+ gint resp = gtk_dialog_run (GTK_DIALOG (filechooserdialog ));
9911001
9921002 if ( resp == GTK_RESPONSE_ACCEPT )
9931003 {
994- gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (d_filechooserdialog ));
1004+ gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooserdialog ));
9951005 }
996- path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (d_filechooserdialog ));
1006+ path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooserdialog ));
9971007
9981008 gtk_entry_set_text (GTK_ENTRY (data ), path );
9991009
10001010
1001- gtk_widget_destroy (d_filechooserdialog );
1011+ gtk_widget_destroy (filechooserdialog );
10021012
10031013 g_print ("선택한 폴더 위치: %s\n" , path );
10041014
@@ -1295,10 +1305,10 @@ enum
12951305
12961306gboolean
12971307e_view_selection_func (GtkTreeSelection * selection ,
1298- GtkTreeModel * model ,
1299- GtkTreePath * path ,
1300- gboolean path_currently_selected ,
1301- gpointer userdata )
1308+ GtkTreeModel * model ,
1309+ GtkTreePath * path ,
1310+ gboolean path_currently_selected ,
1311+ gpointer userdata )
13021312{
13031313 GtkTreeIter iter ;
13041314
@@ -1428,8 +1438,8 @@ e_create_view_and_model (void)
14281438{
14291439 GtkTreeViewColumn * e_col ;
14301440 GtkCellRenderer * e_renderer ;
1431- GtkWidget * e_view ;
1432- GtkTreeModel * e_model ;
1441+ GtkWidget * e_view ;
1442+ GtkTreeModel * e_model ;
14331443 GtkTreeSelection * e_selection ;
14341444
14351445 e_view = gtk_tree_view_new ();
@@ -1514,6 +1524,66 @@ void e_enroll_btn_clicked (GtkButton *e_enroll_btn, gpointer *data)
15141524
15151525
15161526// setting_window function #sf //
1527+ void s_ip_entry_activate (GtkEntry * s_ip_entry , gpointer * data )
1528+ {
1529+ char * hostname ;
1530+ hostname = (gchar * )gtk_entry_get_text (s_ip_entry );
1531+ g_print ("선택한 폴더 위치: %s\n" , hostname );
1532+
1533+ return ;
1534+ }
1535+
1536+ void s_port_entry_activate (GtkEntry * s_port_entry , gpointer * data )
1537+ {
1538+ char * port ;
1539+ port = (gchar * )gtk_entry_get_text (s_port_entry );
1540+ g_print ("선택한 폴더 위치: %s\n" , port );
1541+
1542+ return ;
1543+ }
1544+
1545+ void s_detect_entry_activate (GtkEntry * s_detect_entry , gpointer * data )
1546+ {
1547+ path = (gchar * )gtk_entry_get_text (s_detect_entry );
1548+ g_print ("선택한 폴더 위치: %s\n" , path );
1549+
1550+ return ;
1551+ }
1552+
1553+ void s_folder_btn_clicked (GtkButton * s_folder_btn , gpointer * data )
1554+ {
1555+ filechooserdialog = gtk_file_chooser_dialog_new ("Open File" , GTK_WINDOW (data ), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ,
1556+ ("_선택" ), GTK_RESPONSE_ACCEPT , NULL );
1557+
1558+ gtk_widget_show_all (filechooserdialog );
1559+
1560+ gint resp = gtk_dialog_run (GTK_DIALOG (filechooserdialog ));
1561+
1562+ if ( resp == GTK_RESPONSE_ACCEPT )
1563+ {
1564+ gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooserdialog ));
1565+ }
1566+ path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooserdialog ));
1567+
1568+ gtk_entry_set_text (GTK_ENTRY (data ), path );
1569+
1570+
1571+ gtk_widget_destroy (filechooserdialog );
1572+
1573+ g_print ("선택한 폴더 위치: %s\n" , path );
1574+
1575+ return ;
1576+ }
1577+ void s_usrchg_btn_clicked (GtkButton * s_usrchg_btn , gpointer * data );
1578+
1579+
1580+ void s_ok_btn_clicked (GtkButton * s_ok_btn , gpointer * data )
1581+ {
1582+ gtk_widget_show (main_window );
1583+
1584+ return ;
1585+ }
1586+
15171587void s_cloese_btn_clicked (GtkButton * setting_window , gpointer * data )
15181588{
15191589 gtk_widget_hide (GTK_WIDGET (data ));
@@ -1553,7 +1623,7 @@ int main (int argc, char *argv[])
15531623 func_SetRabbit (); // 서버와 연결 //
15541624 func_VerChk (); // 버전 확인 //
15551625 func_UsrChk (); // 사용자 확인 //
1556- func_Uuid (); // 사용자 UUID //
1626+ func_Uuid (); // 사용자 UUID //
15571627
15581628 g_object_unref (builder );
15591629
0 commit comments