def _get_unity_launcher_info( self, app, appdetails, installed_desktop_file_path, trans_id): (icon_size, icon_x, icon_y) = ( self._get_onscreen_icon_details_for_launcher_service(app)) icon_path = get_file_path_from_iconname( self.icons, iconname=appdetails.icon) # Note that the transaction ID is not specified because we are firing # the dbus signal at the very end of the installation now, and the # corresponding fix in Unity is expecting this value to be empty (it # would not be useful to the Unity launcher at this point anyway, # as the corresponding transaction would be complete). # Please see bug LP: #925014 and corresponding Unity branch for # further details. # TODO: If and when we re-implement firing the dbus signal at the # start of the transaction, at that time we will need to replace # the empty string below with the trans_id value. launcher_info = UnityLauncherInfo(app.name, appdetails.icon, icon_path, icon_x, icon_y, icon_size, installed_desktop_file_path, "") return launcher_info
def test_get_file_path_from_iconname(self): icons = get_test_gtk3_icon_cache() icon_path = get_file_path_from_iconname( icons, "softwarecenter") self.assertEqual( icon_path, "/usr/share/icons/hicolor/48x48/apps/softwarecenter.svg")
def _get_unity_launcher_info(self, app, appdetails, trans_id): (icon_size, icon_x, icon_y) = (self._get_onscreen_icon_details_for_launcher_service(app)) icon_path = get_file_path_from_iconname( self.icons, iconname=appdetails.icon_file_name) launcher_info = UnityLauncherInfo(app.name, appdetails.icon, icon_path, icon_x, icon_y, icon_size, appdetails.desktop_file, trans_id) return launcher_info
def _get_unity_launcher_info(self, app, appdetails, trans_id): (icon_size, icon_x, icon_y) = ( self._get_onscreen_icon_details_for_launcher_service(app)) icon_path = get_file_path_from_iconname( self.icons, iconname=appdetails.icon_file_name) launcher_info = UnityLauncherInfo(app.name, appdetails.icon, icon_path, icon_x, icon_y, icon_size, appdetails.desktop_file, trans_id) return launcher_info
def _check_unity_launcher_transaction_finished(self, result): # add the completed transaction details to the corresponding # launcher_item if result.pkgname in self.unity_launcher_items: launcher_info = self.unity_launcher_items[result.pkgname] launcher_info.icon_file_path = get_file_path_from_iconname( self.icons, launcher_info.icon_name) installed_path = convert_desktop_file_to_installed_location( launcher_info.app_install_desktop_file_path, result.pkgname) launcher_info.installed_desktop_file_path = installed_path # if the request to add to launcher has already been made, do it now if launcher_info.add_to_launcher_requested: if result.success: self._send_dbus_signal_to_unity_launcher(launcher_info) self.unity_launcher_items.pop(result.pkgname) self.action_bar.clear()
def _get_unity_launcher_info(self, app, appdetails, installed_desktop_file_path, trans_id): (icon_size, icon_x, icon_y) = (self._get_onscreen_icon_details_for_launcher_service(app)) icon_path = get_file_path_from_iconname(self.icons, iconname=appdetails.icon) # Note that the transaction ID is not specified because we are firing # the dbus signal at the very end of the installation now, and the # corresponding fix in Unity is expecting this value to be empty (it # would not be useful to the Unity launcher at this point anyway, # as the corresponding transaction would be complete). # Please see bug LP: #925014 and corresponding Unity branch for # further details. # TODO: If and when we re-implement firing the dbus signal at the # start of the transaction, at that time we will need to replace # the empty string below with the trans_id value. launcher_info = UnityLauncherInfo(app.name, appdetails.icon, icon_path, icon_x, icon_y, icon_size, installed_desktop_file_path, "") return launcher_info
def test_get_file_path_from_iconname(self): icons = get_test_gtk3_icon_cache() icon_path = get_file_path_from_iconname(icons, "softwarecenter") self.assertEqual( icon_path, "/usr/share/icons/hicolor/48x48/apps/softwarecenter.svg")