fixed some issues with the new widget.

2007-02-12  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpstringcombobox.c: fixed some issues with the
	new widget.

	* modules/controller_linux_input.c: define a property for the
	device store and use the device file as provided by the store.

	* modules/gimpinputdevicestore.c: removed debug output.


svn path=/trunk/; revision=21902
This commit is contained in:
Sven Neumann
2007-02-12 16:36:27 +00:00
committed by Sven Neumann
parent ace0321f83
commit c1f3b2af61
4 changed files with 57 additions and 42 deletions

View File

@ -113,7 +113,8 @@ static const LinuxInputEvent rel_events[] =
enum
{
PROP_0,
PROP_DEVICE
PROP_DEVICE,
PROP_DEVICE_STORE
};
@ -246,6 +247,11 @@ linux_input_class_init (ControllerLinuxInputClass *klass)
_("The name of the device to read Linux Input events from."),
NULL,
GIMP_CONFIG_PARAM_FLAGS));
g_object_class_install_property (object_class, PROP_DEVICE_STORE,
g_param_spec_object ("device-values",
NULL, NULL,
GIMP_TYPE_INPUT_DEVICE_STORE,
G_PARAM_READABLE));
controller_class->name = _("Linux Input");
controller_class->help_id = "gimp-controller-linux-input";
@ -318,6 +324,9 @@ linux_input_get_property (GObject *object,
case PROP_DEVICE:
g_value_set_string (value, controller->device);
break;
case PROP_DEVICE_STORE:
g_value_set_object (value, controller->store);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@ -503,10 +512,17 @@ linux_input_set_device (ControllerLinuxInput *controller,
if (controller->device && strlen (controller->device))
{
gchar *filename;
gchar *state;
gint fd;
fd = g_open (controller->device, O_RDONLY, 0);
if (controller->store)
filename = gimp_input_device_store_get_device_file (controller->store,
controller->device);
else
filename = g_strdup (controller->device);
fd = g_open (filename, O_RDONLY, 0);
if (fd >= 0)
{
@ -522,10 +538,12 @@ linux_input_set_device (ControllerLinuxInput *controller,
linux_input_get_device_info (controller, fd);
state = g_strdup_printf (_("Reading from %s"), controller->device);
state = g_strdup_printf (_("Reading from %s"), filename);
g_object_set (controller, "state", state, NULL);
g_free (state);
g_free (filename);
controller->io = g_io_channel_unix_new (fd);
g_io_channel_set_close_on_unref (controller->io, TRUE);
g_io_channel_set_encoding (controller->io, NULL, NULL);
@ -543,6 +561,8 @@ linux_input_set_device (ControllerLinuxInput *controller,
g_object_set (controller, "state", state, NULL);
g_free (state);
}
g_free (filename);
}
else
{

View File

@ -214,9 +214,6 @@ gimp_input_device_store_add (GimpInputDeviceStore *store,
GtkTreeIter iter;
gtk_list_store_append (GTK_LIST_STORE (store), &iter);
g_printerr ("%s\n", str);
gtk_list_store_set (GTK_LIST_STORE (store), &iter,
COLUMN_UDI, udi,
COLUMN_LABEL, str,