summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/templates
diff options
context:
space:
mode:
Diffstat (limited to 'korundum/rubylib/templates')
-rw-r--r--korundum/rubylib/templates/annotated/basicapp.rb106
-rw-r--r--korundum/rubylib/templates/annotated/menuapp1.rb278
-rw-r--r--korundum/rubylib/templates/annotated/menuapp2.rb260
-rw-r--r--korundum/rubylib/templates/annotated/menuapp3.rb221
-rw-r--r--korundum/rubylib/templates/annotated/menuapp3ui.rc24
-rw-r--r--korundum/rubylib/templates/annotated/minimal.rb80
-rw-r--r--korundum/rubylib/templates/annotated/systray1.rb94
-rw-r--r--korundum/rubylib/templates/basic/basicapp.rb61
-rw-r--r--korundum/rubylib/templates/basic/menuapp1.rb213
-rw-r--r--korundum/rubylib/templates/basic/menuapp2.rb216
-rw-r--r--korundum/rubylib/templates/basic/menuapp3.rb174
-rw-r--r--korundum/rubylib/templates/basic/menuapp3ui.rc24
-rw-r--r--korundum/rubylib/templates/basic/minimal.rb56
-rw-r--r--korundum/rubylib/templates/basic/systray1.rb75
14 files changed, 1882 insertions, 0 deletions
diff --git a/korundum/rubylib/templates/annotated/basicapp.rb b/korundum/rubylib/templates/annotated/basicapp.rb
new file mode 100644
index 00000000..41f61bce
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/basicapp.rb
@@ -0,0 +1,106 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+=begin
+Most Korundum applications will need a main window - the is the top
+level widget (the parent for all other widgets). KDE::MainWindow has
+more functionality than shown here (see more complex templates).
+It has the ability to create the other major parts of the user
+interface - the main view, menus, toolbars, etc.
+
+Usually you provide a subclass of KDE::MainWindow, construct menus
+and toolbars in the subclass' initialize method, and provide
+slots for menu/toolbar actions in separate methods.
+=end
+
+class MainWin < KDE::MainWindow
+ def initialize(*args)
+ super
+ end
+
+end
+#-------------------- main ------------------------------------------------
+
+# set up some basic information about the program in
+# a KDE::AboutData object - this affects the application's
+# title bar caption and makes it easy to set up a
+# Help | About dialog box for your app
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+# you can add the names of the app's authors here
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+# Pass the command line arguments and aboutData to
+# KDE::CmdLineArgs - this is where KDE will look for
+# this information. The KDE::Application constructor
+# used below *requires* the args are processed
+# *before* KDE::Application is instantiated. There
+# is an alternate constructor that takes ARGV
+# as an argument (see minimal.rb)
+
+# Note that instead of argc/argv, this constructor
+# only takes a single argument - ARGV - which
+# is a Ruby list
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+# Set up the command line options (switches) you
+# want your app to be able to process (you could
+# use Ruby's getopt module instead, but it works
+# a little differently)
+
+# Note that the argument for this method is a list
+# of three element lists
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+# instantiate KDE::Application - no other QObject
+# or QWidget based classes can be instantiated
+# until there is a KApplication instance
+app = KDE::Application.new()
+
+# instantiate the subclass of KMainWindow
+mainWindow = MainWin.new(nil, "main window")
+
+# create the display
+mainWindow.show
+
+# run KDE::Application's event loop until the
+# program exits
+app.exec
+
diff --git a/korundum/rubylib/templates/annotated/menuapp1.rb b/korundum/rubylib/templates/annotated/menuapp1.rb
new file mode 100644
index 00000000..0553aa14
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/menuapp1.rb
@@ -0,0 +1,278 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+
+=begin
+This template constructs an application with menus, toolbar and statusbar,
+HOWEVER it is not recommended this template actually be used. It presents
+the "KDE 1.0" method for constructing menus and toolbars - later versions
+of KDE have introduced better(easier and more powerful) methods for
+doing this job - see other menuapp*.rb templates for these methods
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ TOOLBAR_NEW = 1
+ TOOLBAR_OPEN = 2
+ TOOLBAR_SAVE = 3
+ TOOLBAR_CUT = 4
+ TOOLBAR_COPY = 5
+ TOOLBAR_PASTE = 6
+
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ initMenus()
+ initToolBar()
+ initStatusBar()
+ end
+
+ def initMenus()
+ # Create a QPopupMenu - all menus are "popup" menus
+
+ fileMenu = Qt::PopupMenu.new(self)
+
+ # This is the "simple" KDE-1.0 way. It is not suggested that this
+ # template actually be used in an application, but it's
+ # provided to show the underlying mechanics of menu construction
+ # that KDE makes much easier with other methods (see other
+ # menuapp*.rb templates for usable examples)
+
+ # All menu item strings are wrapped with i18n - this allows
+ # internationalization
+
+ # Predefined accelerators are in KDE::StdAccel - these are
+ # the standard accelerators. For custom accelerators, use
+ # KDE::Accel. All KDE::StdAccel methods are static, so there is no
+ # need to instantiate KDE::StdAccel
+
+ # "File" menu items
+ fileMenu.insertItem(i18n("New"), self, SLOT('slotNew()'), Qt::KeySequence.new(KDE::StdAccel.openNew().keyCodeQt()))
+ fileMenu.insertItem(i18n("Open"), self, SLOT('slotOpen()'), Qt::KeySequence.new(KDE::StdAccel.open().keyCodeQt()))
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("Save"), self, SLOT('slotSave()'), Qt::KeySequence.new(KDE::StdAccel.save().keyCodeQt()))
+
+ # KStdAccel doesn't have a standard accelerator for 'Save As',
+ # so we omit it - insertItem uses the default value
+ fileMenu.insertItem(i18n("SaveAs"), self, SLOT('slotSaveAs()'))
+
+ # This inserts a line between groups of items in a menu
+
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("Print"), self, SLOT('slotPrint()'), Qt::KeySequence.new(KDE::StdAccel.print().keyCodeQt()))
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("&Quit"), self, SLOT('slotQuit()'), Qt::KeySequence.new(KDE::StdAccel.quit().keyCodeQt()))
+
+ # Put fileMenu (as the File menu) into the menu bar
+ # 'menuBar' is a predefined object owned by KDE::MainWindow
+ menuBar().insertItem(i18n("&File"), fileMenu)
+
+ editMenu = Qt::PopupMenu.new(self)
+
+ # "Edit" menu items
+ editMenu.insertItem(i18n("Undo"), self, SLOT('slotUndo()'), Qt::KeySequence.new(KDE::StdAccel.undo().keyCodeQt()))
+ editMenu.insertItem(i18n("Redo"), self, SLOT('slotRedo()'), Qt::KeySequence.new(KDE::StdAccel.redo().keyCodeQt()))
+ editMenu.insertSeparator()
+ editMenu.insertItem(i18n("Cut"), self, SLOT('slotCut()'), Qt::KeySequence.new(KDE::StdAccel.cut().keyCodeQt()))
+ editMenu.insertItem(i18n("Copy"), self, SLOT('slotCopy()'), Qt::KeySequence.new(KDE::StdAccel.copy().keyCodeQt()))
+ editMenu.insertItem(i18n("Paste"), self, SLOT('slotPaste()'), Qt::KeySequence.new(KDE::StdAccel.paste().keyCodeQt()))
+ editMenu.insertSeparator()
+ editMenu.insertItem(i18n("Find"), self, SLOT('slotFind()'), Qt::KeySequence.new(KDE::StdAccel.find().keyCodeQt()))
+ editMenu.insertItem(i18n("Find Next"), self, SLOT('slotFindNext()'), Qt::KeySequence.new(KDE::StdAccel.findNext().keyCodeQt()))
+ editMenu.insertItem(i18n("Replace"), self, SLOT('slotReplace()'), Qt::KeySequence.new(KDE::StdAccel.replace().keyCodeQt()))
+
+ # Put editMenu (as the Edit menu) into the menu bar
+
+ menuBar().insertItem(i18n("&Edit"), editMenu)
+
+ # Let KDE generate a nifty help menu
+
+ # The KDE::AboutData/KDE::CmdLineArgs data from the main part of the program
+ # will be used to generate the About dialog
+ helpMenu = helpMenu("")
+ menuBar().insertItem(i18n("&Help"), helpMenu)
+ end
+
+ def initToolBar()
+ # KDE::IconLoader will make it easy to locate the standard KDE icons for
+ # toolbar buttons. For custom icons, a complete path to the icon
+ # (without the loadIcon call) is needed
+ icons = KDE::IconLoader.new()
+
+ # KDE::MainWindow owns at least one KDE::ToolBar instance, which is returned
+ # by 'toolBar()'. To obtain additional toolbars, add an argument
+ # to the call -- toolBar(1) will return another toolbar you can
+ # add buttons to.
+
+ # Add buttons to the toolbar. The icon name, id value (eg TOOLBAR_NEW),
+ # signal to connect (eg clicked) and the slot to connect to all need
+ # to be specified,as does the tooltip (the last string argument). There
+ # are easier ways to do this - see other menuapp templates for easier
+ # methods using KDE::Action/KDE::StdAction
+
+ toolBar().insertButton(icons.loadIcon("filenew", KDE::Icon::Toolbar), TOOLBAR_NEW, SIGNAL("clicked(int)"),
+ self, SLOT('slotNew()'), true, "New")
+ toolBar().insertButton(icons.loadIcon("fileopen", KDE::Icon::Toolbar), TOOLBAR_OPEN, SIGNAL("clicked(int)"),
+ self, SLOT('slotOpen()'), true, "Open")
+ toolBar().insertButton(icons.loadIcon("filesave", KDE::Icon::Toolbar), TOOLBAR_SAVE, SIGNAL("clicked(int)"),
+ self, SLOT('slotSave()'), true, "Save")
+ toolBar().insertButton(icons.loadIcon("editcut", KDE::Icon::Toolbar), TOOLBAR_CUT, SIGNAL("clicked(int)"),
+ self, SLOT('slotCut()'), true, "Cut")
+ toolBar().insertButton(icons.loadIcon("editcopy", KDE::Icon::Toolbar), TOOLBAR_COPY, SIGNAL("clicked(int)"),
+ self, SLOT('slotCopy()'), true, "Copy")
+ toolBar().insertButton(icons.loadIcon("editpaste", KDE::Icon::Toolbar), TOOLBAR_PASTE, SIGNAL("clicked(int)"),
+ self, SLOT('slotPaste()'), true, "Paste")
+ end
+
+ def initStatusBar()
+ # KDE::MainWindow also owns a KDE::StatusBar instance. The first
+ # call creates a KDE::StatusBar instance. See 'notImpl' below
+ # for an example of writing to the status bar. You can
+ # also add widgets (labels, progress bars, etc) to the
+ # status bar
+
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+
+#-------------------- slots -----------------------------------------------
+
+ # Slots which can be called from both the menu toolbar
+ # have a second parameter with a default value (id = -1)
+ # This is because menu signals expect to connect to a
+ # slot that takes no arguments, while toolbar signals
+ # expect to send a signal with an int argument for the
+ # id of the toolbar button. The default value allows
+ # both cases to work.
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Qt::uit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+#-------------------- main ------------------------------------------------
+
+# See athe minimal.rb and basicapp.rb templates for
+# explantion of the basic app and main window setup
+
+# The following data is passed to KDE::CmdLineArgs, which in
+# turn makes it available to the "about" box in the Help
+# menu (when the Help menu is created as above)
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
diff --git a/korundum/rubylib/templates/annotated/menuapp2.rb b/korundum/rubylib/templates/annotated/menuapp2.rb
new file mode 100644
index 00000000..d3eab60d
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/menuapp2.rb
@@ -0,0 +1,260 @@
+
+=begin
+This template constructs an application with menus, toolbar and statusbar.
+It uses KDE classes and methods that simplify the task of building and
+operating a GUI. It is recommended that this approach be used, rather
+than the primitive approach in menuapp1.rb
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+
+
+class MainWin < KDE::MainWindow
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ # Create the actions that will populate
+ # the menus and toolbars
+ initActions()
+
+ # Plug actions into menus
+ initMenus()
+
+ # Plug actions into toolbars
+ initToolBar()
+
+ # Create the status bar
+ initStatusBar()
+
+ # Usings actions, only a single line is required
+ # to enable/disable both the menu item and corresponding
+ # toolbar button from anywhere in the program
+ @saveAction.setEnabled(false)
+ @saveAsAction.setEnabled(false)
+ end
+
+ def initActions()
+ # Most of the functions selectable by menu are "standard"
+ # actions (open a file, cut, paste, etc) - you customize
+ # how they behave in your code, but menu, toolbar, and
+ # accelerator settings are the same across all programs.
+ # Standard actions also have tooltips already assigned
+
+ # To create most of the actions below, KDE::StdAction is
+ # is used, since it takes care of everything with
+ # a single line of code.
+
+ # The standard actions only need to specify the slot
+ # where the code for the action is located
+
+ # "File" menu items
+ @newAction = KDE::StdAction.openNew(self, SLOT("slotNew()"), actionCollection())
+ @openAction = KDE::StdAction.open(self, SLOT("slotOpen()"), actionCollection())
+ @saveAction = KDE::StdAction.save(self, SLOT("slotSave()"), actionCollection())
+ @saveAsAction = KDE::StdAction.saveAs(self, SLOT("slotSaveAs()"), actionCollection())
+ @printAction = KDE::StdAction.print(self, SLOT("slotPrint()"), actionCollection())
+ @quitAction = KDE::StdAction.quit(self, SLOT("slotQuit()"), actionCollection())
+
+ # "Edit" menu items
+ @undoAction = KDE::StdAction.undo(self, SLOT("slotUndo()"), actionCollection())
+ @redoAction = KDE::StdAction.redo(self, SLOT("slotRedo()"), actionCollection())
+ @cutAction = KDE::StdAction.cut(self, SLOT("slotCut()"), actionCollection())
+ @copyAction = KDE::StdAction.copy(self, SLOT("slotCopy()"), actionCollection())
+ @pasteAction = KDE::StdAction.paste(self, SLOT("slotPaste()"), actionCollection())
+ @findAction = KDE::StdAction.find(self, SLOT("slotFind()"), actionCollection())
+ @findNextAction = KDE::StdAction.findNext(self, SLOT("slotFindNext()"), actionCollection())
+ @replaceAction = KDE::StdAction.replace(self, SLOT("slotReplace()"), actionCollection())
+
+ # For actions that are not "standard", you can create your
+ # own actions using KDE::Action. This example doesn't include
+ # an icon, but there is a KDE::Action constructor that will
+ # allow you to specify an icon (for toolbar use, for instance),
+ # or you can use KDE::Action.setIcon to set/change the icon. You
+ # can also add a tooltip with KDE::Action.setToolTip
+
+ # This KAction constructor requires a string, an accelerator (0
+ # in this case), a slot, and a QObject (None in this case)
+
+ @specialAction = KDE::Action.new(i18n("Special"), KDE::Shortcut.new(0), self, SLOT('slotSpecial()'), actionCollection(), "specialActionName")
+ end
+
+ def initMenus()
+ # plug the actions into the menus
+
+ fileMenu = Qt::PopupMenu.new(self)
+ @newAction.plug(fileMenu)
+ @openAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @saveAction.plug(fileMenu)
+ @saveAsAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @printAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @quitAction.plug(fileMenu)
+ menuBar().insertItem(i18n("&File"), fileMenu)
+
+ editMenu = Qt::PopupMenu.new(self)
+ @undoAction.plug(editMenu)
+ @redoAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @cutAction.plug(editMenu)
+ @copyAction.plug(editMenu)
+ @pasteAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @findAction.plug(editMenu)
+ @findNextAction.plug(editMenu)
+ @replaceAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @specialAction.plug(editMenu)
+ menuBar().insertItem(i18n("&Edit"), editMenu)
+
+ # Uses the info from KAboutData (specified below)
+ # to construct the "About" box in the Help menu
+
+ helpMenu = helpMenu("")
+ menuBar().insertItem(i18n("&Help"), helpMenu)
+ end
+
+ def initToolBar()
+ # Add some (but not all) actions to the toolbar
+
+ @newAction.plug(toolBar())
+ @openAction.plug(toolBar())
+ @saveAction.plug(toolBar())
+ @cutAction.plug(toolBar())
+ @copyAction.plug(toolBar())
+ @pasteAction.plug(toolBar())
+ end
+
+ def initStatusBar()
+ # Initialize the status bar
+
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+#-------------------- slots -----------------------------------------------
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Quit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
diff --git a/korundum/rubylib/templates/annotated/menuapp3.rb b/korundum/rubylib/templates/annotated/menuapp3.rb
new file mode 100644
index 00000000..bd701d43
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/menuapp3.rb
@@ -0,0 +1,221 @@
+=begin
+This template constructs an application with menus, toolbar and statusbar.
+It uses an XML file(menuapp3ui.rc) to specify the menu layout; all menu
+items have a corresponding action defined, but no menus are created
+explicitly in code. This app has the same menu layout as menuapp2.py
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ # Create actions that correspond to those in the XML file
+ initActions()
+
+ # Parse the default XML file (<appName>ui.rc> and create
+ # the menus and toolbar. This single line (and the XML
+ # file it reads) replace initMenus and initToolBar from
+ # menuapp2.rb. Otherwise, the menuapp2 and menuapp3
+ # are identical 'createGUI' expects to find 'menuapp3ui.rc'
+ # either in the directory menuapp3.rb is run from, or
+ # in $KDEDIR/apps/menuapp3/
+ createGUI()
+
+ # Create the status bar
+ initStatusBar()
+
+ # Disable a couple of menu items using their actions
+ @saveAction.setEnabled(false)
+ @saveAsAction.setEnabled(false)
+ end
+
+ def initActions()
+ # Most of the functions selectable by menu are "standard"
+ # actions (open a file, cut, paste, etc) - you customize
+ # how they behave in your code, but menu, toolbar, and
+ # accelerator settings are the same across all programs.
+ # Standard actions also have tooltips already assigned
+
+ # To create most of the actions below, KDE::StdAction is
+ # is used, since it takes care of everything with
+ # a single line of code.
+
+ # The standard actions only need to specify the slot
+ # where the code for the action is located
+
+ # Because the XMLGUI mechanism parses $KDEDIR/config/ui/ui_standards.rc
+ # before parsing and merging menuapp3ui.rc, it actually isn't
+ # necessary to list KDE::StdAction actions in menuapp3.rc. THE XMLGUI
+ # code will create menu/toolbar items and place them *automatically*
+ # if you defined the KDE::StdActions as below. In fact, you can't override
+ # this behavior using KDE::StdActions - if you want menus to be "non-standard"
+ # KDE menus (eg 'Cut' in the 'File' menu), you'll need to create your
+ # actions from KDE::Action instead of KDE::StdAction. Obviously it makes more
+ # sense to use the mechanism provided to produce consistent menus and
+ # toolbars. You can "unplug" items if, for example, you don't want them
+ # in the toolBar.
+
+ # "File" menu items
+ @newAction = KDE::StdAction.openNew(self, SLOT("slotNew()"), actionCollection())
+ @openAction = KDE::StdAction.open(self, SLOT("slotOpen()"), actionCollection())
+ @saveAction = KDE::StdAction.save(self, SLOT("slotSave()"), actionCollection())
+ @saveAsAction = KDE::StdAction.saveAs(self, SLOT("slotSaveAs()"), actionCollection())
+ @printAction = KDE::StdAction.print(self, SLOT("slotPrint()"), actionCollection())
+ @quitAction = KDE::StdAction.quit(self, SLOT("slotQuit()"), actionCollection())
+
+
+ # "Edit" menu items
+ @undoAction = KDE::StdAction.undo(self, SLOT("slotUndo()"), actionCollection())
+ @redoAction = KDE::StdAction.redo(self, SLOT("slotRedo()"), actionCollection())
+ @cutAction = KDE::StdAction.cut(self, SLOT("slotCut()"), actionCollection())
+ @copyAction = KDE::StdAction.copy(self, SLOT("slotCopy()"), actionCollection())
+ @pasteAction = KDE::StdAction.paste(self, SLOT("slotPaste()"), actionCollection())
+ @findAction = KDE::StdAction.find(self, SLOT("slotFind()"), actionCollection())
+ @findNextAction = KDE::StdAction.findNext(self, SLOT("slotFindNext()"), actionCollection())
+ @replaceAction = KDE::StdAction.replace(self, SLOT("slotReplace()"), actionCollection())
+
+ # For ANYTHING constructed from KDE::Action or its descendants (KDE::ActionMenu, KDE::ActionSeparator,
+ # KDE::FontAction, etc) you MUST provide the actionCollection () parent and an object
+ # name ("specialActionName") or the XMLGUI mechanism will not be able to locate the
+ # action. XMLGUI finds the action via its member name value, NOT via its variable name.
+ @specialAction = KDE::Action.new(i18n("Special"), KDE::Shortcut.new(0), self, SLOT('slotSpecial()'), actionCollection(), "specialActionName")
+ end
+
+ def initStatusBar()
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+#-------------------- slots -----------------------------------------------
+
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Quit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+
+# To use the XMLGUI mechanism, you MUST provide an appName
+# (the first argument to KDE::AboutData below) - the XML spec
+# for the interface will be in <appName>ui.rc (don't forget
+# the "ui" suffix to the application name)
+aboutData = KDE::AboutData.new("menuapp3", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
+
diff --git a/korundum/rubylib/templates/annotated/menuapp3ui.rc b/korundum/rubylib/templates/annotated/menuapp3ui.rc
new file mode 100644
index 00000000..60120e21
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/menuapp3ui.rc
@@ -0,0 +1,24 @@
+<!DOCTYPE kpartgui>
+<kpartgui name = "menuapp3">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name ="newAction"/>
+ <Action name ="openAction"/>
+ <Action name ="saveAction"/>
+ <Action name ="saveAsAction"/>
+ <Action name ="printAction"/>
+ <Action name ="quitAction"/>
+ </Menu>
+ <Menu name = "edit"><text>&amp;Edit</text>
+ <Action name ="undoAction"/>
+ <Action name ="redoAction"/>
+ <Action name ="cutAction"/>
+ <Action name ="copyAction"/>
+ <Action name ="pasteAction"/>
+ <Action name ="findAction"/>
+ <Action name ="findNextAction"/>
+ <Action name ="replaceAction"/>
+ <Action name ="specialActionName"/>
+ </Menu>
+</MenuBar>
+</kpartgui> \ No newline at end of file
diff --git a/korundum/rubylib/templates/annotated/minimal.rb b/korundum/rubylib/templates/annotated/minimal.rb
new file mode 100644
index 00000000..3ac9e23e
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/minimal.rb
@@ -0,0 +1,80 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+This is a minimal PyKDE app template - it constructs an application
+and a main window, but does nothing else.
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+
+=begin
+Most Korundum applications will need a main window - the is the top
+level widget (the parent for all other widgets). KDE::MainWindow has
+more functionality than shown here (see more complex templates).
+It has the ability to create the other major parts of the user
+interface - the main view, menus, toolbars, etc.
+
+Usually you provide a subclass of KDE::MainWindow, construct menus
+and toolbars in the subclass' initialize method, and provide
+slots for menu/toolbar actions in separate methods.
+=end
+class MainWin < KDE::MainWindow
+ def initialize(*args)
+ super
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+# instantiate KDE::Application - no other Qt::Object
+# or Qt::Widget based classes can be instantiated
+# until there is a KDE::Application instance
+appName = "template"
+about = KDE::AboutData.new(appName, "A minimal application", "0.1")
+KDE::CmdLineArgs.init(ARGV, about)
+app = KDE::Application.new()
+
+# instantiate the subclass of KMainWindow
+mainWindow = MainWin.new(nil, "main window")
+
+# create the display
+mainWindow.show
+
+# run KDE::Application's event loop until the
+# program exits
+app.exec
+
+
diff --git a/korundum/rubylib/templates/annotated/systray1.rb b/korundum/rubylib/templates/annotated/systray1.rb
new file mode 100644
index 00000000..daf4f8ff
--- /dev/null
+++ b/korundum/rubylib/templates/annotated/systray1.rb
@@ -0,0 +1,94 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+A basic system tray application - you can combine this with code from
+menuapp2.rb or menuapp3.rb to quickly build a full-blown application
+framework.
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+# This template uses KDE::MainWindow as the main window widget
+# It solves the problem described in systray.rb by using
+# a flag to control the return value from queryClose - if
+# :quit" is signalled from anywhere EXCEPT the system tray
+# icon's menu, @exitFlag == false, and as the return
+# value for queryClose, it stops the application from shutting
+# down; if @exitFlag is true, the application shuts down
+
+class MainWin < KDE::MainWindow
+ slots 'slotQuitSelected()'
+
+ def initialize(*args)
+ super
+
+ @exitFlag = false
+
+ icons = KDE::IconLoader.new()
+
+ # KDE::SystemTray hides or shows its parent when the system tray icon is clicked
+ systray = KDE::SystemTray.new(self)
+ systray.setPixmap(icons.loadIcon("stop", 0))
+ connect(systray, SIGNAL("quitSelected()"), self, SLOT('slotQuitSelected()'))
+ systray.show()
+ end
+
+ # Controls whether or not the application really exits
+ def queryClose()
+ hide()
+ return @exitFlag
+ end
+
+ # Receives the signal emitted when the user selects Quit from the
+ # system tray icon's menu
+ def slotQuitSelected()
+ @exitFlag = true
+ $kapp.quit()
+ end
+end
+
+#-------------------- main ------------------------------------------------
+
+# The usual stuff..
+appName = "template"
+about = KDE::AboutData.new(appName, "A system tray", "0.1")
+KDE::CmdLineArgs.init(ARGV, about)
+app = KDE::Application.new()
+
+mainWindow = MainWin.new(nil, "main window")
+
+mainWindow.show
+app.exec
+
+
diff --git a/korundum/rubylib/templates/basic/basicapp.rb b/korundum/rubylib/templates/basic/basicapp.rb
new file mode 100644
index 00000000..5297c571
--- /dev/null
+++ b/korundum/rubylib/templates/basic/basicapp.rb
@@ -0,0 +1,61 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ def initialize(*args)
+ super
+ end
+
+end
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
+
diff --git a/korundum/rubylib/templates/basic/menuapp1.rb b/korundum/rubylib/templates/basic/menuapp1.rb
new file mode 100644
index 00000000..3c8c9f51
--- /dev/null
+++ b/korundum/rubylib/templates/basic/menuapp1.rb
@@ -0,0 +1,213 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+
+=begin
+This template constructs an application with menus, toolbar and statusbar,
+HOWEVER it is not recommended this template actually be used. It presents
+the "KDE 1.0" method for constructing menus and toolbars - later versions
+of KDE have introduced better(easier and more powerful) methods for
+doing this job - see other menuapp*.rb templates for these methods
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ TOOLBAR_NEW = 1
+ TOOLBAR_OPEN = 2
+ TOOLBAR_SAVE = 3
+ TOOLBAR_CUT = 4
+ TOOLBAR_COPY = 5
+ TOOLBAR_PASTE = 6
+
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ initMenus()
+ initToolBar()
+ initStatusBar()
+ end
+
+ def initMenus()
+ fileMenu = Qt::PopupMenu.new(self)
+
+ # "File" menu items
+ fileMenu.insertItem(i18n("New"), self, SLOT('slotNew()'), Qt::KeySequence.new(KDE::StdAccel.openNew().keyCodeQt()))
+ fileMenu.insertItem(i18n("Open"), self, SLOT('slotOpen()'), Qt::KeySequence.new(KDE::StdAccel.open().keyCodeQt()))
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("Save"), self, SLOT('slotSave()'), Qt::KeySequence.new(KDE::StdAccel.save().keyCodeQt()))
+ fileMenu.insertItem(i18n("SaveAs"), self, SLOT('slotSaveAs()'))
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("Print"), self, SLOT('slotPrint()'), Qt::KeySequence.new(KDE::StdAccel.print().keyCodeQt()))
+ fileMenu.insertSeparator()
+ fileMenu.insertItem(i18n("&Quit"), self, SLOT('slotQuit()'), Qt::KeySequence.new(KDE::StdAccel.quit().keyCodeQt()))
+
+ menuBar().insertItem(i18n("&File"), fileMenu)
+
+ editMenu = Qt::PopupMenu.new(self)
+
+ # "Edit" menu items
+ editMenu.insertItem(i18n("Undo"), self, SLOT('slotUndo()'), Qt::KeySequence.new(KDE::StdAccel.undo().keyCodeQt()))
+ editMenu.insertItem(i18n("Redo"), self, SLOT('slotRedo()'), Qt::KeySequence.new(KDE::StdAccel.redo().keyCodeQt()))
+ editMenu.insertSeparator()
+ editMenu.insertItem(i18n("Cut"), self, SLOT('slotCut()'), Qt::KeySequence.new(KDE::StdAccel.cut().keyCodeQt()))
+ editMenu.insertItem(i18n("Copy"), self, SLOT('slotCopy()'), Qt::KeySequence.new(KDE::StdAccel.copy().keyCodeQt()))
+ editMenu.insertItem(i18n("Paste"), self, SLOT('slotPaste()'), Qt::KeySequence.new(KDE::StdAccel.paste().keyCodeQt()))
+ editMenu.insertSeparator()
+ editMenu.insertItem(i18n("Find"), self, SLOT('slotFind()'), Qt::KeySequence.new(KDE::StdAccel.find().keyCodeQt()))
+ editMenu.insertItem(i18n("Find Next"), self, SLOT('slotFindNext()'), Qt::KeySequence.new(KDE::StdAccel.findNext().keyCodeQt()))
+ editMenu.insertItem(i18n("Replace"), self, SLOT('slotReplace()'), Qt::KeySequence.new(KDE::StdAccel.replace().keyCodeQt()))
+
+ menuBar().insertItem(i18n("&Edit"), editMenu)
+
+ helpMenu = helpMenu("")
+ menuBar().insertItem(i18n("&Help"), helpMenu)
+ end
+
+ def initToolBar()
+ icons = KDE::IconLoader.new()
+
+ toolBar().insertButton(icons.loadIcon("filenew", KDE::Icon::Toolbar), TOOLBAR_NEW, SIGNAL("clicked(int)"),
+ self, SLOT('slotNew()'), true, "New")
+ toolBar().insertButton(icons.loadIcon("fileopen", KDE::Icon::Toolbar), TOOLBAR_OPEN, SIGNAL("clicked(int)"),
+ self, SLOT('slotOpen()'), true, "Open")
+ toolBar().insertButton(icons.loadIcon("filesave", KDE::Icon::Toolbar), TOOLBAR_SAVE, SIGNAL("clicked(int)"),
+ self, SLOT('slotSave()'), true, "Save")
+ toolBar().insertButton(icons.loadIcon("editcut", KDE::Icon::Toolbar), TOOLBAR_CUT, SIGNAL("clicked(int)"),
+ self, SLOT('slotCut()'), true, "Cut")
+ toolBar().insertButton(icons.loadIcon("editcopy", KDE::Icon::Toolbar), TOOLBAR_COPY, SIGNAL("clicked(int)"),
+ self, SLOT('slotCopy()'), true, "Copy")
+ toolBar().insertButton(icons.loadIcon("editpaste", KDE::Icon::Toolbar), TOOLBAR_PASTE, SIGNAL("clicked(int)"),
+ self, SLOT('slotPaste()'), true, "Paste")
+ end
+
+ def initStatusBar()
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+
+#-------------------- slots -----------------------------------------------
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Qt::uit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
diff --git a/korundum/rubylib/templates/basic/menuapp2.rb b/korundum/rubylib/templates/basic/menuapp2.rb
new file mode 100644
index 00000000..63430fd0
--- /dev/null
+++ b/korundum/rubylib/templates/basic/menuapp2.rb
@@ -0,0 +1,216 @@
+
+=begin
+This template constructs an application with menus, toolbar and statusbar.
+It uses KDE classes and methods that simplify the task of building and
+operating a GUI. It is recommended that this approach be used, rather
+than the primitive approach in menuapp1.py
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+
+
+class MainWin < KDE::MainWindow
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ initActions()
+ initMenus()
+ initToolBar()
+ initStatusBar()
+
+ @saveAction.setEnabled(false)
+ @saveAsAction.setEnabled(false)
+ end
+
+ def initActions()
+ # "File" menu items
+ @newAction = KDE::StdAction.openNew(self, SLOT("slotNew()"), actionCollection())
+ @openAction = KDE::StdAction.open(self, SLOT("slotOpen()"), actionCollection())
+ @saveAction = KDE::StdAction.save(self, SLOT("slotSave()"), actionCollection())
+ @saveAsAction = KDE::StdAction.saveAs(self, SLOT("slotSaveAs()"), actionCollection())
+ @printAction = KDE::StdAction.print(self, SLOT("slotPrint()"), actionCollection())
+ @quitAction = KDE::StdAction.quit(self, SLOT("slotQuit()"), actionCollection())
+
+ # "Edit" menu items
+ @undoAction = KDE::StdAction.undo(self, SLOT("slotUndo()"), actionCollection())
+ @redoAction = KDE::StdAction.redo(self, SLOT("slotRedo()"), actionCollection())
+ @cutAction = KDE::StdAction.cut(self, SLOT("slotCut()"), actionCollection())
+ @copyAction = KDE::StdAction.copy(self, SLOT("slotCopy()"), actionCollection())
+ @pasteAction = KDE::StdAction.paste(self, SLOT("slotPaste()"), actionCollection())
+ @findAction = KDE::StdAction.find(self, SLOT("slotFind()"), actionCollection())
+ @findNextAction = KDE::StdAction.findNext(self, SLOT("slotFindNext()"), actionCollection())
+ @replaceAction = KDE::StdAction.replace(self, SLOT("slotReplace()"), actionCollection())
+ @specialAction = KDE::Action.new(i18n("Special"), KDE::Shortcut.new(0), self, SLOT('slotSpecial()'), actionCollection(), "specialActionName")
+ end
+
+ def initMenus()
+ fileMenu = Qt::PopupMenu.new(self)
+ @newAction.plug(fileMenu)
+ @openAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @saveAction.plug(fileMenu)
+ @saveAsAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @printAction.plug(fileMenu)
+ fileMenu.insertSeparator()
+ @quitAction.plug(fileMenu)
+ menuBar().insertItem(i18n("&File"), fileMenu)
+
+ editMenu = Qt::PopupMenu.new(self)
+ @undoAction.plug(editMenu)
+ @redoAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @cutAction.plug(editMenu)
+ @copyAction.plug(editMenu)
+ @pasteAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @findAction.plug(editMenu)
+ @findNextAction.plug(editMenu)
+ @replaceAction.plug(editMenu)
+ editMenu.insertSeparator()
+ @specialAction.plug(editMenu)
+ menuBar().insertItem(i18n("&Edit"), editMenu)
+
+ helpMenu = helpMenu("")
+ menuBar().insertItem(i18n("&Help"), helpMenu)
+ end
+
+ def initToolBar()
+ @newAction.plug(toolBar())
+ @openAction.plug(toolBar())
+ @saveAction.plug(toolBar())
+ @cutAction.plug(toolBar())
+ @copyAction.plug(toolBar())
+ @pasteAction.plug(toolBar())
+ end
+
+ def initStatusBar()
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+#-------------------- slots -----------------------------------------------
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Quit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
diff --git a/korundum/rubylib/templates/basic/menuapp3.rb b/korundum/rubylib/templates/basic/menuapp3.rb
new file mode 100644
index 00000000..7751e847
--- /dev/null
+++ b/korundum/rubylib/templates/basic/menuapp3.rb
@@ -0,0 +1,174 @@
+=begin
+This template constructs an application with menus, toolbar and statusbar.
+It uses an XML file(menuapp3ui.rc) to specify the menu layout; all menu
+items have a corresponding action defined, but no menus are created
+explicitly in code. This app has the same menu layout as menuapp2.py
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ STATUSBAR_LEFT = 1
+ STATUSBAR_MIDDLE = 2
+ STATUSBAR_RIGHT = 3
+
+ slots 'slotNew()', 'slotOpen()', 'slotSave()', 'slotSaveAs()', 'slotPrint()', 'slotQuit()', 'slotUndo()',
+ 'slotRedo()', 'slotCut()', 'slotCopy()', 'slotPaste()', 'slotFind()', 'slotFindNext()', 'slotReplace()',
+ 'slotSpecial()'
+
+ def initialize(*args)
+ super
+
+ initActions()
+ createGUI()
+ initStatusBar()
+
+ @saveAction.setEnabled(false)
+ @saveAsAction.setEnabled(false)
+ end
+
+ def initActions()
+ # "File" menu items
+ @newAction = KDE::StdAction.openNew(self, SLOT("slotNew()"), actionCollection())
+ @openAction = KDE::StdAction.open(self, SLOT("slotOpen()"), actionCollection())
+ @saveAction = KDE::StdAction.save(self, SLOT("slotSave()"), actionCollection())
+ @saveAsAction = KDE::StdAction.saveAs(self, SLOT("slotSaveAs()"), actionCollection())
+ @printAction = KDE::StdAction.print(self, SLOT("slotPrint()"), actionCollection())
+ @quitAction = KDE::StdAction.quit(self, SLOT("slotQuit()"), actionCollection())
+
+
+ # "Edit" menu items
+ @undoAction = KDE::StdAction.undo(self, SLOT("slotUndo()"), actionCollection())
+ @redoAction = KDE::StdAction.redo(self, SLOT("slotRedo()"), actionCollection())
+ @cutAction = KDE::StdAction.cut(self, SLOT("slotCut()"), actionCollection())
+ @copyAction = KDE::StdAction.copy(self, SLOT("slotCopy()"), actionCollection())
+ @pasteAction = KDE::StdAction.paste(self, SLOT("slotPaste()"), actionCollection())
+ @findAction = KDE::StdAction.find(self, SLOT("slotFind()"), actionCollection())
+ @findNextAction = KDE::StdAction.findNext(self, SLOT("slotFindNext()"), actionCollection())
+ @replaceAction = KDE::StdAction.replace(self, SLOT("slotReplace()"), actionCollection())
+ @specialAction = KDE::Action.new(i18n("Special"), KDE::Shortcut.new(0), self, SLOT('slotSpecial()'), actionCollection(), "specialActionName")
+ end
+
+ def initStatusBar()
+ statusBar().insertItem("", STATUSBAR_LEFT, 1000, true)
+ statusBar().insertItem("", STATUSBAR_MIDDLE, 1000, true)
+ statusBar().insertItem("", STATUSBAR_RIGHT, 1000, true)
+ end
+
+#-------------------- slots -----------------------------------------------
+
+
+ def slotNew(id = -1)
+ notImpl("New")
+ end
+
+ def slotOpen(id = -1)
+ notImpl("Open")
+ end
+
+ def slotSave(id = -1)
+ notImpl("Save")
+ end
+
+ def slotSaveAs()
+ notImpl("Save As")
+ end
+
+ def slotPrint()
+ notImpl("Print")
+ end
+
+ def slotQuit()
+ notImpl("Quit")
+ end
+
+ def slotUndo()
+ notImpl("Undo")
+ end
+
+ def slotRedo()
+ notImpl("Redo")
+ end
+
+ def slotCut(id = -1)
+ notImpl("Cut")
+ end
+
+ def slotCopy(id = -1)
+ notImpl("Copy")
+ end
+
+ def slotPaste(id = -1)
+ notImpl("Paste")
+ end
+
+ def slotFind()
+ notImpl("Find")
+ end
+
+ def slotFindNext()
+ notImpl("Find Next")
+ end
+
+ def slotReplace()
+ notImpl("Replace")
+ end
+
+ def notImpl(item = "Feature")
+ statusBar().changeItem("#{item} not implemented", STATUSBAR_LEFT)
+ KDE::MessageBox.error(self, "#{item} not implemented", "Not Implemented")
+ statusBar().changeItem("", STATUSBAR_LEFT)
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+description = "A basic application template"
+version = "1.0"
+aboutData = KDE::AboutData.new("menuapp3", "",
+ version, description, KDE::AboutData::License_GPL,
+ "(C) 2003 whoever the author is")
+
+aboutData.addAuthor("author1", "whatever they did", "email@somedomain")
+aboutData.addAuthor("author2", "they did something else", "another@email.address")
+
+KDE::CmdLineArgs.init(ARGV, aboutData)
+
+KDE::CmdLineArgs.addCmdLineOptions([["+files", "File to open", ""]])
+
+app = KDE::Application.new()
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
+
diff --git a/korundum/rubylib/templates/basic/menuapp3ui.rc b/korundum/rubylib/templates/basic/menuapp3ui.rc
new file mode 100644
index 00000000..60120e21
--- /dev/null
+++ b/korundum/rubylib/templates/basic/menuapp3ui.rc
@@ -0,0 +1,24 @@
+<!DOCTYPE kpartgui>
+<kpartgui name = "menuapp3">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name ="newAction"/>
+ <Action name ="openAction"/>
+ <Action name ="saveAction"/>
+ <Action name ="saveAsAction"/>
+ <Action name ="printAction"/>
+ <Action name ="quitAction"/>
+ </Menu>
+ <Menu name = "edit"><text>&amp;Edit</text>
+ <Action name ="undoAction"/>
+ <Action name ="redoAction"/>
+ <Action name ="cutAction"/>
+ <Action name ="copyAction"/>
+ <Action name ="pasteAction"/>
+ <Action name ="findAction"/>
+ <Action name ="findNextAction"/>
+ <Action name ="replaceAction"/>
+ <Action name ="specialActionName"/>
+ </Menu>
+</MenuBar>
+</kpartgui> \ No newline at end of file
diff --git a/korundum/rubylib/templates/basic/minimal.rb b/korundum/rubylib/templates/basic/minimal.rb
new file mode 100644
index 00000000..555875a2
--- /dev/null
+++ b/korundum/rubylib/templates/basic/minimal.rb
@@ -0,0 +1,56 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+
+
+class MainWin < KDE::MainWindow
+ def initialize(*args)
+ super
+ end
+end
+
+
+#-------------------- main ------------------------------------------------
+
+appName = "template"
+about = KDE::AboutData.new(appName, "A minimal application", "0.1")
+KDE::CmdLineArgs.init(ARGV, about)
+app = KDE::Application.new()
+
+mainWindow = MainWin.new(nil, "main window")
+mainWindow.show
+app.exec
+
+
diff --git a/korundum/rubylib/templates/basic/systray1.rb b/korundum/rubylib/templates/basic/systray1.rb
new file mode 100644
index 00000000..34f26f04
--- /dev/null
+++ b/korundum/rubylib/templates/basic/systray1.rb
@@ -0,0 +1,75 @@
+=begin
+This is a ruby version of Jim Bublitz's pykde program, translated by Richard Dale
+=end
+
+=begin
+Copyright 2003 Jim Bublitz
+
+Terms and Conditions
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KDE::IND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Except as contained in this notice, the name of the copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from the
+copyright holder.
+=end
+
+require 'Korundum'
+
+class MainWin < KDE::MainWindow
+ slots 'slotQuitSelected()'
+
+ def initialize(*args)
+ super
+
+ @exitFlag = false
+
+ icons = KDE::IconLoader.new()
+
+ systray = KDE::SystemTray.new(self)
+ systray.setPixmap(icons.loadIcon("stop", 0))
+ connect(systray, SIGNAL("quitSelected()"), self, SLOT('slotQuitSelected()'))
+ systray.show()
+ end
+
+ def queryClose()
+ hide()
+ return @exitFlag
+ end
+
+ def slotQuitSelected()
+ @exitFlag = true
+ $kapp.quit()
+ end
+end
+
+#-------------------- main ------------------------------------------------
+
+appName = "template"
+about = KDE::AboutData.new(appName, "A system tray", "0.1")
+KDE::CmdLineArgs.init(ARGV, about)
+app = KDE::Application.new()
+
+mainWindow = MainWin.new(nil, "main window")
+
+mainWindow.show
+app.exec
+
+