From 2d84c9d3ad0aaea0620658024537d54e6a7939f4 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:00 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- korundum/bin/Makefile.am | 2 +- korundum/rubylib/examples/RubberDoc.rb | 26 ++-- korundum/rubylib/examples/uikmdi.rb | 187 ------------------------ korundum/rubylib/examples/uikmdi.rc | 11 -- korundum/rubylib/examples/uitdemdi.rb | 187 ++++++++++++++++++++++++ korundum/rubylib/examples/uitdemdi.rc | 11 ++ korundum/rubylib/korundum/Korundum.cpp | 6 +- korundum/rubylib/korundum/kdehandlers.cpp | 6 +- korundum/rubylib/rbkconfig_compiler/Makefile.am | 2 +- 9 files changed, 219 insertions(+), 219 deletions(-) delete mode 100644 korundum/rubylib/examples/uikmdi.rb delete mode 100644 korundum/rubylib/examples/uikmdi.rc create mode 100644 korundum/rubylib/examples/uitdemdi.rb create mode 100644 korundum/rubylib/examples/uitdemdi.rc (limited to 'korundum') diff --git a/korundum/bin/Makefile.am b/korundum/bin/Makefile.am index 4c3e637c..69813941 100644 --- a/korundum/bin/Makefile.am +++ b/korundum/bin/Makefile.am @@ -1,7 +1,7 @@ INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS) bin_PROGRAMS = krubyinit -krubyinit_LDFLAGS = -module $(all_libraries) -version-info 0:0:0 -L$(top_srcdir)/smoke/kde/ -L$(RUBY_LIBDIR) -lkmdi -lknewstuff +krubyinit_LDFLAGS = -module $(all_libraries) -version-info 0:0:0 -L$(top_srcdir)/smoke/kde/ -L$(RUBY_LIBDIR) -ltdemdi -lknewstuff krubyinit_METASOURCES = AUTO krubyinit_SOURCES = krubyinit.cpp krubyinit_LDADD = $(LIB_KDE) $(RUBY_LIBRUBYARG) $(top_builddir)/smoke/kde/libsmokekde.la $(top_builddir)/qtruby/rubylib/qtruby/libqtrubyinternal.la diff --git a/korundum/rubylib/examples/RubberDoc.rb b/korundum/rubylib/examples/RubberDoc.rb index 1b196999..a5cc35cb 100755 --- a/korundum/rubylib/examples/RubberDoc.rb +++ b/korundum/rubylib/examples/RubberDoc.rb @@ -183,7 +183,7 @@ module MyGui TQt::Object.connect @listbox, SIGNAL("clicked(TQListBoxItem*)"), self, SLOT("clicked_result(TQListBoxItem*)") TQt::Object.connect @viewed, SIGNAL("completed()"), - self, SLOT("khtml_part_init_complete()") + self, SLOT("tdehtml_part_init_complete()") TQt::Object::connect @viewed, SIGNAL("setWindowCaption(const TQString&)"), @viewed.widget.topLevelWidget, @@ -501,7 +501,7 @@ module HTMLIndexer end -# TODO - this sucks, use khtml to get the values +# TODO - this sucks, use tdehtml to get the values module IDS A = 1 META = 62 @@ -865,7 +865,7 @@ end class RubberDoc < TQt::VBox - slots "khtml_part_init_complete()", + slots "tdehtml_part_init_complete()", "go_back()", "go_forward()", "go_home()", "goto_url()", "goto_search()", "clicked_result(TQListBoxItem*)", "search(const TQString&)", "update_highlight()", @@ -926,20 +926,20 @@ class RubberDoc < TQt::VBox def blah_blah save_indexes init_blah - khtml_part_init_complete + tdehtml_part_init_complete end def quit @main.close end - def khtml_part_init_complete + def tdehtml_part_init_complete TQt::Object.disconnect @viewed, SIGNAL("completed()"), - self, SLOT("khtml_part_init_complete()") if @init_connected + self, SLOT("tdehtml_part_init_complete()") if @init_connected @pref = File.dirname first_url.url.gsub("file:","") - init_khtml_part_settings @viewed if @init_connected + init_tdehtml_part_settings @viewed if @init_connected index_documents # maybe make a better choice as to the start page??? @@ -959,11 +959,11 @@ class RubberDoc < TQt::VBox save_indexes end - def init_khtml_part_settings khtmlpart - khtmlpart.setJScriptEnabled true - khtmlpart.setJavaEnabled false - khtmlpart.setPluginsEnabled false - khtmlpart.setAutoloadImages false + def init_tdehtml_part_settings tdehtmlpart + tdehtmlpart.setJScriptEnabled true + tdehtmlpart.setJavaEnabled false + tdehtmlpart.setPluginsEnabled false + tdehtmlpart.setAutoloadImages false end def load_page @@ -1248,7 +1248,7 @@ can't get tabwidget working. umm... wonder what i'm messing up... (RECHECK) # possible BUG DOM::Text.new(node).data.string # strange that this one doesn't work... (RECHECK) -wierd khtml bug +wierd tdehtml bug @rightpane.setResizeMode @viewed, TQt::Splitter::KeepSize in order to use KURL's as constants one must place this TDEApplication init diff --git a/korundum/rubylib/examples/uikmdi.rb b/korundum/rubylib/examples/uikmdi.rb deleted file mode 100644 index e73422eb..00000000 --- a/korundum/rubylib/examples/uikmdi.rb +++ /dev/null @@ -1,187 +0,0 @@ - -=begin -This is a ruby version of Jim Bublitz's python original. The ruby behaviour -is 'crash for crash' identical - so the the problems described below are -related to KMDI, and not the bindings. -=end - -=begin -A rough Python translation of the ideas presented in this KMDI tutorial: - - http://web.tiscali.it/andreabergia/kmditutorial.html - -What does work: - - IDEAlMode - yay! - - Adding and closing child views - - Two-way syncing between a tool widget and a matching child view - -All is not rosy, however: - - Instances of the KmdiExample maintain a dictionary of child views. Values - cannot be deleted from this dictionary during a window close (causes an - immediate segfault). - - Child views created after initialization aren't numbered correctly; given - the first problem, it's harder to do this than it's really worth. - - The example segfaults at shutdown if the tool (on the left) is is open but - is not in overlap-mode. - -=end - -require 'Korundum' -include KDE - -class KmdiExample < KDE::MdiMainFrm - - slots 'closeChild(KMdiChildView*)', - 'syncFromChildView(KMdiChildView*)', - 'syncFromMainTool(TQListBoxItem*)', - 'activatedMessage(KMdiChildView*)', - 'newView()', 'close()', 'closeActiveChild()' - - def getIcon(name, group=Icon::NoGroup, size=Icon::SizeSmall) - # returns a kde icon by name - return Global.instance().iconLoader().loadIcon(name, group, size) - end - - def initialize(parent=nil) - super(parent, 'KmdiExample', Mdi::IDEAlMode) - - @viewIcons = ['network', 'email', 'stop', 'back', 'forward'] - @toolIcons = ['view_icon', 'configure'] - - openNewAction = StdAction.openNew(self, SLOT('newView()'), actionCollection()) - quitAction = StdAction.quit(self, SLOT('close()'), actionCollection()) - closeAction = StdAction.close(self, SLOT('closeActiveChild()'), actionCollection()) - - uifilebase = Dir.getwd + '/uikmdi.rc' - createGUI(uifilebase) - # The task bar is created in the KMdiMainFrm constructor - # and then deleted in the createGUI() call above.. - # So recreate it again to avoid a crash. - createTaskBar() - statusBar() - resize(400, 300) - - @tools = {} - @toolIcons.each_index do |idx| - ico = @toolIcons[idx] - wid = KDE::ListBox.new(self, "list#{idx.to_s}") - makeTool(wid, "Tool #{idx.to_s}", ico) - end - ## smells - @mainToolWidget = @maintool = @tools['Tool 0'][0] - - @childs = {} - @viewIcons.each_index do |idx| - ico = @viewIcons[idx] - makeView("View #{idx.to_s}", ico, ico) - end - - connect(self, SIGNAL('viewActivated(KMdiChildView*)'), self, SLOT('activatedMessage(KMdiChildView*)')) - connect(self, SIGNAL('viewActivated(KMdiChildView*)'), self, SLOT('syncFromChildView(KMdiChildView*)')) - connect(@maintool, SIGNAL('selectionChanged(TQListBoxItem*)'), self, SLOT('syncFromMainTool(TQListBoxItem*)')) - syncFromChildView(activeWindow()) - end - - def syncFromMainTool(item) - # activate the view that matches the item text - activateView(findWindow(item.text())) - end - - def syncFromChildView(child) - # sync the main tool to the indicated child - @maintool = @mainToolWidget - if child.nil? - return - end - item = @maintool.findItem(child.tabCaption()) - if !item.nil? - @maintool.setSelected(item, nil) - end - end - - def makeTool(widget, caption, icon, percent=50) - # makes a tool from the widget - tip = i18n("#{caption} Tool Tip") - dock = DockWidget::DockLeft - maindock = getMainDockWidget() - widget.setIcon(getIcon(icon)) - tool = addToolWindow(widget, dock, maindock, percent, tip, caption) - @tools[caption] = [widget, tool] - end - - def makeView(label, icon, text) - # makes a child view with a text label and a pixmap label - view = MdiChildView.new(label, self) - @childs[label] = view - view.setIcon(getIcon(icon)) - layout = TQt::VBoxLayout.new(view) - layout.setAutoAdd(true) - - lbl = TQt::Label.new(i18n("Label for a view with an icon named #{text}"), view) - pxm = TQt::Label.new('', view) - pxm.setPixmap(getIcon(icon, Icon::NoGroup, KDE::Icon::SizeLarge)) - addWindow(view) - @mainToolWidget.insertItem(label) - connect(view, SIGNAL('childWindowCloseRequest(KMdiChildView*)'), self, SLOT('closeChild(KMdiChildView*)')) - end - - def removeMainToolItem(view) - # remove item from the main list tool that corresponds to the view - @maintool = @mainToolWidget - @maintool.takeItem(@maintool.findItem(view.tabCaption(), 0)) - end - - def newView() - # make a view when the user invokes the new action - makeView("View ", 'network', 'A Fresh View') -# makeView("View #{@childs.length}", 'network', 'A Fresh View') - syncFromChildView(activeWindow()) - end - - def closeActiveChild() - # close the current view - removeMainToolItem(activeWindow()) - closeActiveView() - syncFromChildView(activeWindow()) - end - - def closeChild(which) - # called to close a view from its tab close button - caption = which.tabCaption() - removeMainToolItem(which) - which.close() - statusBar().message(i18n("#{caption} closed")) - syncFromChildView(activeWindow()) - end - - def activatedMessage(view) - # updates the status bar with the caption of the current view - statusBar().message(i18n("#{view.tabCaption()} activated")) - end -end - -if $0 == __FILE__ - aname = 'uikmdi' - desc = 'A Simple Korundum KMDI Sample' - ver = '1.0' - lic = AboutData::License_GPL - author = 'Troy Melhase' - authormail = 'troy@gci.net' - - about = AboutData.new(aname, aname, ver, desc, lic, "#{authormail} (c) 2004") - about.addAuthor(author, 'hi, mom!', authormail) - about.addAuthor('Jim Bublitz', 'For PyKDE', 'jbublitz@nwinternet.com') - about.addAuthor('Richard Dale', 'For Korundum', 'Richard_Dale@tipitina.demon.co.uk') - CmdLineArgs.init(ARGV, about) - app = KDE::Application.new - mainWindow = KmdiExample.new - mainWindow.show - app.exec -end - diff --git a/korundum/rubylib/examples/uikmdi.rc b/korundum/rubylib/examples/uikmdi.rc deleted file mode 100644 index a7e21969..00000000 --- a/korundum/rubylib/examples/uikmdi.rc +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/korundum/rubylib/examples/uitdemdi.rb b/korundum/rubylib/examples/uitdemdi.rb new file mode 100644 index 00000000..3b67b9e1 --- /dev/null +++ b/korundum/rubylib/examples/uitdemdi.rb @@ -0,0 +1,187 @@ + +=begin +This is a ruby version of Jim Bublitz's python original. The ruby behaviour +is 'crash for crash' identical - so the the problems described below are +related to KMDI, and not the bindings. +=end + +=begin +A rough Python translation of the ideas presented in this KMDI tutorial: + + http://web.tiscali.it/andreabergia/tdemditutorial.html + +What does work: + + IDEAlMode - yay! + + Adding and closing child views + + Two-way syncing between a tool widget and a matching child view + +All is not rosy, however: + + Instances of the KmdiExample maintain a dictionary of child views. Values + cannot be deleted from this dictionary during a window close (causes an + immediate segfault). + + Child views created after initialization aren't numbered correctly; given + the first problem, it's harder to do this than it's really worth. + + The example segfaults at shutdown if the tool (on the left) is is open but + is not in overlap-mode. + +=end + +require 'Korundum' +include KDE + +class KmdiExample < KDE::MdiMainFrm + + slots 'closeChild(KMdiChildView*)', + 'syncFromChildView(KMdiChildView*)', + 'syncFromMainTool(TQListBoxItem*)', + 'activatedMessage(KMdiChildView*)', + 'newView()', 'close()', 'closeActiveChild()' + + def getIcon(name, group=Icon::NoGroup, size=Icon::SizeSmall) + # returns a kde icon by name + return Global.instance().iconLoader().loadIcon(name, group, size) + end + + def initialize(parent=nil) + super(parent, 'KmdiExample', Mdi::IDEAlMode) + + @viewIcons = ['network', 'email', 'stop', 'back', 'forward'] + @toolIcons = ['view_icon', 'configure'] + + openNewAction = StdAction.openNew(self, SLOT('newView()'), actionCollection()) + quitAction = StdAction.quit(self, SLOT('close()'), actionCollection()) + closeAction = StdAction.close(self, SLOT('closeActiveChild()'), actionCollection()) + + uifilebase = Dir.getwd + '/uitdemdi.rc' + createGUI(uifilebase) + # The task bar is created in the KMdiMainFrm constructor + # and then deleted in the createGUI() call above.. + # So recreate it again to avoid a crash. + createTaskBar() + statusBar() + resize(400, 300) + + @tools = {} + @toolIcons.each_index do |idx| + ico = @toolIcons[idx] + wid = KDE::ListBox.new(self, "list#{idx.to_s}") + makeTool(wid, "Tool #{idx.to_s}", ico) + end + ## smells + @mainToolWidget = @maintool = @tools['Tool 0'][0] + + @childs = {} + @viewIcons.each_index do |idx| + ico = @viewIcons[idx] + makeView("View #{idx.to_s}", ico, ico) + end + + connect(self, SIGNAL('viewActivated(KMdiChildView*)'), self, SLOT('activatedMessage(KMdiChildView*)')) + connect(self, SIGNAL('viewActivated(KMdiChildView*)'), self, SLOT('syncFromChildView(KMdiChildView*)')) + connect(@maintool, SIGNAL('selectionChanged(TQListBoxItem*)'), self, SLOT('syncFromMainTool(TQListBoxItem*)')) + syncFromChildView(activeWindow()) + end + + def syncFromMainTool(item) + # activate the view that matches the item text + activateView(findWindow(item.text())) + end + + def syncFromChildView(child) + # sync the main tool to the indicated child + @maintool = @mainToolWidget + if child.nil? + return + end + item = @maintool.findItem(child.tabCaption()) + if !item.nil? + @maintool.setSelected(item, nil) + end + end + + def makeTool(widget, caption, icon, percent=50) + # makes a tool from the widget + tip = i18n("#{caption} Tool Tip") + dock = DockWidget::DockLeft + maindock = getMainDockWidget() + widget.setIcon(getIcon(icon)) + tool = addToolWindow(widget, dock, maindock, percent, tip, caption) + @tools[caption] = [widget, tool] + end + + def makeView(label, icon, text) + # makes a child view with a text label and a pixmap label + view = MdiChildView.new(label, self) + @childs[label] = view + view.setIcon(getIcon(icon)) + layout = TQt::VBoxLayout.new(view) + layout.setAutoAdd(true) + + lbl = TQt::Label.new(i18n("Label for a view with an icon named #{text}"), view) + pxm = TQt::Label.new('', view) + pxm.setPixmap(getIcon(icon, Icon::NoGroup, KDE::Icon::SizeLarge)) + addWindow(view) + @mainToolWidget.insertItem(label) + connect(view, SIGNAL('childWindowCloseRequest(KMdiChildView*)'), self, SLOT('closeChild(KMdiChildView*)')) + end + + def removeMainToolItem(view) + # remove item from the main list tool that corresponds to the view + @maintool = @mainToolWidget + @maintool.takeItem(@maintool.findItem(view.tabCaption(), 0)) + end + + def newView() + # make a view when the user invokes the new action + makeView("View ", 'network', 'A Fresh View') +# makeView("View #{@childs.length}", 'network', 'A Fresh View') + syncFromChildView(activeWindow()) + end + + def closeActiveChild() + # close the current view + removeMainToolItem(activeWindow()) + closeActiveView() + syncFromChildView(activeWindow()) + end + + def closeChild(which) + # called to close a view from its tab close button + caption = which.tabCaption() + removeMainToolItem(which) + which.close() + statusBar().message(i18n("#{caption} closed")) + syncFromChildView(activeWindow()) + end + + def activatedMessage(view) + # updates the status bar with the caption of the current view + statusBar().message(i18n("#{view.tabCaption()} activated")) + end +end + +if $0 == __FILE__ + aname = 'uitdemdi' + desc = 'A Simple Korundum KMDI Sample' + ver = '1.0' + lic = AboutData::License_GPL + author = 'Troy Melhase' + authormail = 'troy@gci.net' + + about = AboutData.new(aname, aname, ver, desc, lic, "#{authormail} (c) 2004") + about.addAuthor(author, 'hi, mom!', authormail) + about.addAuthor('Jim Bublitz', 'For PyKDE', 'jbublitz@nwinternet.com') + about.addAuthor('Richard Dale', 'For Korundum', 'Richard_Dale@tipitina.demon.co.uk') + CmdLineArgs.init(ARGV, about) + app = KDE::Application.new + mainWindow = KmdiExample.new + mainWindow.show + app.exec +end + diff --git a/korundum/rubylib/examples/uitdemdi.rc b/korundum/rubylib/examples/uitdemdi.rc new file mode 100644 index 00000000..a7e21969 --- /dev/null +++ b/korundum/rubylib/examples/uitdemdi.rc @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/korundum/rubylib/korundum/Korundum.cpp b/korundum/rubylib/korundum/Korundum.cpp index c07c29c5..c6c9a548 100644 --- a/korundum/rubylib/korundum/Korundum.cpp +++ b/korundum/rubylib/korundum/Korundum.cpp @@ -30,7 +30,7 @@ #include #endif #include -#include +#include #include #include @@ -916,8 +916,8 @@ extern VALUE qt_internal_module; extern VALUE qt_base_class; extern VALUE kde_module; extern VALUE kio_module; -extern VALUE kparts_module; -extern VALUE khtml_module; +extern VALUE tdeparts_module; +extern VALUE tdehtml_module; VALUE getdcopinfo(VALUE self, TQString & signalname) diff --git a/korundum/rubylib/korundum/kdehandlers.cpp b/korundum/rubylib/korundum/kdehandlers.cpp index 1e4eb3a4..fa696791 100644 --- a/korundum/rubylib/korundum/kdehandlers.cpp +++ b/korundum/rubylib/korundum/kdehandlers.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/korundum/rubylib/rbkconfig_compiler/Makefile.am b/korundum/rubylib/rbkconfig_compiler/Makefile.am index 7b5bd663..276e32f7 100644 --- a/korundum/rubylib/rbkconfig_compiler/Makefile.am +++ b/korundum/rubylib/rbkconfig_compiler/Makefile.am @@ -12,7 +12,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/tdecore -I$(top_srcdir) $(all_includes) bin_PROGRAMS = rbkconfig_compiler -rbkconfig_compiler_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +rbkconfig_compiler_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor rbkconfig_compiler_LDADD = $(LIB_TDECORE) rbkconfig_compiler_SOURCES = rbkconfig_compiler.cpp -- cgit v1.2.1