Changeset View
Changeset View
Standalone View
Standalone View
processui/ksysguardprocesslist.cpp
Show First 20 Lines • Show All 408 Lines • ▼ Show 20 Line(s) | 406 | { //index is the item the user selected in the combo box | |||
---|---|---|---|---|---|
409 | d->mUi->cmbFilter->setCurrentIndex( (int)state); | 409 | d->mUi->cmbFilter->setCurrentIndex( (int)state); | ||
410 | if(isVisible()) | 410 | if(isVisible()) | ||
411 | expandInit(); | 411 | expandInit(); | ||
412 | } | 412 | } | ||
413 | void KSysGuardProcessList::filterTextChanged(const QString &newText) { | 413 | void KSysGuardProcessList::filterTextChanged(const QString &newText) { | ||
414 | d->mFilterModel.setFilterRegExp(newText.trimmed()); | 414 | d->mFilterModel.setFilterRegExp(newText.trimmed()); | ||
415 | if(isVisible()) | 415 | if(isVisible()) | ||
416 | expandInit(); | 416 | expandInit(); | ||
417 | d->mUi->btnKillProcess->setEnabled( d->mUi->treeView->selectionModel()->hasSelection() ); | 417 | d->mUi->btnKillProcess->setEnabled(d->mUi->treeView->selectionModel()->hasSelection()); | ||
418 | d->mUi->treeView->scrollTo( d->mUi->treeView->currentIndex()); | 418 | d->mUi->treeView->scrollTo(d->mUi->treeView->currentIndex()); | ||
419 | } | 419 | } | ||
420 | 420 | | |||
421 | int KSysGuardProcessList::visibleProcessesCount() const { | 421 | int KSysGuardProcessList::visibleProcessesCount() const { | ||
422 | //This assumes that all the visible rows are processes. This is true currently, but might not be | 422 | //This assumes that all the visible rows are processes. This is true currently, but might not be | ||
423 | //true if we add support for showing threads etc | 423 | //true if we add support for showing threads etc | ||
424 | if(d->mModel.isSimpleMode()) | 424 | if(d->mModel.isSimpleMode()) | ||
425 | return d->mFilterModel.rowCount(); | 425 | return d->mFilterModel.rowCount(); | ||
426 | return d->totalRowCount(QModelIndex()); | 426 | return d->totalRowCount(QModelIndex()); | ||
Show All 22 Lines | 442 | { | |||
449 | action.addArgument(QStringLiteral("pidcount"), processCount); | 449 | action.addArgument(QStringLiteral("pidcount"), processCount); | ||
450 | } | 450 | } | ||
451 | void KSysGuardProcessList::selectionChanged() | 451 | void KSysGuardProcessList::selectionChanged() | ||
452 | { | 452 | { | ||
453 | int numSelected = d->mUi->treeView->selectionModel()->selectedRows().size(); | 453 | int numSelected = d->mUi->treeView->selectionModel()->selectedRows().size(); | ||
454 | if(numSelected == d->mNumItemsSelected) | 454 | if(numSelected == d->mNumItemsSelected) | ||
455 | return; | 455 | return; | ||
456 | d->mNumItemsSelected = numSelected; | 456 | d->mNumItemsSelected = numSelected; | ||
457 | d->mUi->btnKillProcess->setEnabled( numSelected != 0 ); | 457 | d->mUi->btnKillProcess->setEnabled(numSelected != 0); | ||
458 | 458 | | |||
459 | d->renice->setText(i18np("Set Priority...", "Set Priority...", numSelected)); | 459 | d->renice->setText(i18np("Set Priority...", "Set Priority...", numSelected)); | ||
460 | d->kill->setText(i18np("Forcibly Kill Process", "Forcibly Kill Processes", numSelected)); | 460 | d->kill->setText(i18np("Forcibly Kill Process", "Forcibly Kill Processes", numSelected)); | ||
461 | d->terminate->setText(i18ncp("Context menu", "End Process", "End Processes", numSelected)); | 461 | d->terminate->setText(i18ncp("Context menu", "End Process", "End Processes", numSelected)); | ||
462 | } | 462 | } | ||
463 | void KSysGuardProcessList::showProcessContextMenu(const QModelIndex &index) { | 463 | void KSysGuardProcessList::showProcessContextMenu(const QModelIndex &index) { | ||
464 | if(!index.isValid()) return; | 464 | if(!index.isValid()) return; | ||
465 | QRect rect = d->mUi->treeView->visualRect(index); | 465 | QRect rect = d->mUi->treeView->visualRect(index); | ||
▲ Show 20 Lines • Show All 1051 Lines • Show Last 20 Lines |