diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-04-05 15:35:19 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-04-05 15:35:19 +0900 |
commit | b425c87ca31d9558e761cc7307ed62a4cd368348 (patch) | |
tree | 30b5b8167dfe8a5ad43d31f04e50749a1f368290 /kcontrol/hwmanager/hwdevicetray.cpp | |
parent | 62583793601489c5aa14b57d0d12628436c20923 (diff) | |
download | tdebase-b425c87ca31d9558e761cc7307ed62a4cd368348.tar.gz tdebase-b425c87ca31d9558e761cc7307ed62a4cd368348.zip |
tdehwdevicetray: add 'eject' and 'safe remove' buttons to the disk properties dialog.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kcontrol/hwmanager/hwdevicetray.cpp')
-rw-r--r-- | kcontrol/hwmanager/hwdevicetray.cpp | 81 |
1 files changed, 38 insertions, 43 deletions
diff --git a/kcontrol/hwmanager/hwdevicetray.cpp b/kcontrol/hwmanager/hwdevicetray.cpp index 5bc77c306..509fe2835 100644 --- a/kcontrol/hwmanager/hwdevicetray.cpp +++ b/kcontrol/hwmanager/hwdevicetray.cpp @@ -154,50 +154,45 @@ void HwDeviceSystemTray::mousePressEvent(TQMouseEvent* e) { KSystemTray::mousePressEvent(e); } -bool HwDeviceSystemTray::isMonitoredDevice(TDEStorageDevice* sdevice) { +bool HwDeviceSystemTray::isMonitoredDevice(TDEStorageDevice* sdevice) +{ // Type selection logic largely duplicated from the media manager tdeioslave - if ((sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || - sdevice->checkDiskStatus(TDEDiskDeviceStatus::ContainsFilesystem) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDAudio) || - sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) && - !sdevice->checkDiskStatus(TDEDiskDeviceStatus::Hidden) && - (sdevice->isDiskOfType(TDEDiskDeviceType::HDD) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDROM) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDR) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDMO) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDMRRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDMRRWW) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDROM) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDRAM) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDR) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDRDL) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDRWDL) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSR) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRDL) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRWDL) || - sdevice->isDiskOfType(TDEDiskDeviceType::BDROM) || - sdevice->isDiskOfType(TDEDiskDeviceType::BDR) || - sdevice->isDiskOfType(TDEDiskDeviceType::BDRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDROM) || - sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDR) || - sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDRW) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDAudio) || - sdevice->isDiskOfType(TDEDiskDeviceType::CDVideo) || - sdevice->isDiskOfType(TDEDiskDeviceType::DVDVideo) || - sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo) || - sdevice->isDiskOfType(TDEDiskDeviceType::Floppy) || - sdevice->isDiskOfType(TDEDiskDeviceType::Zip) || - sdevice->isDiskOfType(TDEDiskDeviceType::Jaz) || - sdevice->isDiskOfType(TDEDiskDeviceType::Camera))) - { - return true; - } - else { - return false; - } + return ((sdevice->isDiskOfType(TDEDiskDeviceType::LUKS) || + sdevice->checkDiskStatus(TDEDiskDeviceStatus::ContainsFilesystem) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDAudio) || + sdevice->checkDiskStatus(TDEDiskDeviceStatus::Blank)) && + !sdevice->checkDiskStatus(TDEDiskDeviceStatus::Hidden) && + (sdevice->isDiskOfType(TDEDiskDeviceType::HDD) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDROM) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDR) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDMO) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDMRRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDMRRWW) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDROM) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDRAM) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDR) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDRDL) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDRWDL) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSR) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRDL) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDPLUSRWDL) || + sdevice->isDiskOfType(TDEDiskDeviceType::BDROM) || + sdevice->isDiskOfType(TDEDiskDeviceType::BDR) || + sdevice->isDiskOfType(TDEDiskDeviceType::BDRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDROM) || + sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDR) || + sdevice->isDiskOfType(TDEDiskDeviceType::HDDVDRW) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDAudio) || + sdevice->isDiskOfType(TDEDiskDeviceType::CDVideo) || + sdevice->isDiskOfType(TDEDiskDeviceType::DVDVideo) || + sdevice->isDiskOfType(TDEDiskDeviceType::BDVideo) || + sdevice->isDiskOfType(TDEDiskDeviceType::Floppy) || + sdevice->isDiskOfType(TDEDiskDeviceType::Zip) || + sdevice->isDiskOfType(TDEDiskDeviceType::Jaz) || + sdevice->isDiskOfType(TDEDiskDeviceType::Camera))); } void HwDeviceSystemTray::contextMenuAboutToShow(TDEPopupMenu* menu) { |