Commit 2ad36ad2 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

#fix: disallow " to appear in IDs, actions, and other values, so that skin...

#fix: disallow " to appear in IDs, actions, and other values, so that skin file cannot be broken by that
#fix: save the new art parameter of images to the skin file
#fix: always use / instead of \ in resource paths, so that skins also work on Linux
parent 92d7b801
......@@ -2,7 +2,16 @@
-----------------------------------------------------------
Changelog:
-----------------------------------------------------------
0.8.6 - Bugfix: XML Output was not proper UTF-8
0.8.6 - Support for new skins2 features in VLC 1.1/1.2
+ cover art
+ video recording action
+ new image resize mode
- Bugfix: XML Output was not proper UTF-8
- Bugfix: " was tolerated as value for IDs, actions
etc. and could thus break your skin file
- Bugfix: Paths to resource files could contain \
and thus break your skin on Linux
- several other small bugfixes
0.8.5 - Various bugfixes and technical improvements
- A toolbar was added
......
......@@ -341,7 +341,7 @@ public class Layout implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -118,7 +118,7 @@ public class Window implements ActionListener{
id=id_tf.getText();
x=Integer.parseInt(x_tf.getText());
y=Integer.parseInt(y_tf.getText());
visible=visible_tf.getText();
visible=visible_tf.getText().replaceAll("\"","'");
dragdrop=Boolean.parseBoolean(dragdrop_tf.getText());
playondrop=Boolean.parseBoolean(playondrop_tf.getText());
s.updateWindows();
......@@ -131,7 +131,7 @@ public class Window implements ActionListener{
id=id_tf.getText();
x=Integer.parseInt(x_tf.getText());
y=Integer.parseInt(y_tf.getText());
visible=visible_tf.getText();
visible=visible_tf.getText().replaceAll("\"","'");
dragdrop=Boolean.parseBoolean(dragdrop_tf.getText());
playondrop=Boolean.parseBoolean(playondrop_tf.getText());
s.updateWindows();
......@@ -299,7 +299,7 @@ public class Window implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -321,7 +321,7 @@ public class Anchor extends Item implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......@@ -331,6 +331,10 @@ public class Anchor extends Item implements ActionListener {
return;
}
}
if(points_tf.getText().equals("")||points.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_POINTS_INVALID"),Language.get("ERROR_POINTS_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
update();
frame.setVisible(false);
frame.dispose();
......
......@@ -139,14 +139,14 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText();
over = over_tf.getText();
down = down_tf.getText();
action = action_tf.getText();
tooltiptext = tooltiptext_tf.getText();
action = action_tf.getText().replaceAll("\"","'");
tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
ItemAddEvent bae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(bae);
......@@ -165,8 +165,8 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText();
over = over_tf.getText();
......@@ -468,7 +468,7 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -181,20 +181,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up1 = up1_tf.getText();
over1 = over1_tf.getText();
down1 = down1_tf.getText();
action1 = action1_tf.getText();
tooltiptext1 = tooltiptext1_tf.getText();
action1 = action1_tf.getText().replaceAll("\"","'");
tooltiptext1 = tooltiptext1_tf.getText().replaceAll("\"","'");
up2 = up2_tf.getText();
over2 = over2_tf.getText();
down2 = down2_tf.getText();
action2 = action2_tf.getText();
tooltiptext2 = tooltiptext2_tf.getText();
state = state_tf.getText();
action2 = action2_tf.getText().replaceAll("\"","'");
tooltiptext2 = tooltiptext2_tf.getText().replaceAll("\"","'");
state = state_tf.getText().replaceAll("\"","'");
ItemAddEvent cae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(cae);
......@@ -214,20 +214,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up1 = up1_tf.getText();
over1 = over1_tf.getText();
down1 = down1_tf.getText();
action1 = action1_tf.getText();
tooltiptext1 = tooltiptext1_tf.getText();
action1 = action1_tf.getText().replaceAll("\"","'");
tooltiptext1 = tooltiptext1_tf.getText().replaceAll("\"","'");
up2 = up2_tf.getText();
over2 = over2_tf.getText();
down2 = down2_tf.getText();
action2 = action2_tf.getText();
tooltiptext2 = tooltiptext2_tf.getText();
state = state_tf.getText();
action2 = action2_tf.getText().replaceAll("\"","'");
tooltiptext2 = tooltiptext2_tf.getText().replaceAll("\"","'");
state = state_tf.getText().replaceAll("\"","'");
cee.setNew();
s.m.hist.addEvent(cee);
......@@ -648,7 +648,7 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -223,7 +223,7 @@ public class Group extends Item implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -43,11 +43,12 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
public final String RESIZE_DEFAULT = "mosaic";
public final String ACTION_DEFAULT = "none";
public final String ACTION2_DEFAULT = "none";
public final boolean ART_DEFAULT = false;
public String image;
public String resize = RESIZE_DEFAULT;
public String action = ACTION_DEFAULT;
public String action2 = ACTION2_DEFAULT;
public boolean art = false;
public boolean art = ART_DEFAULT;
JFrame frame = null;
JTextField id_tf, x_tf, y_tf, help_tf, visible_tf, image_tf, action2_tf;
JComboBox lefttop_cb, rightbottom_cb, xkeepratio_cb, ykeepratio_cb, resize_cb, action_cb;
......@@ -130,13 +131,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
image = image_tf.getText();
resize = resize_cb.getSelectedItem().toString();
action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText();
action2 = action2_tf.getText().replaceAll("\"","'");
art = art_cb.isSelected();
......@@ -157,13 +158,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
image = image_tf.getText();
resize = resize_cb.getSelectedItem().toString();
action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText();
action2 = action2_tf.getText().replaceAll("\"","'");
art = art_cb.isSelected();
......@@ -459,7 +460,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return;
} else if(!id_tf.getText().equals(id)) {
......@@ -522,6 +523,11 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
}
code += " image=\"" + image + "\"";
if(art!=ART_DEFAULT) {
code += "art=\""+String.valueOf(art)+"\"";
}
if(!action.equals(ACTION_DEFAULT)) {
code += " action=\"" + action + "\"";
}
......
......@@ -109,8 +109,8 @@ public class Panel extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -136,8 +136,8 @@ public class Panel extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -360,7 +360,7 @@ public class Panel extends Item implements ActionListener{
}
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -215,8 +215,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -225,11 +225,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
itemimage = itemimage_tf.getText();
openimage = openimage_tf.getText();
closedimage = closedimage_tf.getText();
fgcolor = fgcolor_tf.getText();
selcolor = selcolor_tf.getText();
playcolor = playcolor_tf.getText();
bgcolor1 = bgcolor1_tf.getText();
bgcolor2 = bgcolor2_tf.getText();
fgcolor = fgcolor_tf.getText().replaceAll("\"","'");
selcolor = selcolor_tf.getText().replaceAll("\"","'");
playcolor = playcolor_tf.getText().replaceAll("\"","'");
bgcolor1 = bgcolor1_tf.getText().replaceAll("\"","'");
bgcolor2 = bgcolor2_tf.getText().replaceAll("\"","'");
flat = (Boolean) flat_cb.getSelectedItem();
s.updateItems();
......@@ -249,8 +249,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -259,11 +259,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
itemimage = itemimage_tf.getText();
openimage = openimage_tf.getText();
closedimage = closedimage_tf.getText();
fgcolor = fgcolor_tf.getText();
selcolor = selcolor_tf.getText();
playcolor = playcolor_tf.getText();
bgcolor1 = bgcolor1_tf.getText();
bgcolor2 = bgcolor2_tf.getText();
fgcolor = fgcolor_tf.getText().replaceAll("\"","'");
selcolor = selcolor_tf.getText().replaceAll("\"","'");
playcolor = playcolor_tf.getText().replaceAll("\"","'");
bgcolor1 = bgcolor1_tf.getText().replaceAll("\"","'");
bgcolor2 = bgcolor2_tf.getText().replaceAll("\"","'");
flat = (Boolean) flat_cb.getSelectedItem();
s.updateItems();
......@@ -707,7 +707,7 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return;
} else if(!id_tf.getText().equals(id)) {
......
......@@ -226,8 +226,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText();
over = over_tf.getText();
......@@ -235,7 +235,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
points = points_tf.getText();
thickness = Integer.parseInt(thickness_tf.getText());
if(!inPlaytree) value = (String)value_cb.getSelectedItem();
tooltiptext = tooltiptext_tf.getText();
tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
updateBezier();
......@@ -257,8 +257,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText();
over = over_tf.getText();
......@@ -266,7 +266,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
points = points_tf.getText();
thickness = Integer.parseInt(thickness_tf.getText());
if(!inPlaytree) value = (String)value_cb.getSelectedItem();
tooltiptext = tooltiptext_tf.getText();
tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
updateBezier();
......@@ -610,7 +610,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......@@ -638,7 +638,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
down_res = s.getImageResource(down);
return;
}
if(points_tf.getText().equals("")) {
if(points_tf.getText().equals("")||points.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_POINTS_INVALID"),Language.get("ERROR_POINTS_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -311,7 +311,7 @@ public class SliderBackground extends Item implements ActionListener, ResourceCh
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return;
} else if(!id_tf.getText().equals(id)) {
......
......@@ -148,12 +148,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
text = text_tf.getText();
text = text_tf.getText().replaceAll("\"","'");
font = font_tf.getText();
color = color_tf.getText();
color = color_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
alignment = alignment_cb.getSelectedItem().toString();
scrolling = scrolling_cb.getSelectedItem().toString();
......@@ -176,12 +176,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
text = text_tf.getText();
text = text_tf.getText().replaceAll("\"","'");
font = font_tf.getText();
color = color_tf.getText();
color = color_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
alignment = alignment_cb.getSelectedItem().toString();
scrolling = scrolling_cb.getSelectedItem().toString();
......@@ -491,7 +491,7 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -112,8 +112,8 @@ public class Video extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -137,8 +137,8 @@ public class Video extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText();
help = help_tf.getText();
visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText());
......@@ -400,7 +400,7 @@ public class Video extends Item implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -95,7 +95,7 @@ public class Bitmap extends ImageResource implements ActionListener{
public Bitmap(Skin s_, File f_) {
s = s_;
//Gets the relative path to the bitmap file
file = f_.getPath().replace(s.skinfolder,"");
file = f_.getPath().replace(s.skinfolder,"").replaceAll("\\\\", "/");
//Sets the bitmap's id according to the pattern subfolder_filename
String id_t = file.replaceAll("\\\\","_").replaceAll("/","_").substring(0,file.lastIndexOf("."));
if(s.idExists(id_t)) id_t += "_"+s.getNewId();
......@@ -125,7 +125,7 @@ public class Bitmap extends ImageResource implements ActionListener{
*/
public boolean updateImage() {
try {
image = ImageIO.read(new File(s.skinfolder+file));
image = ImageIO.read(new File(s.skinfolder,file));
image = image.getSubimage(0,0,image.getWidth(),image.getHeight()/nbframes);
if(image.getType()!=13) { //If PNG is not indexed
BufferedImage bi = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB);
......@@ -172,7 +172,7 @@ public class Bitmap extends ImageResource implements ActionListener{
@Override
public void update() {
BitmapEditEvent be = new BitmapEditEvent(this);
file=file_tf.getText();
file=file_tf.getText().replaceAll("\\\\","/");
alphacolor=alphacolor_tf.getText();
nbframes=Integer.parseInt(nbframes_tf.getText());
fps=Integer.parseInt(fps_tf.getText());
......@@ -382,7 +382,7 @@ public class Bitmap extends ImageResource implements ActionListener{
}
}
else if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -71,14 +71,14 @@ public class Font extends Resource implements ActionListener{
* Creates a new Font from a given file.
* @param s_ The skin in which the Font is used.
* @param f_ The font file. TrueType or OpenType. Notice that only OpenType fonts in a TrueType container
* can be displayed by the Skin Editor. VLC can display both.
* can be displayed by the Skin Editor. VLC can display both. This will be fixed in JRE 7
*/
public Font(Skin s_, File f_) {
s = s_;
String id_t = f_.getName().substring(0,f_.getName().lastIndexOf("."));
if(s.idExists(id_t)) id_t += "_"+s.getNewId();
id = id_t;
file = f_.getPath().replace(s.skinfolder,"");
file = f_.getPath().replace(s.skinfolder,"").replaceAll("\\\\","/");
s.updateResources();
s.expandResource(id);
updateFont();
......@@ -139,10 +139,9 @@ public class Font extends Resource implements ActionListener{
@Override
public void update() {
FontEditEvent fee = new FontEditEvent(this);
file=file_tf.getText();
file=file_tf.getText().replaceAll("\\\\","/");
size=Integer.parseInt(size_tf.getText());
if(!id.equals(id_tf.getText())) {
String oldid = id;
id=id_tf.getText();
s.updateResources();
s.expandResource(id);
......@@ -279,7 +278,7 @@ public class Font extends Resource implements ActionListener{
}
}
else if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
......@@ -350,7 +350,7 @@ public class SubBitmap extends ImageResource implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment