def initActions(self): collection = self.actionCollection() self.quitAction = KStdAction.quit(self.close, collection) self.newEntityAction = KStdAction.openNew(self.slotNewEntity, collection) self.newTagAction = NewTagAction(self.slotNewTag, collection) self.manageEntityTypesAction = KStdAction.addBookmark(self.slotManageEntityTypes, collection)
def __init__(self, *args): apply(KMainWindow.__init__, (self,) + args) self.lastDir = "/var/log" self.monitors = [] self.currentPage = None self.tab = QTabWidget(self) self.settingsDlg = SettingsDlg(self) self.cfg = LoviConfig().getInstance() self.bellIcon = \ QIconSet(KIconLoader().loadIcon("idea", KIcon.Small, 11)) self.noIcon = QIconSet() self.findDlg = KEdFind(self, "find", False) self.connect(self.findDlg, SIGNAL("search()"), self.doFind) self.setCentralWidget(self.tab) self.connect(self.tab, SIGNAL("currentChanged(QWidget *)"), self.onPageChange) self.setGeometry(0, 0, 600, 400) self.setCaption(makeCaption("(none)")) # Timers self.timer = QTimer(self) self.timer.start(MainWin.MON_TIMEOUT) self.statusTimer = QTimer(self) self.connect(self.statusTimer, SIGNAL("timeout()"), self.onStatusTimeout) self.changeTimer = QTimer(self) self.changeTimer.start(MainWin.CHANGE_TIMEOUT) self.connect(self.changeTimer, SIGNAL("timeout()"), self.onChangeTimeout) # Initialize actions actions = self.actionCollection() self.openAction = KStdAction.open(self.onOpen, actions) self.closeAction = KStdAction.close(self.onClose, actions) self.closeAction.setEnabled(False) self.quitAction = KStdAction.quit(self.onQuit, actions) self.copyAction = KStdAction.copy(self.onCopy, actions) self.copyAction.setEnabled(False) self.clearAction = KStdAction.clear(self.onClear, actions) self.clearAction.setEnabled(False) self.selectAllAction = KStdAction.selectAll(self.onSelectAll, actions) self.selectAllAction.setEnabled(False) self.addBookmarkAction = \ KStdAction.addBookmark(self.onAddBookmark, actions) self.addBookmarkAction.setEnabled(False) self.settingsAction = KStdAction.preferences(self.onSettings, actions) self.findAction = KStdAction.find(self.onFind, actions) self.findAction.setEnabled(False) self.findNextAction = KStdAction.findNext(self.onFindNext, actions) self.findNextAction.setEnabled(False) self.findPrevAction = KStdAction.findPrev(self.onFindPrev, actions) self.findPrevAction.setEnabled(False) # Initialize menus fileMenu = QPopupMenu(self) self.openAction.plug(fileMenu) self.closeAction.plug(fileMenu) fileMenu.insertSeparator() self.quitAction.plug(fileMenu) self.menuBar().insertItem(i18n("&File"), fileMenu) editMenu = QPopupMenu(self) self.copyAction.plug(editMenu) self.clearAction.plug(editMenu) editMenu.insertSeparator() self.selectAllAction.plug(editMenu) self.addBookmarkAction.plug(editMenu) editMenu.insertSeparator() self.findAction.plug(editMenu) self.findNextAction.plug(editMenu) self.findPrevAction.plug(editMenu) self.menuBar().insertItem(i18n("&Edit"), editMenu) settingsMenu = QPopupMenu(self) self.settingsAction.plug(settingsMenu) self.menuBar().insertItem(i18n("&Settings"), settingsMenu) helpMenu = self.helpMenu("") self.menuBar().insertItem(i18n("&Help"), helpMenu) # Initialize status bar self.sb = self.statusBar() self.bell = BellButton(None) self.displayStatus(False, "")
def initActions(self): collection = self.actionCollection() self.quitAction = KStdAction.quit(self.close, collection) self.newEntityTypeAction = KStdAction.openNew(self.slotNewEntityType, collection) self.newExtraFieldAction = KStdAction.addBookmark(self.slotNewExtraField, collection)