#include <kdialog.h>
#include <tdelocale.h>

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

#include "sessionwidgetbase.h"

#include <ntqvariant.h>
#include <klshistorycombo.h>
#include <kpushbutton.h>
#include <resultssearchbar.h>
#include <treeview.h>
#include <kprogress.h>
#include <ksqueezedtextlabel.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqtoolbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqspinbox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "treeview.h"
#include "resultssearchbar.h"

/*
 *  Constructs a SessionWidgetBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
SessionWidgetBase::SessionWidgetBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "SessionWidgetBase" );
    setMinimumSize( TQSize( 0, 300 ) );
    setBaseSize( TQSize( 1000, 500 ) );
    SessionWidgetBaseLayout = new TQVBoxLayout( this, 11, 6, "SessionWidgetBaseLayout"); 

    buttongroup_search = new TQButtonGroup( this, "buttongroup_search" );
    buttongroup_search->setColumnLayout(0, TQt::Vertical );
    buttongroup_search->layout()->setSpacing( 6 );
    buttongroup_search->layout()->setMargin( 11 );
    buttongroup_searchLayout = new TQVBoxLayout( buttongroup_search->layout() );
    buttongroup_searchLayout->setAlignment( TQt::AlignTop );

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

    layout14 = new TQVBoxLayout( 0, 0, 6, "layout14"); 

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

    toolButton_clear_combo = new TQToolButton( buttongroup_search, "toolButton_clear_combo" );
    toolButton_clear_combo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, toolButton_clear_combo->sizePolicy().hasHeightForWidth() ) );
    toolButton_clear_combo->setMinimumSize( TQSize( 25, 25 ) );
    toolButton_clear_combo->setMaximumSize( TQSize( 25, 25 ) );
    toolButton_clear_combo->setAutoRaise( true );
    layout13->addWidget( toolButton_clear_combo );

    textlabel_url = new TQLabel( buttongroup_search, "textlabel_url" );
    textlabel_url->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textlabel_url->sizePolicy().hasHeightForWidth() ) );
    textlabel_url->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignLeft ) );
    layout13->addWidget( textlabel_url );

    combobox_url = new KLSHistoryCombo( buttongroup_search, "combobox_url" );
    combobox_url->setFocusPolicy( KLSHistoryCombo::StrongFocus );
    combobox_url->setAcceptDrops( false );
    layout13->addWidget( combobox_url );

    pushbutton_url = new KPushButton( buttongroup_search, "pushbutton_url" );
    pushbutton_url->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)1, 0, 0, pushbutton_url->sizePolicy().hasHeightForWidth() ) );
    layout13->addWidget( pushbutton_url );
    Spacer11 = new TQSpacerItem( 16, 20, TQSizePolicy::Maximum, TQSizePolicy::Minimum );
    layout13->addItem( Spacer11 );
    layout14->addLayout( layout13 );

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

    checkbox_recursively = new TQCheckBox( buttongroup_search, "checkbox_recursively" );
    checkbox_recursively->setChecked( true );
    layout10->addWidget( checkbox_recursively );

    spinbox_depth = new TQSpinBox( buttongroup_search, "spinbox_depth" );
    spinbox_depth->setEnabled( true );
    spinbox_depth->setMaxValue( 15 );
    spinbox_depth->setMinValue( 0 );
    spinbox_depth->setValue( 0 );
    layout10->addWidget( spinbox_depth );

    checkbox_subdirs_only = new TQCheckBox( buttongroup_search, "checkbox_subdirs_only" );
    checkbox_subdirs_only->setEnabled( true );
    layout10->addWidget( checkbox_subdirs_only );
    spacer4 = new TQSpacerItem( 160, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout10->addItem( spacer4 );
    layout14->addLayout( layout10 );

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

    checkbox_external_links = new TQCheckBox( buttongroup_search, "checkbox_external_links" );
    checkbox_external_links->setEnabled( true );
    checkbox_external_links->setChecked( true );
    layout11->addWidget( checkbox_external_links );
    spacer5 = new TQSpacerItem( 174, 20, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    layout11->addItem( spacer5 );
    layout14->addLayout( layout11 );

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

    textLabel1 = new TQLabel( buttongroup_search, "textLabel1" );
    layout11_2->addWidget( textLabel1 );

    lineedit_reg_exp = new TQLineEdit( buttongroup_search, "lineedit_reg_exp" );
    layout11_2->addWidget( lineedit_reg_exp );
    spacer5_2 = new TQSpacerItem( 16, 20, TQSizePolicy::Maximum, TQSizePolicy::Minimum );
    layout11_2->addItem( spacer5_2 );
    layout14->addLayout( layout11_2 );
    layout15->addLayout( layout14 );
    buttongroup_searchLayout->addLayout( layout15 );
    SessionWidgetBaseLayout->addWidget( buttongroup_search );

    resultsSearchBar = new ResultsSearchBar( this, "resultsSearchBar" );
    resultsSearchBar->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, resultsSearchBar->sizePolicy().hasHeightForWidth() ) );
    SessionWidgetBaseLayout->addWidget( resultsSearchBar );

    tree_view = new TreeView( this, "tree_view" );
    tree_view->setMinimumSize( TQSize( 0, 300 ) );
    SessionWidgetBaseLayout->addWidget( tree_view );

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

    textlabel_progressbar = new TQLabel( this, "textlabel_progressbar" );
    textlabel_progressbar->setMinimumSize( TQSize( 94, 0 ) );
    layout10_2->addWidget( textlabel_progressbar );

    progressbar_checker = new KProgress( this, "progressbar_checker" );
    progressbar_checker->setTotalSteps( 1 );
    progressbar_checker->setProgress( 0 );
    progressbar_checker->setPercentageVisible( false );
    layout10_2->addWidget( progressbar_checker );
    SessionWidgetBaseLayout->addLayout( layout10_2 );

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

    textlabel_status = new KSqueezedTextLabel( this, "textlabel_status" );
    textlabel_status->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, textlabel_status->sizePolicy().hasHeightForWidth() ) );
    textlabel_status->setMaximumSize( TQSize( 470, 32767 ) );
    layout11_3->addWidget( textlabel_status );
    spacer5_2_3 = new TQSpacerItem( 30, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    layout11_3->addItem( spacer5_2_3 );

    layout12_2 = new TQGridLayout( 0, 1, 1, 0, 6, "layout12_2"); 

    textlabel_elapsed_time = new TQLabel( this, "textlabel_elapsed_time" );
    textlabel_elapsed_time->setEnabled( false );
    textlabel_elapsed_time->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textlabel_elapsed_time->sizePolicy().hasHeightForWidth() ) );

    layout12_2->addWidget( textlabel_elapsed_time, 1, 0 );

    textlabel_elapsed_time_value = new TQLabel( this, "textlabel_elapsed_time_value" );
    textlabel_elapsed_time_value->setEnabled( true );
    textlabel_elapsed_time_value->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textlabel_elapsed_time_value->sizePolicy().hasHeightForWidth() ) );
    textlabel_elapsed_time_value->setMinimumSize( TQSize( 80, 0 ) );

    layout12_2->addWidget( textlabel_elapsed_time_value, 1, 1 );
    layout11_3->addLayout( layout12_2 );
    SessionWidgetBaseLayout->addLayout( layout11_3 );
    languageChange();
    resize( TQSize(689, 683).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( checkbox_recursively, TQ_SIGNAL( toggled(bool) ), spinbox_depth, TQ_SLOT( setEnabled(bool) ) );
    connect( checkbox_recursively, TQ_SIGNAL( toggled(bool) ), checkbox_external_links, TQ_SLOT( setEnabled(bool) ) );
    connect( checkbox_recursively, TQ_SIGNAL( toggled(bool) ), checkbox_subdirs_only, TQ_SLOT( setEnabled(bool) ) );
    connect( toolButton_clear_combo, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotClearComboUrl() ) );

    // tab order
    setTabOrder( combobox_url, checkbox_recursively );
    setTabOrder( checkbox_recursively, spinbox_depth );
    setTabOrder( spinbox_depth, checkbox_subdirs_only );
    setTabOrder( checkbox_subdirs_only, checkbox_external_links );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SessionWidgetBase::languageChange()
{
    buttongroup_search->setTitle( tr2i18n( "Search" ) );
    toolButton_clear_combo->setText( TQString::null );
    textlabel_url->setText( tr2i18n( "URL: " ) );
    pushbutton_url->setText( TQString::null );
    checkbox_recursively->setText( tr2i18n( "Recursivel&y:" ) );
    TQToolTip::add( checkbox_recursively, tr2i18n( "Check pages recursively" ) );
    spinbox_depth->setSpecialValueText( tr2i18n( "Unlimited" ) );
    TQToolTip::add( spinbox_depth, TQString::null );
    checkbox_subdirs_only->setText( tr2i18n( "Do &not check parent folders" ) );
    checkbox_external_links->setText( tr2i18n( "Chec&k external links" ) );
    textLabel1->setText( tr2i18n( "Do not check regular expression:" ) );
    textlabel_progressbar->setText( tr2i18n( "Ready" ) );
    textlabel_status->setText( TQString::null );
    textlabel_elapsed_time->setText( tr2i18n( "Elapsed time:" ) );
    TQToolTip::add( textlabel_elapsed_time, tr2i18n( "hh:mm:ss.zzz" ) );
    textlabel_elapsed_time_value->setText( TQString::null );
    TQToolTip::add( textlabel_elapsed_time_value, tr2i18n( "hh:mm:ss.zzz" ) );
}

/****************************************************************************
** SessionWidgetBase meta object code from reading C++ file 'sessionwidgetbase.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "sessionwidgetbase.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *SessionWidgetBase::className() const
{
    return "SessionWidgetBase";
}

TQMetaObject *SessionWidgetBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SessionWidgetBase( "SessionWidgetBase", &SessionWidgetBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString SessionWidgetBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "SessionWidgetBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString SessionWidgetBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "SessionWidgetBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* SessionWidgetBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"slotCheck", 0, 0 };
    static const TQUMethod slot_1 = {"slotCancel", 0, 0 };
    static const TQUMethod slot_2 = {"slotClearComboUrl", 0, 0 };
    static const TQUMethod slot_3 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotCheck()", &slot_0, TQMetaData::Public },
	{ "slotCancel()", &slot_1, TQMetaData::Public },
	{ "slotClearComboUrl()", &slot_2, TQMetaData::Public },
	{ "languageChange()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"SessionWidgetBase", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_SessionWidgetBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* SessionWidgetBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "SessionWidgetBase" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool SessionWidgetBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotCheck(); break;
    case 1: slotCancel(); break;
    case 2: slotClearComboUrl(); break;
    case 3: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool SessionWidgetBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool SessionWidgetBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool SessionWidgetBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
