diff options
Diffstat (limited to 'examples/xmlmenudemo.py')
-rw-r--r-- | examples/xmlmenudemo.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/examples/xmlmenudemo.py b/examples/xmlmenudemo.py index ce372ca..ac469bf 100644 --- a/examples/xmlmenudemo.py +++ b/examples/xmlmenudemo.py @@ -43,17 +43,17 @@ import sys, os from qt import TQPopupMenu, SIGNAL, TQLabel, TQIconSet -from tdecore import TDEApplication, TDECmdLineArgs, TDEAboutData, i18n, KIcon, KIconLoader, KShortcut, TDEGlobal -from tdeui import KMainWindow, KMessageBox, KStdAction, KAction, KToggleAction, KFontSizeAction, KFontAction, KRadioAction,\ - KActionSeparator, KActionMenu, KWindowListMenu, KXMLGUIClient, KActionCollection +from tdecore import TDEApplication, TDECmdLineArgs, TDEAboutData, i18n, KIcon, KIconLoader, TDEShortcut, TDEGlobal +from tdeui import TDEMainWindow, KMessageBox, KStdAction, TDEAction, TDEToggleAction, TDEFontSizeAction, TDEFontAction, TDERadioAction,\ + TDEActionSeparator, TDEActionMenu, KWindowListMenu, KXMLGUIClient, TDEActionCollection STATUSBAR_LEFT = 1 STATUSBAR_MIDDLE = 2 STATUSBAR_RIGHT = 3 -class MainWin (KMainWindow): +class MainWin (TDEMainWindow): def __init__ (self, *args): - apply (KMainWindow.__init__, (self,) + args) + apply (TDEMainWindow.__init__, (self,) + args) self.initActions () self.setGeometry (0, 0, 350, 200) @@ -76,12 +76,12 @@ class MainWin (KMainWindow): self.saveAsAction.setEnabled (False) def initActions (self): - # This is used in all of the KAction/KStdAction constructors -- + # This is used in all of the TDEAction/KStdAction constructors -- # Seems more efficient to only do the call once acts = self.actionCollection () # This is used often enough, we just define it here - scNull = KShortcut.null () + scNull = TDEShortcut.null () # "File" menu items self.newAction = KStdAction.openNew (self.slotNew, acts) @@ -114,20 +114,20 @@ class MainWin (KMainWindow): # object names - the variable the object is assigned to ('self.specialAction') # has no meaning in XNLGUI terms except through the objects 'name' member value - self.specialAction = KAction (i18n ("Special"), scNull, self.slotSpecial, acts, "specialActionName") + self.specialAction = TDEAction (i18n ("Special"), scNull, self.slotSpecial, acts, "specialActionName") # Demo menu items - # KToggleAction has an isChecked member and emits the "toggle" signal - self.toggle1Action = KToggleAction ("Toggle 1", scNull, acts, "toggle1Action") - self.toggle2Action = KToggleAction ("Toggle 2", scNull, self.slotToggle2, acts, "toggle2Action") + # TDEToggleAction has an isChecked member and emits the "toggle" signal + self.toggle1Action = TDEToggleAction ("Toggle 1", scNull, acts, "toggle1Action") + self.toggle2Action = TDEToggleAction ("Toggle 2", scNull, self.slotToggle2, acts, "toggle2Action") # A separator - create once/use everywhere - self.separateAction = KActionSeparator (acts, "separateAction") + self.separateAction = TDEActionSeparator (acts, "separateAction") # Font stuff in menus or toolbar - self.fontAction = KFontAction ("Font", scNull, acts, "fontAction") - self.fontSizeAction = KFontSizeAction ("Font Size", scNull, acts, "fontSizeAction") + self.fontAction = TDEFontAction ("Font", scNull, acts, "fontAction") + self.fontSizeAction = TDEFontSizeAction ("Font Size", scNull, acts, "fontSizeAction") self.fontAction.setComboWidth (150) self.fontSizeAction.setComboWidth (75) @@ -136,8 +136,8 @@ class MainWin (KMainWindow): icons = KIconLoader () iconSet = TQIconSet (icons.loadIcon ("viewmag", KIcon.Toolbar)) - # Nested menus using KActions (also nested on toolbar) - self.actionMenu = KActionMenu ("Action Menu", acts, "actionMenu") + # Nested menus using TDEActions (also nested on toolbar) + self.actionMenu = TDEActionMenu ("Action Menu", acts, "actionMenu") self.actionMenu.setIconSet (iconSet) # By using KStdAction here, the XMLGUI mechanism will automatically @@ -152,12 +152,12 @@ class MainWin (KMainWindow): self.actionMenu.insert (KStdAction.zoomIn (self.slotZoomIn, acts)) self.actionMenu.insert (KStdAction.zoomOut (self.slotZoomOut, acts)) - self.radio1Action = KRadioAction ("Radio 1", scNull, self.slotRadio, acts, "radio1") + self.radio1Action = TDERadioAction ("Radio 1", scNull, self.slotRadio, acts, "radio1") self.radio1Action.setExclusiveGroup ("Radio") self.radio1Action.setChecked (1) - self.radio2Action = KRadioAction ("Radio 2", scNull, self.slotRadio, acts, "radio2") + self.radio2Action = TDERadioAction ("Radio 2", scNull, self.slotRadio, acts, "radio2") self.radio2Action.setExclusiveGroup ("Radio") - self.radio3Action = KRadioAction ("Radio 3", scNull, self.slotRadio, acts, "radio3") + self.radio3Action = TDERadioAction ("Radio 3", scNull, self.slotRadio, acts, "radio3") self.radio3Action.setExclusiveGroup ("Radio") @@ -168,7 +168,7 @@ class MainWin (KMainWindow): def dynamicActions (self): # This creates something like a 'recent files list' in the 'File' menu - # (There is a KRecentFilesAction that probably should be used instead, + # (There is a TDERecentFilesAction that probably should be used instead, # but this demos the use of action lists) # The code here corresponds to the <ActionList name="recent"/> entry # in the rc file @@ -180,15 +180,15 @@ class MainWin (KMainWindow): self.unplugActionList("recent"); self.dynamicActionsList = [] - # Create a KAction for each entry and store the KActions in a list - # Use 'None' for the KActionCollection argument in the KAction constructor + # Create a TDEAction for each entry and store the TDEActions in a list + # Use 'None' for the TDEActionCollection argument in the TDEAction constructor # in this case only for i in range (len (fakeFiles)): - act = KAction (i18n (" ".join (["&" + str (i), fakeFiles [i]])), KShortcut.null (),\ + act = TDEAction (i18n (" ".join (["&" + str (i), fakeFiles [i]])), TDEShortcut.null (),\ self.slotFake, None, fakeFiles [i][:-4] + "open") self.dynamicActionsList.append(act) - # Update the menu with the most recent KActions + # Update the menu with the most recent TDEActions self.plugActionList("recent", self.dynamicActionsList) |