Diffstat (limited to 'noncore/apps/checkbook/listedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/listedit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp index d00e305..5026c9d 100644 --- a/noncore/apps/checkbook/listedit.cpp +++ b/noncore/apps/checkbook/listedit.cpp @@ -6,56 +6,61 @@ _;:, .> :=|. This file is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General ..}^=.= = ; Public License for more details. ++= -. .` .: : = ...= . :.=- You should have received a copy of the GNU -. .:....=;==+<; General Public License along with this file; -_. . . )=. = see the file COPYING. If not, write to the -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "listedit.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/resource.h> +using namespace Opie::Core; + +/* QT */ #include <qlayout.h> #include <qlineedit.h> #include <qlistview.h> #include <qwidgetstack.h> #include <qcombobox.h> #include <qpushbutton.h> -#include <qpe/resource.h> - // --- ListEdit --------------------------------------------------------------- ListEdit::ListEdit( QWidget *parent, const char *sName ) : QWidget(parent, sName), TableDef(sName) { // get font height int fh = fontMetrics().height(); // create layout QGridLayout *layout=new QGridLayout(this); layout->setSpacing( 2 ); layout->setMargin( 4 ); // type table _typeTable = new QListView( this ); ColumnDef *def=first(); while( def ) { _typeTable->addColumn( def->getName() ); def=next(); } connect( _typeTable, SIGNAL( clicked(QListViewItem*,const QPoint&,int) ), this, SLOT( slotClick(QListViewItem*,const QPoint&,int) ) ); layout->addMultiCellWidget(_typeTable, 0,4,0,4); _currentItem=NULL; @@ -281,49 +286,49 @@ void ListEdit::slotClick(QListViewItem *itm, const QPoint &pnt, int col) if( _currentColumn<0 ) _currentColumn=0; ColumnDef *pDef=this->at(_currentColumn); if( pDef->isType(ColumnDef::typeString) ) { _typeEdit->setText( _currentItem->text(_currentColumn) ); _stack->raiseWidget(_typeEdit); } else if( pDef->isType(ColumnDef::typeList) ){ _box->clear(); _box->insertStringList( pDef->getValueList() ); QStringList::Iterator itr; int i=0; for(itr=pDef->getValueList().begin(); itr!=pDef->getValueList().end(); itr++) { if( (*itr)==_currentItem->text(_currentColumn) ) { _box->setCurrentItem(i); i=-1; break; } i++; } if( i>=0 ) { _box->insertItem( _currentItem->text(_currentColumn) ); _box->setCurrentItem(i); } _stack->raiseWidget(_box); } else { - qDebug( "Unsupported column type for column %s", (const char *)pDef->getName() ); + odebug << "Unsupported column type for column " << (const char *)pDef->getName() << "" << oendl; _typeEdit->setText(""); _stack->raiseWidget(_typeEdit); } } // --- addColumnDef ----------------------------------------------------------- void ListEdit::addColumnDef(ColumnDef *pDef) { _typeTable->addColumn( pDef->getName() ); _vColumns.append(pDef); } // --- addData ---------------------------------------------------------------- void ListEdit::addData(QStringList &lst) { // run through list QStringList::Iterator itr; for(itr=lst.begin(); itr!=lst.end(); itr++) { QStringList split=QStringList::split(";", *itr, true); QStringList::Iterator entry; QString args[8]; int i=0; for(entry=split.begin(); entry!=split.end() && i<8; entry++, i++) { |