void BookmarksWindow::setupConnections()
{
	connect(addButton,SIGNAL(clicked()),this, SLOT(on_addButton_clicked()));
	connect(addBookmarkWindow, SIGNAL(addBookmark(Bookmark *)), this, SLOT(addBookmarkItem(Bookmark *)));
	connect(removeButton,SIGNAL(clicked()),this, SLOT(on_removeButton_clicked()));
	connect(closeButton,SIGNAL(clicked()),this,SLOT(on_closeButton_clicked()));
	connect(loadButton,SIGNAL(clicked()),this,SLOT(on_loadButton_clicked()));
	connect(saveButton,SIGNAL(clicked()),this,SLOT(on_saveButton_clicked()));
	connect(openButton,SIGNAL(clicked()),this,SLOT(on_openButton_clicked()));
}
Beispiel #2
0
/**
 * Event filters on the task dialog
 */
bool TodoDialog::eventFilter(QObject *obj, QEvent *event) {
    if (event->type() == QEvent::KeyPress) {
        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);

        if (obj == ui->newItemEdit) {
            // set focus to the task list if Key_Down or Key_Tab
            // were pressed in the new item edit
            if ((keyEvent->key() == Qt::Key_Down) ||
                    (keyEvent->key() == Qt::Key_Tab)) {
                // choose an other selected item if current item is invisible
                QListWidgetItem *item = ui->todoList->currentItem();
                if ((item != NULL) && ui->todoList->currentItem()->isHidden() &&
                    (firstVisibleTodoListRow >= 0)) {
                    ui->todoList->setCurrentRow(firstVisibleTodoListRow);
                }

                // give the keyboard focus to the task list widget
                ui->todoList->setFocus();
                return true;
            }

            return false;
        } else if (obj == ui->todoList) {
            // set focus to the description edit if the tab key is pressed
            if (keyEvent->key() == Qt::Key_Tab) {
                ui->descriptionEdit->setFocus();
                return true;
            } else if ((keyEvent->key() == Qt::Key_Delete) ||
                       (keyEvent->key() == Qt::Key_Backspace)) {
                on_removeButton_clicked();
                return true;
            }

            return false;
        } else if (obj == ui->reminderDateTimeEdit) {
            // store the task and set focus to the description edit if the
            // return key is pressed
            if (keyEvent->key() == Qt::Key_Return) {
                on_saveButton_clicked();
                ui->descriptionEdit->setFocus();
                return true;
            }

            return false;
        }
    }

    return QDialog::eventFilter(obj, event);
}
MeltedPlaylistDock::MeltedPlaylistDock(QWidget *parent)
    : QDockWidget(parent)
    , ui(new Ui::MeltedPlaylistDock)
    , m_transportControl(new MeltedPlaylist::TransportControl(m_model))
{
    ui->setupUi(this);
    ui->tableView->setModel(&m_model);
    ui->tableView->setDragDropMode(QAbstractItemView::DragDrop);
    ui->tableView->setDropIndicatorShown(true);
    ui->tableView->setDragDropOverwriteMode(false);
    ui->tableView->setAcceptDrops(true);
    connect(&m_model, SIGNAL(loaded()), ui->tableView, SLOT(resizeColumnsToContents()));
    connect(&m_model, SIGNAL(dropped(QString,int)), this, SLOT(onDropped(QString,int)));
    connect(&m_model, SIGNAL(moveClip(int,int)), this, SLOT(onMoveClip(int,int)));
    connect(&m_model, SIGNAL(success()), this, SLOT(onSuccess()));
    connect(ui->actionAppendCut, SIGNAL(triggered()), this, SLOT(on_addButton_clicked()));
    connect(ui->actionRemove, SIGNAL(triggered()), this, SLOT(on_removeButton_clicked()));
}
Beispiel #4
0
void TodoDialog::setupUi() {
    setupMainSplitter();
    refreshUi();

    ui->newItemEdit->installEventFilter(this);
    ui->todoList->installEventFilter(this);
    ui->reminderDateTimeEdit->installEventFilter(this);

    ui->newItemEdit->setFocus();

    // adding shortcuts, that weren't working when defined in the ui file
    QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+S"), this);
    QObject::connect(shortcut, SIGNAL(activated()),
                     this, SLOT(on_saveButton_clicked()));
    shortcut = new QShortcut(QKeySequence("Ctrl+I"), this);
    QObject::connect(shortcut, SIGNAL(activated()),
                     this, SLOT(onSaveAndInsertButtonClicked()));
    shortcut = new QShortcut(QKeySequence("Ctrl+R"), this);
    QObject::connect(shortcut, SIGNAL(activated()),
                     this, SLOT(on_removeButton_clicked()));

    /*
     * setup the note button menu
     */
    QMenu *noteMenu = new QMenu();

    QAction *insertAction = noteMenu->addAction(
            tr("Save and insert into note"));
    insertAction->setIcon(QIcon::fromTheme(
            "document-save",
            QIcon(":icons/breeze-qownnotes/16x16/document-save.svg")));
    insertAction->setToolTip(tr("Save the current todo item and insert a link"
                                        " to it into the current note"));
    connect(insertAction, SIGNAL(triggered()),
            this, SLOT(onSaveAndInsertButtonClicked()));

    QAction *importAction = noteMenu->addAction(tr("Import as note"));
    importAction->setIcon(QIcon::fromTheme(
            "document-import",
            QIcon(":icons/breeze-qownnotes/16x16/document-import.svg")));
    importAction->setToolTip(tr("Import the current todo item as new note"));
    connect(importAction, SIGNAL(triggered()),
            this, SLOT(onImportAsNoteButtonClicked()));

    ui->noteButton->setMenu(noteMenu);

    /*
     * setup the reload button menu
     */
    QMenu *reloadMenu = new QMenu();

    QAction *reloadAction = reloadMenu->addAction(tr("Reload from server"));
    reloadAction->setIcon(QIcon::fromTheme(
            "view-refresh",
            QIcon(":icons/breeze-qownnotes/16x16/view-refresh.svg")));
    reloadAction->setToolTip(tr("Reload tasks from server"));
    connect(reloadAction, SIGNAL(triggered()),
            this, SLOT(reloadTodoList()));

    QAction *clearCacheAction = reloadMenu->addAction(
            tr("Clear cache and reload"));
    clearCacheAction->setIcon(QIcon::fromTheme(
            "trash-empty",
            QIcon(":icons/breeze-qownnotes/16x16/trash-empty.svg")));
    clearCacheAction->setToolTip(tr("Clear calendar cache and reload tasks "
                                            "from server"));
    connect(clearCacheAction, SIGNAL(triggered()),
            this, SLOT(clearCacheAndReloadTodoList()));

    ui->reloadTodoListButton->setMenu(reloadMenu);
}
void MeltedPlaylistDock::keyPressEvent(QKeyEvent *ev)
{
    if (ui->tableView->currentIndex().isValid())
    if (ev->key() == Qt::Key_Backspace || ev->key() == Qt::Key_Delete)
        on_removeButton_clicked();
}