Some TODOs
This commit is contained in:
parent
bdd86c7683
commit
2ca25a7bee
|
@ -0,0 +1,14 @@
|
|||
package extensions.org.gnome.adw.ActionRow;
|
||||
|
||||
import io.gitlab.jfronny.inceptum.gtk.control.ILabel;
|
||||
import manifold.ext.rt.api.Extension;
|
||||
import manifold.ext.rt.api.This;
|
||||
import org.gnome.adw.ActionRow;
|
||||
import org.gtk.gtk.Label;
|
||||
|
||||
@Extension
|
||||
public class ActionRowExt {
|
||||
public static void fixSubtitle(@This ActionRow thiz) {
|
||||
ILabel.theme((Label) thiz.firstChild.lastChild.prevSibling.lastChild, ILabel.Mode.SUBTITLE);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@ package io.gitlab.jfronny.inceptum.gtk.control;
|
|||
import io.gitlab.jfronny.commons.LazySupplier;
|
||||
import io.gitlab.jfronny.inceptum.gtk.GtkMain;
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.I18n;
|
||||
import manifold.util.concurrent.Cache;
|
||||
import org.gtk.gtk.*;
|
||||
import org.jetbrains.annotations.PropertyKey;
|
||||
|
||||
|
@ -21,20 +20,24 @@ public class ILabel extends Label {
|
|||
return provider;
|
||||
});
|
||||
|
||||
public static void theme(Label label, Mode mode) {
|
||||
switch (mode) {
|
||||
case HEADING -> label.addCssClass("heading");
|
||||
case SUBTITLE -> {
|
||||
label.addCssClass("jf-subtitle");
|
||||
label.styleContext.addProvider(provider.get(), Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
case NORMAL -> {}
|
||||
}
|
||||
}
|
||||
|
||||
public ILabel(@PropertyKey(resourceBundle = I18n.BUNDLE) String str) {
|
||||
this(str, Mode.NORMAL);
|
||||
}
|
||||
|
||||
public ILabel(@PropertyKey(resourceBundle = I18n.BUNDLE) String str, Mode mode) {
|
||||
super(I18n.get(str));
|
||||
switch (mode) {
|
||||
case HEADING -> addCssClass("heading");
|
||||
case SUBTITLE -> {
|
||||
addCssClass("jf-subtitle");
|
||||
styleContext.addProvider(provider.get(), Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
case NORMAL -> {}
|
||||
}
|
||||
theme(this, mode);
|
||||
}
|
||||
|
||||
public enum Mode {
|
||||
|
|
|
@ -51,6 +51,7 @@ public class InstanceListEntryFactory extends SignalListItemFactory {
|
|||
row.addPrefix(thumbnail);
|
||||
row.addSuffix(launch);
|
||||
row.addSuffix(menu);
|
||||
row.fixSubtitle();
|
||||
|
||||
var rightClicked = new GestureClick();
|
||||
rightClicked.button = 3;
|
||||
|
@ -66,7 +67,12 @@ public class InstanceListEntryFactory extends SignalListItemFactory {
|
|||
onBind(item -> {
|
||||
Decomposed li = Decomposed.of((ListItem) item, instanceList);
|
||||
|
||||
li.item.activatable = !li.instance.isLocked; //TODO add message / gray out
|
||||
if (li.instance.isLocked) {
|
||||
li.item.activatable = false;
|
||||
li.row.setSubtitle(li.instance.isRunningLocked
|
||||
? I18n.get("instance.launch.locked.running")
|
||||
: I18n.get("instance.launch.locked.setup"));
|
||||
}
|
||||
|
||||
li.row.title = li.instance.toString();
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
|
||||
public class InstanceSettingsWindow extends Window {
|
||||
//TODO improve by having multiple lists on one page
|
||||
public InstanceSettingsWindow(Application app, Instance instance) {
|
||||
this.application = app;
|
||||
|
||||
|
@ -121,15 +120,11 @@ public class InstanceSettingsWindow extends Window {
|
|||
lb.append(row);
|
||||
}
|
||||
}
|
||||
//TODO: Implement
|
||||
/*
|
||||
General
|
||||
- Open Directory (button)
|
||||
- Version (dropdown) + checkbox: "show snapshots"
|
||||
- Fabric support (checkbox) + dropdown: Loader version
|
||||
- Delete (button) -> confirmation + delete
|
||||
- Custom Java (checkbox) + String: path
|
||||
*/
|
||||
//TODO Open Directory (button)
|
||||
//TODO Version (dropdown) + checkbox: "show snapshots"
|
||||
//TODO Fabric support (checkbox) + dropdown: Loader version
|
||||
//TODO Delete (button) -> confirmation + delete
|
||||
//TODO Custom Java (checkbox) + String: path
|
||||
stack.addTitledWithIcon(box, null, I18n.get("instance.settings.general"), "preferences-other-symbolic");
|
||||
}
|
||||
|
||||
|
@ -138,11 +133,7 @@ public class InstanceSettingsWindow extends Window {
|
|||
var box = new Box(Orientation.VERTICAL, 0);
|
||||
box.marginHorizontal = 24;
|
||||
box.marginTop = 12;
|
||||
//TODO: Implement
|
||||
/*
|
||||
Mods:
|
||||
- show "currently unsupported in GTK UI (idk how I'd visualize this)
|
||||
*/
|
||||
//TODO show "currently unsupported in GTK UI (idk how I'd visualize this)
|
||||
stack.addTitledWithIcon(box, null, I18n.get("instance.settings.mods"), "package-x-generic-symbolic");
|
||||
}
|
||||
|
||||
|
@ -151,13 +142,9 @@ public class InstanceSettingsWindow extends Window {
|
|||
var box = new Box(Orientation.VERTICAL, 0);
|
||||
box.marginHorizontal = 24;
|
||||
box.marginTop = 12;
|
||||
//TODO: Implement
|
||||
/*
|
||||
Export:
|
||||
- CurseForge (button) -> see imgui
|
||||
- Modrinth (button) -> see imgui
|
||||
- MultiMC (button) -> see imgui
|
||||
*/
|
||||
//TODO CurseForge (button) -> see imgui
|
||||
//TODO Modrinth (button) -> see imgui
|
||||
//TODO MultiMC (button) -> see imgui
|
||||
stack.addTitledWithIcon(box, null, I18n.get("instance.settings.export"), "send-to-symbolic");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
package io.gitlab.jfronny.inceptum.gtk.window;
|
||||
|
||||
import io.gitlab.jfronny.inceptum.gtk.GtkMain;
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.ListIndexModel;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.launch.LaunchType;
|
||||
import org.gnome.adw.Clamp;
|
||||
import org.gnome.adw.StatusPage;
|
||||
import org.gtk.gio.Menu;
|
||||
import org.gtk.glib.GLib;
|
||||
import org.gtk.gtk.*;
|
||||
import io.gitlab.jfronny.inceptum.common.*;
|
||||
import io.gitlab.jfronny.inceptum.gtk.GtkMenubar;
|
||||
import io.gitlab.jfronny.inceptum.gtk.control.InstanceGridEntryFactory;
|
||||
import io.gitlab.jfronny.inceptum.gtk.control.InstanceListEntryFactory;
|
||||
import io.gitlab.jfronny.inceptum.gtk.menu.MenuBuilder;
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.I18n;
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.ListIndexModel;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.instance.Instance;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.instance.InstanceList;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.launch.LaunchType;
|
||||
import org.gnome.adw.Clamp;
|
||||
import org.gnome.adw.StatusPage;
|
||||
import org.gtk.gio.Menu;
|
||||
import org.gtk.glib.GLib;
|
||||
import org.gtk.gtk.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
@ -129,7 +128,7 @@ public class MainWindow extends ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
private void setupDirWatcher() throws IOException { //TODO test (including after lock state change)
|
||||
private void setupDirWatcher() throws IOException { //TODO fix this never running properly (or at least not updating)
|
||||
WatchService ws = FileSystems.getDefault().newWatchService();
|
||||
MetaHolder.INSTANCE_DIR.register(ws, ENTRY_MODIFY, ENTRY_CREATE, ENTRY_DELETE);
|
||||
int source = GLib.idleAdd(() -> {
|
||||
|
|
|
@ -50,4 +50,4 @@ instance.settings.general.args.server=Server
|
|||
instance.settings.general.args.client.subtitle=Arguments to add to Minecraft Clients
|
||||
instance.settings.general.args.server.subtitle=Arguments to add to Minecraft Servers
|
||||
instance.settings.export=Export
|
||||
instance.settings.mods=Mods
|
||||
instance.settings.mods=Mods
|
|
@ -50,4 +50,4 @@ instance.settings.general.args.server=Server
|
|||
instance.settings.general.args.client.subtitle=Argumente für Minecraft-Clients
|
||||
instance.settings.general.args.server.subtitle=Argumente für Minecraft-Server
|
||||
instance.settings.export=Export
|
||||
instance.settings.mods=Mods
|
||||
instance.settings.mods=Mods
|
Loading…
Reference in New Issue