Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37504434
en ru br
Репозитории ALT

Группа :: Графические оболочки/KDE
Пакет: plasma5-workspace

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: alt-filtering-widget-settings-upon-first-launch.patch
Скачать


From 9481c89d5999297b10a6ef1c6e564c9922e456ae Mon Sep 17 00:00:00 2001
From: Pavel Moseev <mars@altlinux.org>
Date: Wed, 20 Mar 2019 14:25:06 +0300
Subject: [PATCH] Filtering widget settings upon first launch.
when the widget is first loaded, only checkboxes related to real devices in the system are enabled.
---
--- a/applets/systemmonitor/common/contents/ui/Applet.qml
+++ b/applets/systemmonitor/common/contents/ui/Applet.qml
@@ -53,17 +53,38 @@ Item {
             return;
         }
 
-        smSource.connectSource(source1);
-        if (source2) {
-            smSource.connectSource(source2);
-        }
 
-        sourcesModel.append(
-           {"source1": encodeURIComponent(source1),
-            "friendlyName1": friendlyName1,
-            "source2": encodeURIComponent(source2),
-            "friendlyName2": friendlyName2,
-            "dataSource": smSource});
+        var match_disk = source1.match(/^(disk+)/i);
+        if ((match_disk)&&(plasmoid.configuration.sources.length == 0)) {
+            var match_device = source1.match(/^disk\/((sd|vd|hd)\w+)/i);
+            if (match_device) {
+                var device_number = match_device[1].match(/\d+/);
+                if (device_number == null) {
+                    smSource.connectSource(source1);
+                    if (source2) {
+                        smSource.connectSource(source2);
+                    }
+                    sourcesModel.append(
+                        {"source1": encodeURIComponent(source1),
+                         "friendlyName1": friendlyName1,
+                         "source2": encodeURIComponent(source2),
+                         "friendlyName2": friendlyName2,
+                         "dataSource": smSource});
+                }
+            }
+        }
+        else {
+            smSource.connectSource(source1);
+            if (source2) {
+                smSource.connectSource(source2);
+            }
+            sourcesModel.append(
+            {"source1": encodeURIComponent(source1),
+             "friendlyName1": friendlyName1,
+             "source2": encodeURIComponent(source2),
+             "friendlyName2": friendlyName2,
+             "dataSource": smSource});
+        }
     }
 
     function showSource(source) {
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin