]> git.deb.at Git - pkg/abook.git/blobdiff - edit.c
* Added a string as translatable (reported by C. Stazzone).
[pkg/abook.git] / edit.c
diff --git a/edit.c b/edit.c
index f5e05845e8022e1abc94f20e4845815a5aa0c8d9..3da07caba0880060e08b2fec3d85d2a65ba3eb4a 100644 (file)
--- a/edit.c
+++ b/edit.c
  * some extern variables
  */
 
-
-extern int curitem;
 extern int views_count;
-extern int items;
 
 WINDOW *editw;
 
@@ -51,10 +48,7 @@ editor_tab(const int tab)
                int width = strwidth(tab_name) + 5;
 
                if(x_pos + width + 1 > EDITW_COLS) {
-                       statusline_msg(_("Tab name too wide for screen"));
-                       /* Disabling this field */
-                       /* TODO should be recomputed on window resize */
-                       views_count--;
+                       statusline_addstr(_("Tab name too wide for screen"));
                        break;
                }
 
@@ -513,17 +507,17 @@ edit_loop(int item)
 void
 edit_item(int item)
 {
-       if( item < 0 ) {
-               if( curitem < 0 )
+       if(item < 0) {
+               if(list_get_curitem() < 0)
                        return;
                else
-                       item = curitem;
+                       item = list_get_curitem();
        }
 
        init_editor();
 
        while((item = edit_loop(item)) >= 0)
-               curitem = item; /* hmm, this is not very clean way to go */
+               list_set_curitem(item); /* this is not very clean way to go */
 
        close_editor();
 }
@@ -534,7 +528,7 @@ add_item()
        char *field = NULL;
        list_item item = item_create();
 
-       change_field("Name: ", &field, MAX_FIELD_LEN);
+       change_field(_("Name: "), &field, MAX_FIELD_LEN);
 
        if( field == NULL )
                return;
@@ -544,8 +538,8 @@ add_item()
        add_item2database(item);
        item_free(&item);
 
-       curitem = LAST_ITEM;
+       list_set_curitem(last_item());
 
-       edit_item(LAST_ITEM);
+       edit_item(last_item());
 }