Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: Add quick tips configuration to the general config
  • Loading branch information
perexg committed Dec 5, 2015
1 parent 130c903 commit a3906ce
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/config.c
Expand Up @@ -1626,6 +1626,7 @@ config_boot ( const char *path, gid_t gid, uid_t uid )

memset(&config, 0, sizeof(config));
config.idnode.in_class = &config_class;
config.ui_quicktips = 1;
config.wizard = strdup("hello");
config.info_area = strdup("login,storage,time");
config.cookie_expires = 7;
Expand Down Expand Up @@ -1992,6 +1993,15 @@ const idclass_t config_class = {
.opts = PO_ADVANCED,
.group = 1
},
{
.type = PT_BOOL,
.id = "ui_quicktips",
.name = N_("User interface quick tips"),
.desc = N_("Allow to show the quick tips for the form fields."),
.off = offsetof(config_t, ui_quicktips),
.opts = PO_ADVANCED,
.group = 1
},
{
.type = PT_U32,
.id = "cookie_expires",
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Expand Up @@ -32,6 +32,7 @@ typedef struct config {
uint32_t version;
int uilevel;
int uilevel_nochange;
int ui_quicktips;
char *wizard;
char *full_version;
char *server_name;
Expand Down
1 change: 1 addition & 0 deletions src/webui/comet.c
Expand Up @@ -166,6 +166,7 @@ comet_access_update(http_connection_t *hc, comet_mailbox_t *cmb)
if (config.uilevel_nochange)
htsmsg_add_u32(m, "uilevel_nochange", config.uilevel_nochange);
}
htsmsg_add_u32(m, "quicktips", config.ui_quicktips);
if (!access_noacl)
htsmsg_add_str(m, "username", username);
if (hc->hc_peer_ipstr)
Expand Down
2 changes: 1 addition & 1 deletion src/webui/static/app/idnode.js
Expand Up @@ -635,7 +635,7 @@ tvheadend.idnode_editor_field = function(f, conf)
value = f['default'];

function postfield(r, f) {
if (f.description) {
if (f.description && tvheadend.quicktips) {
r.on('render', function(c) {
Ext.QuickTips.register({
target: c.getEl(),
Expand Down
3 changes: 3 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -5,6 +5,7 @@ tvheadend.admin = false;
tvheadend.dialog = null;
tvheadend.uilevel = 'expert';
tvheadend.uilevel_nochange = false;
tvheadend.quicktips = true;
tvheadend.wizard = null;

tvheadend.cookieProvider = new Ext.state.CookieProvider({
Expand Down Expand Up @@ -424,6 +425,8 @@ function accessUpdate(o) {

if (o.uilevel)
tvheadend.uilevel = o.uilevel;

tvheadend.quicktips = o.quicktips;

if (o.uilevel_nochange)
tvheadend.uilevel_nochange = true;
Expand Down

0 comments on commit a3906ce

Please sign in to comment.