Part: simplify openFile() and use more KMessageWidgets
ClosedPublic

Authored by elvisangelaccio on Mar 17 2016, 10:55 PM.

Details

Summary

When the user opens (from Dolphin) an archive whose plugin is not available,
the feedback is currently very annoying:

  • a KMessageBox pops up with the error message
  • the user closes the message box
  • an empty (and useless) Ark window shows up

This patch replaces the KMessageBoxes with KMessageWidgets, so that the 3 steps
above are merged into 1.

Possible alternative solution: display only the KMessageBox, then quit Ark
(preventing the MainWindow from showing up). But I'm not sure if this is
actually better.

This patch also move the input validation code from Part::openFile() to a new
Part::isLocalFileValid() method.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio retitled this revision from to Part: simplify openFile() and use more KMessageWidgets.
elvisangelaccio added a reviewer: rthomsen.
elvisangelaccio updated this object.
Restricted Application added a project: Ark. · View Herald TranscriptMar 17 2016, 10:55 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript
rthomsen accepted this revision.Mar 18 2016, 7:13 AM
rthomsen edited edge metadata.

Code looks good. Tested and works for me. The text is a bit squeezed when there are two lines in the KMessageWidget, but I think it's ok.

part/part.cpp
525–527

I would rather have these warnings as errors (displayed with red background). Same with the others below.

This revision is now accepted and ready to land.Mar 18 2016, 7:13 AM
elvisangelaccio marked an inline comment as done.Mar 18 2016, 9:41 AM