mirror of
https://github.com/gryf/pygtktalog.git
synced 2026-03-07 10:05:47 +01:00
Added unit test for misc module, added initial mvc for main window.
This commit is contained in:
28
pygtktalog/controllers/main.py
Normal file
28
pygtktalog/controllers/main.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: Controller for main window
|
||||
Type: core
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2009-05-02
|
||||
"""
|
||||
from gtkmvc import Controller
|
||||
|
||||
|
||||
class MainController(Controller):
|
||||
"""
|
||||
Controller for main application window
|
||||
"""
|
||||
|
||||
def __init__(self, model, view):
|
||||
"""Initialize main controller"""
|
||||
Controller.__init__(self, model, view)
|
||||
|
||||
def register_view(self, view):
|
||||
"""Default view registration stuff"""
|
||||
view['main'].show()
|
||||
|
||||
def register_adapters(self):
|
||||
"""
|
||||
progress bar/status bar adapters goes here
|
||||
"""
|
||||
pass
|
||||
13
pygtktalog/models/main.py
Normal file
13
pygtktalog/models/main.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: Model for main application
|
||||
Type: core
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2009-05-02
|
||||
"""
|
||||
from gtkmvc import Model
|
||||
|
||||
class MainModel(Model):
|
||||
status_bar_message = _("Idle")
|
||||
|
||||
__observables__ = ("status_bar_message",)
|
||||
34
pygtktalog/views/main.py
Normal file
34
pygtktalog/views/main.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: View for main window
|
||||
Type: core
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2009-05-02
|
||||
"""
|
||||
import os.path
|
||||
import gtk
|
||||
from gtkmvc import View
|
||||
|
||||
|
||||
class MainView(View):
|
||||
"""
|
||||
Create window from glade file. Note, that glade file is placed in view
|
||||
module under glade subdirectory.
|
||||
"""
|
||||
|
||||
glade = os.path.join(os.path.dirname(__file__), "glade", "main.glade")
|
||||
top = "main"
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize view
|
||||
"""
|
||||
View.__init__(self)
|
||||
self['tag_path_box'].hide()
|
||||
|
||||
def set_widgets_scan_visibility(self, flag):
|
||||
"""
|
||||
Activate/deactivate selected widgets while scanning is active
|
||||
"""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user