Skip to content

Commit

Permalink
cool
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Sep 17, 2023
1 parent b9e1a28 commit 9944fd5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
3 changes: 0 additions & 3 deletions data/app.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<key name="recent-code-language" type="i">
<default>0</default>
</key>
<key name="recent-user-interface-language" enum="re.sonny.Workbench.UserInterfaceLanguage">
<default>'blueprint'</default>
</key>
</schema>
<schema id="@[email protected]" path="/re/sonny/Workbench/">
<key name="show-code" type="b">
Expand Down
16 changes: 1 addition & 15 deletions src/PanelUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import GObject from "gi://GObject";
import Gtk from "gi://Gtk";

import { LSPError } from "./lsp/LSP.js";
import {
unstack,
listenProperty,
settings as global_settings,
getLanguage,
} from "./util.js";
import { unstack, listenProperty, getLanguage } from "./util.js";

import {
setup as setupBlueprint,
Expand All @@ -20,8 +15,6 @@ const { addSignalMethods } = imports.signals;

const lang_blueprint = getLanguage("blueprint");
const lang_xml = getLanguage("xml");
// Make sure it matches app.gschhema.xml re.sonny.Workbench.UserInterfaceLanguage enum
// and dropdown_ui_lang
export const ui_languages = [lang_blueprint, lang_xml];

export default function PanelUI({
Expand Down Expand Up @@ -155,13 +148,6 @@ export default function PanelUI({
},
);

settings.connect("changed::user-interface-language", () => {
global_settings.set_enum(
"recent-user-interface-language",
settings.get_enum("user-interface-language"),
);
});

async function onChangeLang(lang) {
if (lang === lang_xml) {
try {
Expand Down
4 changes: 0 additions & 4 deletions src/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ export function createSessionFromDemo(demo) {
"code-language",
global_settings.get_int("recent-code-language"),
);
settings.set_enum(
"user-interface-language",
global_settings.get_enum("recent-user-interface-language"),
);

return session;
}
Expand Down
11 changes: 2 additions & 9 deletions src/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import Adw from "gi://Adw";
import Vte from "gi://Vte";

import * as xml from "./langs/xml/xml.js";
import { getLanguage, languages } from "./util.js";
import { languages } from "./util.js";
import Document from "./Document.js";
import PanelUI, { ui_languages } from "./PanelUI.js";
import PanelUI from "./PanelUI.js";
import PanelCode from "./PanelCode.js";
import PanelStyle from "./PanelStyle.js";
import Devtools from "./Devtools.js";
Expand Down Expand Up @@ -66,13 +66,6 @@ export default function Window({ application, session }) {

const { term_console } = Devtools({ application, window, builder, settings });

if (!file.get_child("main.xml").query_exists(null)) {
settings.set_enum(
"user-interface-language",
ui_languages.indexOf(getLanguage("blueprint")),
);
}

const document_javascript = Document({
code_view: builder.get_object("code_view_javascript"),
file: file.get_child("main.js"),
Expand Down

0 comments on commit 9944fd5

Please sign in to comment.