mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
Merge remote-tracking branch 'uncool/cst-next'
This need buildfixes and some functional updates...
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <neutrino.h>
|
||||
|
||||
#include <system/settings.h>
|
||||
#include <driver/display.h>
|
||||
#include <driver/screen_max.h>
|
||||
#include <driver/display.h>
|
||||
#include <gui/components/cc.h>
|
||||
@@ -84,11 +85,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;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -140,8 +144,6 @@ void CBookmarkManager::readBookmarkFile() {
|
||||
bookmarks.push_back(CBookmark(bookmarkname, bookmarkurl, bookmarktime));
|
||||
}
|
||||
}
|
||||
else
|
||||
bookmarkfile.clear();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -149,6 +151,7 @@ void CBookmarkManager::writeBookmarkFile() {
|
||||
|
||||
printf("CBookmarkManager: Writing bookmark file\n");
|
||||
|
||||
bookmarkfile.clear();
|
||||
unsigned int bookmarkcount = 0;
|
||||
for (std::vector<CBookmark>::const_iterator it = bookmarks.begin(); it != bookmarks.end(); ++it, bookmarkcount++)
|
||||
{
|
||||
@@ -159,12 +162,15 @@ void CBookmarkManager::writeBookmarkFile() {
|
||||
}
|
||||
bookmarkfile.setInt32("bookmarkcount", bookmarks.size());
|
||||
bookmarkfile.saveConfig(BOOKMARKFILE);
|
||||
|
||||
bookmarksmodified = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
CBookmarkManager::CBookmarkManager() : bookmarkfile ('\t')
|
||||
{
|
||||
bookmarkname_entered = false;
|
||||
bookmarksmodified = false;
|
||||
readBookmarkFile();
|
||||
}
|
||||
@@ -176,6 +182,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 {
|
||||
@@ -210,7 +225,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent)
|
||||
visible = false;
|
||||
selected = 0;
|
||||
// Max
|
||||
width = w_max( 90, 10 );
|
||||
width = 90;
|
||||
footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //initial height value for buttonbar
|
||||
theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
||||
|
Reference in New Issue
Block a user