diff options
Diffstat (limited to 'krecipes/src/widgets/authorlistview.cpp')
-rw-r--r-- | krecipes/src/widgets/authorlistview.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/krecipes/src/widgets/authorlistview.cpp b/krecipes/src/widgets/authorlistview.cpp index cfc4b70..17c3d4d 100644 --- a/krecipes/src/widgets/authorlistview.cpp +++ b/krecipes/src/widgets/authorlistview.cpp @@ -21,10 +21,10 @@ #include "dialogs/createelementdialog.h" #include "dialogs/dependanciesdialog.h" -AuthorListView::AuthorListView( QWidget *parent, RecipeDB *db ) : DBListViewBase( parent, db, db->authorCount() ) +AuthorListView::AuthorListView( TQWidget *parent, RecipeDB *db ) : DBListViewBase( parent, db, db->authorCount() ) { setAllColumnsShowFocus( true ); - setDefaultRenameAction( QListView::Reject ); + setDefaultRenameAction( TQListView::Reject ); } void AuthorListView::init() @@ -52,7 +52,7 @@ void AuthorListView::checkCreateAuthor( const Element &el ) } -StdAuthorListView::StdAuthorListView( QWidget *parent, RecipeDB *db, bool editable ) : AuthorListView( parent, db ) +StdAuthorListView::StdAuthorListView( TQWidget *parent, RecipeDB *db, bool editable ) : AuthorListView( parent, db ) { addColumn( i18n( "Author" ) ); @@ -75,13 +75,13 @@ StdAuthorListView::StdAuthorListView( QWidget *parent, RecipeDB *db, bool editab delete il; - connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), SLOT( showPopup( KListView *, QListViewItem *, const QPoint & ) ) ); - connect( this, SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( modAuthor( QListViewItem* ) ) ); - connect( this, SIGNAL( itemRenamed( QListViewItem* ) ), this, SLOT( saveAuthor( QListViewItem* ) ) ); + connect( this, SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), SLOT( showPopup( KListView *, TQListViewItem *, const TQPoint & ) ) ); + connect( this, SIGNAL( doubleClicked( TQListViewItem* ) ), this, SLOT( modAuthor( TQListViewItem* ) ) ); + connect( this, SIGNAL( itemRenamed( TQListViewItem* ) ), this, SLOT( saveAuthor( TQListViewItem* ) ) ); } } -void StdAuthorListView::showPopup( KListView * /*l*/, QListViewItem *i, const QPoint &p ) +void StdAuthorListView::showPopup( KListView * /*l*/, TQListViewItem *i, const TQPoint &p ) { if ( i ) kpop->exec( p ); @@ -91,8 +91,8 @@ void StdAuthorListView::createNew() { CreateElementDialog * elementDialog = new CreateElementDialog( this, i18n( "New Author" ) ); - if ( elementDialog->exec() == QDialog::Accepted ) { - QString result = elementDialog->newElementName(); + if ( elementDialog->exec() == TQDialog::Accepted ) { + TQString result = elementDialog->newElementName(); //check bounds first if ( checkBounds( result ) ) @@ -103,7 +103,7 @@ void StdAuthorListView::createNew() void StdAuthorListView::remove () { - QListViewItem * item = currentItem(); + TQListViewItem * item = currentItem(); if ( item ) { int id = item->text( 1 ).toInt(); @@ -125,7 +125,7 @@ void StdAuthorListView::remove info.name = i18n("Recipes"); DependanciesDialog warnDialog( this, info, false ); - if ( warnDialog.exec() == QDialog::Accepted ) + if ( warnDialog.exec() == TQDialog::Accepted ) database->removeAuthor( id ); } } @@ -133,7 +133,7 @@ void StdAuthorListView::remove void StdAuthorListView::rename() { - QListViewItem * item = currentItem(); + TQListViewItem * item = currentItem(); if ( item ) AuthorListView::rename( item, 0 ); @@ -141,22 +141,22 @@ void StdAuthorListView::rename() void StdAuthorListView::createAuthor( const Element &author ) { - createElement(new QListViewItem( this, author.name, QString::number( author.id ) )); + createElement(new TQListViewItem( this, author.name, TQString::number( author.id ) )); } void StdAuthorListView::removeAuthor( int id ) { - QListViewItem * item = findItem( QString::number( id ), 1 ); + TQListViewItem * item = findItem( TQString::number( id ), 1 ); removeElement(item); } -void StdAuthorListView::modAuthor( QListViewItem* i ) +void StdAuthorListView::modAuthor( TQListViewItem* i ) { if ( i ) AuthorListView::rename( i, 0 ); } -void StdAuthorListView::saveAuthor( QListViewItem* i ) +void StdAuthorListView::saveAuthor( TQListViewItem* i ) { if ( !checkBounds( i->text( 0 ) ) ) { reload(ForceReload); //reset the changed text @@ -183,10 +183,10 @@ void StdAuthorListView::saveAuthor( QListViewItem* i ) } } -bool StdAuthorListView::checkBounds( const QString &name ) +bool StdAuthorListView::checkBounds( const TQString &name ) { if ( name.length() > uint(database->maxAuthorNameLength()) ) { - KMessageBox::error( this, QString( i18n( "Author name cannot be longer than %1 characters." ) ).arg( database->maxAuthorNameLength() ) ); + KMessageBox::error( this, TQString( i18n( "Author name cannot be longer than %1 characters." ) ).arg( database->maxAuthorNameLength() ) ); return false; } @@ -194,13 +194,13 @@ bool StdAuthorListView::checkBounds( const QString &name ) } -AuthorCheckListItem::AuthorCheckListItem( AuthorCheckListView* qlv, const Element &author ) : QCheckListItem( qlv, QString::null, QCheckListItem::CheckBox ), +AuthorCheckListItem::AuthorCheckListItem( AuthorCheckListView* qlv, const Element &author ) : TQCheckListItem( qlv, TQString::null, TQCheckListItem::CheckBox ), authorStored(author), m_listview(qlv) { } -AuthorCheckListItem::AuthorCheckListItem( AuthorCheckListView* qlv, QListViewItem *after, const Element &author ) : QCheckListItem( qlv, after, QString::null, QCheckListItem::CheckBox ), +AuthorCheckListItem::AuthorCheckListItem( AuthorCheckListView* qlv, TQListViewItem *after, const Element &author ) : TQCheckListItem( qlv, after, TQString::null, TQCheckListItem::CheckBox ), authorStored(author), m_listview(qlv) { @@ -211,15 +211,15 @@ Element AuthorCheckListItem::author() const return authorStored; } -QString AuthorCheckListItem::text( int column ) const +TQString AuthorCheckListItem::text( int column ) const { switch ( column ) { case 0: return ( authorStored.name ); case 1: - return ( QString::number( authorStored.id ) ); + return ( TQString::number( authorStored.id ) ); default: - return QString::null; + return TQString::null; } } @@ -229,7 +229,7 @@ void AuthorCheckListItem::stateChange( bool on ) } -AuthorCheckListView::AuthorCheckListView( QWidget *parent, RecipeDB *db ) : AuthorListView( parent, db ) +AuthorCheckListView::AuthorCheckListView( TQWidget *parent, RecipeDB *db ) : AuthorListView( parent, db ) { addColumn( i18n( "Author" ) ); @@ -246,7 +246,7 @@ void AuthorCheckListView::createAuthor( const Element &author ) void AuthorCheckListView::removeAuthor( int id ) { - QListViewItem * item = findItem( QString::number( id ), 1 ); + TQListViewItem * item = findItem( TQString::number( id ), 1 ); removeElement(item); } @@ -254,8 +254,8 @@ void AuthorCheckListView::load( int limit, int offset ) { AuthorListView::load(limit,offset); - for ( QValueList<Element>::const_iterator author_it = m_selections.begin(); author_it != m_selections.end(); ++author_it ) { - QCheckListItem * item = ( QCheckListItem* ) findItem( QString::number( (*author_it).id ), 1 ); + for ( TQValueList<Element>::const_iterator author_it = m_selections.begin(); author_it != m_selections.end(); ++author_it ) { + TQCheckListItem * item = ( TQCheckListItem* ) findItem( TQString::number( (*author_it).id ), 1 ); if ( item ) { item->setOn(true); } |