-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start on asset importer, implement themes.
- Loading branch information
=
committed
Apr 12, 2022
1 parent
7e0f14a
commit 7e39a40
Showing
42 changed files
with
540 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
package com.abysl.assetmanager | ||
|
||
import com.abysl.assetmanager.db.tables.PreferencesTable | ||
import kotlinx.coroutines.selects.select | ||
import okio.Path.Companion.toPath | ||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq | ||
import org.jetbrains.exposed.sql.transactions.transaction | ||
|
||
object Prefs { | ||
|
||
val HOME_FOLDER = ".abysl/assetmanager".toPath().toFile().also { it.mkdir() } | ||
val HOME_FOLDER = System.getProperty("user.home").toPath().toFile() | ||
.resolve(".abysl/assetmanager") | ||
.also { it.mkdirs() } | ||
val DB_FILE = HOME_FOLDER.resolve("assetmanager.sqlite").also { it.createNewFile() } | ||
val IMAGE_PATH = HOME_FOLDER.resolve("images").also { it.mkdirs() } | ||
val IMAGE_CACHE = IMAGE_PATH.resolve("cache").also { it.mkdirs() } | ||
|
||
val itchApiKey by lazy { PreferencesTable["itchApiKey"] } | ||
var itchApiKey: String | ||
get() = PreferencesTable["itchApiKey"] ?: "" | ||
set(value) { | ||
PreferencesTable["itchApiKey"] = value | ||
} | ||
|
||
var darkMode: Boolean | ||
get() = PreferencesTable["darkMode"] != "0" | ||
set(value) { | ||
PreferencesTable["darkMode"] = if(value) "1" else "0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
src/main/kotlin/com/abysl/assetmanager/db/migrations/AssetCreator.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 15 additions & 10 deletions
25
src/main/kotlin/com/abysl/assetmanager/db/tables/PreferencesTable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/kotlin/com/abysl/assetmanager/ui/components/ImportComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package com.abysl.assetmanager.ui.components | ||
|
Oops, something went wrong.