akregator/src

settings_appearance.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './settings_appearance.ui'
00005 **
00006 ** Created: Tue Oct 6 13:01:05 2009
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "settings_appearance.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qgroupbox.h>
00016 #include <qlabel.h>
00017 #include <qslider.h>
00018 #include <knuminput.h>
00019 #include <kfontcombo.h>
00020 #include <qcheckbox.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 
00025 /*
00026  *  Constructs a Akregator::SettingsAppearance as a child of 'parent', with the
00027  *  name 'name' and widget flags set to 'f'.
00028  */
00029 Akregator::SettingsAppearance::SettingsAppearance( QWidget* parent, const char* name, WFlags fl )
00030     : QWidget( parent, name, fl )
00031 {
00032     if ( !name )
00033     setName( "SettingsAppearance" );
00034     SettingsAppearanceLayout = new QVBoxLayout( this, 0, 6, "SettingsAppearanceLayout"); 
00035 
00036     groupBox3 = new QGroupBox( this, "groupBox3" );
00037     groupBox3->setColumnLayout(0, Qt::Vertical );
00038     groupBox3->layout()->setSpacing( 6 );
00039     groupBox3->layout()->setMargin( 11 );
00040     groupBox3Layout = new QGridLayout( groupBox3->layout() );
00041     groupBox3Layout->setAlignment( Qt::AlignTop );
00042 
00043     lbl_MinimumFontSize = new QLabel( groupBox3, "lbl_MinimumFontSize" );
00044 
00045     groupBox3Layout->addMultiCellWidget( lbl_MinimumFontSize, 0, 0, 0, 1 );
00046 
00047     slider_minimumFontSize = new QSlider( groupBox3, "slider_minimumFontSize" );
00048     slider_minimumFontSize->setMinValue( 2 );
00049     slider_minimumFontSize->setMaxValue( 30 );
00050     slider_minimumFontSize->setValue( 8 );
00051     slider_minimumFontSize->setOrientation( QSlider::Horizontal );
00052     slider_minimumFontSize->setTickmarks( QSlider::Below );
00053     slider_minimumFontSize->setTickInterval( 3 );
00054 
00055     groupBox3Layout->addWidget( slider_minimumFontSize, 1, 0 );
00056 
00057     kcfg_MinimumFontSize = new KIntSpinBox( groupBox3, "kcfg_MinimumFontSize" );
00058     kcfg_MinimumFontSize->setValue( 8 );
00059 
00060     groupBox3Layout->addWidget( kcfg_MinimumFontSize, 1, 1 );
00061 
00062     lbl_MediumFontSize = new QLabel( groupBox3, "lbl_MediumFontSize" );
00063 
00064     groupBox3Layout->addMultiCellWidget( lbl_MediumFontSize, 2, 2, 0, 1 );
00065 
00066     slider_mediumFontSize = new QSlider( groupBox3, "slider_mediumFontSize" );
00067     slider_mediumFontSize->setMinValue( 2 );
00068     slider_mediumFontSize->setMaxValue( 30 );
00069     slider_mediumFontSize->setValue( 12 );
00070     slider_mediumFontSize->setOrientation( QSlider::Horizontal );
00071     slider_mediumFontSize->setTickmarks( QSlider::Below );
00072     slider_mediumFontSize->setTickInterval( 3 );
00073 
00074     groupBox3Layout->addWidget( slider_mediumFontSize, 3, 0 );
00075 
00076     kcfg_MediumFontSize = new KIntSpinBox( groupBox3, "kcfg_MediumFontSize" );
00077     kcfg_MediumFontSize->setValue( 12 );
00078 
00079     groupBox3Layout->addWidget( kcfg_MediumFontSize, 3, 1 );
00080     SettingsAppearanceLayout->addWidget( groupBox3 );
00081 
00082     FontsGroupBox = new QGroupBox( this, "FontsGroupBox" );
00083     FontsGroupBox->setColumnLayout(0, Qt::Vertical );
00084     FontsGroupBox->layout()->setSpacing( 6 );
00085     FontsGroupBox->layout()->setMargin( 11 );
00086     FontsGroupBoxLayout = new QGridLayout( FontsGroupBox->layout() );
00087     FontsGroupBoxLayout->setAlignment( Qt::AlignTop );
00088 
00089     textLabel1 = new QLabel( FontsGroupBox, "textLabel1" );
00090 
00091     FontsGroupBoxLayout->addWidget( textLabel1, 0, 0 );
00092 
00093     kcfg_StandardFont = new KFontCombo( FontsGroupBox, "kcfg_StandardFont" );
00094 
00095     FontsGroupBoxLayout->addWidget( kcfg_StandardFont, 0, 1 );
00096 
00097     textLabel2_2 = new QLabel( FontsGroupBox, "textLabel2_2" );
00098 
00099     FontsGroupBoxLayout->addWidget( textLabel2_2, 1, 0 );
00100 
00101     kcfg_FixedFont = new KFontCombo( FontsGroupBox, "kcfg_FixedFont" );
00102 
00103     FontsGroupBoxLayout->addWidget( kcfg_FixedFont, 1, 1 );
00104 
00105     textLabel3 = new QLabel( FontsGroupBox, "textLabel3" );
00106 
00107     FontsGroupBoxLayout->addWidget( textLabel3, 2, 0 );
00108 
00109     kcfg_SerifFont = new KFontCombo( FontsGroupBox, "kcfg_SerifFont" );
00110 
00111     FontsGroupBoxLayout->addWidget( kcfg_SerifFont, 2, 1 );
00112 
00113     textLabel4 = new QLabel( FontsGroupBox, "textLabel4" );
00114 
00115     FontsGroupBoxLayout->addWidget( textLabel4, 3, 0 );
00116 
00117     kcfg_SansSerifFont = new KFontCombo( FontsGroupBox, "kcfg_SansSerifFont" );
00118 
00119     FontsGroupBoxLayout->addWidget( kcfg_SansSerifFont, 3, 1 );
00120     SettingsAppearanceLayout->addWidget( FontsGroupBox );
00121 
00122     kcfg_UnderlineLinks = new QCheckBox( this, "kcfg_UnderlineLinks" );
00123     SettingsAppearanceLayout->addWidget( kcfg_UnderlineLinks );
00124     spacer1 = new QSpacerItem( 20, 41, QSizePolicy::Minimum, QSizePolicy::Expanding );
00125     SettingsAppearanceLayout->addItem( spacer1 );
00126     languageChange();
00127     resize( QSize(418, 377).expandedTo(minimumSizeHint()) );
00128     clearWState( WState_Polished );
00129 
00130     // signals and slots connections
00131     connect( kcfg_MediumFontSize, SIGNAL( valueChanged(int) ), slider_mediumFontSize, SLOT( setValue(int) ) );
00132     connect( slider_mediumFontSize, SIGNAL( valueChanged(int) ), kcfg_MediumFontSize, SLOT( setValue(int) ) );
00133     connect( kcfg_MinimumFontSize, SIGNAL( valueChanged(int) ), slider_minimumFontSize, SLOT( setValue(int) ) );
00134     connect( slider_minimumFontSize, SIGNAL( valueChanged(int) ), kcfg_MinimumFontSize, SLOT( setValue(int) ) );
00135 }
00136 
00137 /*
00138  *  Destroys the object and frees any allocated resources
00139  */
00140 Akregator::SettingsAppearance::~SettingsAppearance()
00141 {
00142     // no need to delete child widgets, Qt does it all for us
00143 }
00144 
00145 /*
00146  *  Sets the strings of the subwidgets using the current
00147  *  language.
00148  */
00149 void Akregator::SettingsAppearance::languageChange()
00150 {
00151     setCaption( tr2i18n( "General" ) );
00152     groupBox3->setTitle( tr2i18n( "Font Size" ) );
00153     lbl_MinimumFontSize->setText( tr2i18n( "Minimum font size:" ) );
00154     lbl_MediumFontSize->setText( tr2i18n( "Medium font size:" ) );
00155     FontsGroupBox->setTitle( tr2i18n( "Fonts" ) );
00156     textLabel1->setText( tr2i18n( "Standard font:" ) );
00157     textLabel2_2->setText( tr2i18n( "Fixed font:" ) );
00158     textLabel3->setText( tr2i18n( "Serif font:" ) );
00159     textLabel4->setText( tr2i18n( "Sans serif font:" ) );
00160     kcfg_UnderlineLinks->setText( tr2i18n( "&Underline links" ) );
00161 }
00162 
00163 #include "settings_appearance.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys