lib/csd/application/minisip/component/gnome.rb in csd-0.1.17 vs lib/csd/application/minisip/component/gnome.rb in csd-0.1.18

- old
+ new

@@ -27,10 +27,11 @@ # This command opens the bin directory in Debian/Ubuntu as to show where the executables are located in a single-user mode installation. UI.info "Revealing user-specific MiniSIP exectutables" Cmd.run "nautilus #{Path.build_bin}" else create_desktop_entry + update_gnome_menu_cache end send_notification end def create_desktop_entry @@ -42,9 +43,19 @@ Path.new_desktop_entry = Pathname.new File.join(Path.work, 'minisip.desktop') Cmd.touch_and_replace_content Path.new_desktop_entry, DESKTOP_ENTRY, :internal => true Cmd.run "sudo mv #{Path.new_desktop_entry} #{Path.minisip_desktop_entry}", :announce_pwd => false end + # Every desktop entry file not created via dpkg will not update the gnome menus cache. We need to + # do this manually here. See https://bugs.launchpad.net/ubuntu/+source/gnome-menus/+bug/581838 + # If this step would not be done, the MiniSIP menu item would disappear after restarting Ubuntu. + # + def update_gnome_menu_cache + Cmd.run %{sudo sh -c "/usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications/ > /usr/share/applications/desktop.${LANG}.cache"}, :announce_pwd => false + end + + # Sends an OSD notification. + # def send_notification Cmd.run %{notify-send --icon=minisip_gnome "MiniSIP installation complete" "Please have a look in your Applications menu -> Internet." }, :internal => true, :die_on_failure => false end end