#include <locale.h>
#include <vconf.h>
#include <syspopup_caller.h>
+#include <notification.h>
#include "ss_log.h"
#include "sys_pci_noti.h"
-#define TICKERNOTI_LOCATION_TOP 0
+static void show_tickernoti(char *msg)
+{
+ if (!msg)
+ return;
+
+ notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+ noti_err = notification_status_message_post(gettext(msg));
+ if (noti_err != NOTIFICATION_ERROR_NONE)
+ PRT_TRACE_ERR("FAIL: notification_status_message_post(msg)");
+}
static void pci_noti(pci_noti_type iPCI)
{
char *lang;
char *r;
int ret = -1;
- bundle *b = NULL;
const int arrSize = 2;
char str_tickernoti[arrSize];
bindtextdomain("sys_pci_noti","/usr/share/system-server/sys_pci_noti/res/locale/");
textdomain("sys_pci_noti");
- b = bundle_create();
- if(b == NULL) {
- PRT_TRACE_ERR("FAIL: bundle_create()");
- return;
- }
- /* set tickernoti style */
- ret = bundle_add(b, "0", "info");
- if (ret != 0)
- goto BUNDLE_ADD_ERR;
-
- /* set tickernoti text */
if (iPCI == CB_NOTI_PCI_REMOVED)
- ret = bundle_add(b, "1", _("IDS_COM_POP_KEYBOARD_DISCONNECTED_ABB2"));
- else if (iPCI == CB_NOTI_PCI_INSERTED)
- ret = bundle_add(b, "1", _("IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"));
- if (ret != 0)
- goto BUNDLE_ADD_ERR;
- /* set tickernoti orientation */
- snprintf(str_tickernoti,arrSize,"%d",TICKERNOTI_LOCATION_TOP);
- ret = bundle_add(b, "2", str_tickernoti);
- if (ret != 0)
- goto BUNDLE_ADD_ERR;
-
- /* set tickernoti timeout */
- ret = bundle_add(b, "3", "3");
- if (ret != 0)
- goto BUNDLE_ADD_ERR;
-
- /* launch tickernoti */
- ret = syspopup_launch("tickernoti-syspopup", b);
- if (ret < 0)
- PRT_TRACE_ERR("FAIL: syspopup_launch()");
+ show_tickernoti(_("IDS_COM_POP_KEYBOARD_DISCONNECTED_ABB2"));
- if(bundle_free(b) != 0)
- PRT_TRACE_ERR("FAIL: bundle_free()");
- return;
-
-BUNDLE_ADD_ERR:
- PRT_TRACE_ERR("FAIL: bundle_add()");
- if (bundle_free(b) != 0)
- PRT_TRACE_ERR("FAIL: bundle_free()");
- return;
+ else if (iPCI == CB_NOTI_PCI_INSERTED)
+ show_tickernoti(_("IDS_COM_POP_KEYBOARD_CONNECTED_ABB2"));
}
+
int main(int argc, char *argv[])
{
int r = 0;