Diffstat (limited to 'core/pim/todo/quickeditimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/todo/quickeditimpl.cpp | 50 |
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,3 +1,6 @@ +#include <qaction.h> #include <qlineedit.h> +#include <qpe/resource.h> + #include <opie/oclickablelabel.h> @@ -8,24 +11,31 @@ -QuickEditImpl::QuickEditImpl( Todo::MainWindow* win, QWidget* arent ) - : QHBox(arent), Todo::QuickEdit(win) { +QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) + : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { + setHorizontalStretchable( TRUE ); + + // TODO - come up with icons and replace text priority values m_lbl = new OClickableLabel(this ); - m_lbl->setMinimumWidth(12); + m_lbl->setMinimumWidth(15); m_lbl->setText("3"); + connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); m_edit = new QLineEdit(this ); + setStretchableWidget( m_edit ); - m_enter = new OClickableLabel(this); - m_enter->setText("Enter"); + QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); + a->addTo( this ); - m_more = new OClickableLabel(this); - m_more->setText("More"); + a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); + a->addTo( this ); + a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) ); + a->addTo( this ); - // connect - connect(m_lbl, SIGNAL(clicked() ), - this, SLOT(slotPrio()) ); - connect(m_enter, SIGNAL(clicked() ), - this, SLOT(slotEnter() ) ); - connect(m_more, SIGNAL(clicked() ), - this, SLOT(slotMore() ) ); + m_visible = visible; + if ( !m_visible ) { + hide(); + } @@ -33,3 +43,2 @@ QuickEditImpl::QuickEditImpl( Todo::MainWindow* win, QWidget* arent ) reinit(); - setMaximumHeight( m_edit->sizeHint().height() ); } @@ -44,5 +53,2 @@ QWidget* QuickEditImpl::widget() { } -QSize QuickEditImpl::sizeHint()const{ - return m_edit->sizeHint(); -} void QuickEditImpl::slotEnter() { @@ -55,4 +61,4 @@ void QuickEditImpl::slotEnter() { todo.setSummary( m_edit->text() ); - if ( mainWindow()->currentCatId() != 0 ) - todo.setCategories( mainWindow()->currentCatId() ); + if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 ) + todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() ); @@ -83,2 +89,6 @@ void QuickEditImpl::slotPrio() { void QuickEditImpl::slotMore() { + // TODO - implement +} +void QuickEditImpl::slotCancel() { + reinit(); } |