~bakrss.developers/bakrss/main

« back to all changes in this revision

Viewing changes to GuiTools.py

  • Committer: akus-py
  • Date: 2009-03-30 20:32:34 UTC
  • mfrom: (7.1.2 bakrss)
  • Revision ID: akus.py@gmail.com-20090330203234-fdgsxzjcdoagkrbt
load database added

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import pygtk
 
2
import gtk
 
3
import gtk.glade
 
4
from dbaseclass import DbaseFeed
 
5
 
 
6
class Add_dialog:
 
7
    
 
8
    def __init__(self):
 
9
        
 
10
        signals = {"on_ok_btn_clicked" : self.on_ok_btn_clicked,
 
11
                   "on_abort_btn_clicked" : self.on_abort_btn_clicked,}
 
12
        self.glade = gtk.glade.XML("Gui.glade", "add_dialog")
 
13
        self.glade.signal_autoconnect(signals)
 
14
        self.add_dialog = self.glade.get_widget('add_dialog')
 
15
        self.ok_btn = self.glade.get_widget("ok_btn")
 
16
        self.url_entry = self.glade.get_widget("url_entry")
 
17
        self.add_dialog.run()
 
18
        
 
19
    def on_ok_btn_clicked(self, widget):
 
20
        self.dbase = DbaseFeed()
 
21
        self.dbase.fill(self.url_entry.get_text())
 
22
        self.add_dialog.destroy()
 
23
    
 
24
    def on_abort_btn_clicked(self, widget):
 
25
        self.add_dialog.destroy()
 
26
 
 
27
class Prefs_dialog:
 
28
    
 
29
    def __init__(self):
 
30
        
 
31
        signals = {"on_ok_btn_clicked" : self.on_ok_btn_clicked,
 
32
                   "on_abort_btn_clicked" : self.on_abort_btn_clicked,}
 
33
                   
 
34
        self.glade = gtk.glade.XML("Gui.glade", "prefs_dialog")
 
35
        self.prefs_dialog = self.glade.get_widget("prefs_dialog")
 
36
        self.prefs_dialog.run()
 
37
        
 
38
    def on_ok_btn_clicked(self, widget):
 
39
        self.prefs_dialog.destroy()
 
40
    
 
41
    def on_abort_btn_clicked(self, widget):
 
42
        self.prefs_dialog.destroy()