Script Warlock
August 4th, 2011, 07:12 AM
can anyone help me on this:
void
ClientWin::dispMessage(FXString &msgstr, int timeout)
{
//FXMessageBox::information(getRoot(),
// MBOX_OK,_("Admin Message!"), msgstr.text());
#ifdef HAVE_NOTIFICATION
NotifyNotification* notification;
gboolean success = true;
GError* error = NULL;
//if (notify_init ("mkahawa-client"))
{
notify_init("mkahawa-client");
/* try the mkahawa-client notification */
notification = notify_notification_new (
"Message from Cyber Admin:",
msgstr.text(),
"/usr/share/pixmaps/mkahawa-icon.png",
NULL);
error = NULL;
notify_notification_set_timeout(notification, timeout * 1000);
success = notify_notification_show (notification, &error);
notify_uninit();
}
if (!success)
{
//use alternative
#endif
FXDialogBox dialog(getRoot(),_("Admin Message"));
FXLabel lbl1(&dialog,_("Message from Administrator"));
FXLabel lbl2(&dialog, msgstr);
FXVerticalFrame *vframe =
new FXVerticalFrame(&dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,0,0,0,0,0,0 ,0,0);
FXHorizontalFrame *hframe =
new FXHorizontalFrame(vframe,LAYOUT_FILL_X|LAYOUT_FILL _Y);
FXButton okbtn(hframe,_(" Ok "),NULL,&dialog,FXDialogBox::ID_ACCEPT,
LAYOUT_TOP|LAYOUT_CENTER_X);
okbtn.setWidth(100);
if (dialog.execute(PLACEMENT_SCREEN)){
// do nothing
}
#ifdef HAVE_NOTIFICATION
}
#endif
}
and the result is:
** (process:1668): CRITICAL **: dbux_g_proxy_disconnect: assertion 'DBUS_G_PROXY_DISTROYED (proxy)' failed
i have a video (http://www.youtube.com/watch?v=5q0aeDJMdH8) clip that demos the result starting at 6:40
void
ClientWin::dispMessage(FXString &msgstr, int timeout)
{
//FXMessageBox::information(getRoot(),
// MBOX_OK,_("Admin Message!"), msgstr.text());
#ifdef HAVE_NOTIFICATION
NotifyNotification* notification;
gboolean success = true;
GError* error = NULL;
//if (notify_init ("mkahawa-client"))
{
notify_init("mkahawa-client");
/* try the mkahawa-client notification */
notification = notify_notification_new (
"Message from Cyber Admin:",
msgstr.text(),
"/usr/share/pixmaps/mkahawa-icon.png",
NULL);
error = NULL;
notify_notification_set_timeout(notification, timeout * 1000);
success = notify_notification_show (notification, &error);
notify_uninit();
}
if (!success)
{
//use alternative
#endif
FXDialogBox dialog(getRoot(),_("Admin Message"));
FXLabel lbl1(&dialog,_("Message from Administrator"));
FXLabel lbl2(&dialog, msgstr);
FXVerticalFrame *vframe =
new FXVerticalFrame(&dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,0,0,0,0,0,0 ,0,0);
FXHorizontalFrame *hframe =
new FXHorizontalFrame(vframe,LAYOUT_FILL_X|LAYOUT_FILL _Y);
FXButton okbtn(hframe,_(" Ok "),NULL,&dialog,FXDialogBox::ID_ACCEPT,
LAYOUT_TOP|LAYOUT_CENTER_X);
okbtn.setWidth(100);
if (dialog.execute(PLACEMENT_SCREEN)){
// do nothing
}
#ifdef HAVE_NOTIFICATION
}
#endif
}
and the result is:
** (process:1668): CRITICAL **: dbux_g_proxy_disconnect: assertion 'DBUS_G_PROXY_DISTROYED (proxy)' failed
i have a video (http://www.youtube.com/watch?v=5q0aeDJMdH8) clip that demos the result starting at 6:40