Ejemplo n.º 1
0
void Client::processNotification(const QJsonObject &notification)
{
  if (notification["method"].toString() == "jobStateChanged") {
    QJsonObject params = notification["params"].toObject();
    emit jobStateChanged(
          static_cast<unsigned int>(params["moleQueueId"].toDouble()),
          params["oldState"].toString(), params["newState"].toString());
  }
}
Ejemplo n.º 2
0
void QueueLocal::jobStarted()
{
  QObject *theSender = QObject::sender();
  if (theSender) {
    qDebug() << "The job was successfully started:"
             << theSender->property("JOB_ID");
    int id = theSender->property("JOB_ID").toInt();
    m_jobs[id]->setStatus(Job::RUNNING);
    emit(jobStateChanged(0));
  }
}
Ejemplo n.º 3
0
void TransferManagerModel::addJobToList(QXmppTransferJob *job)
{
    beginInsertRows(QModelIndex(), m_jobList.count(), m_jobList.count());
    m_jobList << job;
    m_doneSize << 0;
    connect(job, SIGNAL(finished()),
            this, SLOT(jobFinished()) );
    connect(job, SIGNAL(progress(qint64,qint64)),
            this, SLOT(jobProgress(qint64,qint64)) );
    connect(job, SIGNAL(stateChanged(QXmppTransferJob::State)),
            this, SLOT(jobStateChanged(QXmppTransferJob::State)) );
    endInsertRows();
}
Ejemplo n.º 4
0
MainWindow::MainWindow()
  : m_ui(new Ui::MainWindow),
    m_logWindow(NULL),
    m_openWithManagerDialog(NULL),
    m_queueManagerDialog(NULL),
    m_minimizeAction(NULL),
    m_maximizeAction(NULL),
    m_restoreAction(NULL),
    m_trayIcon(NULL),
    m_trayIconMenu(NULL),
    m_statusTotalJobs(new QLabel(this)),
    m_statusHiddenJobs(new QLabel(this)),
    m_server(new Server (this))
{
  m_ui->setupUi(this);

  QIcon icon(":/icons/molequeue.png");
  setWindowIcon(icon);

  createActions();
  createActionFactories();
  createShortcuts();
  createMainMenu();
  createTrayIcon();
  createJobTable();
  createStatusBar();

  readSettings();

  connect(m_server, SIGNAL(connectionError(MoleQueue::ConnectionListener::Error,QString)),
          this, SLOT(handleServerConnectionError(MoleQueue::ConnectionListener::Error, QString)));

  connect(Logger::getInstance(), SIGNAL(firstNewErrorOccurred()),
          this, SLOT(errorOccurred()));
  connect(Logger::getInstance(), SIGNAL(newErrorCountReset()),
          this, SLOT(errorCleared()));
  connect(m_ui->errorNotificationLabel, SIGNAL(linkActivated(QString)),
          this, SLOT(handleErrorNotificationLabelAction(QString)));
  connect(m_server->jobManager(), SIGNAL(jobStateChanged(MoleQueue::Job,
                                                         MoleQueue::JobState,
                                                         MoleQueue::JobState)),
          this, SLOT(notifyJobStateChange(MoleQueue::Job,
                                          MoleQueue::JobState,
                                          MoleQueue::JobState)));

  m_server->start();

  m_ui->errorNotificationLabel->hide();
  m_trayIcon->show();
}
Ejemplo n.º 5
0
void QueueLocal::jobFinished()
{
  QObject *theSender = QObject::sender();
  if (theSender) {
    qDebug() << "The job was successfully finished:"
             << theSender->property("JOB_ID");
    int id = theSender->property("JOB_ID").toInt();
    m_jobs[id]->setStatus(Job::COMPLETE);
    emit(jobStateChanged(0));
    // Submit the next job if there is one
    ++m_currentJob;
    if (m_currentJob < m_jobs.size())
      runProgram(m_currentJob);
  }
}
Ejemplo n.º 6
0
void QueueLocal::jobFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
  QByteArray result = m_process->readAllStandardError();
  qDebug() << "Program output:" << result;
  qDebug() << "Return code:" << exitCode << exitStatus;

  QObject *theSender = QObject::sender();
  if (!theSender)
    return;

  qDebug() << "The job was successfully finished:"
           << theSender->property("JOB_ID");
  int id = theSender->property("JOB_ID").toInt();
  m_jobs[id]->setStatus(Job::COMPLETE);
  emit(jobStateChanged(0));
  // Submit the next job if there is one
  ++m_currentJob;
  if (m_currentJob < m_jobs.size())
    runProgram(m_currentJob);
}
Ejemplo n.º 7
0
 void RunManagerWatcher::stateChanged(const openstudio::UUID &id)
 {
   jobStateChanged(id);
 }
Ejemplo n.º 8
0
Archivo: jovie.cpp Proyecto: KDE/jovie
void Jovie::slotJobStateChanged(const QString& appId, int jobNum, KSpeech::JobState state)
{
    announceEvent(QLatin1String( "slotJobStateChanged" ), QLatin1String( "jobStateChanged" ), appId, jobNum, state);
    emit jobStateChanged(appId, jobNum, state);
}