Improve shutdown handling, keep shutdown clients around afterwards
[profile/ivi/node-startup-controller.git] / common / nsm-enum-types.c
1 /* vi:set et ai sw=2 sts=2 ts=2: */
2 /* -
3  * Copyright (c) 2012 GENIVI.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13
14 #include <glib/gi18n.h>
15 #include <glib-object.h>
16
17 #include <common/nsm-enum-types.h>
18
19
20
21 GType
22 nsm_shutdown_type_get_type (void)
23 {
24   GType type = G_TYPE_INVALID;
25
26   if (G_UNLIKELY (type == G_TYPE_INVALID))
27     {
28       static const GEnumValue values[] =
29       {
30         { NSM_SHUTDOWN_TYPE_NOT,    "NSM_SHUTDOWN_TYPE_NOT",    N_ ("No shutdown"),        },
31         { NSM_SHUTDOWN_TYPE_NORMAL, "NSM_SHUTDOWN_TYPE_NORMAL", N_ ("Normal shutdown"),    },
32         { NSM_SHUTDOWN_TYPE_FAST,   "NSM_SHUTDOWN_TYPE_FAST",   N_ ("Fast shutdown"),      },
33         { NSM_SHUTDOWN_TYPE_RUNUP,  "NSM_SHUTDOWN_TYPE_RUNUP",  N_ ("Shutdown cancelled"), },
34         { 0 ,                       NULL,                       NULL,                      },
35       };
36
37       type = g_enum_register_static ("NSMShutdownType", values); 
38     }
39   return type;
40 }
41
42
43
44 GType
45 nsm_error_status_get_type (void)
46 {
47   GType type = G_TYPE_INVALID;
48
49   if (G_UNLIKELY (type == G_TYPE_INVALID))
50     {
51       static const GEnumValue values[] =
52       {
53         { NSM_ERROR_STATUS_NOT_SET,          "NSM_ERROR_STATUS_NOT_SET",          N_ ("Error not set"),           },
54         { NSM_ERROR_STATUS_OK,               "NSM_ERROR_STATUS_OK",               N_ ("No error"),                },
55         { NSM_ERROR_STATUS_ERROR,            "NSM_ERROR_STATUS_ERROR",            N_ ("Non-specific error"),      },
56         { NSM_ERROR_STATUS_DBUS,             "NSM_ERROR_STATUS_DBUS",             N_ ("Dbus comunication error"), },
57         { NSM_ERROR_STATUS_INTERNAL,         "NSM_ERROR_STATUS_INTERNAL",         N_ ("Internal error"),          },
58         { NSM_ERROR_STATUS_PARAMETER,        "NSM_ERROR_STATUS_PARAMETER",        N_ ("Parameter wrong"),         },
59         { NSM_ERROR_STATUS_WRONG_SESSION,    "NSM_ERROR_STATUS_WRONG_SESSION",    N_ ("Unknown session"),         },
60         { NSM_ERROR_STATUS_RESPONSE_PENDING, "NSM_ERROR_STATUS_RESPONSE_PENDING", N_ ("Reponse pending"),         },
61         { NSM_ERROR_STATUS_LAST,             "NSM_ERROR_STATUS_LAST",             N_ ("Last error"),              },
62         { 0 ,                                NULL,                                NULL,                           },
63       };
64
65       type = g_enum_register_static ("NSMErrorStatus", values);
66     }
67   return type;
68 }