~xnox/vitables/default

« back to all changes in this revision

Viewing changes to vitables/vtapp.py

  • Committer: Vicent Mas
  • Date: 2009-12-05 14:23:06 UTC
  • Revision ID: hg-v1:4dad2bf31769d537a5e399642d5b1f0df5de107b
Several question like message boxes have been customised.

The following modules used QMessageBox.question and have been modified:
- vitables/nodeProperties/nodePropDlg.py
- vitables/plugins/csv/import_csv.py
- vitables/queries/queriesManager.py
- vitables/vtapp.py

* vitables/utils.py
questionBox function  has been added.

* vitables/docBrowser/helpBrowser.py
slotAboutHelpBrowser mehtod has been refactored.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1953
1953
 
1954
1954
        # Confirm deletion dialog
1955
1955
        if not force:
1956
 
            del_dlg = QtGui.QMessageBox.question(self,
1957
 
                trs('Node deletion',
1958
 
                'Caption of the node deletion dialog'),
1959
 
                trs("""\nYou are about to delete the node:\n%s\n""",
1960
 
                'Ask for confirmation') % node.nodepath,
1961
 
                QtGui.QMessageBox.Yes|QtGui.QMessageBox.Default,
1962
 
                QtGui.QMessageBox.No|QtGui.QMessageBox.Escape)
 
1956
            title = trs('Node deletion', 'Caption of the node deletion dialog')
 
1957
            text = trs("""\nYou are about to delete the node:\n%s\n""", 
 
1958
                'Ask for confirmation') % node.nodepath
 
1959
            itext = ''
 
1960
            dtext = ''
 
1961
            buttons = {\
 
1962
                'Delete': \
 
1963
                    (trs('Delete', 'Button text'), QtGui.QMessageBox.YesRole), 
 
1964
                'Cancel': \
 
1965
                    (trs('Cancel', 'Button text'), QtGui.QMessageBox.NoRole), 
 
1966
                }
1963
1967
 
1964
 
            # OK returns Accept, Cancel returns Reject
1965
 
            if del_dlg == QtGui.QMessageBox.No:
1966
 
                return
 
1968
            # Ask for confirmation
 
1969
            answer = \
 
1970
                vitables.utils.questionBox(title, text, itext, dtext, buttons)
 
1971
            if answer == 'Cancel':
 
1972
                    return
1967
1973
 
1968
1974
        # If item is a filtered table then update the list of used names
1969
1975
        if hasattr(node.node._v_attrs, 'query_condition'):