|
|
|
|
@ -603,28 +603,38 @@ int yon_ubl_status_box_setup(GtkWidget *icon, GtkWidget *box, GtkWidget *label)
|
|
|
|
|
} else return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_box_set(BACKGROUND_IMAGE_TYPE type, GtkWidget *box, GtkImage *icon){
|
|
|
|
|
|
|
|
|
|
GtkIconTheme *ictheme = gtk_icon_theme_get_default();
|
|
|
|
|
switch (type){
|
|
|
|
|
case BACKGROUND_IMAGE_SUCCESS_TYPE:
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.libublsettingsui-gtk3.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case BACKGROUND_IMAGE_FAIL_TYPE:
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.libublsettingsui-gtk3.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case BACKGROUND_IMAGE_INFO_TYPE:
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.libublsettingsui-gtk3.important", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type)
|
|
|
|
|
{
|
|
|
|
|
render_data data = render;
|
|
|
|
|
GtkIconTheme *ictheme = gtk_icon_theme_get_default();
|
|
|
|
|
GError *err = NULL;
|
|
|
|
|
if (err)
|
|
|
|
|
{
|
|
|
|
|
printf("%s\n", err->message);
|
|
|
|
|
g_error_free(err);
|
|
|
|
|
}
|
|
|
|
|
if (type == BACKGROUND_IMAGE_SUCCESS_TYPE||! type)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(data.box), "boxInfoMessError");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(data.box), "boxInfoMessOK");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(data.icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err));
|
|
|
|
|
}
|
|
|
|
|
else if (type == BACKGROUND_IMAGE_FAIL_TYPE)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(data.box), "boxInfoMessOK");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(data.box), "boxInfoMessError");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(data.icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-video.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, &err));
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_set(type,data.box,GTK_IMAGE(data.icon));
|
|
|
|
|
if (text)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(data.label), text);
|
|
|
|
|
}
|
|
|
|
|
@ -720,20 +730,7 @@ int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *display_tex
|
|
|
|
|
(int)(textColor.blue * 65535)
|
|
|
|
|
);
|
|
|
|
|
pango_attr_list_insert(attributes, colorAttr);
|
|
|
|
|
|
|
|
|
|
GtkIconTheme *ictheme = gtk_icon_theme_get_default();
|
|
|
|
|
if (type == BACKGROUND_IMAGE_SUCCESS_TYPE||! type)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
else if (type == BACKGROUND_IMAGE_FAIL_TYPE)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_set(type,box,GTK_IMAGE(icon));
|
|
|
|
|
if (display_text)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(label),display_text);
|
|
|
|
|
struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox));
|
|
|
|
|
@ -794,19 +791,7 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti
|
|
|
|
|
);
|
|
|
|
|
pango_attr_list_insert(attributes, colorAttr);
|
|
|
|
|
|
|
|
|
|
GtkIconTheme *ictheme = gtk_icon_theme_get_default();
|
|
|
|
|
if (type == BACKGROUND_IMAGE_SUCCESS_TYPE||! type)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.checked", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
else if (type == BACKGROUND_IMAGE_FAIL_TYPE)
|
|
|
|
|
{
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(box), "boxInfoMessOK");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(box), "boxInfoMessError");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(icon), gtk_icon_theme_load_icon_for_scale(ictheme, "com.ublinux.ubl-settings-logging.warning", 25, 1, GTK_ICON_LOOKUP_FORCE_SIZE, NULL));
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_set(type,box,GTK_IMAGE(icon));
|
|
|
|
|
if (display_text)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(label),display_text);
|
|
|
|
|
struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox));
|
|
|
|
|
|