13 lines
No EOL
529 B
Text
13 lines
No EOL
529 B
Text
::RunPshellCmd::
|
|
use strict;
|
|
my $dialog = Gtk3::Dialog->new('Run pshell Command', $::window, 'modal', 'gtk-ok', 'ok', 'gtk-cancel', 'cancel');
|
|
my $entry = Gtk3::Entry->new;
|
|
$dialog->get_content_area->pack_start($entry, FALSE, FALSE, 0);
|
|
$dialog->show_all;
|
|
if ($dialog->run eq 'ok') {
|
|
my $cmd = $entry->get_text;
|
|
my $output = `$::basedir/pshell -e "$cmd" 2>&1` || "Error: pshell failed";
|
|
$::textbuffer->insert_at_cursor("pshell output:\n$output\n");
|
|
$::statusbar->push(0, "Ran pshell command");
|
|
}
|
|
$dialog->destroy; |