From 9087f660ca8647d069cbe0c4f51ec82bfac8e6db Mon Sep 17 00:00:00 2001 From: oyvang Date: Wed, 13 May 2015 16:18:09 +0200 Subject: [PATCH] fixed bug with complie and run --- juci/notebook.cc | 8 +++++++- juci/window.cc | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/juci/notebook.cc b/juci/notebook.cc index 9785cf0..cb3e159 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -643,17 +643,23 @@ void Notebook::Controller:: OnSaveFile() { std::string Notebook::Controller::OnSaveFileAs(){ - INFO("Notebook save as"); + INFO("Notebook save as"); Gtk::FileChooserDialog dialog("Please choose a file", Gtk::FILE_CHOOSER_ACTION_SAVE); + DEBUG("SET TRANSISTEN FPR"); dialog.set_transient_for(*window_); dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS); dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); dialog.add_button("_Save", Gtk::RESPONSE_OK); + //dialog.set_current_name("Untitled"); + DEBUG("RUN DIALOG"); int result = dialog.run(); + DEBUG("DIALOG RUNNING"); switch (result) { case(Gtk::RESPONSE_OK): { + DEBUG("get_filename()"); std::string path = dialog.get_filename(); + DEBUG_VAR(path); unsigned pos = path.find_last_of("/\\"); std::cout << path<< std::endl; //notebook_.OnSaveFile(path); diff --git a/juci/window.cc b/juci/window.cc index 3cc5b89..ba4c391 100644 --- a/juci/window.cc +++ b/juci/window.cc @@ -54,9 +54,9 @@ Window::Window() : Gtk::AccelKey(keybindings_.config_ .key_map()["compile_and_run"]), [this]() { + notebook_.OnSaveFile(); 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){ @@ -80,9 +80,9 @@ Window::Window() : Gtk::AccelKey(keybindings_.config_ .key_map()["compile"]), [this]() { + notebook_.OnSaveFile(); if (running.try_lock()) { - std::thread execute([=]() { - notebook_.OnSaveFile(); + std::thread execute([=]() { std::string path = notebook_.CurrentPagePath(); int pos = path.find_last_of("/\\"); if(pos != std::string::npos){