Author: remi
Date: 2009-07-07 12:55:38 +0200 (Tue, 07 Jul 2009)
New Revision: 5070
Modified:
software_suite_v3/software/tool/tool-attitunes-studio/trunk/resources/plugin.xml
software_suite_v3/software/tool/tool-attitunes-studio/trunk/src/MainFrame.java
Log:
* Smart-core can now pass a default output path to Attitunes Studio.
* Replace white space by "_" in the att output files.
Modified:
software_suite_v3/software/tool/tool-attitunes-studio/trunk/resources/plugin.xml
===================================================================
---
software_suite_v3/software/tool/tool-attitunes-studio/trunk/resources/plugin.xml
2009-07-07 09:56:01 UTC (rev 5069)
+++
software_suite_v3/software/tool/tool-attitunes-studio/trunk/resources/plugin.xml
2009-07-07 10:55:38 UTC (rev 5070)
@@ -19,6 +19,11 @@
description="Path of the attitune to edit"
type="string"
defaultValue="template.att" />
+ <parameter
+ name="outputpath"
+ description="Default output path"
+ type="string"
+ defaultValue="my/path" />
</parameters>
<commands>
<command
Modified:
software_suite_v3/software/tool/tool-attitunes-studio/trunk/src/MainFrame.java
===================================================================
---
software_suite_v3/software/tool/tool-attitunes-studio/trunk/src/MainFrame.java
2009-07-07 09:56:01 UTC (rev 5069)
+++
software_suite_v3/software/tool/tool-attitunes-studio/trunk/src/MainFrame.java
2009-07-07 10:55:38 UTC (rev 5070)
@@ -89,6 +89,7 @@
private JPanel jPanelBlockHead;
private JFileChooser fileChooser;
+ private File defaultIOPath;
private boolean confirmExit = false;
@@ -128,11 +129,18 @@
if (path == null)
{
+ String strDefaultIOPath =
System.getenv("tgp_outputpath");
+ defaultIOPath = new File(new
File(strDefaultIOPath).getAbsolutePath());
+ if (!defaultIOPath.isDirectory())
+ {
+ defaultIOPath = null;
+ }
attBlockViewer.loadAttitune(ATTConfig.ATT_TEMPLATE_PATH); //$NON-NLS-1$
attBlockViewer.setAttituneIsTemplate(true);
}
else
{
+ defaultIOPath = new File(new
File(path).getAbsolutePath());
attBlockViewer.loadAttitune(path); //$NON-NLS-1$
attBlockViewer.setAttituneIsTemplate(false);
}
@@ -566,6 +574,11 @@
}
}
}
+ /* Set the default output path */
+ if (defaultIOPath != null)
+ {
+ fileChooser.setCurrentDirectory(defaultIOPath);
+ }
/* Load a file viewer to select an attitune */
if (fileChooser.showOpenDialog(this) !=
JFileChooser.APPROVE_OPTION)
{
@@ -632,6 +645,11 @@
JOptionPane.INFORMATION_MESSAGE);
return;
}
+ /* Set the default output path */
+ if (defaultIOPath != null)
+ {
+ fileChooser.setCurrentDirectory(defaultIOPath);
+ }
/* Open a file viewer to select an attitune */
if (fileChooser.showSaveDialog(this) !=
JFileChooser.APPROVE_OPTION)
{
@@ -643,8 +661,16 @@
return;
}
- String outPath = selFile.getPath();
+ String outPath = selFile.getParent();
+ String outFileName = selFile.getName();
+ outFileName = outFileName.replaceAll(" ", "_");
+ outPath = outPath + File.separator + outFileName;
+ JOptionPane.showMessageDialog(this,
+ outPath,
+ ATTMessages.getString("MainFrame.1"),
+ JOptionPane.INFORMATION_MESSAGE);
+
if (!outPath.toLowerCase().endsWith(".att"))
{
outPath += ".att";
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn