diff options
| author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-09 02:46:23 +0000 |
|---|---|---|
| committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2009-01-09 02:46:23 +0000 |
| commit | 283ebdc88fe0867c50f56306bf53dcdeec0da013 (patch) | |
| tree | abab71b8038f352d2db28390bc2922936b96b19a /Plugins/skins/SkinLib | |
| parent | fefa34c8d2d2501ca1ec2e7cd57f98a8816f3939 (diff) | |
skins: List of skins and notification on options
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@126 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib')
| -rw-r--r-- | Plugins/skins/SkinLib/SkinnedDialog.cpp | 17 | ||||
| -rw-r--r-- | Plugins/skins/SkinLib/SkinnedDialog.h | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/Plugins/skins/SkinLib/SkinnedDialog.cpp b/Plugins/skins/SkinLib/SkinnedDialog.cpp index d3abe0c..fdca335 100644 --- a/Plugins/skins/SkinLib/SkinnedDialog.cpp +++ b/Plugins/skins/SkinLib/SkinnedDialog.cpp @@ -58,22 +58,21 @@ void SkinnedDialog::setSize(const Size &size) releaseState();
}
-bool SkinnedDialog::compile()
+int SkinnedDialog::compile()
{
- bool changed = fileChanged();
- if (!changed)
- return true;
+ if (!fileChanged())
+ return 1;
releaseCompiledScript();
struct _stat st = {0};
if (_tstat(filename.c_str(), &st) != 0)
- return false;
+ return 0;
std::tstring text;
readFile(text);
if (text.size() <= 0)
- return false;
+ return 0;
script = new V8Script();
script->setExceptionCallback(errorCallback, errorCallbackParam);
@@ -81,7 +80,7 @@ bool SkinnedDialog::compile() if (!script->compile(text.c_str(), this))
{
releaseCompiledScript();
- return false;
+ return 0;
}
std::pair<SkinOptions *,DialogState *> pair = script->configure(this);
@@ -90,12 +89,12 @@ bool SkinnedDialog::compile() if (opts == NULL)
{
releaseCompiledScript();
- return false;
+ return 0;
}
fileChangedTime = st.st_mtime;
- return true;
+ return 2;
}
DialogState * SkinnedDialog::getState()
diff --git a/Plugins/skins/SkinLib/SkinnedDialog.h b/Plugins/skins/SkinLib/SkinnedDialog.h index 6cbb4a3..ea99280 100644 --- a/Plugins/skins/SkinLib/SkinnedDialog.h +++ b/Plugins/skins/SkinLib/SkinnedDialog.h @@ -60,7 +60,7 @@ public: protected:
virtual bool fileChanged();
- virtual bool compile();
+ virtual int compile(); /// @return 0 error, 1 no change, 2 compiled
virtual void trace(TCHAR *msg, ...);
|
