def _init_common(self): # setup app pointer self.app = get_application_pointer() self.doc = MainGameInfoDocument(self.app) # setup dialog pointers self.select_title_screenshot_dlg = None self.app.dcop.addMethod('void editGameData (QString)', self.edit_game_data_dialog)
def __init__(self, parent): KMainWindow.__init__(self, parent, 'PyKDE Dosbox Frontend') # setup app pointer self.app = get_application_pointer() self._init_common() self.setAcceptDrops(True) # place a splitter in the window self.splitView = QSplitter(self, 'splitView') # place a listview in the splitter (on the left) self.listView = KListView(self.splitView, 'games_view') # fill listview self.initlistView() # try to resize splitter # this is a kind of ugly hack, but seems to work ok x, y = self.myconfig.get_xy('mainwindow', 'mainwindow_size') self.splitView.setSizes([int(.1*x), int(.9*x)]) # setup signals self.connect(self.listView, SIGNAL('selectionChanged()'), self.selectionChanged) # place text browser in splitter #self.textView = InfoBrowser(self.splitView) # i may eventually use the KHTMLPart instead # of the KTextBrowser if self.app.myconfig.getboolean('mainwindow', 'use_khtml_part'): self.textView = InfoPart(self.splitView) else: self.textView = InfoBrowser(self.splitView) self.connect(self.textView, PYSIGNAL('GameInfoSet'), self.selectGame) self.statusbar = KStatusBar(self) self._set_current_profile(self.app.dosbox.current_profile) # set main widget self.setCentralWidget(self.splitView) # setup dialog pointers # it would be nice if I knew a better way to get # information from dialogs self.new_game_dir_dialog = None self.add_new_game_dlg = None self.set_profile_dlg = None # here we add some methods to the dcop object self.app.dcop.addMethod('void selectGame (QString)', self.selectGame) self.app.dcop.addMethod('void launchSelectedGame()', self.slotLaunchDosbox)
def __init__(self, parent, action, name='MultiGameProgress'): QWidget.__init__(self, parent, name) self.app = get_application_pointer() self.fhandler = self.app.make_new_fileshandler() self.action = action self.game_progressBar = KProgress(self) self.file_progressBar = KProgress(self) self.file_progressBarLbl = QLabel(self) self.game_progressBarLbl = QLabel(self) self.grid = QGridLayout(self, 4, 1, 5, 7) self.grid.addWidget(self.file_progressBarLbl, 0, 0) self.grid.addWidget(self.file_progressBar, 1, 0) self.grid.addWidget(self.game_progressBarLbl, 2, 0) self.grid.addWidget(self.game_progressBar, 3, 0) if action == 'prepare_game': self.game_action = 'Prepare' self.fhandler._report_extract_from_installed_archive = self.report_file_extracted else: self.game_action = 'Clean up' self.fhandler.archivehelper.report_installed_file_handled = self.report_file_handled
def __init__(self, parent, name='BaseMainWindow'): KMainWindow.__init__(self, parent, name) HasDialogs.__init__(self) self.app = get_application_pointer()
def __init__(self, parent, name='BaseInfoPart'): KHTMLPart.__init__(self, parent, name) HasDialogs.__init__(self) self.app = get_application_pointer() self.dialog_parent = QWidget(self.parent(), 'dialog_parent')
def __init__(self, parent, name='BaseProgressDialog'): KProgressDialog.__init__(self, parent, name) self.app = get_application_pointer()
def __init__(self): self.app = get_application_pointer() self.dcop = self.app.dcopClient() self.iface = DCOPObj("kaffeine", self.dcop, "KaffeineIface")