summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2007-05-31 19:24:57 +0000
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2007-05-31 19:24:57 +0000
commit4a7724fb059e41e997958ff32a033b2741fbb304 (patch)
tree1c2b0c008057bcf82c583f9316d8f439ca16db49
parent32f43f75311d369ffc7b1eff354703e4039dd8a7 (diff)
downloadvdr-plugin-live-4a7724fb059e41e997958ff32a033b2741fbb304.tar.gz
vdr-plugin-live-4a7724fb059e41e997958ff32a033b2741fbb304.tar.bz2
- configurable start page
-rw-r--r--i18n.cpp22
-rw-r--r--pages/login.ecpp2
-rw-r--r--pages/setup.ecpp17
-rw-r--r--setup.cpp16
-rw-r--r--setup.h4
5 files changed, 60 insertions, 1 deletions
diff --git a/i18n.cpp b/i18n.cpp
index 3cb2f99..1b71623 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -4033,6 +4033,28 @@ const tI18nPhrase Phrases[] = {
"", // Dansk
"", // Czech
},
+ { "Start page", // English
+ "Startseite", // Deutsch
+ "", // Slovenski
+ "", // Italiano
+ "", // Nederlands
+ "", // Português
+ "", // Français
+ "", // Norsk
+ "", // Finnish
+ "", // Polski
+ "", // Español
+ "", // Greek
+ "", // Svenska
+ "", // Românã
+ "", // Magyar
+ "", // Català
+ "", // Russian
+ "", // Hrvatski
+ "", // Eesti
+ "", // Dansk
+ "", // Czech
+ },
/*
{ "", // English
"", // Deutsch
diff --git a/pages/login.ecpp b/pages/login.ecpp
index 7462a59..20624a8 100644
--- a/pages/login.ecpp
+++ b/pages/login.ecpp
@@ -28,7 +28,7 @@ if (action == "login") {
logged_in = false;
}
-if (logged_in || !LiveSetup().UseAuth()) return reply.redirect("whats_on.html");
+if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetStartScreenLink());
}>
<& pageelems.doc_type &>
diff --git a/pages/setup.ecpp b/pages/setup.ecpp
index a95f55d..1650211 100644
--- a/pages/setup.ecpp
+++ b/pages/setup.ecpp
@@ -12,6 +12,7 @@ using namespace std;
string login;
string pass;
string times;
+ string startscreen;
</%args>
<%session scope="global">
bool logged_in(false);
@@ -21,6 +22,8 @@ bool logged_in(false);
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
}>
<%cpp>
+#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" );
+
if ( request.getMethod() == "POST") {
LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0);
LiveSetup().SetUseAuth(useauth);
@@ -30,6 +33,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
LiveSetup().SetAdminPassword(pass);
}
LiveSetup().SetTimes(times);
+ LiveSetup().SetStartScreen(startscreen);
LiveSetup().SaveSetup();
}
pageTitle = tr("Setup");
@@ -42,6 +46,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
login = LiveSetup().GetAdminLogin();
useauth = LiveSetup().UseAuth();
times = LiveSetup().GetTimes();
+ startscreen = LiveSetup().GetStartScreen();
</%cpp>
<& pageelems.doc_type &>
@@ -106,6 +111,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</tr>
<tr>
<td class="border" style="border-left: 1px solid black"></td>
+ <td class="label"><$ tr("Start page") $>:</td>
+ <td><select name="startscreen" size="1" id="startscreen">
+ <option value="whatsonnow" <{ SELECTIF(startscreen == "whatsonnow") }>><$ tr("What's on now?") $></option>
+ <option value="whatsonnext" <{ SELECTIF(startscreen == "whatsonnext") }>><$ tr("What's on next?") $></option>
+ <option value="schedule" <{ SELECTIF(startscreen == "schedule") }>><$ tr("Schedule") $></option>
+ <option value="recordings" <{ SELECTIF(startscreen == "recordings") }>><$ tr("Recordings") $></option>
+ <option value="timers" <{ SELECTIF(startscreen == "timers") }>><$ tr("Timers") $></option>
+ </select></td>
+ <td class="border" style="border-right: 1px solid black"></td>
+ </tr>
+ <tr>
+ <td class="border" style="border-left: 1px solid black"></td>
<td class="buttonpanel" colspan="2">
<button class="green" type="submit" name="save" onclick="return checksearch();"><$ tr("Save") $></button>
</td>
diff --git a/setup.cpp b/setup.cpp
index 0b5a5c8..402bc6a 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -74,6 +74,7 @@ bool Setup::ParseSetupEntry( char const* name, char const* value )
else if ( strcmp( name, "AdminLogin" ) == 0 ) m_adminLogin = value;
else if ( strcmp( name, "AdminPasswordMD5" ) == 0 ) m_adminPasswordMD5 = value;
else if ( strcmp( name, "UserdefTimes" ) == 0 ) m_times = value;
+ else if ( strcmp( name, "StartPage" ) == 0 ) m_startscreen = value;
else return false;
return true;
}
@@ -132,6 +133,20 @@ std::string Setup::SetAdminPassword(std::string password)
return m_adminPasswordMD5;
}
+std::string Setup::GetStartScreenLink() const
+{
+ if (m_startscreen == "whatsonnext")
+ return "whats_on.html?type=next";
+ else if (m_startscreen == "schedule")
+ return "schedule.html";
+ else if (m_startscreen == "timers")
+ return "timers.html";
+ else if (m_startscreen == "recordings")
+ return "recordings.html";
+ else
+ return "whats_on.html?type=now";
+}
+
bool Setup::SaveSetup()
{
if (!liveplugin) return false;
@@ -143,6 +158,7 @@ bool Setup::SaveSetup()
liveplugin->SetupStore("AdminPasswordMD5", m_adminPasswordMD5.c_str());
}
liveplugin->SetupStore("UserdefTimes", m_times.c_str());
+ liveplugin->SetupStore("StartPage", m_startscreen.c_str());
return true;
}
diff --git a/setup.h b/setup.h
index 32512e4..3a78df1 100644
--- a/setup.h
+++ b/setup.h
@@ -36,6 +36,8 @@ public:
int GetAdminPasswordLength() const;
bool UseAuth() const { return m_useAuth; }
std::string GetTimes() const { return m_times; }
+ std::string GetStartScreen() const { return m_startscreen; }
+ std::string GetStartScreenLink() const;
void SetLastChannel(int lastChannel) { m_lastChannel = lastChannel; }
void SetAdminLogin(std::string login) { m_adminLogin = login; }
@@ -43,6 +45,7 @@ public:
void SetUseAuth(int auth) { m_useAuth = auth; }
void SetScrenshotInterval(int interval) { m_screenshotInterval = interval; }
void SetTimes(std::string times) { m_times = times; }
+ void SetStartScreen(std::string startscreen) { m_startscreen = startscreen; }
bool SaveSetup();
@@ -70,6 +73,7 @@ private:
std::string m_adminLogin;
std::string m_adminPasswordMD5;
std::string m_times;
+ std::string m_startscreen;
bool CheckServerPort();
bool CheckServerIps();