summaryrefslogtreecommitdiff
path: root/core/pim/todo/quickeditimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/quickeditimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/quickeditimpl.cpp56
1 files changed, 33 insertions, 23 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,3 +1,6 @@
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>
@@ -8,28 +11,34 @@
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 ) {
11 m_lbl = new OClickableLabel(this ); 14 setHorizontalStretchable( TRUE );
12 m_lbl->setMinimumWidth(12);
13 m_lbl->setText("3");
14 15
15 m_edit = new QLineEdit(this ); 16 // TODO - come up with icons and replace text priority values
17 m_lbl = new OClickableLabel( this );
18 m_lbl->setMinimumWidth(15);
19 m_lbl->setText("3");
20 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
16 21
17 m_enter = new OClickableLabel(this); 22 m_edit = new QLineEdit( this );
18 m_enter->setText("Enter"); 23 setStretchableWidget( m_edit );
19 24
20 m_more = new OClickableLabel(this); 25 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
21 m_more->setText("More"); 26 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
27 a->addTo( this );
22 28
29 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
30 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
31 a->addTo( this );
23 32
24 // connect 33 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
25 connect(m_lbl, SIGNAL(clicked() ), 34 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
26 this, SLOT(slotPrio()) ); 35 a->addTo( this );
27 connect(m_enter, SIGNAL(clicked() ),
28 this, SLOT(slotEnter() ) );
29 connect(m_more, SIGNAL(clicked() ),
30 this, SLOT(slotMore() ) );
31 36
37 m_visible = visible;
38 if ( !m_visible ) {
39 hide();
40 }
41
32 m_menu = 0l; 42 m_menu = 0l;
33 reinit(); 43 reinit();
34 setMaximumHeight( m_edit->sizeHint().height() );
35} 44}
@@ -44,5 +53,2 @@ QWidget* QuickEditImpl::widget() {
44} 53}
45QSize QuickEditImpl::sizeHint()const{
46 return m_edit->sizeHint();
47}
48void QuickEditImpl::slotEnter() { 54void QuickEditImpl::slotEnter() {
@@ -55,4 +61,4 @@ void QuickEditImpl::slotEnter() {
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
@@ -83,2 +89,6 @@ void QuickEditImpl::slotPrio() {
83void QuickEditImpl::slotMore() { 89void QuickEditImpl::slotMore() {
90 // TODO - implement
91}
92void QuickEditImpl::slotCancel() {
93 reinit();
84} 94}