summaryrefslogtreecommitdiff
path: root/core/pim/todo/quickeditimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/quickeditimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/quickeditimpl.cpp50
1 files changed, 30 insertions, 20 deletions
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index 2dd5b61..9b54bdc 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -1,37 +1,46 @@
1#include <qaction.h>
1#include <qlineedit.h> 2#include <qlineedit.h>
2 3
4#include <qpe/resource.h>
5
3#include <opie/oclickablelabel.h> 6#include <opie/oclickablelabel.h>
4 7
5#include "mainwindow.h" 8#include "mainwindow.h"
6#include "quickeditimpl.h" 9#include "quickeditimpl.h"
7 10
8 11
9QuickEditImpl::QuickEditImpl( Todo::MainWindow* win, QWidget* arent ) 12QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
10 : QHBox(arent), Todo::QuickEdit(win) { 13 : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) {
14 setHorizontalStretchable( TRUE );
15
16 // TODO - come up with icons and replace text priority values
11 m_lbl = new OClickableLabel(this ); 17 m_lbl = new OClickableLabel(this );
12 m_lbl->setMinimumWidth(12); 18 m_lbl->setMinimumWidth(15);
13 m_lbl->setText("3"); 19 m_lbl->setText("3");
20 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
14 21
15 m_edit = new QLineEdit(this ); 22 m_edit = new QLineEdit(this );
23 setStretchableWidget( m_edit );
16 24
17 m_enter = new OClickableLabel(this); 25 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
18 m_enter->setText("Enter"); 26 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
27 a->addTo( this );
19 28
20 m_more = new OClickableLabel(this); 29 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
21 m_more->setText("More"); 30 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
31 a->addTo( this );
22 32
33 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
34 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
35 a->addTo( this );
23 36
24 // connect 37 m_visible = visible;
25 connect(m_lbl, SIGNAL(clicked() ), 38 if ( !m_visible ) {
26 this, SLOT(slotPrio()) ); 39 hide();
27 connect(m_enter, SIGNAL(clicked() ), 40 }
28 this, SLOT(slotEnter() ) );
29 connect(m_more, SIGNAL(clicked() ),
30 this, SLOT(slotMore() ) );
31 41
32 m_menu = 0l; 42 m_menu = 0l;
33 reinit(); 43 reinit();
34 setMaximumHeight( m_edit->sizeHint().height() );
35} 44}
36QuickEditImpl::~QuickEditImpl() { 45QuickEditImpl::~QuickEditImpl() {
37 46
@@ -42,9 +51,6 @@ OTodo QuickEditImpl::todo()const {
42QWidget* QuickEditImpl::widget() { 51QWidget* QuickEditImpl::widget() {
43 return this; 52 return this;
44} 53}
45QSize QuickEditImpl::sizeHint()const{
46 return m_edit->sizeHint();
47}
48void QuickEditImpl::slotEnter() { 54void QuickEditImpl::slotEnter() {
49 OTodo todo; 55 OTodo todo;
50 56
@@ -53,8 +59,8 @@ void QuickEditImpl::slotEnter() {
53 todo.setUid(1 ); // new uid 59 todo.setUid(1 ); // new uid
54 todo.setPriority( m_lbl->text().toInt() ); 60 todo.setPriority( m_lbl->text().toInt() );
55 todo.setSummary( m_edit->text() ); 61 todo.setSummary( m_edit->text() );
56 if ( mainWindow()->currentCatId() != 0 ) 62 if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 )
57 todo.setCategories( mainWindow()->currentCatId() ); 63 todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() );
58 64
59 m_todo = todo; 65 m_todo = todo;
60 commit(); 66 commit();
@@ -81,6 +87,10 @@ void QuickEditImpl::slotPrio() {
81 } 87 }
82} 88}
83void QuickEditImpl::slotMore() { 89void QuickEditImpl::slotMore() {
90 // TODO - implement
91}
92void QuickEditImpl::slotCancel() {
93 reinit();
84} 94}
85void QuickEditImpl::reinit() { 95void QuickEditImpl::reinit() {
86 m_state = 1; 96 m_state = 1;