<commit_before>/***************************************************************************
                          knfiltersettings.cpp  -  description
                             -------------------

    copyright            : (C) 2000 by <NAME>
    email                : <EMAIL>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <qlayout.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qbitarray.h>
#include <qcombobox.h>

#include <kiconloader.h>
#include <klocale.h>

#include "knstringfilter.h"
#include "knrangefilter.h"
#include "knstatusfilter.h"
#include "knarticlefilter.h"
#include "knfiltermanager.h"
#include "knlistbox.h"
#include "knfiltersettings.h"


//=============================================================================================



KNFilterSettings::KNFilterSettings(KNFilterManager *fm, QWidget *p)
 : KNSettingsWidget(p), fiManager(fm)
{
  QGridLayout *topL=new QGridLayout(this, 6,2, 5,5);

  // == Filters =================================================

  topL->addWidget(new QLabel(i18n("<b>Filters:</b>"),this),0,0);

  flb=new KNListBox(this);
  connect(flb, SIGNAL(selectionChanged()), SLOT(slotSelectionChangedFilter()));
  connect(flb, SIGNAL(selected(int)), SLOT(slotItemSelectedFilter(int)));
  topL->addMultiCellWidget(flb,1,5,0,0);

  addBtn=new QPushButton(i18n("&Add"), this);
  connect(addBtn, SIGNAL(clicked()), this, SLOT(slotAddBtnClicked()));
  topL->addWidget(addBtn,1,1);

  delBtn=new QPushButton(i18n("&Delete"), this);
  connect(delBtn, SIGNAL(clicked()), this, SLOT(slotDelBtnClicked()));
  topL->addWidget(delBtn,2,1);

  editBtn=new QPushButton(i18n("modify something","&Edit"), this);
  connect(editBtn, SIGNAL(clicked()), this, SLOT(slotEditBtnClicked()));
  topL->addWidget(editBtn,3,1);

  copyBtn=new QPushButton(i18n("C&opy"), this);
  connect(copyBtn, SIGNAL(clicked()), this, SLOT(slotCopyBtnClicked()));
  topL->addWidget(copyBtn,4,1);

  // == Menu ====================================================

  topL->addWidget(new QLabel(i18n("<b>Menu:</b>"),this),6,0);

  mlb=new KNListBox(this);
  connect(mlb, SIGNAL(selectionChanged()), SLOT(slotSelectionChangedMenu()));
  topL->addMultiCellWidget(mlb,7,11,0,0);

  upBtn=new QPushButton(i18n("&Up"), this);
  connect(upBtn, SIGNAL(clicked()), this, SLOT(slotUpBtnClicked()));
  topL->addWidget(upBtn,7,1);

  downBtn=new QPushButton(i18n("D&own"), this);
  connect(downBtn, SIGNAL(clicked()), this, SLOT(slotDownBtnClicked()));
  topL->addWidget(downBtn,8,1);

  sepAddBtn=new QPushButton(i18n("Add\n&Separator"), this);
  connect(sepAddBtn, SIGNAL(clicked()), this, SLOT(slotSepAddBtnClicked()));
  topL->addWidget(sepAddBtn,9,1);

  sepRemBtn=new QPushButton(i18n("&Remove\nSeparator"), this);
  connect(sepRemBtn, SIGNAL(clicked()), this, SLOT(slotSepRemBtnClicked()));
  topL->addWidget(sepRemBtn,10,1);

  topL->setRowStretch(5,1);
  topL->setRowStretch(11,1);

  active = SmallIcon("filter");
  disabled = UserIcon("fltrgrey");

  fiManager->startConfig(this);

  slotSelectionChangedFilter();
  slotSelectionChangedMenu();
}


<commit_msg>visual fix<commit_after>/***************************************************************************
                          knfiltersettings.cpp  -  description
                             -------------------

    copyright            : (C) 2000 by <NAME>
    email                : <EMAIL>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <qlayout.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qbitarray.h>
#include <qcombobox.h>

#include <kiconloader.h>
#include <klocale.h>

#include "knstringfilter.h"
#include "knrangefilter.h"
#include "knstatusfilter.h"
#include "knarticlefilter.h"
#include "knfiltermanager.h"
#include "knlistbox.h"
#include "knfiltersettings.h"


//=============================================================================================



KNFilterSettings::KNFilterSettings(KNFilterManager *fm, QWidget *p)
 : KNSettingsWidget(p), fiManager(fm)
{
  QGridLayout *topL=new QGridLayout(this, 6,2, 5,5);

  // == Filters =================================================

  topL->addWidget(new QLabel(i18n("<b>Filters:</b>"),this),0,0);

  flb=new KNListBox(this);
  connect(flb, SIGNAL(selectionChanged()), SLOT(slotSelectionChangedFilter()));
  connect(flb, SIGNAL(selected(int)), SLOT(slotItemSelectedFilter(int)));
  topL->addMultiCellWidget(flb,1,5,0,0);

  addBtn=new QPushButton(i18n("&Add"), this);
  connect(addBtn, SIGNAL(clicked()), this, SLOT(slotAddBtnClicked()));
  topL->addWidget(addBtn,1,1);

  delBtn=new QPushButton(i18n("&Delete"), this);
  connect(delBtn, SIGNAL(clicked()), this, SLOT(slotDelBtnClicked()));
  topL->addWidget(delBtn,2,1);

  editBtn=new QPushButton(i18n("modify something","&Edit"), this);
  connect(editBtn, SIGNAL(clicked()), this, SLOT(slotEditBtnClicked()));
  topL->addWidget(editBtn,3,1);

  copyBtn=new QPushButton(i18n("C&opy"), this);
  connect(copyBtn, SIGNAL(clicked()), this, SLOT(slotCopyBtnClicked()));
  topL->addWidget(copyBtn,4,1);

  // == Menu ====================================================

  topL->addWidget(new QLabel(i18n("<b>Menu:</b>"),this),6,0);

  mlb=new KNListBox(this);
  connect(mlb, SIGNAL(selectionChanged()), SLOT(slotSelectionChangedMenu()));
  topL->addMultiCellWidget(mlb,7,11,0,0);

  upBtn=new QPushButton(i18n("&Up"), this);
  connect(upBtn, SIGNAL(clicked()), this, SLOT(slotUpBtnClicked()));
  topL->addWidget(upBtn,7,1);

  downBtn=new QPushButton(i18n("D&own"), this);
  connect(downBtn, SIGNAL(clicked()), this, SLOT(slotDownBtnClicked()));
  topL->addWidget(downBtn,8,1);

  sepAddBtn=new QPushButton(i18n("Add\n&Separator"), this);
  connect(sepAddBtn, SIGNAL(clicked()), this, SLOT(slotSepAddBtnClicked()));
  topL->addWidget(sepAddBtn,9,1);

  sepRemBtn=new QPushButton(i18n("&Remove\nSeparator"), this);
  connect(sepRemBtn, SIGNAL(clicked()), this, SLOT(slotSepRemBtnClicked()));
  topL->addWidget(sepRemBtn,10,1);

  topL->setRowStretch(5,1);
  topL->setRowStretch(11,1);

  active = SmallIcon("filter",16);
  disabled = SmallIcon("filter",16,KIcon::DisabledState);

  fiManager->startConfig(this);

  slotSelectionChangedFilter();
  slotSelectionChangedMenu();
}



{'fraction_non_alphanumeric': 0.27477179521100675, 'fraction_numerical': 0.017462627331657626, 'mean_word_length': 4.446685878962536, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4708423', 'n_tokens_mistral': 2434, 'n_tokens_neox': 2266, 'n_words': 375}