Esempio n. 1
0
int runCli(Arguments & args)
{
    QImage * image = new QImage(args.getSource());

    if (image->format() != QImage::Format_RGB32)
    {
        /* For working with image with QImage::bits()
         * and qRed(), qGreen() and qBlue() functions. */
        *image = image->convertToFormat(QImage::Format_RGB32);
    }

    if (image->isNull())
    {
        fatal(QObject::tr("Unable to load source image."));
    }

    processFilters(image, args.getFilters());

    bool ok = image->save(args.getDestination());

    if (!ok)
    {
        fatal(QObject::tr("Unable to save result image."));
    }

    return 0;
}
Esempio n. 2
0
void PlaylistTab::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type())
    {
    case QEvent::LanguageChange:
        _selectType->setItemText(0, tr("All"));
        _selectType->setItemText(1, tr("TV"));
        for (int i = 2; i < _selectType->count(); i++)
            _selectType->setItemText(i, Channel::types()[i-2]);
        _selectCategory->setItemText(0, tr("All categories"));
        _selectLanguage->setItemText(0, tr("All languages"));
        processFilters();
        break;
    default:
        break;
    }
}
Esempio n. 3
0
RecorderNewDialog::RecorderNewDialog(bool quick,
                                     TimersModel *timers,
                                     PlaylistModel *playlist,
                                     QWidget *parent)
    : QDialog(parent),
      ui(new Ui::RecorderNewDialog),
      _currentChannel(0),
      _currentTimer(0)
{
    setWindowModality(Qt::WindowModal);

    ui->setupUi(this);

    _model = timers;
    ui->playlistWidget->setPlaylistModel(playlist);

    if (quick)
        ui->buttonTimer->hide();
    else
        ui->buttonRecord->hide();

    ui->search->setButtonPixmap(FancyLineEdit::Left, QIcon::fromTheme("edit-find").pixmap(16));
    ui->search->setButtonPixmap(FancyLineEdit::Right, QIcon::fromTheme("edit-clear").pixmap(16));
    ui->search->setButtonVisible(FancyLineEdit::Left, true);
    ui->search->setButtonVisible(FancyLineEdit::Right, true);
    ui->search->setAutoHideButton(FancyLineEdit::Right, true);

    connect(ui->buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->buttonTimer, SIGNAL(clicked()), this, SLOT(processNewTimer()));
    connect(ui->buttonRecord, SIGNAL(clicked()), this, SLOT(processQuickRecord()));
    connect(ui->editName, SIGNAL(textChanged(QString)), this, SLOT(validate()));
    connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(processFilters()));
    connect(ui->search, SIGNAL(rightButtonClicked()), ui->search, SLOT(clear()));

    connect(ui->playlistWidget, SIGNAL(itemSelected(Channel *)), this, SLOT(playlist(Channel *)));
}
void QMFStorePrivate::messagesUpdated(const QMailMessageIdList &ids)
{
    processFilters(ids, &QMFStorePrivate::messageUpdated);
}
Esempio n. 5
0
void QMessageStorePrivate::messagesRemoved(const QMailMessageIdList &ids)
{
    processFilters(ids, &QMessageStorePrivate::messageRemoved);
}
Esempio n. 6
0
PlaylistTab::PlaylistTab(QWidget *parent)
    : QMainWindow(parent)
{
    _playlistWidget = new PlaylistDisplayWidget(this);
    _playlistWidget->playMode();
    setCentralWidget(_playlistWidget);

    _toolbarTop = new QToolBar(this);
    _toolbarTop->setMovable(false);
    _toolbarTop->setFloatable(false);
    _toolbarTop->setIconSize(QSize(16, 16));
    _toolbarTop->setMinimumHeight(24);
    _toolbarTop->setMaximumHeight(24);
    addToolBar(Qt::TopToolBarArea, _toolbarTop);

    _toolbarBottomSearch = new QToolBar(this);
    _toolbarBottomSearch->setMovable(false);
    _toolbarBottomSearch->setFloatable(false);
    _toolbarBottomSearch->setProperty("topBorder", true);
    _toolbarBottomSearch->setMinimumHeight(24);
    _toolbarBottomSearch->setMaximumHeight(24);
    addToolBar(Qt::BottomToolBarArea, _toolbarBottomSearch);
    insertToolBarBreak(_toolbarBottomSearch);

    _toolbarBottomType = new QToolBar(this);
    _toolbarBottomType->setMovable(false);
    _toolbarBottomType->setFloatable(false);
    _toolbarBottomType->setProperty("topBorder", true);
    _toolbarBottomType->setMinimumHeight(24);
    _toolbarBottomType->setMaximumHeight(24);
    addToolBar(Qt::BottomToolBarArea, _toolbarBottomType);
    insertToolBarBreak(_toolbarBottomType);

    _labelPlaylist = new QLabel(this);
    _labelPlaylist->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _labelPlaylist->setAlignment(Qt::AlignCenter);
    _toolbarTop->addWidget(_labelPlaylist);

    _selectType = new QComboBox(this);
    _selectType->addItem(tr("All"));
    _selectType->addItem(tr("TV"));
    _selectType->addItems(Channel::types());
    _selectType->setProperty("inverse", true);
    _toolbarTop->addWidget(_selectType);

    _selectCategory = new QComboBox(this);
    _selectCategory->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _selectLanguage = new QComboBox(this);
    _selectLanguage->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _selectLanguage->setProperty("hideborder", true);
    _toolbarBottomType->addWidget(_selectCategory);
    _toolbarBottomType->addWidget(_selectLanguage);

    _search = new FancyLineEdit(this);
    _search->setButtonPixmap(FancyLineEdit::Left, QIcon::fromTheme("edit-find").pixmap(16));
    _search->setButtonPixmap(FancyLineEdit::Right, QIcon::fromTheme("edit-clear").pixmap(16));
    _search->setButtonVisible(FancyLineEdit::Left, true);
    _search->setButtonVisible(FancyLineEdit::Right, true);
    _search->setAutoHideButton(FancyLineEdit::Right, true);
    _toolbarBottomSearch->addWidget(_search);

    connect(_selectType, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_selectCategory, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_selectLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_search, SIGNAL(textChanged(QString)), this, SLOT(processFilters()));
    connect(_search, SIGNAL(rightButtonClicked()), _search, SLOT(clear()));
}