~diegosarmentero/ubuntuone-windows-installer/ui-improves

« back to all changes in this revision

Viewing changes to ubuntuone_installer/gui/qt/preferences.py

  • Committer: Diego Sarmentero
  • Date: 2011-08-10 21:37:30 UTC
  • Revision ID: diego.sarmentero@canonical.com-20110810213730-s7d8f536czw7s0fa
Tests completes.
Lint issues fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
class PreferencesPage(SSOWizardPage):
36
36
    """Wizard page to list and manage an account's folders."""
 
37
 
37
38
    def __init__(self, parent=None):
38
39
        super(PreferencesPage, self).__init__(
39
40
            preferences_ui.Ui_Form(), None, parent)
42
43
        self.preferences_widget.ui.apply_changes_button.hide()
43
44
        self.preferences_widget.ui.restore_defaults_button.hide()
44
45
 
 
46
    # Invalid name "initializePage"
 
47
    # pylint: disable=C0103
 
48
 
45
49
    def initializePage(self):
46
50
        self.wizard().setOption(QtGui.QWizard.HaveCustomButton1, True)
47
51
        self.wizard().setOption(QtGui.QWizard.HaveCustomButton2, True)
70
74
 
71
75
        self.wizard().customButtonClicked.connect(self._button_clicked)
72
76
 
 
77
    # pylint: enable=C0103
 
78
 
73
79
    def _button_clicked(self, btn):
 
80
        """Receive custom wizard buttons clicks."""
74
81
        if btn == QtGui.QWizard.CustomButton1:
75
82
            self.preferences_widget.on_apply_changes_button_clicked()
76
83
            self.cleanupPage()
78
85
        elif btn == QtGui.QWizard.CustomButton2:
79
86
            self.preferences_widget.on_restore_defaults_button_clicked()
80
87
 
 
88
    # Invalid name "cleanupPage"
 
89
    # pylint: disable=C0103
 
90
 
81
91
    def cleanupPage(self):
 
92
        """Execute this cleanup function when the back button is pressed."""
82
93
        self.wizard().setOption(QtGui.QWizard.HaveCustomButton1, False)
83
94
        self.wizard().setOption(QtGui.QWizard.HaveCustomButton2, False)
84
95
        self.wizard().setButtonLayout([
87
98
            QtGui.QWizard.NextButton])
88
99
        self.wizard().setButtonText(QtGui.QWizard.NextButton, _("Sync Now!"))
89
100
        self.wizard()._next_id = self.wizard().CONGRATULATIONS_PAGE
 
101
 
 
102
    # pylint: enable=C0103