GtkWidget *dlg_vbox;
GtkWidget *main_hbox;
GtkWidget *ctrl_vbox;
-#if GTK_CHECK_VERSION(2,12,0)
-#else
- GtkTooltips *tooltips;
-#endif
GtkWidget *order_fr;
GtkWidget *order_vbox;
GtkWidget *color_filter_up;
color_dlg_num_of_filters = 0;
color_dlg_row_selected = -1; /* no row selected */
-#if GTK_CHECK_VERSION(2,12,0)
-#else
- tooltips = gtk_tooltips_new ();
-#endif
/* Resizing of the dialog window is now reasonably done.
* Default size is set so that it should fit into every usual screen resolution.
* All other widgets are always packed depending on the current window size. */
color_new = gtk_button_new_from_stock(GTK_STOCK_NEW);
gtk_box_pack_start (GTK_BOX (edit_vbox), color_new, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_new, "Create a new filter at the top of the list");
-#else
- gtk_tooltips_set_tip (tooltips, color_new, ("Create a new filter at the top of the list"), NULL);
-#endif
color_edit = gtk_button_new_from_stock(WIRESHARK_STOCK_EDIT);
gtk_box_pack_start (GTK_BOX (edit_vbox), color_edit, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_edit, " If more than one filter is selected, edit the first selected one");
-#else
- gtk_tooltips_set_tip (tooltips, color_edit, ("Edit the properties of the selected filter."
- " If more than one filter is selected, edit the first selected one"), NULL);
-#endif
gtk_widget_set_sensitive (color_edit, FALSE);
color_enable = gtk_button_new_from_stock(WIRESHARK_STOCK_ENABLE);
gtk_box_pack_start (GTK_BOX (edit_vbox), color_enable, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_enable, "Enable the selected filter(s)");
-#else
- gtk_tooltips_set_tip (tooltips, color_enable, ("Enable the selected filter(s)"), NULL);
-#endif
gtk_widget_set_sensitive (color_enable, FALSE);
color_disable = gtk_button_new_from_stock(WIRESHARK_STOCK_DISABLE);
gtk_box_pack_start (GTK_BOX (edit_vbox), color_disable, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_disable, "Disable the selected filter(s)");
-#else
- gtk_tooltips_set_tip (tooltips, color_disable, ("Disable the selected filter(s)"), NULL);
-#endif
gtk_widget_set_sensitive (color_disable, FALSE);
color_delete = gtk_button_new_from_stock(GTK_STOCK_DELETE);
gtk_box_pack_start (GTK_BOX (edit_vbox), color_delete, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_delete, "Delete the selected filter(s)");
-#else
- gtk_tooltips_set_tip (tooltips, color_delete, ("Delete the selected filter(s)"), NULL);
-#endif
gtk_widget_set_sensitive (color_delete, FALSE);
/* End edit buttons frame */
color_import = gtk_button_new_from_stock(WIRESHARK_STOCK_IMPORT);
gtk_box_pack_start (GTK_BOX (manage_vbox), color_import, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_import, "Load filters from a file and append them to the list");
-#else
- gtk_tooltips_set_tip(tooltips, color_import, ("Load filters from a file and append them to the list"), NULL);
-#endif
color_export = gtk_button_new_from_stock(WIRESHARK_STOCK_EXPORT);
gtk_box_pack_start (GTK_BOX (manage_vbox), color_export, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_export, "Save all/selected filters to a file");
-#else
- gtk_tooltips_set_tip(tooltips, color_export, ("Save all/selected filters to a file"), NULL);
-#endif
color_clear = gtk_button_new_from_stock(GTK_STOCK_CLEAR);
gtk_box_pack_start(GTK_BOX (manage_vbox), color_clear, FALSE, FALSE, 5);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_clear, "Clear the filter list and revert to system-wide default filter set");
-#else
- gtk_tooltips_set_tip(tooltips, color_clear, ("Clear the filter list and revert to system-wide default filter set"), NULL);
-#endif
/* filter list frame */
list_fr = gtk_frame_new("Filter");
color_filter_up = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
gtk_box_pack_start (GTK_BOX (order_vbox), color_filter_up, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_filter_up, "Move filter higher in list");
-#else
- gtk_tooltips_set_tip (tooltips, color_filter_up, ("Move filter higher in list"), NULL);
-#endif
gtk_widget_set_sensitive (color_filter_up, FALSE);
order_move_label = gtk_label_new (("Move\nselected filter\nup or down"));
color_filter_down = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN);
gtk_box_pack_start (GTK_BOX (order_vbox), color_filter_down, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_filter_down, "Move filter lower in list");
-#else
- gtk_tooltips_set_tip (tooltips, color_filter_down, ("Move filter lower in list"), NULL);
-#endif
gtk_widget_set_sensitive (color_filter_down, FALSE);
gtk_box_pack_start (GTK_BOX (dlg_vbox), button_ok_hbox, FALSE, FALSE, 5);
color_ok = g_object_get_data(G_OBJECT(button_ok_hbox), GTK_STOCK_OK);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_ok, "Apply the color filters to the display and close this dialog");
-#else
- gtk_tooltips_set_tip (tooltips, color_ok, ("Apply the color filters to the display and close this dialog"), NULL);
-#endif
color_apply = g_object_get_data(G_OBJECT(button_ok_hbox), GTK_STOCK_APPLY);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_apply, "Apply the color filters to the display and keep this dialog open");
-#else
- gtk_tooltips_set_tip (tooltips, color_apply, ("Apply the color filters to the display and keep this dialog open"), NULL);
-#endif
color_save = g_object_get_data(G_OBJECT(button_ok_hbox), GTK_STOCK_SAVE);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_save, "Save the color filters permanently and keep this dialog open");
-#else
- gtk_tooltips_set_tip (tooltips, color_save, ("Save the color filters permanently and keep this dialog open"), NULL);
-#endif
color_cancel = g_object_get_data(G_OBJECT(button_ok_hbox), GTK_STOCK_CANCEL);
window_set_cancel_button(color_win, color_cancel, color_cancel_cb);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_cancel, "Cancel changes done (since last \"Apply\") and close this dialog");
-#else
- gtk_tooltips_set_tip (tooltips, color_cancel, ("Cancel changes done (since last \"Apply\") and close this dialog"), NULL);
-#endif
color_help = g_object_get_data(G_OBJECT(button_ok_hbox), GTK_STOCK_HELP);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(color_help, "Get help about this dialog");
-#else
- gtk_tooltips_set_tip (tooltips, color_help, ("Get help about this dialog"), NULL);
-#endif
g_signal_connect(color_help, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_COLORING_RULES_DIALOG);
gtk_widget_grab_default(color_ok);
GtkListStore *store;
GtkTreeIter iter;
- if( strstr(colorf->filter_name,TEMP_COLOR_PREFIX)==NULL) {
+ if( strstr(colorf->filter_name,CONVERSATION_COLOR_PREFIX)==NULL) {
store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(list_arg)));
if (prepend) {
gtk_list_store_prepend(store, &iter);
static void
create_new_color_filter(GtkButton *button, const char *filter)
{
- color_filter_t *colorf;
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *context;
+ GdkRGBA *rgba_bg_color;
+ GdkRGBA *rgba_fg_color;
+#else
GtkStyle *style;
+#endif
+ color_filter_t *colorf;
color_t bg_color, fg_color;
GtkWidget *color_filters;
GtkTreeSelection *sel;
gtk_tree_selection_unselect_all (sel);
/* Use the default background and foreground colors as the colors. */
+#if GTK_CHECK_VERSION(3,0,0)
+ context = gtk_widget_get_style_context (new_packet_list_get_widget());
+ gtk_style_context_get (context, GTK_STATE_NORMAL,
+ "background-color", &rgba_bg_color,
+ NULL);
+ gtk_style_context_get (context, GTK_STATE_NORMAL,
+ "color", &rgba_fg_color,
+ NULL);
+ gdkRGBAcolor_to_color_t(&bg_color, rgba_bg_color);
+ gdkRGBAcolor_to_color_t(&fg_color, rgba_fg_color);
+ gdk_rgba_free (rgba_bg_color);
+ gdk_rgba_free (rgba_fg_color);
+
+#else
style = gtk_widget_get_style(new_packet_list_get_widget());
gdkcolor_to_color_t(&bg_color, &style->base[GTK_STATE_NORMAL]);
gdkcolor_to_color_t(&fg_color, &style->text[GTK_STATE_NORMAL]);
-
+#endif
colorf = color_filter_new("name", filter, &bg_color, &fg_color, FALSE);
add_filter_to_list(colorf, color_filters, TRUE);
select_row(color_filters, 0);
/* Destroy the dialog box. */
window_destroy(colorize_win);
}
-