Browse Source

removed static project path

master
tedjk 11 years ago
parent
commit
b3e6c81b25
  1. 10
      juci/api.cc
  2. 3
      juci/api.h

10
juci/api.cc

@ -8,6 +8,13 @@ Notebook::Controller* PluginApi::notebook_;
//// API ServiceProvider ////
/////////////////////////////
std::string PluginApi::ProjectPath()
{
int MAXPATHLEN = 50;
char temp[MAXPATHLEN];
return ( getcwd(temp, MAXPATHLEN) ? std::string( temp ) : std::string("") );
}
void PluginApi::ReplaceWord(std::string word) {
Glib::RefPtr<Gtk::TextBuffer> buffer = libjuci::BufferFromNotebook();
Gtk::TextIter word_start = libjuci::IterFromNotebook();
@ -44,7 +51,8 @@ std::string PluginApi::GetWord() {
//runs the pythonscript that initiates every plugin within plugins/
void PluginApi::InitPlugins() {
libjuci::LoadPlugin(g_project_root+"plugins.py");
//libjuci::LoadPlugin(g_project_root+"plugins.py");
libjuci::LoadPlugin(ProjectPath()+"/plugins.py");
}
void PluginApi::AddMenuElement(std::string plugin_name){

3
juci/api.h

@ -7,8 +7,6 @@
#include "notebook.h"
#include "menu.h"
const std::string g_project_root("/home/forgie/app/juci/");
////////////////////
//// Plugin Api ////
////////////////////
@ -18,6 +16,7 @@ const std::string g_project_root("/home/forgie/app/juci/");
static Notebook::Controller* notebook_;
static void InitPlugins();
static std::string ProjectPath();
//for Python module:
static std::string GetWord();

Loading…
Cancel
Save