Browse Source

Fixed the hide override issue discussed in #91. We should also add override elsewhere when appropriate.

merge-requests/365/head
eidheim 10 years ago
parent
commit
1221fe1529
  1. 1
      src/cmake.cc
  2. 6
      src/filesystem.h
  3. 13
      src/window.cc
  4. 6
      src/window.h

1
src/cmake.cc

@ -2,7 +2,6 @@
#include "singletons.h" #include "singletons.h"
#include "filesystem.h" #include "filesystem.h"
#include "dialogs.h" #include "dialogs.h"
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <iostream> //TODO: remove #include <iostream> //TODO: remove

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_

13
src/window.cc

@ -147,7 +147,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]() {
@ -677,19 +677,14 @@ bool Window::on_key_press_event(GdkEventKey *event) {
return Gtk::Window::on_key_press_event(event); return Gtk::Window::on_key_press_event(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