~ubuntu-branches/ubuntu/gutsy/avscan/gutsy-security

« back to all changes in this revision

Viewing changes to avscan/win.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2006-08-31 18:52:27 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060831185227-ol7ren8qsenrzlvh
Tags: 0.8.5-openssl-1
* New upstream release.
* Register html documentation with doc-base.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
void WinScanProcessStart(
72
72
        win_struct *win,
73
73
        const gchar *db_location,       /* Virus Scanner Database Location */
74
 
        const gchar *location,          /* Location of object to scan */
 
74
        GList *paths_list,              /* List of paths to scan */
75
75
        const avscan_options options
76
76
);
77
77
void WinScanProcessStop(win_struct *win);
83
83
/* Scan List & Settings Update */
84
84
void WinScanListOpenFromFile(win_struct *win, const gchar *path);
85
85
void WinScanSettingsUpdate(win_struct *win, const obj_struct *obj);
86
 
void WinResultsLocationUpdate(win_struct *win, const gchar *location);
 
86
void WinResultsLocationUpdate(win_struct *win, GList *paths_list);
87
87
 
88
88
/* Operation IDs */
89
89
win_opid_struct *WinOPIDNew(
120
120
void WinStatusTime(
121
121
        win_struct *win, const gulong t, gboolean allow_gtk_iteration
122
122
);
123
 
gboolean WinIsMapped(win_struct *win);          
124
 
void WinMap(win_struct *win);         
 
123
gboolean WinIsMapped(win_struct *win);
 
124
void WinMap(win_struct *win);
125
125
void WinUnmap(win_struct *win);
126
126
void WinDelete(win_struct *win);
127
127
 
166
166
        /* Delete stdout & stderr files */
167
167
        if(win->stdout_path != NULL)      
168
168
        {
169
 
            unlink(win->stdout_path);  
 
169
            unlink(win->stdout_path);
170
170
            g_free(win->stdout_path);
171
171
            win->stdout_path = NULL;
172
172
        }
182
182
 *      Starts the scan process.
183
183
 *
184
184
 *      Any current scan process will be stopped first.
 
185
 *
 
186
 *      The db_location specifies the full path to the Virus Scanner
 
187
 *      Database. If this value is NULL then the CFG_PARM_DB_LOCATION
 
188
 *      value from the configuration will be used instead.
 
189
 *
 
190
 *      The paths_list specifies the list of full paths to the locations
 
191
 *      to scan.
 
192
 *
 
193
 *      The options specifies the scan options.
185
194
 */
186
195
void WinScanProcessStart(
187
196
        win_struct *win,
188
197
        const gchar *db_location,       /* Virus Scanner Database Location */
189
 
        const gchar *location,          /* Location of object to scan */
 
198
        GList *paths_list,              /* List of paths to scan */
190
199
        const avscan_options options
191
200
)
192
201
{
193
202
        const gulong start_time = (gulong)time(NULL);
194
203
        gint fd;
195
 
        const gchar *tmp_dir;
196
 
        gchar *cmd;
 
204
        const gchar *tmp_dir, *path;
 
205
        gchar *cmd, *cmd_next;
 
206
        GList *glist;
197
207
        const cfg_item_struct *cfg_list;
198
208
        GtkWidget *toplevel;
199
209
        core_struct *core;
240
250
        WinScanProcessStop(win);
241
251
 
242
252
        /* Nothing to scan? */
243
 
        if(STRISEMPTY(location))
 
253
        if(paths_list == NULL)
244
254
        {
245
255
#ifdef HAVE_EDV2
246
256
            EDVPlaySoundWarning(core->edv_ctx);
259
269
        }
260
270
 
261
271
        /* Set Results Location */
262
 
        WinResultsLocationUpdate(win, location);
 
272
        WinResultsLocationUpdate(win, paths_list);
263
273
 
264
274
        /* Clear the Results List */
265
275
        WinResultsListClear(win);
300
310
        if(fd > -1)
301
311
            close((int)fd);
302
312
 
303
 
        /* Format scan command */
 
313
        /* Format the scan command */
304
314
        cmd = g_strdup_printf(
305
 
            "\"%s\" --scan \"%s\"%s%s%s --database \"%s\"",
306
 
            core->prog_path, location,
 
315
            "\"%s\" --scan%s%s%s --database \"%s\"",
 
316
            core->prog_path,
307
317
            (options & AVSCAN_OPT_RECURSIVE) ?
308
318
                " --recursive" : "",
309
319
            (options & AVSCAN_OPT_EXECUTABLES_ONLY) ?
312
322
                " --ignore-links" : "",
313
323
            db_location
314
324
        );
 
325
        for(glist = paths_list; glist != NULL; glist = g_list_next(glist))
 
326
        {
 
327
            path = (const gchar *)glist->data;
 
328
            if(STRISEMPTY(path))
 
329
                continue;
 
330
 
 
331
            cmd_next = g_strconcat(cmd, " \"", path, "\"", NULL);
 
332
            g_free(cmd);
 
333
            cmd = cmd_next;
 
334
        }
315
335
 
316
336
        /* Run the scan command */
317
337
        win->scan_pid = (gint)ExecOE(
363
383
}
364
384
 
365
385
/*
366
 
 *      Interrupts the Win's scan process and deletes stdout and stderr
367
 
 *      files.
 
386
 *      Stops the scanning process and cleans up.
 
387
 *
 
388
 *      Stops the scan icon animation.
 
389
 *
 
390
 *      Removes the scan monitoring timeout.
 
391
 *
 
392
 *      Sends SIGINT to the scanning process.
 
393
 *
 
394
 *      Deletes the output files.
 
395
 *
 
396
 *      Resets the status bar and scan values.
 
397
 *
 
398
 *      Marks the Win as no longer passive busy (ready).
368
399
 */
369
400
void WinScanProcessStop(win_struct *win)
370
401
{
382
413
            win->scan_toid = 0;
383
414
        }
384
415
 
385
 
        /* Interrupt the scan child process */
 
416
        /* Interrupt the scan (child) process
 
417
         *
 
418
         * Sending SIGINT to the scan process will increment its stop
 
419
         * count in the signal callback but it will not exit()
 
420
         * immediately, instead it will wait for the current (if any)
 
421
         * ClamAV call to finish and continue to execute without calling
 
422
         * any additional ClamAV calls except AVScanOPClamAVShutdown()
 
423
         * in order to shut down ClamAV nicely (so that there are no
 
424
         * ClamAV tempory files) and finish execution
 
425
         */
386
426
        if(win->scan_pid > 0)
387
427
        {
388
428
            kill(win->scan_pid, SIGINT);
448
488
 
449
489
        toplevel = win->toplevel;
450
490
        core = CORE(win->core);
451
 
        cfg_list = core->cfg_list;             
 
491
        cfg_list = core->cfg_list;
452
492
 
453
493
        /* Interrupt virus database update process and delete stdout
454
494
         * and stderr files
458
498
        /* Check if the virus update program exists */
459
499
        if(stat(prog, &stat_buf))
460
500
        {
461
 
            const gint errnum = (gint)errno;
462
 
            gchar *s, *error_msg = STRDUP(g_strerror(errnum));
 
501
            const gint error_code = (gint)errno;
 
502
            gchar *s, *error_msg = STRDUP(g_strerror(error_code));
463
503
            if(error_msg != NULL)
464
504
            {
465
 
                *error_msg = toupper(*error_msg);
 
505
                *error_msg = (gchar)toupper((int)*error_msg);
466
506
                s = g_strdup_printf(
467
507
"Unable to find the virus database update program:\n\
468
508
\n\
653
693
 */
654
694
gboolean WinUpdateProcessIsRunning(win_struct *win)
655
695
{
656
 
        gint p = (win != NULL) ? win->update_pid : 0;
 
696
        const gint p = (win != NULL) ? win->update_pid : 0;
657
697
        return((p > 0) ? ExecProcessExists((pid_t)p) : FALSE);
658
698
}
659
699
 
694
734
            WinScanListAppend(win, OBJ(glist->data));
695
735
 
696
736
        /* Delete scan list */
697
 
        g_list_free(obj_list);                         
 
737
        g_list_free(obj_list);
698
738
 
699
739
        gtk_clist_thaw(clist);
700
740
 
765
805
/*
766
806
 *      Updates the Win's results location.
767
807
 */
768
 
void WinResultsLocationUpdate(win_struct *win, const gchar *location)
 
808
void WinResultsLocationUpdate(win_struct *win, GList *paths_list)
769
809
{
770
810
        GtkWidget *w;
771
811
 
772
812
        if(win == NULL)
773
 
            return;  
 
813
            return;
774
814
 
775
815
        win->freeze_count++;
776
816
 
777
817
        w = win->results_location_label;
778
818
        if(w != NULL)
779
 
            gtk_label_set_text(
780
 
                GTK_LABEL(w), (location != NULL) ? location : ""
781
 
            );
 
819
        {
 
820
            gchar *s;
 
821
            if(paths_list != NULL)
 
822
            {
 
823
                const gint npaths = g_list_length(paths_list);
 
824
                if(npaths == 1)
 
825
                {
 
826
                    s = STRDUP((const gchar *)paths_list->data);
 
827
                }
 
828
                else
 
829
                {
 
830
                    GList *glist = g_list_last(paths_list);
 
831
                    s = g_strdup_printf(
 
832
                        "..., %s (%i locations)",
 
833
                        (glist != NULL) ? (const gchar *)glist->data : "",
 
834
                        npaths
 
835
                    );
 
836
                }
 
837
            }
 
838
            else
 
839
            {
 
840
                s = STRDUP("");
 
841
            }
 
842
            gtk_label_set_text(GTK_LABEL(w), s);
 
843
            g_free(s);
 
844
        }
782
845
 
783
846
        win->freeze_count--;
784
847
 
897
960
        accel_key = 0;
898
961
        accel_mods = 0;
899
962
        button_icon_data = (guint8 **)icon_add_20x20_xpm;
900
 
        menu_icon_data = button_icon_data;                 
 
963
        menu_icon_data = button_icon_data;
901
964
        func_cb = WinAddCB;
902
965
        DO_APPEND(WIN_OPID_ADD)
903
966
 
1035
1098
 
1036
1099
 
1037
1100
        allow_multiple = FALSE;
1038
 
        item_type = TOOLBAR_ITEM_BUTTON;  
 
1101
        item_type = TOOLBAR_ITEM_BUTTON;
1039
1102
        button_name = "Start";
1040
1103
        menu_name = button_name;
1041
1104
        tooltip = "Start scanning";
1047
1110
        DO_APPEND(WIN_OPID_START)
1048
1111
 
1049
1112
        allow_multiple = FALSE;
1050
 
        item_type = TOOLBAR_ITEM_BUTTON;  
 
1113
        item_type = TOOLBAR_ITEM_BUTTON;
1051
1114
        button_name = "Stop";
1052
1115
        menu_name = button_name;
1053
1116
        tooltip = "Stop the current operation";
1058
1121
        func_cb = WinStopCB;
1059
1122
        DO_APPEND(WIN_OPID_STOP)
1060
1123
 
1061
 
        allow_multiple = FALSE;   
 
1124
        allow_multiple = FALSE;
1062
1125
        item_type = TOOLBAR_ITEM_BUTTON;
1063
1126
        button_name = "Location";
1064
1127
        menu_name = "Location...";
1090
1153
        accel_key = 0;
1091
1154
        accel_mods = 0;
1092
1155
        button_icon_data = NULL;
1093
 
        menu_icon_data = button_icon_data;                         
 
1156
        menu_icon_data = button_icon_data;
1094
1157
        func_cb = WinExecutablesOnlyCB;
1095
1158
        DO_APPEND(WIN_OPID_EXECUTABLES_ONLY)
1096
1159
 
1102
1165
        accel_key = 0;
1103
1166
        accel_mods = 0;
1104
1167
        button_icon_data = NULL;
1105
 
        menu_icon_data = button_icon_data;                         
 
1168
        menu_icon_data = button_icon_data;
1106
1169
        func_cb = WinIgnoreLinksCB;
1107
1170
        DO_APPEND(WIN_OPID_IGNORE_LINKS)
1108
1171
 
1145
1208
 
1146
1209
        allow_multiple = FALSE;
1147
1210
        item_type = TOOLBAR_ITEM_BUTTON;
1148
 
        button_name = "UnselAll";       
1149
 
        menu_name = "Unselect All";  
 
1211
        button_name = "UnselAll";
 
1212
        menu_name = "Unselect All";
1150
1213
        tooltip = "Unselect all objects";
1151
1214
        accel_key = 0;
1152
1215
        accel_mods = 0;
1164
1227
        accel_mods = 0;
1165
1228
        button_icon_data = (guint8 **)icon_select_20x20_xpm; 
1166
1229
        menu_icon_data = NULL;
1167
 
        func_cb = WinResultsInvertSelectionCB;  
 
1230
        func_cb = WinResultsInvertSelectionCB;
1168
1231
        DO_APPEND(WIN_OPID_RESULTS_INVERT_SELECTION)
1169
1232
 
1170
1233
        allow_multiple = FALSE;
1180
1243
        DO_APPEND(WIN_OPID_RESULTS_OPEN)
1181
1244
 
1182
1245
        allow_multiple = FALSE;
1183
 
        item_type = TOOLBAR_ITEM_BUTTON;       
 
1246
        item_type = TOOLBAR_ITEM_BUTTON;
1184
1247
        button_name = "Save As";
1185
1248
        menu_name = "Save As...";
1186
1249
        tooltip = "Save scan results log as";
1330
1393
        button_name = "Update?";
1331
1394
        menu_name = "How To Update";
1332
1395
        tooltip = "Help on updating the virus database";
1333
 
        accel_key = 0;                      
1334
 
        accel_mods = 0;    
 
1396
        accel_key = 0;
 
1397
        accel_mods = 0;
1335
1398
        button_icon_data = (guint8 **)icon_help_20x20_xpm;
1336
1399
        menu_icon_data = NULL;
1337
1400
        func_cb = WinHelpUpdatingCB;
1414
1477
  win->opid, (_id_)                             \
1415
1478
 );                                             \
1416
1479
 if(opid != NULL) {                             \
1417
 
  w = GUIMenuItemCreate(                        \
 
1480
  w = GUIMenuItemCreate(                        \
1418
1481
   menu, GUI_MENU_ITEM_TYPE_LABEL, accelgrp,    \
1419
1482
   (icon_data != NULL) ?                        \
1420
1483
    icon_data : opid->menu_icon_data,           \
1422
1485
   opid->accel_key, opid->accel_mods,           \
1423
1486
   (gpointer *)&menuitem_func_w,                \
1424
1487
   opid->win, opid->func_cb                     \
1425
 
  );                                            \
1426
 
  GUISetMenuItemCrossingCB(                     \
1427
 
   w,                                           \
 
1488
  );                                            \
 
1489
  GUISetMenuItemCrossingCB(                     \
 
1490
   w,                                           \
1428
1491
   (gpointer)opid->enter_func_cb, opid,         \
1429
1492
   (gpointer)opid->leave_func_cb, opid          \
1430
 
  );                                            \
 
1493
  );                                            \
1431
1494
 }                                              \
1432
1495
 else                                           \
1433
1496
  w = NULL;                                     \
1454
1517
  );                                            \
1455
1518
 }                                              \
1456
1519
 else                                           \
1457
 
  w = NULL;                                     \
 
1520
  w = NULL;                                     \
1458
1521
}
1459
1522
 
1460
1523
#define DO_ADD_MENU_SEP         {               \
1461
1524
 w = GUIMenuItemCreate(                         \
1462
 
  menu, GUI_MENU_ITEM_TYPE_SEPARATOR, NULL,     \
1463
 
  NULL, NULL, 0, 0, NULL,                       \
 
1525
  menu, GUI_MENU_ITEM_TYPE_SEPARATOR, NULL,     \
 
1526
  NULL, NULL, 0, 0, NULL,                       \
1464
1527
  NULL, NULL                                    \
1465
 
 );                                             \
 
1528
 );                                             \
1466
1529
}
1467
1530
 
1468
1531
        /* Create the File menu */
1558
1621
            , GUI_MENU_BAR_ALIGN_LEFT
1559
1622
        );
1560
1623
 
 
1624
 
 
1625
        /* Create the View menu */
 
1626
        menu = GUIMenuCreateTearOff();
 
1627
        if(menu != NULL)
 
1628
        {
 
1629
            icon_data = NULL;
 
1630
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_SCAN_PAGE)
 
1631
            win->view_scan_page_micheck = w;
 
1632
 
 
1633
            icon_data = NULL;
 
1634
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_RESULTS_PAGE)
 
1635
            win->view_results_page_micheck = w;
 
1636
 
 
1637
            icon_data = NULL;
 
1638
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_DB_PAGE)
 
1639
            win->view_db_page_micheck = w;
 
1640
 
 
1641
            DO_ADD_MENU_SEP
 
1642
 
 
1643
            icon_data = NULL;
 
1644
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_TOOLBAR)
 
1645
            win->view_toolbar_micheck = w;
 
1646
 
 
1647
            icon_data = NULL;
 
1648
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_STATUSBAR)
 
1649
            win->view_statusbar_micheck = w;
 
1650
        }
 
1651
        win->view_mlabel = GUIMenuAddToMenuBar( 
 
1652
            menubar, menu,
 
1653
#if defined(PROG_LANGUAGE_SPANISH)
 
1654
"Vista"
 
1655
#elif defined(PROG_LANGUAGE_FRENCH)
 
1656
"Vue"
 
1657
#elif defined(PROG_LANGUAGE_GERMAN)
 
1658
"Blick"
 
1659
#elif defined(PROG_LANGUAGE_ITALIAN)
 
1660
"Veduta"
 
1661
#elif defined(PROG_LANGUAGE_DUTCH)
 
1662
"Overzicht"
 
1663
#elif defined(PROG_LANGUAGE_PORTUGUESE)
 
1664
"Vista"
 
1665
#elif defined(PROG_LANGUAGE_NORWEGIAN)
 
1666
"Sikt"
 
1667
#else
 
1668
"View"
 
1669
#endif
 
1670
            , GUI_MENU_BAR_ALIGN_LEFT
 
1671
        );
 
1672
 
1561
1673
        /* Create the Scan menu */
1562
1674
        menu = GUIMenuCreateTearOff();
1563
1675
        if(menu != NULL)
1660
1772
        );
1661
1773
 
1662
1774
 
1663
 
        /* Create the View menu */
1664
 
        menu = GUIMenuCreateTearOff();
1665
 
        if(menu != NULL)
1666
 
        {
1667
 
            icon_data = NULL;
1668
 
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_SCAN_PAGE)
1669
 
            win->view_scan_page_micheck = w;
1670
 
 
1671
 
            icon_data = NULL;
1672
 
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_RESULTS_PAGE)
1673
 
            win->view_results_page_micheck = w;
1674
 
 
1675
 
            icon_data = NULL;
1676
 
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_DB_PAGE)
1677
 
            win->view_db_page_micheck = w;
1678
 
 
1679
 
            DO_ADD_MENU_SEP
1680
 
 
1681
 
            icon_data = NULL;
1682
 
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_TOOLBAR)
1683
 
            win->view_toolbar_micheck = w;
1684
 
 
1685
 
            icon_data = NULL;
1686
 
            DO_ADD_MENU_ITEM_CHECK(WIN_OPID_VIEW_STATUSBAR)
1687
 
            win->view_statusbar_micheck = w;
1688
 
        }
1689
 
        win->view_mlabel = GUIMenuAddToMenuBar( 
1690
 
            menubar, menu,
1691
 
#if defined(PROG_LANGUAGE_SPANISH)
1692
 
"Vista"
1693
 
#elif defined(PROG_LANGUAGE_FRENCH)
1694
 
"Vue"
1695
 
#elif defined(PROG_LANGUAGE_GERMAN)
1696
 
"Blick"
1697
 
#elif defined(PROG_LANGUAGE_ITALIAN)
1698
 
"Veduta"
1699
 
#elif defined(PROG_LANGUAGE_DUTCH)
1700
 
"Overzicht"
1701
 
#elif defined(PROG_LANGUAGE_PORTUGUESE)
1702
 
"Vista"
1703
 
#elif defined(PROG_LANGUAGE_NORWEGIAN)
1704
 
"Sikt"
1705
 
#else
1706
 
"View"
1707
 
#endif
1708
 
            , GUI_MENU_BAR_ALIGN_LEFT
1709
 
        );
1710
 
 
1711
 
 
1712
1775
        /* Create the Help menu */
1713
1776
        menu = GUIMenuCreateTearOff();
1714
1777
        if(menu != NULL)
1979
2042
        /* Left column vbox */
1980
2043
        w = gtk_vbox_new(FALSE, border_major);
1981
2044
        gtk_box_pack_start(GTK_BOX(parent), w, TRUE, TRUE, 0);
1982
 
        gtk_widget_show(w);                                   
 
2045
        gtk_widget_show(w);
1983
2046
        parent2 = w;
1984
2047
#endif
1985
2048
        /* Left column notebook */
1987
2050
        notebook = GTK_NOTEBOOK(w);
1988
2051
        gtk_box_pack_start(GTK_BOX(parent), w, TRUE, TRUE, 0); 
1989
2052
        gtk_notebook_set_tab_pos(notebook, GTK_POS_TOP);
1990
 
        gtk_notebook_set_scrollable(notebook, TRUE);   
 
2053
        gtk_notebook_set_scrollable(notebook, TRUE);
1991
2054
        gtk_notebook_set_show_tabs(notebook, TRUE); 
1992
2055
        gtk_notebook_set_show_border(notebook, TRUE);
1993
2056
        gtk_signal_connect(
2142
2205
        win->add_btn = w;
2143
2206
        NEW_BUTTON(WIN_OPID_EDIT, parent5, FALSE);
2144
2207
        win->edit_btn = w;
2145
 
        NEW_BUTTON(WIN_OPID_REMOVE, parent5, FALSE);   
 
2208
        NEW_BUTTON(WIN_OPID_REMOVE, parent5, FALSE);
2146
2209
        win->remove_btn = w;
2147
2210
 
2148
2211
 
2199
2262
        );
2200
2263
        SET_CROSSING(WIN_OPID_LOCATION, w);
2201
2264
        GUISetWidgetTip(w,
2202
 
"Enter the location of the file or directory to scan"
 
2265
"Enter a comma-separated list of full paths to the file(s)\
 
2266
 and/or directory(ies) to scan"
2203
2267
        );
2204
2268
 
2205
2269
        /* Scan settings hbox */
2348
2412
        gtk_clist_set_column_resizeable(clist, 1, FALSE);
2349
2413
        gtk_clist_set_column_width(clist, 1, 10);
2350
2414
        gtk_clist_set_row_height(clist, WIN_LIST_ROW_SPACING);
2351
 
        gtk_clist_set_shadow_type(clist, GTK_SHADOW_IN);   
 
2415
        gtk_clist_set_shadow_type(clist, GTK_SHADOW_IN);
2352
2416
        gtk_signal_connect(
2353
2417
            GTK_OBJECT(w), "resize_column",
2354
2418
            GTK_SIGNAL_FUNC(WinListResizeColumnCB), win
2393
2457
 
2394
2458
        w = gtk_hbox_new(FALSE, border_major);
2395
2459
        gtk_box_pack_end(GTK_BOX(parent5), w, FALSE, FALSE, 0);
2396
 
        gtk_widget_show(w);   
 
2460
        gtk_widget_show(w);
2397
2461
        parent5 = w;
2398
2462
        NEW_BUTTON(WIN_OPID_RESULTS_CLEAR, parent5, FALSE);
2399
2463
        win->results_clear_btn = w;
2414
2478
        /* Virus Database page */
2415
2479
        w = gtk_vbox_new(FALSE, border_major);
2416
2480
        gtk_container_border_width(GTK_CONTAINER(w), border_major);
2417
 
        gtk_notebook_append_page(                                 
 
2481
        gtk_notebook_append_page(
2418
2482
            GTK_NOTEBOOK(parent2), w, tablabel
2419
2483
        );
2420
2484
        gtk_widget_show(w);
2436
2500
        /* Virus Database Stats & Buttons hbox */
2437
2501
        w = gtk_hbox_new(FALSE, border_major);
2438
2502
        gtk_box_pack_start(GTK_BOX(parent4), w, FALSE, FALSE, 0);
2439
 
        gtk_widget_show(w);                                      
2440
 
        parent5 = w;       
 
2503
        gtk_widget_show(w);
 
2504
        parent5 = w;
2441
2505
 
2442
2506
 
2443
2507
        /* Virus Database Stats Prefixes icon & label */
2450
2514
        w = gtk_label_new("Location:\nLast Updated:\nPatterns:");
2451
2515
        gtk_label_set_justify(GTK_LABEL(w), GTK_JUSTIFY_RIGHT);
2452
2516
        gtk_box_pack_start(GTK_BOX(parent5), w, FALSE, FALSE, 0);
2453
 
        gtk_widget_show(w);                                      
 
2517
        gtk_widget_show(w);
2454
2518
 
2455
2519
        /* Virus Database Stats label */
2456
2520
        win->db_stats_label = w = gtk_label_new("");
2738
2802
   opid->accel_key, opid->accel_mods,           \
2739
2803
   (gpointer *)&menuitem_func_w,                \
2740
2804
   opid->win, opid->func_cb                     \
2741
 
  );                                            \
2742
 
  GUISetMenuItemCrossingCB(                     \
2743
 
   w,                                           \
2744
 
   (gpointer)opid->enter_func_cb, opid,         \
2745
 
   (gpointer)opid->leave_func_cb, opid          \
2746
 
  );                                            \
 
2805
  );                                            \
 
2806
  GUISetMenuItemCrossingCB(                     \
 
2807
   w,                                           \
 
2808
   (gpointer)opid->enter_func_cb, opid,         \
 
2809
   (gpointer)opid->leave_func_cb, opid          \
 
2810
  );                                            \
2747
2811
 }                                              \
2748
2812
 else                                           \
2749
 
  w = NULL;                                     \
 
2813
  w = NULL;                                     \
2750
2814
}
2751
2815
 
2752
2816
#define DO_ADD_MENU_ITEM_CHECK(_id_)    {       \
2762
2826
   opid->accel_key, opid->accel_mods,           \
2763
2827
   (gpointer *)&menuitem_func_w,                \
2764
2828
   opid->win, opid->func_cb                     \
2765
 
  );                                            \
2766
 
  GUISetMenuItemCrossingCB(                     \
2767
 
   w,                                           \
2768
 
   (gpointer)opid->enter_func_cb, opid,         \
2769
 
   (gpointer)opid->leave_func_cb, opid          \
2770
 
  );                                            \
 
2829
  );                                            \
 
2830
  GUISetMenuItemCrossingCB(                     \
 
2831
   w,                                           \
 
2832
   (gpointer)opid->enter_func_cb, opid,         \
 
2833
   (gpointer)opid->leave_func_cb, opid          \
 
2834
  );                                            \
2771
2835
 }                                              \
2772
2836
 else                                           \
2773
 
  w = NULL;                                     \
 
2837
  w = NULL;                                     \
2774
2838
}
2775
2839
 
2776
2840
#define DO_ADD_MENU_SEP         {               \
2884
2948
 
2885
2949
        cfg_list = core->cfg_list;
2886
2950
 
2887
 
        win->toplevel = toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);  
 
2951
        win->toplevel = toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2888
2952
        win->accelgrp = accelgrp = gtk_accel_group_new();
2889
2953
        win->processing = FALSE;
2890
2954
        win->busy_count = 0;
2963
3027
 
2964
3028
        /* Main VBox */
2965
3029
        win->main_vbox = main_vbox = w = gtk_vbox_new(FALSE, 0);
2966
 
        gtk_container_border_width(GTK_CONTAINER(w), 0);                        
 
3030
        gtk_container_border_width(GTK_CONTAINER(w), 0);
2967
3031
        gtk_container_add(GTK_CONTAINER(parent), w);
2968
3032
        gtk_widget_show(w);
2969
3033
        parent = w;
3063
3127
            CFGItemListSetValueI(
3064
3128
                cfg_list, CFG_PARM_WIN_X,
3065
3129
                x, FALSE
3066
 
            );          
 
3130
            );
3067
3131
            CFGItemListSetValueI(
3068
3132
                cfg_list, CFG_PARM_WIN_Y,
3069
3133
                y, FALSE
3178
3242
        );
3179
3243
        ToolBarItemSetSensitiveID(
3180
3244
            toolbar, WIN_OPID_ADD, sensitive
3181
 
        );      
 
3245
        );
3182
3246
 
3183
3247
        /* Close */
3184
3248
        sensitive = (scanning || db_loading || db_updating) ? FALSE : TRUE;
3627
3691
 
3628
3692
        gtk_label_set_text(
3629
3693
            GTK_LABEL(w), (mesg != NULL) ? mesg : ""
3630
 
        );  
 
3694
        );
3631
3695
 
3632
3696
        while((gtk_events_pending() > 0) && allow_gtk_iteration)
3633
3697
            gtk_main_iteration();
3654
3718
            );
3655
3719
        else
3656
3720
            s = g_strdup_printf(
3657
 
                "%.2i:%.2i",
 
3721
                "%i:%.2i",
3658
3722
                (gint)(t / 60l),
3659
3723
                (gint)(t % 60l)
3660
3724
            );