~ubuntu-branches/ubuntu/maverick/kdebase/maverick-updates

« back to all changes in this revision

Viewing changes to apps/kfind/kftabdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers, Martin Alfke, Modestas Vainius
  • Date: 2010-05-01 23:37:50 UTC
  • mfrom: (0.7.4 upstream) (0.4.4 experimental)
  • mto: This revision was merged to the branch mainline in revision 285.
  • Revision ID: james.westby@ubuntu.com-20100501233750-maq4i4sh8ymjbneb
Tags: 4:4.4.3-1
* New upstream release:
  - Konsole does not crash when closing a broken restored session.
    (Closes: #555831)
  - Konqueror does not crash when closing fast a tab. (Closes: #441298)

[Martin Alfke]
* Update of debian/copyright for kde 4.4

[ Modestas Vainius ]
* Bump kde-sc-dev-latest build dependency to 4.4.3.
* Confirm symbol files for 4.4.2 on hurd-i386 i386 ia64 kfreebsd-amd64
  kfreebsd-i386 mips powerpc s390 sparc.
* Release KDE SC 4.4.3 to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <QtGui/QCheckBox>
26
26
#include <QtGui/QWhatsThis>
27
27
 
28
 
#include <QtGui/QSpinBox>
29
28
#include <QtGui/QPushButton>
30
29
#include <QtGui/QApplication>
31
30
#include <QtGui/QDesktopWidget>
36
35
#include <klineedit.h>
37
36
#include <klocale.h>
38
37
#include <kmessagebox.h>
 
38
#include <KNumInput>
39
39
#include <kfiledialog.h>
40
40
#include <kregexpeditorinterface.h>
41
41
#include <kservicetypetrader.h>
172
172
    findCreated =  new QCheckBox(i18n("Find all files created or &modified:"), pages[1]);
173
173
    bg  = new QButtonGroup();
174
174
    rb[0] = new QRadioButton(i18n("&between"), pages[1] );
175
 
    rb[1] = new QRadioButton(i18n("&during the previous"), pages[1] );
 
175
    rb[1] = new QRadioButton(pages[1]); // text set in updateDateLabels
176
176
    andL = new QLabel(i18n("and"), pages[1]);
177
177
    andL->setObjectName( "and" );
178
178
    betweenType = new KComboBox( pages[1] );
179
 
    betweenType->setEditable( false );
180
179
    betweenType->setObjectName( "comboBetweenType" );
181
 
    betweenType->addItem(i18n("minute(s)"));
182
 
    betweenType->addItem(i18n("hour(s)"));
183
 
    betweenType->addItem(i18nc("use date ranges to search files by modified time","day(s)"));
184
 
    betweenType->addItem(i18n("month(s)"));
185
 
    betweenType->addItem(i18n("year(s)"));
 
180
    betweenType->addItems(QVector<QString>(5).toList()); // texts set in updateDateLabels
186
181
    betweenType->setCurrentIndex(1);
187
 
 
 
182
    updateDateLabels(1, 1);
188
183
 
189
184
    QDate dt = KGlobal::locale()->calendar()->addYears(QDate::currentDate(), -1);
190
185
 
192
187
    fromDate->setObjectName( "fromDate" );
193
188
    toDate = new KDateCombo(pages[1] );
194
189
    toDate->setObjectName( "toDate" );
195
 
    timeBox = new QSpinBox( pages[1] );
 
190
    timeBox = new KIntSpinBox( pages[1] );
196
191
    timeBox->setRange( 1, 60 );
197
192
    timeBox->setSingleStep( 1 );
198
193
    timeBox->setObjectName( "timeBox" );
199
194
 
200
195
    sizeBox =new KComboBox( pages[1] );
201
 
    sizeBox->setEditable( false );
202
196
    sizeBox->setObjectName( "sizeBox" );
203
197
    QLabel * sizeL   =new QLabel(i18n("File &size is:"), pages[1]);
204
198
    sizeL->setBuddy( sizeBox );
205
 
    sizeEdit=new QSpinBox(pages[1] );
 
199
    sizeEdit=new KIntSpinBox(pages[1] );
206
200
    sizeEdit->setRange( 0, INT_MAX );
207
201
    sizeEdit->setSingleStep( 1 );
208
202
    sizeEdit->setObjectName( "sizeEdit" );
209
203
    sizeEdit->setValue(1);
210
204
    sizeUnitBox =new KComboBox( pages[1] );
211
 
    sizeUnitBox->setEditable( false );
212
205
    sizeUnitBox->setObjectName( "sizeUnitBox" );
213
206
 
214
207
    m_usernameBox = new KComboBox( pages[1] );
227
220
    sizeBox ->addItem( i18n("At Most") );
228
221
    sizeBox ->addItem( i18n("Equal To") );
229
222
 
230
 
    sizeUnitBox ->addItem( i18n("Bytes") );
 
223
    sizeUnitBox ->addItem( i18np("Byte", "Bytes", 1) );
231
224
    sizeUnitBox ->addItem( i18n("KiB") );
232
225
    sizeUnitBox ->addItem( i18n("MiB") );
233
226
    sizeUnitBox ->addItem( i18n("GiB") );
284
277
    connect( findCreated, SIGNAL(toggled(bool)),  SLOT(fixLayout()) );
285
278
    connect( bg, SIGNAL(buttonClicked(QAbstractButton*)), this,  SLOT(fixLayout()) );
286
279
    connect( sizeBox, SIGNAL(activated(int)), this, SLOT(slotSizeBoxChanged(int)));
 
280
    connect( timeBox, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateDateLabelsForNumber(int)));
 
281
    connect( betweenType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDateLabelsForType(int)));
 
282
    connect( sizeEdit, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateByteComboBox(int)));
287
283
 
288
284
 
289
285
    // ************ Page Three
292
288
    pages[2]->setObjectName( "page3" );
293
289
 
294
290
    typeBox =new KComboBox( pages[2] );
295
 
    typeBox->setEditable( false );
296
291
    typeBox->setObjectName( "typeBox" );
297
292
    typeBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);  // allow smaller than widest entry
298
293
    QLabel * typeL   =new QLabel( i18nc("label for the file type combobox","File &type:"), pages[2] );
624
619
  else if ( QDate::currentDate() < hi1 )
625
620
    str = i18n("Unable to search dates in the future.");
626
621
 
627
 
  if (!str.isNull()) {
 
622
  if (!str.isEmpty()) {
628
623
    KMessageBox::sorry(0, str);
629
624
    return false;
630
625
  }
866
861
  return subdirsCb->isChecked();
867
862
}
868
863
 
 
864
void KfindTabWidget::slotUpdateDateLabelsForNumber(int value)
 
865
{
 
866
  updateDateLabels(betweenType->currentIndex(), value);
 
867
}
 
868
 
 
869
void KfindTabWidget::slotUpdateDateLabelsForType(int index)
 
870
{
 
871
  updateDateLabels(index, timeBox->value());
 
872
}
 
873
 
 
874
void KfindTabWidget::updateDateLabels(int type, int value)
 
875
{
 
876
  QString typeKey(type == 0 ? 'i' : type == 1 ? 'h' : type == 2 ? 'd' : type == 3 ? 'm' : 'y');
 
877
  rb[1]->setText(ki18ncp("during the previous minute(s)/hour(s)/...; "
 
878
                         "dynamic context 'type': 'i' minutes, 'h' hours, 'd' days, 'm' months, 'y' years",
 
879
                         "&during the previous", "&during the previous").subs(value).inContext("type", typeKey).toString());
 
880
  betweenType->setItemText(0, i18ncp("use date ranges to search files by modified time", "minute", "minutes", value));
 
881
  betweenType->setItemText(1, i18ncp("use date ranges to search files by modified time", "hour", "hours", value));
 
882
  betweenType->setItemText(2, i18ncp("use date ranges to search files by modified time", "day", "days", value));
 
883
  betweenType->setItemText(3, i18ncp("use date ranges to search files by modified time", "month", "months", value));
 
884
  betweenType->setItemText(4, i18ncp("use date ranges to search files by modified time", "year", "years", value));
 
885
}
 
886
 
 
887
void KfindTabWidget::slotUpdateByteComboBox(int value)
 
888
{
 
889
  sizeUnitBox->setItemText(0, i18np("Byte", "Bytes", value) );
 
890
}
 
891
 
869
892
 
870
893
/**
871
894
   Digit validator. Allows only digits to be typed.