summaryrefslogtreecommitdiffstats
path: root/krecipes/src/widgets/propertylistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/widgets/propertylistview.cpp')
-rw-r--r--krecipes/src/widgets/propertylistview.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/krecipes/src/widgets/propertylistview.cpp b/krecipes/src/widgets/propertylistview.cpp
index 2e94788..a175f74 100644
--- a/krecipes/src/widgets/propertylistview.cpp
+++ b/krecipes/src/widgets/propertylistview.cpp
@@ -21,19 +21,19 @@
#include "backends/recipedb.h"
#include "dialogs/createpropertydialog.h"
-PropertyCheckListItem::PropertyCheckListItem( QListView* klv, const IngredientProperty &property ) : QCheckListItem( klv, QString::null, QCheckListItem::CheckBox ),
+PropertyCheckListItem::PropertyCheckListItem( TQListView* klv, const IngredientProperty &property ) : TQCheckListItem( klv, TQString::null, TQCheckListItem::CheckBox ),
m_property( property )
{
//setOn( false ); // Set unchecked by default
}
-PropertyCheckListItem::PropertyCheckListItem( QListViewItem* it, const IngredientProperty &property ) : QCheckListItem( it, QString::null, QCheckListItem::CheckBox ),
+PropertyCheckListItem::PropertyCheckListItem( TQListViewItem* it, const IngredientProperty &property ) : TQCheckListItem( it, TQString::null, TQCheckListItem::CheckBox ),
m_property( property )
{
//setOn( false ); // Set unchecked by default
}
-QString PropertyCheckListItem::text( int column ) const
+TQString PropertyCheckListItem::text( int column ) const
{
switch ( column ) {
case 0:
@@ -43,23 +43,23 @@ QString PropertyCheckListItem::text( int column ) const
return m_property.units;
break;
case 2:
- return QString::number( m_property.id );
+ return TQString::number( m_property.id );
break;
}
- return QString::null;
+ return TQString::null;
}
-HidePropertyCheckListItem::HidePropertyCheckListItem( QListView* klv, const IngredientProperty &property, bool enable ) : PropertyCheckListItem( klv, property )
+HidePropertyCheckListItem::HidePropertyCheckListItem( TQListView* klv, const IngredientProperty &property, bool enable ) : PropertyCheckListItem( klv, property )
{
m_holdSettings = true;
setOn( enable ); // Set checked by default
m_holdSettings = false;
}
-HidePropertyCheckListItem::HidePropertyCheckListItem( QListViewItem* it, const IngredientProperty &property, bool enable ) : PropertyCheckListItem( it, property )
+HidePropertyCheckListItem::HidePropertyCheckListItem( TQListViewItem* it, const IngredientProperty &property, bool enable ) : PropertyCheckListItem( it, property )
{
m_holdSettings = true;
setOn( enable ); // Set checked by default
@@ -73,7 +73,7 @@ void HidePropertyCheckListItem::stateChange( bool on )
config->setGroup("Formatting");
config->sync();
- QStringList hiddenList = config->readListEntry("HiddenProperties");
+ TQStringList hiddenList = config->readListEntry("HiddenProperties");
if ( on )
hiddenList.remove(m_property.name);
else if ( !hiddenList.contains(m_property.name) )
@@ -83,11 +83,11 @@ void HidePropertyCheckListItem::stateChange( bool on )
}
}
-PropertyListView::PropertyListView( QWidget *parent, RecipeDB *db ) : KListView( parent ),
+PropertyListView::PropertyListView( TQWidget *parent, RecipeDB *db ) : KListView( parent ),
database( db )
{
setAllColumnsShowFocus( true );
- setDefaultRenameAction( QListView::Reject );
+ setDefaultRenameAction( TQListView::Reject );
connect( db, SIGNAL( propertyCreated( const IngredientProperty & ) ), SLOT( createProperty( const IngredientProperty & ) ) );
connect( db, SIGNAL( propertyRemoved( int ) ), SLOT( removeProperty( int ) ) );
@@ -112,7 +112,7 @@ void PropertyListView::reload()
-StdPropertyListView::StdPropertyListView( QWidget *parent, RecipeDB *db, bool editable ) : PropertyListView( parent, db )
+StdPropertyListView::StdPropertyListView( TQWidget *parent, RecipeDB *db, bool editable ) : PropertyListView( parent, db )
{
addColumn( i18n( "Property" ) );
addColumn( i18n( "Units" ) );
@@ -138,13 +138,13 @@ StdPropertyListView::StdPropertyListView( QWidget *parent, RecipeDB *db, bool ed
delete il;
- connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), SLOT( showPopup( KListView *, QListViewItem *, const QPoint & ) ) );
- connect( this, SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( modProperty( QListViewItem* ) ) );
- connect( this, SIGNAL( itemRenamed( QListViewItem* ) ), this, SLOT( saveProperty( QListViewItem* ) ) );
+ connect( this, SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), SLOT( showPopup( KListView *, TQListViewItem *, const TQPoint & ) ) );
+ connect( this, SIGNAL( doubleClicked( TQListViewItem* ) ), this, SLOT( modProperty( TQListViewItem* ) ) );
+ connect( this, SIGNAL( itemRenamed( TQListViewItem* ) ), this, SLOT( saveProperty( TQListViewItem* ) ) );
}
}
-void StdPropertyListView::showPopup( KListView * /*l*/, QListViewItem *i, const QPoint &p )
+void StdPropertyListView::showPopup( KListView * /*l*/, TQListViewItem *i, const TQPoint &p )
{
if ( i )
kpop->exec( p );
@@ -156,9 +156,9 @@ void StdPropertyListView::createNew()
database->loadUnits( &list );
CreatePropertyDialog* propertyDialog = new CreatePropertyDialog( this, &list );
- if ( propertyDialog->exec() == QDialog::Accepted ) {
- QString name = propertyDialog->newPropertyName();
- QString units = propertyDialog->newUnitsName();
+ if ( propertyDialog->exec() == TQDialog::Accepted ) {
+ TQString name = propertyDialog->newPropertyName();
+ TQString units = propertyDialog->newUnitsName();
if ( !( ( name.isEmpty() ) || ( units.isEmpty() ) ) ) // Make sure none of the fields are empty
{
//check bounds first
@@ -172,7 +172,7 @@ void StdPropertyListView::createNew()
void StdPropertyListView::remove
()
{
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if ( item ) {
switch ( KMessageBox::warningContinueCancel( this, i18n( "Are you sure you want to delete this property?" ) ) ) {
@@ -187,7 +187,7 @@ void StdPropertyListView::remove
void StdPropertyListView::rename()
{
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if ( item )
PropertyListView::rename( item, 0 );
@@ -195,7 +195,7 @@ void StdPropertyListView::rename()
void StdPropertyListView::removeProperty( int id )
{
- QListViewItem * item = findItem( QString::number( id ), 2 );
+ TQListViewItem * item = findItem( TQString::number( id ), 2 );
Q_ASSERT( item );
@@ -204,16 +204,16 @@ void StdPropertyListView::removeProperty( int id )
void StdPropertyListView::createProperty( const IngredientProperty &property )
{
- ( void ) new QListViewItem( this, property.name, property.units, QString::number( property.id ) );
+ ( void ) new TQListViewItem( this, property.name, property.units, TQString::number( property.id ) );
}
-void StdPropertyListView::modProperty( QListViewItem* i )
+void StdPropertyListView::modProperty( TQListViewItem* i )
{
if ( i )
PropertyListView::rename( i, 0 );
}
-void StdPropertyListView::saveProperty( QListViewItem* i )
+void StdPropertyListView::saveProperty( TQListViewItem* i )
{
if ( !checkBounds( i->text( 0 ) ) ) {
reload(); //reset the changed text
@@ -239,10 +239,10 @@ kdDebug() << "saveProp: " << i->text( 0 ) << endl;
database->modProperty( prop_id, i->text( 0 ) );
}
-bool StdPropertyListView::checkBounds( const QString &name )
+bool StdPropertyListView::checkBounds( const TQString &name )
{
if ( name.length() > database->maxPropertyNameLength() ) {
- KMessageBox::error( this, QString( i18n( "Property name cannot be longer than %1 characters." ) ).arg( database->maxPropertyNameLength() ) );
+ KMessageBox::error( this, TQString( i18n( "Property name cannot be longer than %1 characters." ) ).arg( database->maxPropertyNameLength() ) );
return false;
}
@@ -251,7 +251,7 @@ bool StdPropertyListView::checkBounds( const QString &name )
-PropertyConstraintListView::PropertyConstraintListView( QWidget *parent, RecipeDB *db ) : PropertyListView( parent, db )
+PropertyConstraintListView::PropertyConstraintListView( TQWidget *parent, RecipeDB *db ) : PropertyListView( parent, db )
{
addColumn( i18n( "Enabled" ) );
addColumn( i18n( "Property" ) );
@@ -264,7 +264,7 @@ PropertyConstraintListView::PropertyConstraintListView( QWidget *parent, RecipeD
void PropertyConstraintListView::removeProperty( int id )
{
- QListViewItem * item = findItem( QString::number( id ), 4 );
+ TQListViewItem * item = findItem( TQString::number( id ), 4 );
Q_ASSERT( item );
@@ -277,7 +277,7 @@ void PropertyConstraintListView::createProperty( const IngredientProperty &prope
}
-CheckPropertyListView::CheckPropertyListView( QWidget *parent, RecipeDB *db, bool editable ) : StdPropertyListView( parent, db, editable )
+CheckPropertyListView::CheckPropertyListView( TQWidget *parent, RecipeDB *db, bool editable ) : StdPropertyListView( parent, db, editable )
{
}