Merge lp://qastaging/~andreagrandi/unity-2d/trash-nautilus-setting into lp://qastaging/unity-2d/3.0

Proposed by Andrea Grandi
Status: Rejected
Rejected by: Florian Boucault
Proposed branch: lp://qastaging/~andreagrandi/unity-2d/trash-nautilus-setting
Merge into: lp://qastaging/unity-2d/3.0
Diff against target: 72 lines (+30/-2)
2 files modified
libunity-2d-private/src/trash.cpp (+27/-1)
libunity-2d-private/src/trash.h (+3/-1)
To merge this branch: bzr merge lp://qastaging/~andreagrandi/unity-2d/trash-nautilus-setting
Reviewer Review Type Date Requested Status
Florian Boucault (community) Needs Fixing
Review via email: mp+70583@code.qastaging.launchpad.net

Commit message

Emptying the trash from the unity sidebar now respect nautilus setting

Description of the change

Emptying the trash by right-clicking the trash icon in the unity sidebar and selecting the "Empty ..." option requires users to confirm the action, even if they have unchecked the "Ask before emptying ..." option in nautilus > Edit > Preferences > Behaviour. The option is correctly applied to emptying the trash from nautilus itself.

Now this behaviour is respected in Unity-2D too.

Please Note: I've noticed that we're not using a translation for this part (neither the relative Unity code does). We should do it. Even this part of the UI should be correctly translatable.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

Nice work Andrea.
A few comments:
- the strings need to be made translatable; see http://doc.qt.nokia.com/4.7-snapshot/internationalization.html#step-by-step for more information
- the dialog box should not have a title (right now it's 'unity-2d-launcher')
- the dialog box should be the same size as nautilus' (a bit bigger than with this patch)

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Another issue: when the dialog box is up, an icon appears in the launcher which should not.

review: Needs Fixing
Revision history for this message
Andrea Grandi (andreagrandi) wrote :

> Nice work Andrea.
> A few comments:
> - the strings need to be made translatable; see
> http://doc.qt.nokia.com/4.7-snapshot/internationalization.html#step-by-step
> for more information

the Qt way is using tr("....") but I've seen that you're using another macro: u2dTr("...."), do I have to use this one?

> - the dialog box should not have a title (right now it's 'unity-2d-launcher')

I've set it to "" with this line: msgBox.setWindowTitle(""); but the string "unity-2d-launcher" is shown anyway. Any idea?

> - the dialog box should be the same size as nautilus' (a bit bigger than with
> this patch)

you mean the message box displayed by the Gnome Trash Applet or the message box displayed by Unity? They're a bit different: the Gnome one has a button named in a different way and the text displayed is a bit different: "If you choose to empty the trash, all items in it will be permanently lost. Please note that you can also delete them separately.". Which one do I have to use?

> Another issue: when the dialog box is up, an icon appears in the launcher which should not.

this is probably a behaviour of QtMessageBox... I can try to see which properties I can modify but I'm not sure it will be possible. Any idea?

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Why not using nautilus3 dbus interface?

Revision history for this message
Florian Boucault (fboucault) wrote :

> > Nice work Andrea.
> > A few comments:
> > - the strings need to be made translatable; see
> > http://doc.qt.nokia.com/4.7-snapshot/internationalization.html#step-by-step
> > for more information
>
> the Qt way is using tr("....") but I've seen that you're using another macro:
> u2dTr("...."), do I have to use this one?

Yes, you should use the u2dTr one.

>
> > - the dialog box should not have a title (right now it's 'unity-2d-
> launcher')
>
> I've set it to "" with this line: msgBox.setWindowTitle(""); but the string
> "unity-2d-launcher" is shown anyway. Any idea?

Unfortunately no, not at the moment. I guess it will take some digging around :/

>
> > - the dialog box should be the same size as nautilus' (a bit bigger than
> with
> > this patch)
>
> you mean the message box displayed by the Gnome Trash Applet or the message
> box displayed by Unity? They're a bit different: the Gnome one has a button
> named in a different way and the text displayed is a bit different: "If you
> choose to empty the trash, all items in it will be permanently lost. Please
> note that you can also delete them separately.". Which one do I have to use?
>

Let's use nautilus'
Unity should be modified to follow that I believe.

> > Another issue: when the dialog box is up, an icon appears in the launcher
> which should not.
>
> this is probably a behaviour of QtMessageBox... I can try to see which
> properties I can modify but I'm not sure it will be possible. Any idea?

Hmmm, I am not sure, I would suggest trying various options of:

QWidget::setWindowFlags
and
QWidget::setAttribute

Revision history for this message
Florian Boucault (fboucault) wrote :

> Why not using nautilus3 dbus interface?

That would be the best!
Do you know what it looks like? What methods are available?

Revision history for this message
Andrea Grandi (andreagrandi) wrote :

Let's make a quick resume of the available options.

1) I can keep trying tuning these: QWidget::setWindowFlags and QWidget::setAttribute
but I've already tried and until now I wasn't able to fix it in this way.

2) We could try the method suggested by Andrea Azzarone, but keep in mind that it only works with Ubuntu Oneiric, it won'r work on Natty. So we have to choose: do we want this bug fixed only in Oneiric or in Natty too?

My suggestion: let's use the QtMessageBox for Natty, doing our best even if it's not exactly the same and let's use the dbus method for Oneiric.

Do we have separate trunks for Natty and Oneiric of Unity-2d?

Revision history for this message
Florian Boucault (fboucault) wrote :

> Let's make a quick resume of the available options.
>
> 1) I can keep trying tuning these: QWidget::setWindowFlags and
> QWidget::setAttribute
> but I've already tried and until now I wasn't able to fix it in this way.
>
> 2) We could try the method suggested by Andrea Azzarone, but keep in mind that
> it only works with Ubuntu Oneiric, it won'r work on Natty. So we have to
> choose: do we want this bug fixed only in Oneiric or in Natty too?
>

This is the way to go. It's acceptable to not have this bug fixed on Natty.

> My suggestion: let's use the QtMessageBox for Natty, doing our best even if
> it's not exactly the same and let's use the dbus method for Oneiric.
>

Hmmm, I am not so keen on merging code with known bugs when we have the choice therefore I would only merge the complete and proper fix in Oneiric.

> Do we have separate trunks for Natty and Oneiric of Unity-2d?

Yes.
Natty: lp:unity-2d/3.0
Oneiric: lp:unity-2d

Revision history for this message
Andrea Grandi (andreagrandi) wrote :

Ok so I'll use the dbus method and will fix this for Oneiric. I'll talk with Andrea Azzarone to understand how it works exactly, since he has already used that method before.

Revision history for this message
Andrea Grandi (andreagrandi) wrote :

I've fixed it and I've done the merge request using another trunk since the new one is based on Unity-2d 4.0 and not 3.0 like the old one. The new merge request is here: https://code.launchpad.net/~andreagrandi/unity-2d/trash-nautilus-setting-oneiric/+merge/73960

Unmerged revisions

660. By Andrea Grandi

Emptying the trash from the unity sidebar now respect nautilus setting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches