Esempio n. 1
0
KTimerPref::KTimerPref( QWidget *parent)
    : QDialog( parent )
{
    d = new KTimerPrefPrivate;

    setupUi(this);

    // set icons
    m_stop->setIcon( QIcon::fromTheme( QStringLiteral( "media-playback-stop" )) );
    m_pause->setIcon( QIcon::fromTheme( QStringLiteral( "media-playback-pause" )) );
    m_start->setIcon( QIcon::fromTheme( QStringLiteral( "arrow-right" )) );

    // create tray icon
    KStatusNotifierItem *tray = new KStatusNotifierItem(this);
    tray->setIconByName(QStringLiteral( "ktimer" ));
    tray->setCategory(KStatusNotifierItem::ApplicationStatus);
    tray->setStatus(KStatusNotifierItem::Active);
    // set help button gui item
    KGuiItem::assign(m_help,KStandardGuiItem::help());

    // Exit
    QAction *exit = KStandardAction::quit(this, SLOT(exit()), this);
    addAction(exit);

    // connect
    connect(m_add, &QPushButton::clicked, this, &KTimerPref::add);
    connect(m_remove, &QPushButton::clicked, this, &KTimerPref::remove);
    connect(m_help, &QPushButton::clicked, this, &KTimerPref::help);
    connect(m_list, &QTreeWidget::currentItemChanged, this, &KTimerPref::currentChanged);
    loadJobs( KSharedConfig::openConfig().data() );

    show();
}
Esempio n. 2
0
void __fastcall TfrmRetrievalJobList::btnResetJobsClick(TObject *Sender) {
/** for debugging: set all retrieval jobs back to their initial states */
    ostringstream oss; oss<<__FUNC__<<": reset jobs"; debugLog(oss.str().c_str());

    // might be good to be able to delete specific jobs,
    // though would have to iterate through boxes to delete lcr records
    LCDbCryoJob * job = ((LCDbCryoJob *)(sgJobs->Objects[0][sgJobs->Row]));
    if (NULL == job) return;

    LQuery qc(LIMSDatabase::getCentralDb()), qc2(LIMSDatabase::getCentralDb());
    qc.setSQL("select rj_box_cid from c_box_retrieval where retrieval_cid = :rtid");
    qc.setParam("rtid", job->getID());
    qc.open();
    while (!qc.eof()) {
        int rj_box_cid = qc.readInt("rj_box_cid");
        qc2.setSQL("delete from l_cryovial_retrieval where rj_box_cid = :rjbid");
        qc2.setParam("rjbid", rj_box_cid);
        qc2.execSQL();
        qc.next();
    }
    qc.setSQL("delete from c_box_retrieval where retrieval_cid = :rtid");
    qc.setParam("rtid", job->getID());
	qc.execSQL();
	qc.setSQL("update c_retrieval_job set status = :new where retrieval_cid = :rtid");
    qc.setParam("rtid", job->getID());
	qc.setParam("new", LCDbCryoJob::NEW_JOB); // NEW_JOB, INPROGRESS, DONE
    qc.execSQL();
    loadJobs();
}
Esempio n. 3
0
int main(int argc, char** argv) {
    DataPoint p;
    KnowledgeSource a(0);
    a.connectKS();
    p.wrap(0);
    a.update(p);
    a.disconnectKS();
    KnowledgeSource b(1);
    b.connectKS();
    p.wrap(1);
    b.update(p);
    b.disconnectKS();

    // load joblist
    log("Loading initial jobs...\n");
    loadJobs();

    JobManager::getInstance()->__debug__print();

    log("Starting event loop...\n");
    // CS event loop
    JobManager::getInstance()->eventLoop();

    return 0;
}
Esempio n. 4
0
/*              Main Body                   */
int main(int argc, char *argv[])
{
    /*          PRINTF OVERRIDE                */
    if (LOG_MODE)
    {
        FILE *log_file;
        if((log_file=freopen("JBUP_LOG_FILE", "a" ,stdout))==NULL)
        {
            printf("Cannot open LOG.\n");
            exit(1);
        }
    } // END IF LOG_MODE
    
    jobs jlist [MAX_JOBS];
    
    int result = 0;
    int number_of_jobs = 0;
    
    number_of_jobs = loadJobs( jlist ); 
    
    result = doJobs( jlist, number_of_jobs );

    if(BUGS) printf("\n\n\tNumber of jobs loaded : %i \n\n", number_of_jobs);

    /*       DEV C++     */
    system("PAUSE");
    return EXIT_SUCCESS;
}
Esempio n. 5
0
void KMThreadJob::updateManager(KMJobManager *mgr)
{
	loadJobs();
	TQIntDictIterator<KMJob>	it(m_jobs);
	for (;it.current();++it)
	{
		KMJob	*job = new KMJob(*(it.current()));
		mgr->addJob(job);
	}
}
Esempio n. 6
0
void KMThreadJob::createJob(KMJob *job)
{
	if (job->id() > 0)
	{
		loadJobs();
		if (!m_jobs.find(job->id()))
		{
			m_jobs.insert(job->id(),job);
			saveJobs();
		}
	}
}
Esempio n. 7
0
void TfrmRetrievalJobList::init() {
    cbLog->Checked      = false;//RETRASSTDEBUG;
    cbLog->Visible      = true;//= RETRASSTDEBUG;
	panelDebug->Visible = cbLog->Checked;

    sgwJobs = new StringGridWrapper<LCDbCryoJob>(sgJobs, &vecJobs);
    sgwJobs->addCol("boxset",   "Box set",          30);
    sgwJobs->addCol("desc",     "Description",      312);
    sgwJobs->addCol("type",     "Job type",         95);
    sgwJobs->addCol("status",   "Status",           82);
    sgwJobs->addCol("primary",  "Primary Aliquot",  84);
    sgwJobs->addCol("secondary","Secondary Aliquot",94);
    sgwJobs->addCol("project",  "Project",          103);
    sgwJobs->addCol("reason",   "Reason",           155);
    sgwJobs->addCol("start",    "Started",          74);
    sgwJobs->addCol("finish",   "Finished",         74);
    sgwJobs->addCol("claimed",  "Claimed until",    74);
    sgwJobs->init();

    initCustom();
    loadJobs();
}
Esempio n. 8
0
void __fastcall TfrmRetrievalJobList::cbSampleDiscardClick(TObject *Sender) { loadJobs(); }
Esempio n. 9
0
void __fastcall TfrmRetrievalJobList::cbBoxMoveClick(TObject *Sender) { loadJobs(); }
Esempio n. 10
0
void __fastcall TfrmRetrievalJobList::cbRejectedClick(TObject *Sender) { loadJobs(); }
Esempio n. 11
0
void __fastcall TfrmRetrievalJobList::cbInProgressClick(TObject *Sender) { loadJobs(); }