CategoriesPage::CategoriesPage(Nepomuk::WebExtractorConfig* cfg, QWidget * parent):
    QWidget(parent),
    m_config(cfg),
    m_categoryEdited(false)
{
    this->setupUi(this);
    this->query_edit_widget->hide();
    this->query_prefix_edit->hide();
    this->plugins_selector = new PluginSelector(this);
    this->verticalLayout->insertWidget(0, this->plugins_selector);
    m_oldDelegate = this->plugins_selector->selectedView()->itemDelegate();
    m_newDelegate = new CategoryPluginItemDelegate(this->plugins_selector->selectedView(), this);
    this->plugins_selector->selectedView()->setItemDelegate(m_newDelegate);
    //this->plugins_selector->selectedListWidget()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    connect(this->query_edit, SIGNAL(textChanged()), this, SLOT(setCategoryChanged()));
    connect(this->query_prefix_edit, SIGNAL(textChanged()), this, SLOT(setCategoryChanged()));
    connect(this->interval_spinbox, SIGNAL(valueChanged(int)), this, SLOT(setCategoryChanged()));
    connect(this->plugins_selector, SIGNAL(added()), this, SLOT(setCategoryChanged()));
    connect(this->plugins_selector, SIGNAL(removed()), this, SLOT(setCategoryChanged()));
    connect(this->plugins_selector, SIGNAL(movedUp()), this, SLOT(setCategoryChanged()));
    connect(this->plugins_selector, SIGNAL(movedDown()), this, SLOT(setCategoryChanged()));
    connect(enabled_categories_listwidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
            SLOT(switchCategory(QListWidgetItem*, QListWidgetItem*)));

    connect(Nepomuk::CategoriesPool::self(), SIGNAL(categoriesChanged()),
            this, SLOT(reloadAvailableCategoriesList()));

    // Initialize machine
    m_machine = new QStateMachine();
    s1 = new QState();
    s2 = new QState();
    s3 = new QState();

    s1->addTransition(manageButton, SIGNAL(clicked()), s2);
    s2->addTransition(returnButton, SIGNAL(clicked()), s1);

    m_machine->addState(s1);
    m_machine->addState(s2);
    m_machine->setInitialState(s1);

    connect(s1, SIGNAL(entered()), this, SLOT(reloadEnabledCategoriesList()));
    connect(s2, SIGNAL(exited()), this, SLOT(syncEnabledCategoriesList()));
    s1->assignProperty(stackedWidget, "currentIndex", 0);
    s2->assignProperty(stackedWidget, "currentIndex", 1);

    // Initialize validator
    m_catvalidator = new CategoryNameValidator(this);

    // Inilialize buttons
    this->add_button->setGuiItem(KStandardGuiItem::add());
    this->add_button->setText(QString());
    this->remove_button->setGuiItem(KStandardGuiItem::remove());
    this->remove_button->setText(QString());
    connect(this->add_button, SIGNAL(clicked()), this, SLOT(addButton()));

    // no need to query endless numbers of results when we only want to create a query
    Nepomuk::Query::Query baseQuery;
    baseQuery.setLimit(10);
    queryBuilder->setBaseQuery(baseQuery);
}
Beispiel #2
0
void TDEActionSelector::buttonUpClicked()
{
  int c = d->selectedListBox->currentItem();
  if ( c < 1 ) return;
  TQListBoxItem *item = d->selectedListBox->item( c );
  d->selectedListBox->takeItem( item );
  d->selectedListBox->insertItem( item, c-1 );
  d->selectedListBox->setCurrentItem( item );
  emit movedUp( item );
}
Beispiel #3
0
View::View(VideoPlayer* player, Screen* screen) :
    QWidget(screen),
    ui(new Ui::View),
    overlayUi(new Ui::ViewOverlay),
    screen(screen),
    player(player),
    overlay(new QWidget),
    isMovable(false),
    awesome(0)
{
    // setup UI
    ui->setupUi(this);
    overlayUi->setupUi(overlay);

    overlay->setParent(this);

    ui->zoomedLabel->hide();

    QVBoxLayout* layout = new QVBoxLayout;
    ui->video->setLayout(layout);

    player->setWidget(ui->video);

    awesome = new QtAwesome(this);
    awesome->initFontAwesome();
    awesome->setDefaultOption("color", QColor(255,255,255));
    awesome->setDefaultOption("color-disabled", QColor(127,127,127));
    awesome->setDefaultOption("color-active", QColor(255,255,255));
    awesome->setDefaultOption("color-selected", QColor(255,255,255));

    ui->moveButton->setIcon(awesome->icon(fa::arrows));
    ui->settingsButton->setIcon(awesome->icon(fa::cog));
    ui->zoomButton->setIcon(awesome->icon(fa::expand));
    ui->removeButton->setIcon(awesome->icon(fa::times));

    overlayUi->moveUpButton->setIcon(awesome->icon(fa::arrowcircleup));
    overlayUi->moveDownButton->setIcon(awesome->icon(fa::arrowcircledown));
    overlayUi->moveLeftButton->setIcon(awesome->icon(fa::arrowcircleleft));
    overlayUi->moveRightButton->setIcon(awesome->icon(fa::arrowcircleright));

    connect(ui->moveButton, SIGNAL(toggled(bool)), this, SLOT(setMovable(bool)));
    connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(openSettings()));

    connect(overlayUi->settingsButton, SIGNAL(clicked()), this, SLOT(openSettings()));

    connect(ui->zoomButton, SIGNAL(toggled(bool)), this, SLOT(setZoomed(bool)));
    connect(ui->removeButton, SIGNAL(clicked()), this, SIGNAL(removed()));
    connect(overlayUi->moveUpButton, SIGNAL(clicked()), this, SIGNAL(movedUp()));
    connect(overlayUi->moveDownButton, SIGNAL(clicked()), this, SIGNAL(movedDown()));
    connect(overlayUi->moveLeftButton, SIGNAL(clicked()), this, SIGNAL(movedLeft()));
    connect(overlayUi->moveRightButton, SIGNAL(clicked()), this, SIGNAL(movedRight()));
}
/*!
 * \brief Move the scene up
 */
void
ControlWidget::moveUp()
{
    emit movedUp();
}