summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rcm-client-advanced.c6
-rw-r--r--rcm-client-main.c29
-rw-r--r--rcm-client-main.h4
-rw-r--r--rcm-client.ui6
4 files changed, 41 insertions, 4 deletions
diff --git a/rcm-client-advanced.c b/rcm-client-advanced.c
index 31ac86b..ca10331 100644
--- a/rcm-client-advanced.c
+++ b/rcm-client-advanced.c
@@ -69,7 +69,7 @@ advanced_transmit_cb(GtkButton *button, gpointer user_data)
g_free(protocol);
if (!strcmp(protocol, "NEC")) {
- printf("Invalid protocol: %s\n", protocol);
+ printf("Unsupported protocol: %s\n", protocol);
return;
}
@@ -318,6 +318,10 @@ advanced_init_ui(RCDevice *object)
render_cell_as_hexadecimal,
NULL, NULL);
+ cbox_add_all_protocols(GTK_COMBO_BOX_TEXT(get_object("advanced_transmit_protocol")));
+ cbox_add_all_protocols(GTK_COMBO_BOX_TEXT(get_object("advanced_add_protocol")));
+ cbox_add_all_keycodes(GTK_COMBO_BOX_TEXT(get_object("advanced_add_keycode")));
+
dialog = GTK_WIDGET(get_object("advanced"));
g_signal_replace_swapped(dialog, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), dialog);
advanced_show_main_cb(NULL, NULL);
diff --git a/rcm-client-main.c b/rcm-client-main.c
index 3595722..e3dcd04 100644
--- a/rcm-client-main.c
+++ b/rcm-client-main.c
@@ -6,6 +6,7 @@
#include <gtk/gtk.h>
#include "generated.h"
+#include "shared.h"
#include "rcm-client-main.h"
#include "rcm-client-hardware-list.h"
#include "rcm-client-receive.h"
@@ -165,6 +166,34 @@ create_header_button(GtkHeaderBar *header, const gchar *tooltip,
return button;
}
+void
+cbox_add_all_protocols(GtkComboBoxText *cbox)
+{
+ unsigned i;
+
+ if (!cbox)
+ return;
+
+ gtk_combo_box_text_remove_all(cbox);
+ for (i = 0; rc_protocols[i]; i++)
+ gtk_combo_box_text_append(cbox, NULL, rc_protocols[i]);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), 0);
+}
+
+void
+cbox_add_all_keycodes(GtkComboBoxText *cbox)
+{
+ unsigned i;
+
+ if (!cbox)
+ return;
+
+ gtk_combo_box_text_remove_all(cbox);
+ for (i = 0; linux_input_keycodes[i].name; i++)
+ gtk_combo_box_text_append(cbox, NULL, linux_input_keycodes[i].name);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), 0);
+}
+
gulong
_g_signal_replace(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GConnectFlags flags)
{
diff --git a/rcm-client-main.h b/rcm-client-main.h
index 49c96b4..5592554 100644
--- a/rcm-client-main.h
+++ b/rcm-client-main.h
@@ -11,6 +11,10 @@ create_header_button(GtkHeaderBar *header, const gchar *tooltip,
const gchar *icon_name, gboolean end, GCallback callback,
gpointer user_data);
+void cbox_add_all_protocols(GtkComboBoxText *cbox);
+
+void cbox_add_all_keycodes(GtkComboBoxText *cbox);
+
gulong _g_signal_replace(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GConnectFlags flags);
static inline gulong
diff --git a/rcm-client.ui b/rcm-client.ui
index 4edd537..5619159 100644
--- a/rcm-client.ui
+++ b/rcm-client.ui
@@ -213,7 +213,7 @@ a keytable</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Edit Kernel Keymap&lt;/big&gt;&lt;/b&gt;
-Edit the in-kernel protocol/scancode
+Edit/view the in-kernel protocol/scancode
to keycode mappings</property>
<property name="use_markup">True</property>
</object>
@@ -318,8 +318,8 @@ Based on protocol and scancode</property>
<object class="GtkEntry" id="advanced_transmit_scancode">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="max_length">10</property>
- <property name="text" translatable="yes">0x1FE0FF0</property>
+ <property name="max_length">18</property>
+ <property name="placeholder_text" translatable="yes">e.g. 0x1FE003CE</property>
<property name="input_hints">GTK_INPUT_HINT_UPPERCASE_CHARS | GTK_INPUT_HINT_NONE</property>
</object>
<packing>