Lines 347-353
Link Here
|
347 |
int flag = 0; |
347 |
int flag = 0; |
348 |
static harglst * hosts = NULL; |
348 |
static harglst * hosts = NULL; |
349 |
int v = 1; |
349 |
int v = 1; |
350 |
int newmax=0; |
350 |
|
351 |
if(!hosts) |
351 |
if(!hosts) |
352 |
{ |
352 |
{ |
353 |
hosts = harg_create(65000); |
353 |
hosts = harg_create(65000); |
Lines 376-389
Link Here
|
376 |
if (GTK_CHECK_VERSION(2,6,0)) { /* TreeView since GTK 2.6 */ |
376 |
if (GTK_CHECK_VERSION(2,6,0)) { /* TreeView since GTK 2.6 */ |
377 |
GtkListStore * store = arg_get_value(ctrls, "MON_STORE"); |
377 |
GtkListStore * store = arg_get_value(ctrls, "MON_STORE"); |
378 |
GtkTreeIter iter; |
378 |
GtkTreeIter iter; |
379 |
if (max==0){ |
379 |
int f; |
380 |
newmax=1; |
380 |
if (max == 0) { |
381 |
}else{ |
381 |
f = 100; |
382 |
newmax=max; |
382 |
} else { |
|
|
383 |
f = (atoi(current) / max) * 100; |
384 |
if(f>=100)f=100; |
385 |
if(f<=0)f=0; |
383 |
} |
386 |
} |
384 |
int f = (atoi(current) * 100) / newmax; |
|
|
385 |
if(f>=100)f=100; |
386 |
if(f<=0)f=0; |
387 |
|
387 |
|
388 |
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
388 |
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
389 |
do { |
389 |
do { |
Lines 420-435
Link Here
|
420 |
GtkWidget * progress_bar; |
420 |
GtkWidget * progress_bar; |
421 |
gfloat f; |
421 |
gfloat f; |
422 |
|
422 |
|
|
|
423 |
gmax = max; |
424 |
if (gmax == 0) { |
425 |
f = 1.0; |
426 |
} else { |
427 |
gcurrent = atoi(current); |
428 |
f = (gcurrent/gmax); |
429 |
if(f>=1.0)f=1.0; |
430 |
if(f<=0.0)f=0.0; |
431 |
} |
432 |
|
423 |
if( strcmp(action, "portscan") == 0 ) |
433 |
if( strcmp(action, "portscan") == 0 ) |
424 |
progress_bar = gtk_object_get_data(item, "progress_bar_portscan"); |
434 |
progress_bar = gtk_object_get_data(item, "progress_bar_portscan"); |
425 |
else |
435 |
else |
426 |
progress_bar = gtk_object_get_data(item, "progress_bar_attack"); |
436 |
progress_bar = gtk_object_get_data(item, "progress_bar_attack"); |
427 |
|
437 |
|
428 |
gmax = max; |
|
|
429 |
gcurrent = atoi(current); |
430 |
f = (gcurrent/gmax); |
431 |
if(f>=1.0)f=1.0; |
432 |
if(f<=0.0)f=0.0; |
433 |
gtk_progress_bar_update (GTK_PROGRESS_BAR(progress_bar), f); |
438 |
gtk_progress_bar_update (GTK_PROGRESS_BAR(progress_bar), f); |
434 |
|
439 |
|
435 |
flag = 1; |
440 |
flag = 1; |