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

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

#include "channeloptionsui.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <knuminput.h>
#include <ktextedit.h>
#include <tdelistview.h>
#include <tdelistviewsearchline.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqsplitter.h>
#include <ntqcheckbox.h>
#include <ntqtoolbutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a Konversation::ChannelOptionsUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
Konversation::ChannelOptionsUI::ChannelOptionsUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "Konversation::ChannelOptionsUI" );
    ChannelOptionsUILayout = new TQVBoxLayout( this, 0, KDialog::spacingHint(), "ChannelOptionsUILayout"); 

    channelTabWidget = new TQTabWidget( this, "channelTabWidget" );

    topicTab = new TQWidget( channelTabWidget, "topicTab" );
    topicTabLayout = new TQVBoxLayout( topicTab, KDialog::marginHint(), KDialog::spacingHint(), "topicTabLayout"); 

    splitter4 = new TQSplitter( topicTab, "splitter4" );
    splitter4->setOrientation( TQSplitter::Vertical );

    topicHistoryList = new TDEListView( splitter4, "topicHistoryList" );
    topicHistoryList->addColumn( tr2i18n( "Nickname" ) );
    topicHistoryList->addColumn( tr2i18n( "Date" ) );
    topicHistoryList->addColumn( tr2i18n( "Topic" ) );
    topicHistoryList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, topicHistoryList->sizePolicy().hasHeightForWidth() ) );
    topicHistoryList->setProperty( "selectionMode", "Single" );
    topicHistoryList->setAllColumnsShowFocus( true );
    topicHistoryList->setShowSortIndicator( true );
    topicHistoryList->setShowToolTips( false );
    topicHistoryList->setResizeMode( TDEListView::AllColumns );
    topicHistoryList->setFullWidth( true );
    topicHistoryList->setItemsMovable( false );

    topicPreview = new KTextEdit( splitter4, "topicPreview" );
    topicPreview->setEnabled( true );
    topicPreview->setBackgroundOrigin( KTextEdit::WidgetOrigin );
    topicPreview->setReadOnly( true );
    topicTabLayout->addWidget( splitter4 );

    topicEdit = new KTextEdit( topicTab, "topicEdit" );
    topicEdit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 2, topicEdit->sizePolicy().hasHeightForWidth() ) );
    topicEdit->setTextFormat( KTextEdit::PlainText );
    topicTabLayout->addWidget( topicEdit );
    channelTabWidget->insertTab( topicTab, TQString::fromLatin1("") );

    modesPage = new TQWidget( channelTabWidget, "modesPage" );
    modesPageLayout = new TQVBoxLayout( modesPage, KDialog::marginHint(), KDialog::spacingHint(), "modesPageLayout"); 

    topicModeChBox = new TQCheckBox( modesPage, "topicModeChBox" );
    modesPageLayout->addWidget( topicModeChBox );

    messageModeChBox = new TQCheckBox( modesPage, "messageModeChBox" );
    modesPageLayout->addWidget( messageModeChBox );

    secretModeChBox = new TQCheckBox( modesPage, "secretModeChBox" );
    modesPageLayout->addWidget( secretModeChBox );

    inviteModeChBox = new TQCheckBox( modesPage, "inviteModeChBox" );
    modesPageLayout->addWidget( inviteModeChBox );

    moderatedModeChBox = new TQCheckBox( modesPage, "moderatedModeChBox" );
    modesPageLayout->addWidget( moderatedModeChBox );

    layout11 = new TQGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout11"); 

    keyModeChBox = new TQCheckBox( modesPage, "keyModeChBox" );

    layout11->addWidget( keyModeChBox, 1, 0 );

    userLimitEdit = new KIntNumInput( modesPage, "userLimitEdit" );
    userLimitEdit->setEnabled( false );
    userLimitEdit->setMinValue( 0 );

    layout11->addWidget( userLimitEdit, 0, 1 );

    userLimitChBox = new TQCheckBox( modesPage, "userLimitChBox" );

    layout11->addWidget( userLimitChBox, 0, 0 );
    spacer10 = new TQSpacerItem( 211, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout11->addItem( spacer10, 0, 2 );

    keyModeEdit = new KLineEdit( modesPage, "keyModeEdit" );
    keyModeEdit->setEnabled( false );

    layout11->addMultiCellWidget( keyModeEdit, 1, 1, 1, 2 );
    modesPageLayout->addLayout( layout11 );

    layout2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 

    toggleAdvancedModes = new TQPushButton( modesPage, "toggleAdvancedModes" );
    toggleAdvancedModes->setToggleButton( true );
    layout2->addWidget( toggleAdvancedModes );
    spacer3 = new TQSpacerItem( 301, 31, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer3 );
    modesPageLayout->addLayout( layout2 );

    otherModesList = new TDEListView( modesPage, "otherModesList" );
    otherModesList->addColumn( tr2i18n( "Mode" ) );
    otherModesList->addColumn( tr2i18n( "Parameter" ) );
    otherModesList->setProperty( "selectionMode", "Single" );
    otherModesList->setAllColumnsShowFocus( true );
    otherModesList->setResizeMode( TDEListView::LastColumn );
    otherModesList->setDefaultRenameAction( TDEListView::Accept );
    otherModesList->setItemsMovable( false );
    otherModesList->setItemsRenameable( true );
    modesPageLayout->addWidget( otherModesList );
    spacer4 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    modesPageLayout->addItem( spacer4 );
    channelTabWidget->insertTab( modesPage, TQString::fromLatin1("") );

    TabPage = new TQWidget( channelTabWidget, "TabPage" );
    TabPageLayout = new TQGridLayout( TabPage, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "TabPageLayout"); 

    removeBan = new TQPushButton( TabPage, "removeBan" );
    removeBan->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, removeBan->sizePolicy().hasHeightForWidth() ) );

    TabPageLayout->addMultiCellWidget( removeBan, 2, 2, 0, 2 );

    addBan = new TQPushButton( TabPage, "addBan" );
    addBan->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, addBan->sizePolicy().hasHeightForWidth() ) );

    TabPageLayout->addWidget( addBan, 2, 3 );

    banList = new TDEListView( TabPage, "banList" );
    banList->addColumn( tr2i18n( "Hostmask" ) );
    banList->addColumn( tr2i18n( "Set By" ) );
    banList->addColumn( tr2i18n( "Time Set" ) );
    banList->setShowSortIndicator( true );
    banList->setItemsRenameable( true );

    TabPageLayout->addMultiCellWidget( banList, 1, 1, 0, 3 );

    clearButton = new TQToolButton( TabPage, "clearButton" );
    clearButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)4, 0, 0, clearButton->sizePolicy().hasHeightForWidth() ) );

    TabPageLayout->addWidget( clearButton, 0, 0 );

    textLabel2 = new TQLabel( TabPage, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );

    TabPageLayout->addWidget( textLabel2, 0, 1 );

    banListSearchLine = new TDEListViewSearchLine( TabPage, "banListSearchLine" );

    TabPageLayout->addMultiCellWidget( banListSearchLine, 0, 0, 2, 3 );
    channelTabWidget->insertTab( TabPage, TQString::fromLatin1("") );
    ChannelOptionsUILayout->addWidget( channelTabWidget );
    languageChange();
    resize( TQSize(502, 421).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( keyModeChBox, TQ_SIGNAL( toggled(bool) ), keyModeEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( userLimitChBox, TQ_SIGNAL( toggled(bool) ), userLimitEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( clearButton, TQ_SIGNAL( clicked() ), banListSearchLine, TQ_SLOT( clear() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void Konversation::ChannelOptionsUI::languageChange()
{
    topicHistoryList->header()->setLabel( 0, tr2i18n( "Nickname" ) );
    topicHistoryList->header()->setLabel( 1, tr2i18n( "Date" ) );
    topicHistoryList->header()->setLabel( 2, tr2i18n( "Topic" ) );
    channelTabWidget->changeTab( topicTab, tr2i18n( "Topi&c" ) );
    topicModeChBox->setText( tr2i18n( "&Topic can only be changed by channel operators" ) );
    TQWhatsThis::add( topicModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>The <b>T</b>opic mode means that only the channel operator can change the topic for the channel.</qt>" ) );
    messageModeChBox->setText( tr2i18n( "&No messages from outside the channel" ) );
    TQWhatsThis::add( messageModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p><b>N</b>o messages from outside means that users that are not in the channel cannot send messages that everybody in the channel can see.  Almost all channels have this set to prevent nuisance messages.</qt>" ) );
    secretModeChBox->setText( tr2i18n( "&Secret channel, the channel is not listed in the channel list" ) );
    TQWhatsThis::add( secretModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A <b>S</b>ecret channel will not show up in the channel list, nor will any user be able to see that you are in the channel with the <em>WHOIS</em> command or anything similar.  Only the people that are in the same channel will know that you are in this channel, if this mode is set.</qt>" ) );
    inviteModeChBox->setText( tr2i18n( "Only &invited are allowed to join the channel" ) );
    TQWhatsThis::add( inviteModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>An <b>I</b>nvite only channel means that people can only join the channel if they are invited.  To invite someone, a channel operator needs to issue the command<em>/invite nick</em> from within the channel.</qt>" ) );
    moderatedModeChBox->setText( tr2i18n( "&Moderated channel, only people with voice can write to the channel" ) );
    TQWhatsThis::add( moderatedModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A <b>M</b>oderated channel is one where only operators, half-operators and those with voice can talk.</qt>" ) );
    keyModeChBox->setText( tr2i18n( "Channel &password:" ) );
    TQWhatsThis::add( keyModeChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A <b>P</b>rotected channel requires users to enter a password in order to join.</qt>" ) );
    TQWhatsThis::add( userLimitEdit, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A channel that has a user <b>L</b>imit means that only that many users can be in the channel at any one time.  Some channels have a bot that sits in the channel and changes this automatically depending on how busy the channel is.</qt>" ) );
    userLimitChBox->setText( tr2i18n( "User &limit:" ) );
    TQWhatsThis::add( userLimitChBox, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A channel that has a user <b>L</b>imit means that only that many users can be in the channel at any one time.  Some channels have a bot that sits in the channel and changes this automatically depending on how busy the channel is.</qt>" ) );
    TQWhatsThis::add( keyModeEdit, tr2i18n( "<qt>These control the <em>mode</em> of the channel.  Only an operator can change these.<p>A <b>P</b>rotected channel requires users to enter a password in order to join.</qt>" ) );
    toggleAdvancedModes->setText( tr2i18n( "Show &Advanced Modes >>" ) );
    toggleAdvancedModes->setAccel( TQKeySequence( tr2i18n( "Tab, Backspace" ) ) );
    otherModesList->header()->setLabel( 0, tr2i18n( "Mode" ) );
    otherModesList->header()->setLabel( 1, tr2i18n( "Parameter" ) );
    channelTabWidget->changeTab( modesPage, tr2i18n( "Mo&des" ) );
    removeBan->setText( tr2i18n( "&Remove Ban" ) );
    addBan->setText( tr2i18n( "&Add Ban" ) );
    banList->header()->setLabel( 0, tr2i18n( "Hostmask" ) );
    banList->header()->setLabel( 1, tr2i18n( "Set By" ) );
    banList->header()->setLabel( 2, tr2i18n( "Time Set" ) );
    clearButton->setText( TQString::null );
    textLabel2->setText( tr2i18n( "Search:" ) );
    channelTabWidget->changeTab( TabPage, tr2i18n( "&Ban List" ) );
}

/****************************************************************************
** Konversation::ChannelOptionsUI meta object code from reading C++ file 'channeloptionsui.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 "channeloptionsui.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 *Konversation::ChannelOptionsUI::className() const
{
    return "Konversation::ChannelOptionsUI";
}

TQMetaObject *Konversation::ChannelOptionsUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_Konversation__ChannelOptionsUI( "Konversation::ChannelOptionsUI", &Konversation::ChannelOptionsUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* Konversation::ChannelOptionsUI::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 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"Konversation::ChannelOptionsUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_Konversation__ChannelOptionsUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool Konversation::ChannelOptionsUI::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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