forked from ff6347/mpolauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fabiantheblind
committed
Aug 1, 2011
1 parent
d9b6cea
commit 3b3fca5
Showing
23 changed files
with
3,782 additions
and
1,339 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* MPOLnchHelpfiles.cpp | ||
* MPOLauncher | ||
* | ||
* Created by fabiantheblind on 01.08.11. | ||
* Copyright 2011 tmn. All rights reserved. | ||
* | ||
*/ | ||
|
||
#include "MPOLnchHelper.h" | ||
|
||
// constructor | ||
MPOLnchHelper::MPOLnchHelper(); | ||
//{ | ||
//} | ||
|
||
// Helpfile function | ||
|
||
PMString MPOLnchHelper::ReadAllAsText(IPMStream *s) | ||
{ | ||
PMString text; | ||
uchar oneChar; | ||
s->XferByte(oneChar); | ||
while (s->GetStreamState() == kStreamStateGood) | ||
{ | ||
text.Append((char)oneChar); | ||
|
||
// Read the next character | ||
s->XferByte(oneChar); | ||
|
||
} // end while streamstategood | ||
|
||
return text; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* MPOLnchHelpfiles.h | ||
* MPOLauncher | ||
* | ||
* Created by fabiantheblind on 01.08.11. | ||
* Copyright 2011 tmn. All rights reserved. | ||
* | ||
*/ | ||
|
||
#ifndef DATE_H | ||
#define DATE_H | ||
#include "IPMStream.h" | ||
|
||
class MPOLnchHelper | ||
{ | ||
public: | ||
|
||
|
||
MPOLnchHelper() { } // default constructor | ||
|
||
PMString ReadAllAsText(IPMStream *s); | ||
|
||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,10 +63,8 @@ | |
#include "FileUtils.h" | ||
#include "StreamUtil.h" | ||
#include "IPMStream.h" | ||
#include "MPOLnchHelper.h" | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
|
||
/** | ||
|
@@ -117,6 +115,7 @@ class MPOLnchPenObserver : public CObserver | |
*/ | ||
virtual void Update(const ClassID& theChange, ISubject* theSubject, const PMIID &protocol, void* changedBy); | ||
|
||
//PMString ReadAllAsText(IPMStream *s); | ||
|
||
|
||
}; | ||
|
@@ -215,12 +214,17 @@ void MPOLnchPenObserver::Update | |
|
||
|
||
IDFile helpFile; | ||
FileUtils::GetAppInstallationFolder(&helpFile); //application folder path | ||
FileUtils::AppendPath(&helpFile, PMString("Scripts")); | ||
FileUtils::AppendPath(&helpFile, PMString("Scripts Panel")); | ||
FileUtils::AppendPath(&helpFile, PMString("MPO Launcher")); | ||
FileUtils::AppendPath(&helpFile, PMString("help")); | ||
|
||
|
||
FileUtils::GetAppInstallationFolder(&helpFile); // Application Folder Path | ||
|
||
FileUtils::AppendPath(&helpFile, PMString("Plug-Ins")); | ||
FileUtils::AppendPath(&helpFile, PMString("tmn")); | ||
FileUtils::AppendPath(&helpFile, PMString("MPOLauncher.InDesignPlugin")); | ||
// | ||
FileUtils::AppendPath(&helpFile, PMString("Versions")); | ||
FileUtils::AppendPath(&helpFile, PMString("A")); | ||
FileUtils::AppendPath(&helpFile, PMString("Resources")); | ||
|
||
PMString pre("help_"); | ||
PMString fn(nodeName); | ||
PMString exth(".jsx"); | ||
|
@@ -230,27 +234,24 @@ void MPOLnchPenObserver::Update | |
|
||
|
||
if (FileUtils::DoesFileExist(helpFile)) { | ||
InterfacePtr<IPMStream> s(StreamUtil::CreateFileStreamRead(helpFile)); | ||
|
||
MPOLnchHelper helper; | ||
|
||
//CAlert::InformationAlert(helper.ReadAllAsText(s)); | ||
CAlert::ModalAlert(helper.ReadAllAsText(s), | ||
kOKString, | ||
kNullString, | ||
kNullString, | ||
1, // pass in 1, 2, or 3 to make that button the default button or 0 for no default | ||
CAlert::eWarningIcon); | ||
|
||
|
||
// for debug | ||
//FileUtils::OpenFile(scriptFile); | ||
InterfacePtr<IScriptRunner>scriptRunner(Utils<IScriptUtils>()->QueryScriptRunner(helpFile)); | ||
bool filestatus=scriptRunner->CanHandleFile(helpFile); | ||
|
||
RunScriptParams scriptParams(scriptRunner); | ||
scriptParams.SetShowErrorAlert(kTrue); | ||
scriptParams.SetInvokeDebugger(kFalse); | ||
|
||
|
||
|
||
if(filestatus==1) | ||
{ | ||
scriptRunner->RunFile(helpFile,scriptParams); | ||
}// close filestatus | ||
|
||
}else { | ||
CAlert::InformationAlert("Got an error. You need the MPO Launcher Folder in the Scripts Panel"); | ||
CAlert::InformationAlert("Got an error reading in the "+nodeName | ||
+" help. Something went teribly wrong."+ | ||
" Contact [email protected] for more help"); | ||
} | ||
|
||
|
||
|
@@ -265,5 +266,21 @@ void MPOLnchPenObserver::Update | |
} | ||
|
||
|
||
//PMString MPOLnchPenObserver::ReadAllAsText(IPMStream *s) | ||
//{ | ||
// PMString text; | ||
// uchar oneChar; | ||
// s->XferByte(oneChar); | ||
// while (s->GetStreamState() == kStreamStateGood) | ||
// { | ||
// text.Append((char)oneChar); | ||
// | ||
// // Read the next character | ||
// s->XferByte(oneChar); | ||
// | ||
// } // end while streamstategood | ||
// | ||
// return text; | ||
//} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
alert("This is the Help for: " + $.fileName); | ||
alert("This is the Help for: " + $.fileName); | ||
|
||
var myString = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. | ||
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. | ||
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. | ||
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. | ||
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. | ||
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur"; |
Oops, something went wrong.