This repository has been archived by the owner on Sep 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3: Display status icon on files and folders in Windows Explorer (
#67)
- Loading branch information
1 parent
452478b
commit 1c37ec6
Showing
6 changed files
with
385 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/io/goobox/sync/storj/overlay/OverlayIcon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2017 Kaloyan Raev | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.goobox.sync.storj.overlay; | ||
|
||
import io.goobox.sync.storj.db.SyncFile; | ||
|
||
public enum OverlayIcon { | ||
|
||
NONE(0), OK(1), SYNCING(2), WARNING(3), ERROR(4); | ||
|
||
private int id; | ||
|
||
private OverlayIcon(int id) { | ||
this.id = id; | ||
} | ||
|
||
public int id() { | ||
return id; | ||
} | ||
|
||
public static OverlayIcon from(SyncFile file) { | ||
if (file == null || file.getState().isPending()) { | ||
return OverlayIcon.SYNCING; | ||
} else if (file.getState().isSynced()) { | ||
return OverlayIcon.OK; | ||
} else if (file.getState().isFailed()) { | ||
return OverlayIcon.ERROR; | ||
} else { | ||
return OverlayIcon.WARNING; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.