Re: [Vala] Use defined pathes inside a method

2017-05-06 Thread Sascha Manns
Hello list,

maybe anyone has an idea for that?

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org



signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Use defined pathes inside a method

2017-05-03 Thread Sascha Manns
Hi Al, hi list,


On 20.04.2017 18:40, Al Thomas wrote:
> I would create a single configuration object that implements multiple
> interfaces. The interfaces allow settings to be grouped. So the single object 
> is
> passed around, but a specific interface is given as the type for the argument 
> to 
>
> a service object constructor. This also makes it easier to test a service
> object because you need to pass a dummy configuration that only matches the 
>
> interface and not the whole configuration object.
I prepared that config.vala [1].

In general it looks like, that:

public string home = Environment.get_home_dir ();

public string publican_home {get {_pathhome = home +
(string)Path.DIR_SEPARATOR + "/publisher-projects"; return _pathhome;}}

can't used because of it itn't instancable. But how can i work with such
pathes instead?

Also i added a metod which imports the settings from the gsettings
schema and connects this to its properties from the interface. Is the
implementation usable in that case? It would be great, that the
gsettings and the defined pathes are useable inside each other class.

Greetings
Sascha


[1] https://github.com/saigkill/gnome-publisher/blob/master/src/config.vala

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Use defined pathes inside a method

2017-04-20 Thread Sascha Manns
Hello list,

i have defined some stuff in my Defines class [1].

What is a good way to use the contents of the properties inside a mathod
or class?

[1] https://github.com/saigkill/gnome-publisher/blob/master/src/defines.vala

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Gschema: failed to parse value

2017-04-19 Thread Sascha Manns
Hi Al,


On 19.04.2017 22:32, Al Thomas wrote:
>> default element is available by using double quotes.
> Hmmm, this has caught out other people too:
> https://rm5248.com/gsettings/
Yes that is irritating. I have placed a enhancement on bgo.
> The problem to do with properties is because you are assigning the body
> of the property. That's not how is should be done. So in 
>
> src/core/create_publication_core.vala the property:
>
>
> private string entity_file_local = {get {_filename = publication_title + 
> entity_file_suffix; return _filename;}}
>
> should be:
>
> private string entity_file_local {get {_filename = publication_title + 
> entity_file_suffix; return _filename;}}
>
> Also, if you haven't already figured it out Path.DIR_SEPARATOR needs to be 
> cast to a string:
>
>
> private string project_dir {get {_path = target_dir + 
> (string)Path.DIR_SEPARATOR + publication_title + (string)Path.DIR_SEPARATOR + 
> create_language; return _path;}}
After that changes the make process goes to the end now. Thanks for helping.

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Gschema: failed to parse value

2017-04-19 Thread Sascha Manns
Hello list,

i have looked in other projects on git, and found out, that a empty
default element is available by using double quotes.
Now the validation and compiling process of data/ is done.

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Gschema: failed to parse value

2017-04-19 Thread Sascha Manns
Hello list,


On 15.04.2017 22:09, Sascha Manns wrote:
> Hi List,
>
> i created a schema file in:
> https://github.com/saigkill/gnome-publisher/blob/master/data/org.gnome.Publisher.gschema.xml
>
> Then i tried to install and compile it manually. But i'm got:
>
> sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/data> sudo cp
> org.gnome.Publisher.gschema.xml /usr/share/glib-2.0/schemas/
> sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/data> sudo
> glib-compile-schemas /usr/share/glib-2.0/schemas/
> /usr/share/glib-2.0/schemas/org.gnome.Publisher.gschema.xml:16:1  failed
> to parse  value of type 's': 0-5:unknown keyword.  This entire
> file has been ignored.
>
> Maybe a string-key default-element can't be empty?
Today i filled the default element with some default stuff. I committed
my last changes to the mentioned repository. Currently a make inside the
data directory ends with: failed to parse  value of type 's':
0-1:unknown keyword. What can i do? Or exists a better place to ask?

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Handling strings

2017-04-19 Thread Sascha Manns
Hi Al,

On 19.04.2017 15:04, Al Thomas wrote:
>
> You've added 'const'. It should be:
>
> private string ENTITY_FILE_LOCAL = {get {_filename =
>  publication_title + ENTITY_FILE_SUFFIX; return _filename;}}
>
> Constants do not change during the running of the program. They can, however,
> be concatenated at compile time. So you could do:
> private const string PATH = DIRECTORY_SEPARATOR_CHAR + AUTHOR_GROUP;
>
> If the field is changeable during the running of the program then it shouldn't
> be marked as 'const'.
I tried it out:
private string _filename;
private string _path;
private string entity_file_suffix = ".ent";
private string entity_file_local = {get {_filename =
publication_title + entity_file_suffix; return _filename;}}
private string project_dir = {get {_path = target_dir +
Path.DIR_SEPARATOR + publication_title + Path.DIR_SEPARATOR +
create_language; return _path;}}

But got the same compiler error:
core/create_publication_core.vala:52.42-52.42: error: syntax error,
expected `}'
private string entity_file_local = {get {_filename =
publication_title + entity_file_suffix; return _filename;}}
^
core/create_publication_core.vala:53.36-53.36: error: syntax error,
expected `}'
private string project_dir = {get {_path = target_dir +
Path.DIR_SEPARATOR + publication_title + Path.DIR_SEPARATOR +
create_language; return _path;}}
> By the way, GLib has a constant already for directory separator:
> https://valadoc.org/glib-2.0/GLib.Path.DIR_SEPARATOR.html
Good point. Thank you, i'll changed it.

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Handling strings

2017-04-19 Thread Sascha Manns
Hi Al,


On 19.04.2017 14:17, Al Thomas wrote:
> Concatenation of variables is done at run time, so you either need to
> make the strings constant or use properties to allow the concatenation to
> occur at run time:
>
> void main () {
>  var a = new Test ();
>   print (@"Extension: $(Test.ext)\n");
>   print (@"Filename: $(a.filename)\n");
>   print (@"Path: $(a.path)\n");
> }
>
> class Test {
>   public const string ext = ".ext";
>   private string _filename;
>   public string filename {get {_filename = "test" + ext; return _filename;}}
>   private string _path;
>   public string path {get {_path = "/full/path/" + filename; return _path;}}
> }
I tried it out in that way:
// Constants used by create_publication_core
private string _filename;
private string _path;
private const string REV_HIST = "Revision_History.xml";
private const string AUTHOR_GROUP = "Author_Group.xml";
private const string ENTITY_FILE_SUFFIX = ".ent";
private const string DIRECTORY_SEPARATOR_CHAR = "/";
private const string ENTITY_FILE_LOCAL = {get {_filename =
publication_title + ENTITY_FILE_SUFFIX; return _filename;}}
private const string PROJECT_DIR = {get {_path = target_dir +
DIRECTORY_SEPARATOR_CHAR + publication_title + DIRECTORY_SEPARATOR_CHAR
+ create_language; return _path;}}

The compiler says:

core/create_publication_core.vala:51.48-51.48: error: syntax error,
expected `}'
private const string ENTITY_FILE_LOCAL = {get {_filename =
publication_title + ENTITY_FILE_SUFFIX; return _filename;}}
  ^
core/create_publication_core.vala:52.42-52.42: error: syntax error,
expected `}'
private const string PROJECT_DIR = {get {_path = target_dir +
DIRECTORY_SEPARATOR_CHAR + publication_title + DIRECTORY_SEPARATOR_CHAR
+ create_language; return _path;}}

Maybe i miss anything?

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Handling strings

2017-04-19 Thread Sascha Manns
Hello list,

actually i'm trying to use some strings in my vala app:

private string entity_file_suffix = ".ent";
private string directory_separator_char = "/";
private string entity_file_local = publication_title +
entity_file_suffix;
private string project_dir = target_dir + directory_separator_char +
publication_title + directory_separator_char + create_language;

I'm getting the information that the access to instance member is denied.

How can i concat strings in Vala? The doc under
https://wiki.gnome.org/Projects/Vala/StringSample uses the same way.

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Gschema: failed to parse value

2017-04-15 Thread Sascha Manns
Hi List,

i created a schema file in:
https://github.com/saigkill/gnome-publisher/blob/master/data/org.gnome.Publisher.gschema.xml

Then i tried to install and compile it manually. But i'm got:

sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/data> sudo cp
org.gnome.Publisher.gschema.xml /usr/share/glib-2.0/schemas/
sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/data> sudo
glib-compile-schemas /usr/share/glib-2.0/schemas/
/usr/share/glib-2.0/schemas/org.gnome.Publisher.gschema.xml:16:1  failed
to parse  value of type 's': 0-5:unknown keyword.  This entire
file has been ignored.

Maybe a string-key default-element can't be empty?

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] syntax error, expected get, set, or construct

2017-04-15 Thread Sascha Manns
Hi Evan,

thank you very much for helping. That works.

Greetings Sascha


On 15.04.2017 20:07, Evan Nemerson wrote:
> On Sat, 2017-04-15 at 15:38 +0200, Sascha Manns wrote:
>> Hello list,
>>
>> i prepared that class:
>> https://github.com/saigkill/gnome-publisher/blob/master/src/ui/build_
>> publication.vala
>>
>> The compiler says to me:
>>
>> sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/src> make
>>   GEN  resources.c
>> git.mk: Generating .gitignore
>> make  all-am
>> make[1]: Verzeichnis „/home/sascha/Projects/gnome-publisher-tmp/src“
>> wird betreten
>>   VALACgnome_publisher_vala.stamp
>> ui/build_publication.vala:57.2-57.11: error: syntax error, expected
>> get,
>> set, or construct
>> build_docx = chkDOCX.active;
>> ^^
>
> The functions are missing parenthesis.  For example,
>
> [GtkCallback]
> private void on_chkDOCX_toggled {
>   build_docx = chkDOCX.active;
> }
>
> Should be
>
> [GtkCallback]
> private void on_chkDOCX_toggled () {
>   build_docx = chkDOCX.active;
> }
>
>> And the error above it gets me for each element in the class. But
>> this
>> class is build like the other classes (like
>> https://github.com/saigkill/gnome-publisher/blob/master/src/ui/revisi
>> on_update.vala).
>> On the other classes i haven't seen that issue.
>>
>> Maybe anyone has an idea?
>>
>> Greetings
>>
>> Sascha
>>
>> ___
>> vala-list mailing list
>> vala-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/vala-list

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] syntax error, expected get, set, or construct

2017-04-15 Thread Sascha Manns
Hello list,

i prepared that class:
https://github.com/saigkill/gnome-publisher/blob/master/src/ui/build_publication.vala

The compiler says to me:

sascha@linux-ktr9:~/Projects/gnome-publisher-tmp/src> make
  GEN  resources.c
git.mk: Generating .gitignore
make  all-am
make[1]: Verzeichnis „/home/sascha/Projects/gnome-publisher-tmp/src“
wird betreten
  VALACgnome_publisher_vala.stamp
ui/build_publication.vala:57.2-57.11: error: syntax error, expected get,
set, or construct
build_docx = chkDOCX.active;
^^

And the error above it gets me for each element in the class. But this
class is build like the other classes (like
https://github.com/saigkill/gnome-publisher/blob/master/src/ui/revision_update.vala).
On the other classes i haven't seen that issue.

Maybe anyone has an idea?

Greetings

Sascha

-- 

Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Gtk.FileChooserButton

2017-04-10 Thread Sascha Manns
Hello list,

i tried out to get a special folder from a Gtk.FileChooserButton.

In Mono/Gtk-Sharp i used:

public string RevUpdFolder { get; set; }
[Builder.Object] private FileChooserButton FileChooserRevUpd;
protected void OnFileChooserRevUpdFileSet(object sender, EventArgs e)
{
RevUpdFolder = FileChooserRevUpd.CurrentFolder;
}

In Vala i tried to port it:

public string revupdfolder { get; set; }
[Gtk.Child] private Gtk.FileChooserButton fileChooserRevUpd;
private void on_fileChooserRevUpd_file_set () {
revupdfolder = fileChooserRevUpd.current_folder;
}

But it looks like there is no way to get the current folder like
Gtk-Sharp it does, or?

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Cannot convert from `Gtk.ComboBoxText.get_active_text' to `string'

2017-04-10 Thread Sascha Manns
Hi Jonathan,

yeah that works. Thank you :-)

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Cannot convert from `Gtk.ComboBoxText.get_active_text' to `string'

2017-04-10 Thread Sascha Manns
Hello list,

i created a class what contains:

// Properties
public string doctype { get; set; }

// GUI Elements
[GtkChild] private Gtk.ComboBoxText cboDocType;

// on_cboDocType_changed gets the chosen document type
[GtkCallback]
private void on_cboDocType_changed () {
doctype = cboDocType.get_active_text;
}

The compiler says:
ui/create_publication.vala:45.2-45.37: error: Assignment: Cannot convert
from `Gtk.ComboBoxText.get_active_text' to `string'
doctype = cboDocType.get_active_text;


But as far as i know the combobox text is a string. So it should work.

What can i do?

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] cannot locate ITS rules for org.gnome.Publisher.appdata.xml.in

2017-04-10 Thread Sascha Manns
Hi Al,

thank you very much for helping out. I'll try this out.

Greetings
Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] cannot locate ITS rules for org.gnome.Publisher.appdata.xml.in

2017-04-09 Thread Sascha Manns
Hello list,

i prepared a Makefile for all stuff in data directory:
https://github.com/saigkill/gnome-publisher/blob/master/data/Makefile.am

After ./autogen.sh and make i'm getting:

sascha@linux-ktr9:~/Projects/gnome-publisher1/data> make
  GEN  org.gnome.Publisher.appdata.xml
/usr/bin/msgfmt: cannot locate ITS rules for
org.gnome.Publisher.appdata.xml.in

Maybe anyone knows why this happens?

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Radio-Button Signals

2017-04-05 Thread Sascha Manns
Hello list,

I have a GtkBox with three childs: a label and two GtkRadioButtons. If a
user chooses one of them, what kind of signal will be sent? The
group-changed?

Greetings Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Starting with Vala

2017-04-03 Thread Sascha Manns
Hello list,

i would like to learn Vala and plan to port a Mono-GNOME-App to Vala. I
already seen the documentation.

Maybe you know some small Vala apps where i can see the code in action?

Greetings

Sascha

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org




signature.asc
Description: OpenPGP digital signature
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list