/**
 * @brief Class constructor
 */
FeedEditWidget::FeedEditWidget(QWidget *parent) : QWidget(parent), ui(new Ui::FeedEditWidget){
    ui->setupUi(this);

    //fills predefined feed lists
    listFeedPresets();

    //sets focus to save button
    ui->saveButton->setFocus();

    //background color preview
    connect(ui->bkgRedBox, SIGNAL(valueChanged(int)), this, SLOT(bkgColorChanged()));
    connect(ui->bkgGreenBox, SIGNAL(valueChanged(int)), this, SLOT(bkgColorChanged()));
    connect(ui->bkgBlueBox, SIGNAL(valueChanged(int)), this, SLOT(bkgColorChanged()));

    //feed list selection
    connect(ui->feedList, SIGNAL(currentRowChanged(int)), this, SLOT(feedSelected(int)));
    connect(ui->feedPresetList, SIGNAL(currentRowChanged(int)), this, SLOT(presetSelected(int)));

    //main control buttons
    connect(ui->saveButton, SIGNAL(pressed()), this, SLOT(saveChangesPressed()));
    connect(ui->addButton, SIGNAL(pressed()), this, SLOT(addNewPressed()));
    connect(ui->removeButton, SIGNAL(pressed()), this, SLOT(removePressed()));
    connect(ui->loadFeedlistButton, SIGNAL(pressed()), this, SLOT(loadPresetPressed()));

    //paste buttons
    connect(ui->pasteNameButton, SIGNAL(pressed()), this, SLOT(pasteNamePressed()));
    connect(ui->urlNameButton, SIGNAL(pressed()), this, SLOT(pasteUrlPressed()));
    connect(ui->descriptionNameButton, SIGNAL(pressed()), this, SLOT(pasteDescriptionPressed()));

    //close button
    connect(ui->closeButton, SIGNAL(pressed()), this, SLOT(emitClosePressed()));
}
 ScanFolderPrefPage::ScanFolderPrefPage(ScanFolderPlugin* plugin, QWidget* parent)
     : PrefPageInterface(ScanFolderPluginSettings::self(), i18nc("plugin name", "Scan Folder"), "folder-open", parent), m_plugin(plugin)
 {
     setupUi(this);
     connect(kcfg_actionDelete, SIGNAL(toggled(bool)), kcfg_actionMove, SLOT(setDisabled(bool)));
     connect(m_add, SIGNAL(clicked()), this, SLOT(addPressed()));
     connect(m_remove, SIGNAL(clicked()), this, SLOT(removePressed()));
     connect(m_folders, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
     connect(m_group, SIGNAL(currentIndexChanged(int)), this, SLOT(currentGroupChanged(int)));
 }
/**
 * Called when remove button is pressed.
 */
void LayerEditWidget::removeButtonPress() {
    emit removePressed(this);
}