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

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

#include "watchednicknames_preferencesui.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    WatchedNicknames_ConfigUILayout->addWidget( notifyActionLabel, 2, 0 );

    kcfg_NotifyDoubleClickAction = new KLineEdit( this, "kcfg_NotifyDoubleClickAction" );
    kcfg_NotifyDoubleClickAction->setEnabled( false );
    kcfg_NotifyDoubleClickAction->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_NotifyDoubleClickAction->sizePolicy().hasHeightForWidth() ) );

    WatchedNicknames_ConfigUILayout->addMultiCellWidget( kcfg_NotifyDoubleClickAction, 2, 2, 1, 2 );

    notifyDelayLabel = new TQLabel( this, "notifyDelayLabel" );
    notifyDelayLabel->setEnabled( false );

    WatchedNicknames_ConfigUILayout->addWidget( notifyDelayLabel, 3, 0 );
    spacer36 = new TQSpacerItem( 150, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    WatchedNicknames_ConfigUILayout->addItem( spacer36, 3, 2 );

    kcfg_NotifyDelay = new TQSpinBox( this, "kcfg_NotifyDelay" );
    kcfg_NotifyDelay->setEnabled( false );
    kcfg_NotifyDelay->setMaxValue( 1000 );
    kcfg_NotifyDelay->setMinValue( 5 );

    WatchedNicknames_ConfigUILayout->addWidget( kcfg_NotifyDelay, 3, 1 );

    kcfg_OpenWatchedNicksAtStartup = new TQCheckBox( this, "kcfg_OpenWatchedNicksAtStartup" );
    kcfg_OpenWatchedNicksAtStartup->setEnabled( false );

    WatchedNicknames_ConfigUILayout->addMultiCellWidget( kcfg_OpenWatchedNicksAtStartup, 1, 1, 0, 2 );

    kcfg_UseNotify = new TQCheckBox( this, "kcfg_UseNotify" );

    WatchedNicknames_ConfigUILayout->addMultiCellWidget( kcfg_UseNotify, 0, 0, 0, 2 );

    listGroupBox = new TQGroupBox( this, "listGroupBox" );
    listGroupBox->setEnabled( false );
    listGroupBox->setColumnLayout(0, TQt::Vertical );
    listGroupBox->layout()->setSpacing( KDialog::spacingHint() );
    listGroupBox->layout()->setMargin( KDialog::marginHint() );
    listGroupBoxLayout = new TQGridLayout( listGroupBox->layout() );
    listGroupBoxLayout->setAlignment( TQt::AlignTop );

    networkLabel = new TQLabel( listGroupBox, "networkLabel" );
    networkLabel->setEnabled( false );

    listGroupBoxLayout->addWidget( networkLabel, 1, 0 );

    networkDropdown = new TQComboBox( false, listGroupBox, "networkDropdown" );
    networkDropdown->setEnabled( false );

    listGroupBoxLayout->addWidget( networkDropdown, 1, 1 );

    nicknameLabel = new TQLabel( listGroupBox, "nicknameLabel" );
    nicknameLabel->setEnabled( false );

    listGroupBoxLayout->addWidget( nicknameLabel, 1, 2 );

    nicknameInput = new KLineEdit( listGroupBox, "nicknameInput" );
    nicknameInput->setEnabled( false );

    listGroupBoxLayout->addWidget( nicknameInput, 1, 3 );

    notifyListView = new TDEListView( listGroupBox, "notifyListView" );
    notifyListView->addColumn( tr2i18n( "Watched Networks/Nicknames" ) );
    notifyListView->setEnabled( false );
    notifyListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, notifyListView->sizePolicy().hasHeightForWidth() ) );
    notifyListView->setAllColumnsShowFocus( true );
    notifyListView->setRootIsDecorated( true );
    notifyListView->setFullWidth( true );
    notifyListView->setItemsRenameable( true );

    listGroupBoxLayout->addMultiCellWidget( notifyListView, 0, 0, 0, 3 );

    layout3 = new TQVBoxLayout( 0, 0, KDialog::spacingHint(), "layout3"); 

    newButton = new KPushButton( listGroupBox, "newButton" );
    newButton->setEnabled( false );
    newButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, newButton->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( newButton );

    removeButton = new KPushButton( listGroupBox, "removeButton" );
    removeButton->setEnabled( false );
    removeButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, removeButton->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( removeButton );
    spacer34 = new TQSpacerItem( 20, 160, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout3->addItem( spacer34 );

    listGroupBoxLayout->addMultiCellLayout( layout3, 0, 1, 4, 4 );

    WatchedNicknames_ConfigUILayout->addMultiCellWidget( listGroupBox, 4, 4, 0, 2 );
    languageChange();
    resize( TQSize(623, 418).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), kcfg_OpenWatchedNicksAtStartup, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), kcfg_NotifyDelay, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), notifyListView, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), notifyDelayLabel, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), notifyActionLabel, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), kcfg_NotifyDoubleClickAction, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_UseNotify, TQ_SIGNAL( toggled(bool) ), listGroupBox, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_UseNotify, kcfg_OpenWatchedNicksAtStartup );
    setTabOrder( kcfg_OpenWatchedNicksAtStartup, kcfg_NotifyDoubleClickAction );
    setTabOrder( kcfg_NotifyDoubleClickAction, kcfg_NotifyDelay );
    setTabOrder( kcfg_NotifyDelay, notifyListView );
    setTabOrder( notifyListView, networkDropdown );
    setTabOrder( networkDropdown, nicknameInput );
    setTabOrder( nicknameInput, newButton );
    setTabOrder( newButton, removeButton );

    // buddies
    notifyActionLabel->setBuddy( kcfg_NotifyDoubleClickAction );
    notifyDelayLabel->setBuddy( kcfg_NotifyDelay );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void WatchedNicknames_ConfigUI::languageChange()
{
    notifyActionLabel->setText( tr2i18n( "Command e&xecuted when nickname is double clicked:" ) );
    TQWhatsThis::add( notifyActionLabel, tr2i18n( "<qt>\n"
"<p>When you double click a nickname in the <b>Nicks Online</b> window, this\n"
"command is placed in the <b>Input Line</b> on the server window.</p>\n"
"<p>The following symbols can be used in the command:</p><ul>\n"
"<li>%u: The nickname double clicked.</li>\n"
"<li>%K: Server password.</li>\n"
"<li>%n: Send command directly to the server instead of your input line.</li>\"\n"
"</ul>\n"
"</qt>" ) );
    TQWhatsThis::add( kcfg_NotifyDoubleClickAction, tr2i18n( "<qt>\n"
"<p>When you double click a nickname in the <b>Nicks Online</b> window, this\n"
" command is placed in the <b>Input Line</b> on the server window.</p>\n"
"<p>The following symbols can be used in the command:</p><ul>\n"
"<li>%u: The nickname double clicked.</li>\n"
"<li>%K: Server password.</li>\n"
"<li>%n: Send command directly to the server instead of your input line.</li>\n"
"</ul>\n"
"</qt>" ) );
    notifyDelayLabel->setText( tr2i18n( "&Update interval:" ) );
    TQWhatsThis::add( notifyDelayLabel, tr2i18n( "Konversation will check the status of the nicknames listed below at this interval." ) );
    kcfg_NotifyDelay->setSuffix( tr2i18n( " seconds" ) );
    TQWhatsThis::add( kcfg_NotifyDelay, tr2i18n( "Konversation will check the status of the nicknames listed below at this interval." ) );
    kcfg_OpenWatchedNicksAtStartup->setText( tr2i18n( "Show watched nicks online tab on &application startup" ) );
    TQWhatsThis::add( kcfg_OpenWatchedNicksAtStartup, tr2i18n( "<qt>When checked, the <b>Nicks Online</b> window will be automatically opened when starting Konversation.</qt>" ) );
    kcfg_UseNotify->setText( tr2i18n( "Enable nic&kname watcher" ) );
    TQWhatsThis::add( kcfg_UseNotify, tr2i18n( "<qt>\n"
"<p>\n"
"When the nickname watcher is turned on, you will be notified when the nicknames appearing in the <b>Watched Networks/Nicknames</b> list come online or go offline.</p>\n"
"<p>You can also open the <b>Nicks Online</b> window to see the status of all the watched nicknames.</p>\n"
"</qt>" ) );
    listGroupBox->setTitle( tr2i18n( "Watched Nicknames" ) );
    networkLabel->setText( tr2i18n( "Network:" ) );
    TQWhatsThis::add( networkLabel, tr2i18n( "The irc server network (such as 'freenode') that the selected user to watch is on." ) );
    TQWhatsThis::add( networkDropdown, tr2i18n( "The irc server network (such as 'freenode') that the selected user to watch is on." ) );
    nicknameLabel->setText( tr2i18n( "Nickname:" ) );
    TQWhatsThis::add( nicknameLabel, tr2i18n( "The nick (username) of the selected person to watch" ) );
    TQWhatsThis::add( nicknameInput, tr2i18n( "The nick (username) of the selected person to watch" ) );
    notifyListView->header()->setLabel( 0, tr2i18n( "Watched Networks/Nicknames" ) );
    TQWhatsThis::add( notifyListView, tr2i18n( "<qt>\n"
"<p>\n"
"When the nickname watcher is turned on, you will be notified when the nicknames appearing in the <b>Watched Networks/Nicknames</b> list come online or go offline.</p>\n"
"<p>You can also open the <b>Nicks Online</b> window to see the status of all the watched nicknames.</p></qt>" ) );
    newButton->setText( tr2i18n( "&New..." ) );
    TQWhatsThis::add( newButton, tr2i18n( "Click to add a nickname to the list." ) );
    removeButton->setText( tr2i18n( "&Remove" ) );
    TQWhatsThis::add( removeButton, tr2i18n( "Click to remove the selected nickname from the list." ) );
}

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

TQMetaObject *WatchedNicknames_ConfigUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_WatchedNicknames_ConfigUI( "WatchedNicknames_ConfigUI", &WatchedNicknames_ConfigUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* WatchedNicknames_ConfigUI::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(
	"WatchedNicknames_ConfigUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_WatchedNicknames_ConfigUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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