Changeset 37 for trunk/src/CreateKit.py

Show
Ignore:
Timestamp:
21-09-2008 18:40:51 (5 years ago)
Author:
pcabido
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/CreateKit.py

    r34 r37  
    1414import gobject 
    1515import threading 
    16 import sexy 
    1716 
    1817import apt 
     
    2524__title__ = "Criador de Kits" 
    2625__version__ = "0.0.1" 
     26__comments__ = "Frontend GTK para o criador de Kits." 
    2727__authors__= ["Paulo Cabido <paulo.cabido@gmail.com>"] 
    28  
    29 gtk.gdk.threads_init() 
    30  
    31 #controla o dialog da progressbar 
    32 class ProgressBar(): 
    33     def __init__(self, dialogName, pbobj): 
    34         self._progressbar = pbobj 
    35         self._dialog = dialogName 
    36      
    37     def progressbarTimeout(self, pbobj): 
    38         pbobj.pulse() 
    39         return True 
    40      
    41     def start(self): 
    42         self._dialog.show() 
    43          
    44     def active(self): 
    45         self._timer = gobject.timeout_add(100, self.progressbarTimeout, self._progressbar) 
    46      
    47     def stop(self): 
    48         gobject.source_remove(self._timer) 
    49         self._timer = 0 
    50         self._dialog.hide()       
     28__copyright__ = "Paulo Cabido" 
     29__license__ = "GNU GPL v3" 
     30 
     31gtk.gdk.threads_init()    
    5132 
    5233#main function 
     
    9475        Creates the package list from the current system cache. 
    9576        """ 
     77         
     78        #init progress dialog 
     79        self.cpbar = util.ProgressBar(self.dialogProgress, self.pbar) 
     80        self.cpbar.start() 
     81             
    9682        gtk.gdk.threads_enter() 
    9783        self.window.set_sensitive(False) 
     
    217203        self.aboutDialog.set_name(__title__) 
    218204        self.aboutDialog.set_version(__version__) 
    219         #self.aboutDialog.set_comments("GTK frontend para Criar Kits.") 
    220         #self.aboutDialog.set_copyright("Copyright (C) Paulo Cabido 2008") 
     205        self.aboutDialog.set_comments(__comments__) 
     206        self.aboutDialog.set_copyright(__copyright__) 
    221207        self.aboutDialog.set_authors(__authors__) 
     208        self.aboutDialog.set_license(__license__) 
    222209        #self.aboutDialog.set_logo(self.aboutDialogIcon) 
    223210         
     
    375362            return False 
    376363         
     364        #msg de sucesso 
    377365        return True 
    378366         
     
    436424         
    437425        #Progress dialog     
    438         self.window_progress = self.wTree.get_widget("window_progress") 
    439426        self.dialogProgress = self.wTree.get_widget("dialogProgress") 
    440427        self.pbar = self.wTree.get_widget("pbarCache") 
     
    455442            self.loadImage(self.imageGenerate, "icons/application-x-deb.png") 
    456443             
    457             #init progress dialog 
    458             self.cpbar = ProgressBar(self.dialogProgress, self.pbar) 
    459             self.cpbar.start() 
     444             
    460445             
    461446            #searchbox