Skip to content

Commit

Permalink
Xkb config: 4 layout warning condition on better place
Browse files Browse the repository at this point in the history
  • Loading branch information
thewaiter committed Nov 3, 2024
1 parent b15667f commit 2ab5841
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/modules/xkbswitch/e_mod_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ _cb_add(void *data, void *data2 __UNUSED__)
E_Config_Dialog_Data *cfdata;
if (!(cfdata = data)) return;

if (eina_list_count(cfdata->cfg_layouts) >= 4)
{
e_util_dialog_internal(_("Warning"),_("The limit for setxkbmap "
"command is 4 layouts!"));
return;
}

if (cfdata->dlg_add_new) e_win_raise(cfdata->dlg_add_new->win);
else cfdata->dlg_add_new = _dlg_add_new(cfdata);
}
Expand Down Expand Up @@ -599,13 +606,6 @@ _dlg_add_cb_ok(void *data __UNUSED__, E_Dialog *dlg)
const char *layout = e_widget_ilist_selected_value_get(cfdata->layout_list);
const char *model = e_widget_ilist_selected_value_get(cfdata->model_list);
const char *variant = e_widget_ilist_selected_value_get(cfdata->variant_list);

if (eina_list_count(cfdata->cfg_layouts) >= 4)
{
e_util_dialog_internal(_("Warning"),_("The limit for setxkbmap "
"command is 4 layouts!"));
return;
}

/* The new configuration */
cl = E_NEW(E_Config_XKB_Layout, 1);
Expand Down

0 comments on commit 2ab5841

Please sign in to comment.