Accidental wiki word deletion

38 views
Skip to first unread message

msb

unread,
Nov 29, 2012, 8:04:33 PM11/29/12
to wikidpa...@googlegroups.com
Sorry if this has already been addressed/fixed elsewhere.

After accidentally deleting a valuable wikiword 3 times in the same way, I decided to fix my problem. It happens that I sometimes hit "crtl+D" by accident, either wanting to hit "ctrl+F" or "ctrl+C". I am then faced with the message "Are you sure ...?", to which I sometimes instinctively try to cancel by hitting the "ESC" key in my keyboard, causing the wiki word to be deleted.
To fix that, I changed line 4486 in lib/pwiki/PersonalWikiFrame.py, from "if result == wx.NO:" to "if result != wx.YES:". I paste the block below to make it easier to locate, in case you want to incorporate this fix in the main branch (supposing it's not there yet):

        if self.getConfig().getboolean("main", "trashcan_askOnDelete", True):
            result = wx.MessageBox(
                    _(u"Are you sure you want to delete wiki word '%s'?") %
                    wikiWord, _(u'Delete Wiki Word'),
                    wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION, self)
            if result != wx.YES: #### MODIFIED LINE <========
                return
        try:
            self.saveAllDocPages()
            self.deleteWikiWord(wikiWord)
        except (IOError, OSError, DbAccessError), e:
            self.lostAccess(e)
            raise
        except WikiDataException, e:
            self.displayErrorMessage(unicode(e))


Thanks,
   Mauricio   

Michael Butscher

unread,
Nov 30, 2012, 9:26:11 AM11/30/12
to wikidpa...@googlegroups.com
On 30.11.2012 02:04, msb wrote:
> Sorry if this has already been addressed/fixed elsewhere.
>
> After accidentally deleting a valuable wikiword 3 times in the same way, I
> decided to fix my problem. It happens that I sometimes hit "crtl+D" by
> accident, either wanting to hit "ctrl+F" or "ctrl+C". I am then faced with
> the message "Are you sure ...?", to which I sometimes instinctively try to
> cancel by hitting the "ESC" key in my keyboard, causing the wiki word to be
> deleted.

Thank you for the fix, it will be integrated into next versions.

I didn't notice this problem yet because on Windows hitting ESC does nothing on
a yes/no-dialog.



Michael

msb

unread,
Nov 30, 2012, 2:09:52 PM11/30/12
to wikidpa...@googlegroups.com
I see. Indeed, I use WikidPad under linux. I also use it under windows, but maybe I've never hit crtl+D by accident on windows...
BTW, Many many thanks Michael and all other current and past developers for creating and maintaining WikidPad. I'd say it's the most important software I use. :-)

Regards,
   Mauricio   

ghostincircuit

unread,
Dec 1, 2012, 3:33:23 AM12/1/12
to wikidpa...@googlegroups.com
good job, I got that problem several weeks ago.
It's really a hazard when you press ESC and find that the wiki word has been deleted
Reply all
Reply to author
Forward
0 new messages