Пример #1
0
void MainWindow::emitAddDirector()
{
    connect(this,SIGNAL(addDirector(QString,QDate)),db,SLOT(addDirector(QString,QDate)));
    emit addDirector(ui->directorNameLineEdit->text(),ui->directorDateEdit->date());
    disconnect(this,SIGNAL(addDirector(QString,QDate)),db,SLOT(addDirector(QString,QDate)));
    ui->statusBar->showMessage("Director added",3000);
    refreshUi();
}
Пример #2
0
void MainWindow::emitAddGener()
{
    connect(this,SIGNAL(addGener(QString)),db,SLOT(addGener(QString)));
    emit addGener(ui->generNameLineEdit->text());
    disconnect(this,SIGNAL(addGener(QString)),db,SLOT(addGener(QString)));
    ui->statusBar->showMessage("Gener added",3000);
    refreshUi();
}
Пример #3
0
void MainWindow::loadDb(QString dbFile)
{
    db = new dbworker(dbFile);
    resultTable = new tableWidget();
    connect(this,SIGNAL(showResult(QString)),resultTable,SLOT(showExecutedQuery(QString)));
    connect(ui->editMoviesTable,SIGNAL(triggered()),resultTable,SLOT(editMoviesTable()));
    connect(ui->editGenersTable,SIGNAL(triggered()),resultTable,SLOT(editGenersTable()));
    connect(ui->editActorsTable,SIGNAL(triggered()),resultTable,SLOT(editActorsTable()));
    connect(ui->editDirectTable,SIGNAL(triggered()),resultTable,SLOT(editDirectTable()));
    ui->tabWidget->setDisabled(false);
    refreshUi();
}
Пример #4
0
void MainWindow::emitAddMovie()
{
    QStringList test;
    test << "1"<<"2"<<"23"<<"32";
    connect(this,SIGNAL(addMovie(int,QString,QDate,QString,QTime,int)),db,
            SLOT(addMovie(int,QString,QDate,QString,QTime,int)));
    emit addMovie(ui->movieDirectorSelector->currentIndex()+1,ui->movieNameLineEdit->text(),
                  ui->movieDateEdit->date(),
                  ui->movieAddedActors->text().remove(ui->movieAddedActors->text().length()-1,1),
                  ui->movieTimeEdit->time(),ui->movieGenerSelector->currentIndex()+1);
    disconnect(this,SIGNAL(addMovie(int,QString,QDate,QString,QTime,int)),db,
               SLOT(addMovie(int,QString,QDate,QString,QTime,int)));
    ui->statusBar->showMessage("Movie added",3000);
    refreshUi();
}
Пример #5
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);
}
Пример #6
0
void FrameGenerator::refreshUi() {
    refreshUi(true);
}