~ubuntu-branches/ubuntu/saucy/aptoncd/saucy-proposed

« back to all changes in this revision

Viewing changes to messageBox.py

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-08-17 22:04:26 UTC
  • mfrom: (1.1.1 upstream) (0.1.11 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090817220426-bhxr3a21ff6y8edm
Tags: 0.1.98+bzr109-0.1
* Non-maintainer upload
* New upstream release (Closes: #452205, #423480, #433915, #541047, #427003,
  #493647, #484636)
* debian/control: 
  - Changed python build dependencies to Build-Depends-Indep
  - Moved url from Description to Homepage
  - Changed Standards-Version to 3.8.2
  - Changed Maintainer to myself
  - Deleted dependency on deprecated mkisofs 
  - Deleted recommend of nautilus-cd-burner
* debian/copyright: Changed (C) to © to make lintian happy
* debian/rules: 
  - deleted deprecated dh_desktop
  - added get-orig-source target to get the latest source from lp
* data/aptoncd.desktop.in: Fixed error and deprecated values in Desktop file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import gtk
2
 
import msg
3
 
 
4
 
(DOWNLOAD_FINISHED, CREATE_FINISHED) =range(2)
5
 
class MessageBox:
6
 
    
7
 
    def ShowInfo(self, text = '', parentWindow= None):
8
 
        dlg = gtk.MessageDialog(parentWindow, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, text)
9
 
        dlg.set_markup(text)
10
 
        dlg.run()
11
 
        dlg.destroy()
12
 
        return
13
 
  
14
 
    def ShowError(self, text = '', parentWindow= None):
15
 
        dlg= gtk.MessageDialog(parentWindow, gtk.DIALOG_MODAL,    gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, text)
16
 
        dlg.set_markup(text)
17
 
        dlg.run()
18
 
        dlg.destroy()
19
 
        return
20
 
        
21
 
    def ShowQuestionOkCancel(self,text, parentWindow= None):
22
 
        dlg = gtk.MessageDialog (parentWindow, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK_CANCEL, text)
23
 
        dlg.set_markup(text)
24
 
        response = dlg.run ()
25
 
        dlg.destroy ()
26
 
        
27
 
        return (response == gtk.RESPONSE_OK)
28
 
        
29
 
    def ShowQuestion(self,text, parentWindow= None):
30
 
        dlg = gtk.MessageDialog (parentWindow, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, text)
31
 
        dlg.set_markup(text)
32
 
        response = dlg.run ()
33
 
        dlg.destroy ()
34
 
        
35
 
        return (response == gtk.RESPONSE_YES)
36
 
 
37
 
    def ShowFinished(self,gladeFile,filePath):
38
 
        a = BurnCreateMsg(gladeFile,filePath)
39
 
        result =  a.run()
40
 
        return result, a.checked()
41
 
 
42
 
class BurnCreateMsg:
43
 
    def __init__(self, gladeFileName,filepath =''):
44
 
        self.formName = "frmDownloadFinished"
45
 
        self.filepath = filepath
46
 
        self.gladeFile = gtk.glade.XML(gladeFileName, self.formName)
47
 
        self.__checked = False
48
 
    
49
 
    def checked(self):
50
 
        return self.__checked
51
 
    
52
 
    def run(self):
53
 
        """This function will show the aboutDialog"""
54
 
        #Get the actual dialog widget
55
 
        frmMsg = self.gladeFile.get_widget(self.formName)
56
 
        frmMsg.set_position(gtk.WIN_POS_CENTER)
57
 
        frmMsg.set_modal(True)
58
 
        
59
 
        self.lblMsg = self.gladeFile.get_widget("lblMsg")
60
 
        self.ckboxRemoveTemp = self.gladeFile.get_widget("ckboxRemoveTemp")
61
 
        
62
 
        self.lblMsg.set_markup(msg.MESSAGE_0068 % self.filepath)           
63
 
            
64
 
        #run the dialog and store the response        
65
 
        result = frmMsg.run()
66
 
        
67
 
        self.__checked = self.ckboxRemoveTemp.get_active() 
68
 
        #we are done with the dialog, destory it
69
 
        frmMsg.destroy()
70
 
        
71
 
        #return the result
72
 
        return     result
73
 
        
74
 
        
 
 
b'\\ No newline at end of file'