removed "enabled" property. Removed GIMP_CONTROLLER_PARAM_RERIALIZE from

2004-06-17  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpcontroller.[ch]: removed "enabled"
	property. Removed GIMP_CONTROLLER_PARAM_RERIALIZE from the "name"
	property because it's the hardware-determined name of this
	controller instance.

	* app/widgets/gimpcontrollerwheel.c
	* modules/controller_linux_input.c: set the name.

	* libgimpwidgets/gimpwidgets.h: #include gimpcontroller.h.

	* app/widgets/gimpcontrollerinfo.[ch]: added "enabled" here
	instead.  Don't dispatch events if the controller is
	disabled. Made everything work (not crash) with info->mapping
	being NULL.

	* etc/controllerrc: updated again with the changed format.

	* app/widgets/gimpcontrollers.[ch]: added
	gimp_controllers_get_list() which returns the container of
	controllers.

	* app/widgets/gimphelp-ids.h
	* app/gui/preferences-dialog.c: added controller configuration
	(can't change anything yet, just view the current settings).
	Resurrected the "Input Devices" page and removed the "Session"
	page by moving its widgets to other pages. Pack the various
	"Save now"/"Clear now" buttons vertically, not horizontally.
	Fixes bug #139069.

	* themes/Default/images/preferences/Makefile.am
	* themes/Default/images/preferences/controllers.png
	* themes/Default/images/preferences/theme.png: new icons for new
	prefs pages. Someone needs to make them nice...
This commit is contained in:
Michael Natterer
2004-06-17 14:07:05 +00:00
committed by Michael Natterer
parent c3a0a277e7
commit 5f4eabdbcb
17 changed files with 677 additions and 357 deletions

View File

@ -120,7 +120,7 @@ struct _ControllerLinuxInputClass
GType linux_input_get_type (GTypeModule *module);
static void linux_input_class_init (ControllerLinuxInputClass *klass);
static void linux_input_finalize (GObject *object);
static void linux_input_dispose (GObject *object);
static void linux_input_set_property (GObject *object,
guint property_id,
const GValue *value,
@ -208,7 +208,7 @@ linux_input_class_init (ControllerLinuxInputClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = linux_input_finalize;
object_class->dispose = linux_input_dispose;
object_class->get_property = linux_input_get_property;
object_class->set_property = linux_input_set_property;
@ -227,13 +227,13 @@ linux_input_class_init (ControllerLinuxInputClass *klass)
}
static void
linux_input_finalize (GObject *object)
linux_input_dispose (GObject *object)
{
ControllerLinuxInput *controller = CONTROLLER_LINUX_INPUT (object);
linux_input_set_device (controller, NULL);
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
@ -357,6 +357,12 @@ linux_input_set_device (ControllerLinuxInput *controller,
"name", name,
NULL);
}
else
{
g_object_set (controller,
"name", _("Unknown device"),
NULL);
}
controller->io = g_io_channel_unix_new (fd);
g_io_channel_set_close_on_unref (controller->io, TRUE);
@ -370,10 +376,20 @@ linux_input_set_device (ControllerLinuxInput *controller,
}
else
{
g_printerr ("controller_linux_input: Cannot open device '%s': %s\n",
device, g_strerror (errno));
gchar *name = g_strdup_printf (_("Device not available: %s"),
g_strerror (errno));
g_object_set (controller,
"name", name,
NULL);
g_free (name);
}
}
else
{
g_object_set (controller,
"name", _("No device configured"),
NULL);
}
return FALSE;
}