Browse Source

added custom keyindings where stock gtk bindings were used.

master
tedjk 11 years ago
parent
commit
0e3c551c53
  1. 15
      juci/api_ext.cc
  2. 2
      juci/config.json
  3. 2
      juci/menu.cc
  4. 2
      juci/menu.xml
  5. 12
      juci/notebook.cc
  6. 6
      juci/window.cc

15
juci/api_ext.cc

@ -0,0 +1,15 @@
#include "api.h"
BOOST_PYTHON_MODULE(juci_to_python_api) {
using namespace boost::python;
// plugin inclusion
def("addMenuElement", &libjuci::AddMenuElement);
def("addSubMenuElement", &libjuci::AddSubMenuElement);
def("loadPlugin", &libjuci::LoadPlugin);
def("initPlugin", &libjuci::InitPlugin);
// text editing
def("replaceLine", &libjuci::ReplaceLine);
def("replaceWord", &libjuci::ReplaceWord);
def("getWord", &libjuci::GetWord);
} // module::juci_to_python_api

2
juci/config.json

@ -32,10 +32,12 @@
},
"keybindings": {
"split_window": "<control><alt>s",
"new_file": "<control>n",
"new_h_file": "<control><alt>h",
"new_cc_file": "<alt>c",
"close_tab": "<control>w",
"open_folder": "<control><alt>o",
"open_file": "<control>o",
"edit_undo": "<control>z",
"save": "<control>s",
"save_as": "<control><shift>s",

2
juci/menu.cc

@ -15,7 +15,7 @@ Menu::Controller::Controller(Keybindings::Controller& keybindings) :
menu_view_(Gtk::ORIENTATION_VERTICAL),
keybindings_(keybindings) {
keybindings_.action_group_menu()->add(Gtk::Action::create("FileNew",
Gtk::Stock::FILE));
"New File"));
keybindings_.action_group_menu()->add(Gtk::Action::create("EditMenu",
Gtk::Stock::EDIT));
keybindings_.action_group_menu()->add(Gtk::Action::create("WindowMenu",

2
juci/menu.xml

@ -6,7 +6,7 @@
<menuitem action='FileNewCC'/>
<menuitem action='FileNewH'/>
</menu>
<menuitem action='FileOpenFile'/>
<menuitem action='FileOpenFile'/>
<menuitem action='FileOpenFolder'/>
<menuitem action='FileSave'/>
<menuitem action='FileSaveAs'/>

12
juci/notebook.cc

@ -42,17 +42,17 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller
Gtk::Stock::FILE));
keybindings.action_group_menu()->
add(Gtk::Action::create("FileNewStandard",
Gtk::Stock::NEW,
"New empty file",
"Create a new file"),
add(Gtk::Action::create("FileNewStandard",
"New empty file"),
Gtk::AccelKey(keybindings.config_
.key_map()["new_file"]),
[this]() {
is_new_file_ = true;
OnFileNewEmptyfile();
});
keybindings.action_group_menu()->
add(Gtk::Action::create("FileNewCC",
"New cc file"),
"New source file"),
Gtk::AccelKey(keybindings.config_
.key_map()["new_cc_file"]),
[this]() {
@ -61,7 +61,7 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller
});
keybindings.action_group_menu()->
add(Gtk::Action::create("FileNewH",
"New h file"),
"New header file"),
Gtk::AccelKey(keybindings.config_
.key_map()["new_h_file"]),
[this]() {

6
juci/window.cc

@ -21,7 +21,9 @@ Window::Window() :
OnWindowHide();
});
keybindings_.action_group_menu()->add(Gtk::Action::create("FileOpenFile",
Gtk::Stock::OPEN),
"Open file"),
Gtk::AccelKey(keybindings_.config_
.key_map()["open_file"]),
[this]() {
OnOpenFile();
});
@ -42,7 +44,7 @@ Window::Window() :
});
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSave",
"Save"),
"Save file"),
Gtk::AccelKey(keybindings_.config_
.key_map()["save"]),
[this]() {

Loading…
Cancel
Save