summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp3
-rw-r--r--src/gui/GladeFactory.cpp19
-rw-r--r--src/gui/LoadPatchWindow.cpp4
-rw-r--r--src/gui/LoadSubpatchWindow.cpp4
4 files changed, 13 insertions, 17 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 7e414297..615ac36f 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -34,6 +34,7 @@
#include "client/PatchModel.hpp"
#include "client/ClientStore.hpp"
#include "engine/Engine.hpp"
+#include "shared/runtime_paths.hpp"
#include "NodeModule.hpp"
#include "ControlPanel.hpp"
#include "SubpatchModule.hpp"
@@ -107,7 +108,7 @@ App::run(int argc, char** argv, Ingen::Shared::World* world)
_instance->configuration()->apply_settings();
// Set default window icon
- const Glib::ustring icon_path = INGEN_DATA_DIR "/ingen.svg";
+ const Glib::ustring icon_path = Shared::data_file_path("ingen.svg");
try {
if (Glib::file_test(icon_path, Glib::FILE_TEST_EXISTS))
Gtk::Window::set_default_icon_from_file(icon_path);
diff --git a/src/gui/GladeFactory.cpp b/src/gui/GladeFactory.cpp
index 81640d57..792e67ac 100644
--- a/src/gui/GladeFactory.cpp
+++ b/src/gui/GladeFactory.cpp
@@ -19,6 +19,7 @@
#include <iostream>
#include <fstream>
#include "config.h"
+#include "shared/runtime_paths.hpp"
using namespace std;
@@ -36,21 +37,15 @@ GladeFactory::find_glade_file()
if (env_path)
glade_filename = env_path;
else
- glade_filename = "./ingen_gui.glade";
+ glade_filename = Shared::data_file_path("ingen_gui.glade");
ifstream fs(glade_filename.c_str());
- if (fs.fail()) { // didn't find it, check INGEN_DATA_DIR
- fs.clear();
- glade_filename = INGEN_DATA_DIR;
- glade_filename += "/ingen_gui.glade";
-
- fs.open(glade_filename.c_str());
- if (fs.fail()) {
- cerr << "[GladeFactory] Unable to find ingen_gui.glade in current directory or " << INGEN_DATA_DIR << "." << endl;
- throw;
- }
- fs.close();
+ if (fs.fail()) {
+ cerr << "Unable to find ingen_gui.glade in " << INGEN_DATA_DIR << endl;
+ throw;
}
+
+ fs.close();
cerr << "[GladeFactory] Loading widgets from " << glade_filename.c_str() << endl;
}
diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp
index fdbc3c23..caa6c8bf 100644
--- a/src/gui/LoadPatchWindow.cpp
+++ b/src/gui/LoadPatchWindow.cpp
@@ -21,6 +21,7 @@
#include "LoadPatchWindow.hpp"
#include "interface/EngineInterface.hpp"
#include "client/PatchModel.hpp"
+#include "shared/runtime_paths.hpp"
#include "App.hpp"
#include "Configuration.hpp"
#include "ThreadedLoader.hpp"
@@ -60,8 +61,7 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno
set_filter(filt);
// Add global examples directory to "shortcut folders" (bookmarks)
- string examples_dir = INGEN_DATA_DIR;
- examples_dir.append("/patches");
+ const string examples_dir = Shared::data_file_path("patches");
DIR* d = opendir(examples_dir.c_str());
if (d != NULL)
add_shortcut_folder(examples_dir);
diff --git a/src/gui/LoadSubpatchWindow.cpp b/src/gui/LoadSubpatchWindow.cpp
index 71dbfb36..5bdd8ea6 100644
--- a/src/gui/LoadSubpatchWindow.cpp
+++ b/src/gui/LoadSubpatchWindow.cpp
@@ -22,6 +22,7 @@
#include "interface/EngineInterface.hpp"
#include "client/NodeModel.hpp"
#include "client/PatchModel.hpp"
+#include "shared/runtime_paths.hpp"
#include "App.hpp"
#include "LoadSubpatchWindow.hpp"
#include "PatchView.hpp"
@@ -65,8 +66,7 @@ LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefP
property_select_multiple() = true;
// Add global examples directory to "shortcut folders" (bookmarks)
- string examples_dir = INGEN_DATA_DIR;
- examples_dir.append("/patches");
+ const string examples_dir = Shared::data_file_path("patches");
DIR* d = opendir(examples_dir.c_str());
if (d != NULL)
add_shortcut_folder(examples_dir);