Skip to content

Commit f7ba279

Browse files
author
updating-bot
committed
mirroring bot - 2024/11/15
1 parent 53d62db commit f7ba279

36 files changed

+1082
-951
lines changed

svn_trunk/src/jd/controlling/faviconcontroller/FavIcons.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,11 @@ public static BufferedImage getCroppedImage(final BufferedImage source, final bo
566566
}
567567
}
568568
int y1 = j + 1;
569-
if (x0 == 0 && y0 == 0 && (x1 - x0) == width && (y1 - y0) == height) {
569+
if (x0 == width && y0 == height) {
570+
// complete empty/transparent picture
571+
return source;
572+
} else if (x0 == 0 && y0 == 0 && x1 - x0 == width && y1 - y0 == height) {
573+
// no transparency cropping
570574
return source;
571575
} else {
572576
final boolean sameAspectRatio = Math.abs(((double) width / height) - ((double) (x1 - x0) / (y1 - y0))) < 0.00001d;

svn_trunk/src/jd/controlling/proxy/ProxyController.java

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@
2424
import java.util.concurrent.CopyOnWriteArrayList;
2525
import java.util.logging.Level;
2626

27+
import jd.controlling.accountchecker.AccountChecker.AccountCheckJob;
28+
import jd.controlling.accountchecker.AccountCheckerThread;
29+
import jd.controlling.downloadcontroller.AccountCache.CachedAccount;
30+
import jd.controlling.downloadcontroller.DownloadLinkCandidate;
31+
import jd.controlling.downloadcontroller.SingleDownloadController;
32+
import jd.controlling.linkchecker.LinkCheckerThread;
33+
import jd.controlling.linkcrawler.LinkCrawlerThread;
34+
import jd.http.Browser;
35+
import jd.http.ClonedProxy;
36+
import jd.http.ProxySelectorInterface;
37+
import jd.http.Request;
38+
import jd.nutils.encoding.Encoding;
39+
import jd.plugins.Account;
40+
import jd.plugins.AccountInfo;
41+
import jd.plugins.MultiHostHost;
42+
import jd.plugins.Plugin;
43+
import jd.plugins.PluginForHost;
44+
2745
import org.appwork.exceptions.WTFException;
2846
import org.appwork.net.protocol.http.HTTPConstants;
2947
import org.appwork.scheduler.DelayedRunnable;
@@ -85,23 +103,6 @@
85103
import com.btr.proxy.util.Logger.LogBackEnd;
86104
import com.btr.proxy.util.Logger.LogLevel;
87105

88-
import jd.controlling.accountchecker.AccountChecker.AccountCheckJob;
89-
import jd.controlling.accountchecker.AccountCheckerThread;
90-
import jd.controlling.downloadcontroller.AccountCache.CachedAccount;
91-
import jd.controlling.downloadcontroller.DownloadLinkCandidate;
92-
import jd.controlling.downloadcontroller.SingleDownloadController;
93-
import jd.controlling.linkchecker.LinkCheckerThread;
94-
import jd.controlling.linkcrawler.LinkCrawlerThread;
95-
import jd.http.Browser;
96-
import jd.http.ClonedProxy;
97-
import jd.http.ProxySelectorInterface;
98-
import jd.http.Request;
99-
import jd.nutils.encoding.Encoding;
100-
import jd.plugins.Account;
101-
import jd.plugins.AccountInfo;
102-
import jd.plugins.Plugin;
103-
import jd.plugins.PluginForHost;
104-
105106
//import com.btr.proxy.search.ProxySearchStrategy;
106107
//import com.btr.proxy.search.browser.firefox.FirefoxProxySearchStrategy;
107108
//import com.btr.proxy.search.desktop.DesktopProxySearchStrategy;
@@ -117,11 +118,11 @@
117118
//import com.btr.proxy.util.Logger.LogLevel;
118119
public class ProxyController implements ProxySelectorInterface {
119120
public static final URLStreamHandler SOCKETURLSTREAMHANDLER = new URLStreamHandler() {
120-
@Override
121-
protected URLConnection openConnection(URL u) throws IOException {
122-
throw new IOException("not implemented");
123-
}
124-
};
121+
@Override
122+
protected URLConnection openConnection(URL u) throws IOException {
123+
throw new IOException("not implemented");
124+
}
125+
};
125126
private static final ProxyController INSTANCE = new ProxyController();
126127

127128
public static final ProxyController getInstance() {
@@ -133,27 +134,21 @@ public static final ProxyController getInstance() {
133134
private final InternetConnectionSettings config;
134135
private final LogSource logger;
135136
private final Queue QUEUE = new Queue(getClass().getName()) {
136-
@Override
137-
public void killQueue() {
138-
LogController.CL().log(new Throwable("YOU CANNOT KILL ME!"));
139-
/*
140-
* this
141-
* queue
142-
* can
143-
* '
144-
* t
145-
* be
146-
* killed
147-
*/
148-
}
149-
};
137+
@Override
138+
public void killQueue() {
139+
LogController.CL().log(new Throwable("YOU CANNOT KILL ME!"));
140+
/*
141+
* this queue can ' t be killed
142+
*/
143+
}
144+
};
150145
private final ConfigEventSender<Object> customProxyListEventSender;
151146
private final EventSuppressor<ConfigEvent> eventSuppressor = new EventSuppressor<ConfigEvent>() {
152-
@Override
153-
public boolean suppressEvent(ConfigEvent eventType) {
154-
return true;
155-
}
156-
};
147+
@Override
148+
public boolean suppressEvent(ConfigEvent eventType) {
149+
return true;
150+
}
151+
};
157152

158153
public Queue getQUEUE() {
159154
return QUEUE;
@@ -205,16 +200,16 @@ public String toString() {
205200
});
206201
getEventSender().addListener(new DefaultEventListener<ProxyEvent<AbstractProxySelectorImpl>>() {
207202
final DelayedRunnable asyncSaving = new DelayedRunnable(5000l, 60000l) {
208-
@Override
209-
public void delayedrun() {
210-
ProxyController.this.saveProxySettings();
211-
}
203+
@Override
204+
public void delayedrun() {
205+
ProxyController.this.saveProxySettings();
206+
}
212207

213-
@Override
214-
public String getID() {
215-
return "ProxyController";
216-
}
217-
};
208+
@Override
209+
public String getID() {
210+
return "ProxyController";
211+
}
212+
};
218213

219214
@Override
220215
public void onEvent(final ProxyEvent<AbstractProxySelectorImpl> event) {
@@ -246,9 +241,9 @@ private String assignHost(final PluginFinder pluginFinder, final Map<String, Str
246241
String assignedHost = pluginFinder.assignHost(host);
247242
if (assignedHost == null) {
248243
final AccountInfo ai = new AccountInfo();
249-
final List<String> assigned = ai.setMultiHostSupport(null, Arrays.asList(new String[] { host }), pluginFinder);
244+
final List<MultiHostHost> assigned = ai.setMultiHostSupportV2(null, Arrays.asList(new MultiHostHost(host)), pluginFinder);
250245
if (assigned != null && assigned.size() == 1) {
251-
assignedHost = assigned.get(0);
246+
assignedHost = assigned.get(0).getDomain();
252247
}
253248
}
254249
if (assignedHost == null) {

svn_trunk/src/jd/gui/swing/jdgui/components/premiumbar/AccountListTableModel.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import jd.controlling.accountchecker.AccountCheckerEventListener;
5151
import jd.gui.swing.jdgui.GUIUtils;
5252
import jd.gui.swing.jdgui.views.settings.panels.accountmanager.AccountEntry;
53-
import jd.gui.swing.jdgui.views.settings.panels.accountmanager.RefreshAction;
5453
import jd.plugins.AccountInfo;
5554
import jd.plugins.AccountTrafficView;
5655

@@ -148,9 +147,6 @@ public boolean isEditable(AccountEntry obj) {
148147
protected void setBooleanValue(boolean enabled, final AccountEntry object) {
149148
object.getAccount().setEnabled(enabled);
150149
fireTableStructureChanged();
151-
if (enabled && object.getAccount().isMultiHost()) {
152-
RefreshAction.displayMultihosterDetailOverviewHelpDialog();
153-
}
154150
}
155151
});
156152
}

svn_trunk/src/jd/gui/swing/jdgui/views/settings/panels/accountmanager/PremiumAccountTableModel.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,11 @@ public boolean isEditable(AccountEntry obj) {
570570
}
571571

572572
@Override
573-
protected void setBooleanValue(boolean value, final AccountEntry object) {
574-
object.getAccount().setEnabled(value);
573+
protected void setBooleanValue(boolean enabled, final AccountEntry object) {
574+
object.getAccount().setEnabled(enabled);
575+
if (enabled && object.getAccount().isMultiHost()) {
576+
RefreshAction.displayMultihosterDetailOverviewHelpDialog();
577+
}
575578
}
576579
});
577580
}
Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package jd.gui.swing.jdgui.views.settings.panels.accountmanager;
22

33
import java.awt.event.ActionEvent;
4+
import java.util.ArrayList;
45
import java.util.List;
56

67
import javax.swing.AbstractAction;
@@ -22,18 +23,17 @@ public class RefreshAction extends AbstractAction {
2223
/**
2324
*
2425
*/
25-
private static final long serialVersionUID = 1L;
26-
private List<AccountEntry> selection;
27-
private boolean ignoreSelection = false;
26+
private static final long serialVersionUID = 1L;
27+
private final List<AccountEntry> selection;
2828

2929
public RefreshAction() {
30-
this(null);
31-
this.putValue(AbstractAction.SMALL_ICON, new AbstractIcon(IconKey.ICON_REFRESH, 20));
32-
ignoreSelection = true;
30+
selection = null;
31+
this.putValue(NAME, _GUI.T.settings_accountmanager_refresh());
32+
this.putValue(AbstractAction.SMALL_ICON, new AbstractIcon(IconKey.ICON_REFRESH, 16));
3333
}
3434

3535
public RefreshAction(List<AccountEntry> selectedObjects) {
36-
selection = selectedObjects;
36+
selection = selectedObjects != null ? selectedObjects : new ArrayList<AccountEntry>();
3737
this.putValue(NAME, _GUI.T.settings_accountmanager_refresh());
3838
this.putValue(AbstractAction.SMALL_ICON, new AbstractIcon(IconKey.ICON_REFRESH, 16));
3939
}
@@ -46,26 +46,34 @@ public void actionPerformed(ActionEvent e) {
4646
TaskQueue.getQueue().add(new QueueAction<Void, RuntimeException>() {
4747
@Override
4848
protected Void run() throws RuntimeException {
49-
boolean containedMultihosterAccount = false;
49+
final List<Account> accountsToCheck = new ArrayList<Account>();
5050
if (selection == null) {
51-
for (Account acc : AccountController.getInstance().list()) {
52-
if (acc == null || acc.isEnabled() == false || acc.isValid() == false || acc.isTempDisabled()) {
53-
continue;
51+
/* All accounts */
52+
for (final Account acc : AccountController.getInstance().list()) {
53+
if (acc.isEnabled() && acc.isValid()) {
54+
accountsToCheck.add(acc);
5455
}
55-
AccountChecker.getInstance().check(acc, true);
56-
containedMultihosterAccount |= acc.isMultiHost();
5756
}
5857
} else {
59-
for (AccountEntry accEntry : selection) {
60-
Account acc = accEntry.getAccount();
61-
if (acc == null || acc.isEnabled() == false) {
58+
/* Selected accounts only */
59+
for (final AccountEntry accEntry : selection) {
60+
final Account acc = accEntry.getAccount();
61+
if (acc == null) {
6262
continue;
6363
}
64-
AccountChecker.getInstance().check(acc, true);
65-
containedMultihosterAccount |= acc.isMultiHost();
64+
accountsToCheck.add(acc);
6665
}
6766
}
68-
if (containedMultihosterAccount) {
67+
if (accountsToCheck.isEmpty()) {
68+
/* Do nothing. This can happen if e.g. all selected items are disabled. */
69+
return null;
70+
}
71+
boolean containedCheckedMultihosterAccount = false;
72+
for (final Account acc : accountsToCheck) {
73+
AccountChecker.getInstance().check(acc, true);
74+
containedCheckedMultihosterAccount |= acc.isMultiHost();
75+
}
76+
if (containedCheckedMultihosterAccount) {
6977
displayMultihosterDetailOverviewHelpDialog();
7078
}
7179
return null;
@@ -74,15 +82,11 @@ protected Void run() throws RuntimeException {
7482
}
7583

7684
public static void displayMultihosterDetailOverviewHelpDialog() {
77-
HelpDialog.showIfAllowed(new MessageConfig(null, "downloadtabe_sortwarner", Dialog.STYLE_SHOW_DO_NOT_DISPLAY_AGAIN, "Multihoster detail overview", "Click on the wrench symbol to get a more detailed overview of the supported hosts.\r\nThe detailed overview allows you to disable specific hosts, view host specific limits and, in case of problems, see the reason of failure.\r\nAlternatively, you can navigate to this information via Settings -> Plugins", new AbstractIcon(IconKey.ICON_SORT, 32)));
85+
HelpDialog.showIfAllowed(new MessageConfig(null, "multihoster_table_detail_overview_hint", Dialog.STYLE_SHOW_DO_NOT_DISPLAY_AGAIN, _GUI.T.multihost_detailed_host_do_not_show_again_info_about_multi_host_overview_table_title(), _GUI.T.multihost_detailed_host_do_not_show_again_info_about_multi_host_overview_table_message(), new AbstractIcon(IconKey.ICON_SORT, 32)));
7886
}
7987

8088
@Override
8189
public boolean isEnabled() {
82-
if (ignoreSelection) {
83-
return true;
84-
} else {
85-
return selection != null && selection.size() > 0;
86-
}
90+
return selection == null || selection.size() > 0;
8791
}
8892
}

0 commit comments

Comments
 (0)