akregator/src

propertieswidgetbase.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './propertieswidgetbase.ui'
00005 **
00006 ** Created: Tue Jan 19 17:34:34 2010
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "propertieswidgetbase.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qtabwidget.h>
00016 #include <qlabel.h>
00017 #include <klineedit.h>
00018 #include <qcheckbox.h>
00019 #include <knuminput.h>
00020 #include <qcombobox.h>
00021 #include <qbuttongroup.h>
00022 #include <qradiobutton.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026 #include "klineedit.h"
00027 #include "knuminput.h"
00028 
00029 /*
00030  *  Constructs a Akregator::FeedPropertiesWidgetBase as a child of 'parent', with the
00031  *  name 'name' and widget flags set to 'f'.
00032  */
00033 Akregator::FeedPropertiesWidgetBase::FeedPropertiesWidgetBase( QWidget* parent, const char* name, WFlags fl )
00034     : QWidget( parent, name, fl )
00035 {
00036     if ( !name )
00037     setName( "FeedPropertiesWidget" );
00038     FeedPropertiesWidgetLayout = new QVBoxLayout( this, 0, 6, "FeedPropertiesWidgetLayout"); 
00039 
00040     tabWidget2 = new QTabWidget( this, "tabWidget2" );
00041 
00042     tab = new QWidget( tabWidget2, "tab" );
00043     tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 
00044 
00045     layout8 = new QGridLayout( 0, 1, 1, 0, 6, "layout8"); 
00046 
00047     textLabel3 = new QLabel( tab, "textLabel3" );
00048 
00049     layout8->addWidget( textLabel3, 1, 0 );
00050 
00051     textLabel2 = new QLabel( tab, "textLabel2" );
00052 
00053     layout8->addWidget( textLabel2, 0, 0 );
00054 
00055     feedNameEdit = new KLineEdit( tab, "feedNameEdit" );
00056     feedNameEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, feedNameEdit->sizePolicy().hasHeightForWidth() ) );
00057 
00058     layout8->addWidget( feedNameEdit, 0, 1 );
00059 
00060     urlEdit = new KLineEdit( tab, "urlEdit" );
00061 
00062     layout8->addWidget( urlEdit, 1, 1 );
00063 
00064     tabLayout->addLayout( layout8, 0, 0 );
00065 
00066     upChkbox = new QCheckBox( tab, "upChkbox" );
00067 
00068     tabLayout->addWidget( upChkbox, 1, 0 );
00069 
00070     layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 
00071     spacer8 = new QSpacerItem( 31, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00072     layout9->addItem( spacer8 );
00073 
00074     textLabel1 = new QLabel( tab, "textLabel1" );
00075     textLabel1->setEnabled( FALSE );
00076     layout9->addWidget( textLabel1 );
00077 
00078     updateSpinBox = new KIntSpinBox( tab, "updateSpinBox" );
00079     updateSpinBox->setEnabled( FALSE );
00080     updateSpinBox->setMaxValue( 100000000 );
00081     updateSpinBox->setMinValue( 1 );
00082     layout9->addWidget( updateSpinBox );
00083 
00084     updateComboBox = new QComboBox( FALSE, tab, "updateComboBox" );
00085     updateComboBox->setEnabled( FALSE );
00086     layout9->addWidget( updateComboBox );
00087 
00088     tabLayout->addLayout( layout9, 2, 0 );
00089 
00090     checkBox_useNotification = new QCheckBox( tab, "checkBox_useNotification" );
00091 
00092     tabLayout->addWidget( checkBox_useNotification, 3, 0 );
00093     tabWidget2->insertTab( tab, QString::fromLatin1("") );
00094 
00095     tab_2 = new QWidget( tabWidget2, "tab_2" );
00096     tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 
00097 
00098     bg_feedArchive = new QButtonGroup( tab_2, "bg_feedArchive" );
00099     bg_feedArchive->setFrameShape( QButtonGroup::NoFrame );
00100     bg_feedArchive->setExclusive( FALSE );
00101     bg_feedArchive->setColumnLayout(0, Qt::Vertical );
00102     bg_feedArchive->layout()->setSpacing( 6 );
00103     bg_feedArchive->layout()->setMargin( 0 );
00104     bg_feedArchiveLayout = new QGridLayout( bg_feedArchive->layout() );
00105     bg_feedArchiveLayout->setAlignment( Qt::AlignTop );
00106 
00107     rb_keepAllArticles = new QRadioButton( bg_feedArchive, "rb_keepAllArticles" );
00108 
00109     bg_feedArchiveLayout->addMultiCellWidget( rb_keepAllArticles, 1, 1, 0, 3 );
00110 
00111     rb_limitArticleNumber = new QRadioButton( bg_feedArchive, "rb_limitArticleNumber" );
00112 
00113     bg_feedArchiveLayout->addWidget( rb_limitArticleNumber, 2, 0 );
00114 
00115     rb_limitArticleAge = new QRadioButton( bg_feedArchive, "rb_limitArticleAge" );
00116 
00117     bg_feedArchiveLayout->addMultiCellWidget( rb_limitArticleAge, 3, 3, 0, 1 );
00118 
00119     sb_maxArticleAge = new KIntSpinBox( bg_feedArchive, "sb_maxArticleAge" );
00120     sb_maxArticleAge->setEnabled( FALSE );
00121     sb_maxArticleAge->setMaxValue( 1000000 );
00122     sb_maxArticleAge->setMinValue( 1 );
00123     sb_maxArticleAge->setValue( 1 );
00124 
00125     bg_feedArchiveLayout->addWidget( sb_maxArticleAge, 3, 2 );
00126     spacer5_2 = new QSpacerItem( 99, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00127     bg_feedArchiveLayout->addItem( spacer5_2, 3, 3 );
00128     spacer7 = new QSpacerItem( 100, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00129     bg_feedArchiveLayout->addItem( spacer7, 2, 3 );
00130 
00131     sb_maxArticleNumber = new KIntSpinBox( bg_feedArchive, "sb_maxArticleNumber" );
00132     sb_maxArticleNumber->setEnabled( FALSE );
00133     sb_maxArticleNumber->setMaxValue( 1000000 );
00134     sb_maxArticleNumber->setMinValue( 1 );
00135 
00136     bg_feedArchiveLayout->addMultiCellWidget( sb_maxArticleNumber, 2, 2, 1, 2 );
00137 
00138     rb_disableArchiving = new QRadioButton( bg_feedArchive, "rb_disableArchiving" );
00139 
00140     bg_feedArchiveLayout->addMultiCellWidget( rb_disableArchiving, 4, 4, 0, 3 );
00141 
00142     rb_globalDefault = new QRadioButton( bg_feedArchive, "rb_globalDefault" );
00143     rb_globalDefault->setChecked( TRUE );
00144 
00145     bg_feedArchiveLayout->addMultiCellWidget( rb_globalDefault, 0, 0, 0, 3 );
00146 
00147     tabLayout_2->addWidget( bg_feedArchive, 0, 0 );
00148     tabWidget2->insertTab( tab_2, QString::fromLatin1("") );
00149 
00150     TabPage = new QWidget( tabWidget2, "TabPage" );
00151     TabPageLayout = new QGridLayout( TabPage, 1, 1, 11, 6, "TabPageLayout"); 
00152 
00153     layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 
00154 
00155     checkBox_loadWebsite = new QCheckBox( TabPage, "checkBox_loadWebsite" );
00156     layout4->addWidget( checkBox_loadWebsite );
00157 
00158     checkBox_markRead = new QCheckBox( TabPage, "checkBox_markRead" );
00159     layout4->addWidget( checkBox_markRead );
00160 
00161     TabPageLayout->addLayout( layout4, 0, 0 );
00162     spacer6 = new QSpacerItem( 20, 71, QSizePolicy::Minimum, QSizePolicy::Expanding );
00163     TabPageLayout->addItem( spacer6, 1, 0 );
00164     tabWidget2->insertTab( TabPage, QString::fromLatin1("") );
00165     FeedPropertiesWidgetLayout->addWidget( tabWidget2 );
00166     languageChange();
00167     resize( QSize(355, 189).expandedTo(minimumSizeHint()) );
00168     clearWState( WState_Polished );
00169 
00170     // signals and slots connections
00171     connect( upChkbox, SIGNAL( toggled(bool) ), updateSpinBox, SLOT( setEnabled(bool) ) );
00172     connect( rb_limitArticleNumber, SIGNAL( toggled(bool) ), sb_maxArticleNumber, SLOT( setEnabled(bool) ) );
00173     connect( rb_limitArticleAge, SIGNAL( toggled(bool) ), sb_maxArticleAge, SLOT( setEnabled(bool) ) );
00174     connect( upChkbox, SIGNAL( toggled(bool) ), updateComboBox, SLOT( setEnabled(bool) ) );
00175     connect( updateComboBox, SIGNAL( activated(int) ), this, SLOT( slotUpdateComboBoxActivated(int) ) );
00176     connect( upChkbox, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateCheckBoxToggled(bool) ) );
00177     connect( upChkbox, SIGNAL( toggled(bool) ), textLabel1, SLOT( setEnabled(bool) ) );
00178 
00179     // buddies
00180     textLabel3->setBuddy( urlEdit );
00181     textLabel2->setBuddy( feedNameEdit );
00182     textLabel1->setBuddy( updateSpinBox );
00183 }
00184 
00185 /*
00186  *  Destroys the object and frees any allocated resources
00187  */
00188 Akregator::FeedPropertiesWidgetBase::~FeedPropertiesWidgetBase()
00189 {
00190     // no need to delete child widgets, Qt does it all for us
00191 }
00192 
00193 /*
00194  *  Sets the strings of the subwidgets using the current
00195  *  language.
00196  */
00197 void Akregator::FeedPropertiesWidgetBase::languageChange()
00198 {
00199     setCaption( tr2i18n( "Feed Properties" ) );
00200     textLabel3->setText( tr2i18n( "&URL:" ) );
00201     textLabel2->setText( tr2i18n( "&Name:" ) );
00202     QToolTip::add( feedNameEdit, tr2i18n( "Display name of RSS column" ) );
00203     upChkbox->setText( tr2i18n( "U&se a custom update interval" ) );
00204     textLabel1->setText( tr2i18n( "Update &every:" ) );
00205     updateSpinBox->setSuffix( QString::null );
00206     updateComboBox->clear();
00207     updateComboBox->insertItem( tr2i18n( "Minutes" ) );
00208     updateComboBox->insertItem( tr2i18n( "Hours" ) );
00209     updateComboBox->insertItem( tr2i18n( "Days" ) );
00210     updateComboBox->insertItem( tr2i18n( "Never" ) );
00211     checkBox_useNotification->setText( tr2i18n( "Notify when new articles arri&ve" ) );
00212     tabWidget2->changeTab( tab, tr2i18n( "&General" ) );
00213     bg_feedArchive->setTitle( QString::null );
00214     rb_keepAllArticles->setText( tr2i18n( "&Keep all articles" ) );
00215     rb_limitArticleNumber->setText( tr2i18n( "Limit archi&ve to:" ) );
00216     rb_limitArticleAge->setText( tr2i18n( "&Delete articles older than:" ) );
00217     sb_maxArticleAge->setSuffix( tr2i18n( " days" ) );
00218     sb_maxArticleAge->setSpecialValueText( tr2i18n( "1 day" ) );
00219     sb_maxArticleNumber->setSuffix( tr2i18n( " articles" ) );
00220     sb_maxArticleNumber->setSpecialValueText( tr2i18n( "1 article" ) );
00221     rb_disableArchiving->setText( tr2i18n( "Di&sable archiving" ) );
00222     rb_globalDefault->setText( tr2i18n( "&Use default settings" ) );
00223     tabWidget2->changeTab( tab_2, tr2i18n( "Ar&chive" ) );
00224     checkBox_loadWebsite->setText( tr2i18n( "Load the &full website when reading articles" ) );
00225     checkBox_markRead->setText( tr2i18n( "Mar&k articles as read when they arrive" ) );
00226     tabWidget2->changeTab( TabPage, tr2i18n( "Adva&nced" ) );
00227 }
00228 
00229 #include "propertieswidgetbase.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys