Browse Source

Fixes

merge-requests/365/head
Jørgen Lien Sellæg 11 years ago
parent
commit
f7da02341c
  1. 2
      juci/notebook.cc
  2. 3
      juci/notebook.h
  3. 3
      juci/source.cc

2
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);

3
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 &current_x,
int &current_y);
void AskToSaveDialog();
bool LegalExtension(std::string extension);
Glib::RefPtr<Gtk::Builder> m_refBuilder;
Glib::RefPtr<Gio::SimpleActionGroup> refActionGroup;
Source::Config source_config_;

3
juci/source.cc

@ -1,5 +1,4 @@
#include "source.h"
#include <iostream>
#include "sourcefile.h"
#include <boost/property_tree/json_parser.hpp>
#include <fstream>
@ -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),

Loading…
Cancel
Save