diff -U 3 -H -d -r -N -- Plasma-GlobalMenu.orig/Changelog Plasma-GlobalMenu/Changelog --- Plasma-GlobalMenu.orig/Changelog 2010-08-25 00:09:11.000000000 +0100 +++ Plasma-GlobalMenu/Changelog 2010-11-07 21:38:05.780615244 +0000 @@ -1,3 +1,8 @@ +* Implemented Icons, based on list from QtCurve configs. +* Implemented Checkable menus. +* Fixed "Attempt to set global shortcut for action without objectName()" +Changes by falkTX + * Fixed Minimize Problem , when window is minimized , and restored , top menu will automatically hide or restore to applications's ( app like iptux , pidgin ) Thanks edio for finding this bug ! diff -U 3 -H -d -r -N -- Plasma-GlobalMenu.orig/Instructions Plasma-GlobalMenu/Instructions --- Plasma-GlobalMenu.orig/Instructions 2010-08-25 00:08:39.000000000 +0100 +++ Plasma-GlobalMenu/Instructions 2010-11-07 21:33:03.490631936 +0000 @@ -1,13 +1,11 @@ Plasma-GlobalMenu is in src directory. -TODO: -* Add Icon support ( now i'm using bespin without icons , so cool enough now ) - Evey feature , that i need , is added to this version , 0.14 , if you need anything specific , just post a comment here , you're welcomed. Originally plasma-globalmenu was developed by Wang Hoi , thanks for him firstly. Well , this modification made all menus available global for Gnome / GTK ( dynampic linked with system library ) , possible. +Icon support and other small fixes by falkTX. The screenshot is running KDE 4.4.5 , with Bespin Style , XBar plasma widget , on Gentoo System. diff -U 3 -H -d -r -N -- Plasma-GlobalMenu.orig/src/README Plasma-GlobalMenu/src/README --- Plasma-GlobalMenu.orig/src/README 2010-08-19 05:26:41.000000000 +0100 +++ Plasma-GlobalMenu/src/README 2010-11-07 21:29:46.816630400 +0000 @@ -4,10 +4,10 @@ Global menu on XBar, sub menu, checkable menu entry supported. Trigger menu action. XPropertyEvent handled +Menu entry icon. Not implemented: Global keyboard shortcut. -Menu entry icon. You need XBar (and Bespin style) to test it. Compile it, run globalmenu, then you can get both menus on GTK programs and Qt4 programs. diff -U 3 -H -d -r -N -- Plasma-GlobalMenu.orig/src/globalmenu.cpp Plasma-GlobalMenu/src/globalmenu.cpp --- Plasma-GlobalMenu.orig/src/globalmenu.cpp 2010-08-27 13:59:42.000000000 +0100 +++ Plasma-GlobalMenu/src/globalmenu.cpp 2010-11-07 21:31:55.332632006 +0000 @@ -1,5 +1,6 @@ /* Bespin mac-a-like GlobalMenu KDE4 Copyright (C) 2007 Thomas Luebking + Copyright (C) 2010 Filipe Coelho This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -100,6 +101,109 @@ return result; } +static QString GtkIcon(QString icon) +{ + if (icon == "gtk-about") { return "start-here-kde"; } + else if (icon == "gtk-add") { return "list-add.png"; } + else if (icon == "gtk-apply") { return "dialog-ok-apply.png"; } + else if (icon == "gtk-bold") { return "format-text-bold.png"; } + else if (icon == "gtk-cancel") { return "dialog-cancel.png"; } + else if (icon == "gtk-cdrom") { return "media-optical.png"; } + else if (icon == "gtk-clear") { return "edit-clear.png"; } + else if (icon == "gtk-close") { return "window-close.png"; } + else if (icon == "gtk-color-picker") { return "color-picker.png"; } + else if (icon == "gtk-connect") { return "network-connect.png"; } + else if (icon == "gtk-convert") { return "document-export.png"; } + else if (icon == "gtk-copy") { return "edit-copy.png"; } + else if (icon == "gtk-cut") { return "edit-cut.png"; } + else if (icon == "gtk-delete") { return "edit-delete.png"; } + else if (icon == "gtk-dialog-authentication") { return "status/dialog-password.png"; } + else if (icon == "gtk-dialog-error") { return "status/dialog-error.png"; } + else if (icon == "gtk-dialog-info") { return "status/dialog-information.png"; } + else if (icon == "gtk-dialog-question") { return "status/dialog-information.png"; } + else if (icon == "gtk-dialog-warning") { return "status/dialog-warning.png"; } + else if (icon == "gtk-directory") { return "folder.png"; } + else if (icon == "gtk-disconnect") { return "network-disconnect.png"; } + else if (icon == "gtk-dnd") { return "application-x-zerosize.png"; } + else if (icon == "gtk-dnd-multiple") { return "document-multiple.png"; } + else if (icon == "gtk-edit") { return "document-properties.png"; } + else if (icon == "gtk-execute") { return "fork.png"; } + else if (icon == "gtk-file") { return "application-x-zerosize.png"; } + else if (icon == "gtk-find") { return "edit-find.png"; } + else if (icon == "gtk-find-and-replace") { return "edit-find-replace.png"; } + else if (icon == "gtk-floppy") { return "media-floppy.png"; } + else if (icon == "gtk-fullscreen") { return "view-fullscreen.png"; } + else if (icon == "gtk-goto-bottom") { return "go-bottom.png"; } + else if (icon == "gtk-goto-first") { return "go-first.png"; } + else if (icon == "gtk-goto-last") { return "go-last.png"; } + else if (icon == "gtk-goto-top") { return "go-top.png"; } + else if (icon == "gtk-go-back") { return "go-previous.png"; } + else if (icon == "gtk-go-back-ltr") { return "go-previous.png"; } + else if (icon == "gtk-go-back-rtl") { return "go-next.png"; } + else if (icon == "gtk-go-down") { return "go-down.png"; } + else if (icon == "gtk-go-forward") { return "go-next.png"; } + else if (icon == "gtk-go-forward-ltr") { return "go-next.png"; } + else if (icon == "gtk-go-forward-rtl") { return "go-previous.png"; } + else if (icon == "gtk-go-up") { return "go-up.png"; } + else if (icon == "gtk-harddisk") { return "drive-harddisk.png"; } + else if (icon == "gtk-help") { return "help-contents.png"; } + else if (icon == "gtk-home") { return "go-home.png"; } + else if (icon == "gtk-indent") { return "format-indent-more.png"; } + else if (icon == "gtk-index") { return "help-contents.png"; } + else if (icon == "gtk-info") { return "help-about.png"; } + else if (icon == "gtk-italic") { return "format-text-italic.png"; } + else if (icon == "gtk-jump-to") { return "go-jump.png"; } + else if (icon == "gtk-justify-center") { return "format-justify-center.png"; } + else if (icon == "gtk-justify-fill") { return "format-justify-fill.png"; } + else if (icon == "gtk-justify-left") { return "format-justify-left.png"; } + else if (icon == "gtk-justify-right") { return "format-justify-right.png"; } + else if (icon == "gtk-leave-fullscreen") { return "view-restore.png"; } + else if (icon == "gtk-media-forward") { return "media-seek-forward.png"; } + else if (icon == "gtk-media-next") { return "media-skip-forward.png"; } + else if (icon == "gtk-media-pause") { return "media-playback-pause.png"; } + else if (icon == "gtk-media-play") { return "media-playback-start.png"; } + else if (icon == "gtk-media-previous") { return "media-skip-backward.png"; } + else if (icon == "gtk-media-record") { return "media-record.png"; } + else if (icon == "gtk-media-rewind") { return "media-seek-backward.png"; } + else if (icon == "gtk-media-stop") { return "media-playback-stop.png"; } + else if (icon == "gtk-missing-image") { return "unknown.png"; } + else if (icon == "gtk-network") { return "network-server.png"; } + else if (icon == "gtk-new") { return "document-new.png"; } + else if (icon == "gtk-no") { return "edit-delete.png"; } + else if (icon == "gtk-ok") { return "dialog-ok.png"; } + else if (icon == "gtk-open") { return "document-open.png"; } + else if (icon == "gtk-paste") { return "edit-paste.png"; } + else if (icon == "gtk-preferences") { return "configure.png"; } + else if (icon == "gtk-print") { return "document-print.png"; } + else if (icon == "gtk-print-preview") { return "document-print-preview.png"; } + else if (icon == "gtk-properties") { return "document-properties.png"; } + else if (icon == "gtk-quit") { return "application-exit.png"; } + else if (icon == "gtk-redo") { return "edit-redo.png"; } + else if (icon == "gtk-refresh") { return "view-refresh.png"; } + else if (icon == "gtk-remove") { return "edit-delete.png"; } + else if (icon == "gtk-revert-to-saved") { return "document-revert.png"; } + else if (icon == "gtk-save") { return "document-save.png"; } + else if (icon == "gtk-save-as") { return "document-save-as.png"; } + else if (icon == "gtk-select-all") { return "edit-select-all.png"; } + else if (icon == "gtk-select-color") { return "color-picker.png"; } + else if (icon == "gtk-select-font") { return "preferences-desktop-font.png"; } + else if (icon == "gtk-sort-ascending") { return "view-sort-ascending.png"; } + else if (icon == "gtk-sort-descending") { return "view-sort-descending.png"; } + else if (icon == "gtk-spell-check") { return "tools-check-spelling.png"; } + else if (icon == "gtk-stop") { return "process-stop.png"; } + else if (icon == "gtk-strikethrough") { return "format-text-strikethrough.png"; } + else if (icon == "gtk-undelete") { return "edit-undo.png"; } + else if (icon == "gtk-underline") { return "format-text-underline.png"; } + else if (icon == "gtk-undo") { return "edit-undo.png"; } + else if (icon == "gtk-unindent") { return "format-indent-less.png"; } + else if (icon == "gtk-yes") { return "dialog-ok.png"; } + else if (icon == "gtk-zoom-100") { return "zoom-original.png"; } + else if (icon == "gtk-zoom-fit") { return "zoom-fit-best.png"; } + else if (icon == "gtk-zoom-in") { return "zoom-in.png"; } + else if (icon == "gtk-zoom-out") { return "zoom-out.png"; } + else return icon; +} + GlobalMenu::GlobalMenu(QWidget *parent) : QWidget(parent), mMenu(0), @@ -306,8 +410,14 @@ QString menu_tmp = itemElem.attribute("label").replace("_","&"); action = new KAction(menu_tmp,0); + if ( !itemElem.attribute("icon").isEmpty() ) + action->setIcon(KIcon( GtkIcon(itemElem.attribute("icon")) )); mMapper->setMapping(action,QString("%1/%2").arg(prefix).arg(itemElem.attribute("id"))); connect(action,SIGNAL(triggered()),mMapper,SLOT(map())); + if (itemElem.attribute("type") == "c" || itemElem.attribute("type") == "r") { + action->setCheckable(true); + action->setChecked(itemElem.attribute("state") == "1"); + } if (itemElem.attribute("sensible") == "0") { action->setEnabled(false); } @@ -371,6 +481,7 @@ KAction *action = new KAction(label,0); mMapper->setMapping(action,QString("/%1").arg(elem.attribute("id"))); connect(action,SIGNAL(triggered()),mMapper,SLOT(map())); + action->setObjectName(QString("action_"+elem.attribute("label"))); action->setGlobalShortcut(shortcut); result << label; }