Skip to content

Commit d6fdaf8

Browse files
Merge pull request #14 from mylinuxforwork/9-add-selectunselect-toggle
9 add selectunselect toggle
2 parents 7b51c17 + 83a6cc3 commit d6fdaf8

File tree

16 files changed

+162
-26
lines changed

16 files changed

+162
-26
lines changed

com.ml4w.dotfilesinstaller.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
{
5757
"type" : "git",
5858
"url" : "https://github.com/mylinuxforwork/dotfiles-installer",
59-
"tag": "0.8.9"
59+
"tag": "0.9"
6060
}
6161
]
6262
}

data/com.ml4w.dotfilesinstaller.metainfo.xml.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@
5858
</screenshots>
5959

6060
<releases>
61+
<release version="0.9" date="2025-07-18">
62+
<url type="details">https://mylinuxforwork.github.io/dotfiles-installer/changelog</url>
63+
<description translate="no">
64+
<p>Release 0.9</p>
65+
<ul>
66+
<li>Access to all installation folders after got clone</li>
67+
<li>Add icons to backup, restore and protect screen</li>
68+
<li>Add select/unselect all toggle to backup, restore and protect screen</li>
69+
</ul>
70+
</description>
71+
</release>
6172
<release version="0.8.9" date="2025-07-16">
6273
<url type="details">https://mylinuxforwork.github.io/dotfiles-installer/changelog</url>
6374
<description translate="no">
Lines changed: 2 additions & 0 deletions
Loading

data/icons/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ action_icons = [
2222
join_paths(action_dir, 'edit-delete-symbolic.svg'),
2323
join_paths(action_dir, 'org.gnome.Settings-symbolic.svg'),
2424
join_paths(action_dir, 'update-symbolic.svg'),
25-
join_paths(action_dir, 'arrow3-left-symbolic.svg')
25+
join_paths(action_dir, 'arrow3-left-symbolic.svg'),
26+
join_paths(action_dir, 'paper-symbolic.svg')
2627
]
2728

2829
install_data(

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
{ text: "Home", link: "/" },
2424
{ text: "About", link: "/getting-started/overview" },
2525
{
26-
text: "0.8.9",
26+
text: "0.9",
2727
items: [
2828
{
2929
// todo; add CHANGELOG.md in dotfiles-installer repo

docs/changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Version 0.9
4+
5+
- Access to all installation folders after got clone
6+
- Add icons to backup, restore and protect screen
7+
- Add select/unselect all toggle to backup, restore and protect screen
8+
39
## Version 0.8.9
410

511
- Add git tag support for remote .dotinst files
@@ -12,4 +18,4 @@
1218

1319
## Version 0.8.7
1420

15-
- git dependency included
21+
- git dependency included

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('dotfiles-installer',
2-
version: '0.8.9',
2+
version: '0.9',
33
meson_version: '>= 1.0.0',
44
default_options: [ 'warning_level=2', 'werror=false', ],
55
)

src/_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
app_id = "com.ml4w.dotfilesinstaller"
2323
app_name = "Dotfiles Installer"
2424
app_developer = "Stephan Raabe"
25-
app_version = "0.8.9"
25+
app_version = "0.9"
2626
app_homepage = "https://github.com/mylinuxforwork/dotfiles-installer"
2727
app_github_api_tags = "https://api.github.com/repos/mylinuxforwork/dotfiles-installer/tags"
2828

src/classes/backup.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self, **kwargs):
3636
super().__init__(**kwargs)
3737
self.current_cancellable = None
3838
self.backup_group.bind_model(self.backup_store,self.create_row)
39+
self.updating_switches = False
3940

4041
# Init load backup
4142
def load(self):
@@ -101,6 +102,10 @@ def check_backup(self, task, source_object, task_data, cancellable):
101102

102103
def create_row(self,item):
103104
row = Adw.SwitchRow()
105+
if os.path.isdir(item.source + item.file):
106+
row.set_icon_name("folder-symbolic")
107+
else:
108+
row.set_icon_name("paper-symbolic")
104109
row.set_title(item.file)
105110
row.set_subtitle("Backup from " + item.source)
106111
row.set_active(item.value)
@@ -131,4 +136,15 @@ def openNext(self):
131136
else:
132137
self.props.config_settings.load()
133138

139+
@Gtk.Template.Callback()
140+
def on_select_all_switch_toggled(self, switch_widget, pspec):
141+
if self.updating_switches:
142+
return
143+
144+
is_active = switch_widget.get_active()
145+
146+
for i in range(self.backup_store.get_n_items()):
147+
v = self.backup_store.get_item(i)
148+
v.value = is_active
134149

150+
self.updating_switches = False # Reset the flag after updates are complete

src/classes/installation.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,35 @@ def change_activate_now(self, switch, GParamBoolean):
6969

7070
def install_dotfiles(self):
7171

72+
printLog("Installing dotfiles " + self.props.id)
7273
if not os.path.exists(self.props.dotfiles_folder):
7374
pathlib.Path(self.props.dotfiles_folder).mkdir(parents=True, exist_ok=True)
7475

7576
if not self.activate:
7677
# Copy prepared folder to the dotfiles folder
7778
shutil.copytree(self.props.prepared_folder, self.props.dotfiles_folder, dirs_exist_ok=True)
79+
printLog("Installing dotfiles " + self.props.prepared_folder + " to " + self.props.dotfiles_folder)
7880

79-
if get_symlink_enabled():
81+
if get_symlink_enabled() and self.activate_now.get_active():
8082
# Create symlinks for all files and folders except for .dotinst files
83+
printLog("Creating symlinks...")
8184
for f in os.listdir(self.props.dotfiles_folder):
8285
if f != ".config" and ".dotinst" not in f:
8386
self.createSymlink(self.props.dotfiles_folder + "/" + f, home_folder + f)
8487
for f in os.listdir(self.props.dotfiles_folder + "/.config"):
8588
if ".dotinst" not in f:
8689
self.createSymlink(self.props.dotfiles_folder + "/.config/" + f, home_folder + ".config/" + f)
90+
91+
# Write dotfiles config file to dotfiles folder
92+
dotfiles_json = {}
93+
dotfiles_json["active"] = self.props.id
94+
with open(get_installed_dotfiles_folder() + 'dotfiles.json', 'w', encoding='utf-8') as f:
95+
json.dump(dotfiles_json, f, ensure_ascii=False, indent=4)
96+
8797
else:
8898
printLog("Creating of symlinks disabled in preferences. Installation has been skipped.")
8999

90-
# Write dotfiles config file to dotfiles folder
91-
dotfiles_json = {}
92-
dotfiles_json["active"] = self.props.id
93-
with open(get_installed_dotfiles_folder() + 'dotfiles.json', 'w', encoding='utf-8') as f:
94-
json.dump(dotfiles_json, f, ensure_ascii=False, indent=4)
95-
96-
self.activated = False
100+
self.activate = False
97101

98102
# Delete existing symlink, file or folder
99103
def delete_file_in_sandbox(self,filepath):

0 commit comments

Comments
 (0)