summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todoentry.ui193
-rw-r--r--core/pim/todo/todoentryimpl.cpp9
-rw-r--r--core/pim/todo/todoentryimpl.h2
3 files changed, 128 insertions, 76 deletions
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui
index 5da4bb7..9ffa89b 100644
--- a/core/pim/todo/todoentry.ui
+++ b/core/pim/todo/todoentry.ui
@@ -1,402 +1,447 @@
<!DOCTYPE UI><UI>
<class>NewTaskDialogBase</class>
<comment>*********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** 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.
**
*********************************************************************</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>429</width>
+ <width>425</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>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout22</cstring>
+ <cstring>Layout31</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
- <x>0</x>
- <y>5</y>
+ <x>1</x>
+ <y>6</y>
<width>240</width>
<height>310</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="3" column="0" >
+ <widget row="2" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout18</cstring>
+ <cstring>Layout19</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>NoFrame</enum>
+ <cstring>txtProg</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Category:</string>
+ <string>Progress:</string>
</property>
</widget>
<widget>
- <class>CategorySelect</class>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>0%</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>20%</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>40%</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>60%</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>80%</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>100%</string>
+ </property>
+ </item>
<property stdset="1">
<name>name</name>
- <cstring>comboCategory</cstring>
+ <cstring>cmbProg</cstring>
</property>
<property stdset="1">
- <name>minimumSize</name>
+ <name>maximumSize</name>
<size>
- <width>60</width>
- <height>0</height>
+ <width>45</width>
+ <height>32767</height>
</size>
</property>
</widget>
</hbox>
</widget>
- <widget row="4" column="0" >
+ <widget row="3" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout4</cstring>
+ <cstring>Layout18</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1</cstring>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
</property>
<property stdset="1">
<name>text</name>
- <string>Summary:</string>
+ <string>Category:</string>
</property>
</widget>
<widget>
- <class>QLineEdit</class>
+ <class>CategorySelect</class>
<property stdset="1">
<name>name</name>
- <cstring>lneSum</cstring>
+ <cstring>comboCategory</cstring>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
</property>
</widget>
</hbox>
</widget>
<widget row="0" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout20</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<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>
+ <widget row="5" column="0" >
+ <class>QMultiLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>txtTodo</cstring>
+ </property>
+ </widget>
<widget row="1" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout21</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</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="2" column="0" >
+ <widget row="4" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout19</cstring>
+ <cstring>Layout30</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>txtProg</cstring>
+ <cstring>TextLabel1</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Progress:</string>
+ <string>Summary:</string>
</property>
</widget>
<widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>0%</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>20%</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>40%</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>60%</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>80%</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>100%</string>
- </property>
- </item>
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>cmbProg</cstring>
+ <cstring>lneSum</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>OClickableLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>lblDown</cstring>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
</property>
<property stdset="1">
<name>maximumSize</name>
<size>
- <width>45</width>
- <height>32767</height>
+ <width>20</width>
+ <height>20</height>
</size>
</property>
</widget>
</hbox>
</widget>
- <widget row="5" column="0" >
- <class>QMultiLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>txtTodo</cstring>
- </property>
- </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>
+ <customwidget>
+ <class>OClickableLabel</class>
+ <header location="global">opie/oclickablelabel.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>toggled(bool)</signal>
+ <slot access="public">slotOn(bool)</slot>
+ </customwidget>
</customwidgets>
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
<connections>
<connection>
<sender>checkDate</sender>
<signal>toggled(bool)</signal>
<receiver>buttonDate</receiver>
<slot>setEnabled(bool)</slot>
</connection>
+ <connection>
+ <sender>lblDown</sender>
+ <signal>clicked()</signal>
+ <receiver>NewTaskDialogBase</receiver>
+ <slot>slotCopy()</slot>
+ </connection>
<slot access="protected">dateChanged( const QString &amp; )</slot>
<slot access="protected">dateChanged( int, int, int )</slot>
+ <slot access="protected">slotCopy()</slot>
</connections>
</UI>
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index f8e2f4d..dd01130 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -1,158 +1,165 @@
/**********************************************************************
** 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.
**
**********************************************************************/
#include "todoentryimpl.h"
+#include <opie/oclickablelabel.h>
#include <opie/todoevent.h>
#include <opie/tododb.h>
#include <qpe/categoryselect.h>
#include <qpe/datebookmonth.h>
#include <qpe/global.h>
+#include <qpe/resource.h>
#include <qpe/imageedit.h>
#include <qpe/timestring.h>
#include <qpe/palmtoprecord.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qlabel.h>
#include <qtimer.h>
#include <qapplication.h>
NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent,
const char *name, bool modal, WFlags fl )
: NewTaskDialogBase( parent, name, modal, fl ),
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() );
cmbProg->setCurrentItem( task.progress()/20 );
}
/*
* 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 );
ids[0] = id;
todo.setCategory( Qtopia::Record::idsToString( ids ) );
}
init();
}
void NewTaskDialog::init()
{
QPopupMenu *m1 = new QPopupMenu( this );
picker = new DateBookMonth( m1, 0, TRUE );
m1->insertItem( picker );
buttonDate->setPopup( m1 );
comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") );
connect( picker, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( dateChanged( int, int, int ) ) );
buttonDate->setText( TimeString::longDateString( date ) );
picker->setDate( date.year(), date.month(), date.day() );
+ lblDown->setPixmap(Resource::loadPixmap("down") );
}
/*
* Destroys the object and frees any allocated resources
*/
NewTaskDialog::~NewTaskDialog()
{
// no need to delete child widgets, Qt does it all for us
}
void NewTaskDialog::dateChanged( int y, int m, int d )
{
date = QDate( y, m, d );
buttonDate->setText( TimeString::longDateString( date ) );
}
/*!
*/
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() );
QString text = cmbProg->currentText();
todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() );
return todo;
}
-
+void NewTaskDialog::slotCopy()
+{
+ txtTodo->clear();
+ txtTodo->setText( lneSum->text() );
+}
/*!
*/
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;
}
QDialog::accept();
}
diff --git a/core/pim/todo/todoentryimpl.h b/core/pim/todo/todoentryimpl.h
index 6407eb4..49d1274 100644
--- a/core/pim/todo/todoentryimpl.h
+++ b/core/pim/todo/todoentryimpl.h
@@ -1,61 +1,61 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** 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.
**
**********************************************************************/
#ifndef NEWTASKDIALOG_H
#define NEWTASKDIALOG_H
#include "todoentry.h"
#include <opie/todoevent.h>
#include <qdatetime.h>
#include <qpalette.h>
class QLabel;
class QTimer;
class DateBookMonth;
class NewTaskDialog : public NewTaskDialogBase
{
Q_OBJECT
public:
NewTaskDialog( const ToDoEvent &task, QWidget *parent = 0, const char* name = 0,
bool modal = FALSE, WFlags fl = 0 );
NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0,
bool modal = FALSE, WFlags fl = 0 );
~NewTaskDialog();
ToDoEvent todoEntry();
protected slots:
void dateChanged( int y, int m, int d );
-
+ void slotCopy();
protected:
virtual void accept();
private:
void init();
ToDoEvent todo;
QDate date;
DateBookMonth *picker;
};
#endif // NEWTASKDIALOG_H