#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './kdardlg.ui'
**
** Created: Sun Jul 10 12:14:03 2005
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kdardlg.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qsplitter.h>
#include <qheader.h>
#include <klistview.h>
#include <qgroupbox.h>
#include <ktextbrowser.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>


/*
 *  Constructs a KDARDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KDARDlg::KDARDlg( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "KDARDlg" );
    setMouseTracking( TRUE );
    setAcceptDrops( TRUE );
    KDARDlgLayout = new QVBoxLayout( this, 11, 6, "KDARDlgLayout"); 

    mainWindowSplitter = new QSplitter( this, "mainWindowSplitter" );
    mainWindowSplitter->setMouseTracking( TRUE );
    mainWindowSplitter->setAcceptDrops( TRUE );
    mainWindowSplitter->setOrientation( QSplitter::Vertical );
    mainWindowSplitter->setOpaqueResize( FALSE );
    mainWindowSplitter->setHandleWidth( 6 );

    archiveFileView = new KListView( mainWindowSplitter, "archiveFileView" );
    archiveFileView->addColumn( tr2i18n( "Filename" ) );
    archiveFileView->addColumn( tr2i18n( "Permissions" ) );
    archiveFileView->addColumn( tr2i18n( "User ID" ) );
    archiveFileView->addColumn( tr2i18n( "Group ID" ) );
    archiveFileView->addColumn( tr2i18n( "Size" ) );
    archiveFileView->addColumn( tr2i18n( "Date" ) );
    archiveFileView->addColumn( tr2i18n( "Status" ) );
    archiveFileView->setMouseTracking( TRUE );
    archiveFileView->setAcceptDrops( TRUE );
    archiveFileView->setProperty( "selectionMode", "FileManager" );
    archiveFileView->setAllColumnsShowFocus( TRUE );
    archiveFileView->setShowSortIndicator( TRUE );
    archiveFileView->setRootIsDecorated( TRUE );
    archiveFileView->setResizeMode( KListView::NoColumn );

    groupBox2 = new QGroupBox( mainWindowSplitter, "groupBox2" );
    groupBox2->setMouseTracking( TRUE );
    groupBox2->setAcceptDrops( TRUE );
    groupBox2->setColumnLayout(0, Qt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new QVBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( Qt::AlignTop );

    archiveTextBrowser = new KTextBrowser( groupBox2, "archiveTextBrowser" );
    archiveTextBrowser->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, archiveTextBrowser->sizePolicy().hasHeightForWidth() ) );
    archiveTextBrowser->setMouseTracking( TRUE );
    archiveTextBrowser->setAcceptDrops( TRUE );
    groupBox2Layout->addWidget( archiveTextBrowser );
    KDARDlgLayout->addWidget( mainWindowSplitter );
    languageChange();
    resize( QSize(699, 675).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( archiveFileView, SIGNAL( expanded(QListViewItem*) ), this, SLOT( slotArchiveDescend(QListViewItem*) ) );
    connect( archiveFileView, SIGNAL( contextMenu(KListView*,QListViewItem*,const QPoint&) ), this, SLOT( slotArchiveContextMenu(KListView*,QListViewItem*,const QPoint&) ) );
    connect( archiveFileView, SIGNAL( dropped(QDropEvent*) ), this, SLOT( dropEvent(QDropEvent*) ) );
    connect( archiveFileView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotArchiveOpenFromDoubleClick(QListViewItem*) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KDARDlg::languageChange()
{
    setCaption( tr2i18n( "KDAR 0.1" ) );
    archiveFileView->header()->setLabel( 0, tr2i18n( "Filename" ) );
    archiveFileView->header()->setLabel( 1, tr2i18n( "Permissions" ) );
    archiveFileView->header()->setLabel( 2, tr2i18n( "User ID" ) );
    archiveFileView->header()->setLabel( 3, tr2i18n( "Group ID" ) );
    archiveFileView->header()->setLabel( 4, tr2i18n( "Size" ) );
    archiveFileView->header()->setLabel( 5, tr2i18n( "Date" ) );
    archiveFileView->header()->setLabel( 6, tr2i18n( "Status" ) );
    archiveFileView->clear();
    QListViewItem * item = new QListViewItem( archiveFileView, 0 );
    item->setText( 0, tr2i18n( "no archive selected" ) );

    groupBox2->setTitle( tr2i18n( "Messages", "Title for the message window in main KDar view" ) );
}

void KDARDlg::slotArchiveContextMenu(KListView*,QListViewItem*,const QPoint&)
{
    qWarning( "KDARDlg::slotArchiveContextMenu(KListView*,QListViewItem*,const QPoint&): Not implemented yet" );
}

void KDARDlg::slotArchiveChoose(const QString&)
{
    qWarning( "KDARDlg::slotArchiveChoose(const QString&): Not implemented yet" );
}

void KDARDlg::slotArchiveDescend(QListViewItem*)
{
    qWarning( "KDARDlg::slotArchiveDescend(QListViewItem*): Not implemented yet" );
}

void KDARDlg::dropEvent(QDropEvent*)
{
    qWarning( "KDARDlg::dropEvent(QDropEvent*): Not implemented yet" );
}

void KDARDlg::slotArchiveOpenFromDoubleClick(QListViewItem*)
{
    qWarning( "KDARDlg::slotArchiveOpenFromDoubleClick(QListViewItem*): Not implemented yet" );
}

#include "kdardlg.moc"
