mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
bookmark manager: only add bookmark if OK pressed
This commit is contained in:
committed by
svenhoefer
parent
66ec686568
commit
14999c7015
@@ -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) {
|
int CBookmarkManager::createBookmark (const std::string & url, const std::string & time) {
|
||||||
std::string bookmarkname;
|
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, "");
|
bookmarkname_input.exec(NULL, "");
|
||||||
// TODO: return -1 if no name was entered
|
if (bookmarkname_entered)
|
||||||
if (bookmarkname.empty()) return -1;
|
{
|
||||||
return createBookmark(bookmarkname, url, time);
|
bookmarkname_entered = false;
|
||||||
|
return createBookmark(bookmarkname, url, time);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
@@ -166,6 +169,7 @@ void CBookmarkManager::writeBookmarkFile() {
|
|||||||
|
|
||||||
CBookmarkManager::CBookmarkManager() : bookmarkfile ('\t')
|
CBookmarkManager::CBookmarkManager() : bookmarkfile ('\t')
|
||||||
{
|
{
|
||||||
|
bookmarkname_entered = false;
|
||||||
bookmarksmodified = false;
|
bookmarksmodified = false;
|
||||||
readBookmarkFile();
|
readBookmarkFile();
|
||||||
}
|
}
|
||||||
@@ -177,6 +181,15 @@ CBookmarkManager::~CBookmarkManager () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool CBookmarkManager::changeNotify(const neutrino_locale_t, void *)
|
||||||
|
{
|
||||||
|
bookmarkname_entered = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
//never used
|
//never used
|
||||||
int CBookmarkManager::getBookmarkCount(void) const {
|
int CBookmarkManager::getBookmarkCount(void) const {
|
||||||
|
@@ -63,7 +63,7 @@ class CBookmark
|
|||||||
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
|
|
||||||
class CBookmarkManager
|
class CBookmarkManager : public CChangeObserver
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::vector<CBookmark> bookmarks;
|
std::vector<CBookmark> bookmarks;
|
||||||
@@ -84,6 +84,7 @@ class CBookmarkManager
|
|||||||
|
|
||||||
|
|
||||||
//int bookmarkCount;
|
//int bookmarkCount;
|
||||||
|
bool bookmarkname_entered;
|
||||||
bool bookmarksmodified;
|
bool bookmarksmodified;
|
||||||
void readBookmarkFile();
|
void readBookmarkFile();
|
||||||
void writeBookmarkFile();
|
void writeBookmarkFile();
|
||||||
@@ -101,6 +102,7 @@ class CBookmarkManager
|
|||||||
public:
|
public:
|
||||||
CBookmarkManager();
|
CBookmarkManager();
|
||||||
~CBookmarkManager();
|
~CBookmarkManager();
|
||||||
|
bool changeNotify(const neutrino_locale_t, void *);
|
||||||
int createBookmark(const std::string & name, const std::string & url, const std::string & time);
|
int createBookmark(const std::string & name, const std::string & url, const std::string & time);
|
||||||
int createBookmark(const std::string & url, const std::string & time);
|
int createBookmark(const std::string & url, const std::string & time);
|
||||||
void removeBookmark(unsigned int index);
|
void removeBookmark(unsigned int index);
|
||||||
|
Reference in New Issue
Block a user