Bug 288042 - Option to reset forms (PDF)
Summary: Option to reset forms (PDF)
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (other bugs)
Version First Reported In: 0.5.81
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: junior-jobs
: 306292 354970 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-02 10:32 UTC by Alvaro Aguilera
Modified: 2025-01-13 15:41 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The attachment contains a zip file with 3 patches containing the changes to 5 files: part.cpp/pageview.cpp/pageview.h/formwidget.cpp/formwidget.h (4.92 KB, patch)
2018-02-13 17:21 UTC, Ahmad Osama
Details
Implement the reset forms option using Okular::FormFields in a way similar to editformstest.cpp (10.67 KB, patch)
2018-03-04 19:05 UTC, Ahmad Osama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Aguilera 2011-12-02 10:32:39 UTC
Version:           0.5.81 (using KDE 4.7.3) 
OS:                Linux

It would be nice to have an option to reset a PDF form. 

Reproducible: Didn't try



Expected Results:  
For example, a reset button next to the "show/hide form" button that clears all the input fields the document has.

OS: Linux (x86_64) release 3.0.6-2-desktop
Compiler: gcc
Comment 1 Albert Astals Cid 2016-06-12 18:15:48 UTC
*** Bug 306292 has been marked as a duplicate of this bug. ***
Comment 2 Albert Astals Cid 2016-06-12 18:17:20 UTC
*** Bug 354970 has been marked as a duplicate of this bug. ***
Comment 3 francisco navarro morales 2017-08-30 13:58:32 UTC
working on it
Comment 4 Gilbert Assaf 2017-08-30 15:07:44 UTC
https://git.reviewboard.kde.org/r/130057/
Comment 5 Ahmad Osama 2018-02-13 17:21:41 UTC
Created attachment 110619 [details]
The attachment contains a zip file with 3 patches containing the changes to 5 files: part.cpp/pageview.cpp/pageview.h/formwidget.cpp/formwidget.h

These changes are done to add a button to Reset pdf forms when clicked.

Changes are to the following files:

* part.cpp: Just changing the text displayed to the user when the document has forms
* pageview.cpp/pageview.h: add an action to reset forms just like the Show Form/Hide form (aToggleForm QAction)
* formwidget.cpp/formwidger.h: add a virtual function 'clearWidgetContents()' to the parent class (FormWidgetIface) that clears the contents of the widget, then overriding this function in its children to clear the contents differently in each widget, ex. clearing the FormLineEditClass (that iherits from QLineEdit) is done by setting text to an empty string ("").

* the clearWidgetContents() is called when the QAction associated with it is triggered.
Comment 6 Oliver Sander 2018-02-13 18:54:40 UTC
Hi Ahmad, thanks for posting these patches.  Could you please get an account at

   https://phabricator.kde.org/

and post the patches there?  They are much easier to review that way.

Are your patches related to the patches posted by Gilbert Assaf in Comment 4?
Comment 7 Ahmad Osama 2018-02-14 12:32:13 UTC
I have posted it here: https://phabricator.kde.org/D10504

I saw the comment now, it sounds that I have implemented almost the same idea!
Comment 8 Ahmad Osama 2018-03-04 19:05:17 UTC
Created attachment 111183 [details]
Implement the reset forms option using Okular::FormFields in a way similar to editformstest.cpp

I uploaded the path here:
https://phabricator.kde.org/D10932

I am currently working on getting the auto test to work in a way other than creating a reset function in the document class.
Comment 9 Ahmad Osama 2018-03-13 13:00:36 UTC
I created an auto-test for this option that is working fine on the created test cases, the new test along with the implementation for this option are in this patch:

https://phabricator.kde.org/D10932
Comment 10 Andrej Repisky 2024-12-24 18:06:26 UTC
Hi,
I'm trying to figure out why the code is still not merged and the feature still not present in Okular. It has been ages since the last comment. Any ideas?
Andrej
Comment 11 Noah Davis 2025-01-13 15:41:50 UTC
(In reply to Andrej Repisky from comment #10)
> Hi,
> I'm trying to figure out why the code is still not merged and the feature
> still not present in Okular. It has been ages since the last comment. Any
> ideas?
> Andrej

It seems that the patch submitter either gave up or ran out of personal time to work on the change. This is the last version of the patch: https://phabricator.kde.org/D10932. We don't use Phabricator to submit patches to Okular anymore, so a new patch will have to be submitted at https://invent.kde.org/graphics/okular.