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