Skip to content

Commit 5a730c8

Browse files
committed
Some fixes, allow double-click to activate selected automount op.
1 parent 98700ed commit 5a730c8

5 files changed

Lines changed: 25 additions & 7 deletions

File tree

js/ui/autorunManager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ class AutorunDialog extends ModalDialog.ModalDialog {
327327
this.contentLayout.add_child(description);
328328

329329
this._appSection = new Dialog.ListSection({ selectable: true });
330+
this._appSection.connect('row-activated', () => this._onOk());
330331
this.contentLayout.add_child(this._appSection);
331332

332333
this._populateAppList();
@@ -396,7 +397,7 @@ class AutorunDialog extends ModalDialog.ModalDialog {
396397
if (!selected)
397398
return;
398399

399-
let remember = this._alwaysCheckBox.checked;
400+
let remember = this._alwaysCheckBox?.checked ?? false;
400401

401402
if (selected._autorunType === AUTORUN_ITEM_DO_NOTHING) {
402403
if (remember && this._contentType)

js/ui/cinnamonMountOperation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,10 @@ var CinnamonMountPasswordDialog = GObject.registerClass({
496496
this._passwordEntry.can_focus = !useKeyfiles;
497497
this._pimEntry.reactive = !useKeyfiles;
498498
this._pimEntry.can_focus = !useKeyfiles;
499-
this._rememberChoice.reactive = !useKeyfiles;
500-
this._rememberChoice.can_focus = !useKeyfiles;
499+
if (this._rememberChoice) {
500+
this._rememberChoice.reactive = !useKeyfiles;
501+
this._rememberChoice.can_focus = !useKeyfiles;
502+
}
501503
this._keyfilesLabel.visible = useKeyfiles;
502504
this.setButtons(useKeyfiles ? this._usesKeyfilesButtons : this._defaultButtons);
503505
}

js/ui/dialog.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ var ListSection = GObject.registerClass({
287287
false),
288288
},
289289
Signals: {
290-
'selection-changed': { param_types: [GObject.TYPE_INT] },
290+
'row-selected': { param_types: [GObject.TYPE_INT] },
291+
'row-activated': { param_types: [GObject.TYPE_INT] },
291292
},
292293
}, class ListSection extends St.BoxLayout {
293294
_init(params) {
@@ -356,7 +357,7 @@ var ListSection = GObject.registerClass({
356357
});
357358

358359
this._selectedIndex = index;
359-
this.emit('selection-changed', index);
360+
this.emit('row-selected', index);
360361
}
361362

362363
_onItemClicked(item) {
@@ -372,6 +373,16 @@ var ListSection = GObject.registerClass({
372373
if (this.selectable) {
373374
item.reactive = true;
374375
item.track_hover = true;
376+
item.connect('button-press-event', (actor, event) => {
377+
if (event.get_click_count() === 2) {
378+
let children = this.list.get_children();
379+
let index = children.indexOf(item);
380+
if (index >= 0)
381+
this.emit('row-activated', index);
382+
return Clutter.EVENT_STOP;
383+
}
384+
return Clutter.EVENT_PROPAGATE;
385+
});
375386
item.connect('button-release-event', () => {
376387
this._onItemClicked(item);
377388
return Clutter.EVENT_STOP;

js/ui/placesManager.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ PlaceDeviceInfo.prototype = {
135135
drive.can_stop()) {
136136
drive.stop(0, mountOp.mountOp, null, null);
137137
} else {
138-
if ((drive && drive.can_eject()) || (volume && volume.can_eject()) || this._mount.can_eject())
138+
if (drive && drive.can_eject())
139139
drive.eject_with_operation(0, mountOp.mountOp, null, null);
140+
else if (volume && volume.can_eject())
141+
volume.eject_with_operation(0, mountOp.mountOp, null, null);
142+
else if (this._mount.can_eject())
143+
this._mount.eject_with_operation(0, mountOp.mountOp, null, null);
140144
else if (this._mount.can_unmount())
141145
this._mount.unmount_with_operation(0, mountOp.mountOp, null, null);
142146
}

src/hotplug-sniffer/cinnamon-mime-sniffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ query_info_async_ready_cb (GObject *source,
438438
G_IO_ERROR,
439439
G_IO_ERROR_NOT_DIRECTORY,
440440
"Not a directory");
441-
441+
g_object_unref (info);
442442
return;
443443
}
444444

0 commit comments

Comments
 (0)