summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Menut <lmenut@mageia.org>2012-03-25 23:57:07 +0000
committerLuc Menut <lmenut@mageia.org>2012-03-25 23:57:07 +0000
commit813b372fb330fb1d125ec0bd07b2016570e63d88 (patch)
treea78854d7a3ae0ac9e8772037922dc4aad2bd4640
parent2d5b39a99be81268d8a9fdf4430d4e2d525d6811 (diff)
downloadconfig-813b372fb330fb1d125ec0bd07b2016570e63d88.tar
config-813b372fb330fb1d125ec0bd07b2016570e63d88.tar.gz
config-813b372fb330fb1d125ec0bd07b2016570e63d88.tar.bz2
config-813b372fb330fb1d125ec0bd07b2016570e63d88.tar.xz
config-813b372fb330fb1d125ec0bd07b2016570e63d88.zip
- fix plasma update script (mga #4845)
- sync plasma update with default panel - sync classicPanel's config with defaultPanel
-rw-r--r--kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js65
-rw-r--r--kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js5
-rw-r--r--kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js2
3 files changed, 41 insertions, 31 deletions
diff --git a/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js b/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js
index 8235f98..5b87161 100644
--- a/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js
+++ b/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js
@@ -8,9 +8,24 @@ function addLauncher(icontasks, applicationDesktop, applicationWmClass) {
icontasks.writeConfig("Items", itemsLaunchers);
}
+function removeIcon(panel, appDesktop) {
+ var iconsWidgets = panel.widgets("icon");
+ var appDesktopUrl = "file://" + applicationPath(appDesktop);
+ var iconUrl = "";
+ for (var j in iconsWidgets) {
+ iconUrl = iconsWidgets[j].readConfig("Url","noUrl");
+ if (iconUrl === appDesktopUrl) {
+ var myIcon = iconsWidgets[j];
+ myIcon.remove();
+ sleep(10);
+ }
+ }
+}
+
var myActivity14 = false;
var oldPanel = false;
+var userBottomPanel = false;
myActivity14 = activityById(14);
oldPanel = activityById(2);
@@ -26,7 +41,14 @@ if (myActivity14) {
}
-if (oldPanel) {
+for (var idxPanel in panels()) {
+ if ((panels()[idxPanel].id !== 2) && (panels()[idxPanel].location === "bottom")) {
+ userBottomPanel = true;
+ break;
+ }
+}
+
+if ((!userBottomPanel) && oldPanel) {
loadTemplate("org.mageia.plasma-desktop.defaultPanel");
var kickoffLauncher;
@@ -84,7 +106,7 @@ if (oldPanel) {
var showActivityManagerFound = false;
var iconsWidgets;
var launcherIndex = -1;
- var tasksIndex = -1;
+ var tasksIndex = -1;
var panelWidgets = myPanel.widgets();
for (var id in panelWidgets) {
@@ -136,9 +158,6 @@ if (oldPanel) {
case "org.kde.showActivityManager":
showActivityManagerFound = true;
break;
- case "showdesktop":
- panelWidgets[id].remove();
- break;
case "digital-clock":
var w_clock = panelWidgets[id];
w_clock.writeConfig("displayHolidays","false");
@@ -148,31 +167,21 @@ if (oldPanel) {
default:
break;
}
-
- sleep(2);
- myPanel.reloadConfig();
+
+ sleep(10);
+ myPanel.reloadConfig();
}
if (tasksIndex > -1) {
- iconsWidgets = myPanel.widgets("icon");
- for (var j in iconsWidgets) {
- var iconUrl = iconsWidgets[j].readConfig("Url","noUrl");
- var iconApp = iconUrl.substr(iconUrl.lastIndexOf('/') +1);
- switch(iconApp) {
- case "dolphin.desktop":
- case "systemsettings.desktop":
- case "mageia-drakconf.desktop":
- case "firefox.desktop":
- var myIcon = iconsWidgets[j];
- myIcon.remove();
- break;
- default:
- break;
- }
- }
+ removeIcon(myPanel, "dolphin.desktop");
+ myPanel.reloadConfig();
+ removeIcon(myPanel, "systemsettings.desktop");
+ myPanel.reloadConfig();
+ removeIcon(myPanel, "mageia-drakconf.desktop");
+ myPanel.reloadConfig();
+ removeIcon(myPanel, "firefox.desktop");
+ myPanel.reloadConfig();
}
- sleep(2);
- myPanel.reloadConfig();
if (! showActivityManagerFound) {
var newShowActivityManager = myPanel.addWidget("org.kde.showActivityManager");
@@ -183,11 +192,11 @@ if (oldPanel) {
newShowActivityManager.index = 0;
}
}
- sleep(2);
+ sleep(10);
myPanel.reloadConfig();
}
}
-sleep(2);
+sleep(10);
locked = true;
diff --git a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js
index ba94f85..3e83fc3 100644
--- a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js
+++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js
@@ -9,7 +9,7 @@ if (panelIds.length == 1) {
panel.location = 'bottom';
}
-panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27;
+panel.height = 40;
var w_simplelauncher = panel.addWidget("simplelauncher");
w_simplelauncher.writeConfig("icon", "mgabutton");
@@ -18,6 +18,7 @@ w_simplelauncher.writeConfig("showMenuTitles", "true");
w_simplelauncher.writeConfig("views", "RecentlyUsedApplications,Applications,Favorites,RecentlyUsed,RunCommand,Leave");
w_simplelauncher.reloadConfig();
+panel.addWidget("showdesktop");
panel.addWidget("org.kde.showActivityManager");
addIcon("dolphin.desktop");
@@ -66,4 +67,4 @@ w_systray.writeConfig('plugin', 'org.kde.telepathy-presence');
w_systray.currentConfigGroup = new Array();
w_systray.reloadConfig();
-sleep(2);
+sleep(10);
diff --git a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js
index 9a62190..03c9648 100644
--- a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js
+++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js
@@ -83,4 +83,4 @@ w_systray.currentConfigGroup = new Array('Applets', biggestId+1);
w_systray.writeConfig('plugin', 'org.kde.telepathy-presence');
w_systray.currentConfigGroup = new Array();
w_systray.reloadConfig();
-sleep(2);
+sleep(10);