• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • jobs
kwidgetjobtracker.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2000 Matej Koss <koss@miesto.sk>
3  Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
4  Copyright (C) 2007 Rafael Fernández López <ereslibre@kde.org>
5  Copyright (C) 2009 Shaun Reich <shaun.reich@kdemail.net>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21 */
22 
23 #include "kwidgetjobtracker.h"
24 #include "kwidgetjobtracker_p.h"
25 
26 #include <QProcess>
27 #include <QTimer>
28 #include <QLabel>
29 #include <QProgressBar>
30 #include <QVBoxLayout>
31 #include <QGridLayout>
32 #include <QMenu>
33 #include <QEvent>
34 
35 #include <kurl.h>
36 #include <kpushbutton.h>
37 #include <ksqueezedtextlabel.h>
38 #include <kguiitem.h>
39 #include <kiconloader.h>
40 #include <kdialog.h>
41 #include <kstandarddirs.h>
42 #include <kdebug.h>
43 #include <klocale.h>
44 #include <kwindowsystem.h>
45 #include <kseparator.h>
46 
47 void KWidgetJobTracker::Private::_k_showProgressWidget()
48 {
49  if (progressWidgetsToBeShown.isEmpty()) {
50  return;
51  }
52 
53  KJob *job = progressWidgetsToBeShown.dequeue();
54 
55  // If the job has been unregistered before reaching this point, widget will
56  // return 0.
57  QWidget *widget = q->widget(job);
58 
59  if (widget) {
60  widget->show();
61  }
62 }
63 
64 KWidgetJobTracker::KWidgetJobTracker(QWidget *parent)
65  : KAbstractWidgetJobTracker(parent), d(new Private(parent, this))
66 {
67 }
68 
69 KWidgetJobTracker::~KWidgetJobTracker()
70 {
71  delete d;
72 }
73 
74 QWidget *KWidgetJobTracker::widget(KJob *job)
75 {
76  return d->progressWidget.value(job, 0);
77 }
78 
79 void KWidgetJobTracker::registerJob(KJob *job)
80 {
81  Private::ProgressWidget *vi = new Private::ProgressWidget(job, this, d->parent);
82  vi->jobRegistered = true;
83  vi->setAttribute(Qt::WA_DeleteOnClose);
84  d->progressWidget.insert(job, vi);
85  d->progressWidgetsToBeShown.enqueue(job);
86 
87  KAbstractWidgetJobTracker::registerJob(job);
88 
89  QTimer::singleShot(500, this, SLOT(_k_showProgressWidget()));
90 }
91 
92 void KWidgetJobTracker::unregisterJob(KJob *job)
93 {
94  KAbstractWidgetJobTracker::unregisterJob(job);
95 
96  d->progressWidgetsToBeShown.removeAll(job);
97  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
98  if (!pWidget) {
99  return;
100  }
101 
102  pWidget->jobRegistered = false;
103  pWidget->deref();
104 }
105 
106 bool KWidgetJobTracker::keepOpen(KJob *job) const
107 {
108  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
109  if (!pWidget) {
110  return false;
111  }
112 
113  return pWidget->keepOpenCheck->isChecked();
114 }
115 
116 void KWidgetJobTracker::infoMessage(KJob *job, const QString &plain, const QString &rich)
117 {
118  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
119  if (!pWidget) {
120  return;
121  }
122 
123  pWidget->infoMessage(plain, rich);
124 }
125 
126 void KWidgetJobTracker::description(KJob *job, const QString &title,
127  const QPair<QString, QString> &field1,
128  const QPair<QString, QString> &field2)
129 {
130  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
131  if (!pWidget) {
132  return;
133  }
134 
135  pWidget->description(title, field1, field2);
136 }
137 
138 void KWidgetJobTracker::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
139 {
140  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
141  if (!pWidget) {
142  return;
143  }
144 
145  pWidget->totalAmount(unit, amount);
146 }
147 
148 void KWidgetJobTracker::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
149 {
150  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
151  if (!pWidget) {
152  return;
153  }
154 
155  pWidget->processedAmount(unit, amount);
156 }
157 
158 void KWidgetJobTracker::percent(KJob *job, unsigned long percent)
159 {
160  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
161  if (!pWidget) {
162  return;
163  }
164 
165  pWidget->percent(percent);
166 }
167 
168 void KWidgetJobTracker::speed(KJob *job, unsigned long value)
169 {
170  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
171  if (!pWidget) {
172  return;
173  }
174 
175  pWidget->speed(value);
176 }
177 
178 void KWidgetJobTracker::slotClean(KJob *job)
179 {
180  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
181  if (!pWidget) {
182  return;
183  }
184 
185  pWidget->slotClean();
186 }
187 
188 void KWidgetJobTracker::suspended(KJob *job)
189 {
190  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
191  if (!pWidget) {
192  return;
193  }
194 
195  pWidget->suspended();
196 }
197 
198 void KWidgetJobTracker::resumed(KJob *job)
199 {
200  KWidgetJobTracker::Private::ProgressWidget *pWidget = d->progressWidget.value(job, 0);
201  if (!pWidget) {
202  return;
203  }
204 
205  pWidget->resumed();
206 }
207 
208 void KWidgetJobTracker::Private::ProgressWidget::ref()
209 {
210  ++refCount;
211 }
212 
213 void KWidgetJobTracker::Private::ProgressWidget::deref()
214 {
215  if (refCount) {
216  --refCount;
217  }
218 
219  if (!refCount) {
220  if (!keepOpenCheck->isChecked()) {
221  closeNow();
222  } else {
223  slotClean();
224  }
225  }
226 }
227 
228 void KWidgetJobTracker::Private::ProgressWidget::closeNow()
229 {
230  close();
231 
232  // It might happen the next scenario:
233  // - Start a job which opens a progress widget. Keep it open. Address job is 0xdeadbeef
234  // - Start a new job, which is given address 0xdeadbeef. A new window is opened.
235  // This one will take much longer to complete. The key 0xdeadbeef on the widget map now
236  // stores the new widget address.
237  // - Close the first progress widget that was opened (and has already finished) while the
238  // last one is still running. We remove its reference on the map. Wrong.
239  // For that reason we have to check if the map stores the widget as the current one.
240  // ereslibre
241  if (tracker->d->progressWidget[job] == this) {
242  tracker->d->progressWidget.remove(job);
243  tracker->d->progressWidgetsToBeShown.removeAll(job);
244  }
245 }
246 
247 bool KWidgetJobTracker::Private::ProgressWidget::eventFilter(QObject *watched, QEvent *event)
248 {
249  // Handle context menu events for the source/dest labels here, so that we are ref()ed while the
250  // menu is exec()ed, to avoid a crash if the job finishes meanwhile. #159621.
251  if ((watched == sourceEdit || watched == destEdit) && event->type() == QEvent::ContextMenu) {
252  ref();
253  watched->event(event);
254  deref();
255  return true;
256  }
257 
258  return QWidget::eventFilter(watched, event);
259 }
260 
261 void KWidgetJobTracker::Private::ProgressWidget::infoMessage(const QString &plain, const QString &/*rich*/)
262 {
263  speedLabel->setText(plain);
264  speedLabel->setAlignment(speedLabel->alignment() & ~Qt::TextWordWrap);
265 }
266 
267 void KWidgetJobTracker::Private::ProgressWidget::description(const QString &title,
268  const QPair<QString, QString> &field1,
269  const QPair<QString, QString> &field2)
270 {
271  setWindowTitle(title);
272  caption = title;
273 
274  sourceInvite->setText(i18nc("%1 is the label, we add a ':' to it", "%1:", field1.first));
275  sourceEdit->setText(field1.second);
276 
277  if (field2.first.isEmpty()) {
278  setDestVisible(false);
279  } else {
280  setDestVisible(true);
281  checkDestination(KUrl(field2.second));
282  destInvite->setText(i18nc("%1 is the label, we add a ':' to it", "%1:", field2.first));
283  destEdit->setText(field2.second);
284  }
285 }
286 
287 void KWidgetJobTracker::Private::ProgressWidget::totalAmount(KJob::Unit unit, qulonglong amount)
288 {
289  switch(unit)
290  {
291  case KJob::Bytes:
292  totalSizeKnown = true;
293  // size is measured in bytes
294  if (totalSize == amount)
295  return;
296  totalSize = amount;
297  if (startTime.isNull())
298  startTime.start();
299  break;
300 
301  case KJob::Files:
302  if (totalFiles == amount)
303  return;
304  totalFiles = amount;
305  showTotals();
306  break;
307 
308  case KJob::Directories:
309  if (totalDirs == amount)
310  return;
311  totalDirs = amount;
312  showTotals();
313  break;
314  }
315 }
316 
317 void KWidgetJobTracker::Private::ProgressWidget::processedAmount(KJob::Unit unit, qulonglong amount)
318 {
319  QString tmp;
320 
321  switch(unit)
322  {
323  case KJob::Bytes:
324  if (processedSize == amount)
325  return;
326  processedSize = amount;
327 
328  if (totalSizeKnown) {
329  tmp = i18np( "%2 of %3 complete", "%2 of %3 complete",
330  amount,
331  KGlobal::locale()->formatByteSize(amount),
332  KGlobal::locale()->formatByteSize(totalSize));
333  } else {
334  tmp = KGlobal::locale()->formatByteSize(amount);
335  }
336  sizeLabel->setText(tmp);
337  if (!totalSizeKnown) // update jumping progressbar
338  progressBar->setValue(amount);
339  break;
340 
341  case KJob::Directories:
342  if (processedDirs == amount)
343  return;
344  processedDirs = amount;
345 
346  tmp = i18np("%2 / %1 folder", "%2 / %1 folders", totalDirs, processedDirs);
347  tmp += " ";
348  tmp += i18np("%2 / %1 file", "%2 / %1 files", totalFiles, processedFiles);
349  progressLabel->setText(tmp);
350  break;
351 
352  case KJob::Files:
353  if (processedFiles == amount)
354  return;
355  processedFiles = amount;
356 
357  if (totalDirs > 1) {
358  tmp = i18np("%2 / %1 folder", "%2 / %1 folders", totalDirs, processedDirs);
359  tmp += " ";
360  }
361  tmp += i18np("%2 / %1 file", "%2 / %1 files", totalFiles, processedFiles);
362  progressLabel->setText(tmp);
363  }
364 }
365 
366 void KWidgetJobTracker::Private::ProgressWidget::percent(unsigned long percent)
367 {
368  QString title = caption + " (";
369 
370  if (totalSizeKnown) {
371  title += i18n("%1% of %2", percent,
372  KGlobal::locale()->formatByteSize(totalSize));
373  } else if (totalFiles) {
374  title += i18np("%2% of 1 file", "%2% of %1 files", totalFiles, percent);
375  } else {
376  title += i18n("%1%", percent);
377  }
378 
379  title += ')';
380 
381  progressBar->setMaximum(100);
382  progressBar->setValue(percent);
383  setWindowTitle(title);
384 }
385 
386 void KWidgetJobTracker::Private::ProgressWidget::speed(unsigned long value)
387 {
388  if (value == 0) {
389  speedLabel->setText(i18n("Stalled"));
390  } else {
391  const QString speedStr = KGlobal::locale()->formatByteSize(value);
392  if (totalSizeKnown) {
393  const int remaining = 1000*(totalSize - processedSize)/value;
394  speedLabel->setText(i18np("%2/s (%3 remaining)", "%2/s (%3 remaining)", remaining, speedStr,
395  KGlobal::locale()->prettyFormatDuration(remaining)));
396  } else { // total size is not known (#24228)
397  speedLabel->setText(i18nc("speed in bytes per second", "%1/s", speedStr));
398  }
399  }
400 }
401 
402 void KWidgetJobTracker::Private::ProgressWidget::slotClean()
403 {
404  percent(100);
405  cancelClose->setGuiItem(KStandardGuiItem::close());
406  openFile->setEnabled(true);
407  if (!totalSizeKnown || totalSize < processedSize)
408  totalSize = processedSize;
409  processedAmount(KJob::Bytes, totalSize);
410  keepOpenCheck->setEnabled(false);
411  pauseButton->setEnabled(false);
412  if (!startTime.isNull()) {
413  int s = startTime.elapsed();
414  if (!s)
415  s = 1;
416  speedLabel->setText(i18n("%1/s (done)",
417  KGlobal::locale()->formatByteSize(1000 * totalSize / s)));
418  }
419 }
420 
421 void KWidgetJobTracker::Private::ProgressWidget::suspended()
422 {
423  pauseButton->setText(i18n("&Resume"));
424  suspendedProperty = true;
425 }
426 
427 void KWidgetJobTracker::Private::ProgressWidget::resumed()
428 {
429  pauseButton->setText(i18n("&Pause"));
430  suspendedProperty = false;
431 }
432 
433 void KWidgetJobTracker::Private::ProgressWidget::closeEvent(QCloseEvent *event)
434 {
435  if (jobRegistered && tracker->stopOnClose(job)) {
436  tracker->slotStop(job);
437  }
438 
439  QWidget::closeEvent(event);
440 }
441 
442 void KWidgetJobTracker::Private::ProgressWidget::init()
443 {
444  // Set a useful icon for this window!
445  KWindowSystem::setIcons( winId(),
446  KIconLoader::global()->loadIcon( "document-save", KIconLoader::NoGroup, 32 ),
447  KIconLoader::global()->loadIcon( "document-save", KIconLoader::NoGroup, 16 ) );
448 
449  QVBoxLayout *topLayout = new QVBoxLayout(this);
450 
451  QGridLayout *grid = new QGridLayout();
452  topLayout->addLayout(grid);
453  grid->addItem(new QSpacerItem(KDialog::spacingHint(),0),0,1);
454  // filenames or action name
455  sourceInvite = new QLabel(i18nc("The source url of a job", "Source:"), this);
456  grid->addWidget(sourceInvite, 0, 0);
457 
458  sourceEdit = new KSqueezedTextLabel(this);
459  sourceEdit->setTextInteractionFlags(Qt::TextSelectableByMouse);
460  sourceEdit->installEventFilter(this);
461  grid->addWidget(sourceEdit, 0, 2);
462 
463  destInvite = new QLabel(i18nc("The destination url of a job", "Destination:"), this);
464  grid->addWidget(destInvite, 1, 0);
465 
466  destEdit = new KSqueezedTextLabel(this);
467  destEdit->setTextInteractionFlags(Qt::TextSelectableByMouse);
468  destEdit->installEventFilter(this);
469  grid->addWidget(destEdit, 1, 2);
470 
471  QHBoxLayout *progressHBox = new QHBoxLayout();
472  topLayout->addLayout(progressHBox);
473 
474  progressBar = new QProgressBar(this);
475  progressBar->setMaximum(0); // want a jumping progress bar if percent is not emitted
476  progressHBox->addWidget(progressBar);
477 
478  suspendedProperty = false;
479 
480  // processed info
481  QHBoxLayout *hBox = new QHBoxLayout();
482  topLayout->addLayout(hBox);
483 
484  arrowButton = new KPushButton(this);
485  arrowButton->setMaximumSize(QSize(32,25));
486  arrowButton->setIcon(KIcon("arrow-down"));
487  arrowButton->setToolTip(i18n("Click this to expand the dialog, to show details"));
488  arrowState = Qt::DownArrow;
489  connect(arrowButton, SIGNAL(clicked()), this, SLOT(_k_arrowToggled()));
490  hBox->addWidget(arrowButton);
491  hBox->addStretch(1);
492 
493  KSeparator *separator1 = new KSeparator(Qt::Horizontal, this);
494  topLayout->addWidget(separator1);
495 
496  sizeLabel = new QLabel(this);
497  hBox->addWidget(sizeLabel, 0, Qt::AlignLeft);
498 
499  resumeLabel = new QLabel(this);
500  hBox->addWidget(resumeLabel);
501 
502  pauseButton = new KPushButton(i18n("&Pause"), this);
503  connect(pauseButton, SIGNAL(clicked()), this, SLOT(_k_pauseResumeClicked()));
504  hBox->addWidget(pauseButton);
505 
506  hBox = new QHBoxLayout();
507  topLayout->addLayout(hBox);
508 
509  speedLabel = new QLabel(this);
510  hBox->addWidget(speedLabel, 1);
511  speedLabel->hide();
512 
513  hBox = new QHBoxLayout();
514  topLayout->addLayout(hBox);
515 
516  progressLabel = new QLabel(this);
517  progressLabel->setAlignment(Qt::AlignLeft);
518  hBox->addWidget(progressLabel);
519  progressLabel->hide();
520 
521  keepOpenCheck = new QCheckBox(i18n("&Keep this window open after transfer is complete"), this);
522  connect(keepOpenCheck, SIGNAL(toggled(bool)), this, SLOT(_k_keepOpenToggled(bool)));
523  topLayout->addWidget(keepOpenCheck);
524  keepOpenCheck->hide();
525 
526  hBox = new QHBoxLayout();
527  topLayout->addLayout(hBox);
528 
529  openFile = new KPushButton(i18n("Open &File"), this);
530  connect(openFile, SIGNAL(clicked()), this, SLOT(_k_openFile()));
531  hBox->addWidget(openFile);
532  openFile->setEnabled(false);
533  openFile->hide();
534 
535  openLocation = new KPushButton(i18n("Open &Destination"), this);
536  connect(openLocation, SIGNAL(clicked()), this, SLOT(_k_openLocation()));
537  hBox->addWidget(openLocation);
538  openLocation->hide();
539 
540  hBox->addStretch(1);
541 
542  cancelClose = new KPushButton(KStandardGuiItem::cancel(), this);
543  connect(cancelClose, SIGNAL(clicked()), this, SLOT(_k_stop()));
544  hBox->addWidget(cancelClose);
545 
546  resize(sizeHint());
547  setMaximumHeight(sizeHint().height());
548 
549  setWindowTitle(i18n("Progress Dialog")); // show something better than kuiserver
550 }
551 
552 void KWidgetJobTracker::Private::ProgressWidget::showTotals()
553 {
554  // Show the totals in the progress label, if we still haven't
555  // processed anything. This is useful when the stat'ing phase
556  // of CopyJob takes a long time (e.g. over networks).
557  if (processedFiles == 0 && processedDirs == 0)
558  {
559  QString tmps;
560  if (totalDirs > 1)
561  // that we have a singular to translate looks weired but is only logical
562  tmps = i18np("%1 folder", "%1 folders", totalDirs) + " ";
563  tmps += i18np("%1 file", "%1 files", totalFiles);
564  progressLabel->setText( tmps );
565  }
566 }
567 
568 void KWidgetJobTracker::Private::ProgressWidget::setDestVisible(bool visible)
569 {
570  // We can't hide the destInvite/destEdit labels,
571  // because it screws up the QGridLayout.
572  if (visible)
573  {
574  destInvite->show();
575  destEdit->show();
576  }
577  else
578  {
579  destInvite->hide();
580  destEdit->hide();
581  destInvite->setText( QString() );
582  destEdit->setText( QString() );
583  }
584  setMaximumHeight(sizeHint().height());
585 }
586 
587 void KWidgetJobTracker::Private::ProgressWidget::checkDestination(const KUrl &dest)
588 {
589  bool ok = true;
590 
591  if (dest.isLocalFile()) {
592  QString path = dest.toLocalFile( KUrl::RemoveTrailingSlash );
593  const QStringList tmpDirs = KGlobal::dirs()->resourceDirs( "tmp" );
594  for (QStringList::ConstIterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it)
595  if (path.contains(*it))
596  ok = false; // it's in the tmp resource
597  }
598 
599  if (ok) {
600  openFile->show();
601  openLocation->show();
602  keepOpenCheck->show();
603  setMaximumHeight(sizeHint().height());
604  location=dest;
605  }
606 }
607 
608 void KWidgetJobTracker::Private::ProgressWidget::_k_keepOpenToggled(bool keepOpen)
609 {
610  if (keepOpen) {
611  KGlobal::ref();
612  } else {
613  KGlobal::deref();
614  }
615 }
616 
617 void KWidgetJobTracker::Private::ProgressWidget::_k_openFile()
618 {
619  QProcess::startDetached("kde-open", QStringList() << location.prettyUrl());
620 }
621 
622 void KWidgetJobTracker::Private::ProgressWidget::_k_openLocation()
623 {
624  KUrl dirLocation(location);
625  dirLocation.setFileName(QString());
626  QProcess::startDetached("kde-open", QStringList() << dirLocation.prettyUrl());
627 }
628 
629 void KWidgetJobTracker::Private::ProgressWidget::_k_pauseResumeClicked()
630 {
631  if (jobRegistered && !suspendedProperty) {
632  tracker->slotSuspend(job);
633  } else if (jobRegistered) {
634  tracker->slotResume(job);
635  }
636 }
637 
638 void KWidgetJobTracker::Private::ProgressWidget::_k_stop()
639 {
640  if (jobRegistered) {
641  tracker->slotStop(job);
642  }
643  closeNow();
644 }
645 
646 void KWidgetJobTracker::Private::ProgressWidget::_k_arrowToggled()
647 {
648  if (arrowState == Qt::DownArrow) {
649  //The arrow is in the down position, dialog is collapsed, expand it and change icon.
650  progressLabel->show();
651  speedLabel->show();
652  arrowButton->setIcon(KIcon("arrow-up"));
653  arrowButton->setToolTip(i18n("Click this to collapse the dialog, to hide details"));
654  arrowState = Qt::UpArrow;
655  } else {
656  //Collapse the dialog
657  progressLabel->hide();
658  speedLabel->hide();
659  arrowButton->setIcon(KIcon("arrow-down"));
660  arrowButton->setToolTip(i18n("Click this to expand the dialog, to show details"));
661  arrowState = Qt::DownArrow;
662  }
663  setMaximumHeight(sizeHint().height());
664 }
665 
666 #include "kwidgetjobtracker.moc"
667 #include "kwidgetjobtracker_p.moc"
KStandardGuiItem::cancel
KGuiItem cancel()
Returns the 'Cancel' gui item.
Definition: kstandardguiitem.cpp:113
kdialog.h
caption
QString caption()
i18n
QString i18n(const char *text)
KPushButton
A QPushButton with drag-support and KGuiItem support.
Definition: kpushbutton.h:46
KWidgetJobTracker::speed
virtual void speed(KJob *job, unsigned long value)
Definition: kwidgetjobtracker.cpp:168
KUrl::RemoveTrailingSlash
KWidgetJobTracker::percent
virtual void percent(KJob *job, unsigned long percent)
Definition: kwidgetjobtracker.cpp:158
kdebug.h
kurl.h
KIconLoader::global
static KIconLoader * global()
Returns the global icon loader initialized with the global KComponentData.
i18np
QString i18np(const char *sing, const char *plur, const A1 &a1)
KWidgetJobTracker::slotClean
virtual void slotClean(KJob *job)
Definition: kwidgetjobtracker.cpp:178
KWidgetJobTracker::description
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
Definition: kwidgetjobtracker.cpp:126
QWidget
KWidgetJobTracker::totalAmount
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Definition: kwidgetjobtracker.cpp:138
KAbstractWidgetJobTracker
The base class for widget based job trackers.
Definition: kabstractwidgetjobtracker.h:34
KGlobal::dirs
KStandardDirs * dirs()
kiconloader.h
KUrl::toLocalFile
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
KWidgetJobTracker::resumed
virtual void resumed(KJob *job)
Definition: kwidgetjobtracker.cpp:198
QString
KIconLoader::NoGroup
No group.
Definition: kiconloader.h:129
QObject
klocale.h
ref
void ref()
KUrl
i18nc
QString i18nc(const char *ctxt, const char *text)
KSeparator
Standard horizontal or vertical separator.
Definition: kseparator.h:34
deref
void deref()
KDialog::spacingHint
static int spacingHint()
Returns the number of pixels that should be used between widgets inside a dialog according to the KDE...
Definition: kdialog.cpp:432
QStringList
KWidgetJobTracker::suspended
virtual void suspended(KJob *job)
Definition: kwidgetjobtracker.cpp:188
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:40
KLocale::formatByteSize
QString formatByteSize(double size) const
KWidgetJobTracker::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kwidgetjobtracker.cpp:79
KSqueezedTextLabel
A replacement for QLabel that squeezes its text.
Definition: ksqueezedtextlabel.h:47
KAbstractWidgetJobTracker::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kabstractwidgetjobtracker.cpp:43
kwidgetjobtracker.h
KWindowSystem::setIcons
static void setIcons(WId win, const QPixmap &icon, const QPixmap &miniIcon)
Sets an icon and a miniIcon on window win.
Definition: kwindowsystem_mac.cpp:467
kpushbutton.h
KStandardDirs::resourceDirs
QStringList resourceDirs(const char *type) const
KStandardGuiItem::close
KGuiItem close()
Returns the 'Close' gui item.
Definition: kstandardguiitem.cpp:182
ksqueezedtextlabel.h
KStandardGuiItem::ok
KGuiItem ok()
Returns the 'Ok' gui item.
Definition: kstandardguiitem.cpp:107
KGlobal::locale
KLocale * locale()
kseparator.h
KWidgetJobTracker::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kwidgetjobtracker.cpp:92
KWidgetJobTracker::KWidgetJobTracker
KWidgetJobTracker(QWidget *parent=0)
Creates a new KWidgetJobTracker.
Definition: kwidgetjobtracker.cpp:64
kstandarddirs.h
KWidgetJobTracker::~KWidgetJobTracker
virtual ~KWidgetJobTracker()
Destroys a KWidgetJobTracker.
Definition: kwidgetjobtracker.cpp:69
QLabel
kwindowsystem.h
KWidgetJobTracker::infoMessage
virtual void infoMessage(KJob *job, const QString &plain, const QString &rich)
The following slots are inherited from KJobTrackerInterface.
Definition: kwidgetjobtracker.cpp:116
QPair
QSize
KWidgetJobTracker::keepOpen
bool keepOpen(KJob *job) const
Definition: kwidgetjobtracker.cpp:106
KUrl::isLocalFile
bool isLocalFile() const
KAbstractWidgetJobTracker::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kabstractwidgetjobtracker.cpp:48
kguiitem.h
KWidgetJobTracker::widget
virtual QWidget * widget(KJob *job)
The widget associated to this tracker.
Definition: kwidgetjobtracker.cpp:74
KJob
KWidgetJobTracker::processedAmount
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Definition: kwidgetjobtracker.cpp:148
KStandardAction::close
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
Close the current document.
Definition: kstandardaction.cpp:269
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal