author | drw <drw> | 2002-12-20 23:35:07 (UTC) |
---|---|---|
committer | drw <drw> | 2002-12-20 23:35:07 (UTC) |
commit | de31929f800eb2aebe2fcb71a0c165f0f318e220 (patch) (side-by-side diff) | |
tree | 9645e3042359be0f2957584b5aa1723f99e92458 /core/pim/todo/quickeditimpl.cpp | |
parent | 24972a13cfadcb004936b548fccf87cbb7b15de2 (diff) | |
download | opie-de31929f800eb2aebe2fcb71a0c165f0f318e220.zip opie-de31929f800eb2aebe2fcb71a0c165f0f318e220.tar.gz opie-de31929f800eb2aebe2fcb71a0c165f0f318e220.tar.bz2 |
Use icons for task priority on quick task toolbar
Diffstat (limited to 'core/pim/todo/quickeditimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/quickeditimpl.cpp | 35 |
1 files changed, 21 insertions, 14 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 @@ -10,16 +10,23 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { 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()) ); m_edit = new QLineEdit( this ); setStretchableWidget( m_edit ); QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); @@ -54,46 +61,46 @@ QWidget* QuickEditImpl::widget() { void QuickEditImpl::slotEnter() { OTodo todo; 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 ) todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() ); m_todo = todo; commit(); } m_todo = todo; reinit(); } 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" ); + switch( m_state ) { + 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; } } void QuickEditImpl::slotMore() { // TODO - implement } void QuickEditImpl::slotCancel() { reinit(); } void QuickEditImpl::reinit() { - m_state = 1; - m_lbl->setText("3"); + m_state = 3; + m_lbl->setPixmap( priority3 ); m_edit->clear(); } |