Commit 92d7b801 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

+add run target to ANT script

#fix problems with registry access if DLL missing
#fix display bugs in res/win/item windows when skin is first loaded
+add support for cover art as found in VLC 1.2
+translations: add WIN_IMAGE_ART string, update EN, DE accordingly
parent c39d4908
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
destdir="${build}/classes" destdir="${build}/classes"
target="1.6" target="1.6"
source="1.6" source="1.6"
debug="on" debuglevel="lines,vars,source"
fork="true" /> fork="true" />
</target> </target>
...@@ -117,4 +118,8 @@ ...@@ -117,4 +118,8 @@
package-win32, package-win32,
package-unix, package-unix,
installer-win32" /> installer-win32" />
<target name="run" depends="jar">
<java jar="VLCSkinEditor.jar"/>
</target>
</project> </project>
\ No newline at end of file
...@@ -532,7 +532,8 @@ WIN_IMAGE_ACTION|Aktion: ...@@ -532,7 +532,8 @@ WIN_IMAGE_ACTION|Aktion:
WIN_IMAGE_ACTION_TIP|Aktion die ausgeführt wird, wenn auf das Bild geklickt wird. WIN_IMAGE_ACTION_TIP|Aktion die ausgeführt wird, wenn auf das Bild geklickt wird.
WIN_IMAGE_ACTION2|Doppelklick Aktion: WIN_IMAGE_ACTION2|Doppelklick Aktion:
WIN_IMAGE_ACTION2_TIP|Aktion die ausgeführt wird, wenn auf das Bild doppelt geklickt wird. WIN_IMAGE_ACTION2_TIP|Aktion die ausgeführt wird, wenn auf das Bild doppelt geklickt wird.
WIN_IMAGE_ATTR|Image attributes WIN_IMAGE_ATTR|Image Eigenschaften
WIN_IMAGE_ART|Ersetze bild durch Albumcover, wenn verfügbar
#Group #Group
WIN_GROUP_TITLE|Group Einstellungen WIN_GROUP_TITLE|Group Einstellungen
......
...@@ -533,6 +533,7 @@ WIN_IMAGE_ACTION_TIP|Action triggered by a click on the image. ...@@ -533,6 +533,7 @@ WIN_IMAGE_ACTION_TIP|Action triggered by a click on the image.
WIN_IMAGE_ACTION2|Double-click action: WIN_IMAGE_ACTION2|Double-click action:
WIN_IMAGE_ACTION2_TIP|Action triggered by a double-click on the image. WIN_IMAGE_ACTION2_TIP|Action triggered by a double-click on the image.
WIN_IMAGE_ATTR|Image attributes WIN_IMAGE_ATTR|Image attributes
WIN_IMAGE_ART|Replace image with cover art, when available
#Group #Group
WIN_GROUP_TITLE|Group settings WIN_GROUP_TITLE|Group settings
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
action2 CDATA "none" action2 CDATA "none"
resize CDATA "mosaic" resize CDATA "mosaic"
help CDATA "" help CDATA ""
art CDATA "false"
> >
<!ELEMENT Button EMPTY> <!ELEMENT Button EMPTY>
<!ATTLIST Button <!ATTLIST Button
......
...@@ -658,7 +658,11 @@ public class Main extends JFrame implements ActionListener, TreeSelectionListene ...@@ -658,7 +658,11 @@ public class Main extends JFrame implements ActionListener, TreeSelectionListene
update(); update();
getVLCdirectory(); try {
getVLCdirectory();
} catch(UnsatisfiedLinkError ex) {
ex.printStackTrace();
}
if(args.length>0) { if(args.length>0) {
File f = new File(args[0]); File f = new File(args[0]);
...@@ -672,15 +676,22 @@ public class Main extends JFrame implements ActionListener, TreeSelectionListene ...@@ -672,15 +676,22 @@ public class Main extends JFrame implements ActionListener, TreeSelectionListene
*/ */
private void getVLCdirectory() { private void getVLCdirectory() {
if(System.getProperty("os.name").indexOf("Windows")!=-1) { if(System.getProperty("os.name").indexOf("Windows")!=-1) {
try { File f = new File(System.getProperty("ProgramFiles"), "VideoLAN/VLC");
RegistryKey vlc_key = Registry.openSubkey(Registry.HKEY_LOCAL_MACHINE,"Software\\VideoLAN\\VLC",RegistryKey.ACCESS_READ); File exe = new File(f, "vlc.exe");
String installDir = vlc_key.getStringValue("InstallDir"); if(f.exists() && exe.exists()) {
vlc_dir = installDir+File.separator; vlc_dir = f.getPath();
vlc_skins_dir = vlc_dir+"skins\\"; vlc_skins_dir = new File(f, "skins").getPath();
} } else {
catch (Exception e) { try {
System.err.println("Could not read VLC installation directory from Registry. VLC might not be properly installed."); RegistryKey vlc_key = Registry.openSubkey(Registry.HKEY_LOCAL_MACHINE,"Software\\VideoLAN\\VLC",RegistryKey.ACCESS_READ);
e.printStackTrace(); String installDir = vlc_key.getStringValue("InstallDir");
vlc_dir = installDir+File.separator;
vlc_skins_dir = vlc_dir+"skins\\";
}
catch (Exception e) {
System.err.println("Could not read VLC installation directory from Registry. VLC might not be properly installed.");
e.printStackTrace();
}
} }
} }
else if(System.getProperty("os.name").indexOf("Linux")!=-1){ else if(System.getProperty("os.name").indexOf("Linux")!=-1){
......
...@@ -633,16 +633,19 @@ public class Skin implements ActionListener{ ...@@ -633,16 +633,19 @@ public class Skin implements ActionListener{
public void updateResources() { public void updateResources() {
m.res_tree_model.setRoot(getResourcesTree()); m.res_tree_model.setRoot(getResourcesTree());
m.saved=false; m.saved=false;
m.res_tree.repaint();
} }
/** Recreates the window hierarchies **/ /** Recreates the window hierarchies **/
public void updateWindows() { public void updateWindows() {
m.win_tree_model.setRoot(getWindowsTree()); m.win_tree_model.setRoot(getWindowsTree());
m.saved=false; m.saved=false;
m.win_tree.repaint();
} }
/** Recreates the item hierarchies **/ /** Recreates the item hierarchies **/
public void updateItems() { public void updateItems() {
m.items_tree_model.setRoot(getItemsTree()); m.items_tree_model.setRoot(getItemsTree());
m.saved=false; m.saved=false;
m.items_tree.repaint();
} }
/** Updates everything **/ /** Updates everything **/
public void update() { public void update() {
......
...@@ -40,6 +40,8 @@ public class ImageEditEvent extends HistoryEvent{ ...@@ -40,6 +40,8 @@ public class ImageEditEvent extends HistoryEvent{
private String image_old, image_new, resize_old, resize_new; private String image_old, image_new, resize_old, resize_new;
private String action_old, action_new, action2_old, action2_new; private String action_old, action_new, action2_old, action2_new;
private boolean art_old, art_new;
public ImageEditEvent(Image ima) { public ImageEditEvent(Image ima) {
i = ima; i = ima;
...@@ -58,6 +60,8 @@ public class ImageEditEvent extends HistoryEvent{ ...@@ -58,6 +60,8 @@ public class ImageEditEvent extends HistoryEvent{
resize_old = i.resize; resize_old = i.resize;
action_old = i.action; action_old = i.action;
action2_old = i.action2; action2_old = i.action2;
art_old = i.art;
} }
public void setNew() { public void setNew() {
id_new = i.id; id_new = i.id;
...@@ -74,6 +78,8 @@ public class ImageEditEvent extends HistoryEvent{ ...@@ -74,6 +78,8 @@ public class ImageEditEvent extends HistoryEvent{
resize_new = i.resize; resize_new = i.resize;
action_new = i.action; action_new = i.action;
action2_new = i.action2; action2_new = i.action2;
art_new = i.art;
} }
@Override @Override
public void undo() { public void undo() {
...@@ -91,6 +97,8 @@ public class ImageEditEvent extends HistoryEvent{ ...@@ -91,6 +97,8 @@ public class ImageEditEvent extends HistoryEvent{
i.resize = resize_old; i.resize = resize_old;
i.action = action_old; i.action = action_old;
i.action2 = action2_old; i.action2 = action2_old;
i.art = art_old;
} }
@Override @Override
public void redo() { public void redo() {
...@@ -108,6 +116,8 @@ public class ImageEditEvent extends HistoryEvent{ ...@@ -108,6 +116,8 @@ public class ImageEditEvent extends HistoryEvent{
i.resize = resize_new; i.resize = resize_new;
i.action = action_new; i.action = action_new;
i.action2 = action2_new; i.action2 = action2_new;
i.art = art_new;
} }
@Override @Override
public String getDescription() { public String getDescription() {
......
...@@ -47,9 +47,11 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -47,9 +47,11 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
public String resize = RESIZE_DEFAULT; public String resize = RESIZE_DEFAULT;
public String action = ACTION_DEFAULT; public String action = ACTION_DEFAULT;
public String action2 = ACTION2_DEFAULT; public String action2 = ACTION2_DEFAULT;
public boolean art = false;
JFrame frame = null; JFrame frame = null;
JTextField id_tf, x_tf, y_tf, help_tf, visible_tf, image_tf, action2_tf; 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; JComboBox lefttop_cb, rightbottom_cb, xkeepratio_cb, ykeepratio_cb, resize_cb, action_cb;
JCheckBox art_cb;
JButton visible_btn, action2_btn, ok_btn, cancel_btn, help_btn; JButton visible_btn, action2_btn, ok_btn, cancel_btn, help_btn;
ActionEditor action2_ae; ActionEditor action2_ae;
ImageResource image_res; ImageResource image_res;
...@@ -87,6 +89,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -87,6 +89,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
image_res = s.getImageResource(image); image_res = s.getImageResource(image);
if(image_res!=null) image_res.addResourceChangeListener(this); if(image_res!=null) image_res.addResourceChangeListener(this);
art = XML.getBoolAttributeValue(n, "art", art);
created = true; created = true;
} }
...@@ -134,6 +138,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -134,6 +138,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
action = action_cb.getSelectedItem().toString(); action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText(); action2 = action2_tf.getText();
art = art_cb.isSelected();
s.updateItems(); s.updateItems();
s.expandItem(id); s.expandItem(id);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
...@@ -159,6 +165,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -159,6 +165,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
action = action_cb.getSelectedItem().toString(); action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText(); action2 = action2_tf.getText();
art = art_cb.isSelected();
s.updateItems(); s.updateItems();
s.expandItem(id); s.expandItem(id);
...@@ -213,7 +221,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -213,7 +221,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
image_tf = new JTextField(); image_tf = new JTextField();
image_tf.setToolTipText(Language.get("WIN_IMAGE_IMAGE_TIP")); image_tf.setToolTipText(Language.get("WIN_IMAGE_IMAGE_TIP"));
JLabel resize_l = new JLabel(Language.get("WIN_IMAGE_RESIZE")); JLabel resize_l = new JLabel(Language.get("WIN_IMAGE_RESIZE"));
String[] resize_values = {"mosaic", "scale"}; String[] resize_values = {"mosaic", "scale", "scale2"};
resize_cb = new JComboBox(resize_values); resize_cb = new JComboBox(resize_values);
resize_cb.setToolTipText(Language.get("WIN_IMAGE_RESIZE_TIP")); resize_cb.setToolTipText(Language.get("WIN_IMAGE_RESIZE_TIP"));
JLabel action_l = new JLabel(Language.get("WIN_IMAGE_ACTION")); JLabel action_l = new JLabel(Language.get("WIN_IMAGE_ACTION"));
...@@ -226,6 +234,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -226,6 +234,8 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
action2_btn = new JButton("", Main.editor_icon); action2_btn = new JButton("", Main.editor_icon);
action2_btn.addActionListener(this); action2_btn.addActionListener(this);
art_cb = new JCheckBox(Language.get("WIN_IMAGE_ART"), art);
ok_btn = new JButton(Language.get("BUTTON_OK")); ok_btn = new JButton(Language.get("BUTTON_OK"));
ok_btn.addActionListener(this); ok_btn.addActionListener(this);
cancel_btn = new JButton(Language.get("BUTTON_CANCEL")); cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
...@@ -348,6 +358,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -348,6 +358,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
image_panel.add(action2_l); image_panel.add(action2_l);
image_panel.add(action2_tf); image_panel.add(action2_tf);
image_panel.add(action2_btn); image_panel.add(action2_btn);
image_panel.add(art_cb);
image_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_IMAGE_ATTR"))); image_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_IMAGE_ATTR")));
SpringLayout image_layout = new SpringLayout(); SpringLayout image_layout = new SpringLayout();
...@@ -382,8 +393,12 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -382,8 +393,12 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action2_btn, 0, SpringLayout.VERTICAL_CENTER, action2_l); image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action2_btn, 0, SpringLayout.VERTICAL_CENTER, action2_l);
image_layout.putConstraint(SpringLayout.EAST, action2_btn, 0, SpringLayout.EAST, image_tf); image_layout.putConstraint(SpringLayout.EAST, action2_btn, 0, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.NORTH, art_cb, 10, SpringLayout.SOUTH, action2_tf);
image_layout.putConstraint(SpringLayout.WEST, art_cb, 5, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.EAST, art_cb, 0, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.EAST, image_panel, 5, SpringLayout.EAST, image_tf); image_layout.putConstraint(SpringLayout.EAST, image_panel, 5, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.SOUTH, image_panel, 10, SpringLayout.SOUTH, action2_btn); image_layout.putConstraint(SpringLayout.SOUTH, image_panel, 10, SpringLayout.SOUTH, art_cb);
image_panel.setLayout(image_layout); image_panel.setLayout(image_layout);
......
...@@ -117,7 +117,7 @@ public class Font extends Resource implements ActionListener{ ...@@ -117,7 +117,7 @@ public class Font extends Resource implements ActionListener{
catch(Exception e) { catch(Exception e) {
e.printStackTrace(); e.printStackTrace();
if(file.indexOf(".otf")==-1) { if(file.indexOf(".otf")==-1) {
//Font file corrupt //Font file most probably corrupt, as its not OTF but still cannot be loaded by Java
f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size);
return false; return false;
} }
......
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