kmail

snippetsettingsbase.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './snippetsettingsbase.ui'
00005 **
00006 ** Created: Fri Jan 15 19:18:16 2010
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "snippetsettingsbase.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qgroupbox.h>
00016 #include <qcheckbox.h>
00017 #include <qbuttongroup.h>
00018 #include <qradiobutton.h>
00019 #include <qlabel.h>
00020 #include <klineedit.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 
00025 /*
00026  *  Constructs a SnippetSettingsBase as a child of 'parent', with the
00027  *  name 'name' and widget flags set to 'f'.
00028  */
00029 SnippetSettingsBase::SnippetSettingsBase( QWidget* parent, const char* name, WFlags fl )
00030     : QWidget( parent, name, fl )
00031 {
00032     if ( !name )
00033     setName( "SnippetSettingsBase" );
00034     SnippetSettingsBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "SnippetSettingsBaseLayout"); 
00035 
00036     groupBox1 = new QGroupBox( this, "groupBox1" );
00037     groupBox1->setColumnLayout(0, Qt::Vertical );
00038     groupBox1->layout()->setSpacing( 6 );
00039     groupBox1->layout()->setMargin( 11 );
00040     groupBox1Layout = new QGridLayout( groupBox1->layout() );
00041     groupBox1Layout->setAlignment( Qt::AlignTop );
00042 
00043     cbToolTip = new QCheckBox( groupBox1, "cbToolTip" );
00044     cbToolTip->setChecked( TRUE );
00045 
00046     groupBox1Layout->addWidget( cbToolTip, 0, 0 );
00047 
00048     SnippetSettingsBaseLayout->addWidget( groupBox1, 0, 0 );
00049     spacer2 = new QSpacerItem( 20, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
00050     SnippetSettingsBaseLayout->addItem( spacer2, 3, 0 );
00051 
00052     buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
00053     buttonGroup1->setColumnLayout(0, Qt::Vertical );
00054     buttonGroup1->layout()->setSpacing( 6 );
00055     buttonGroup1->layout()->setMargin( 11 );
00056     buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00057     buttonGroup1Layout->setAlignment( Qt::AlignTop );
00058 
00059     btnGroup = new QButtonGroup( buttonGroup1, "btnGroup" );
00060     btnGroup->setColumnLayout(0, Qt::Vertical );
00061     btnGroup->layout()->setSpacing( 6 );
00062     btnGroup->layout()->setMargin( 11 );
00063     btnGroupLayout = new QGridLayout( btnGroup->layout() );
00064     btnGroupLayout->setAlignment( Qt::AlignTop );
00065 
00066     rbSingle = new QRadioButton( btnGroup, "rbSingle" );
00067     rbSingle->setChecked( TRUE );
00068 
00069     btnGroupLayout->addWidget( rbSingle, 0, 0 );
00070 
00071     rbAll = new QRadioButton( btnGroup, "rbAll" );
00072     rbAll->setChecked( FALSE );
00073 
00074     btnGroupLayout->addWidget( rbAll, 1, 0 );
00075 
00076     buttonGroup1Layout->addWidget( btnGroup, 1, 0 );
00077 
00078     layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
00079 
00080     textLabel1 = new QLabel( buttonGroup1, "textLabel1" );
00081     layout1->addWidget( textLabel1 );
00082 
00083     leDelimiter = new KLineEdit( buttonGroup1, "leDelimiter" );
00084     leDelimiter->setMaximumSize( QSize( 40, 32767 ) );
00085     leDelimiter->setMaxLength( 1 );
00086     layout1->addWidget( leDelimiter );
00087     spacer3 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00088     layout1->addItem( spacer3 );
00089 
00090     buttonGroup1Layout->addLayout( layout1, 0, 0 );
00091 
00092     SnippetSettingsBaseLayout->addWidget( buttonGroup1, 1, 0 );
00093     languageChange();
00094     resize( QSize(574, 398).expandedTo(minimumSizeHint()) );
00095     clearWState( WState_Polished );
00096 }
00097 
00098 /*
00099  *  Destroys the object and frees any allocated resources
00100  */
00101 SnippetSettingsBase::~SnippetSettingsBase()
00102 {
00103     // no need to delete child widgets, Qt does it all for us
00104 }
00105 
00106 /*
00107  *  Sets the strings of the subwidgets using the current
00108  *  language.
00109  */
00110 void SnippetSettingsBase::languageChange()
00111 {
00112     setCaption( tr2i18n( "Snippet Settings" ) );
00113     groupBox1->setTitle( tr2i18n( "Tooltips" ) );
00114     cbToolTip->setText( tr2i18n( "Show snippet's text in &tooltip" ) );
00115     QToolTip::add( cbToolTip, tr2i18n( "Decides if a tooltip should be shown containing text from the bookmarked line" ) );
00116     buttonGroup1->setTitle( tr2i18n( "Variables" ) );
00117     btnGroup->setTitle( tr2i18n( "Input Method for Variables" ) );
00118     rbSingle->setText( tr2i18n( "Single dialog for each variable within a snippet" ) );
00119     rbSingle->setAccel( QKeySequence( QString::null ) );
00120     QToolTip::add( rbSingle, tr2i18n( "An input dialog will be displayed for every variable within a snippet" ) );
00121     rbAll->setText( tr2i18n( "One dialog for all variables within a snippet" ) );
00122     rbAll->setAccel( QKeySequence( QString::null ) );
00123     QToolTip::add( rbAll, tr2i18n( "A single dialog will be displayed where you can enter the values for all variables within a snippet" ) );
00124     textLabel1->setText( tr2i18n( "Delimiter:" ) );
00125 }
00126 
00127 #include "snippetsettingsbase.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys