void ContextMenuActionProvider::addHideEventsMenu(QMenu *menu, MessageFilter *msgFilter)
{
    if (BufferSettings(msgFilter->idString()).hasFilter())
        addHideEventsMenu(menu, BufferSettings(msgFilter->idString()).messageFilter());
    else
        addHideEventsMenu(menu);
}
void ContextMenuActionProvider::addHideEventsMenu(QMenu *menu, BufferId bufferId)
{
    if (BufferSettings(bufferId).hasFilter())
        addHideEventsMenu(menu, BufferSettings(bufferId).messageFilter());
    else
        addHideEventsMenu(menu);
}
Exemplo n.º 3
0
void MessageFilter::messageTypeFilterChanged() {
  int newFilter;
  BufferSettings defaultSettings;
  newFilter = BufferSettings().messageFilter();

  BufferSettings mySettings(idString());
  if(mySettings.hasFilter())
    newFilter = mySettings.messageFilter();

  if(_messageTypeFilter != newFilter) {
    _messageTypeFilter = newFilter;
    _filteredQuitMsgs.clear();
    invalidateFilter();
  }
}
void ContextMenuActionProvider::addHideEventsMenu(QMenu *menu, int filter) {
  action(HideApplyToAll)->setEnabled(filter != -1);
  action(HideUseDefaults)->setEnabled(filter != -1);
  if(filter == -1)
    filter = BufferSettings().messageFilter();

  action(HideJoin)->setChecked(filter & Message::Join);
  action(HidePart)->setChecked(filter & Message::Part);
  action(HideQuit)->setChecked(filter & Message::Quit);
  action(HideNick)->setChecked(filter & Message::Nick);
  action(HideMode)->setChecked(filter & Message::Mode);
  action(HideDayChange)->setChecked(filter & Message::DayChange);
  action(HideTopic)->setChecked(filter & Message::Topic);

  menu->addAction(_hideEventsMenuAction);
}