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

KDEUI

  • 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
47void 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
64KWidgetJobTracker::KWidgetJobTracker(QWidget *parent)
65 : KAbstractWidgetJobTracker(parent), d(new Private(parent, this))
66{
67}
68
69KWidgetJobTracker::~KWidgetJobTracker()
70{
71 delete d;
72}
73
74QWidget *KWidgetJobTracker::widget(KJob *job)
75{
76 return d->progressWidget.value(job, 0);
77}
78
79void 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
92void 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
106bool 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
116void 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
126void 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
138void 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
148void 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
158void 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
168void 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
178void 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
188void 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
198void 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
208void KWidgetJobTracker::Private::ProgressWidget::ref()
209{
210 ++refCount;
211}
212
213void 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
228void 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
247bool 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
261void KWidgetJobTracker::Private::ProgressWidget::infoMessage(const QString &plain, const QString &/*rich*/)
262{
263 speedLabel->setText(plain);
264 speedLabel->setAlignment(speedLabel->alignment() & ~Qt::TextWordWrap);
265}
266
267void 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
287void 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
317void 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
366void 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
386void 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
402void 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
421void KWidgetJobTracker::Private::ProgressWidget::suspended()
422{
423 pauseButton->setText(i18n("&Resume"));
424 suspendedProperty = true;
425}
426
427void KWidgetJobTracker::Private::ProgressWidget::resumed()
428{
429 pauseButton->setText(i18n("&Pause"));
430 suspendedProperty = false;
431}
432
433void 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
442void 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
552void 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
568void 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
587void 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
608void KWidgetJobTracker::Private::ProgressWidget::_k_keepOpenToggled(bool keepOpen)
609{
610 if (keepOpen) {
611 KGlobal::ref();
612 } else {
613 KGlobal::deref();
614 }
615}
616
617void KWidgetJobTracker::Private::ProgressWidget::_k_openFile()
618{
619 QProcess::startDetached("kde-open", QStringList() << location.prettyUrl());
620}
621
622void KWidgetJobTracker::Private::ProgressWidget::_k_openLocation()
623{
624 KUrl dirLocation(location);
625 dirLocation.setFileName(QString());
626 QProcess::startDetached("kde-open", QStringList() << dirLocation.prettyUrl());
627}
628
629void 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
638void KWidgetJobTracker::Private::ProgressWidget::_k_stop()
639{
640 if (jobRegistered) {
641 tracker->slotStop(job);
642 }
643 closeNow();
644}
645
646void 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"
KAbstractWidgetJobTracker
The base class for widget based job trackers.
Definition: kabstractwidgetjobtracker.h:35
KAbstractWidgetJobTracker::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kabstractwidgetjobtracker.cpp:48
KAbstractWidgetJobTracker::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kabstractwidgetjobtracker.cpp:43
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
KIconLoader::NoGroup
@ NoGroup
No group.
Definition: kiconloader.h:129
KIconLoader::global
static KIconLoader * global()
Returns the global icon loader initialized with the global KComponentData.
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:41
KJob
KJob::Unit
Unit
KJob::Files
Files
KJob::Bytes
Bytes
KJob::Directories
Directories
KLocale::formatByteSize
QString formatByteSize(double size) const
KPushButton
A QPushButton with drag-support and KGuiItem support.
Definition: kpushbutton.h:47
KSeparator
Standard horizontal or vertical separator.
Definition: kseparator.h:35
KSqueezedTextLabel
A replacement for QLabel that squeezes its text.
Definition: ksqueezedtextlabel.h:47
KStandardDirs::resourceDirs
QStringList resourceDirs(const char *type) const
KUrl
KUrl::RemoveTrailingSlash
RemoveTrailingSlash
KUrl::isLocalFile
bool isLocalFile() const
KUrl::toLocalFile
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
KWidgetJobTracker::~KWidgetJobTracker
virtual ~KWidgetJobTracker()
Destroys a KWidgetJobTracker.
Definition: kwidgetjobtracker.cpp:69
KWidgetJobTracker::resumed
virtual void resumed(KJob *job)
Definition: kwidgetjobtracker.cpp:198
KWidgetJobTracker::KWidgetJobTracker
KWidgetJobTracker(QWidget *parent=0)
Creates a new KWidgetJobTracker.
Definition: kwidgetjobtracker.cpp:64
KWidgetJobTracker::totalAmount
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Definition: kwidgetjobtracker.cpp:138
KWidgetJobTracker::processedAmount
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Definition: kwidgetjobtracker.cpp:148
KWidgetJobTracker::speed
virtual void speed(KJob *job, unsigned long value)
Definition: kwidgetjobtracker.cpp:168
KWidgetJobTracker::percent
virtual void percent(KJob *job, unsigned long percent)
Definition: kwidgetjobtracker.cpp:158
KWidgetJobTracker::widget
virtual QWidget * widget(KJob *job)
The widget associated to this tracker.
Definition: kwidgetjobtracker.cpp:74
KWidgetJobTracker::keepOpen
bool keepOpen(KJob *job) const
Definition: kwidgetjobtracker.cpp:106
KWidgetJobTracker::infoMessage
virtual void infoMessage(KJob *job, const QString &plain, const QString &rich)
The following slots are inherited from KJobTrackerInterface.
Definition: kwidgetjobtracker.cpp:116
KWidgetJobTracker::unregisterJob
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
Definition: kwidgetjobtracker.cpp:92
KWidgetJobTracker::suspended
virtual void suspended(KJob *job)
Definition: kwidgetjobtracker.cpp:188
KWidgetJobTracker::description
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
Definition: kwidgetjobtracker.cpp:126
KWidgetJobTracker::slotClean
virtual void slotClean(KJob *job)
Definition: kwidgetjobtracker.cpp:178
KWidgetJobTracker::registerJob
virtual void registerJob(KJob *job)
Register a new job in this tracker.
Definition: kwidgetjobtracker.cpp:79
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
QLabel
QObject
QPair
QWidget
kdebug.h
kdialog.h
kguiitem.h
kiconloader.h
klocale.h
i18n
QString i18n(const char *text)
i18np
QString i18np(const char *sing, const char *plur, const A1 &a1)
i18nc
QString i18nc(const char *ctxt, const char *text)
kpushbutton.h
kseparator.h
ksqueezedtextlabel.h
kstandarddirs.h
kurl.h
kwidgetjobtracker.h
kwindowsystem.h
KGlobal::dirs
KStandardDirs * dirs()
deref
void deref()
KGlobal::locale
KLocale * locale()
ref
void ref()
caption
QString caption()
KStandardAction::close
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
Close the current document.
Definition: kstandardaction.cpp:269
KStandardGuiItem::cancel
KGuiItem cancel()
Returns the 'Cancel' gui item.
Definition: kstandardguiitem.cpp:113
KStandardGuiItem::ok
KGuiItem ok()
Returns the 'Ok' gui item.
Definition: kstandardguiitem.cpp:107
KStandardGuiItem::close
KGuiItem close()
Returns the 'Close' gui item.
Definition: kstandardguiitem.cpp:182
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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