Skip to content

Commit

Permalink
Merge pull request geany#3833 from ntrel/custom-dialog
Browse files Browse the repository at this point in the history
[build] Improve custom command dialog
  • Loading branch information
eht16 committed Jun 9, 2024
2 parents 539287d + 41620fc commit be7e3ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,17 +1268,24 @@ static void on_build_menu_item(GtkWidget *w, gpointer user_data)
if (grp == GEANY_GBG_NON_FT && cmd == GBO_TO_CMD(GEANY_GBO_CUSTOM))
{
static GtkWidget *dialog = NULL; /* keep dialog for combo history */
gchar *str;

bc = get_build_cmd(doc, grp, cmd, NULL);
str = g_strdup_printf(_("Enter custom text to append to the command \"%s\":"),
bc->command);
if (! dialog)
{
dialog = dialogs_show_input_persistent(_("Custom Text"), GTK_WINDOW(main_widgets.window),
_("Enter custom text here, all entered text is appended to the command."),
build_info.custom_target, &on_make_custom_input_response, NULL);
dialog = dialogs_show_input_persistent(NULL, GTK_WINDOW(main_widgets.window),
str, build_info.custom_target, &on_make_custom_input_response, NULL);
}
else
{
gtk_label_set_label(GTK_LABEL(ui_lookup_widget(dialog, "label")), str);
gtk_widget_show(dialog);
}
SETPTR(str, utils_str_remove_chars(g_strdup(bc->label), "_"));
gtk_window_set_title(GTK_WINDOW(dialog), str);
g_free(str);
return;
}
else if (grp == GEANY_GBG_EXEC)
Expand Down
1 change: 1 addition & 0 deletions src/dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ dialogs_show_input_full(const gchar *title, GtkWindow *parent,
GtkWidget *label = gtk_label_new(label_text);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
ui_hookup_widget(dialog, label, "label");
gtk_container_add(GTK_CONTAINER(vbox), label);
}

Expand Down

0 comments on commit be7e3ce

Please sign in to comment.