Browse Source

Merge pull request #20 from cppit/master

pull from cppit
merge-requests/365/head
Ole Christian Eidheim 10 years ago
parent
commit
00a0e358f4
  1. 2
      src/cmake.cc
  2. 2
      src/directories.cc
  3. 4
      src/files.h
  4. 6
      src/filesystem.h
  5. 6
      src/juci.h
  6. 13
      src/window.cc
  7. 6
      src/window.h

2
src/cmake.cc

@ -1,8 +1,8 @@
#include "cmake.h"
#include "singletons.h"
#include "filesystem.h"
#include <boost/regex.hpp>
#include "dialogs.h"
#include <boost/regex.hpp>
#include <iostream> //TODO: remove
using namespace std; //TODO: remove

2
src/directories.cc

@ -216,7 +216,7 @@ void Directories::add_path(const boost::filesystem::path& dir_path, const Gtk::T
bool already_added=false;
if(*children) {
for(auto &child: *children) {
if(child.get_value(column_record.name)==filename) {
if(child->get_value(column_record.name)==filename) {
not_deleted.emplace(filename);
already_added=true;
break;

4
src/files.h

@ -1,3 +1,5 @@
#ifndef JUCI_FILES_H_
#define JUCI_FILES_H_
#include <string>
#define JUCI_VERSION "0.9.6"
@ -373,4 +375,4 @@ const std::string snippetpy =
" output=getSnippet(theWord) \n"
" juci.replaceWord(output) \n";
#endif // JUCI_FILES_H_

6
src/filesystem.h

@ -1,5 +1,5 @@
#ifndef JUCI_SOURCEFILE_H_
#define JUCI_SOURCEFILE_H_
#ifndef JUCI_FILESYSTEM_H_
#define JUCI_FILESYSTEM_H_
#include <vector>
#include <string>
#include <boost/filesystem.hpp>
@ -26,4 +26,4 @@ public:
static bool write(const boost::filesystem::path &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { return write(path.string(), text_buffer); }
};
#endif // JUCI_SOURCEFILE_H_
#endif // JUCI_FILESYSTEM_H_

6
src/juci.h

@ -8,9 +8,9 @@
class Application : public Gtk::Application {
public:
Application();
int on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd);
void on_activate();
void on_startup();
int on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd) override;
void on_activate() override;
void on_startup() override;
std::unique_ptr<Window> window;
private:
std::vector<boost::filesystem::path> directories;

13
src/window.cc

@ -152,7 +152,7 @@ void Window::set_menu_actions() {
notebook.open(Singleton::config->juci_home_path()/"config"/"config.json");
});
menu->add_action("quit", [this]() {
hide();
close();
});
menu->add_action("new_file", [this]() {
@ -682,19 +682,14 @@ bool Window::on_key_press_event(GdkEventKey *event) {
return Gtk::Window::on_key_press_event(event);
}
bool Window::on_delete_event (GdkEventAny *event) {
hide();
return true;
}
void Window::hide() {
bool Window::on_delete_event(GdkEventAny *event) {
auto size=notebook.size();
for(int c=0;c<size;c++) {
if(!notebook.close_current_page())
return;
return true;
}
Singleton::terminal->kill_async_executes();
Gtk::Window::hide();
return false;
}
void Window::search_and_replace_entry() {

6
src/window.h

@ -11,9 +11,8 @@ public:
Window();
Notebook notebook;
protected:
bool on_key_press_event(GdkEventKey *event);
bool on_delete_event (GdkEventAny *event);
bool on_key_press_event(GdkEventKey *event) override;
bool on_delete_event(GdkEventAny *event) override;
private:
Gtk::VPaned vpaned;
@ -29,7 +28,6 @@ private:
void configure();
void set_menu_actions();
void activate_menu_items(bool activate=true);
void hide();
void search_and_replace_entry();
void set_tab_entry();
void goto_line_entry();

Loading…
Cancel
Save