Update Runner

This commit is contained in:
daleclack 2022-05-26 14:00:11 +08:00
parent 3fb2582ac5
commit 1e89576b8e
2 changed files with 6 additions and 4 deletions

View File

@ -74,6 +74,7 @@
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp"
"variant": "cpp",
"charconv": "cpp"
}
}

View File

@ -7,7 +7,7 @@ hbox(Gtk::ORIENTATION_HORIZONTAL,5),
open_btn("...")
{
//Ininalize window
set_title("Run a Application");
set_title("Run a Command");
set_icon_name("myrunner");
set_default_size(300,150);
add_button("OK",Gtk::RESPONSE_OK);
@ -36,7 +36,7 @@ open_btn("...")
void GtkRunner::on_response(int response_id){
if(response_id==Gtk::RESPONSE_OK){
//Start The Application
Glib::ustring program=app_entry.get_text();
std::string program=app_entry.get_text();
std::thread first(system,program.c_str());
first.detach();
}
@ -65,7 +65,8 @@ void GtkRunner::file_dialog(){
void GtkRunner::dialog_response(int response){
if(response==Gtk::RESPONSE_ACCEPT){
Glib::ustring filename=dialog->get_filename();
app_entry.set_text(filename);
Glib::ustring text = Glib::filename_to_utf8(filename);
app_entry.set_text(text);
}
dialog.reset();
}