summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todoentryimpl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index 6af229c..89f08e0 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -99,71 +99,72 @@ void NewTaskDialog::init()
99 m1->insertItem( picker ); 99 m1->insertItem( picker );
100 buttonDate->setPopup( m1 ); 100 buttonDate->setPopup( m1 );
101 comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); 101 comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") );
102 102
103 connect( picker, SIGNAL( dateClicked( int, int, int ) ), 103 connect( picker, SIGNAL( dateClicked( int, int, int ) ),
104 this, SLOT( dateChanged( int, int, int ) ) ); 104 this, SLOT( dateChanged( int, int, int ) ) );
105 105
106 buttonDate->setText( TimeString::longDateString( date ) ); 106 buttonDate->setText( TimeString::longDateString( date ) );
107 picker->setDate( date.year(), date.month(), date.day() ); 107 picker->setDate( date.year(), date.month(), date.day() );
108 lblDown->setPixmap(Resource::loadPixmap("down") ); 108 lblDown->setPixmap(Resource::loadPixmap("down") );
109} 109}
110 110
111/* 111/*
112 * Destroys the object and frees any allocated resources 112 * Destroys the object and frees any allocated resources
113 */ 113 */
114NewTaskDialog::~NewTaskDialog() 114NewTaskDialog::~NewTaskDialog()
115{ 115{
116 // no need to delete child widgets, Qt does it all for us 116 // no need to delete child widgets, Qt does it all for us
117} 117}
118void NewTaskDialog::dateChanged( int y, int m, int d ) 118void NewTaskDialog::dateChanged( int y, int m, int d )
119{ 119{
120 date = QDate( y, m, d ); 120 date = QDate( y, m, d );
121 buttonDate->setText( TimeString::longDateString( date ) ); 121 buttonDate->setText( TimeString::longDateString( date ) );
122} 122}
123 123
124/*! 124/*!
125*/ 125*/
126 126
127ToDoEvent NewTaskDialog::todoEntry() 127ToDoEvent NewTaskDialog::todoEntry()
128{ 128{
129 if( checkDate->isChecked() ){ 129 if( checkDate->isChecked() ){
130 todo.setDate( date ); 130 todo.setDate( date );
131 todo.setHasDate( true ); 131 todo.setHasDate( true );
132 }else{ 132 }else{
133 todo.setHasDate( false ); 133 todo.setHasDate( false );
134 } 134 }
135 if ( comboCategory->currentCategory() != -1 ) { 135 if ( comboCategory->currentCategory() != -1 ) {
136 QArray<int> arr = comboCategory->currentCategories(); 136 QArray<int> arr = comboCategory->currentCategories();
137 QStringList list; 137 QStringList list;
138 list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ; 138 list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ;
139 todo.setCategories( list ); 139 todo.setCategories( list );
140 } 140 }
141 todo.setPriority( comboPriority->currentItem() + 1 ); 141 todo.setPriority( comboPriority->currentItem() + 1 );
142 todo.setCompleted( checkCompleted->isChecked() ); 142 todo.setCompleted( checkCompleted->isChecked() );
143 143
144 todo.setDescription( txtTodo->text() ); 144 todo.setDescription( txtTodo->text() );
145 todo.setSummary( lneSum->text() ); 145 todo.setSummary( lneSum->text() );
146 QString text = cmbProg->currentText(); 146 QString text = cmbProg->currentText();
147 todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() ); 147 todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() );
148 return todo; 148 return todo;
149} 149}
150void NewTaskDialog::slotCopy() 150void NewTaskDialog::slotCopy()
151{ 151{
152 txtTodo->clear(); 152 txtTodo->clear();
153 txtTodo->setText( lneSum->text() ); 153 txtTodo->setText( lneSum->text() );
154} 154}
155 155
156/*! 156/*!
157 157
158*/ 158*/
159 159
160void NewTaskDialog::accept() 160void NewTaskDialog::accept()
161{ 161{
162 QString strText = txtTodo->text(); 162 QString strText = txtTodo->text();
163 if ( strText.isEmpty() ) { 163 QString strSumm = lneSum->text();
164 if ( strSumm.isEmpty() && strText.isEmpty() ) {
164 // hmm... just decline it then, the user obviously didn't care about it 165 // hmm... just decline it then, the user obviously didn't care about it
165 QDialog::reject(); 166 QDialog::reject();
166 return; 167 return;
167 } 168 }
168 QDialog::accept(); 169 QDialog::accept();
169} 170}