pictureviewer: -add delete pic-file option

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1520 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 083fd6923f
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-06-05 (Sun, 05 Jun 2011)



------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2011-06-05 12:31:02 +00:00
parent 147d2c5818
commit e6e23d699b
4 changed files with 40 additions and 7 deletions

View File

@@ -164,8 +164,8 @@ audioplayer.building_search_index Erstelle Suchindex
audioplayer.button_select_title_by_id Suche n. ID
audioplayer.button_select_title_by_name Suche n. Name
audioplayer.defdir Start-Verz.
audioplayer.delete Löschen
audioplayer.deleteall Alle löschen
audioplayer.delete entfernen
audioplayer.deleteall Alle entfernen
audioplayer.display_order Anzeige
audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing
audioplayer.fastforward schneller Vorl.

View File

@@ -164,8 +164,8 @@ audioplayer.building_search_index building search index
audioplayer.button_select_title_by_id search by ID
audioplayer.button_select_title_by_name search by name
audioplayer.defdir start dir.
audioplayer.delete Delete
audioplayer.deleteall delete all
audioplayer.delete Remove
audioplayer.deleteall remove all
audioplayer.display_order display order
audioplayer.enable_sc_metadata enable shoutcast meta data parsing
audioplayer.fastforward fast forw.

View File

@@ -343,6 +343,21 @@ int CPictureViewerGui::show()
}
}
}
else if (msg == CRCInput::RC_spkr)
{
if (!playlist.empty())
{
if (m_state == MENU)
{
deletePicFile(selected, false);
update = true;
}
else{
deletePicFile(selected, true);
}
}
}
else if (msg == CRCInput::RC_ok)
{
if (!playlist.empty())
@@ -627,12 +642,13 @@ void CPictureViewerGui::paintHead()
}
//------------------------------------------------------------------------
const struct button_label PictureViewerButtons[4] =
const struct button_label PictureViewerButtons[5] =
{
{ NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE },
{ NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD },
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL },
{ NEUTRINO_ICON_BUTTON_BLUE , LOCALE_PICTUREVIEWER_SLIDESHOW }
{ NEUTRINO_ICON_BUTTON_BLUE , LOCALE_PICTUREVIEWER_SLIDESHOW },
{ NEUTRINO_ICON_BUTTON_MUTE_SMALL , LOCALE_FILEBROWSER_DELETE }
};
const struct button_label PictureViewerButtons2[][2] =
{
@@ -653,7 +669,7 @@ void CPictureViewerGui::paintFoot()
if (!playlist.empty())
{
::paintButtons(x, y + (height - 2 * buttonHeight), 0, 4, PictureViewerButtons);
::paintButtons(x, y + (height - 2 * buttonHeight), 0, 5, PictureViewerButtons);
::paintButtons(x, y + (height - buttonHeight), 0, 2, (m_sort==FILENAME)?PictureViewerButtons2[0]:PictureViewerButtons2[1]);
}
@@ -724,6 +740,22 @@ void CPictureViewerGui::endView()
m_state=MENU;
}
void CPictureViewerGui::deletePicFile(unsigned int index, bool mode)
{
CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str());
if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)
{
unlink(playlist[index].Filename.c_str());
printf("[ %s ] delete file: %s\r\n",__FUNCTION__,playlist[index].Filename.c_str());
CViewList::iterator p = playlist.begin()+index;
playlist.erase(p);
if(mode)
selected = selected-1;
if (selected >= playlist.size())
selected = playlist.size()-1;
}
}
void CPictureViewerGui::showHelp()
{
Helpbox helpbox;

View File

@@ -107,6 +107,7 @@ class CPictureViewerGui : public CMenuTarget
int show();
void showHelp();
void deletePicFile(unsigned int index, bool mode);
public:
CPictureViewerGui();