gui: Initialization cleanups
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
8b4d99c50c
commit
ec83acbdfe
|
@ -7,7 +7,8 @@
|
|||
#include <gui/tabs.h>
|
||||
|
||||
|
||||
static std::string share_dir = "";
|
||||
static std::string ocarina_dir = "";
|
||||
static Glib::RefPtr<Gtk::Application> ocarina_app;
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
@ -15,7 +16,7 @@ namespace gui
|
|||
|
||||
const std::string share_file(const std::string &f)
|
||||
{
|
||||
return share_dir + f;
|
||||
return ocarina_dir + f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,22 +30,23 @@ static void setup_share(const std::string &path)
|
|||
return;
|
||||
buf[len] = '\0';
|
||||
|
||||
share_dir = std::string(buf);
|
||||
share_dir = share_dir.substr(0, share_dir.size() - 11);
|
||||
share_dir = share_dir + "share/ocarina/";
|
||||
ocarina_dir = std::string(buf);
|
||||
ocarina_dir = ocarina_dir.substr(0, ocarina_dir.size() - 11);
|
||||
ocarina_dir = ocarina_dir + "share/ocarina/";
|
||||
}
|
||||
|
||||
static Gtk::Window *ocarina_init(int *argc, char ***argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Gtk::Window *window;
|
||||
|
||||
setup_share((*argv)[0]);
|
||||
setup_share(argv[0]);
|
||||
ocarina_app = Gtk::Application::create(argc, argv, "ocarina");
|
||||
|
||||
gui :: __O_BUILDER = Gtk::Builder::create();
|
||||
if (!gui::__O_BUILDER->add_from_file(gui::share_file("ocarina6.glade")))
|
||||
exit(1);
|
||||
|
||||
gst :: init(argc, argv);
|
||||
gst :: init(&argc, &argv);
|
||||
plist :: init();
|
||||
|
||||
core :: init();
|
||||
|
@ -53,15 +55,8 @@ static Gtk::Window *ocarina_init(int *argc, char ***argv)
|
|||
init_tabs();
|
||||
window = window_init();
|
||||
post_init_tabs();
|
||||
return window;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Glib::RefPtr<Gtk::Application> ocarina = Gtk::Application::create(argc, argv, "ocarina");
|
||||
|
||||
Gtk::Window *window = ocarina_init(&argc, &argv);
|
||||
ocarina->run(*window);
|
||||
ocarina_app->run(*window);
|
||||
cleanup_tabs();
|
||||
gst :: quit();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue