Application::Application() { std::string base_path = clan::System::get_exe_path(); if(clan::FileHelp::file_exists(base_path + "Resources/resources.xml") == false) base_path += "../"; clan::Directory::set_current(base_path); std::string global_resource_filename("../../Resources/GUIThemeAero/resources.xml"); std::string global_theme_filename("../../Resources/GUIThemeAero/theme.css"); std::string local_theme_filename("Resources/theme.css"); if (!clan::FileHelp::file_exists(global_resource_filename)) { global_resource_filename = "../../Resources/GUIThemeBasic/resources.xml"; global_theme_filename = "../../Resources/GUIThemeBasic/theme.css"; local_theme_filename = "Resources/theme_basic.css"; } gui.set_window_manager(window_manager); gui.add_theme(global_theme_filename); gui.add_theme(local_theme_filename); gui.add_resources(global_resource_filename); gui.add_resources("Resources/resources.xml"); }
int main(const std::vector<std::string> &args) { std::string resource_filename("../../Resources/GUIThemeAero/resources.xml"); std::string theme_filename("../../Resources/GUIThemeAero/theme.css"); std::string local_theme_filename("theme.css"); if (!clan::FileHelp::file_exists(resource_filename)) { resource_filename = "../../Resources/GUIThemeBasic/resources.xml"; std::string theme_filename("../../Resources/GUIThemeBasic/theme.css"); } clan::GUIWindowManagerSystem wm; clan::GUIManager gui; gui.set_window_manager(wm); gui.add_resources("resources.xml"); gui.add_resources(resource_filename); gui.add_theme(theme_filename); gui.add_theme(local_theme_filename); MainWindow mainwindow(&gui); gui.exec(); return 0; }