()
| 164 | } |
| 165 | |
| 166 | public MainWindow() throws IOException { |
| 167 | mainFrame = new JFrame("RipMe v" + UpdateUtils.getThisJarVersion()); |
| 168 | mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 169 | mainFrame.setLayout(new GridBagLayout()); |
| 170 | |
| 171 | createUI(mainFrame.getContentPane()); |
| 172 | pack(); |
| 173 | |
| 174 | loadHistory(); |
| 175 | setupHandlers(); |
| 176 | |
| 177 | Thread shutdownThread = new Thread(this::shutdownCleanup); |
| 178 | Runtime.getRuntime().addShutdownHook(shutdownThread); |
| 179 | |
| 180 | if (Utils.getConfigBoolean("auto.update", true)) { |
| 181 | upgradeProgram(); |
| 182 | } |
| 183 | |
| 184 | boolean autoripEnabled = Utils.getConfigBoolean("clipboard.autorip", false); |
| 185 | ClipboardUtils.setClipboardAutoRip(autoripEnabled); |
| 186 | trayMenuAutorip.setState(autoripEnabled); |
| 187 | } |
| 188 | |
| 189 | private void upgradeProgram() { |
| 190 | if (!configurationPanel.isVisible()) { |
nothing calls this directly
no test coverage detected