mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
- Added option to select number of threads for image download
This commit is contained in:
parent
4732686d8f
commit
9861f762b7
3 changed files with 127 additions and 75 deletions
|
@ -122,7 +122,7 @@
|
|||
<Component id="showCardName" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="tooltipDelay" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="233" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
@ -146,7 +146,7 @@
|
|||
<Property name="toolTipText" type="java.lang.String" value="Write the card's name on the card to make the card name more recognizable."/>
|
||||
<Property name="actionCommand" type="java.lang.String" value=""/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Standardcursor"/>
|
||||
<Color id="Default Cursor"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
|
@ -3918,11 +3918,11 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="panelCardImages" max="32767" attributes="0"/>
|
||||
<Component id="panelBackgroundImages" max="32767" attributes="0"/>
|
||||
<Component id="panelCardImages" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="panelBackgroundImages" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -3932,10 +3932,10 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelCardImages" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="panelCardImages" min="-2" pref="231" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelBackgroundImages" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="90" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
@ -3959,30 +3959,38 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cbUseDefaultImageFolder" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbCheckForNewImages" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="labelPreferedImageLanguage" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="cbSaveToZipFiles" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="cbPreferedImageLanguage" min="-2" pref="153" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="txtImageFolderPath" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnBrowseImageLocation" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="labelNumberOfDownloadThreads" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cbNumberOfDownloadThreads" min="-2" pref="153" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cbUseDefaultImageFolder" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbCheckForNewImages" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="labelPreferedImageLanguage" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="cbSaveToZipFiles" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
||||
<Component id="cbPreferedImageLanguage" min="-2" pref="153" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="142" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -4003,6 +4011,11 @@
|
|||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cbSaveToZipFiles" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="labelNumberOfDownloadThreads" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbNumberOfDownloadThreads" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cbPreferedImageLanguage" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelPreferedImageLanguage" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -4071,6 +4084,23 @@
|
|||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelNumberOfDownloadThreads">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Number of download threads:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbNumberOfDownloadThreads">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelBackgroundImages">
|
||||
|
@ -5329,7 +5359,7 @@
|
|||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="lblURLServerList" max="32767" attributes="0"/>
|
||||
<Component id="txtURLServerList" max="32767" attributes="0"/>
|
||||
<Component id="txtURLServerList" pref="28" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>
|
||||
|
|
|
@ -112,6 +112,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
public static final String KEY_CARD_IMAGES_USE_DEFAULT = "cardImagesUseDefault";
|
||||
public static final String KEY_CARD_IMAGES_PATH = "cardImagesPath";
|
||||
public static final String KEY_CARD_IMAGES_THREADS = "cardImagesThreads";
|
||||
public static final String KEY_CARD_IMAGES_CHECK = "cardImagesCheck";
|
||||
public static final String KEY_CARD_IMAGES_SAVE_TO_ZIP = "cardImagesSaveToZip";
|
||||
public static final String KEY_CARD_IMAGES_PREF_LANGUAGE = "cardImagesPreferedImageLaguage";
|
||||
|
@ -349,7 +350,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
addAvatars();
|
||||
|
||||
cbPreferedImageLanguage.setModel(new DefaultComboBoxModel<>(new String[]{"en", "de", "fr", "it", "es", "pt", "jp", "cn", "ru", "tw", "ko"}));
|
||||
|
||||
cbNumberOfDownloadThreads.setModel(new DefaultComboBoxModel<>(new String[]{"10", "9", "8", "7", "6", "5", "4", "3", "2", "1"}));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -446,8 +447,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
btnBrowseImageLocation = new javax.swing.JButton();
|
||||
cbCheckForNewImages = new javax.swing.JCheckBox();
|
||||
cbSaveToZipFiles = new javax.swing.JCheckBox();
|
||||
cbPreferedImageLanguage = new javax.swing.JComboBox<>();
|
||||
cbPreferedImageLanguage = new javax.swing.JComboBox<String>();
|
||||
labelPreferedImageLanguage = new javax.swing.JLabel();
|
||||
labelNumberOfDownloadThreads = new javax.swing.JLabel();
|
||||
cbNumberOfDownloadThreads = new javax.swing.JComboBox();
|
||||
panelBackgroundImages = new javax.swing.JPanel();
|
||||
cbUseDefaultBackground = new javax.swing.JCheckBox();
|
||||
txtBackgroundImagePath = new javax.swing.JTextField();
|
||||
|
@ -502,7 +505,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
txtURLServerList = new javax.swing.JTextField();
|
||||
jLabel17 = new javax.swing.JLabel();
|
||||
lblProxyType = new javax.swing.JLabel();
|
||||
cbProxyType = new javax.swing.JComboBox<>();
|
||||
cbProxyType = new javax.swing.JComboBox<ProxyType>();
|
||||
pnlProxySettings = new javax.swing.JPanel();
|
||||
pnlProxy = new javax.swing.JPanel();
|
||||
lblProxyServer = new javax.swing.JLabel();
|
||||
|
@ -556,10 +559,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.add(main_cardLayout.createSequentialGroup()
|
||||
.add(6, 6, 6)
|
||||
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
|
||||
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 308, Short.MAX_VALUE)
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, showCardName)
|
||||
.add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(233, Short.MAX_VALUE))
|
||||
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
main_cardLayout.setVerticalGroup(
|
||||
main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
|
@ -1388,35 +1391,45 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
});
|
||||
|
||||
cbPreferedImageLanguage.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
cbPreferedImageLanguage.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
labelPreferedImageLanguage.setText("Prefered image language:");
|
||||
labelPreferedImageLanguage.setFocusable(false);
|
||||
|
||||
labelNumberOfDownloadThreads.setText("Number of download threads:");
|
||||
|
||||
cbNumberOfDownloadThreads.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
|
||||
org.jdesktop.layout.GroupLayout panelCardImagesLayout = new org.jdesktop.layout.GroupLayout(panelCardImages);
|
||||
panelCardImages.setLayout(panelCardImagesLayout);
|
||||
panelCardImagesLayout.setHorizontalGroup(
|
||||
panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(cbUseDefaultImageFolder)
|
||||
.add(cbCheckForNewImages)
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, panelCardImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(labelPreferedImageLanguage))
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, cbSaveToZipFiles))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
|
||||
.add(cbPreferedImageLanguage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 153, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
|
||||
.add(0, 0, Short.MAX_VALUE))
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(24, 24, 24)
|
||||
.add(txtImageFolderPath)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(btnBrowseImageLocation)))
|
||||
.add(btnBrowseImageLocation))
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, panelCardImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(labelNumberOfDownloadThreads)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(cbNumberOfDownloadThreads, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 153, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(cbUseDefaultImageFolder)
|
||||
.add(cbCheckForNewImages)
|
||||
.add(panelCardImagesLayout.createSequentialGroup()
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, panelCardImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(labelPreferedImageLanguage))
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, cbSaveToZipFiles))
|
||||
.add(40, 40, 40)
|
||||
.add(cbPreferedImageLanguage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 153, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
|
||||
.add(0, 142, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
panelCardImagesLayout.setVerticalGroup(
|
||||
|
@ -1433,6 +1446,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(cbSaveToZipFiles)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(labelNumberOfDownloadThreads)
|
||||
.add(cbNumberOfDownloadThreads, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(panelCardImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(cbPreferedImageLanguage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(labelPreferedImageLanguage))
|
||||
|
@ -1558,10 +1575,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabImagesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(tabImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(panelCardImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(panelCardImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 231, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(panelBackgroundImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(90, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
tabsPanel.addTab("Images", tabImages);
|
||||
|
@ -2178,7 +2195,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.add(connection_serversLayout.createSequentialGroup()
|
||||
.add(connection_serversLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
|
||||
.add(lblURLServerList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.add(txtURLServerList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.add(txtURLServerList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(jLabel17))
|
||||
);
|
||||
|
@ -2474,6 +2491,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
saveImagesPath(prefs);
|
||||
save(prefs, dialog.cbCheckForNewImages, KEY_CARD_IMAGES_CHECK, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbSaveToZipFiles, KEY_CARD_IMAGES_SAVE_TO_ZIP, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbNumberOfDownloadThreads, KEY_CARD_IMAGES_THREADS);
|
||||
save(prefs, dialog.cbPreferedImageLanguage, KEY_CARD_IMAGES_PREF_LANGUAGE);
|
||||
|
||||
save(prefs, dialog.cbUseDefaultBackground, KEY_BACKGROUND_IMAGE_DEFAULT, "true", "false", UPDATE_CACHE_POLICY);
|
||||
|
@ -2525,14 +2543,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
dialog.setVisible(false);
|
||||
}//GEN-LAST:event_exitButtonActionPerformed
|
||||
|
||||
private void cbUseDefaultImageFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseDefaultImageFolderActionPerformed
|
||||
if (cbUseDefaultImageFolder.isSelected()) {
|
||||
useDefaultPath();
|
||||
} else {
|
||||
useConfigurablePath();
|
||||
}
|
||||
}//GEN-LAST:event_cbUseDefaultImageFolderActionPerformed
|
||||
|
||||
private void useDefaultPath() {
|
||||
txtImageFolderPath.setText("./plugins/images/");
|
||||
txtImageFolderPath.setEnabled(false);
|
||||
|
@ -2546,15 +2556,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
btnBrowseImageLocation.setEnabled(true);
|
||||
}
|
||||
|
||||
private void btnBrowseImageLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrowseImageLocationActionPerformed
|
||||
int returnVal = fc.showOpenDialog(PreferencesDialog.this);
|
||||
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
txtImageFolderPath.setText(file.getAbsolutePath());
|
||||
}
|
||||
}//GEN-LAST:event_btnBrowseImageLocationActionPerformed
|
||||
|
||||
private void cbProxyTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbProxyTypeActionPerformed
|
||||
this.showProxySettings();
|
||||
}//GEN-LAST:event_cbProxyTypeActionPerformed
|
||||
|
@ -2568,14 +2569,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private void rememberPswdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rememberPswdActionPerformed
|
||||
}//GEN-LAST:event_rememberPswdActionPerformed
|
||||
|
||||
private void cbSaveToZipFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSaveToZipFilesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbSaveToZipFilesActionPerformed
|
||||
|
||||
private void cbCheckForNewImagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbCheckForNewImagesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbCheckForNewImagesActionPerformed
|
||||
|
||||
private void cbEnableGameSoundsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbEnableGameSoundsActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbEnableGameSoundsActionPerformed
|
||||
|
@ -2777,6 +2770,31 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbAutoOrderTriggerActionPerformed
|
||||
|
||||
private void cbSaveToZipFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSaveToZipFilesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbSaveToZipFilesActionPerformed
|
||||
|
||||
private void cbCheckForNewImagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbCheckForNewImagesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbCheckForNewImagesActionPerformed
|
||||
|
||||
private void btnBrowseImageLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrowseImageLocationActionPerformed
|
||||
int returnVal = fc.showOpenDialog(PreferencesDialog.this);
|
||||
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
txtImageFolderPath.setText(file.getAbsolutePath());
|
||||
}
|
||||
}//GEN-LAST:event_btnBrowseImageLocationActionPerformed
|
||||
|
||||
private void cbUseDefaultImageFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseDefaultImageFolderActionPerformed
|
||||
if (cbUseDefaultImageFolder.isSelected()) {
|
||||
useDefaultPath();
|
||||
} else {
|
||||
useConfigurablePath();
|
||||
}
|
||||
}//GEN-LAST:event_cbUseDefaultImageFolderActionPerformed
|
||||
|
||||
private void showProxySettings() {
|
||||
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
||||
switch (proxyType) {
|
||||
|
@ -2946,6 +2964,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
load(prefs, dialog.cbCheckForNewImages, KEY_CARD_IMAGES_CHECK, "true");
|
||||
load(prefs, dialog.cbSaveToZipFiles, KEY_CARD_IMAGES_SAVE_TO_ZIP, "true");
|
||||
dialog.cbNumberOfDownloadThreads.setSelectedItem(MageFrame.getPreferences().get(KEY_CARD_IMAGES_THREADS, "10"));
|
||||
dialog.cbPreferedImageLanguage.setSelectedItem(MageFrame.getPreferences().get(KEY_CARD_IMAGES_PREF_LANGUAGE, "en"));
|
||||
|
||||
//add background load precedure
|
||||
|
@ -3337,6 +3356,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JCheckBox cbEnableOtherSounds;
|
||||
private javax.swing.JCheckBox cbEnableSkipButtonsSounds;
|
||||
private javax.swing.JCheckBox cbGameLogAutoSave;
|
||||
private javax.swing.JComboBox cbNumberOfDownloadThreads;
|
||||
private javax.swing.JCheckBox cbPassPriorityActivation;
|
||||
private javax.swing.JCheckBox cbPassPriorityCast;
|
||||
private javax.swing.JComboBox<String> cbPreferedImageLanguage;
|
||||
|
@ -3418,6 +3438,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JLabel labelEditorCardOffset;
|
||||
private javax.swing.JLabel labelEditorCardSize;
|
||||
private javax.swing.JLabel labelGameFeedback;
|
||||
private javax.swing.JLabel labelNumberOfDownloadThreads;
|
||||
private javax.swing.JLabel labelPreferedImageLanguage;
|
||||
private javax.swing.JLabel labelStackWidth;
|
||||
private javax.swing.JLabel labelTooltipSize;
|
||||
|
|
|
@ -472,7 +472,8 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
|
||||
update(0, cardsToDownload.size());
|
||||
|
||||
ExecutorService executor = Executors.newFixedThreadPool(10);
|
||||
int numberOfThreads = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_THREADS, "10"));
|
||||
ExecutorService executor = Executors.newFixedThreadPool(numberOfThreads);
|
||||
for (int i = 0; i < cardsToDownload.size() && !cancel; i++) {
|
||||
try {
|
||||
|
||||
|
|
Loading…
Reference in a new issue