~ubuntu-branches/ubuntu/lucid/whowatch/lucid

« back to all changes in this revision

Viewing changes to src/menu.c

  • Committer: Bazaar Package Importer
  • Author(s): KELEMEN Péter
  • Date: 2004-08-14 21:12:18 UTC
  • Revision ID: james.westby@ubuntu.com-20040814211218-d2h0pa5c27osnf1f
Tags: 1.6.0-5
* Fixed ctime() prototype. (Closes: #226683)
* Fixed gcc-3.4 parse errors. (Closes: #264261)
* debian/copyright
  - Fixed lintian warning.
* debian/menu
  - Fixed lintian warning.
* debian/control
  - Standards-Version: 3.6.1
  - Fixed Build-Depends: field.
  - Fixed Description: field.
* debian/changelog
  - UTF-8 encoding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        static int pos = TITLE_START;
75
75
        
76
76
        t = calloc(1, sizeof *t);
77
 
        if(!t) prg_exit(__FUNCTION__": cannot allocate memory.");
 
77
        if(!t) prg_exit("add_submenu: cannot allocate memory.");
78
78
        t->title = s;
79
79
        INIT_LIST_HEAD(&t->items);
80
80
        list_add(&t->l_menu, &menu.submenus);
101
101
        static unsigned short longest;
102
102
        int len = strlen(i->name);// + strlen(i->descr) + 1;
103
103
        if(!(t = find_submenu(title))) {
104
 
//dolog(__FUNCTION__ ": cannot find title %s\n", title);
 
104
//dolog("%s: cannot find title %s\n", __func__, title);
105
105
                return;
106
106
        }
107
107
        if(len > longest) longest = len;
108
 
//dolog(__FUNCTION__": %d %d %d\n", longest, strlen(i->descr), t->cols);        
 
108
//dolog("%s: %d %d %d\n", __func__, longest, strlen(i->descr), t->cols);        
109
109
        if(longest + strlen(i->descr) + 3 > t->cols) 
110
110
                t->cols = 3 + longest + strlen(i->descr);
111
111
        if(!t->rows) t->rows = 3; /* make space for a border line */
193
193
{
194
194
        set_size();
195
195
        menu.wd = newpad(1, menu.cols);
196
 
        if(!menu.wd) prg_exit(__FUNCTION__ ": Cannot allocate memory.");
 
196
        if(!menu.wd) prg_exit("menu_create: Cannot allocate memory.");
197
197
        wbkgd(menu.wd, COLOR_PAIR(9));
198
198
//      overwrite(info_win.wd, menu.wd);
199
199
        werase(menu.wd);
276
276
                return 1;
277
277
        }
278
278
        if(!menu.wd) return 0;
279
 
dolog(__FUNCTION__"submenu_wd %p\n", submenu_wd);       
 
279
dolog("%s submenu_wd %p\n", __func__, submenu_wd);      
280
280
        switch(key) {
281
281
        case KBD_ESC:
282
282
                menu_destroy();
291
291
                if(!submenu_show()) return 1; 
292
292
                if(change_item(cur_item->l_submenu.prev))
293
293
                        highlight_item(cur_submenu, 1);
294
 
                dolog(__FUNCTION__": cur item %s\n", cur_item->name);
 
294
                dolog("%s: cur item %s\n", __func__, cur_item->name);
295
295
                break;  
296
296
        case KBD_UP:
297
297
                if(!submenu_show()) return 1; 
308
308
                menu_destroy();
309
309
                break;
310
310
        default: 
311
 
dolog(__FUNCTION__": [%d] skipped\n", key);
 
311
dolog("%s: [%d] skipped\n", __func__, key);
312
312
                return KEY_HANDLED;
313
313
        }
314
 
dolog(__FUNCTION__":[%d] accepted\n", key);
 
314
dolog("%s:[%d] accepted\n", __func__, key);
315
315
        return KEY_HANDLED;
316
316
}
317
317