~ubuntu-branches/ubuntu/precise/apturl/precise

16 by Michael Vogt
* add README
1
import Helpers
28 by Harald Sitter
Reupload merged 0.4.0ubuntu5 and 0.4.1ubuntu1, forgot to bzr push -.-
2
from Helpers import utf8, _, _n
3
16 by Michael Vogt
* add README
4
class AbstractUI(object):
5
    # generic dialogs
6
    def error(self, summary, msg):
7
        return False
8
    def yesNoQuestion(self, summary, msg, title, default='no'):
9
        pass
10
    def message(self, summary, msg):
11
        return True
12
    
13
    # specific dialogs
14
    def askEnableSections(self, sections):
15
        " generic implementation, can be overridden "
16
        return self.yesNoQuestion(_("Enable additional components"),
17
                                  _n("Do you want to enable the following "
28 by Harald Sitter
Reupload merged 0.4.0ubuntu5 and 0.4.1ubuntu1, forgot to bzr push -.-
18
                                         "component: '%s'?",
16 by Michael Vogt
* add README
19
                                         "Do you want to enable the following "
20
                                         "components: '%s'?",
21
                                         len(sections)) % ", ".join(sections))
22
    def askEnableChannel(self, channel, channel_info_html):
21 by Michael Vogt
* AptUrl/AptUrl.py, AptUrl/UI.py, AptUrl/gtk/GtkUI.py:
23
        " generic implementation, can be overridden "
16 by Michael Vogt
* add README
24
        return self.yesNoQuestion(_("Enable additional software channel"),
25
                                  _("Do you want to enable the following "
26
                                    "software channel: '%s'?") % channel)
27
    def askInstallPackage(self):
28
        pass
29
30
    # install/update progress 
31
    def doUpdate(self):
32
        pass
33
    def doInstall(self, pkglist):
34
        pass
35
36
    # UI specific actions for enabling stuff
37
38
    # FIXME: the next two functions shoud go into generic code
39
    #        that checks for the availablility of tools
40
    #        like gksu or kdesudo and uses them 
41
    #        appropriately
42
    def doEnableSection(self, sections):
43
        pass
44
    def doEnableChannel(self, channelpath, channelkey):
45
        pass
46