diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
commit | 6392f5a9dfce2bf83617d49bb7f332181ec6004e (patch) | |
tree | ab69e390f7962b7e7dda1a3a64f035c61c751cf4 /languages/cpp/app_templates/tdeapp/appview.cpp | |
parent | aba2788b428dc53243407902e9ccbb20b97a69fd (diff) | |
download | tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.tar.gz tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.zip |
Revert "Finish renaming tdevelop components"
This reverts commit 722ce1efbac31c61b1d4b13f7e075c9f311e3e73.
Diffstat (limited to 'languages/cpp/app_templates/tdeapp/appview.cpp')
-rw-r--r-- | languages/cpp/app_templates/tdeapp/appview.cpp | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/languages/cpp/app_templates/tdeapp/appview.cpp b/languages/cpp/app_templates/tdeapp/appview.cpp deleted file mode 100644 index 16c05a3f..00000000 --- a/languages/cpp/app_templates/tdeapp/appview.cpp +++ /dev/null @@ -1,107 +0,0 @@ -%{CPP_TEMPLATE} - -#include "%{APPNAMELC}view.h" - -#include <tqpainter.h> -#include <tqlayout.h> - -#include <kurl.h> - -#include <ktrader.h> -#include <klibloader.h> -#include <tdemessagebox.h> -#include <krun.h> -#include <tdelocale.h> - -%{APPNAME}View::%{APPNAME}View(TQWidget *parent) - : TQWidget(parent), - DCOPObject("%{APPNAME}Iface") -{ - // setup our layout manager to automatically add our widgets - TQHBoxLayout *top_layout = new TQHBoxLayout(this); - top_layout->setAutoAdd(true); - - // we want to look for all components that satisfy our needs. the - // trader will actually search through *all* registered TDE - // applications and components -- not just KParts. So we have to - // specify two things: a service type and a constraint - // - // the service type is like a mime type. we say that we want all - // applications and components that can handle HTML -- 'text/html' - // - // however, by itself, this will return such things as Netscape.. - // not what we wanted. so we constrain it by saying that the - // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes - // field. with this, only components of the type we want will be - // returned. - TDETrader::OfferList offers = TDETrader::self()->query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes"); - - KLibFactory *factory = 0; - // in theory, we only care about the first one.. but let's try all - // offers just in case the first can't be loaded for some reason - TDETrader::OfferList::Iterator it(offers.begin()); - for( ; it != offers.end(); ++it) - { - KService::Ptr ptr = (*it); - - // we now know that our offer can handle HTML and is a part. - // since it is a part, it must also have a library... let's try to - // load that now - factory = KLibLoader::self()->factory( ptr->library() ); - if (factory) - { - m_html = static_cast<KParts::ReadOnlyPart *>(factory->create(this, ptr->name(), "KParts::ReadOnlyPart")); - break; - } - } - - // if our factory is invalid, then we never found our component - // and we might as well just exit now - if (!factory) - { - KMessageBox::error(this, i18n("Could not find a suitable HTML component")); - return; - } - - connect(m_html, TQT_SIGNAL(setWindowCaption(const TQString&)), - this, TQT_SLOT(slotSetTitle(const TQString&))); - connect(m_html, TQT_SIGNAL(setStatusBarText(const TQString&)), - this, TQT_SLOT(slotOnURL(const TQString&))); - -} - -%{APPNAME}View::~%{APPNAME}View() -{ -} - -void %{APPNAME}View::print(TQPainter *p, int height, int width) -{ - // do the actual printing, here - // p->drawText(etc..) -} - -TQString %{APPNAME}View::currentURL() -{ - return m_html->url().url(); -} - -void %{APPNAME}View::openURL(TQString url) -{ - openURL(KURL(url)); -} - -void %{APPNAME}View::openURL(const KURL& url) -{ - m_html->openURL(url); -} - -void %{APPNAME}View::slotOnURL(const TQString& url) -{ - emit signalChangeStatusbar(url); -} - -void %{APPNAME}View::slotSetTitle(const TQString& title) -{ - emit signalChangeCaption(title); -} -#include "%{APPNAMELC}view.moc" |