From ff47b17768607d8819ef5cd3316a1cab0abdcf3a Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 15 Jun 2002 16:46:37 +0000 Subject: Summary support --- (limited to 'core/pim') 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 @@ -594,7 +594,7 @@ void TodoWindow::slotBeam() 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" ); } 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 @@ -30,7 +30,7 @@ 0 0 - 249 + 245 321 @@ -44,192 +44,252 @@ layoutSpacing - + + QLayoutWidget - margin - 0 + name + Layout3 - spacing - 0 + geometry + + 1 + 25 + 243 + 17 + - - QLayoutWidget + - name - Layout4 + margin + 0 - + + spacing + 6 + + + QLabel - margin - 0 + name + TextLabel3 - spacing - 6 + frameShape + NoFrame - - QLabel + + text + Category: + + + + CategorySelect + + name + comboCategory + + + + + + QLayoutWidget + + name + Layout6 + + + geometry + + 0 + 0 + 240 + 320 + + + + + margin + 0 + + + spacing + 6 + + + QLayoutWidget + + name + Layout4 + + - name - TextLabel2 + margin + 0 - text - Priority: + spacing + 6 - - - QComboBox - - - text - 1 - Very High + + QLabel + + name + TextLabel1 - - - + text - 2 - High + Summary: - - - - text - 3 - Normal - - - - - text - 4 - Low - - - - - text - 5 - Very Low + + + QLineEdit + + name + lneSum - - - name - comboPriority - - - sizePolicy - - 7 - 0 - - - - currentItem - 2 - - - - - - QLayoutWidget - - name - Layout3 - - + + + + + QMultiLineEdit - margin - 0 + name + txtTodo + + + QLayoutWidget - spacing - 6 + name + Layout4 - - QLabel - - name - TextLabel3 - - - frameShape - NoFrame - + - text - Category: + margin + 0 - - - CategorySelect - name - comboCategory + spacing + 6 - - - - - QLayoutWidget - - name - Layout4 - - - - margin - 0 - + + QCheckBox + + name + checkCompleted + + + text + &Completed + + + + QCheckBox + + name + checkDate + + + text + D&ue + + + + QPushButton + + name + buttonDate + + + enabled + false + + + text + 1 Jan 2001 + + + + + + QLayoutWidget - spacing - 6 + name + Layout4 - - QCheckBox - - name - checkCompleted - + - text - &Completed + margin + 0 - - - QCheckBox - name - checkDate + spacing + 6 - - text - D&ue - - - - QPushButton - - name - buttonDate - - - enabled - false - - - text - 1 Jan 2001 - - - - - - QMultiLineEdit - - name - txtTodo - - - + + QLabel + + name + TextLabel2 + + + text + Priority: + + + + QComboBox + + + text + 1 - Very High + + + + + text + 2 - High + + + + + text + 3 - Normal + + + + + text + 4 - Low + + + + + text + 5 - Very Low + + + + name + comboPriority + + + sizePolicy + + 7 + 0 + + + + currentItem + 2 + + + + + + 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,5 +1,6 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2002 zecke ** ** This file is part of Qtopia Environment. ** @@ -61,6 +62,7 @@ NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent, buttonDate->setText( TimeString::longDateString( date ) ); txtTodo->setText( task.description() ); + lneSum->setText( task.summary() ); } /* @@ -130,9 +132,10 @@ ToDoEvent NewTaskDialog::todoEntry() } todo.setPriority( comboPriority->currentItem() + 1 ); todo.setCompleted( checkCompleted->isChecked() ); - + todo.setDescription( txtTodo->text() ); - + todo.setSummary( lneSum->text() ); + return todo; } 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 @@ -572,6 +572,7 @@ void TodoTable::updateJournal( const ToDoEvent &todo, journal_action action ) 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() ) + "\""; @@ -610,8 +611,11 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) 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 it; for ( it = todoList.begin(); it != todoList.end(); ++it ) { @@ -908,6 +912,9 @@ static ToDoEvent xmlToEvent( XMLElement *element ) //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 ); 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 @@ -199,7 +199,8 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) 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 ); -- cgit v0.9.0.2