kmail

snippetdlgbase.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './snippetdlgbase.ui'
00005 **
00006 ** Created: Fri Aug 22 18:47:15 2008
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "snippetdlgbase.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <kpushbutton.h>
00017 #include <klineedit.h>
00018 #include <qlabel.h>
00019 #include <kcombobox.h>
00020 #include <ktextedit.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 #include "kpushbutton.h"
00025 #include "klineedit.h"
00026 #include "kcombobox.h"
00027 #include "ktextedit.h"
00028 
00029 /*
00030  *  Constructs a SnippetDlgBase as a child of 'parent', with the
00031  *  name 'name' and widget flags set to 'f'.
00032  *
00033  *  The dialog will by default be modeless, unless you set 'modal' to
00034  *  TRUE to construct a modal dialog.
00035  */
00036 SnippetDlgBase::SnippetDlgBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00037     : QDialog( parent, name, modal, fl )
00038 {
00039     if ( !name )
00040     setName( "SnippetDlgBase" );
00041     SnippetDlgBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "SnippetDlgBaseLayout"); 
00042 
00043     layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); 
00044     spacer1 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00045     layout5->addItem( spacer1 );
00046 
00047     btnAdd = new KPushButton( this, "btnAdd" );
00048     layout5->addWidget( btnAdd );
00049 
00050     btnCancel = new KPushButton( this, "btnCancel" );
00051     layout5->addWidget( btnCancel );
00052 
00053     SnippetDlgBaseLayout->addLayout( layout5, 1, 0 );
00054 
00055     layout3 = new QGridLayout( 0, 1, 1, 0, 6, "layout3"); 
00056 
00057     snippetName = new KLineEdit( this, "snippetName" );
00058 
00059     layout3->addWidget( snippetName, 0, 1 );
00060     spacer2 = new QSpacerItem( 20, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
00061     layout3->addItem( spacer2, 4, 0 );
00062 
00063     textLabel1 = new QLabel( this, "textLabel1" );
00064 
00065     layout3->addWidget( textLabel1, 0, 0 );
00066 
00067     textLabel2 = new QLabel( this, "textLabel2" );
00068     textLabel2->setAlignment( int( QLabel::AlignTop ) );
00069 
00070     layout3->addWidget( textLabel2, 2, 0 );
00071 
00072     textLabelGroup = new QLabel( this, "textLabelGroup" );
00073 
00074     layout3->addWidget( textLabelGroup, 1, 0 );
00075 
00076     cbGroup = new KComboBox( FALSE, this, "cbGroup" );
00077 
00078     layout3->addWidget( cbGroup, 1, 1 );
00079 
00080     snippetText = new KTextEdit( this, "snippetText" );
00081     QFont snippetText_font(  snippetText->font() );
00082     snippetText_font.setFamily( "Courier" );
00083     snippetText_font.setPointSize( 11 );
00084     snippetText->setFont( snippetText_font ); 
00085 
00086     layout3->addMultiCellWidget( snippetText, 2, 4, 1, 1 );
00087 
00088     SnippetDlgBaseLayout->addLayout( layout3, 0, 0 );
00089     languageChange();
00090     resize( QSize(344, 289).expandedTo(minimumSizeHint()) );
00091     clearWState( WState_Polished );
00092 
00093     // signals and slots connections
00094     connect( btnAdd, SIGNAL( clicked() ), this, SLOT( accept() ) );
00095     connect( btnCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00096 
00097     // tab order
00098     setTabOrder( snippetName, cbGroup );
00099     setTabOrder( cbGroup, snippetText );
00100     setTabOrder( snippetText, btnAdd );
00101     setTabOrder( btnAdd, btnCancel );
00102 
00103     // buddies
00104     textLabel1->setBuddy( snippetName );
00105     textLabel2->setBuddy( snippetText );
00106 }
00107 
00108 /*
00109  *  Destroys the object and frees any allocated resources
00110  */
00111 SnippetDlgBase::~SnippetDlgBase()
00112 {
00113     // no need to delete child widgets, Qt does it all for us
00114 }
00115 
00116 /*
00117  *  Sets the strings of the subwidgets using the current
00118  *  language.
00119  */
00120 void SnippetDlgBase::languageChange()
00121 {
00122     setCaption( tr2i18n( "Add Snippet" ) );
00123     btnAdd->setText( tr2i18n( "&Add" ) );
00124     btnCancel->setText( tr2i18n( "&Cancel" ) );
00125     textLabel1->setText( tr2i18n( "&Name:" ) );
00126     textLabel2->setText( tr2i18n( "&Snippet:" ) );
00127     textLabelGroup->setText( tr2i18n( "Group:" ) );
00128 }
00129 
00130 #include "snippetdlgbase.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys