diff --git a/dhcp_tools/main.h b/dhcp_tools/main.h index a2d04bf..5a116f5 100644 --- a/dhcp_tools/main.h +++ b/dhcp_tools/main.h @@ -18,6 +18,7 @@ typedef enum { COL_RESULT, COL_STATUS, + COL_ATTR_EDITABLE, NUM_COLS } COL_NAME; diff --git a/dhcp_tools/main_wnd.c b/dhcp_tools/main_wnd.c index 0285933..f4d79a2 100644 --- a/dhcp_tools/main_wnd.c +++ b/dhcp_tools/main_wnd.c @@ -54,14 +54,12 @@ static double calc_total_progress(PDHCP_INFO pInfo) { return pre_cnt; } -static double calc_step_progress(PDHCP_INFO pInfo, DHCP_STEP step) { - double pre_cnt = 0.0; - +static gboolean calc_step_progress(PDHCP_INFO pInfo, DHCP_STEP step) { if (pInfo && pInfo->step == step) { - pre_cnt += pInfo->status * 5; + return TRUE; } - return pre_cnt; + return FALSE; } static void tree_view_data_store_create() { @@ -99,6 +97,7 @@ static void tree_view_data_store_create() { COL_ACK, calc_step_progress(pInfo, STEP_ACK), COL_RESULT, "", COL_STATUS, calc_total_progress(pInfo), + COL_ATTR_EDITABLE, FALSE, -1); // clang-format on } @@ -179,6 +178,7 @@ static gboolean tree_view_data_store_upgade(gpointer pInfo) { COL_ACK, calc_step_progress(pInfo, STEP_ACK), COL_RESULT, "", COL_STATUS, calc_total_progress(pInfo), + COL_ATTR_EDITABLE, FALSE, -1); // clang-format on } @@ -397,7 +397,7 @@ int main(int args, char **argv) { GtkWidget *macTxt = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "txtMacStart")); GtkWidget *numInc = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbReqNum")); - GtkAdjustment *adj = gtk_adjustment_new(1000, 1, 100000, 1, 0, 0); + GtkAdjustment *adj = gtk_adjustment_new(1, 1, 100000, 1, 0, 0); gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(numInc), adj); GtkWidget *numVni = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbVni")); diff --git a/dhcp_tools/res/main.glade b/dhcp_tools/res/main.glade index 0108787..7765b2e 100644 --- a/dhcp_tools/res/main.glade +++ b/dhcp_tools/res/main.glade @@ -2,6 +2,12 @@ + + + + + + @@ -11,23 +17,19 @@ - + - + - + - + - - - - - - + + @@ -389,7 +391,6 @@ both - 32 Index 0.5 @@ -402,7 +403,6 @@ - 128 MAC 0.5 @@ -415,7 +415,6 @@ - 64 Hostname 0.5 @@ -428,58 +427,60 @@ - autosize - 64 - 96 - Discover + fixed + 32 + D 0.5 - + - 3 + 9 + 3 - autosize - 64 - 96 - Offer + fixed + 32 + O 0.5 - + - 4 + 9 + 4 - autosize - 96 - Request + fixed + 32 + R 0.5 - + - 5 + 9 + 5 - autosize - 96 - ACK + fixed + 32 + A 0.5 - + - 6 + 9 + 6 @@ -487,7 +488,7 @@ fixed - 200 + 400 Result 0.5 @@ -501,10 +502,8 @@ fixed - 64 - 64 - 64 - Totol Progress + 32 + Progress 0.5