How to include resources file in anjuta project - gtk3

I'm trying to update a graphical project in vala, moving lot of code lines into an ui file.
I want to use template (available with glib-2.38 and GTK+3.8, something like that).
My project is managed with Anjuta and autoconf.
In the src directory there are
application.ui:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<template class="SpiWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Example Application</property>
<property name="default-width">600</property>
<property name="default-height">400</property>
<child>
<placeholder />
</child>
</template>
</interface>
resources.xml:
<?xml version="1.0" charset="UTF-8" ?>
<gresources>
<gresource prefix="/org/app/spi">
<file compressed="true" preprocess="xml-stripblanks">application.ui</file>
</gresource>
</gresources>
in src/Makefile.am I have append --gresources resources.xml to the spi_VALAFLAGS. And finally I declared The Gtk.ApplicationWindow like this
[GtkTemplate(ui = "/org/app/spi/application.ui")]
internal class SpiWindow : Gtk.ApplicationWindow {
// Constructor
public Window (Gtk.Application application) {
Object(application: application);
}
}
But when I compile and then run the application, there is the error message :
(spi:9749): Gtk-CRITICAL : Unable to load resource for composite template for type 'SpiWindow': The resource at '/org/app/spi/application.ui' does not exist
(spi:9749): Gtk-CRITICAL : gtk_widget_init_template: assertion 'template != NULL' failed

You still need to compile the resources and include them:
GLIB_COMPILE_RESOURCES=glib-compile-resources
resources.c: resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies resources.xml)
$(GLIB_COMPILE_RESOURCES) --target=$# --generate-source $<
and include resources.c as a source file in spi_SOURCES.

Related

What is wrong with my layer.xml from netbeans?

I try to create a new palette in netbeans 10, but the following 2 errors don't allow me to compile the project:
Document root element "folder", must match DOCTYPE root "JavaPalette". [3]
The markup in the document following the root element must be well-formed. [11]
My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
<filesystem/>
I have no clue what both error messages mean, but i did exactly what is said in the tutorial.
Online validation of the xml file also shows that error.
https://platform.netbeans.org/tutorials/nbm-palette-api2.html
I didn´t followed the tutorial, but as far as i can tell, your filesystem tag is not valid. If you take a look at the DTD you can see that the element filesystem isn´t declared as EMPTY (for more information you can read more about it here). So you have to provide a start and end tag. In your posted example you are only using <filesystem/> which isn´t allowed.
You have to change the xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
</filesystem>

"Function was not implemented" when trying to use ONI recording

I'm trying to use an oni recording in my application using OpenNI. Here is my xml file:
<OpenNI>
<Licenses>
<!-- Add application-specific licenses here
<License vendor="vendor" key="key"/>
-->
</Licenses>
<Log writeToConsole="false" writeToFile="false">
<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="true"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>
<Recording file="Recording.oni" />
<!-- Set global mirror -->
<GlobalMirror on="true"/>
</ProductionNodes>
</OpenNI>
Everything looks ok, but when I try to run my program, I get:
Open failed: Function was not implemented!
What could be the problem?
The problem were the two following lines:
<!-- Set global mirror -->
<GlobalMirror on="true"/>
After removing them, my program works fine.

SYmfony plugin upload error: You must specify the min version for symfony

I have been trying to upload my SYmfony plugin for some time but I keep getting this error.
Initially the dependency on the SYmfony Package was missing, but I added that.
My package.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>sfActivateablePlugin</name>
<channel>pear.symfony-project.com</channel>
<summary>sfActivateablePlugin allows auditing record activation/deactivation by setting up a flag, timestamp & user detail fields.</summary>
<description>The sfActivateablePlugin allows you to automatically:
* create a `is_active` flag (or name of your choice)
* create timestamp & user detail fields (e.g. `activated_by`, `activated_at`, ...)
* populate timestamps & user details when `is_active` flag is toggled on a record.</description>
<lead>
<name>Prasad Gupte</name>
<user>prasadgupte</user>
<email>xxxxxxxx#gmail.com</email>
<active>yes</active>
</lead>
<date>2010-09-22</date>
<time>19:33:09</time>
<version>
<release>1.0.0</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.symfony-project.com/license">MIT license</license>
<notes>
* First public release.
</notes>
<contents>
<dir baseinstalldir="sfActivateablePlugin/" name="/">
<file baseinstalldir="sfActivateablePlugin/" md5sum="89b09d4d48e5259a3c659dfc65b0fc52" name="config/plugin_settings.yml.sample" role="data" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="8b40522acb23552e6e31ba2416387515" name="lib/Activateable.class.php" role="php" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="926a9eb938eccc9083d2b116e50246b3" name="lib/Listener/Activateable.class.php" role="php" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="17346d33da2ea3b9d880afc71e7022fd" name="LICENSE" role="doc" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="b836dfd2f324ae4ea975842197dcf8e2" name="README" role="doc" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.2.6</min>
</php>
<pearinstaller>
<min>1.4.1</min>
</pearinstaller>
<package>
<name>Symfony</name>
<channel>pear.symfony-project.org</channel>
<min>1.4</min>
<recommended>1.4</recommended>
</package>
</required>
</dependencies>
<phprelease />
<changelog>
<release>
<version>
<release>1.0.0</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2010-09-22</date>
<license uri="http://www.symfony-project.com/license">MIT license</license>
<notes>
* First public release.
</notes>
</release>
</changelog>
</package>
Am I missing some tag? Or specified incorrect Symfony version? Pl help
Figured out a couple of mistakes:
1. the package name is symfony and not Symfony
2. the max version is also required
If you use the Pear Package Manager API:
$packagexml->addPackageDepWithChannel('required', 'symfony', 'pear.symfony-project.com', '1.4', '1.4', '1.4');

Reading values from property file through NANT

How can I read a value alone from the property file. For example, how can I read the values of build.home or temp.dir from the below example.
contents of env.properties
build.home=c:\build
temp.dir=c:\temp
Regards
Sarathy
We do this in a slightly different format for Nant.
In your build file:
<include buildfile="./env.properties" failonerror="true"/>
env.properties:
<?xml version="1.0" ?>
<project>
<property name="build.home" value="c:/build"/>
<property name="temp.dir" value="c:/temp"/>
</project>

nant: expanding properties in a string

Summary:
How do I expand a property with value "download\${bulidmode}\project\setup.msi" to "download\Debug\project\setup.msi" if the property buildmode contained debug so I can use it as the file="" part of < copy >
Detail:
I have a bit of a requirement to be able to expand properties within a string in nant.
For example I have a target that is copying file A to B. A and B both come from a simple two field CSV file which I'm iterating through using
<foreach item="Line" in="filelist.csv" delim="," property="source.file,target.file">
<property name="sourcefile" value="${path::combine(source.dir,source)}" />
<property name="targetfile" value="${path::combine(download.dir,destination)}" />
<echo message="Copy ${sourcefile} to ${targetfile}" />
<copy file="${sourcefile" tofile="${destination}" />
</foreach>
and the filelist.csv will be
build\manifest.xml
solutiondirectory\setup-proj-directory\Release\setupproj.msi,ProductA\ProductA.msi
solutiondirectory\another-proj-dir\Release\setupproj.msi,ProductB\ProductB.msi
(The reason we split these out is that we write multi-tiered applications and deploy by MSI to each tier - so one product has multiple msi's all built with the same version numbers)
Anyway - I want to change this to that I no longer have "Release" in the filelist.csv file but something like ${build.mode}. I would wrap the above code with a
<foreach item="String" in="Release,Debug" delim="," property="build.mode">
....as above
</foreach>
and the property embedded within the string in the file gets expanded.
I've been beating my head against a brick wall for a few hours, but just can't figure it out.
Thanks
It is possible with a custom function :
<?xml version="1.0"?>
<project>
<script language="C#" prefix="vbfox" >
<code>
<![CDATA[
[Function("expand")]
public string ExpandString(string str)
{
return Project.Properties.ExpandProperties(str, Location.UnknownLocation);
}
]]>
</code>
</script>
<property name="hello" value="{path::combine('_hello_', '_world_')}" />
<property name="hello" value="${'$' + hello}" />
<echo message="${hello}" />
<echo message="${vbfox::expand(hello)}" />
</project>