Browse Source

dunno what i have done

merge-requests/365/head
oyvang 11 years ago
parent
commit
012754cfe2
  1. 1
      juci/juci.cc
  2. 3
      juci/keybindings.cc
  3. 15
      juci/menu.cc
  4. 2
      juci/menu.h
  5. 3
      juci/window.cc

1
juci/juci.cc

@ -7,7 +7,6 @@ int main(int argc, char *argv[]) {
argc,
argv,
"no.sout.juci");
// app->set_flags(Gio::APPLICATION_NON_UNIQUE);
Window window;
return app->run(window);

3
juci/keybindings.cc

@ -4,11 +4,14 @@
Keybindings::Controller::Controller() {
action_group_ = Gtk::ActionGroup::create();
ui_manager_ = Gtk::UIManager::create();
}
Keybindings::Controller::~Controller(){
}
void Keybindings::Controller::set_ui_manager_action_group(Glib::RefPtr<Gtk::ActionGroup> action_group) {
ui_manager_->insert_action_group(action_group);
}
void Keybindings::Controller::set_ui_manger_string(std::string ui_string) {

15
juci/menu.cc

@ -38,6 +38,7 @@ Menu::Model::Model() {
" </menu> "
" <menu action='HelpMenu'> "
" <menuitem action='HelpAbout'/> "
" <menuitem action='HelpHide'/> "
" </menu> "
" </menubar> "
"</ui> ";
@ -81,14 +82,12 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
[this]() {
OnFileNewEmptyfile();
});
keybindings_.action_group()->add(Gtk::Action::create("FileNewCC",
Gtk::Stock::NEW, "New cc file", "Create a new cc file"),
keybindings_.action_group()->add(Gtk::Action::create("FileNewCC", "New cc file"),
Gtk::AccelKey("<control><alt>c"),
[this]() {
OnFileNewCCFile();
});
keybindings_.action_group()->add(Gtk::Action::create("FileNewH",
Gtk::Stock::NEW, "New h file", "Create a new h file"),
keybindings_.action_group()->add(Gtk::Action::create("FileNewH","New h file" ),
Gtk::AccelKey("<control><alt>h"),
[this]() {
OnFileNewHeaderFile();
@ -152,6 +151,12 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
[this]() {
OnHelpAbout();
});
keybindings_.action_group()->add(Gtk::Action::create("HelpHide"),
Gtk::AccelKey("<control><alt>K"),
[this]() {
OnHelpAbout();
});
/* END help menu */
@ -159,6 +164,8 @@ Menu::Controller::Controller(Keybindings::Controller keybindings) :
keybindings_.ui_manager()->add_ui_from_string(menu_model_.ui_string());
keybindings_.ui_manager()->insert_action_group(keybindings_.action_group());
}
Menu::Controller::~Controller() {

2
juci/menu.h

@ -31,6 +31,8 @@ namespace Menu {
protected:
Gtk::Box view_;
}; // class View
// controller
class Controller {
public:

3
juci/window.cc

@ -16,6 +16,9 @@ Window::Window() :
window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK);
window_box_.pack_start(source().view());
show_all_children();
//TODO(Oyvang, Forgi, Zalox) Find a better solution to hide menu items and still have the keybinding
keybindings_.action_group()->get_action("HelpHide")->set_visible(false);
show();
}
Source::Controller& Window::source() {

Loading…
Cancel
Save