IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Ignore List"), parent)
{
ui.setupUi(this);
_delegate = new IgnoreListDelegate(ui.ignoreListView);
IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Ignore List"), parent)
{
ui.setupUi(this);
_delegate = new IgnoreListDelegate(ui.ignoreListView);
- ui.newIgnoreRuleButton->setIcon(SmallIcon("list-add"));
- ui.deleteIgnoreRuleButton->setIcon(SmallIcon("edit-delete"));
- ui.editIgnoreRuleButton->setIcon(SmallIcon("configure"));
+ ui.newIgnoreRuleButton->setIcon(icon::get("list-add"));
+ ui.deleteIgnoreRuleButton->setIcon(icon::get("edit-delete"));
+ ui.editIgnoreRuleButton->setIcon(icon::get("configure"));
ui.ignoreListView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.ignoreListView->setSelectionMode(QAbstractItemView::SingleSelection);
ui.ignoreListView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.ignoreListView->setSelectionMode(QAbstractItemView::SingleSelection);
void IgnoreListSettingsPage::newIgnoreRule(QString rule)
{
IgnoreListManager::IgnoreListItem newItem = IgnoreListManager::IgnoreListItem();
void IgnoreListSettingsPage::newIgnoreRule(QString rule)
{
IgnoreListManager::IgnoreListItem newItem = IgnoreListManager::IgnoreListItem();
- newItem.strictness = IgnoreListManager::SoftStrictness;
- newItem.scope = IgnoreListManager::GlobalScope;
- newItem.isRegEx = false;
- newItem.isActive = true;
+ newItem.setStrictness(IgnoreListManager::SoftStrictness);
+ newItem.setScope(IgnoreListManager::GlobalScope);
+ newItem.setIsRegEx(false);
+ newItem.setIsEnabled(true);
dlg->enableOkButton(enableOkButton);
while (dlg->exec() == QDialog::Accepted) {
if (!_ignoreListModel.newIgnoreRule(dlg->ignoreListItem())) {
if (QMessageBox::warning(this,
tr("Rule already exists"),
tr("There is already a rule\n\"%1\"\nPlease choose another rule.")
dlg->enableOkButton(enableOkButton);
while (dlg->exec() == QDialog::Accepted) {
if (!_ignoreListModel.newIgnoreRule(dlg->ignoreListItem())) {
if (QMessageBox::warning(this,
tr("Rule already exists"),
tr("There is already a rule\n\"%1\"\nPlease choose another rule.")
case IgnoreListManager::NetworkScope:
ui.networkScopeButton->setChecked(true);
ui.scopeRuleTextEdit->setEnabled(true);
case IgnoreListManager::NetworkScope:
ui.networkScopeButton->setChecked(true);
ui.scopeRuleTextEdit->setEnabled(true);
connect(ui.ignoreRuleLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(widgetHasChanged()));
connect(ui.scopeRuleTextEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged()));
connect(ui.ignoreRuleLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(widgetHasChanged()));
connect(ui.scopeRuleTextEdit, SIGNAL(textChanged()), this, SLOT(widgetHasChanged()));
- if (_clonedIgnoreListItem.scope == IgnoreListManager::GlobalScope) {
- _clonedIgnoreListItem.scopeRule = QString();
+ if (_clonedIgnoreListItem.scope() == IgnoreListManager::GlobalScope) {
+ _clonedIgnoreListItem.setScopeRule(QString());
- QStringList text = ui.scopeRuleTextEdit->toPlainText().split(";", QString::SkipEmptyParts);
- QStringList::iterator it = text.begin();
- while (it != text.end()) {
- *it = it->trimmed();
- ++it;
- }
-
- _clonedIgnoreListItem.scopeRule = text.join("; ");
+ // Trim the resulting MultiWildcard expression
+ _clonedIgnoreListItem.setScopeRule(
+ ExpressionMatch::trimMultiWildcardWhitespace(
+ ui.scopeRuleTextEdit->toPlainText()));
- _clonedIgnoreListItem.ignoreRule = ui.ignoreRuleLineEdit->text();
- _clonedIgnoreListItem.isRegEx = ui.isRegExCheckBox->isChecked();
- _clonedIgnoreListItem.isActive = ui.isActiveCheckBox->isChecked();
+ _clonedIgnoreListItem.setContents(ui.ignoreRuleLineEdit->text());
+ _clonedIgnoreListItem.setIsRegEx(ui.isRegExCheckBox->isChecked());
+ _clonedIgnoreListItem.setIsEnabled(ui.isActiveCheckBox->isChecked());