~bakrss.developers/bakrss/main

7.1.2 by Luca Livraghi
added menubar, first implementation of preferences dialog, added un/fullscreen feature
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")
11 by Luca Livraghi
Name entry added
17
        self.name_entry = self.glade.get_widget("name_entry")
7.1.2 by Luca Livraghi
added menubar, first implementation of preferences dialog, added un/fullscreen feature
18
        self.add_dialog.run()
19
        
20
    def on_ok_btn_clicked(self, widget):
21
        self.dbase = DbaseFeed()
22
        self.dbase.fill(self.url_entry.get_text())
23
        self.add_dialog.destroy()
24
    
25
    def on_abort_btn_clicked(self, widget):
26
        self.add_dialog.destroy()
27
28
class Prefs_dialog:
29
    
30
    def __init__(self):
31
        
32
        signals = {"on_ok_btn_clicked" : self.on_ok_btn_clicked,
33
                   "on_abort_btn_clicked" : self.on_abort_btn_clicked,}
34
                   
35
        self.glade = gtk.glade.XML("Gui.glade", "prefs_dialog")
36
        self.prefs_dialog = self.glade.get_widget("prefs_dialog")
37
        self.prefs_dialog.run()
38
        
39
    def on_ok_btn_clicked(self, widget):
40
        self.prefs_dialog.destroy()
41
    
42
    def on_abort_btn_clicked(self, widget):
43
        self.prefs_dialog.destroy()