From e9638a300c509773908226ef2299f2f2b83a1f55 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 27 Jan 2015 18:42:31 +0900 Subject: Moved TDEFileReplace to tdeutils. This resolves bug 767. Signed-off-by: Michele Calgaro --- tdefilereplace/tdefilereplace.cpp | 111 -------------------------------------- 1 file changed, 111 deletions(-) delete mode 100644 tdefilereplace/tdefilereplace.cpp (limited to 'tdefilereplace/tdefilereplace.cpp') diff --git a/tdefilereplace/tdefilereplace.cpp b/tdefilereplace/tdefilereplace.cpp deleted file mode 100644 index 8cb7d332..00000000 --- a/tdefilereplace/tdefilereplace.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/*************************************************************************** - tdefilereplace.cpp - TDEFileReplace shell implementation - ------------------- - begin : Thu Sep 16 14:14:09 2004 - copyright : (C) 2004 by Andras Mantia - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -//kde includes -#include -#include -#include -#include -#include - -//app includes -#include "tdefilereplace.h" - -TDEFileReplace::TDEFileReplace() - : KParts::MainWindow(0L, "TDEFileReplace") -{ - KLibFactory *factory = KLibLoader::self()->factory("libtdefilereplacepart"); - if (factory) - { - m_part = static_cast(factory->create(TQT_TQOBJECT(this), - "tdefilereplace_part", "KParts::ReadOnlyPart" )); - - if (m_part) - { - setCentralWidget(m_part->widget()); - KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureToolbars()), actionCollection()); - setStandardToolBarMenuEnabled(true); - createGUI(m_part); - removeDuplicatedActions(); - } - } - else - { - KMessageBox::error(this, i18n("Could not find the TDEFileReplace part.")); - close(); - return; - } -} - - -TDEFileReplace::~TDEFileReplace() -{ -} - -void TDEFileReplace::openURL(const KURL &url) -{ - m_part->openURL(url); -} - -void TDEFileReplace::slotConfigureKeys() -{ - KKeyDialog dlg( false, this ); - TQPtrList clients = guiFactory()->clients(); - for( TQPtrListIterator it( clients ); - it.current(); ++it ) - { - dlg.insert( (*it)->actionCollection() ); - } - dlg.configure(); -} - -void TDEFileReplace::slotConfigureToolbars() -{ - saveMainWindowSettings(TDEGlobal::config(), autoSaveGroup()); - KEditToolbar dlg(factory()); - connect(&dlg, TQT_SIGNAL(newToolbarConfig()), - this, TQT_SLOT(applyNewToolbarConfig())); - dlg.exec(); -} - -void TDEFileReplace::applyNewToolbarConfig() -{ - applyMainWindowSettings(TDEGlobal::config(), autoSaveGroup()); -} - - -void TDEFileReplace::removeDuplicatedActions() -{ - TDEActionCollection* part_action_collection = m_part->actionCollection(); - TDEAction* part_about_action = part_action_collection->action("help_about_tdefilereplace"); - TDEAction* part_report_action = part_action_collection->action("report_bug"); - TDEAction* part_help_action= part_action_collection->action("help_tdefilereplace"); - - if (!part_about_action || !part_report_action || !part_help_action || !part_action_collection) - return; - - TQWidget* container = part_about_action->container(0); - part_about_action->unplug(container); - part_report_action->unplug(container); - part_help_action->unplug(container); - part_action_collection->remove(part_about_action); - part_action_collection->remove(part_report_action); - part_action_collection->remove(part_help_action); -} - -#include "tdefilereplace.moc" -- cgit v1.2.3