Exemplo n.º 1
0
void ScreenshotManager::clearHistory()
{
  QSqlQuery clearQuery("DROP TABLE history");
  clearQuery.exec();

  initHistory();
}
Exemplo n.º 2
0
void SearchEdit::keyPressEvent(QKeyEvent *event)
{
    switch (event->key()) {
    case Qt::Key_Escape:
        clearQuery();
        event->accept();
        break;
    case Qt::Key_Return:
        emit m_treeView->activated(m_treeView->selectionModel()->currentIndex());
        event->accept();
        break;
    case Qt::Key_Down:
    case Qt::Key_Up: {
        const QModelIndex index = m_treeView->currentIndex();
        const int nextRow = index.row() + (event->key() == Qt::Key_Down ? 1 : -1);
        if (nextRow >= 0 && nextRow < m_treeView->model()->rowCount()) {
            const QModelIndex sibling = index.sibling(nextRow, 0);
            m_treeView->setCurrentIndex(sibling);
        }
        event->accept();
        break;
    }
    default:
        QLineEdit::keyPressEvent(event);
        break;
    }
}
Exemplo n.º 3
0
void Katapult::initAccel(QWidget *parent)
{
    globalAccel = new KGlobalAccel(parent);
    globalAccel->insert("show_katapult", i18n("Show Launcher"), i18n("Shows the Katapult launcher"), ALT+Key_Space, ALT+Key_Space,
                        this, SLOT(showLauncher()));
    globalAccel->readSettings();
    globalAccel->updateConnections();

    actions = new KActionCollection(parent);
    actionCollection()->clear();

    contextMenu()->clear();

    new KAction(i18n("Execute"), "exec", Key_Return, this, SLOT(execute()), actions, "execute");
    new KAction(i18n("Clear"), "editclear", Key_Left, this, SLOT(clearQuery()), actions, "clear");
    new KAction(i18n("Close"), "fileclose", Key_Escape, this, SLOT(hideLauncher()), actions, "close");
    new KAction(i18n("Complete Query"), "next", Key_Right, this, SLOT(completeQuery()), actions, "complete_query");
    new KAction(i18n("Show Context Menu"), "menu", CTRL+Key_C, this, SLOT(showContextMenu()), actions, "show_menu");

    KAction *actGlobAccel = KStdAction::keyBindings(this, SLOT(showGlobalShortcutsDialog()), actions);
    actGlobAccel->setText(i18n("Configure &Global Shortcuts..."));
    actGlobAccel->plug((QWidget *) contextMenu());

    KStdAction::keyBindings(this, SLOT(showShortcutsDialog()), actions)->plug((QWidget *) contextMenu());
    KStdAction::preferences(settings, SLOT(configure()), actions)->plug((QWidget *) contextMenu());

    contextMenu()->insertSeparator();
    KStdAction::aboutApp(this, SLOT(showAboutDialog()), actions)->plug((QWidget *) contextMenu());
    contextMenu()->insertSeparator();

    KStdAction::quit(this, SLOT(close()), actions)->plug((QWidget *) contextMenu());

    actions->readShortcutSettings();
}
Exemplo n.º 4
0
void ompl::geometric::SPARStwo::clear()
{
    Planner::clear();
    clearQuery();
    resetFailures();
    iterations_ = 0;
    bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());
    freeMemory();
    if (nn_)
        nn_->clear();
}
Exemplo n.º 5
0
void ompl::geometric::LazyPRM::clear()
{
    Planner::clear();
    freeMemory();
    if (nn_)
        nn_->clear();
    clearQuery();

    componentCount_ = 0;
    iterations_ = 0;
    bestCost_ = base::Cost(std::numeric_limits<double>::quiet_NaN());
}
Exemplo n.º 6
0
void ompl::geometric::SPARS::clear(void)
{
    Planner::clear();
    sampler_.reset();
    simpleSampler_.reset();
    freeMemory();
    if (nn_)
        nn_->clear();
    if (snn_)
        snn_->clear();
    clearQuery();
    resetFailures();
    iterations_ = 0;
}
Exemplo n.º 7
0
Katapult::Katapult()
    : KSystemTray(0, "katapultSysTray"),
      DCOPObject("Katapult")
{
    // Register with DCOP
    kapp->dcopClient()->registerAs("katapult", false);
    kapp->dcopClient()->setDefaultObject(objId());

    setPixmap(KGlobal::iconLoader()->loadIcon("katapult", KIcon::Small));

    display = 0;
    globalAccel = 0;
    actions = 0;
    action = 0;
    executing = FALSE;
    _query = "";

    settings = new KatapultSettings();

    loadCatalogPlugins();
    initDisplay();

    hideTimer = new QTimer(this);
    connect(hideTimer, SIGNAL(timeout()), this, SLOT(hideLauncher()));
    clearTimer = new QTimer(this);
    connect(clearTimer, SIGNAL(timeout()), this, SLOT(clearQuery()));

    connect(settings, SIGNAL(catalogsChanged()), this, SLOT(loadCatalogPlugins()));
    connect(settings, SIGNAL(displayChanged()), this, SLOT(initDisplay()));
    connect(settings, SIGNAL(systrayChanged()), this, SLOT(updateSystray()));

    if(settings->systrayIcon())
    {
        show();
    }

}
Exemplo n.º 8
0
void ompl::geometric::SPARS::setProblemDefinition(const base::ProblemDefinitionPtr &pdef)
{
    Planner::setProblemDefinition(pdef);
    clearQuery();
}
Exemplo n.º 9
0
void ZealSearchEdit::clear()
{
    clearQuery();
}
Exemplo n.º 10
0
void SearchEdit::clear()
{
    clearQuery();
}