void FilterableFacebookRelatedDataFilterInterface::setFilterValue(const QString &filterValue)
{
    if (m_filterValue != filterValue) {
        m_filterValue = filterValue;
        emit filterValueChanged();
        refilter();
    }
}
void FilterableFacebookRelatedDataFilterInterface::setFilterField(const QString &filterField)
{
    if (m_filterField != filterField) {
        m_filterField = filterField;
        emit filterFieldChanged();
        refilter();
    }
}
void FilterableFacebookRelatedDataFilterInterface::setFilterType(FilterType filterType)
{
    if (m_filterType != filterType) {
        m_filterType = filterType;
        emit filterTypeChanged();
        refilter();
    }
}
void RosoutPanel::onFilterEnableChecked(wxCommandEvent& event)
{
  V_FilterInfo::iterator it = std::find_if(filters_.begin(), filters_.end(), boost::bind(filterEnabledCheckboxEqual, event.GetId(), _1));
  if (it != filters_.end())
  {
    FilterInfo& info = *it;
    info.filter->setEnabled(event.IsChecked());
    refilter();
  }
}
Exemple #5
0
static GdkFilterReturn event_filter (XEvent *xevent, GdkEvent *event, gpointer data)
{
  if (xevent->type == PropertyNotify) {
    Atom atom = xevent->xproperty.atom;
    Window win = xevent->xproperty.window;
    if (win == gdk_x11_get_default_root_xwindow ()) {
      if (atom == a_NET_CLIENT_LIST) {
	int focus_on = 0;
	if (filtered_size && filtered_boxes) {
	  for (int i = 0; i < filtered_size; i++)
	    if (gtk_widget_is_focus (filtered_boxes [i])) {
	      focus_on = i;
	      break;
	    }
	} else {
	  for (int i = 0; i < wsize; i++)
	    if (gtk_widget_is_focus (boxes [i])) {
	      focus_on = i;
	      break;
	    }
	}
	update_box_list ();
	if (strlen (mosaic_search_box_get_text (MOSAIC_SEARCH_BOX (search)))) {
	  refilter (MOSAIC_SEARCH_BOX (search), NULL);
	  draw_mosaic (GTK_LAYOUT (layout), filtered_boxes, filtered_size, focus_on,
		       options.box_width, options.box_height);
	} else {
	  draw_mosaic (GTK_LAYOUT (layout), boxes, wsize, focus_on,
		       options.box_width, options.box_height);
	}
      }
    } else {
      if (atom == a_WM_NAME || atom == a_NET_WM_NAME || atom == a_NET_WM_VISIBLE_NAME) {
	// Search for appropriate widget to change label.
	for (int i = 0; i < wsize; i++)
	  if (wins [i] == win) {
	    mosaic_window_box_update_xwindow_name (MOSAIC_WINDOW_BOX (boxes[i]));
	    break;
	  }
      }
      if (atom == a_NET_WM_ICON && options.show_icons) {
	// Search for appropriate widget to update icon.
	for (int i = 0; i < wsize; i++)
	  if (wins [i] == win) {
	    mosaic_window_box_setup_icon_from_wm (MOSAIC_WINDOW_BOX (boxes[i]), options.icon_size, options.icon_size);
	    break;
	  }
      }
    }
  }

  return GDK_FILTER_CONTINUE;
}
void RosoutPanel::removeFilter(const RosoutFilterPtr& filter)
{
  V_FilterInfo::iterator it = std::find_if(filters_.begin(), filters_.end(), boost::bind(filterEquals, filter, _1));
  if (it != filters_.end())
  {
    FilterInfo& info = *it;
    info.panel->Destroy();
    filters_.erase(it);

    resizeFiltersPane();
    updateFilterBackgrounds();

    refilter();
  }
}
void RosoutPanel::setMessages(const M_IdToMessage& messages)
{
  messages_ = messages;

  if (messages.empty())
  {
    message_id_counter_ = 0;
  }
  else
  {
    message_id_counter_ = messages.rbegin()->first;
  }

  refilter();
}
void RosoutPanel::onProcessTimer(wxTimerEvent& evt)
{
  callback_queue_.callAvailable(ros::WallDuration());

  processMessages();

  refilter_timer_ += 0.25f;
  if (needs_refilter_ && refilter_timer_ > 0.5f)
  {
    refilter_timer_ = 0.0f;
    needs_refilter_ = false;
    refilter();
  }

  //PRINT_STUFF("onProcessTimer");
}