This commit is contained in:
fgerlits 2006-10-31 17:03:31 +00:00
parent c2bd03eb1d
commit b87465f387
2 changed files with 31 additions and 8 deletions

View File

@ -672,6 +672,21 @@ class GLiveSupport : public LocalizedConfigurable,
acquirePlaylist(Ptr<const UniqueId>::Ref id)
throw (XmlRpcException);
/**
* Tell if a playable object specified by an id exists.
*
* @param id the id of the playable to check for.
* @return true if the playable by the specified id exists,
* false otherwise.
* @exception XmlRpcException on communication problems.
*/
bool
existsPlayable(Ptr<const UniqueId>::Ref id) throw (XmlRpcException)
{
return storage->existsAudioClip(sessionId, id)
|| storage->existsPlaylist(sessionId, id);
}
/**
* Open a playable object, for reading only.
* Calls either getAudioClip() or getPlaylist().

View File

@ -931,14 +931,18 @@ SearchWindow :: onDownloadFromHub(void) throw ()
if (iter) {
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
if (playable) {
try {
searchInput->activatePage(3);
transportList->addDownload(playable);
} catch (XmlRpcException &e) {
gLiveSupport->displayMessageWindow(formatMessage(
if (!gLiveSupport->existsPlayable(playable->getId())) {
try {
searchInput->activatePage(3);
transportList->addDownload(playable);
} catch (XmlRpcException &e) {
gLiveSupport->displayMessageWindow(formatMessage(
"downloadFromHubErrorMsg", e.what() ));
return;
return;
}
} else {
onAddToScratchpad();
}
}
}
@ -953,7 +957,11 @@ SearchWindow :: onDoubleClick(const Gtk::TreeModel::Path & path,
const Gtk::TreeViewColumn * column)
throw ()
{
onAddToScratchpad();
if (searchIsLocal()) {
onAddToScratchpad();
} else {
onDownloadFromHub();
}
}