20#include "kptmilestoneprogresspanel.h"
22#include <tqcheckbox.h>
24#include <kdatetimewidget.h>
26#include <tdemessagebox.h>
32#include "kptcommand.h"
37MilestoneProgressPanel::MilestoneProgressPanel(
Task &task, TQWidget *parent,
const char *name)
38 : MilestoneProgressPanelImpl(parent, name),
41 kdDebug()<<k_funcinfo<<endl;
42 m_progress = task.progress();
43 finished->setChecked(m_progress.finished);
44 finishTime->setDateTime(m_progress.finishTime);
51bool MilestoneProgressPanel::ok() {
52 m_progress.started = finished->isChecked();
53 m_progress.finished = finished->isChecked();
54 m_progress.startTime = finishTime->dateTime();
55 m_progress.finishTime = finishTime->dateTime();
56 m_progress.percentFinished = m_progress.finished ? 100 : 0;
60KCommand *MilestoneProgressPanel::buildCommand(Part *part) {
62 TQString c = i18n(
"Modify progress");
63 if (m_task.progress() != m_progress) {
64 cmd =
new TaskModifyProgressCmd(part, m_task, m_progress, c);
71MilestoneProgressPanelImpl::MilestoneProgressPanelImpl(TQWidget *parent,
const char *name, WFlags f)
72 : MilestoneProgressPanelBase(parent, name, f) {
74 connect(finished, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(slotFinishedChanged(
bool)));
75 connect(finished, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(slotChanged()));
77 connect(finishTime, TQ_SIGNAL(valueChanged(
const TQDateTime &)), TQ_SLOT(slotChanged()));
81void MilestoneProgressPanelImpl::slotChanged() {
85void MilestoneProgressPanelImpl::slotFinishedChanged(
bool state) {
87 if (!finishTime->dateTime().isValid()) {
88 finishTime->setDateTime(TQDateTime::currentDateTime());
95void MilestoneProgressPanelImpl::enableWidgets() {
96 finished->setEnabled(
true);
97 finishTime->setEnabled(finished->isChecked());
103#include "kptmilestoneprogresspanel.moc"
A task in the scheduling software is represented by this class.