/****************************************************************************
** Form implementation generated from reading ui file 'listeditor.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "listeditor.h"

#include <ntqvariant.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

#include "listeditor.ui.h"
/*
 *  Constructs a ListEditor as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
ListEditor::ListEditor( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ListEditor" );
    ListEditorLayout = new TQGridLayout( this, 1, 1, 11, 6, "ListEditorLayout"); 

    listview = new TQListView( this, "listview" );
    listview->addColumn( tr( "Column 1" ) );
    listview->setSelectionMode( TQListView::Extended );
    listview->setResizeMode( TQListView::AllColumns );

    ListEditorLayout->addMultiCellWidget( listview, 0, 4, 0, 0 );

    PushButton1 = new TQPushButton( this, "PushButton1" );

    ListEditorLayout->addWidget( PushButton1, 0, 1 );

    PushButton2 = new TQPushButton( this, "PushButton2" );

    ListEditorLayout->addWidget( PushButton2, 1, 1 );

    PushButton3 = new TQPushButton( this, "PushButton3" );

    ListEditorLayout->addWidget( PushButton3, 2, 1 );

    PushButton4 = new TQPushButton( this, "PushButton4" );

    ListEditorLayout->addWidget( PushButton4, 4, 1 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ListEditorLayout->addItem( Spacer1, 3, 1 );
    languageChange();
    resize( TQSize(331, 301).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addItem() ) );
    connect( PushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeItems() ) );
    connect( PushButton4, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( listview, TQ_SIGNAL( itemRenamed(TQListViewItem*,int) ), this, TQ_SLOT( renamed(TQListViewItem*) ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( renameItem() ) );
    init();
}

/*
 *  Destroys the object and frees any allocated resources
 */
ListEditor::~ListEditor()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ListEditor::languageChange()
{
    setCaption( tr( "Edit..." ) );
    listview->header()->setLabel( 0, tr( "Column 1" ) );
    PushButton1->setText( tr( "&Add" ) );
    PushButton2->setText( tr( "&Remove" ) );
    PushButton3->setText( tr( "Re&name" ) );
    PushButton4->setText( tr( "&Close" ) );
}

