summaryrefslogtreecommitdiff
path: root/core/pim
Side-by-side diff
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp2
-rw-r--r--core/pim/todo/todoentry.ui370
-rw-r--r--core/pim/todo/todoentryimpl.cpp7
-rw-r--r--core/pim/todo/todotable.cpp11
-rw-r--r--core/pim/todo/todotable.h3
5 files changed, 232 insertions, 161 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index b7b1da0..1358f1c 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -581,33 +581,33 @@ void TodoWindow::setDocument( const QString &filename )
table->addEntry( *it );
}
}
static const char * beamfile = "/tmp/obex/todo.vcs";
void TodoWindow::slotBeam()
{
unlink( beamfile ); // delete if exists
ToDoEvent c = table->currentEntry();
mkdir("/tmp/obex/", 0755);
ToDoDB todoDB( beamfile, new ToDoVCalResource() );
todoDB.addEvent( c );
todoDB.save();
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
- QString description = c.description();
+ QString description = c.summary();
ir->send( beamfile, description, "text/x-vCalendar" );
}
void TodoWindow::beamDone( Ir *ir )
{
delete ir;
unlink( beamfile );
}
void TodoWindow::showDeadline( bool s )
{
table->setPaintingEnabled( false );
table->setShowDeadline( s );
table->setPaintingEnabled( true );
}
void TodoWindow::slotShowDetails()
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui
index c735e76..87ee68c 100644
--- a/core/pim/todo/todoentry.ui
+++ b/core/pim/todo/todoentry.ui
@@ -17,232 +17,292 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
*********************************************************************</comment>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>NewTaskDialogBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>249</width>
+ <width>245</width>
<height>321</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>New Task</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
- <vbox>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>name</name>
+ <cstring>Layout3</cstring>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>0</number>
+ <name>geometry</name>
+ <rect>
+ <x>1</x>
+ <y>25</y>
+ <width>243</width>
+ <height>17</height>
+ </rect>
</property>
- <widget>
- <class>QLayoutWidget</class>
+ <hbox>
<property stdset="1">
- <name>name</name>
- <cstring>Layout4</cstring>
+ <name>margin</name>
+ <number>0</number>
</property>
- <hbox>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
</property>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
</property>
- <widget>
- <class>QLabel</class>
+ <property stdset="1">
+ <name>text</name>
+ <string>Category:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>CategorySelect</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>comboCategory</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="2" column="0" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
<property stdset="1">
- <name>name</name>
- <cstring>TextLabel2</cstring>
+ <name>margin</name>
+ <number>0</number>
</property>
<property stdset="1">
- <name>text</name>
- <string>Priority:</string>
+ <name>spacing</name>
+ <number>6</number>
</property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>1 - Very High</string>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
</property>
- </item>
- <item>
- <property>
+ <property stdset="1">
<name>text</name>
- <string>2 - High</string>
+ <string>Summary:</string>
</property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>3 - Normal</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>4 - Low</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>5 - Very Low</string>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>lneSum</cstring>
</property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>comboPriority</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>currentItem</name>
- <number>2</number>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget>
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout3</cstring>
- </property>
- <hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QMultiLineEdit</class>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>name</name>
+ <cstring>txtTodo</cstring>
</property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>name</name>
+ <cstring>Layout4</cstring>
</property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>NoFrame</enum>
- </property>
+ <hbox>
<property stdset="1">
- <name>text</name>
- <string>Category:</string>
+ <name>margin</name>
+ <number>0</number>
</property>
- </widget>
- <widget>
- <class>CategorySelect</class>
<property stdset="1">
- <name>name</name>
- <cstring>comboCategory</cstring>
+ <name>spacing</name>
+ <number>6</number>
</property>
- </widget>
- </hbox>
- </widget>
- <widget>
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout4</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>checkCompleted</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Completed</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>checkDate</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>D&amp;ue</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buttonDate</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>1 Jan 2001</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>name</name>
+ <cstring>Layout4</cstring>
</property>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>checkCompleted</cstring>
- </property>
+ <hbox>
<property stdset="1">
- <name>text</name>
- <string>&amp;Completed</string>
+ <name>margin</name>
+ <number>0</number>
</property>
- </widget>
- <widget>
- <class>QCheckBox</class>
<property stdset="1">
- <name>name</name>
- <cstring>checkDate</cstring>
+ <name>spacing</name>
+ <number>6</number>
</property>
- <property stdset="1">
- <name>text</name>
- <string>D&amp;ue</string>
- </property>
- </widget>
- <widget>
- <class>QPushButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>buttonDate</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>false</bool>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>1 Jan 2001</string>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget>
- <class>QMultiLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>txtTodo</cstring>
- </property>
- </widget>
- </vbox>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Priority:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>1 - Very High</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>2 - High</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>3 - Normal</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>4 - Low</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>5 - Very Low</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>comboPriority</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>currentItem</name>
+ <number>2</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
</widget>
<customwidgets>
<customwidget>
<class>CategorySelect</class>
<header location="global">qpe/categoryselect.h</header>
<sizehint>
<width>-1</width>
<height>-1</height>
</sizehint>
<container>0</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>1</verdata>
</sizepolicy>
<pixmap>image0</pixmap>
</customwidget>
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index 26a685c..dfaf9b4 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -1,18 +1,19 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2002 zecke
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
@@ -48,32 +49,33 @@ NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent,
todo( task )
{
todo.setCategories( task.allCategories() );
if ( todo.hasDate() )
date = todo.date();
else
date = QDate::currentDate();
init();
comboPriority->setCurrentItem( task.priority() - 1 );
checkCompleted->setChecked( task.isCompleted() );
checkDate->setChecked( task.hasDate() );
buttonDate->setText( TimeString::longDateString( date ) );
txtTodo->setText( task.description() );
+ lneSum->setText( task.summary() );
}
/*
* Constructs a NewTaskDialog which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal,
WFlags fl )
: NewTaskDialogBase( parent, name, modal, fl ),
date( QDate::currentDate() )
{
if ( id != -1 ) {
QArray<int> ids( 1 );
@@ -117,35 +119,36 @@ void NewTaskDialog::dateChanged( int y, int m, int d )
ToDoEvent NewTaskDialog::todoEntry()
{
if( checkDate->isChecked() ){
todo.setDate( date );
todo.setHasDate( true );
}else{
todo.setHasDate( false );
}
if ( comboCategory->currentCategory() != -1 ) {
QArray<int> arr = comboCategory->currentCategories();
QStringList list;
list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ;
todo.setCategories( list );
}
todo.setPriority( comboPriority->currentItem() + 1 );
todo.setCompleted( checkCompleted->isChecked() );
-
+
todo.setDescription( txtTodo->text() );
-
+ todo.setSummary( lneSum->text() );
+
return todo;
}
/*!
*/
void NewTaskDialog::accept()
{
QString strText = txtTodo->text();
if ( strText.isEmpty() ) {
// hmm... just decline it then, the user obviously didn't care about it
QDialog::reject();
return;
}
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp
index 52a3087..779b28c 100644
--- a/core/pim/todo/todotable.cpp
+++ b/core/pim/todo/todotable.cpp
@@ -559,32 +559,33 @@ void TodoTable::updateJournal( const ToDoEvent &todo, journal_action action )
buf = "<Task";
// todo.save( buf );
buf += " Action=\"" + QString::number( int(action) ) + "\"";
buf += " Uid=\"" + QString::number( todo.uid() ) + "\""; // better write the id
buf += " Completed=\""+ QString::number((int)todo.isCompleted() ) + "\"";
buf += " HasDate=\""+ QString::number((int)todo.hasDate() ) +"\"";
buf += " Priority=\"" + QString::number( todo.priority() ) + "\"";
QArray<int> arrat = todo.categories();
QString attr;
for(uint i=0; i < arrat.count(); i++ ){
attr.append(QString::number(arrat[i])+";" );
}
if(!attr.isEmpty() ) // remove the last ;
attr.remove(attr.length()-1, 1 );
buf += " Categories=\"" + attr + "\"";
buf += " Description=\"" + todo.description() + "\"";
+ buf += " Summary=\"" + todo.summary() + "\"";
if(todo.hasDate() ) {
buf += " DateYear=\""+QString::number( todo.date().year() ) + "\"";
buf += " DateMonth=\"" + QString::number( todo.date().month() ) + "\"";
buf += " DateDay=\"" + QString::number( todo.date().day() ) + "\"";
}
buf += "/>\n";
str = buf.utf8();
f.writeBlock( str.data(), str.length() );
f.close();
}
void TodoTable::rowHeightChanged( int row )
{
if ( enablePainting )
QTable::rowHeightChanged( row );
}
@@ -597,34 +598,37 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ )
QValueList<ToDoEvent> vaList = todoDB.rawToDos();
for(QValueList<ToDoEvent>::ConstIterator it = vaList.begin(); it != vaList.end(); ++it ){
ToDoEvent *event = new ToDoEvent( (*it) );
list.append( event );
}
vaList.clear();
// qDebug("parsing done=%d", t.elapsed() );
if ( list.count() > 0 ) {
internalAddEntries( list );
list.clear();
}
// qDebug("loading done: t=%d", t.elapsed() );
}
void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row )
{
- QString strTodo;
- strTodo = todo.description().left(40).simplifyWhiteSpace();
+ QString strTodo = todo.summary();
+ if( strTodo.isEmpty() ){
+ strTodo = todo.description().left(40).simplifyWhiteSpace();
+ //todo.setSummary(strTodo );
+ }
if ( row == -1 ) {
QMapIterator<CheckItem*, ToDoEvent *> it;
for ( it = todoList.begin(); it != todoList.end(); ++it ) {
if ( *(*it) == todo ) {
row = it.key()->row();
it.key()->setChecked( todo.isCompleted() );
static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) );
item( row, 2 )->setText( strTodo );
if (showDeadl){
static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo );
}
*(*it) = todo;
}
}
@@ -895,32 +899,35 @@ static ToDoEvent xmlToEvent( XMLElement *element )
dumInt = dummy.toInt(&ok );
if(ok ) month = dumInt;
dummy = element->attribute("DateDay" );
dumInt = dummy.toInt(&ok );
if(ok ) day = dumInt;
// set the date
QDate date( year, month, day );
event.setDate( date);
}
dummy = element->attribute("Priority" );
dumInt = dummy.toInt(&ok );
if(!ok ) dumInt = ToDoEvent::NORMAL;
event.setPriority( dumInt );
//description
dummy = element->attribute("Description" );
event.setDescription( dummy );
+ // summary
+ dummy = element->attribute("Summary" );
+ event.setSummary( dummy );
// category
dummy = element->attribute("Categories" );
QStringList ids = QStringList::split(";", dummy );
event.setCategories( ids );
//uid
dummy = element->attribute("Uid" );
dumInt = dummy.toInt(&ok );
if(ok ) event.setUid( dumInt );
return event;
}
}
// int TodoTable::rowHeight( int ) const
// {
// return 18;
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h
index 7672f21..39e00d1 100644
--- a/core/pim/todo/todotable.h
+++ b/core/pim/todo/todotable.h
@@ -186,33 +186,34 @@ private:
bool enablePainting;
Categories mCat;
int currFindRow;
bool showDeadl:1;
};
inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row )
{
QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A')
+ todo->priority() )
+ Qtopia::buildSortKey( todo->description() );
CheckItem *chk = new CheckItem( this, sortKey );
chk->setChecked( todo->isCompleted() );
ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent );
cmb->setText( QString::number( todo->priority() ) );
- QTableItem *ti = new TodoTextItem( this, todo->description().left(40).simplifyWhiteSpace() );
+ QString sum = todo->summary();
+ QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum );
ti->setReplaceable( false );
DueTextItem *due = new DueTextItem(this, todo );
setItem( row, 3, due);
setItem( row, 0, chk );
setItem( row, 1, cmb );
setItem( row, 2, ti );
todoList.insert( chk, todo );
}
inline void TodoTable::realignTable( int row )
{
QTableItem *ti1,