/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk

« back to all changes in this revision

Viewing changes to src/settings_data.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-08-03 21:09:38 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140803210938-jfhdl23v4mzji6pf
* Added translation files (messeges.po and sv.po)
* fixed a few gettext errors in app.js
* TODO:
  * Make the translations not be as "fixed" as they are now.
  * Add auto update/compile for the translations to makefile.

  * Switch to a better build system?

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/**
17
17
 * Please use this function when getting the settings data object. It is not
18
 
 * good to 
 
18
 * good to have multiple instances of the settings data object, it may
 
19
 * cause problems down the line.
19
20
 */
20
21
function get_settings () {
21
22
  if (!_default_settings_object) {
23
24
  }
24
25
  return _default_settings_object;
25
26
}
 
27
 
26
28
/**
27
29
 * NO NOT CREATE INSTANCES FROM THIS OBJECT, USE THE get_settings () FUNCTION!
28
30
 */
192
194
    if (typeof setting != "string") {
193
195
      print ("ERROR: The \"setting\" parameter must be a string.");
194
196
      ret_data.ok = false;
195
 
      return ret_data.ok;
 
197
      return ret_data;
196
198
    }
197
199
    
198
200
    switch (setting) {
233
235
   * Commits changes to the settings object to file.
234
236
   */
235
237
  commit_to_file: function () {
236
 
    
 
238
    print (JSON.stringify (this._settings, null, 2).toString () );
 
239
      
 
240
      let file_stream = this._settings_file.replace (null,
 
241
                                                    false,
 
242
                                                    Gio.FileCreateFlags.PRIVATE,
 
243
                                                    null);
 
244
      file_stream.write_all (JSON.stringify (
 
245
          this._settings, null, 2).toString (), null);
 
246
      
 
247
      file_stream.close (null);
237
248
  }
238
249
  
 
250
  // End of class.
239
251
});
240
252
 
241
253