dammit op
This commit is contained in:
@@ -236,7 +236,7 @@ public interface OpenOSRSConfig extends Config
|
||||
)
|
||||
default Color miscellaneousColor()
|
||||
{
|
||||
return new Color(243, 85, 136, 255);
|
||||
return new Color(243, 85, 136, 255);
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@@ -361,10 +361,13 @@ public interface OpenOSRSConfig extends Config
|
||||
void setExternalRepositories(String val);
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "warning",
|
||||
name = "",
|
||||
description = "",
|
||||
hidden = true
|
||||
keyName = "warning",
|
||||
name = "",
|
||||
description = "",
|
||||
hidden = true
|
||||
)
|
||||
default boolean warning(){return true;}
|
||||
default boolean warning()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,8 +359,6 @@ public class ExternalPluginManager
|
||||
return openOSRSConfig.warning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This method is a fail safe to ensure that no duplicate
|
||||
* repositories end up getting saved to the config.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.runelite.client.plugins.openosrs.externals;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -8,7 +10,15 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import javax.inject.Inject;
|
||||
import javax.swing.*;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.ExternalPluginManager;
|
||||
@@ -87,20 +97,20 @@ public class ExternalPluginManagerPanel extends PluginPanel
|
||||
@Override
|
||||
public void mousePressed(MouseEvent mouseEvent)
|
||||
{
|
||||
if(externalPluginManager.getWarning()) {
|
||||
if (externalPluginManager.getWarning())
|
||||
{
|
||||
JCheckBox checkbox = new JCheckBox("Don't show again.");
|
||||
Object[] options = {"Okay, I accept the risk", "Never mind, turn back", checkbox};
|
||||
int answer = JOptionPane.showOptionDialog(new JFrame(),
|
||||
"Adding plugins from unverified sources may put your account, or personal information at risk! \n",
|
||||
"Account security warning",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.WARNING_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
int answer = showWarningDialog(checkbox);
|
||||
|
||||
if(answer == 1) return;
|
||||
if(checkbox.isSelected()) externalPluginManager.setWarning(false);
|
||||
if (answer == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkbox.isSelected())
|
||||
{
|
||||
externalPluginManager.setWarning(false);
|
||||
}
|
||||
}
|
||||
|
||||
JTextField owner = new JTextField();
|
||||
@@ -154,23 +164,22 @@ public class ExternalPluginManagerPanel extends PluginPanel
|
||||
@Override
|
||||
public void mousePressed(MouseEvent mouseEvent)
|
||||
{
|
||||
if(externalPluginManager.getWarning()) {
|
||||
if (externalPluginManager.getWarning())
|
||||
{
|
||||
JCheckBox checkbox = new JCheckBox("Don't show again.");
|
||||
Object[] options = {"Okay, I accept the risk", "Never mind, turn back", checkbox};
|
||||
int answer = JOptionPane.showOptionDialog(new JFrame(),
|
||||
"Adding plugins from unverified sources may put your account, or personal information at risk! \n",
|
||||
"Account security warning",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.WARNING_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
int answer = showWarningDialog(checkbox);
|
||||
|
||||
if(answer == 1) return;
|
||||
if(checkbox.isSelected()) externalPluginManager.setWarning(false);
|
||||
if (answer == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkbox.isSelected())
|
||||
{
|
||||
externalPluginManager.setWarning(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
JTextField id = new JTextField();
|
||||
JTextField url = new JTextField();
|
||||
Object[] message = {
|
||||
@@ -258,6 +267,19 @@ public class ExternalPluginManagerPanel extends PluginPanel
|
||||
return mainTabPane;
|
||||
}
|
||||
|
||||
private int showWarningDialog(JCheckBox checkbox)
|
||||
{
|
||||
Object[] options = {"Okay, I accept the risk", "Never mind, turn back", checkbox};
|
||||
return JOptionPane.showOptionDialog(new JFrame(),
|
||||
"Adding plugins from unverified sources may put your account, or personal information at risk! \n",
|
||||
"Account security warning",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.WARNING_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
}
|
||||
|
||||
static JScrollPane wrapContainer(final JPanel container)
|
||||
{
|
||||
final JPanel wrapped = new JPanel(new BorderLayout());
|
||||
|
||||
Reference in New Issue
Block a user