]> git.deb.at Git - pkg/abook.git/commitdiff
Fix launch functions to preserve curses settings
authorJaakko Heinonen <jheinonen@users.sourceforge.net>
Wed, 13 Jun 2001 10:15:09 +0000 (10:15 +0000)
committerJaakko Heinonen <jheinonen@users.sourceforge.net>
Wed, 13 Jun 2001 10:15:09 +0000 (10:15 +0000)
ChangeLog
abook.c
ui.c
ui.h

index 42dd5a16a87de350eb23459578fde15ac8412fe7..ecc103200b93c261260cf70b685c5b3e6fdd2e39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
  - text filter update
  - query/find code cleanup
  - fixed snprintf related bugs
+ - minor bugfixes
 
 0.4.12
  - added man page for abookrc (Alan Ford)
diff --git a/abook.c b/abook.c
index 9c42c08d802c87043eeea74922bafe436568672a..b79fcae0b2fad72537bcb29bd681f7f0dd9bdfdd 100644 (file)
--- a/abook.c
+++ b/abook.c
@@ -322,6 +322,11 @@ launch_mutt(int item)
 #endif
        system(cmd);    
        free(cmd);
+       
+       /*
+        * we need to make sure that curses settings are correct
+        */
+       ui_init_curses();
 }
 
 void
@@ -343,6 +348,11 @@ launch_wwwbrowser(int item)
                system(cmd);
 
        free(cmd);
+
+       /*
+        * we need to make sure that curses settings are correct
+        */
+       ui_init_curses();
 }
 
 void *
diff --git a/ui.c b/ui.c
index c706963f86e550e26adaf18edcecb7e08257742c..9a19df7d9bc036261efa032d857adbe430346272 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -124,14 +124,22 @@ is_ui_initialized()
        return ui_initialized;
 }
 
-
-int
-init_ui()
+void
+ui_init_curses()
 {
-       initscr(); cbreak(); noecho();
+       if(!is_ui_initialized())
+               initscr();
+       cbreak();
+       noecho();
        nonl();
        intrflush(stdscr, FALSE);
        keypad(stdscr, TRUE);
+}
+
+int
+init_ui()
+{
+       ui_init_curses();
 #ifdef DEBUG
         fprintf(stderr, "init_abook():\n");
         fprintf(stderr, "  COLS = %d, LINES = %d\n", COLS, LINES);
diff --git a/ui.h b/ui.h
index 0444e69f06c9eebd27ca0871e0812b5bd2783448..e312abd1d294bf813c8aab76940e236c4aea0f4f 100644 (file)
--- a/ui.h
+++ b/ui.h
@@ -9,6 +9,7 @@ enum {
 };
 
 int            is_ui_initialized();
+void           ui_init_curses();
 int            init_ui();
 void           close_ui();
 void           headerline(char *str);