From f7da02341c2d86df1e3053be56dc896c5e506885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 20 May 2015 10:26:55 +0200 Subject: [PATCH] Fixes --- juci/notebook.cc | 2 +- juci/notebook.h | 3 ++- juci/source.cc | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/juci/notebook.cc b/juci/notebook.cc index ec36acc..bab2830 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -21,7 +21,7 @@ Notebook::Controller::Controller(Gtk::Window* window, index_(0, 1) { INFO("Create notebook"); window_ = window; - OnNewPage("juCi++"); + OnNewPage("untitled"); refClipboard_ = Gtk::Clipboard::get(); ispopup = false; view().pack1(directories_.widget(), true, true); diff --git a/juci/notebook.h b/juci/notebook.h index 6991b32..12c78ea 100644 --- a/juci/notebook.h +++ b/juci/notebook.h @@ -72,6 +72,8 @@ namespace Notebook { bool OnMouseRelease(GdkEventButton* button); bool OnKeyRelease(GdkEventKey* key); std::string OnSaveFileAs(); + bool LegalExtension(std::string extension); + protected: void TextViewHandlers(Gtk::TextView& textview); void PopupSelectHandler(Gtk::Dialog &popup, @@ -89,7 +91,6 @@ namespace Notebook { int ¤t_x, int ¤t_y); void AskToSaveDialog(); - bool LegalExtension(std::string extension); Glib::RefPtr m_refBuilder; Glib::RefPtr refActionGroup; Source::Config source_config_; diff --git a/juci/source.cc b/juci/source.cc index d9a4036..c88d2a9 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -1,5 +1,4 @@ #include "source.h" -#include #include "sourcefile.h" #include #include @@ -343,7 +342,7 @@ void Source::Controller::OnOpenFile(const string &filepath) { buffer()->set_text(s.get_content()); int start_offset = buffer()->begin().get_offset(); int end_offset = buffer()->end().get_offset(); - if (!notebook_->LegalExtension(filepath.substr(filepath.find_last_of(".") + 1))) { + if (notebook_->LegalExtension(filepath.substr(filepath.find_last_of(".") + 1))) { view().ApplyConfig(model().config()); model().InitSyntaxHighlighting(filepath, extract_file_path(filepath),