- for(int i = 0; i < plugindb->total; i++)
- {
- if(plugindb->values[i]->theme &&
- !strcasecmp(preferences->theme, plugindb->values[i]->title))
- {
- PluginServer plugin = *plugindb->values[i];
- plugin.open_plugin(0, preferences, 0, 0);
- theme = plugin.new_theme();
- theme->mwindow = this;
- strcpy(theme->path, plugin.path);
- plugin.close_plugin();
- break;
+ PluginServer *theme_plugin = 0;
+ for(int i = 0; i < plugindb->total && !theme_plugin; i++) {
+ if( plugindb->values[i]->theme &&
+ !strcasecmp(preferences->theme, plugindb->values[i]->title) )
+ theme_plugin = plugindb->values[i];
+ }
+
+ if( !theme_plugin )
+ fprintf(stderr, _("MWindow::init_theme: prefered theme %s not found.\n"),
+ preferences->theme);
+
+ if( !theme_plugin && strcasecmp(preferences->theme, DEFAULT_THEME) ) {
+ fprintf(stderr, _("MWindow::init_theme: trying default theme %s\n"),
+ DEFAULT_THEME);
+ for(int i = 0; i < plugindb->total && !theme_plugin; i++) {
+ if( plugindb->values[i]->theme &&
+ !strcasecmp(DEFAULT_THEME, plugindb->values[i]->title) )
+ theme_plugin = plugindb->values[i];