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