diff --git a/data/platform/gcw0/sections/settings/10_poweroff b/data/platform/gcw0/sections/settings/10_poweroff index 057151c..4a7933d 100644 --- a/data/platform/gcw0/sections/settings/10_poweroff +++ b/data/platform/gcw0/sections/settings/10_poweroff @@ -1,5 +1,6 @@ title=Power Off description=Shut down the system +launchmsg=Powering off icon=skin:icons/poweroff.png exec=/sbin/poweroff editable=false diff --git a/data/platform/gcw0/sections/settings/20_reboot b/data/platform/gcw0/sections/settings/20_reboot index 4806411..a62f245 100644 --- a/data/platform/gcw0/sections/settings/20_reboot +++ b/data/platform/gcw0/sections/settings/20_reboot @@ -1,5 +1,6 @@ title=Reboot description=Reboot the system +launchmsg=Rebooting icon=skin:icons/reboot.png exec=/sbin/reboot editable=false diff --git a/src/link.cpp b/src/link.cpp index 75aef50..9a3c6b0 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -103,6 +103,10 @@ void Link::setDescription(const string &description) { edited = true; } +const string &Link::getLaunchMsg() { + return launchMsg; +} + const string &Link::getIcon() { return icon; } diff --git a/src/link.h b/src/link.h index 9eda73d..48260af 100644 --- a/src/link.h +++ b/src/link.h @@ -56,6 +56,7 @@ public: void setTitle(const std::string &title); const std::string &getDescription(); void setDescription(const std::string &description); + const std::string &getLaunchMsg(); const std::string &getIcon(); void setIcon(const std::string &icon); const std::string &getIconPath(); @@ -65,7 +66,7 @@ public: protected: GMenu2X *gmenu2x; bool edited; - std::string title, description, icon, iconPath; + std::string title, description, launchMsg, icon, iconPath; Surface *iconSurface; Surface *icon_hover; diff --git a/src/linkapp.cpp b/src/linkapp.cpp index c3a9d62..5248ba0 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -213,6 +213,8 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile) title = value; } else if (name == "description") { description = value; + } else if (name == "launchmsg") { + launchMsg = value; } else if (name == "icon") { setIcon(value); } else if (name == "exec") { @@ -311,6 +313,7 @@ bool LinkApp::save() { if (!isOpk()) { if (!title.empty() ) f << "title=" << title << endl; if (!description.empty() ) f << "description=" << description << endl; + if (!launchMsg.empty() ) f << "launchmsg=" << launchMsg << endl; if (!icon.empty() ) f << "icon=" << icon << endl; if (!exec.empty() ) f << "exec=" << exec << endl; if (!params.empty() ) f << "params=" << params << endl; @@ -335,7 +338,10 @@ void LinkApp::drawRun() { //Darkened background gmenu2x->s->box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,150); - string text = gmenu2x->tr.translate("Launching $1",getTitle().c_str(),NULL); + string text = getLaunchMsg().empty() + ? gmenu2x->tr.translate("Launching $1", getTitle().c_str(), nullptr) + : gmenu2x->tr.translate(getLaunchMsg().c_str(), nullptr); + int textW = gmenu2x->font->getTextWidth(text); int boxW = 62+textW; int halfBoxW = boxW/2;