summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 12:40:40 +0000
committerlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-09-25 12:40:40 +0000
commitb9b8dd18c4c4798c168d42ce7c0d2651930f4e55 (patch)
tree6840b02a23784f7c03ad9dd9c313cce8380c97be
parent9e1d6c39975a44844f36c101d363f3aa95e17614 (diff)
downloadvdr-plugin-muggle-b9b8dd18c4c4798c168d42ce7c0d2651930f4e55.tar.gz
vdr-plugin-muggle-b9b8dd18c4c4798c168d42ce7c0d2651930f4e55.tar.bz2
Bug corrected which made muggle crash on displaying the tree submenu
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@176 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--vdr_menu.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/vdr_menu.c b/vdr_menu.c
index 094acd3..314e16a 100644
--- a/vdr_menu.c
+++ b/vdr_menu.c
@@ -164,13 +164,12 @@ eOSState mgMainMenu::ProcessKey(eKeys key)
asprintf( &buffer, "%d tracks sent to current playlist", (int) tracks->size() );
m_current_playlist->appendList(tracks);
#if VDRVERSNUM >= 10307
- Skins.Message(mtInfo,buffer);
- Skins.Flush();
+ Skins.Message(mtInfo,buffer);
+ Skins.Flush();
#else
Interface->Status( buffer );
Interface->Flush();
-#endif
-
+#endif
free( buffer );
}
else
@@ -531,10 +530,14 @@ void mgMainMenu::DisplayTreeSubmenu()
Clear();
SetButtons();
- SetTitle( strcat("Muggle - ",tr("Tree View Commands") ) );
+
+ char *buffer;
+ asprintf( &buffer, "Muggle - %s", tr("Tree View Commands") );
+ SetTitle( buffer );
+ free( buffer );
// Add items
- Add( new cOsdItem( "1 - Instant play" ) );
+ Add( new cOsdItem( "Instant play" ) );
Display();
}
@@ -567,7 +570,7 @@ eOSState mgMainMenu::TreeSubmenuAction( int n )
Play( m_current_playlist );
state = osEnd;
- }
+ }
}
} break;
case 1:
@@ -579,7 +582,7 @@ eOSState mgMainMenu::TreeSubmenuAction( int n )
// undefined action
} break;
}
-
+
return state;
}
@@ -781,8 +784,8 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n )
// confirmation
#if VDRVERSNUM >= 10307
- Skins.Message(mtInfo,"Playlist renamed (dummy)");
- Skins.Flush();
+ Skins.Message(mtInfo,"Playlist renamed (dummy)");
+ Skins.Flush();
#else
Interface->Status( "Playlist renamed (dummy)" );
Interface->Flush();
@@ -793,21 +796,22 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n )
case 3:
{ // clear playlist
m_current_playlist->clear();
-
+
// confirmation
#if VDRVERSNUM >= 10307
- Skins.Message(mtInfo,"Playlist cleared");
- Skins.Flush();
+ Skins.Message(mtInfo,"Playlist cleared");
+ Skins.Flush();
#else
Interface->Status( "Playlist cleared" );
Interface->Flush();
#endif
-
+
state = osContinue;
} break;
case 4:
{ // remove selected title
- m_current_playlist->remove( m_last_osd_index );
+ bool res = m_current_playlist->remove( m_last_osd_index );
+
if( m_last_osd_index > 0 )
{
m_last_osd_index --;
@@ -815,11 +819,13 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n )
DisplayPlaylist( m_last_osd_index );
// confirmation
+ string confirm = res? "Entry deleted": "Cannot delete entry";
+
#if VDRVERSNUM >= 10307
- Skins.Message(mtInfo,"Entry removed");
- Skins.Flush();
+ Skins.Message( mtInfo, confirm.c_str() );
+ Skins.Flush();
#else
- Interface->Status( "Entry removed" );
+ Interface->Status( confirm.c_str() );
Interface->Flush();
#endif
} break;