Skip to content
Permalink
Browse files

media-keys: Execute default calculator application defined by schema

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
  • Loading branch information...
zhangxianwei8 authored and lukefromdc committed Dec 6, 2018
1 parent da353f2 commit c19fce3506738b639ce1b95d90cbcfb3665937b7
Showing with 17 additions and 9 deletions.
  1. +17 −9 plugins/media-keys/msd-media-keys-manager.c
@@ -526,6 +526,22 @@ do_media_action (MsdMediaKeysManager *manager)
}
}

static void
do_calculator_action (MsdMediaKeysManager *manager)
{
GSettings *settings;
char *calc;

settings = g_settings_new ("org.mate.applications-calculator");
calc = g_settings_get_string (settings, "exec");

if (calc)
execute (manager, calc, FALSE, FALSE);

g_free (calc);
g_object_unref (settings);
}

static void
do_shutdown_action (MsdMediaKeysManager *manager)
{
@@ -1245,15 +1261,7 @@ do_action (MsdMediaKeysManager *manager,
do_media_action (manager);
break;
case CALCULATOR_KEY:
if ((cmd = g_find_program_in_path ("galculator"))) {
execute (manager, "galculator", FALSE, FALSE);
} else if ((cmd = g_find_program_in_path ("mate-calc"))) {
execute (manager, "mate-calc", FALSE, FALSE);
} else {
execute (manager, "gnome-calculator", FALSE, FALSE);
}

g_free (cmd);
do_calculator_action (manager);
break;
case PLAY_KEY:
return do_multimedia_player_action (manager, "Play");

0 comments on commit c19fce3

Please sign in to comment.
You can’t perform that action at this time.