🔥 Replace BaseL10n with Translation
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / main / SoneModule.kt
index 8f018f5..97b342a 100644 (file)
@@ -8,9 +8,9 @@ import com.google.inject.matcher.*
 import com.google.inject.name.Names.*
 import com.google.inject.spi.*
 import freenet.l10n.*
-import net.pterodactylus.sone.core.*
 import net.pterodactylus.sone.database.*
 import net.pterodactylus.sone.database.memory.*
+import net.pterodactylus.sone.freenet.*
 import net.pterodactylus.sone.freenet.wot.*
 import net.pterodactylus.util.config.*
 import net.pterodactylus.util.config.ConfigurationException
@@ -51,9 +51,10 @@ open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus:
                bind(PluginYear::class.java).toInstance(PluginYear(sonePlugin.year))
                bind(PluginHomepage::class.java).toInstance(PluginHomepage(sonePlugin.homepage))
                bind(Database::class.java).to(MemoryDatabase::class.java).`in`(Singleton::class.java)
-               bind(BaseL10n::class.java).toInstance(sonePlugin.l10n().base)
+               bind(Translation::class.java).toInstance(BaseL10nTranslation(sonePlugin.l10n().base))
                loaders?.let { bind(Loaders::class.java).toInstance(it) }
                bind(MetricRegistry::class.java).`in`(Singleton::class.java)
+               bind(WebOfTrustConnector::class.java).to(PluginWebOfTrustConnector::class.java).`in`(Singleton::class.java)
 
                bindListener(Matchers.any(), object : TypeListener {
                        override fun <I> hear(typeLiteral: TypeLiteral<I>, typeEncounter: TypeEncounter<I>) {
@@ -62,13 +63,6 @@ open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus:
                })
        }
 
-       @Provides
-       @Singleton
-       fun getCore(configuration: Configuration, freenetInterface: FreenetInterface, identityManager: IdentityManager, soneDownloader: SoneDownloader, imageInserter: ImageInserter, updateChecker: UpdateChecker, webOfTrustUpdater: WebOfTrustUpdater, eventBus: EventBus, database: Database) =
-                       Core(configuration, freenetInterface, identityManager, soneDownloader, imageInserter, updateChecker, webOfTrustUpdater, eventBus, database).apply {
-                               debugInformation.showVersionInformation = configuration.getBooleanValue("Debug/ShowVersionInformation").getValue(false)
-                       }.also(eventBus::register)
-
 }
 
 private fun String.parseVersion(): Version = Version.parse(this)