summaryrefslogtreecommitdiffstats
path: root/tdeioslave
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-21 15:39:58 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-21 15:39:58 -0500
commitb5cb2797d65f2541a4c48ea00e6c325bb375ea46 (patch)
tree61dad727529d9a69977f44a05aca3a719422558c /tdeioslave
parentc73eb5f814d1096cd398fbec3084f816ba8a7269 (diff)
downloadtdebase-b5cb2797d65f2541a4c48ea00e6c325bb375ea46.tar.gz
tdebase-b5cb2797d65f2541a4c48ea00e6c325bb375ea46.zip
Add new hardware device tray application
Allow removable media action request popups to be suppressed
Diffstat (limited to 'tdeioslave')
-rw-r--r--tdeioslave/media/libmediacommon/mediamanagersettings.kcfg5
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp17
-rw-r--r--tdeioslave/media/tdecmodule/managermoduleview.ui12
3 files changed, 30 insertions, 4 deletions
diff --git a/tdeioslave/media/libmediacommon/mediamanagersettings.kcfg b/tdeioslave/media/libmediacommon/mediamanagersettings.kcfg
index 2994680c..32725c1b 100644
--- a/tdeioslave/media/libmediacommon/mediamanagersettings.kcfg
+++ b/tdeioslave/media/libmediacommon/mediamanagersettings.kcfg
@@ -24,5 +24,10 @@
<whatsthis>Allows TDE to autostart application after a medium mount if it contains an Autostart or an Autoopen file.</whatsthis>
<default>true</default>
</entry>
+ <entry name="NotificationPopupsEnabled" type="Bool">
+ <label>Enable notification popups</label>
+ <whatsthis>Deselect this if you do not want action request popups to be generated when devices are plugged in.</whatsthis>
+ <default>true</default>
+ </entry>
</group>
</kcfg>
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index a7cbb226..5846e00a 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -146,6 +146,14 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
allowNotification = false;
}
+ // Check if user wants the full popup to be suppressed
+ bool allowDialogNotification = allowNotification;
+ TDEConfig config("mediamanagerrc");
+ config.setGroup("Global");
+ if (!config.readBoolEntry("NotificationPopupsEnabled", true)) {
+ allowDialogNotification = false;
+ }
+
// Add volume block devices
if (sdevice->isDiskOfType(TDEDiskDeviceType::HDD)) {
/* We only list volumes that...
@@ -190,7 +198,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
}
// Insert medium into list
- m_mediaList.addMedium(medium, allowNotification);
+ m_mediaList.addMedium(medium, allowDialogNotification);
kdDebug(1219) << "TDEBackend::AddDevice inserted hard medium for " << sdevice->uniqueID() << endl;
@@ -233,7 +241,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
setVolumeProperties(medium);
// Insert medium into list
- m_mediaList.addMedium(medium, allowNotification);
+ m_mediaList.addMedium(medium, allowDialogNotification);
kdDebug(1219) << "TDEBackend::AddDevice inserted optical medium for " << sdevice->uniqueID() << endl;
@@ -248,6 +256,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
) {
if ((sdevice->checkDiskStatus(TDEDiskDeviceStatus::Removable)) && (!(sdevice->checkDiskStatus(TDEDiskDeviceStatus::Inserted)))) {
allowNotification = false;
+ allowDialogNotification = false;
}
/* We only list volumes that...
@@ -278,7 +287,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
}
}
- m_mediaList.addMedium(medium, allowNotification);
+ m_mediaList.addMedium(medium, allowDialogNotification);
kdDebug(1219) << "TDEBackend::AddDevice inserted floppy medium for " << sdevice->uniqueID() << endl;
@@ -294,7 +303,7 @@ void TDEBackend::AddDevice(TDEStorageDevice * sdevice, bool allowNotification)
// Create medium
Medium* medium = new Medium(sdevice->uniqueID(), driveUDIFromDeviceUID(sdevice->uniqueID()), "");
setCameraProperties(medium);
- m_mediaList.addMedium(medium, allowNotification);
+ m_mediaList.addMedium(medium, allowDialogNotification);
kdDebug(1219) << "TDEBackend::AddDevice inserted camera medium for " << sdevice->uniqueID() << endl;
diff --git a/tdeioslave/media/tdecmodule/managermoduleview.ui b/tdeioslave/media/tdecmodule/managermoduleview.ui
index 982da7d8..708d38c5 100644
--- a/tdeioslave/media/tdecmodule/managermoduleview.ui
+++ b/tdeioslave/media/tdecmodule/managermoduleview.ui
@@ -52,6 +52,17 @@
<string>Select this if you want to enable application autostart after mounting a device.</string>
</property>
</widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>kcfg_NotificationPopupsEnabled</cstring>
+ </property>
+ <property name="text">
+ <string>Enable notification popups</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Deselect this if you do not want action request popups to be generated when devices are plugged in.</string>
+ </property>
+ </widget>
<widget class="TQGroupBox">
<property name="name">
<cstring>groupbox_mount</cstring>
@@ -330,6 +341,7 @@ Display the short name as is; store a long name when the short name is not all u
<tabstop>kcfg_HalBackendEnabled</tabstop>
<tabstop>kcfg_CdPollingEnabled</tabstop>
<tabstop>kcfg_AutostartEnabled</tabstop>
+ <tabstop>kcfg_NotificationPopupsEnabled</tabstop>
<tabstop>option_automount</tabstop>
<tabstop>option_ro</tabstop>
<tabstop>option_quiet</tabstop>