Merge lp://qastaging/~ralsina/ubuntuone-control-panel/go-native into lp://qastaging/ubuntuone-control-panel

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 286
Merged at revision: 280
Proposed branch: lp://qastaging/~ralsina/ubuntuone-control-panel/go-native
Merge into: lp://qastaging/ubuntuone-control-panel
Diff against target: 70 lines (+14/-4)
3 files modified
ubuntuone/controlpanel/gui/qt/addfolder.py (+12/-1)
ubuntuone/controlpanel/gui/qt/tests/test_addfolder.py (+1/-1)
ubuntuone/controlpanel/utils/windows.py (+1/-2)
To merge this branch: bzr merge lp://qastaging/~ralsina/ubuntuone-control-panel/go-native
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Manuel de la Peña (community) Approve
Review via email: mp+96123@code.qastaging.launchpad.net

Commit message

 - Switched to the native file chooser on Linux (Fixes LP: #947711).

Description of the change

Only use the non-native file chooser on Windows

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

When opening the file choose from the Folders tab, I'm getting:

  File "/home/nessita/canonical/controlpanel/review_go-native/ubuntuone/controlpanel/gui/qt/__init__.py", line 94, in inner
    res = yield f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/home/nessita/canonical/controlpanel/review_go-native/ubuntuone/controlpanel/gui/qt/addfolder.py", line 61, in on_clicked
    options=FILE_CHOOSER_OPTIONS)
TypeError: QFileDialog.getExistingDirectory(QWidget parent=None, QString caption=QString(), QString directory=QString(), QFileDialog.Options options=QFileDialog.ShowDirsOnly): argument 'options' has unexpected type 'int'

review: Needs Fixing
279. By Roberto Alsina

No, 0 is not a good option

Revision history for this message
Roberto Alsina (ralsina) wrote :

> When opening the file choose from the Folders tab, I'm getting:
>
> File "/home/nessita/canonical/controlpanel/review_go-
> native/ubuntuone/controlpanel/gui/qt/__init__.py", line 94, in inner
> res = yield f(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
> 1039, in _inlineCallbacks
> result = g.send(result)
> File "/home/nessita/canonical/controlpanel/review_go-
> native/ubuntuone/controlpanel/gui/qt/addfolder.py", line 61, in on_clicked
> options=FILE_CHOOSER_OPTIONS)
> TypeError: QFileDialog.getExistingDirectory(QWidget parent=None, QString
> caption=QString(), QString directory=QString(), QFileDialog.Options
> options=QFileDialog.ShowDirsOnly): argument 'options' has unexpected type
> 'int'

I forgot to IRL test the last revno. So, I added the right constant now, but I amhaving two concerns about this branch:

1) It's importing PyQt outside qt/
2) I created a linux.py just for a constant

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

> I forgot to IRL test the last revno. So, I added the right constant now, but I
> amhaving two concerns about this branch:
>
> 1) It's importing PyQt outside qt/
> 2) I created a linux.py just for a constant

What about if you just do the following in ubuntuone/controlpanel/utils/__init__.py?

if windows:
    FILE_CHOOSER_OPTIONS = QtGui.QFileDialog.DontUseNativeDialog | QtGui.QFileDialog.ShowDirsOnly
else:
    FILE_CHOOSER_OPTIONS = QtGui.QFileDialog.ShowDirsOnly

280. By Roberto Alsina

simplify a bit

Revision history for this message
Roberto Alsina (ralsina) wrote :

> What about if you just do the following in
> ubuntuone/controlpanel/utils/__init__.py?
>
> if windows:
> FILE_CHOOSER_OPTIONS = QtGui.QFileDialog.DontUseNativeDialog |
> QtGui.QFileDialog.ShowDirsOnly
> else:
> FILE_CHOOSER_OPTIONS = QtGui.QFileDialog.ShowDirsOnly

Sure, done in revno 280 (no need for the | ShowDirsOnly). It would still be importing QtGui outside qt/ though

Revision history for this message
Manuel de la Peña (mandel) wrote :

Did an IRL and got the native dialog.

review: Approve
281. By Roberto Alsina

moved constants into folders.py

282. By Roberto Alsina

move things around

283. By Roberto Alsina

merged trunk

284. By Roberto Alsina

stupid me

285. By Roberto Alsina

engage brain before coding

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks great!

review: Approve
286. By Roberto Alsina

typo

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