Browse Source

Added the missing checks if paths from Dialog::* were empty.

merge-requests/365/head
eidheim 10 years ago
parent
commit
59b32b25f1
  1. 2
      src/files.h
  2. 10
      src/window.cc

2
src/files.h

@ -70,7 +70,7 @@ const std::string configjson =
" \"source_spellcheck_clear\": \"\",\n"
" \"source_spellcheck_next_error\": \"<primary><shift>e\",\n"
" \"source_indentation_set_buffer_tab\": \"\",\n"
" \"source_indentation_auto_indent_buffer\": \"\",\n"
" \"source_indentation_auto_indent_buffer\": \"<primary><shift>i\",\n"
" \"source_goto_line\": \"<primary>g\",\n"
" \"source_center_cursor\": \"<primary>l\",\n"
" \"source_goto_declaration\": \"<primary>d\",\n"

10
src/window.cc

@ -200,14 +200,13 @@ void Window::create_menu() {
}
else
Singleton::terminal()->print("Error: "+path.string()+" already exists.\n");
}
Singleton::directories()->select(path);
}
});
menu.action_group->add(Gtk::Action::create("FileNewProject", "New Project"));
menu.action_group->add(Gtk::Action::create("FileNewProjectCpp", "C++"), [this]() {
boost::filesystem::path project_path = Dialog::new_folder();
if(project_path=="")
return;
if(project_path!="") {
auto project_name=project_path.filename().string();
for(size_t c=0;c<project_name.size();c++) {
if(project_name[c]==' ')
@ -234,9 +233,12 @@ void Window::create_menu() {
}
else
Singleton::terminal()->print("Error: Could not create project "+project_path.string()+"\n");
}
});
menu.action_group->add(Gtk::Action::create("FileOpenFile", "Open File"), Gtk::AccelKey(menu.key_map["open_file"]), [this]() {
notebook.open(Dialog::select_file());
auto path=Dialog::select_file();
if(path!="")
notebook.open(path);
});
menu.action_group->add(Gtk::Action::create("FileOpenFolder", "Open Folder"), Gtk::AccelKey(menu.key_map["open_folder"]), [this]() {
auto path = Dialog::select_folder();

Loading…
Cancel
Save