Skip to content

Commit

Permalink
Remove code for unused "Open UI" function
Browse files Browse the repository at this point in the history
  • Loading branch information
QuickMythril committed Jan 4, 2024
1 parent 687667c commit 8caf5bf
Show file tree
Hide file tree
Showing 20 changed files with 2 additions and 108 deletions.
51 changes: 0 additions & 51 deletions src/main/java/org/qortal/gui/SysTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.qortal.controller.Controller;
import org.qortal.globalization.Translator;
import org.qortal.settings.Settings;
import org.qortal.utils.RandomizeList;
import org.qortal.utils.URLViewer;

import javax.swing.*;
Expand Down Expand Up @@ -140,14 +139,6 @@ public void popupMenuCanceled(PopupMenuEvent e) {
}
});

/* JMenuItem openUi = new JMenuItem(Translator.INSTANCE.translate("SysTray", "OPEN_UI"));
openUi.addActionListener(actionEvent -> {
destroyHiddenDialog();
new OpenUiWorker().execute();
});
menu.add(openUi); */

JMenuItem openTimeCheck = new JMenuItem(Translator.INSTANCE.translate("SysTray", "CHECK_TIME_ACCURACY"));
openTimeCheck.addActionListener(actionEvent -> {
destroyHiddenDialog();
Expand Down Expand Up @@ -190,48 +181,6 @@ public void popupMenuCanceled(PopupMenuEvent e) {
return menu;
}

static class OpenUiWorker extends SwingWorker<Void, Void> {
@Override
protected Void doInBackground() {
List<String> uiServers = new ArrayList<>();

String[] remoteUiServers = Settings.getInstance().getRemoteUiServers();
uiServers.addAll(Arrays.asList(remoteUiServers));
// Randomize remote servers
uiServers = RandomizeList.randomize(uiServers);

// Prepend local servers
String[] localUiServers = Settings.getInstance().getLocalUiServers();
uiServers.addAll(0, Arrays.asList(localUiServers));

// Check each server in turn before opening browser tab
int uiPort = Settings.getInstance().getUiServerPort();
for (String uiServer : uiServers) {
InetSocketAddress socketAddress = new InetSocketAddress(uiServer, uiPort);

// If we couldn't resolve try next
if (socketAddress.isUnresolved())
continue;

try (SocketChannel socketChannel = SocketChannel.open()) {
socketChannel.socket().connect(socketAddress, 100);

// If we reach here, then socket connected to UI server!
URLViewer.openWebpage(new URL(String.format("http://%s:%d", uiServer, uiPort)));

return null;
} catch (IOException e) {
// try next server
} catch (Exception e) {
LOGGER.error("Unable to open UI website in browser");
return null;
}
}

return null;
}
}

static class SynchronizeClockWorker extends SwingWorker<Void, Void> {
@Override
protected Void doInBackground() {
Expand Down
21 changes: 0 additions & 21 deletions src/main/java/org/qortal/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ public class Settings {
private String bindAddress = "::"; // Use IPv6 wildcard to listen on all local addresses
private String bindAddressFallback = "0.0.0.0"; // Some systems are unable to bind using IPv6

// UI servers
private int uiPort = 12388;
private String[] uiLocalServers = new String[] {
"localhost", "127.0.0.1"
};
private String[] uiRemoteServers = new String[] {
// None exist anymore
};

// API-related
private boolean apiEnabled = true;
private Integer apiPort;
Expand Down Expand Up @@ -619,18 +610,6 @@ public String getLocaleLang() {
return this.localeLang;
}

public int getUiServerPort() {
return this.uiPort;
}

public String[] getLocalUiServers() {
return this.uiLocalServers;
}

public String[] getRemoteUiServers() {
return this.uiRemoteServers;
}

public boolean isApiEnabled() {
return this.apiEnabled;
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = Münzprägung inaktiv

MINTING_ENABLED = \u2714 Münzprägung aktiv

OPEN_UI = Öffne Benutzeroberfläche

PERFORMING_DB_CHECKPOINT = Speichere unerfasste Datenbankänderungen...

PERFORMING_DB_MAINTENANCE = Planmäßige Wartung wird durchgeführt...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = NOT minting

MINTING_ENABLED = \u2714 Minting

OPEN_UI = Open UI

PERFORMING_DB_CHECKPOINT = Saving uncommitted database changes...

PERFORMING_DB_MAINTENANCE = Performing scheduled maintenance...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ MINTING_DISABLED = Acuñación NO habilitada

MINTING_ENABLED = \u2714 Acuñación habilitada

OPEN_UI = IU abierta

PERFORMING_DB_CHECKPOINT = Guardando cambios de base de datos no confirmados...

PERFORMING_DB_MAINTENANCE = Realizando mantenimiento programado...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_fi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = EI lyö rahaa

MINTING_ENABLED = \u2714 Lyö rahaa

OPEN_UI = Avaa UI

PERFORMING_DB_CHECKPOINT = Tallentaa kommittoidut tietokantamuutokset...

PERFORMING_DB_MAINTENANCE = Suoritetaan määräaikaishuoltoa...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = NE mint PAS

MINTING_ENABLED = \u2714 Minting

OPEN_UI = Ouvrir l'interface

PERFORMING_DB_CHECKPOINT = Enregistrement des modifications de base de données non validées...

PERFORMING_DB_MAINTENANCE = Entrain d'effectuer la maintenance programmée...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_he.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = כרייה מבוטלת

MINTING_ENABLED = \u2714 הטבעה

OPEN_UI = ממשק משתמש פתוח

PERFORMING_DB_CHECKPOINT = שומר שינויים לא מחויבים במסד הנתונים...

PERFORMING_DB_MAINTENANCE = מבצע תחזוקה מתוזמנת...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_hu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = QORT-érmeverés jelenleg nincs folyamatban

MINTING_ENABLED = \u2714 QORT-érmeverés folyamatban

OPEN_UI = Felhasználói felület megnyitása

PERFORMING_DB_CHECKPOINT = Mentetlen adatbázis-módosítások mentése...

PERFORMING_DB_MAINTENANCE = Ütemezett karbantartás...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = Conio disabilitato

MINTING_ENABLED = \u2714 Conio abilitato

OPEN_UI = Apri UI

PERFORMING_DB_CHECKPOINT = Salvataggio delle modifiche del database non salvate...

PERFORMING_DB_MAINTENANCE = Manutenzione programmata dell'efficienza...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_jp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = ミント一時中止中

MINTING_ENABLED = \u2714 ミント

OPEN_UI = UIを開く

PERFORMING_DB_CHECKPOINT = コミットされていないデータベースの変更を保存中...

PERFORMING_DB_MAINTENANCE = 定期メンテナンスを実行中...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = 민팅중이 아님

MINTING_ENABLED = \u2714 민팅

OPEN_UI = UI 열기

PERFORMING_DB_CHECKPOINT = 커밋되지 않은 데이터베이스 변경 내용을 저장하는 중...

PERFORMING_DB_MAINTENANCE = 예약된 유지 관리 수행 중...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = Minten is uitgeschakeld

MINTING_ENABLED = \u2714 Minten is actief

OPEN_UI = Open UI

PERFORMING_DB_CHECKPOINT = De database wordt bijgewerkt...

PERFORMING_DB_MAINTENANCE = Bezig met gepland onderhoud...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ MINTING_DISABLED = Mennica zamknięta

MINTING_ENABLED = \u2714 Mennica aktywna

OPEN_UI = Otwórz interfejs użytkownika

PERFORMING_DB_CHECKPOINT = Zapisywanie niezaksięgowanych zmian w bazie danych...

PERFORMING_DB_MAINTENANCE = Performing scheduled maintenance...
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/i18n/SysTray_ro.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ MINTING_DISABLED = nu produce moneda

MINTING_ENABLED = \u2714 Minting

OPEN_UI = Deschidere interfata utilizator IU

PERFORMING_DB_CHECKPOINT = Salvarea modificarilor nerealizate ale bazei de date...

PERFORMING_DB_MAINTENANCE = Efectuarea intretinerii programate
PERFORMING_DB_MAINTENANCE = Efectuarea intretinerii programate

SYNCHRONIZE_CLOCK = Sincronizare ceas

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = Чеканка отключена

MINTING_ENABLED = \u2714 Чеканка активна

OPEN_UI = Открыть пользовательский интерфейс

PERFORMING_DB_CHECKPOINT = Сохранение незафиксированных изменений базы данных...

PERFORMING_DB_MAINTENANCE = Выполнение планового технического обслуживания...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ MINTING_DISABLED = Präglar INTE

MINTING_ENABLED = \u2714 Präglar

OPEN_UI = Öppna UI

PERFORMING_DB_CHECKPOINT = Sparar oengagerade databasändringar...

PERFORMING_DB_MAINTENANCE = Utför schemalagt underhåll...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = 没有铸币

MINTING_ENABLED = \u2714 铸币

OPEN_UI = 开启Qortal界面

PERFORMING_DB_CHECKPOINT = 正在保存未提交的数据库修订...

PERFORMING_DB_MAINTENANCE = 正在执行定期数据库维护...
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/i18n/SysTray_zh_TW.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MINTING_DISABLED = 沒有鑄幣

MINTING_ENABLED = \u2714 鑄幣

OPEN_UI = 開啓Qortal界面

PERFORMING_DB_CHECKPOINT = 正在保存未提交的數據庫修訂...

PERFORMING_DB_MAINTENANCE = 正在執行數據庫定期維護...
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/qortal/test/apps/CheckTranslations.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CheckTranslations {
private static final String[] SUPPORTED_LANGS = new String[] { "en", "de", "zh", "ru" };
private static final Set<String> SYSTRAY_KEYS = Set.of("AUTO_UPDATE", "APPLYING_UPDATE_AND_RESTARTING", "BLOCK_HEIGHT",
"BUILD_VERSION", "CHECK_TIME_ACCURACY", "CONNECTING", "CONNECTION", "CONNECTIONS", "CREATING_BACKUP_OF_DB_FILES",
"DB_BACKUP", "DB_CHECKPOINT", "EXIT", "LITE_NODE", "MINTING_DISABLED", "MINTING_ENABLED", "OPEN_UI", "PERFORMING_DB_CHECKPOINT",
"DB_BACKUP", "DB_CHECKPOINT", "EXIT", "LITE_NODE", "MINTING_DISABLED", "MINTING_ENABLED", "PERFORMING_DB_CHECKPOINT",
"SYNCHRONIZE_CLOCK", "SYNCHRONIZING_BLOCKCHAIN", "SYNCHRONIZING_CLOCK");

private static String failurePrefix;
Expand Down

0 comments on commit 8caf5bf

Please sign in to comment.