Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select first device and fix typo #128

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions lib/mintstick.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,33 @@
# Default's to fat32
self.filesystemlist.set_active(0)
if filesystem_arg is not None:
itererator = self.fsmodel.get_iter_first()
while itererator is not None:
value = self.fsmodel.get_value(itererator, 0)
fs_iter = self.fsmodel.get_iter_first()
while fs_iter is not None:
value = self.fsmodel.get_value(fs_iter, 0)
if value == filesystem_arg:
self.filesystemlist.set_active_iter(itererator)
itererator = self.fsmodel.iter_next(itererator)
self.filesystemlist.set_active_iter(fs_iter)
fs_iter = self.fsmodel.iter_next(fs_iter)

self.get_devices()

if usb_path_arg is not None:
itererator = self.devicemodel.get_iter_first()
while itererator is not None:
value = self.devicemodel.get_value(itererator, 0)
if usb_path_arg in value:
self.devicelist.set_active_iter(itererator)
itererator = self.devicemodel.iter_next(itererator)
self.select_device(usb_path_arg)

self.window.show()

def select_device(self, usb_path=None):
if usb_path is not None:
device_iter = self.devicemodel.get_iter_first()
while device_iter is not None:
value = self.devicemodel.get_value(device_iter, 0)
if usb_path in value:
self.devicelist.set_active_iter(device_iter)
return
device_iter = self.devicemodel.iter_next(device_iter)
return

device_iter = self.devicemodel.get_iter_first()
if device_iter is not None:
self.devicelist.set_active_iter(device_iter)

def verify(self, button):
subprocess.Popen(["mint-iso-verify", self.chooser.get_filename()])

Expand Down Expand Up @@ -250,13 +258,13 @@
self.go_button.set_sensitive(True)

def filesystem_selected(self, widget):
itererator = self.filesystemlist.get_active_iter()
if itererator is not None:
self.filesystem = self.fsmodel.get_value(itererator, 0)
fs_iter = self.filesystemlist.get_active_iter()
if fs_iter is not None:
self.filesystem = self.fsmodel.get_value(fs_iter, 0)
self.activate_devicelist()

self.fix_label_entry_text(True)
self.label_entry.set_max_length(self.fsmodel.get_value(itererator, 2))
self.label_entry.set_max_length(self.fsmodel.get_value(fs_iter, 2))
self.on_label_entry_text_changed(self, self.label_entry)

def file_selected(self, widget):
self.activate_devicelist()
Expand Down Expand Up @@ -352,7 +360,7 @@
self.show_format_result("dialog-information", _('The USB stick was formatted successfully.'))
return False
elif rc == 5:
message = _("An error occured while creating a partition on %s.") % usb_path

Check failure on line 363 in lib/mintstick.py

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22-amd64, Mint 22, true) / Mint 22

occured ==> occurred
elif rc == 127:
message = _('Authentication Error.')
elif rc == 126: # Cancelled by the user.
Expand Down Expand Up @@ -462,7 +470,7 @@
elif rc == 3:
message = _('Not enough space on the USB stick.')
elif rc == 4:
message = _('An error occured while copying the image.')

Check failure on line 473 in lib/mintstick.py

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22-amd64, Mint 22, true) / Mint 22

occured ==> occurred
elif rc == 127:
message = _('Authentication Error.')
elif rc == 126: # Cancelled by the user.
Expand Down
Loading