00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "customtemplates_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <klineedit.h>
00017 #include <kpushbutton.h>
00018 #include <qheader.h>
00019 #include <qlistview.h>
00020 #include <kactivelabel.h>
00021 #include <qframe.h>
00022 #include <qlabel.h>
00023 #include <qtextedit.h>
00024 #include <qcombobox.h>
00025 #include <kkeybutton.h>
00026 #include <qlayout.h>
00027 #include <qtooltip.h>
00028 #include <qwhatsthis.h>
00029 #include "templatesinsertcommand.h"
00030 #include "kmfawidgets.h"
00031
00032
00033
00034
00035
00036 CustomTemplatesBase::CustomTemplatesBase( QWidget* parent, const char* name, WFlags fl )
00037 : QWidget( parent, name, fl )
00038 {
00039 grid = new QGridLayout( this, 1, 1, 11, 6, "grid");
00040
00041 layout9 = new QVBoxLayout( 0, 0, 6, "layout9");
00042
00043 layout8 = new QHBoxLayout( 0, 0, 6, "layout8");
00044
00045 mName = new KLineEdit( this, "mName" );
00046 mName->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, mName->sizePolicy().hasHeightForWidth() ) );
00047 mName->setMinimumSize( QSize( 100, 0 ) );
00048 layout8->addWidget( mName );
00049
00050 mAdd = new KPushButton( this, "mAdd" );
00051 layout8->addWidget( mAdd );
00052
00053 mRemove = new KPushButton( this, "mRemove" );
00054 layout8->addWidget( mRemove );
00055 layout9->addLayout( layout8 );
00056
00057 mList = new QListView( this, "mList" );
00058 mList->addColumn( tr2i18n( "Type" ) );
00059 mList->addColumn( tr2i18n( "Name" ) );
00060 mList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 3, 1, mList->sizePolicy().hasHeightForWidth() ) );
00061 mList->setAllColumnsShowFocus( TRUE );
00062 layout9->addWidget( mList );
00063
00064 mHelp = new KActiveLabel( this, "mHelp" );
00065 layout9->addWidget( mHelp );
00066
00067 grid->addLayout( layout9, 0, 0 );
00068
00069 mEditFrame = new QFrame( this, "mEditFrame" );
00070 mEditFrame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 12, 0, mEditFrame->sizePolicy().hasHeightForWidth() ) );
00071 mEditFrame->setFrameShape( QFrame::NoFrame );
00072 mEditFrame->setFrameShadow( QFrame::Raised );
00073 mEditFrameLayout = new QVBoxLayout( mEditFrame, 0, 6, "mEditFrameLayout");
00074
00075 layout8_2 = new QHBoxLayout( 0, 0, 6, "layout8_2");
00076
00077 layout6 = new QVBoxLayout( 0, 0, 6, "layout6");
00078
00079 mToLabel = new QLabel( mEditFrame, "mToLabel" );
00080 layout6->addWidget( mToLabel );
00081
00082 mCCLabel = new QLabel( mEditFrame, "mCCLabel" );
00083 layout6->addWidget( mCCLabel );
00084 layout8_2->addLayout( layout6 );
00085
00086 layout7 = new QVBoxLayout( 0, 0, 6, "layout7");
00087
00088 mToEdit = new KMFilterActionWithAddressWidget( mEditFrame, "mToEdit" );
00089 layout7->addWidget( mToEdit );
00090
00091 mCCEdit = new KMFilterActionWithAddressWidget( mEditFrame, "mCCEdit" );
00092 layout7->addWidget( mCCEdit );
00093 layout8_2->addLayout( layout7 );
00094 mEditFrameLayout->addLayout( layout8_2 );
00095
00096 mEdit = new QTextEdit( mEditFrame, "mEdit" );
00097 mEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 3, 1, mEdit->sizePolicy().hasHeightForWidth() ) );
00098 mEdit->setTextFormat( QTextEdit::PlainText );
00099 mEdit->setWordWrap( QTextEdit::NoWrap );
00100 mEditFrameLayout->addWidget( mEdit );
00101
00102 layout4 = new QGridLayout( 0, 1, 1, 0, 6, "layout4");
00103
00104 mType = new QComboBox( FALSE, mEditFrame, "mType" );
00105
00106 layout4->addWidget( mType, 1, 2 );
00107
00108 textLabel1_2 = new QLabel( mEditFrame, "textLabel1_2" );
00109 textLabel1_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00110
00111 layout4->addWidget( textLabel1_2, 0, 1 );
00112
00113 textLabel1 = new QLabel( mEditFrame, "textLabel1" );
00114 textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 1, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
00115 textLabel1->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00116
00117 layout4->addWidget( textLabel1, 1, 1 );
00118
00119 mInsertCommand = new TemplatesInsertCommand( mEditFrame, "mInsertCommand" );
00120
00121 layout4->addWidget( mInsertCommand, 1, 0 );
00122
00123 mKeyButton = new KKeyButton( mEditFrame, "mKeyButton" );
00124
00125 layout4->addWidget( mKeyButton, 0, 2 );
00126 mEditFrameLayout->addLayout( layout4 );
00127
00128 grid->addWidget( mEditFrame, 0, 1 );
00129 languageChange();
00130 resize( QSize(589, 463).expandedTo(minimumSizeHint()) );
00131 clearWState( WState_Polished );
00132
00133
00134 textLabel1_2->setBuddy( mKeyButton );
00135 textLabel1->setBuddy( mType );
00136 }
00137
00138
00139
00140
00141 CustomTemplatesBase::~CustomTemplatesBase()
00142 {
00143
00144 }
00145
00146
00147
00148
00149
00150 void CustomTemplatesBase::languageChange()
00151 {
00152 mAdd->setText( QString::null );
00153 mRemove->setText( QString::null );
00154 mList->header()->setLabel( 0, tr2i18n( "Type" ) );
00155 mList->header()->setLabel( 1, tr2i18n( "Name" ) );
00156 mHelp->setText( tr2i18n( "How does this work?" ) );
00157 mToLabel->setText( tr2i18n( "To:" ) );
00158 mCCLabel->setText( tr2i18n( "CC:" ) );
00159 mType->clear();
00160 mType->insertItem( tr2i18n( "Universal" ) );
00161 mType->insertItem( tr2i18n( "Reply" ) );
00162 mType->insertItem( tr2i18n( "Reply to All" ) );
00163 mType->insertItem( tr2i18n( "Forward" ) );
00164 textLabel1_2->setText( tr2i18n( "Shortc&ut:" ) );
00165 textLabel1->setText( tr2i18n( "&Template type:" ) );
00166 mKeyButton->setText( tr2i18n( "None" ) );
00167 }
00168
00169 void CustomTemplatesBase::mAdd_clicked()
00170 {
00171 qWarning( "CustomTemplatesBase::mAdd_clicked(): Not implemented yet" );
00172 }
00173
00174 void CustomTemplatesBase::mRemove_clicked()
00175 {
00176 qWarning( "CustomTemplatesBase::mRemove_clicked(): Not implemented yet" );
00177 }
00178
00179 #include "customtemplates_base.moc"