def __init__(self, WinMain):
#set main window
self.WinMain = WinMain
self.layout_filename = ''
self.histview_ok = True
#open history viewer ini
self.histview_ini = MameWahIni(os.path.join(CONFIG_DIR, 'histview.ini'), 'default', '0.16')
if os.path.exists(os.path.join(CONFIG_DIR, 'ini', self.WinMain.current_emu + '.his')):
self.cpviewer_ini = MameWahIni(os.path.join(CONFIG_DIR, 'ini', self.WinMain.current_emu + '.his'), 'default')
if not os.path.isfile(self.histview_ini.get('history_dat_file')):
self.WinMain.log_msg("Warning: history file: [%s] does not exist" % (
self.histview_ini.get('history_dat_file')))
self.histview_ok = False
self.layout_filename = self.histview_ini.get('history_layout')
if not os.path.isfile(self.layout_filename):
self.WinMain.log_msg("Warning: history layout: [%s] does not exist" % (self.layout_filename))
self.histview_ok = False
#build the window
self.winHistory = gtk.Fixed()
self.winHistory.set_has_window(True)
self.imgBackground = gtk.Image()
self.lblHeading = gtk.Label()
self.sclHistory = ScrollList()
self.winHistory.add(self.imgBackground)
self.winHistory.add(self.make_evb_widget(self.lblHeading))
self.winHistory.add(self.sclHistory.fixd)
WinMain.fixd.add(self.winHistory)
self.imgBackground.show()
self.lblHeading.show()
self.winHistory.show()
#build list
self.lsHistory = []
self.sclHistory.auto_update = True
self.sclHistory.display_limiters = self.WinMain.wahcade_ini.getint('show_list_arrows', 0)
#widgets
self._histview_items = [
(8, self.lblHeading),
(21, self.sclHistory)]
#get history
self.history = self.read_history(self.histview_ini.get('history_dat_file'))
#app number
self.app_number = 0
评论列表
文章目录