Skip to content

Commit

Permalink
changes:
Browse files Browse the repository at this point in the history
*~ files ignored
improved saving performance
  • Loading branch information
spheras committed Feb 18, 2018
1 parent 6bdfef1 commit 2c3ad29
Show file tree
Hide file tree
Showing 11 changed files with 471 additions and 41 deletions.
55 changes: 55 additions & 0 deletions data/com.github.spheras.desktopfolder.appdata.xml
Expand Up @@ -42,4 +42,59 @@
<value key="x-appcenter-color-primary-text">#044b6c</value>
<value key="x-appcenter-suggested-price">0</value>
</custom>

<releases>
<release version="1.0.6" date="2018-02-16">
<description>
<p>Release: Italian and minor improvements</p>
<ul>
<li>Italian Translation thanks to andreas-xavier</li>
<li>Saving settings performance improvements</li>
<li>*~ files are ignored now</li>
</ul>
</description>
</release>

<release version="1.0.5" date="2017-12-26">
<description>
<p>1.0.5 release with great changes!</p>
<ul>
<li>Desktop Background</li>
<li>Rename in Place</li>
<li>Different Notes Status (top, back, normal)</li>
<li>Buttons to Headers (remove)</li>
<li>Link Panels to folders</li>
<li>Photo Scale aspect ratio</li>
<li>Custom Colors for Panel and Notes</li>
<li>Menu Redesign And Panel Settings Window</li>
<li>Restore Windows when Super+D is pressed again</li>
<li>Resolution Strategy to prevent widgets going off-screen</li>
<li>Use .desktopnote/.desktopphoto rather than .dfn/.dfp</li>
<li>Don't allow renaming panels to invalid folder names</li>
<li>Serbian translation by @pavlepiramida</li>
<li>Russian translation by @camellan</li>
<li>Arch building by @GabMus</li>
<li>A lot of Minor Bugfixing</li>
</ul>
</description>
</release>

<release version="1.0.2" date="2017-10-19">
<description>
<p>1.0.2 release</p>
<ul>
<li>Drag and Drop to Move/Copy/Link depending on key pressed (none/control/alt|shift)</li>
<li>Text Shadow and Bold configuration</li>
<li>Deleting Last Panel bugfixing</li>
<li>Move panels from body</li>
<li>DESKTOP window types (workspace movement improvement and others)</li>
<li>Drag and Drop folders (recursive copy)</li>
<li>Undo/Redo and others over Text Notes</li>
<li>Menu Redesign</li>
<li>Lithuanian and French translations</li>
<li>Minor Bugfixing</li>
</ul>
</description>
</release>
</releases>
</component>
8 changes: 8 additions & 0 deletions debian/changelog
@@ -1,3 +1,11 @@
com.github.spheras.desktopfolder (1.0.6) precise; urgency=low

* Italian translation
* Minor saving performance improvements
* *~ files are ignored now

-- José Amuedo <joseamuedo@gmail.com> Fri, 16 Feb 2018 17:31:00 +0200

com.github.spheras.desktopfolder (1.0.5) precise; urgency=low

* Desktop Background
Expand Down
2 changes: 2 additions & 0 deletions etc/knowhow
Expand Up @@ -71,6 +71,8 @@ $ ninja com.github.spheras.desktopfolder-pot

Debian build
············
sudo apt install devscripts

From root directory:
$ debuild -uc -us

Expand Down
2 changes: 1 addition & 1 deletion meson.build
@@ -1,5 +1,5 @@
project('com.github.spheras.desktopfolder', ['vala', 'c'],
version: '1.0.5'
version: '1.0.6'
)

gnome = import('gnome')
Expand Down
6 changes: 3 additions & 3 deletions src/Application.vala
Expand Up @@ -223,15 +223,15 @@ public class DesktopFolderApp : Gtk.Application {
this.desktop = new DesktopFolder.DesktopManager (this);
for (int i = 0; i < this.folders.length (); i++) {
var fm = this.folders.nth (i).data;
fm.reopen();
fm.reopen ();
}
for (int i = 0; i < this.notes.length (); i++) {
var fm = this.notes.nth (i).data;
fm.reopen();
fm.reopen ();
}
for (int i = 0; i < this.photos.length (); i++) {
var fm = this.photos.nth (i).data;
fm.reopen();
fm.reopen ();
}

} else if (!desktop_panel && this.desktop != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources.vala
Expand Up @@ -17,7 +17,7 @@ namespace DesktopFolder {
public const string APP_DESKTOP = APP_ID + ".desktop";
public const string APP_TITLE = "Desktop-Folder";
public const string APP_NAME = "desktopfolder";
public const string VERSION = "1.0.5";
public const string VERSION = "1.0.6";
/** Name of the Folder Settings File */
public const string FOLDER_SETTINGS_FILE = ".desktopfolder";
public const string OLD_NOTE_EXTENSION = "dfn";
Expand Down
6 changes: 4 additions & 2 deletions src/logic/FolderManager.vala
Expand Up @@ -226,6 +226,9 @@ public class DesktopFolder.FolderManager : Object, DragnDrop.DndView {
if (basename.has_prefix (".")) {
return true;
}
if(basename.has_suffix("~")){
return true;
}
return false;
}

Expand Down Expand Up @@ -525,7 +528,6 @@ public class DesktopFolder.FolderManager : Object, DragnDrop.DndView {
return this.settings;
}


/**
* @name reopen
* @description close the current view and reopen it again
Expand All @@ -551,7 +553,7 @@ public class DesktopFolder.FolderManager : Object, DragnDrop.DndView {

// let's sync the files found at this folder
this.sync_files (0, 0);

this.view.show_all ();
}

Expand Down
151 changes: 140 additions & 11 deletions src/settings/FolderSettings.vala
Expand Up @@ -22,16 +22,133 @@
* Desktop Folder Settings
*/
public class DesktopFolder.FolderSettings : PositionSettings {
public string name { get; set; }
public string bgcolor { get; set; }
public string fgcolor { get; set; }
public bool textbold { get; set; }
public bool textshadow { get; set; }
public bool lockitems { get; set; }
public bool lockpanel { get; set; }
public bool align_to_grid { get; set; default = false; }
public string[] items { get; set; default = new string[0]; }
public int version { get; set; }
private string _name;
public string name {
get {
return _name;
}
set {
if (_name != value) {
_name = value; flagChanged = true;
}
}
}
private string _bgcolor;
public string bgcolor {
get {
return _bgcolor;
}
set {
if (_bgcolor != value) {
_bgcolor = value; flagChanged = true;
}
}
}
private string _fgcolor;
public string fgcolor {
get {
return _fgcolor;
}
set {
if (_fgcolor != value) {
_fgcolor = value; flagChanged = true;
}
}
}
private bool _textbold;
public bool textbold {
get {
return _textbold;
}
set {
if (_textbold != value) {
_textbold = value; flagChanged = true;
}
}
}
private bool _textshadow;
public bool textshadow {
get {
return _textshadow;
}
set {
if (_textshadow != value) {
_textshadow = value; flagChanged = true;
}
}
}
private bool _lockitems;
public bool lockitems {
get {
return _lockitems;
}
set {
if (_lockitems != value) {
_lockitems = value; flagChanged = true;
}
}
}
private bool _lockpanel;
public bool lockpanel {
get {
return _lockpanel;
}
set {
if (_lockpanel != value) {
_lockpanel = value; flagChanged = true;
}
}
}
private bool _align_to_grid;
public bool align_to_grid {
get {
return _align_to_grid;
}
set {
if (_align_to_grid != value) {
_align_to_grid = value; flagChanged = true;
}
}
}
private string[] _items = new string[0];
public string[] items {
get {
return _items;
}

set {
bool different = false;

if ((value == null && _items != null) || (_items == null && value != null) || value.length != _items.length) {
different = true;
}
if (!different && _items != null) {
for (int i = 0; i < _items.length; i++) {
if (_items[i] != value[i]) {
different = true;
break;
}
}
}

if (different) {
_items = value; flagChanged = true;
}
}
}

// util value to know the settings versions
private int _version;
public int version {
get {
return _version;
}
set {
if (_version != value) {
_version = value; flagChanged = true;
}
}
}
// default json seralization implementation only support primitive types

private File file;
Expand Down Expand Up @@ -169,7 +286,14 @@ public class DesktopFolder.FolderSettings : PositionSettings {
* @param file File the file to be saved
*/
public void save_to_file (File file) {
this.file = file;
if (!flagChanged) {
return;
} else {
//debug ("saving settings!!");
}

flagChanged = false;
this.file = file;

store_resolution_position ();

Expand Down Expand Up @@ -251,7 +375,12 @@ public class DesktopFolder.FolderSettings : PositionSettings {
existent.version = DesktopFolder.SETTINGS_VERSION;
}

//the properties have not changed, just loaded
existent.flagChanged = false;

//after flag changed to false because the check could modify some properties
existent.check_all ();

return existent;
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
Expand Down

0 comments on commit 2c3ad29

Please sign in to comment.