Commit 9f65cede authored by Ognjen Galic's avatar Ognjen Galic Committed by Robert Roth

dialog: use short process name instead of full

When there is a long process name, the name of the
process in the kill dialog is show in full. This is a problem
because long process names (such as google chrome) cause the dialog
to extend all the way across the room.

This patch fixes that by just displaying the short process name
without the command line parameters.
Signed-off-by: Ognjen Galic's avatarOgnjen Galic <smclt30p@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788066
parent 7cb2c66b
......@@ -72,23 +72,27 @@ procdialog_create_kill_dialog (GsmApplication *app, int signal)
// get the last selected row
gtk_tree_selection_selected_foreach (app->selection, get_last_selected,
&selected_process);
std::string *process_name = &selected_process->name;
std::string short_process_name = process_name->substr(0, process_name->find(" "));
switch (signal) {
case SIGKILL:
/*xgettext: primary alert message for killing single process*/
primary = g_strdup_printf (_("Are you sure you want to kill the selected process “%s” (PID: %u)?"),
selected_process->name.c_str(),
short_process_name.c_str(),
selected_process->pid);
break;
case SIGTERM:
/*xgettext: primary alert message for ending single process*/
primary = g_strdup_printf (_("Are you sure you want to end the selected process “%s” (PID: %u)?"),
selected_process->name.c_str(),
short_process_name.c_str(),
selected_process->pid);
break;
default: // SIGSTOP
/*xgettext: primary alert message for stopping single process*/
primary = g_strdup_printf (_("Are you sure you want to stop the selected process “%s” (PID: %u)?"),
selected_process->name.c_str(),
short_process_name.c_str(),
selected_process->pid);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment