[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: last call for alcohol .. er .. BIC API changes
From:       "Richard Dale" <richard.j.dale () gmail ! com>
Date:       2008-11-05 11:55:52
Message-ID: 491684420811050355r48577c93sedd0e7c26f280877 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2008/11/3 Aaron J. Seigo <aseigo@kde.org>

> On Monday 03 November 2008, Richard Dale wrote:
>


> > One little thing that would be nice, is to be able to specify a different
> > name for the main file in a plasmoid so that we can have main.rb, main.py
> > etc without needing to have a new package structure plugin just to be
> able
> > to do that.
>
> i thought that was why we added the virtual mainScript method to
> ScriptEngine,
> but evidently that's not good enough.

No the problem is that in Plasma::Package::isValid() there is this test:

    foreach (const char *file, d->structure->requiredFiles()) {
        if (!QFile::exists(d->basePath + d->structure->contentsPrefix() +
d->structure->path(file))) {
            kWarning() << "Could not find required file" << file << ", look
in"
                       << d->basePath + d->structure->contentsPrefix() +
d->structure->path(file) << endl;
            d->valid = false;
            return false;
        }
    }

And it doesn't use the mainScript() method to get the name of the file to
check, so you get this error:

plasmoidviewer(12281)/libplasma Plasma::Applet::load: we have a script using
the "ruby-script" API
plasmoidviewer(12281)/libplasma Plasma::Package::isValid: Could not find
required file mainscript , look in
"/home/rdale/.kde/share/apps/plasma/plasmoids/test_ruby/contents/code/main"

There is a space after 'mainscript' before the comma in the error text,
which looks like a bug.


>
>
> something that occured to me is that you could always use the mainscript
> file
> to load 'main.py', no? one more bit of indirection, but you get your syntax
> highlighting that way ..
>
> not overly elegant of course ... i'm seriously not impressed that we're
> looking at such complexity because of syntax highlighting in editors. =/

 I think that's uglier than needing special package subclasses though. But
the big problem with custom packages for ruby and python is that they're
supposed to be translated and we will need to duplicate the i18n strings
from the default plasmoid package .desktop file.

-- Richard

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">2008/11/3 Aaron J. Seigo <span dir="ltr">&lt;<a \
href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <div><div></div><div class="Wj3C7c">On Monday 03 \
November 2008, Richard Dale \
wrote:</div></div></blockquote><div>&nbsp;</div><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;"> &gt; One little thing that would be nice, is to be able to \
specify a different<br><div class="Ih2E3d"> &gt; name for the main file in a plasmoid \
so that we can have main.rb, main.py<br> &gt; etc without needing to have a new \
package structure plugin just to be able<br> &gt; to do that.<br>
<br>
</div>i thought that was why we added the virtual mainScript method to \
ScriptEngine,<br> but evidently that&#39;s not good enough.</blockquote><div>No the \
problem is that in Plasma::Package::isValid() there is this \
test:<br><br>&nbsp;&nbsp;&nbsp; foreach (const char *file, \
d-&gt;structure-&gt;requiredFiles()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if (!QFile::exists(d-&gt;basePath + d-&gt;structure-&gt;contentsPrefix() + \
d-&gt;structure-&gt;path(file))) {<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kWarning() \
&lt;&lt; &quot;Could not find required file&quot; &lt;&lt; file &lt;&lt; &quot;, look \
in&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;&lt; d-&gt;basePath + d-&gt;structure-&gt;contentsPrefix() + \
d-&gt;structure-&gt;path(file) &lt;&lt; endl;<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d-&gt;valid = \
false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return \
false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; \
}<br><br>And it doesn&#39;t use the mainScript() method to get the name of the file \
to check, so you get this error:<br><br>plasmoidviewer(12281)/libplasma \
Plasma::Applet::load: we have a script using the &quot;ruby-script&quot; API<br> \
plasmoidviewer(12281)/libplasma Plasma::Package::isValid: Could not find required \
file mainscript , look in \
&quot;/home/rdale/.kde/share/apps/plasma/plasmoids/test_ruby/contents/code/main&quot;<br><br>There \
is a space after &#39;mainscript&#39; before the comma in the error text, which looks \
like a bug.<br> &nbsp;<br></div><blockquote class="gmail_quote" style="border-left: \
1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> \
<br> something that occured to me is that you could always use the mainscript \
file<br> to load &#39;main.py&#39;, no? one more bit of indirection, but you get your \
syntax<br> highlighting that way ..<br>
<br>
not overly elegant of course ... i&#39;m seriously not impressed that we&#39;re<br>
looking at such complexity because of syntax highlighting in editors. \
=/</blockquote><div>&nbsp;I think that&#39;s uglier than needing special package \
subclasses though. But the big problem with custom packages for ruby and python is \
that they&#39;re supposed to be translated and we will need to duplicate the i18n \
strings from the default plasmoid package .desktop file.<br> <br>-- \
Richard<br></div></div><br>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic