diff --git a/src/config.cc b/src/config.cc index 30cadac..cb434b7 100644 --- a/src/config.cc +++ b/src/config.cc @@ -14,7 +14,7 @@ MainConfig::MainConfig() { Singleton::Config::window()->theme_name=cfg.get("gtk_theme.name"); Singleton::Config::window()->theme_variant=cfg.get("gtk_theme.variant"); - + Singleton::Config::window()->version = cfg.get("version"); Singleton::Config::terminal()->make_command=cfg.get("project.make_command"); Singleton::Config::terminal()->cmake_command=cfg.get("project.cmake_command"); } diff --git a/src/files.h b/src/files.h index 5153dba..50476c7 100644 --- a/src/files.h +++ b/src/files.h @@ -1,6 +1,7 @@ #include const std::string configjson = "{\n" +" \"version\": \"0.9.1\",\n" " \"gtk_theme\": {\n" " \"name\": \"Adwaita\", //Use \"\" for default theme, At least these two exist on all systems: Adwaita, Raleigh\n" " \"variant\": \"\" //Use \"\" for default variant, and \"dark\" for dark theme variant\n" diff --git a/src/menu.cc b/src/menu.cc index 4998bee..1cb122c 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -15,8 +15,6 @@ Menu::Menu() : box(Gtk::ORIENTATION_VERTICAL) { action_group->add(Gtk::Action::create("SourceMenu", "_Source")); action_group->add(Gtk::Action::create("PluginMenu", "_Plugins")); action_group->add(Gtk::Action::create("HelpMenu", "Help")); - action_group->add(Gtk::Action::create("HelpAbout", "About"), [this]() { - }); INFO("Menu created"); } diff --git a/src/window.cc b/src/window.cc index c00581b..3fd573e 100644 --- a/src/window.cc +++ b/src/window.cc @@ -107,6 +107,21 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil entry_box.hide(); }); + about.signal_response().connect([this](int d){ + about.hide(); + }); + + about.set_version(Singleton::Config::window()->version); + about.set_authors({"Ted Johan Kristoffersen", + "Jørgen Lien Sellæg", + "Geir Morten Larsen", + "with special thanks to", + "Ole Christian Eidheim"}); + about.set_name("About juCi++"); + about.set_program_name("juCi++"); + about.set_comments("This is an open source IDE with high-end features to make your programming experience juicy"); + about.set_license_type(Gtk::License::LICENSE_MIT_X11); + about.set_transient_for(*this); INFO("Window created"); } // Window constructor @@ -298,11 +313,14 @@ void Window::create_menu() { menu.action_group->add(Gtk::Action::create("ProjectForceKillLastRunning", "Force Kill Last Process"), Gtk::AccelKey(menu.key_map["force_kill_last_running"]), [this]() { Singleton::terminal()->kill_last_async_execute(true); }); - menu.action_group->add(Gtk::Action::create("WindowCloseTab", "Close Tab"), Gtk::AccelKey(menu.key_map["close_tab"]), [this]() { notebook.close_current_page(); }); - add_accel_group(menu.ui_manager->get_accel_group()); + menu.action_group->add(Gtk::Action::create("HelpAbout", "About"), [this] () { + about.show(); + about.present(); + }); + add_accel_group(menu.ui_manager->get_accel_group()); menu.build(); INFO("Menu build") } diff --git a/src/window.h b/src/window.h index b18ae0f..693b526 100644 --- a/src/window.h +++ b/src/window.h @@ -18,6 +18,7 @@ public: public: std::string theme_name; std::string theme_variant; + std::string version; boost::property_tree::ptree keybindings; }; @@ -33,6 +34,7 @@ private: Gtk::VBox terminal_vbox; Gtk::ScrolledWindow terminal_scrolled_window; Gtk::HBox status_hbox; + Gtk::AboutDialog about; EntryBox entry_box; Menu menu; std::atomic compiling;