예제 #1
0
void KOEventEditor::loadDefaults()
{
  QDateTime from( QDate::currentDate(), KOPrefs::instance()->mStartTime.time() );
  int addSecs = ( KOPrefs::instance()->mDefaultDuration.time().hour() * 3600 ) +
                ( KOPrefs::instance()->mDefaultDuration.time().minute() * 60 );
  QDateTime to( from.addSecs( addSecs ) );

  setDates( from, to, false );
}
예제 #2
0
void
PlotWidget::addPlot (QString plugin, int row, QString name)
{
  PluginFactory fac;
  Plugin *plug = fac.load(plugin);
  if (! plug)
    return;

  PluginData pd;
  pd.command = QString("settings");
  if (! plug->command(&pd))
    return;
  
  Entity *settings = pd.settings;
  settings->setName(name);
  
  _settings.insert(name, settings);
  
  addPlotSettings(settings);

  QVariant *tset = settings->get(QString("row"));
  if (tset)
    tset->setValue(row);

  Plot *plot = new Plot(name, 0);
  plot->setMinimumHeight(30);
  _plots.insert(name, plot);
  
  _csplitter->insertWidget(row, plot);

  plot->setStartIndex(_cw->scrollBarValue());
  
  // connect all we need here
  connect(plot, SIGNAL(signalResizeScrollBar(Plot *)), _cw, SLOT(resizeScrollBar(Plot *)));
  connect(this, SIGNAL(signalClear()), plot, SLOT(clear()));
  connect(this, SIGNAL(signalDraw()), plot, SLOT(updatePlot()));
  connect(this, SIGNAL(signalSetDates()), plot, SLOT(setDates()));
  connect(this, SIGNAL(signalBarLength(int)), plot, SLOT(setBarLength(int)));
  connect(this, SIGNAL(signalIndex(int)), plot, SLOT(setStartIndex(int)));
  connect(plot, SIGNAL(signalMessage(QString)), this, SIGNAL(signalMessage(QString)));
  connect(plot, SIGNAL(signalDeleteMarkers(QStringList)), this, SLOT(deleteMarkers(QStringList)));
}
예제 #3
0
void PlotWidget::addPlot (QString plugin, int row, QString name)
{
  qWarning() << "PlotWidget::addPlot - " << name;
  IIndicatorPlugin *plug = dynamic_cast<IIndicatorPlugin*>(((PluginFactory*)PluginFactory::getPluginFactory())->loadPlugin(plugin));
  if (! plug)
    return;

  Entity *settings = plug->querySettings();

  settings->setName(name);
  _settings.insert(name, settings);
  
  addPlotSettings(settings);

  QVariant *tset = settings->get(QString("row"));
  if (tset)
    tset->setValue(row);

  Plot *plot = new Plot(name, 0);
  plot->setMinimumHeight(30);

  _plots.insert(name, plot);
  _csplitter->insertWidget(row, plot);

  plot->setStartIndex(_controlWidget->scrollBarValue());

  // connect all we need here
  connect(plot, SIGNAL(signalResizePanScrollBar(Plot *)), _controlWidget, SLOT(resizePanScrollBar(Plot *)));
  connect(this, SIGNAL(signalClear()), plot, SLOT(clear()));
  connect(this, SIGNAL(signalDraw()), plot, SLOT(updatePlot()));
  connect(this, SIGNAL(signalSetDates()), plot, SLOT(setDates()));
  connect(this, SIGNAL(signalBarLength(int)), plot, SLOT(setBarLength(int)));
  connect(this, SIGNAL(signalIndex(int)), plot, SLOT(setStartIndex(int)));
  connect(plot, SIGNAL(signalMessage(QString)), this, SIGNAL(signalMessage(QString)));
  connect(plot, SIGNAL(signalDeleteMarkers(QStringList)), this, SLOT(deleteMarkers(QStringList)));
  connect(_controlWidget, SIGNAL(signalRange(int)), plot, SLOT(setPage(int)));

}
EditeurTache::EditeurTache(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::EditeurTache)
{
    ui->setupUi(this);
    this->setModal(true);
    ui->stackedWidget->setCurrentIndex(0);
    ui->dateEditDispo->setDate(QDate::currentDate());
    ui->dateEditEch->setDate(QDate::currentDate());

    ui->comboBoxProjet->addItem(" ");
    ui->comboBoxMere->addItem(" ");
    //boucle pour remplir la combobox proposant les projets
    for(QMap<QString, Projet*>::const_iterator it= ProjetManager::getInstance().getProjets().cbegin();it!=ProjetManager::getInstance().getProjets().cend(); it++){
        if ((*it)->getDateEcheance()>=QDate::currentDate())
            ui->comboBoxProjet->addItem((*it)->getNom());
    }

    QObject::connect(ui->radioButtonUnit, SIGNAL(clicked(bool)),this,SLOT(showPropUnit(bool)));//affiche la partie demandant les prop des taches unitaire
    QObject::connect(ui->radioButtonComp, SIGNAL(clicked(bool)),this,SLOT(showPropComp(bool)));//affiche la partie demandant les prop des taches composites
    QObject::connect(ui->comboBoxProjet, SIGNAL(currentIndexChanged(QString)), this, SLOT(remplirComboMere(QString))); //affiche les tâches mères possible en fonction du projet séléctionné
    QObject::connect(ui->comboBoxProjet, SIGNAL(currentIndexChanged(QString)), this, SLOT(setDates(QString)));//Par défaut, initialise les dates de dispo et d'échéance en fonction de celles du projet
    QObject::connect(ui->pushButtonAjouter, SIGNAL(clicked()), this, SLOT(choixPrec()));//affiche nouvelle fenetre pour choisir les taches de précédence
    QObject::connect(ui->pushButtonOK, SIGNAL(clicked()), this, SLOT(enregisterTache()));
    QObject::connect(ui->pushButtonOK, SIGNAL(clicked()),parent,SLOT(updateTree()));
    QObject::connect(ui->pushButtonAnnuler, SIGNAL(clicked()),this,SLOT(close()));
    QObject::connect(this, SIGNAL(finished(int)),parent,SLOT(updateTree()));
}
예제 #5
0
void KOTodoEditor::loadDefaults()
{
    kdDebug(5850) << k_funcinfo << endl;
    setDates(QDateTime::currentDateTime().addDays(7), true, 0);
    mGeneral->toggleAlarm(true);
}