Browse Source

Remove couts

merge-requests/365/head
Jørgen Lien Sellæg 11 years ago
parent
commit
4a066bcb13
  1. 5
      juci/config.json
  2. 19
      juci/plugins/snippet.py
  3. 58
      juci/window.cc

5
juci/config.json

@ -72,8 +72,9 @@
"compile_commands": [ "compile_commands": [
"rm -rf ./.build", "rm -rf ./.build",
"mkdir ./.build", "mkdir ./.build",
"cmake -B./.build -H.", "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B./.build -H.",
"cd ./.build/; make" "cd ./.build/; make",
"cp ./.build/compile_commands.json compile_commands.json"
] ]
}, },
"example": { "example": {

19
juci/plugins/snippet.py

@ -12,28 +12,29 @@ def initPlugin():
snippets = {} snippets = {}
snippets["for"] = """\ snippets["for"] = """\
for(#int i=0; #i<#v.size(); #i++) { for(int i=0; i<v.size(); i++) {
std::cout << v[i] << std::endl; // std::cout << v[i] << std::endl;
// Write code here
} }
""" """
snippets["if"] = """\ snippets["if"] = """\
if(#) { if(true) {
# // Write code here
} }
""" """
snippets["ifelse"] = """\ snippets["ifelse"] = """\
if(#) { if(false) {
# // Write code here
} else { } else {
# // Write code here
} }
""" """
snippets["while"] = """\ snippets["while"] = """\
while(#) { while(condition) {
# // Write code here
} }
""" """

58
juci/window.cc

@ -82,30 +82,30 @@ Window::Window() :
} }
}); });
keybindings_. keybindings_.
action_group_menu()-> action_group_menu()->
add(Gtk::Action::create("ProjectCompile", add(Gtk::Action::create("ProjectCompile",
"Compile"), "Compile"),
Gtk::AccelKey(keybindings_.config_ Gtk::AccelKey(keybindings_.config_
.key_map()["compile"]), .key_map()["compile"]),
[this]() { [this]() {
SaveFile(); SaveFile();
if (running.try_lock()) { if (running.try_lock()) {
std::thread execute([=]() { std::thread execute([=]() {
std::string path = notebook_.CurrentPagePath(); std::string path = notebook_.CurrentPagePath();
int pos = path.find_last_of("/\\"); int pos = path.find_last_of("/\\");
if(pos != std::string::npos){ if(pos != std::string::npos){
path.erase(path.begin()+pos,path.end()); path.erase(path.begin()+pos,path.end());
terminal_.SetFolderCommand(path); terminal_.SetFolderCommand(path);
} }
terminal_.Compile(); terminal_.Compile();
running.unlock(); running.unlock();
}); });
execute.detach(); execute.detach();
} }
}); });
this->signal_button_release_event(). this->signal_button_release_event().
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); 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);
@ -142,20 +142,15 @@ void Window::OnFileOpenFolder() {
{ {
case(Gtk::RESPONSE_OK): case(Gtk::RESPONSE_OK):
{ {
std::cout << "Folder selected: " << dialog.get_filename()
<< std::endl;
notebook_.directories().open_folder(dialog.get_filename()); notebook_.directories().open_folder(dialog.get_filename());
std::cout << dialog.get_filename()<< std::endl;
break; break;
} }
case(Gtk::RESPONSE_CANCEL): case(Gtk::RESPONSE_CANCEL):
{ {
std::cout << "Cancel clicked." << std::endl;
break; break;
} }
default: default:
{ {
std::cout << "Unexpected button clicked." << std::endl;
break; break;
} }
} }
@ -194,19 +189,14 @@ void Window::OnOpenFile() {
switch (result) { switch (result) {
case(Gtk::RESPONSE_OK): { case(Gtk::RESPONSE_OK): {
std::cout << "Open clicked." << std::endl;
std::string path = dialog.get_filename(); std::string path = dialog.get_filename();
std::cout << "File selected: " << path << std::endl;
notebook_.OnOpenFile(path); notebook_.OnOpenFile(path);
break; break;
} }
case(Gtk::RESPONSE_CANCEL): { case(Gtk::RESPONSE_CANCEL): {
std::cout << "Cancel clicked." << std::endl;
break; break;
} }
default: { default: {
std::cout << "Unexpected button clicked." << std::endl;
break; break;
} }
} }

Loading…
Cancel
Save