From ecb186b43cc0b4da6d06bbd21706e51abd975dff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Dec 2014 00:32:30 +0100 Subject: [PATCH] CFile: add filetypes for install and update packages Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7ada20de641b4c5be824ab764239e5c36753ff81 Author: Thilo Graf Date: 2014-12-21 (Sun, 21 Dec 2014) --- src/driver/file.cpp | 16 ++++++++-------- src/driver/file.h | 4 +++- src/gui/opkg_manager.cpp | 6 +++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/driver/file.cpp b/src/driver/file.cpp index 0d16b37bb..ce4c809f5 100644 --- a/src/driver/file.cpp +++ b/src/driver/file.cpp @@ -42,21 +42,21 @@ /* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ const char * const file_extension_list[] = { - "aac", "asf", "avi", "bmp", "cdr", "crw", - "dts", "flac", "flv", "gif", "imu", "iso", "jpeg", "jpg", + "aac", "asf", "avi", "bin", "bmp", "cdr", "crw", + "dts", "flac", "flv", "gif", "imu", "ipk", "iso", "jpeg", "jpg", "m2a", "m3u", "m3u8", "m4a", "mkv", "mp2", "mp3", - "mpa", "ogg", "pls", "png", "sh", + "mpa", "ogg", "opk", "pls", "png", "sh", "txt", "url", "wav", "xml" }; /* ATTENTION: the array file_extension_list MUST BE SORTED ASCENDING (cf. sort, man bsearch) - otherwise bsearch will not work correctly! */ const CFile::FileType file_type_list[] = { - CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , - CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_FLV , CFile::FILE_PICTURE , CFile::STREAM_PICTURE, CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , - CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , - CFile::FILE_MP3 , CFile::FILE_OGG , CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , - CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_WAV , CFile::FILE_XML + CFile::FILE_AAC , CFile::FILE_ASF , CFile::FILE_AVI , CFile::FILE_BIN_PACKAGE ,CFile::FILE_PICTURE , CFile::FILE_CDR , CFile::FILE_PICTURE , + CFile::FILE_WAV , CFile::FILE_FLAC , CFile::FILE_FLV , CFile::FILE_PICTURE , CFile::STREAM_PICTURE , CFile::FILE_PKG_PACKAGE ,CFile::FILE_ISO , CFile::FILE_PICTURE , CFile::FILE_PICTURE , + CFile::FILE_MP3 , CFile::FILE_PLAYLIST , CFile::FILE_PLAYLIST , CFile::FILE_AAC , CFile::FILE_MKV , CFile::FILE_MP3 , CFile::FILE_MP3 , + CFile::FILE_MP3 , CFile::FILE_OGG , CFile::FILE_PKG_PACKAGE, CFile::FILE_PLAYLIST , CFile::FILE_PICTURE , CFile::FILE_TEXT , + CFile::FILE_TEXT , CFile::STREAM_AUDIO , CFile::FILE_WAV , CFile::FILE_XML }; int mycasecmp(const void * a, const void * b) diff --git a/src/driver/file.h b/src/driver/file.h index 987886d29..b26e52475 100644 --- a/src/driver/file.h +++ b/src/driver/file.h @@ -71,7 +71,9 @@ class CFile FILE_PLAYLIST, STREAM_AUDIO, FILE_PICTURE, - STREAM_PICTURE + STREAM_PICTURE, + FILE_BIN_PACKAGE, + FILE_PKG_PACKAGE }; FileType getType(void) const; diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 1476ec05e..192d5116b 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -429,11 +429,11 @@ int COPKGManager::showMenu() */ //restart neutrino: user decision if(!access( "/tmp/.restart", F_OK)){ - int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMsgBox::mbrNo, - CMsgBox::mbYesNo, + int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMessageBox::mbrNo, + CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION, width); - if (msg == CMsgBox::mbrYes) + if (msg == CMessageBox::mbrYes) exit_action = "restart"; } //restart neutrino: forced