]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'meins/master'
authorAndre Noll <maan@systemlinux.org>
Mon, 19 Jan 2009 13:49:09 +0000 (14:49 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 19 Jan 2009 13:49:09 +0000 (14:49 +0100)
1  2 
gui.c

diff --combined gui.c
index 36d47994c073b6fda784086378d3ffbc47934dce,499845d9dadcdb6802b6ac49ab470d969729314c..0a8f081839b97f6b0aaaac7ce3cc9e3d2bc049d1
--- 1/gui.c
--- 2/gui.c
+++ b/gui.c
@@@ -1,5 -1,5 +1,5 @@@
  /*
-  * Copyright (C) 1998-2008 Andre Noll <maan@systemlinux.org>
+  * Copyright (C) 1998-2009 Andre Noll <maan@systemlinux.org>
   *
   * Licensed under the GPL v2. For licencing details see COPYING.
   */
@@@ -489,17 -489,19 +489,19 @@@ static int add_output_line(char *line, 
        return 1;
  }
  
+ static int loglevel;
  __printf_2_3 void para_log(int ll, const char *fmt,...)
  {
        int color;
        char *msg;
  
-       if (ll < conf.loglevel_arg || !curses_active)
+       if (ll < loglevel || !curses_active)
                return;
        switch (ll) {
-               case DEBUG:
-               case INFO:
-               case NOTICE:
+               case LL_DEBUG:
+               case LL_INFO:
+               case LL_NOTICE:
                        color = COLOR_MSG;
                        break;
                default:
@@@ -562,8 -564,7 +564,7 @@@ __noreturn __printf_2_3 static void msg
  
  static void print_welcome(void)
  {
-       int ll = conf.loglevel_arg;
-       if (ll > NOTICE)
+       if (loglevel > LL_NOTICE)
                return;
        outputf(COLOR_WELCOME, "Welcome to para_gui " PACKAGE_VERSION
                " \"" CODENAME "\". Theme: %s", theme.name);
@@@ -1168,24 -1169,24 +1169,24 @@@ err_out
  
  static void com_ll_decr(void)
  {
-       if (conf.loglevel_arg <= DEBUG) {
+       if (loglevel <= LL_DEBUG) {
                print_in_bar(COLOR_ERRMSG,
                        "loglevel already at maximal verbosity\n");
                return;
        }
-       conf.loglevel_arg--;
-       print_in_bar(COLOR_MSG, "loglevel set to %d\n", conf.loglevel_arg);
+       loglevel--;
+       print_in_bar(COLOR_MSG, "loglevel set to %d\n", loglevel);
  }
  
  static void com_ll_incr(void)
  {
-       if (conf.loglevel_arg >= EMERG) {
+       if (loglevel >= LL_EMERG) {
                print_in_bar(COLOR_ERRMSG,
 -                      "loglevel already at miminal verbosity\n");
 +                      "loglevel already at minimal verbosity\n");
                return;
        }
-       conf.loglevel_arg++;
-       print_in_bar(COLOR_MSG, "loglevel set to %d\n", conf.loglevel_arg);
+       loglevel++;
+       print_in_bar(COLOR_MSG, "loglevel set to %d\n", loglevel);
  }
  
  /*
@@@ -1391,6 -1392,7 +1392,7 @@@ int main(int argc, char *argv[]
                };
                gui_cmdline_parser_config_file(cf, &conf, &params);
        }
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        if (check_key_map_args() < 0) {
                fprintf(stderr, "invalid key map in config file\n");
                exit(EXIT_FAILURE);