icewm/icewm-susemenu.patch
Tomáš Chvátal 94c0ab5fe7 Accepting request 529925 from home:avindra
- Update to 1.4.2
- Rebase patches
  - icewm-susemenu.patch: rebase "suseprog" function
  - icewm-preferences.patch: rebase, only IconPath hunk not in upstream now
  - icewm-mate.patch: rebase several hunks in which context changed
- Drop patches that were accepted upstream
  - icewm-session-desktop.patch
  - icewm-exit-fork.patch
  - icewm-mail.patch
- Swap "sgmltool" for "asciidoc"

OBS-URL: https://build.opensuse.org/request/show/529925
OBS-URL: https://build.opensuse.org/package/show/X11:windowmanagers/icewm?expand=0&rev=77
2017-10-02 09:04:31 +00:00

61 lines
2.0 KiB
Diff

diff --git a/lib/menu.in b/lib/menu.in
index 88a3d70..e79d828 100644
--- a/lib/menu.in
+++ b/lib/menu.in
@@ -13,5 +13,6 @@ prog XChat xchat xchat
prog Gimp gimp gimp
separator
menuprog "Desktop Apps" folder icewm-menu-fdo
-menufile Programs folder programs
+#menufile Programs folder programs
menufile Tool_bar folder toolbar
+menuprog SUSE folder xdg_menu --format icewm
diff --git a/src/wmprog.cc b/src/wmprog.cc
index d1ce6b0..5190d80 100644
--- a/src/wmprog.cc
+++ b/src/wmprog.cc
@@ -429,7 +429,42 @@ char *parseMenus(
if (progmenu)
container->addContainer(name.cstr(), icon, progmenu);
}
- } else if (!strcmp(word, "menuprogreload")) {
+ } else if (!strcmp(word, "suseprog")) {
+ Argument name;
+
+ p = YConfig::getArgument(&name, p);
+ if (p == 0) return p;
+
+ Argument icons;
+
+ p = YConfig::getArgument(&icons, p);
+ if (p == 0) return p;
+
+ Argument command;
+ YStringArray args;
+
+ p = getCommandArgs(p, &command, args);
+ if (p == 0) {
+ msg(_("Error at prog %s"), name.cstr());
+ return p;
+ }
+
+ ref<YIcon> icon;
+#ifndef LITE
+ if (icons[0] != '-')
+ icon = YIcon::getIcon(icons);
+#endif
+ MSG(("suseprog %s %s", name.cstr(), command.cstr()));
+
+ upath fullPath = findPath(getenv("PATH"), X_OK, command.cstr());
+ if (fullPath != null) {
+ ObjectMenu *progmenu = new MenuProgMenu(
+ app, smActionListener, wmActionListener,
+ name.cstr(), command.cstr(), args, 0);
+ if (progmenu)
+ container->addContainer(name.cstr(), icon, progmenu);
+ }
+ } else if (!strcmp(word, "menuprogreload")) {
Argument name;
p = YConfig::getArgument(&name, p);