1 /* logray_application.cpp
3 * Logray - Event log analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include "logray_application.h"
13 #include "ui/iface_lists.h"
14 #include "ui/ws_ui_util.h"
16 LograyApplication
*lwApp
;
18 LograyApplication::LograyApplication(int &argc
, char **argv
) :
19 MainApplication(argc
, argv
)
22 Q_INIT_RESOURCE(lricon
);
23 setApplicationName("Logray");
24 setDesktopFileName(QStringLiteral("org.wireshark.Logray"));
27 LograyApplication::~LograyApplication()
32 void LograyApplication::refreshLocalInterfaces()
34 extcap_clear_interfaces();
37 free_interface_list(cached_if_list_
);
38 cached_if_list_
= NULL
;
40 GList
* filter_list
= NULL
;
41 filter_list
= g_list_append(filter_list
, GUINT_TO_POINTER((unsigned) IF_EXTCAP
));
43 // We don't need to (re)start the stats (which calls dumpcap) because
44 // Logray only uses extcaps now. If that changes, do the below instead.
46 emit
scanLocalInterfaces(filter_list
);
49 scan_local_interfaces_filtered(filter_list
, main_window_update
);
51 g_list_free(filter_list
);
53 emit
localInterfaceListChanged();
57 void LograyApplication::initializeIcons()
59 // Do this as late as possible in order to allow time for
60 // MimeDatabaseInitThread to do its work.
61 QList
<int> icon_sizes
= QList
<int>() << 16 << 24 << 32 << 48 << 64 << 128 << 256 << 512 << 1024;
62 foreach (int icon_size
, icon_sizes
) {
63 QString icon_path
= QString(":/lricon/lricon%1.png").arg(icon_size
);
64 normal_icon_
.addFile(icon_path
);
65 icon_path
= QString(":/lricon/lriconcap%1.png").arg(icon_size
);
66 capture_icon_
.addFile(icon_path
);