コード例 #1
0
bool ImageOrientationOperationsMapper::requiresHorizontalFlip()
{
    if (m_hasToUpdateOperations)
    {
        updateOperations();
    }
    return m_horizontalFlip;
}
コード例 #2
0
int ImageOrientationOperationsMapper::getNumberOfClockwiseTurnsToApply()
{
    if (m_hasToUpdateOperations)
    {
        updateOperations();
    }
    return m_clockwiseTurns;
}
コード例 #3
0
ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source, QWidget *parent)
    : QDialog(parent),
      m_engine(engine),
      m_service(0),
      m_source(source),
      m_operationCount(0),
      m_operationButton(new QPushButton(i18n("Start Operation"), this))
{
    setAttribute(Qt::WA_DeleteOnClose);
    QWidget* mainWidget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout();

    QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
    buttonBox->addButton(m_operationButton, QDialogButtonBox::ActionRole);
    buttonBox->addButton(QDialogButtonBox::Close);

    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    layout->addWidget(mainWidget);
    layout->addWidget(buttonBox);
    setLayout(layout);

    setupUi(mainWidget);
    m_operationStatus->hide();

    connect(m_operationButton, SIGNAL(clicked()), this, SLOT(startOperation()));
    m_operationButton->setEnabled(false);

    connect(m_operations, SIGNAL(currentIndexChanged(QString)),
            this, SLOT(operationSelected(QString)));

    QString engineName = i18nc("Plasma engine with unknown name", "Unknown");
    QString serviceName = i18nc("Plasma service with unknown name", "Unknown");

    if (m_engine) {
        engineName = KStringHandler::capwords(m_engine->pluginInfo().name());
        qDebug() << "########### CALLING SERVICE FOR SOURCE: " << m_source;
        m_service = m_engine->serviceForSource(m_source);

        if (m_service != 0) {
            serviceName = m_service->name();
            updateOperations();
            connect(m_service, SIGNAL(operationsChanged()), this, SLOT(updateOperations()));
            connect(m_engine, SIGNAL(destroyed(QObject*)), this, SLOT(engineDestroyed()));
        } else {