Reviewed by John Sullivan.
- Allow showing and closing the inspector programatically.
- Add showConsole() and showTimeline() methods.
* WebCore.base.exp: Add exports for WebKit.
* page/InspectorController.cpp:
(WebCore::callSimpleFunction): Renamed from callClearFunction().
(WebCore::unloading): Renamed to close().
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspect): Moved showing code to show().
(WebCore::InspectorController::setWindowVisible): Show the timeline or console if needed.
(WebCore::InspectorController::show): Code factored out of inspect().
(WebCore::InspectorController::showConsole): Call show() and the JS showConsole().
(WebCore::InspectorController::showTimeline): Call show() and the JS showTimeline().
(WebCore::InspectorController::close):
(WebCore::InspectorController::clearScriptResources): Call the new callSimpleFunction.
(WebCore::InspectorController::clearDatabaseScriptResources): Ditto.
(WebCore::InspectorController::clearScriptConsoleMessages): Ditto.
(WebCore::InspectorController::clearNetworkTimeline): Ditto.
* page/InspectorController.h: Add and rename methods.
* page/inspector/inspector.js: Add showConsole() and showTimeline().
WebKit:
Reviewed by John Sullivan.
Various semi-related changes:
- A WebView can now be asked for it's WebInspector. There is one
WebInspector per WebView.
- Refactor the WebInspector class and move obsolete methods to
a special category.
- Add new WebInspector methods to show, hide and show the
console/timeline panels.
- Add an isDisabled method to WebCache.
- Allow WebLocalizableStrings.h to be used in C files.
* Misc/WebCache.h: Add isDisabled.
* Misc/WebCache.mm:
(+[WebCache isDisabled]): New method.
* Misc/WebLocalizableStrings.h: Changes to allow use in plain C files.
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController showWindow:]): Call super if already visible
so the window will be ordered front.
(-[WebInspectorWindowController showWebInspector:]): Method used by menu items,
so they are enabled and work when the Inspector window is key.
(-[WebInspectorWindowController showErrorConsole:]): Ditto.
(-[WebInspectorWindowController showNetworkTimeline:]): Ditto.
* WebInspector/WebInspector.h: Add and remove methods.
* WebInspector/WebInspector.mm:
(-[WebInspector webViewClosed]): Called when the WebView is closed/dealloced.
Clears the _webView pointer.
(-[WebInspector show:]): Calls thru to the Page's InspectorController.
(-[WebInspector showConsole:]): Ditto.
(-[WebInspector showTimeline:]): Ditto.
(-[WebInspector close:]): Ditto.
(-[WebInspector attach:]): Ditto.
(-[WebInspector detach:]): Ditto.
(+[WebInspector sharedWebInspector]): Moved to the obsolete category.
(+[WebInspector webInspector]): Ditto.
(-[WebInspector setWebFrame:]): Ditto.
(-[WebInspector window]): Ditto.
(-[WebInspector showWindow:]): Ditto.
* WebView/WebView.mm:
(-[WebViewPrivate dealloc]): Release the WebInspector.
(-[WebView _close]): Call webViewClosed on the WebInspector.
(-[WebView inspector]): Create a WebInspector if needed and return it.
* WebView/WebViewPrivate.h: Add the inspector method.
WebKitTools:
Reviewed by John Sullivan.
- Place the Localizable.strings file in mac or win directories
if that location exists.
- Also look for UI_STRING in .c files.
* Scripts/extract-localizable-strings:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27266
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-10-29 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - Allow showing and closing the inspector programatically.
+ - Add showConsole() and showTimeline() methods.
+
+ * WebCore.base.exp: Add exports for WebKit.
+ * page/InspectorController.cpp:
+ (WebCore::callSimpleFunction): Renamed from callClearFunction().
+ (WebCore::unloading): Renamed to close().
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::inspect): Moved showing code to show().
+ (WebCore::InspectorController::setWindowVisible): Show the timeline or console if needed.
+ (WebCore::InspectorController::show): Code factored out of inspect().
+ (WebCore::InspectorController::showConsole): Call show() and the JS showConsole().
+ (WebCore::InspectorController::showTimeline): Call show() and the JS showTimeline().
+ (WebCore::InspectorController::close):
+ (WebCore::InspectorController::clearScriptResources): Call the new callSimpleFunction.
+ (WebCore::InspectorController::clearDatabaseScriptResources): Ditto.
+ (WebCore::InspectorController::clearScriptConsoleMessages): Ditto.
+ (WebCore::InspectorController::clearNetworkTimeline): Ditto.
+ * page/InspectorController.h: Add and rename methods.
+ * page/inspector/inspector.js: Add showConsole() and showTimeline().
+
2007-10-30 Adele Peterson <adele@apple.com>
Reviewed by Sam.
__ZN7WebCore16NavigationActionC1Ev
__ZN7WebCore16colorFromNSColorEP7NSColor
__ZN7WebCore18PlatformMouseEventC1EP7NSEvent
+__ZN7WebCore19InspectorController11showConsoleEv
+__ZN7WebCore19InspectorController12attachWindowEv
+__ZN7WebCore19InspectorController12detachWindowEv
+__ZN7WebCore19InspectorController12showTimelineEv
__ZN7WebCore19InspectorController16setWindowVisibleEb
+__ZN7WebCore19InspectorController4showEv
+__ZN7WebCore19InspectorController5closeEv
__ZN7WebCore19InspectorController7inspectEPNS_4NodeE
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEbRi
__ZN7WebCore19SelectionController5clearEv
if (source == JSMessageSource)
m_client->addMessageToConsole(message, lineNumber, sourceID);
- if (InspectorController* inspector = m_page->inspectorController())
- inspector->addMessageToConsole(source, level, message, lineNumber, sourceID);
+ m_page->inspectorController()->addMessageToConsole(source, level, message, lineNumber, sourceID);
}
bool Chrome::canRunBeforeUnloadConfirmPanel()
namespace WebCore {
+static void callSimpleFunction(JSContextRef context, JSObjectRef thisObject, const char* functionName)
+{
+ ASSERT_ARG(context, context);
+ ASSERT_ARG(thisObject, thisObject);
+
+ JSStringRef string = JSStringCreateWithUTF8CString(functionName);
+ JSObjectRef function = JSValueToObject(context, JSObjectGetProperty(context, thisObject, string, 0), 0);
+ JSStringRelease(string);
+
+ JSObjectCallAsFunction(context, function, thisObject, 0, 0, 0);
+}
+
struct ConsoleMessage {
ConsoleMessage(MessageSource s, MessageLevel l, const String& m, unsigned li, const String& u)
: source(s)
if (!controller)
return JSValueMakeUndefined(ctx);
- controller->windowUnloading();
+ controller->close();
return JSValueMakeUndefined(ctx);
}
, m_controllerScriptObject(0)
, m_scriptContext(0)
, m_windowVisible(false)
+ , m_showAfterVisible(FocusedNodeDocumentPanel)
, m_nextIdentifier(-2)
{
ASSERT_ARG(page, page);
if (!node || !enabled())
return;
- if (!m_page) {
- m_page = m_client->createPage();
- if (!m_page)
- return;
-
- m_page->setParentInspectorController(this);
- }
+ show();
if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE)
node = node->parentNode();
m_nodeToFocus = node;
- if (!m_scriptObject)
+ if (!m_scriptObject) {
+ m_showAfterVisible = FocusedNodeDocumentPanel;
return;
+ }
if (windowVisible())
focusNode();
- else
- m_client->showWindow();
}
void InspectorController::focusNode()
populateScriptResources();
if (m_nodeToFocus)
focusNode();
+ if (m_showAfterVisible == ConsolePanel)
+ showConsole();
+ else if (m_showAfterVisible == TimelinePanel)
+ showTimeline();
} else {
clearScriptResources();
clearScriptConsoleMessages();
clearDatabaseScriptResources();
clearNetworkTimeline();
}
+
+ m_showAfterVisible = FocusedNodeDocumentPanel;
}
void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
m_client->showWindow();
}
-void InspectorController::windowUnloading()
+void InspectorController::show()
+{
+ if (!enabled())
+ return;
+
+ if (!m_page) {
+ m_page = m_client->createPage();
+ if (!m_page)
+ return;
+ m_page->setParentInspectorController(this);
+
+ // m_client->showWindow() will be called after the page loads in scriptObjectReady()
+ return;
+ }
+
+ m_client->showWindow();
+}
+
+void InspectorController::showConsole()
+{
+ if (!enabled())
+ return;
+
+ show();
+
+ if (!m_scriptObject) {
+ m_showAfterVisible = ConsolePanel;
+ return;
+ }
+
+ callSimpleFunction(m_scriptContext, m_scriptObject, "showConsole");
+}
+
+void InspectorController::showTimeline()
{
+ if (!enabled())
+ return;
+
+ show();
+
+ if (!m_scriptObject) {
+ m_showAfterVisible = TimelinePanel;
+ return;
+ }
+
+ callSimpleFunction(m_scriptContext, m_scriptObject, "showTimeline");
+}
+
+void InspectorController::close()
+{
+ if (!enabled())
+ return;
+
m_client->closeWindow();
if (m_page)
m_page->setParentInspectorController(0);
JSObjectCallAsFunction(m_scriptContext, addMessage, m_scriptObject, 1, &messageObject, 0);
}
-static void callClearFunction(JSContextRef context, JSObjectRef thisObject, const char* functionName)
-{
- ASSERT_ARG(context, context);
- ASSERT_ARG(thisObject, thisObject);
-
- JSStringRef string = JSStringCreateWithUTF8CString(functionName);
- JSObjectRef function = JSValueToObject(context, JSObjectGetProperty(context, thisObject, string, 0), 0);
- JSStringRelease(string);
-
- JSObjectCallAsFunction(context, function, thisObject, 0, 0, 0);
-}
-
void InspectorController::clearScriptResources()
{
if (!m_scriptContext || !m_scriptObject)
resource->setScriptObject(0, 0);
}
- callClearFunction(m_scriptContext, m_scriptObject, "clearResources");
+ callSimpleFunction(m_scriptContext, m_scriptObject, "clearResources");
}
void InspectorController::clearDatabaseScriptResources()
resource->setScriptObject(0, 0);
}
- callClearFunction(m_scriptContext, m_scriptObject, "clearDatabaseResources");
+ callSimpleFunction(m_scriptContext, m_scriptObject, "clearDatabaseResources");
#endif
}
if (!m_scriptContext || !m_scriptObject)
return;
- callClearFunction(m_scriptContext, m_scriptObject, "clearConsoleMessages");
+ callSimpleFunction(m_scriptContext, m_scriptObject, "clearConsoleMessages");
}
void InspectorController::clearNetworkTimeline()
if (!m_scriptContext || !m_scriptObject)
return;
- callClearFunction(m_scriptContext, m_scriptObject, "clearNetworkTimeline");
+ callSimpleFunction(m_scriptContext, m_scriptObject, "clearNetworkTimeline");
}
void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap;
typedef HashSet<RefPtr<InspectorDatabaseResource> > DatabaseResourcesSet;
+ typedef enum {
+ FocusedNodeDocumentPanel,
+ ConsolePanel,
+ TimelinePanel
+ } SpecialPanels;
+
InspectorController(Page*, InspectorClient*);
~InspectorController();
void highlight(Node*);
void hideHighlight();
+ void show();
+ void showConsole();
+ void showTimeline();
+ void close();
+
bool windowVisible();
void setWindowVisible(bool visible = true);
void windowScriptObjectAvailable();
void scriptObjectReady();
- void windowUnloading();
void populateScriptResources();
void clearScriptResources();
JSObjectRef m_controllerScriptObject;
JSContextRef m_scriptContext;
bool m_windowVisible;
+ SpecialPanels m_showAfterVisible;
long long m_nextIdentifier;
};
document.getElementById("forward").disabled = index >= this.backForwardList.length - 1;
}
+WebInspector.showConsole = function()
+{
+ this.showingStatusArea = true;
+ this.navigateToPanel(WebInspector.consolePanel);
+}
+
+WebInspector.showTimeline = function()
+{
+ this.showingStatusArea = true;
+ this.navigateToPanel(WebInspector.networkPanel);
+}
+
WebInspector.addResource = function(resource)
{
this.resources.push(resource);
+2007-10-29 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Various semi-related changes:
+ - A WebView can now be asked for it's WebInspector. There is one
+ WebInspector per WebView.
+ - Refactor the WebInspector class and move obsolete methods to
+ a special category.
+ - Add new WebInspector methods to show, hide and show the
+ console/timeline panels.
+ - Add an isDisabled method to WebCache.
+ - Allow WebLocalizableStrings.h to be used in C files.
+
+ * Misc/WebCache.h: Add isDisabled.
+ * Misc/WebCache.mm:
+ (+[WebCache isDisabled]): New method.
+
+ * Misc/WebLocalizableStrings.h: Changes to allow use in plain C files.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController showWindow:]): Call super if already visible
+ so the window will be ordered front.
+ (-[WebInspectorWindowController showWebInspector:]): Method used by menu items,
+ so they are enabled and work when the Inspector window is key.
+ (-[WebInspectorWindowController showErrorConsole:]): Ditto.
+ (-[WebInspectorWindowController showNetworkTimeline:]): Ditto.
+
+ * WebInspector/WebInspector.h: Add and remove methods.
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector webViewClosed]): Called when the WebView is closed/dealloced.
+ Clears the _webView pointer.
+ (-[WebInspector show:]): Calls thru to the Page's InspectorController.
+ (-[WebInspector showConsole:]): Ditto.
+ (-[WebInspector showTimeline:]): Ditto.
+ (-[WebInspector close:]): Ditto.
+ (-[WebInspector attach:]): Ditto.
+ (-[WebInspector detach:]): Ditto.
+ (+[WebInspector sharedWebInspector]): Moved to the obsolete category.
+ (+[WebInspector webInspector]): Ditto.
+ (-[WebInspector setWebFrame:]): Ditto.
+ (-[WebInspector window]): Ditto.
+ (-[WebInspector showWindow:]): Ditto.
+
+ * WebView/WebView.mm:
+ (-[WebViewPrivate dealloc]): Release the WebInspector.
+ (-[WebView _close]): Call webViewClosed on the WebInspector.
+ (-[WebView inspector]): Create a WebInspector if needed and return it.
+ * WebView/WebViewPrivate.h: Add the inspector method.
+
2007-10-30 Adele Peterson <adele@apple.com>
Reviewed by Darin.
+ (NSArray *)statistics;
+ (void)empty;
+ (void)setDisabled:(BOOL)disabled;
++ (BOOL)isDisabled;
@end
WebCore::cache()->setDisabled(disabled);
}
++ (BOOL)isDisabled
+{
+ return WebCore::cache()->disabled();
+}
+
@end
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
+#if __OBJC__
+@class NSBundle;
+#else
+typedef struct NSBundle NSBundle;
+#endif
typedef struct {
const char *identifier;
extern "C" {
#endif
+#if __OBJC__
NSString *WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key);
+#else
+CFStringRef WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key);
+#endif
#ifdef __cplusplus
}
- (IBAction)showWindow:(id)sender
{
- if (_visible)
+ if (_visible) {
+ if (!_attachedToInspectedWebView)
+ [super showWindow:sender]; // call super so the window will be ordered front if needed
return;
+ }
_visible = YES;
}
}
+
+#pragma mark -
+
+// These methods can be used by UI elements such as menu items and toolbar buttons when the inspector is the key window.
+
+// This method is really only implemented to keep any UI elements enabled.
+- (void)showWebInspector:(id)sender
+{
+ [_inspectedWebView page]->inspectorController()->show();
+}
+
+- (void)showErrorConsole:(id)sender
+{
+ [_inspectedWebView page]->inspectorController()->showConsole();
+}
+
+- (void)showNetworkTimeline:(id)sender
+{
+ [_inspectedWebView page]->inspectorController()->showTimeline();
+}
+
@end
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <Foundation/Foundation.h>
+#import <Foundation/NSObject.h>
-@class WebFrame;
@class WebView;
@interface WebInspector : NSObject
{
WebView *_webView;
}
-+ (WebInspector *)sharedWebInspector;
-+ (WebInspector *)webInspector;
-- (void)setWebFrame:(WebFrame*)frame;
-- (void)showWindow:(id)sender;
+- (id)initWithWebView:(WebView *)webView;
+- (void)webViewClosed;
+- (void)show:(id)sender;
+- (void)showConsole:(id)sender;
+- (void)showTimeline:(id)sender;
+- (void)close:(id)sender;
+- (void)attach:(id)sender;
+- (void)detach:(id)sender;
@end
using namespace WebCore;
@implementation WebInspector
+- (id)initWithWebView:(WebView *)webView
+{
+ if (!(self = [super init]))
+ return nil;
+ _webView = webView; // not retained to prevent a cycle
+ return self;
+}
-// This method name is used by the Safari 3 beta
-+ (WebInspector *)sharedWebInspector
+- (void)webViewClosed
{
- return [self webInspector];
+ _webView = nil;
}
-+ (WebInspector *)webInspector
+- (void)show:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->show();
+}
+
+- (void)showConsole:(id)sender
{
+ if (Page* page = core(_webView))
+ page->inspectorController()->showConsole();
+}
+
+- (void)showTimeline:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->showTimeline();
+}
+
+- (void)close:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->close();
+}
+
+- (void)attach:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->attachWindow();
+}
+
+- (void)detach:(id)sender
+{
+ if (Page* page = core(_webView))
+ page->inspectorController()->detachWindow();
+}
+@end
+
+@implementation WebInspector (Obsolete)
++ (WebInspector *)sharedWebInspector
+{
+ // Safari 3 beta calls this method
+ static BOOL logged = NO;
+ if (!logged) {
+ NSLog(@"+[WebInspector sharedWebInspector]: this method is obsolete.");
+ logged = YES;
+ }
+
return [[[WebInspector alloc] init] autorelease];
}
-- (void)dealloc
++ (WebInspector *)webInspector
{
- [_webView release];
- [super dealloc];
+ // Safari 3 beta calls this method
+ static BOOL logged = NO;
+ if (!logged) {
+ NSLog(@"+[WebInspector webInspector]: this method is obsolete.");
+ logged = YES;
+ }
+
+ return [[[WebInspector alloc] init] autorelease];
}
- (void)setWebFrame:(WebFrame *)frame
{
- [_webView release];
- _webView = [[frame webView] retain];
+ // Safari 3 beta calls this method
+ static BOOL logged = NO;
+ if (!logged) {
+ NSLog(@"-[WebInspector setWebFrame:]: this method is obsolete.");
+ logged = YES;
+ }
+
+ _webView = [frame webView];
}
- (NSWindow *)window
// Shiira calls this internal method, return nil since we can't easily return the window
static BOOL logged = NO;
if (!logged) {
- NSLog(@"-[WebInspector window]: this method is obsolete and now returns nil. The WebInspector class will be removed in a future release.");
+ NSLog(@"-[WebInspector window]: this method is obsolete and now returns nil.");
logged = YES;
}
- (void)showWindow:(id)sender
{
- if (Page* page = core(_webView))
- if (InspectorController* inspectorController = page->inspectorController())
- inspectorController->inspect(page->mainFrame()->document());
+ // Safari 3 beta calls this method
+ static BOOL logged = NO;
+ if (!logged) {
+ NSLog(@"-[WebInspector showWindow:]: this method is obsolete.");
+ logged = YES;
+ }
+
+ [self show:sender];
}
@end
#import "WebHistoryItemInternal.h"
#import "WebIconDatabase.h"
#import "WebIconDatabaseInternal.h"
+#import "WebInspector.h"
#import "WebInspectorClient.h"
#import "WebKitErrors.h"
#import "WebKitLogging.h"
id scriptDebugDelegate;
id scriptDebugDelegateForwarder;
+ WebInspector *inspector;
+
BOOL allowsUndo;
float textSizeMultiplier;
[applicationNameForUserAgent release];
[backgroundColor release];
+ [inspector release];
[hostWindow release];
[policyDelegateForwarder release];
[self setResourceLoadDelegate:nil];
[self setScriptDebugDelegate:nil];
[self setUIDelegate:nil];
-
+
+ [_private->inspector webViewClosed];
+
// setHostWindow:nil must be called before this value is set (see 5408186)
_private->closed = YES;
return newWindowWebView;
}
+- (WebInspector *)inspector
+{
+ if (!_private->inspector)
+ _private->inspector = [[WebInspector alloc] initWithWebView:self];
+ return _private->inspector;
+}
+
- (WebCore::Page*)page
{
return _private->page;
@class NSError;
@class WebFrame;
+@class WebInspector;
@class WebPreferences;
@protocol WebFormDelegate;
+ (BOOL)_developerExtrasEnabled;
+ (BOOL)_scriptDebuggerEnabled;
+- (WebInspector *)inspector;
+
/*!
@method setBackgroundColor:
@param backgroundColor Color to use as the default background.
+2007-10-29 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by John Sullivan.
+
+ - Place the Localizable.strings file in mac or win directories
+ if that location exists.
+ - Also look for UI_STRING in .c files.
+
+ * Scripts/extract-localizable-strings:
+
2007-10-30 Kevin McCullough <kmccullough@apple.com>
Reviewed by Adam.
(ServerConnection::getCallerFrame):
* Drosera/win/ServerConnection.h: Added a helper function.
-
2007-10-29 Kevin McCullough <kmccullough@apple.com>
updated reviewers for my previous changelog.
if (open EXCEPTIONS, $exceptionsFile) {
while (<EXCEPTIONS>) {
chomp;
- if (/^"([^\\"]|\\.)*"$/ or /^[-_\/\w.]+.(h|m|mm|cpp)$/ or /^[-_\/\w.]+.(h|m|mm|cpp):"([^\\"]|\\.)*"$/) {
+ if (/^"([^\\"]|\\.)*"$/ or /^[-_\/\w.]+.(h|m|mm|c|cpp)$/ or /^[-_\/\w.]+.(h|m|mm|c|cpp):"([^\\"]|\\.)*"$/) {
if ($exception{$_}) {
print "$exceptionsFile:$.:exception for $_ appears twice\n";
print "$exceptionsFile:$exception{$_}:first appearance\n";
$quotedDirectoriesString .= ' -path "' . $dir . '" -prune';
}
-my @files = ( split "\n", `find $quotedDirectoriesString -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.cpp"` );
+my @files = ( split "\n", `find $quotedDirectoriesString -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.c" -o -name "*.cpp"` );
for my $file (sort @files) {
next if $file =~ /\/WebLocalizableStrings\.h$/;
utf8::decode($localizedStrings) if $^V ge chr(5).chr(8);
my $output = pack "n*", (0xFEFF, unpack "U*", $localizedStrings);
foreach my $directory (@directories) {
- open STRINGS, ">", "$directory/$stringsFile" or die;
- print STRINGS $output;
- close STRINGS;
+ if (-e "$directory/mac/$stringsFile") {
+ open STRINGS, ">", "$directory/mac/$stringsFile" or die;
+ print STRINGS $output;
+ close STRINGS;
+ }
+
+ if (-e "$directory/win/$stringsFile") {
+ open STRINGS, ">", "$directory/win/$stringsFile" or die;
+ print STRINGS $output;
+ close STRINGS;
+ }
+
+ if (-e "$directory/$stringsFile") {
+ open STRINGS, ">", "$directory/$stringsFile" or die;
+ print STRINGS $output;
+ close STRINGS;
+ }
}