|
|
|
@ -33,53 +33,71 @@ Window::Window() : |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSaveAs", |
|
|
|
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSaveAs", |
|
|
|
"Save as"), |
|
|
|
"Save as"), |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
.key_map()["save_as"]), |
|
|
|
.key_map()["save_as"]), |
|
|
|
[this]() { |
|
|
|
[this]() { |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSave", |
|
|
|
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSave", |
|
|
|
"Save"), |
|
|
|
"Save"), |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
.key_map()["save"]), |
|
|
|
.key_map()["save"]), |
|
|
|
[this]() { |
|
|
|
[this]() { |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
keybindings_. |
|
|
|
|
|
|
|
action_group_menu()-> |
|
|
|
|
|
|
|
add(Gtk::Action::create("ProjectCompileAndRun", |
|
|
|
|
|
|
|
"Compile And Run"), |
|
|
|
|
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
|
|
|
|
.key_map()["compile_and_run"]), |
|
|
|
|
|
|
|
[this]() { |
|
|
|
|
|
|
|
notebook_.OnSaveFile(); |
|
|
|
|
|
|
|
std::string path = notebook_.CurrentPagePath(); |
|
|
|
|
|
|
|
terminal_.SetFolderCommand(path); |
|
|
|
|
|
|
|
if(terminal_.Compile()) { |
|
|
|
|
|
|
|
std::string executable = notebook_.directories(). |
|
|
|
|
|
|
|
GetCmakeVarValue(path,"add_executable"); |
|
|
|
|
|
|
|
terminal_.Run(executable); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
keybindings_. |
|
|
|
keybindings_. |
|
|
|
action_group_menu()-> |
|
|
|
action_group_menu()-> |
|
|
|
add(Gtk::Action::create("ProjectCompile", |
|
|
|
add(Gtk::Action::create("ProjectCompileAndRun", |
|
|
|
"Compile"), |
|
|
|
"Compile And Run"), |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
.key_map()["compile"]), |
|
|
|
.key_map()["compile_and_run"]), |
|
|
|
[this]() { |
|
|
|
[this]() { |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
if (running.try_lock()) { |
|
|
|
std::string path = |
|
|
|
std::thread execute([=]() { |
|
|
|
notebook_.CurrentPagePath(); |
|
|
|
notebook_.OnSaveFile(); |
|
|
|
terminal_.SetFolderCommand(path); |
|
|
|
std::string path = notebook_.CurrentPagePath(); |
|
|
|
terminal_.Compile(); |
|
|
|
int pos = path.find_last_of("/\\"); |
|
|
|
}); |
|
|
|
if(pos != std::string::npos){ |
|
|
|
|
|
|
|
path.erase(path.begin()+pos,path.end()); |
|
|
|
this->signal_button_release_event(). |
|
|
|
terminal_.SetFolderCommand(path); |
|
|
|
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); |
|
|
|
} |
|
|
|
|
|
|
|
terminal_.Compile(); |
|
|
|
|
|
|
|
std::string executable = notebook_.directories(). |
|
|
|
|
|
|
|
GetCmakeVarValue(path,"add_executable"); |
|
|
|
|
|
|
|
terminal_.Run(executable); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
execute.detach(); |
|
|
|
|
|
|
|
running.unlock(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
keybindings_. |
|
|
|
|
|
|
|
action_group_menu()-> |
|
|
|
|
|
|
|
add(Gtk::Action::create("ProjectCompile", |
|
|
|
|
|
|
|
"Compile"), |
|
|
|
|
|
|
|
Gtk::AccelKey(keybindings_.config_ |
|
|
|
|
|
|
|
.key_map()["compile"]), |
|
|
|
|
|
|
|
[this]() { |
|
|
|
|
|
|
|
if (running.try_lock()) { |
|
|
|
|
|
|
|
std::thread execute([=]() { |
|
|
|
|
|
|
|
notebook_.OnSaveFile(); |
|
|
|
|
|
|
|
std::string path = notebook_.CurrentPagePath(); |
|
|
|
|
|
|
|
int pos = path.find_last_of("/\\"); |
|
|
|
|
|
|
|
if(pos != std::string::npos){ |
|
|
|
|
|
|
|
path.erase(path.begin()+pos,path.end()); |
|
|
|
|
|
|
|
terminal_.SetFolderCommand(path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
terminal_.Compile(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
execute.detach(); |
|
|
|
|
|
|
|
running.unlock(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this->signal_button_release_event(). |
|
|
|
|
|
|
|
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); |
|
|
|
terminal_.Terminal().signal_button_release_event(). |
|
|
|
terminal_.Terminal().signal_button_release_event(). |
|
|
|
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); |
|
|
|
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); |
|
|
|
|
|
|
|
|
|
|
|
@ -88,9 +106,12 @@ Window::Window() : |
|
|
|
keybindings_.BuildMenu(); |
|
|
|
keybindings_.BuildMenu(); |
|
|
|
|
|
|
|
|
|
|
|
window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK); |
|
|
|
window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK); |
|
|
|
|
|
|
|
|
|
|
|
window_box_.pack_start(notebook_.entry_view(), Gtk::PACK_SHRINK); |
|
|
|
window_box_.pack_start(notebook_.entry_view(), Gtk::PACK_SHRINK); |
|
|
|
window_box_.pack_start(notebook_.view()); |
|
|
|
paned_.set_position(300); |
|
|
|
window_box_.pack_end(terminal_.view(),Gtk::PACK_SHRINK); |
|
|
|
paned_.pack1(notebook_.view(), true, false); |
|
|
|
|
|
|
|
paned_.pack2(terminal_.view(), true, true); |
|
|
|
|
|
|
|
window_box_.pack_end(paned_); |
|
|
|
show_all_children(); |
|
|
|
show_all_children(); |
|
|
|
INFO("Window created"); |
|
|
|
INFO("Window created"); |
|
|
|
} // Window constructor
|
|
|
|
} // Window constructor
|
|
|
|
|