decrease minimal gtk requirement to 2.22
[psensor.git] / src / main.c
index 6e0ded5..d2d7e8b 100644 (file)
@@ -40,6 +40,7 @@
 #include "lmsensor.h"
 #include "ui_pref.h"
 #include "ui_graph.h"
+#include "ui_status.h"
 
 #ifdef HAVE_UNITY
 #include "ui_unity.h"
@@ -57,9 +58,7 @@
 #include "rsensor.h"
 #endif
 
-#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
 #include "ui_appindicator.h"
-#endif
 
 #ifdef HAVE_LIBNOTIFY
 #include "ui_notify.h"
@@ -73,7 +72,7 @@
 
 static const char *program_name;
 
-void print_version()
+static void print_version()
 {
        printf("psensor %s\n", VERSION);
        printf(_("Copyright (C) %s jeanfi@gmail.com\n\
@@ -84,7 +83,7 @@ There is NO WARRANTY, to the extent permitted by law.\n"),
               "2010-2011");
 }
 
-void print_help()
+static void print_help()
 {
        printf(_("Usage: %s [OPTION]...\n"), program_name);
 
@@ -314,7 +313,7 @@ static void log_init()
        path = malloc(strlen(dir)+1+strlen("log")+1);
        sprintf(path, "%s/%s", dir, "log");
 
-       log_open(path, LOG_INFO);
+       log_open(path);
 
        free(dir);
        free(path);
@@ -421,6 +420,8 @@ int main(int argc, char **argv)
        associate_colors(ui.sensors);
        associate_cb_alarm_raised(ui.sensors, &ui);
 
+       ui_status_init(&ui);
+
        /* main window */
        ui_window_create(&ui);
        ui.sensor_box = NULL;
@@ -462,10 +463,19 @@ int main(int argc, char **argv)
 #ifdef HAVE_LIBATIADL
        amd_cleanup();
 #endif
+#ifdef HAVE_REMOTE_SUPPORT
+       rsensor_cleanup();
+#endif
 
        psensor_list_free(ui.sensors);
        ui.sensors = NULL;
 
+#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
+       ui_appindicator_cleanup();
+#endif
+
+       ui_status_cleanup();
+
        g_mutex_unlock(ui.sensors_mutex);
 
        config_cleanup();