Add new client interface for activating the settings daemon if its not
2002-03-10 Seth Nickell <snickell@stanford.edu> * Makefile.am: * activate-settings-daemon.c: (popup_error_message), (activate_settings_daemon): * activate-settings-daemon.h: Add new client interface for activating the settings daemon if its not already running.
This commit is contained in:
parent
8717066fbd
commit
006261e341
4 changed files with 74 additions and 0 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2002-03-10 Seth Nickell <snickell@stanford.edu>
|
||||||
|
|
||||||
|
* Makefile.am:
|
||||||
|
* activate-settings-daemon.c: (popup_error_message),
|
||||||
|
(activate_settings_daemon):
|
||||||
|
* activate-settings-daemon.h:
|
||||||
|
|
||||||
|
Add new client interface for activating the settings daemon
|
||||||
|
if its not already running.
|
||||||
|
|
||||||
2002-02-27 Kjartan Maraas <kmaraas@gnome.org>
|
2002-02-27 Kjartan Maraas <kmaraas@gnome.org>
|
||||||
|
|
||||||
* capplet-util.c: s/PACKAGE/GETTEXT_PACKAGE/g
|
* capplet-util.c: s/PACKAGE/GETTEXT_PACKAGE/g
|
||||||
|
|
|
@ -10,6 +10,7 @@ INCLUDES = \
|
||||||
noinst_LIBRARIES = libcommon.a
|
noinst_LIBRARIES = libcommon.a
|
||||||
|
|
||||||
libcommon_a_SOURCES = \
|
libcommon_a_SOURCES = \
|
||||||
|
activate-settings-daemon.c activate-settings-daemon.h \
|
||||||
capplet-util.c capplet-util.h \
|
capplet-util.c capplet-util.h \
|
||||||
gconf-property-editor.c gconf-property-editor.h \
|
gconf-property-editor.c gconf-property-editor.h \
|
||||||
gconf-property-editor-marshal.c gconf-property-editor-marshal.h
|
gconf-property-editor-marshal.c gconf-property-editor-marshal.h
|
||||||
|
|
54
capplets/common/activate-settings-daemon.c
Normal file
54
capplets/common/activate-settings-daemon.c
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#include <libbonobo.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "activate-settings-daemon.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*#include "GNOME_SettingsDaemon.h"*/
|
||||||
|
|
||||||
|
static void popup_error_message ()
|
||||||
|
{
|
||||||
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_WARNING,
|
||||||
|
GTK_BUTTONS_OK, "Unable to start the settings manager 'gnome2-settings-daemon'.\n"
|
||||||
|
"Without the GNOME settings manager running, some preferences may not take effect. This could"
|
||||||
|
"indicate a problem with Bonobo, or a non-GNOME (e.g. KDE) settings manager may already"
|
||||||
|
"be active and conflicting with the GNOME settings manager.");
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
gtk_widget_destroy (dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Returns FALSE if activation failed, else TRUE */
|
||||||
|
gboolean
|
||||||
|
activate_settings_daemon (void)
|
||||||
|
{
|
||||||
|
CORBA_Environment ev;
|
||||||
|
CORBA_Object object;
|
||||||
|
|
||||||
|
/*GNOME_SettingsDaemon corba_foo;*/
|
||||||
|
|
||||||
|
bonobo_init (NULL, NULL);
|
||||||
|
|
||||||
|
CORBA_exception_init (&ev);
|
||||||
|
|
||||||
|
object = bonobo_activation_activate_from_id ("OAFIID:GNOME_SettingsDaemon",
|
||||||
|
0, NULL, &ev);
|
||||||
|
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION) {
|
||||||
|
popup_error_message ();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (object == CORBA_OBJECT_NIL) {
|
||||||
|
popup_error_message ();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*bool = GNOME_SettingsDaemon_awake (corba_foo, "MyService", &ev);
|
||||||
|
printf ("bool is %d\n", bool);*/
|
||||||
|
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
9
capplets/common/activate-settings-daemon.h
Normal file
9
capplets/common/activate-settings-daemon.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef ACTIVATE_SETINGS_DAEMON
|
||||||
|
#define ACTIVATE_SETINGS_DAEMON
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
|
/* Returns FALSE if activation failed, else TRUE */
|
||||||
|
gboolean activate_settings_daemon (void);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue