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. 11
      src/window.cc
  7. 6
      src/window.h

2
src/cmake.cc

@ -1,8 +1,8 @@
#include "cmake.h" #include "cmake.h"
#include "singletons.h" #include "singletons.h"
#include "filesystem.h" #include "filesystem.h"
#include <boost/regex.hpp>
#include "dialogs.h" #include "dialogs.h"
#include <boost/regex.hpp>
#include <iostream> //TODO: remove #include <iostream> //TODO: remove
using namespace std; //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; bool already_added=false;
if(*children) { if(*children) {
for(auto &child: *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); not_deleted.emplace(filename);
already_added=true; already_added=true;
break; break;

4
src/files.h

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

6
src/filesystem.h

@ -1,5 +1,5 @@
#ifndef JUCI_SOURCEFILE_H_ #ifndef JUCI_FILESYSTEM_H_
#define JUCI_SOURCEFILE_H_ #define JUCI_FILESYSTEM_H_
#include <vector> #include <vector>
#include <string> #include <string>
#include <boost/filesystem.hpp> #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); } 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 { class Application : public Gtk::Application {
public: public:
Application(); Application();
int on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd); int on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd) override;
void on_activate(); void on_activate() override;
void on_startup(); void on_startup() override;
std::unique_ptr<Window> window; std::unique_ptr<Window> window;
private: private:
std::vector<boost::filesystem::path> directories; std::vector<boost::filesystem::path> directories;

11
src/window.cc

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

6
src/window.h

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

Loading…
Cancel
Save