diff options
| author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-05 09:57:39 +0200 | 
|---|---|---|
| committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-05 09:58:04 +0200 | 
| commit | 8c6fe0ad321a263ee56a3d6439d7b99630a1755c (patch) | |
| tree | eba5aa148ea881d577f343995de2fdd042a76ad7 /fiv.c | |
| parent | ca51c9413b38ee4b65af7e95d5c81aecbda5aa2c (diff) | |
| download | fiv-8c6fe0ad321a263ee56a3d6439d7b99630a1755c.tar.gz fiv-8c6fe0ad321a263ee56a3d6439d7b99630a1755c.tar.xz fiv-8c6fe0ad321a263ee56a3d6439d7b99630a1755c.zip  | |
Integrate dconf-editor
This is a more than adequate solution for now.
Diffstat (limited to 'fiv.c')
| -rw-r--r-- | fiv.c | 18 | 
1 files changed, 18 insertions, 0 deletions
@@ -82,6 +82,7 @@ struct key_section {  static struct key help_keys_general[] = {  	{"F1", "Show help"},  	{"F10", "Open menu"}, +	{"<Control>comma", "Preferences"},  	{"<Control>question", "Keyboard shortcuts"},  	{"q <Control>q", "Quit"},  	{"<Control>w", "Quit"}, @@ -1127,6 +1128,20 @@ show_help_shortcuts(void)  }  static void +show_preferences(void) +{ +	char *argv[] = {"dconf-editor", PROJECT_NS PROJECT_NAME, NULL}; +	GError *error = NULL; +	if (!g_spawn_async( +		NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) { +		if (g_error_matches(error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)) +			g_prefix_error_literal(&error, +				"Please install dconf-editor, or use the gsettings utility.\n"); +		show_error_dialog(error); +	} +} + +static void  toggle_sunlight(void)  {  	GtkSettings *settings = gtk_settings_get_default(); @@ -1182,6 +1197,9 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,  		case GDK_KEY_question:  			show_help_shortcuts();  			return TRUE; +		case GDK_KEY_comma: +			show_preferences(); +			return TRUE;  		}  		break;  	case GDK_MOD1_MASK:  | 
