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

#include "pixmapcollectioneditor.h"

#include <ntqvariant.h>
#include <ntqfileinfo.h>
#include <ntqimage.h>
#include <ntqiconview.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "pixmapcollection.h"
#include "pixmapchooser.h"
#include "project.h"
#include "pixmapcollectioneditor.ui.h"

/*
 *  Constructs a PixmapCollectionEditor 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.
 */
PixmapCollectionEditor::PixmapCollectionEditor( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "PixmapCollectionEditor" );
    PixmapCollectionEditorLayout = new TQVBoxLayout( this, 11, 6, "PixmapCollectionEditorLayout"); 

    viewPixmaps = new TQIconView( this, "viewPixmaps" );
    viewPixmaps->setResizeMode( TQIconView::Adjust );
    viewPixmaps->setItemsMovable( false );
    PixmapCollectionEditorLayout->addWidget( viewPixmaps );

    Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2"); 

    PushButton2 = new TQPushButton( this, "PushButton2" );
    Layout2->addWidget( PushButton2 );

    PushButton3 = new TQPushButton( this, "PushButton3" );
    Layout2->addWidget( PushButton3 );
    Spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout2->addItem( Spacer2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setDefault( true );
    Layout2->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    Layout2->addWidget( buttonCancel );

    buttonClose = new TQPushButton( this, "buttonClose" );
    buttonClose->setDefault( true );
    Layout2->addWidget( buttonClose );
    PixmapCollectionEditorLayout->addLayout( Layout2 );
    languageChange();
    resize( TQSize(455, 260).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addPixmap() ) );
    connect( PushButton3, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removePixmap() ) );
    connect( viewPixmaps, TQ_SIGNAL( currentChanged(TQIconViewItem*) ), this, TQ_SLOT( currentChanged(TQIconViewItem*) ) );
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( buttonClose, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );

    // tab order
    setTabOrder( PushButton2, PushButton3 );
    setTabOrder( PushButton3, viewPixmaps );
    setTabOrder( viewPixmaps, buttonClose );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PixmapCollectionEditor::languageChange()
{
    setCaption( tr( "Manage Image Collection" ) );
    PushButton2->setText( tr( "&Add..." ) );
    PushButton3->setText( tr( "&Delete" ) );
    buttonOk->setText( tr( "&OK" ) );
    buttonCancel->setText( tr( "&Cancel" ) );
    buttonClose->setText( tr( "C&lose" ) );
}

