commit 4a61296f576a5c6b2968297fab9db4687a7b4213
parent a830f495bc4b35910554b2b4a02ddaae69522949
Author: Claudio Alessi <smoppy@gmail.com>
Date: Wed, 13 Apr 2016 21:38:35 +0200
Get choice in newaview()
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/myadm.c b/myadm.c
@@ -485,6 +485,7 @@ newaview(const char *name, void (*func)(void)) {
v = ecalloc(1, sizeof(View));
v->mode = ecalloc(1, sizeof(Mode));
v->mode->name = ecalloc(strlen(name)+1, sizeof(char));
+ v->choice = cloneitem(getitem(0));
strcpy(v->mode->name, name);
v->mode->func = func;
attach(v);
@@ -675,7 +676,6 @@ viewdb(const Arg *arg) {
View *v;
v = newaview("tables", viewdb_show);
- v->choice = cloneitem(getitem(0));
if(!(v->choice && v->choice->ncols)) {
ui_set("status", "No database selected.");
return;
@@ -733,7 +733,6 @@ viewtable(const Arg *arg) {
View *v;
v = newaview("records", viewtable_show);
- v->choice = cloneitem(getitem(0));
if(!(v->choice && v->choice->ncols)) {
ui_set("status", "No table selected.");
return;