Changeset View
Changeset View
Standalone View
Standalone View
processui/ksysguardprocesslist.cpp
Show First 20 Lines • Show All 746 Lines • ▼ Show 20 Line(s) | 739 | #endif | |||
---|---|---|---|---|---|
747 | QAction *actionAuto = nullptr; | 747 | QAction *actionAuto = nullptr; | ||
748 | QAction *actionKB = nullptr; | 748 | QAction *actionKB = nullptr; | ||
749 | QAction *actionMB = nullptr; | 749 | QAction *actionMB = nullptr; | ||
750 | QAction *actionGB = nullptr; | 750 | QAction *actionGB = nullptr; | ||
751 | QAction *actionPercentage = nullptr; | 751 | QAction *actionPercentage = nullptr; | ||
752 | QAction *actionShowCmdlineOptions = nullptr; | 752 | QAction *actionShowCmdlineOptions = nullptr; | ||
753 | QAction *actionShowTooltips = nullptr; | 753 | QAction *actionShowTooltips = nullptr; | ||
754 | QAction *actionNormalizeCPUUsage = nullptr; | 754 | QAction *actionNormalizeCPUUsage = nullptr; | ||
755 | QAction *actionShowThreads = nullptr; | ||||
755 | 756 | | |||
756 | QAction *actionIoCharacters = nullptr; | 757 | QAction *actionIoCharacters = nullptr; | ||
757 | QAction *actionIoSyscalls = nullptr; | 758 | QAction *actionIoSyscalls = nullptr; | ||
758 | QAction *actionIoActualCharacters = nullptr; | 759 | QAction *actionIoActualCharacters = nullptr; | ||
759 | QAction *actionIoShowRate = nullptr; | 760 | QAction *actionIoShowRate = nullptr; | ||
760 | bool showIoRate = false; | 761 | bool showIoRate = false; | ||
761 | if(index == ProcessModel::HeadingIoRead || index == ProcessModel::HeadingIoWrite) | 762 | if(index == ProcessModel::HeadingIoRead || index == ProcessModel::HeadingIoWrite) | ||
762 | showIoRate = d->mModel.ioInformation() == ProcessModel::BytesRate || | 763 | showIoRate = d->mModel.ioInformation() == ProcessModel::BytesRate || | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 827 | } else if(index == ProcessModel::HeadingName) { | |||
832 | menu.addAction(actionShowCmdlineOptions); | 833 | menu.addAction(actionShowCmdlineOptions); | ||
833 | } else if(index == ProcessModel::HeadingCPUUsage) { | 834 | } else if(index == ProcessModel::HeadingCPUUsage) { | ||
834 | menu.addSeparator(); | 835 | menu.addSeparator(); | ||
835 | actionNormalizeCPUUsage = new QAction(&menu); | 836 | actionNormalizeCPUUsage = new QAction(&menu); | ||
836 | actionNormalizeCPUUsage->setText(i18n("Divide CPU usage by number of CPUs")); | 837 | actionNormalizeCPUUsage->setText(i18n("Divide CPU usage by number of CPUs")); | ||
837 | actionNormalizeCPUUsage->setCheckable(true); | 838 | actionNormalizeCPUUsage->setCheckable(true); | ||
838 | actionNormalizeCPUUsage->setChecked(d->mModel.isNormalizedCPUUsage()); | 839 | actionNormalizeCPUUsage->setChecked(d->mModel.isNormalizedCPUUsage()); | ||
839 | menu.addAction(actionNormalizeCPUUsage); | 840 | menu.addAction(actionNormalizeCPUUsage); | ||
841 | } else if(index == ProcessModel::HeadingPid && d->mModel.canShowThreads()) { | ||||
842 | menu.addSeparator(); | ||||
843 | actionShowThreads = new QAction(&menu); | ||||
844 | actionShowThreads->setText(i18n("Show threads as if they were processes")); | ||||
845 | actionShowThreads->setCheckable(true); | ||||
846 | actionShowThreads->setChecked(d->mModel.isShowingThreads()); | ||||
847 | menu.addAction(actionShowThreads); | ||||
840 | } | 848 | } | ||
841 | 849 | | |||
842 | if(index == ProcessModel::HeadingIoRead || index == ProcessModel::HeadingIoWrite) { | 850 | if(index == ProcessModel::HeadingIoRead || index == ProcessModel::HeadingIoWrite) { | ||
843 | menu.addSeparator()->setText(i18n("Displayed Information")); | 851 | menu.addSeparator()->setText(i18n("Displayed Information")); | ||
844 | QActionGroup *ioInformationGroup = new QActionGroup(&menu); | 852 | QActionGroup *ioInformationGroup = new QActionGroup(&menu); | ||
845 | actionIoCharacters = new QAction(&menu); | 853 | actionIoCharacters = new QAction(&menu); | ||
846 | actionIoCharacters->setText(i18n("Characters read/written")); | 854 | actionIoCharacters->setText(i18n("Characters read/written")); | ||
847 | actionIoCharacters->setCheckable(true); | 855 | actionIoCharacters->setCheckable(true); | ||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 956 | case ProcessModel::SyscallsRate: | |||
950 | break; | 958 | break; | ||
951 | case ProcessModel::ActualBytes: | 959 | case ProcessModel::ActualBytes: | ||
952 | case ProcessModel::ActualBytesRate: | 960 | case ProcessModel::ActualBytesRate: | ||
953 | d->mModel.setIoInformation((showIoRate)?ProcessModel::ActualBytesRate:ProcessModel::ActualBytes); | 961 | d->mModel.setIoInformation((showIoRate)?ProcessModel::ActualBytesRate:ProcessModel::ActualBytes); | ||
954 | break; | 962 | break; | ||
955 | default: | 963 | default: | ||
956 | break; | 964 | break; | ||
957 | } | 965 | } | ||
966 | } else if(result == actionShowThreads) { | ||||
967 | d->mModel.setShowingThreads(actionShowThreads->isChecked()); | ||||
968 | return; | ||||
958 | } | 969 | } | ||
959 | 970 | | |||
960 | int i = result->data().toInt(); | 971 | int i = result->data().toInt(); | ||
961 | //We set data to be negative to hide a column, and positive to show a column | 972 | //We set data to be negative to hide a column, and positive to show a column | ||
962 | if(i < 0) | 973 | if(i < 0) | ||
963 | d->mUi->treeView->hideColumn(-1-i); | 974 | d->mUi->treeView->hideColumn(-1-i); | ||
964 | else { | 975 | else { | ||
965 | d->mUi->treeView->showColumn(i); | 976 | d->mUi->treeView->showColumn(i); | ||
▲ Show 20 Lines • Show All 623 Lines • Show Last 20 Lines |