summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/quickeditimpl.cpp33
-rw-r--r--core/pim/todo/quickeditimpl.h6
2 files changed, 26 insertions, 13 deletions
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index 9b54bdc..8d0a9fd 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -14,8 +14,15 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
setHorizontalStretchable( TRUE );
+ // Load priority icons
+ // TODO - probably should be done globally somewhere else
+ priority1 = Resource::loadPixmap( "todo/priority1" );
+ priority3 = Resource::loadPixmap( "todo/priority3" );
+ priority5 = Resource::loadPixmap( "todo/priority5" );
+
+
// TODO - come up with icons and replace text priority values
m_lbl = new OClickableLabel( this );
m_lbl->setMinimumWidth(15);
- m_lbl->setText("3");
+ m_lbl->setPixmap( priority3 );
connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
@@ -58,5 +65,5 @@ void QuickEditImpl::slotEnter() {
if (!m_edit->text().isEmpty() ) {
todo.setUid(1 ); // new uid
- todo.setPriority( m_lbl->text().toInt() );
+ todo.setPriority( m_state );
todo.setSummary( m_edit->text() );
if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 )
@@ -70,18 +77,18 @@ void QuickEditImpl::slotEnter() {
}
void QuickEditImpl::slotPrio() {
- m_state++;
- if (m_state > 2 )
- m_state = 0;
+ m_state -= 2;
+ if ( m_state < 1 )
+ m_state = 5;
switch(m_state ) {
- case 0:
- m_lbl->setText( "1" );
+ case 1:
+ m_lbl->setPixmap( priority1 );
break;
- case 2:
- m_lbl->setText( "5" );
+ case 5:
+ m_lbl->setPixmap( priority5 );
break;
- case 1:
+ case 3:
default:
- m_lbl->setText( "3");
+ m_lbl->setPixmap( priority3 );
break;
}
@@ -94,6 +101,6 @@ void QuickEditImpl::slotCancel() {
}
void QuickEditImpl::reinit() {
- m_state = 1;
- m_lbl->setText("3");
+ m_state = 3;
+ m_lbl->setPixmap( priority3 );
m_edit->clear();
}
diff --git a/core/pim/todo/quickeditimpl.h b/core/pim/todo/quickeditimpl.h
index c58275e..1253f3d 100644
--- a/core/pim/todo/quickeditimpl.h
+++ b/core/pim/todo/quickeditimpl.h
@@ -2,4 +2,6 @@
#define OPIE_QUICK_EDIT_IMPL_H
+#include <qpixmap.h>
+
#include <qpe/qpetoolbar.h>
@@ -31,4 +33,8 @@ private:
OTodo m_todo;
bool m_visible;
+
+ QPixmap priority1;
+ QPixmap priority3;
+ QPixmap priority5;
};