akregator/src

settings_browser.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './settings_browser.ui'
00005 **
00006 ** Created: Mon Mar 21 20:12:08 2011
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "settings_browser.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qbuttongroup.h>
00016 #include <qradiobutton.h>
00017 #include <qlineedit.h>
00018 #include <qcheckbox.h>
00019 #include <qcombobox.h>
00020 #include <qlabel.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 
00025 /*
00026  *  Constructs a Akregator::SettingsBrowser as a child of 'parent', with the
00027  *  name 'name' and widget flags set to 'f'.
00028  */
00029 Akregator::SettingsBrowser::SettingsBrowser( QWidget* parent, const char* name, WFlags fl )
00030     : QWidget( parent, name, fl )
00031 {
00032     if ( !name )
00033     setName( "SettingsBrowser" );
00034     SettingsBrowserLayout = new QGridLayout( this, 1, 1, 0, 6, "SettingsBrowserLayout"); 
00035 
00036     buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
00037     buttonGroup1->setExclusive( FALSE );
00038     buttonGroup1->setColumnLayout(0, Qt::Vertical );
00039     buttonGroup1->layout()->setSpacing( 6 );
00040     buttonGroup1->layout()->setMargin( 11 );
00041     buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00042     buttonGroup1Layout->setAlignment( Qt::AlignTop );
00043 
00044     kcfg_ExternalBrowserUseKdeDefault = new QRadioButton( buttonGroup1, "kcfg_ExternalBrowserUseKdeDefault" );
00045     kcfg_ExternalBrowserUseKdeDefault->setChecked( TRUE );
00046 
00047     buttonGroup1Layout->addMultiCellWidget( kcfg_ExternalBrowserUseKdeDefault, 0, 0, 0, 1 );
00048 
00049     kcfg_ExternalBrowserUseCustomCommand = new QRadioButton( buttonGroup1, "kcfg_ExternalBrowserUseCustomCommand" );
00050 
00051     buttonGroup1Layout->addWidget( kcfg_ExternalBrowserUseCustomCommand, 1, 0 );
00052 
00053     kcfg_ExternalBrowserCustomCommand = new QLineEdit( buttonGroup1, "kcfg_ExternalBrowserCustomCommand" );
00054     kcfg_ExternalBrowserCustomCommand->setEnabled( FALSE );
00055 
00056     buttonGroup1Layout->addWidget( kcfg_ExternalBrowserCustomCommand, 1, 1 );
00057 
00058     SettingsBrowserLayout->addWidget( buttonGroup1, 1, 0 );
00059 
00060     kcfg_CloseButtonOnTabs = new QCheckBox( this, "kcfg_CloseButtonOnTabs" );
00061 
00062     SettingsBrowserLayout->addWidget( kcfg_CloseButtonOnTabs, 2, 0 );
00063     spacer1 = new QSpacerItem( 31, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00064     SettingsBrowserLayout->addItem( spacer1, 3, 0 );
00065 
00066     layout2 = new QGridLayout( 0, 1, 1, 0, 6, "layout2"); 
00067 
00068     kcfg_LMBBehaviour = new QComboBox( FALSE, this, "kcfg_LMBBehaviour" );
00069     kcfg_LMBBehaviour->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kcfg_LMBBehaviour->sizePolicy().hasHeightForWidth() ) );
00070 
00071     layout2->addWidget( kcfg_LMBBehaviour, 0, 1 );
00072 
00073     textLabel1 = new QLabel( this, "textLabel1" );
00074     textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
00075 
00076     layout2->addWidget( textLabel1, 1, 0 );
00077 
00078     textLabel1_3 = new QLabel( this, "textLabel1_3" );
00079     textLabel1_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, textLabel1_3->sizePolicy().hasHeightForWidth() ) );
00080 
00081     layout2->addWidget( textLabel1_3, 0, 0 );
00082 
00083     kcfg_MMBBehaviour = new QComboBox( FALSE, this, "kcfg_MMBBehaviour" );
00084     kcfg_MMBBehaviour->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kcfg_MMBBehaviour->sizePolicy().hasHeightForWidth() ) );
00085 
00086     layout2->addWidget( kcfg_MMBBehaviour, 1, 1 );
00087 
00088     SettingsBrowserLayout->addLayout( layout2, 0, 0 );
00089     languageChange();
00090     resize( QSize(340, 299).expandedTo(minimumSizeHint()) );
00091     clearWState( WState_Polished );
00092 
00093     // signals and slots connections
00094     connect( kcfg_ExternalBrowserUseCustomCommand, SIGNAL( toggled(bool) ), kcfg_ExternalBrowserCustomCommand, SLOT( setEnabled(bool) ) );
00095 }
00096 
00097 /*
00098  *  Destroys the object and frees any allocated resources
00099  */
00100 Akregator::SettingsBrowser::~SettingsBrowser()
00101 {
00102     // no need to delete child widgets, Qt does it all for us
00103 }
00104 
00105 /*
00106  *  Sets the strings of the subwidgets using the current
00107  *  language.
00108  */
00109 void Akregator::SettingsBrowser::languageChange()
00110 {
00111     setCaption( tr2i18n( "ExternalBrowser" ) );
00112     buttonGroup1->setTitle( tr2i18n( "For External Browsing" ) );
00113     kcfg_ExternalBrowserUseKdeDefault->setText( tr2i18n( "Use default KDE web browser" ) );
00114     kcfg_ExternalBrowserUseCustomCommand->setText( tr2i18n( "Use this command:" ) );
00115     kcfg_ExternalBrowserCustomCommand->setText( tr2i18n( "firefox %u" ) );
00116     kcfg_CloseButtonOnTabs->setText( tr2i18n( "Show tab close button on hover" ) );
00117     kcfg_LMBBehaviour->clear();
00118     kcfg_LMBBehaviour->insertItem( tr2i18n( "Open in Tab" ) );
00119     kcfg_LMBBehaviour->insertItem( tr2i18n( "Open in Background Tab" ) );
00120     kcfg_LMBBehaviour->insertItem( tr2i18n( "Open in External Browser" ) );
00121     textLabel1->setText( tr2i18n( "Middle mouse click:" ) );
00122     textLabel1_3->setText( tr2i18n( "Left mouse click:" ) );
00123     kcfg_MMBBehaviour->clear();
00124     kcfg_MMBBehaviour->insertItem( tr2i18n( "Open in Tab" ) );
00125     kcfg_MMBBehaviour->insertItem( tr2i18n( "Open in Background Tab" ) );
00126     kcfg_MMBBehaviour->insertItem( tr2i18n( "Open in External Browser" ) );
00127 }
00128 
00129 #include "settings_browser.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys