#include "devproc.h"
#include "wireless.h"
#include "plugin.h"
+#include "misc.h"
#include "dbg.h"
/* 1 second */
/* Encryption */
if (aps->apinfo->haskey) {
- lockicon = gtk_image_new_from_file(ICONS_WL_LOCK);
+ lockicon = lxpanel_image_new_for_icon(NULL, ICONS_WL_LOCK, 18, NULL);
gtk_box_pack_start(GTK_BOX(item_box), lockicon, FALSE, FALSE, 0);
}
g_return_val_if_fail (event != NULL, FALSE);
- if (event->type == GDK_BUTTON_PRESS) {
+// if (event->type == GDK_BUTTON_PRESS) {
event_button = (GdkEventButton *) event;
- if (event_button->button == 1) {
+ if (event->type == GDK_BUTTON_PRESS && event_button->button == 1) {
+// if (event_button->button == 1) {
/* wireless device */
if (ni->netdev_list->info.wireless) {
gtk_menu_popup(GTK_MENU(wireless_menu(ni)), NULL, NULL, NULL, NULL, event_button->button, event_button->time);
- }
+// }
return TRUE;
- } else if (event_button->button == 3) {
+ } else {
+// } else if (event_button->button == 3) {
GtkWidget *menu;
GtkWidget *menu_item;
{
NETDEVLIST_PTR ptr;
char *tooltip;
+ const char *icon, *theme_icon;
if (netdev_list==NULL) {
return;
ptr->info.trans_bytes, ptr->info.recv_bytes, _("bytes"),
ptr->info.trans_packets, ptr->info.recv_packets, _("packets"));
+ icon = select_icon(ptr->info.plug, ptr->info.connected, ptr->info.status);
+ if (ns->use_theme)
+ theme_icon = select_icon_theme(ptr->info.plug, ptr->info.connected, ptr->info.status);
+ else
+ theme_icon = icon;
/* status icon doesn't exist */
if (ptr->info.status_icon==NULL) {
netdev_info *ni;
ni->ns = ns;
ni->netdev_list = ptr;
- ptr->info.status_icon = create_statusicon(ns->mainw, select_icon(ptr->info.plug, ptr->info.connected, ptr->info.status), tooltip, select_icon_theme(ptr->info.plug, ptr->info.connected, ptr->info.status));
+ ptr->info.status_icon = create_statusicon(ns->panel, ns->mainw, icon, tooltip, theme_icon);
g_signal_connect(ptr->info.status_icon->main, "button-press-event", G_CALLBACK(menupopup), ni);
g_object_weak_ref(G_OBJECT(ptr->info.status_icon->main), g_free_weaknotify, ni);
} else {
set_statusicon_tooltips(ptr->info.status_icon, tooltip);
- set_statusicon_image_from_file(ptr->info.status_icon, select_icon(ptr->info.plug, ptr->info.connected, ptr->info.status));
+ update_statusicon(ptr->info.status_icon, icon, theme_icon);
set_statusicon_visible(ptr->info.status_icon, TRUE);
}
g_free(tooltip);
{
netstat *ns;
const char *tmp;
+ int tmp_int;
GtkWidget *p;
ENTER;
ns = g_new0(netstat, 1);
g_return_val_if_fail(ns != NULL, NULL);
+ ns->panel = panel;
/* apply config */
if (config_setting_lookup_string(settings, "FixCommand", &tmp))
ns->fixcmd = g_strdup(tmp);
+ if (config_setting_lookup_int(settings, "UseTheme", &tmp_int))
+ ns->use_theme = !!tmp_int;
/* initializing */
ns->fnetd = malloc(sizeof(FNETD));