bookmark manager: only add bookmark if OK pressed

Origin commit data
------------------
Commit: 14999c7015
Author: Gaucho316 <Gaucho316@hotmail.com>
Date: 2015-03-16 (Mon, 16 Mar 2015)
This commit is contained in:
Gaucho316
2015-03-16 11:57:22 +01:00
committed by vanhofen
parent e08b1bf256
commit 72d126b228
2 changed files with 20 additions and 5 deletions

View File

@@ -84,11 +84,14 @@ inline int CBookmarkManager::createBookmark (const std::string & name, const std
int CBookmarkManager::createBookmark (const std::string & url, const std::string & time) {
std::string bookmarkname;
CStringInputSMS bookmarkname_input(LOCALE_MOVIEPLAYER_BOOKMARKNAME, &bookmarkname, 25, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-_");
CStringInputSMS bookmarkname_input(LOCALE_MOVIEPLAYER_BOOKMARKNAME, &bookmarkname, 25, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-_", this);
bookmarkname_input.exec(NULL, "");
// TODO: return -1 if no name was entered
if (bookmarkname.empty()) return -1;
return createBookmark(bookmarkname, url, time);
if (bookmarkname_entered)
{
bookmarkname_entered = false;
return createBookmark(bookmarkname, url, time);
}
return -1;
}
//------------------------------------------------------------------------
@@ -166,6 +169,7 @@ void CBookmarkManager::writeBookmarkFile() {
CBookmarkManager::CBookmarkManager() : bookmarkfile ('\t')
{
bookmarkname_entered = false;
bookmarksmodified = false;
readBookmarkFile();
}
@@ -177,6 +181,15 @@ CBookmarkManager::~CBookmarkManager () {
}
//------------------------------------------------------------------------
bool CBookmarkManager::changeNotify(const neutrino_locale_t, void *)
{
bookmarkname_entered = true;
return false;
}
//------------------------------------------------------------------------
#if 0
//never used
int CBookmarkManager::getBookmarkCount(void) const {