diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-26 13:17:21 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-26 13:17:21 -0600 |
commit | dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 (patch) | |
tree | c297348a55df66c571de4525646e0b9762427353 /kparts/tests | |
parent | b7658a0d5eca24a9d37c6e04f88298ef02389db0 (diff) | |
download | tdelibs-dfe289850f068f19ba4a83ab4e7e22a7e09c13c9.tar.gz tdelibs-dfe289850f068f19ba4a83ab4e7e22a7e09c13c9.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'kparts/tests')
-rw-r--r-- | kparts/tests/Makefile.am | 46 | ||||
-rw-r--r-- | kparts/tests/README | 5 | ||||
-rw-r--r-- | kparts/tests/example.cpp | 135 | ||||
-rw-r--r-- | kparts/tests/example.h | 39 | ||||
-rw-r--r-- | kparts/tests/ghostview.cpp | 119 | ||||
-rw-r--r-- | kparts/tests/ghostview.h | 22 | ||||
-rw-r--r-- | kparts/tests/ghostviewtest_shell.rc | 15 | ||||
-rw-r--r-- | kparts/tests/kpartstest_part1.rc | 18 | ||||
-rw-r--r-- | kparts/tests/kpartstest_shell.rc | 28 | ||||
-rw-r--r-- | kparts/tests/normalktm.cpp | 122 | ||||
-rw-r--r-- | kparts/tests/normalktm.h | 38 | ||||
-rw-r--r-- | kparts/tests/notepad.cpp | 101 | ||||
-rw-r--r-- | kparts/tests/notepad.desktop | 86 | ||||
-rw-r--r-- | kparts/tests/notepad.h | 42 | ||||
-rw-r--r-- | kparts/tests/notepadpart.cpp | 5 | ||||
-rw-r--r-- | kparts/tests/notepadpart.rc | 14 | ||||
-rw-r--r-- | kparts/tests/parts.cpp | 90 | ||||
-rw-r--r-- | kparts/tests/parts.h | 43 | ||||
-rw-r--r-- | kparts/tests/plugin_foobar.rc | 12 | ||||
-rw-r--r-- | kparts/tests/plugin_spellcheck.cpp | 39 | ||||
-rw-r--r-- | kparts/tests/plugin_spellcheck.h | 18 | ||||
-rw-r--r-- | kparts/tests/plugin_spellcheck.rc | 15 |
22 files changed, 0 insertions, 1052 deletions
diff --git a/kparts/tests/Makefile.am b/kparts/tests/Makefile.am deleted file mode 100644 index e593cb6da..000000000 --- a/kparts/tests/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ - -INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/libltdl -I$(top_srcdir)/kfile -I$(top_srcdir)/kio $(all_includes) -AM_LDFLAGS = $(all_libraries) -LDADD = $(LIB_KPARTS) - -check_PROGRAMS = kpartstest normalktmtest ghostviewtest - -kpartstest_SOURCES = example.cpp parts.cpp -kpartstest_LDADD = libnotepad.la $(LIB_KPARTS) -normalktmtest_SOURCES = normalktm.cpp parts.cpp -normalktmtest_LDADD = libnotepad.la $(LIB_KPARTS) -ghostviewtest_SOURCES = ghostview.cpp -ghostviewtest_LDADD = $(LIB_KPARTS) - -# These are not really libraries, but modules dynamically opened. -# So they should be installed in kde_module_dir, which is usually $prefix/lib/trinity -kde_module_LTLIBRARIES = libspellcheckplugin.la libnotepadpart.la - -libspellcheckplugin_la_SOURCES = plugin_spellcheck.cpp -libspellcheckplugin_la_LIBADD = $(LIB_KPARTS) -libspellcheckplugin_la_LDFLAGS = -module $(KDE_PLUGIN) - -libnotepadpart_la_SOURCES = notepadpart.cpp -libnotepadpart_la_LIBADD = libnotepad.la $(LIB_KPARTS) -libnotepadpart_la_LDFLAGS = -module $(KDE_PLUGIN) - -noinst_LTLIBRARIES = libnotepad.la -libnotepad_la_SOURCES = notepad.cpp - -rcdir = $(kde_datadir)/kpartstest -rc_DATA = kpartstest_shell.rc - -testpartdir = $(kde_datadir)/kpartstestpart -testpart_DATA = kpartstest_part1.rc - -notepaddir = $(kde_datadir)/notepadpart -notepad_DATA = notepadpart.rc - -ghostviewtestdir = $(kde_datadir)/ghostviewtest -ghostviewtest_DATA = ghostviewtest_shell.rc - -pluginsdir = $(kde_datadir)/notepadpart/kpartplugins -plugins_DATA = plugin_foobar.rc plugin_spellcheck.rc - -METASOURCES = AUTO - diff --git a/kparts/tests/README b/kparts/tests/README deleted file mode 100644 index a0bee7ca6..000000000 --- a/kparts/tests/README +++ /dev/null @@ -1,5 +0,0 @@ -In order to test embedding the notepad part in konqueror, you need -to "make install", to install the libs, and to copy notepad.desktop -into $TDEDIR/share/services/, and remove kwrite.desktop from -$TDEDIR/share/applnk/... (at least the ServiceTypes line of it) - diff --git a/kparts/tests/example.cpp b/kparts/tests/example.cpp deleted file mode 100644 index 4628e8ca7..000000000 --- a/kparts/tests/example.cpp +++ /dev/null @@ -1,135 +0,0 @@ - -#include "example.h" -#include "parts.h" -#include "notepad.h" - -#include <tqsplitter.h> -#include <tqcheckbox.h> -#include <tqdir.h> - -#include <kiconloader.h> -#include <kstandarddirs.h> -#include <kapplication.h> -#include <kmessagebox.h> -#include <kaction.h> -#include <klocale.h> - -Shell::Shell() -{ - setXMLFile( "kpartstest_shell.rc" ); - - m_manager = new KParts::PartManager( this ); - - // When the manager says the active part changes, the builder updates (recreates) the GUI - connect( m_manager, TQT_SIGNAL( activePartChanged( KParts::Part * ) ), - this, TQT_SLOT( createGUI( KParts::Part * ) ) ); - - // We can do this "switch active part" because we have a splitter with - // two items in it. - // I wonder what tdevelop uses/will use to embed kedit, BTW. - m_splitter = new TQSplitter( this ); - - m_part1 = new Part1(this, m_splitter); - m_part2 = new Part2(this, m_splitter); - - KActionCollection *coll = actionCollection(); - - (void)new KAction( "&View local file", 0, this, TQT_SLOT( slotFileOpen() ), coll, "open_local_file" ); - (void)new KAction( "&View remote file", 0, this, TQT_SLOT( slotFileOpenRemote() ), coll, "open_remote_file" ); - - m_paEditFile = new KAction( "&Edit file", 0, this, TQT_SLOT( slotFileEdit() ), coll, "edit_file" ); - m_paCloseEditor = new KAction( "&Close file editor", 0, this, TQT_SLOT( slotFileCloseEditor() ), coll, "close_editor" ); - m_paCloseEditor->setEnabled(false); - KAction * paQuit = new KAction( "&Quit", 0, this, TQT_SLOT( close() ), coll, "shell_quit" ); - paQuit->setIconSet(TQIconSet(BarIcon("exit"))); - - (void)new KAction( "Yet another menu item", 0, coll, "shell_yami" ); - (void)new KAction( "Yet another submenu item", 0, coll, "shell_yasmi" ); - - setCentralWidget( m_splitter ); - m_splitter->setMinimumSize( 400, 300 ); - - m_splitter->show(); - - m_manager->addPart( m_part1, true ); // sets part 1 as the active part - m_manager->addPart( m_part2, false ); - m_editorpart = 0; -} - -Shell::~Shell() -{ - disconnect( m_manager, 0, this, 0 ); -} - -void Shell::slotFileOpen() -{ - if ( ! m_part1->openURL( locate("data", TDEGlobal::instance()->instanceName()+"/kpartstest_shell.rc" ) ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -void Shell::slotFileOpenRemote() -{ - KURL u ( "http://www.kde.org/index.html" ); - if ( ! m_part1->openURL( u ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -void Shell::embedEditor() -{ - if ( m_manager->activePart() == m_part2 ) - createGUI( 0L ); - - // replace part2 with the editor part - delete m_part2; - m_part2 = 0L; - m_editorpart = new NotepadPart( m_splitter, "editor", - this, "NotepadPart" ); - m_editorpart->setReadWrite(); // read-write mode - m_manager->addPart( m_editorpart ); - m_paEditFile->setEnabled(false); - m_paCloseEditor->setEnabled(true); -} - -void Shell::slotFileCloseEditor() -{ - // It is very important to close the url of a read-write part - // before destroying it. This allows to save the document (if modified) - // and also to cancel. - if ( ! m_editorpart->closeURL() ) - return; - - // Is this necessary ? (David) - if ( m_manager->activePart() == m_editorpart ) - createGUI( 0L ); - - delete m_editorpart; - m_editorpart = 0L; - m_part2 = new Part2(this, m_splitter); - m_manager->addPart( m_part2 ); - m_paEditFile->setEnabled(true); - m_paCloseEditor->setEnabled(false); -} - -void Shell::slotFileEdit() -{ - if ( !m_editorpart ) - embedEditor(); - // TODO use KFileDialog to allow testing remote files - if ( ! m_editorpart->openURL( TQDir::current().absPath()+"/kpartstest_shell.rc" ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -int main( int argc, char **argv ) -{ - TDEApplication app( argc, argv, "kpartstest" ); - - Shell *shell = new Shell; - - shell->show(); - - app.exec(); - - return 0; -} - -#include "example.moc" diff --git a/kparts/tests/example.h b/kparts/tests/example.h deleted file mode 100644 index 87c907390..000000000 --- a/kparts/tests/example.h +++ /dev/null @@ -1,39 +0,0 @@ - -#ifndef __example_h__ -#define __example_h__ - -#include <kparts/partmanager.h> -#include <kparts/mainwindow.h> - -class KAction; -class TQWidget; - -class Shell : public KParts::MainWindow -{ - Q_OBJECT -public: - Shell(); - virtual ~Shell(); - -protected slots: - void slotFileOpen(); - void slotFileOpenRemote(); - void slotFileEdit(); - void slotFileCloseEditor(); - -protected: - void embedEditor(); - -private: - - KAction * m_paEditFile; - KAction * m_paCloseEditor; - - KParts::ReadOnlyPart *m_part1; - KParts::Part *m_part2; - KParts::ReadWritePart *m_editorpart; - KParts::PartManager *m_manager; - TQWidget *m_splitter; -}; - -#endif diff --git a/kparts/tests/ghostview.cpp b/kparts/tests/ghostview.cpp deleted file mode 100644 index 5d1bbe5b3..000000000 --- a/kparts/tests/ghostview.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include <kiconloader.h> -#include <kstandarddirs.h> -#include <kapplication.h> -#include <kaction.h> -#include <klocale.h> -#include <kfiledialog.h> -#include <kmessagebox.h> -#include <kcmdlineargs.h> -#include <klibloader.h> - -#include <tqwidget.h> -#include <tqdir.h> -#include <tqfile.h> - -#include <ktrader.h> - -#include "ghostview.h" - -Shell::Shell() -{ - setXMLFile( "ghostviewtest_shell.rc" ); - - KAction * paOpen = new KAction( "&Open file" , "fileopen", 0, this, - TQT_SLOT( slotFileOpen() ), actionCollection(), "file_open" ); - - KAction * paQuit = new KAction( "&Quit" , "exit", 0, this, TQT_SLOT( close() ), actionCollection(), "file_quit" ); - - // Try to find a postscript component first - KTrader::OfferList offers = KTrader::self()->query("application/postscript", "('KParts/ReadOnlyPart' in ServiceTypes) or ('Browser/View' in ServiceTypes)"); - - KLibFactory *factory = 0; - m_gvpart = 0; - KTrader::OfferList::Iterator it(offers.begin()); - for( ; it != offers.end(); ++it) - { - KService::Ptr ptr = (*it); - - factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) ); - if (factory) - { - m_gvpart = static_cast<KParts::ReadOnlyPart *>(factory->create(this, ptr->name().latin1(), "KParts::ReadOnlyPart")); - setCentralWidget( m_gvpart->widget() ); - // Integrate its GUI - createGUI( m_gvpart ); - - break; - } - } - - // if we couldn't find a component with the trader, try the - // kghostview library directly. if this ever happens, then something - // is seriously screwed up, though -- the kghostview component - // should be picked up by the trader - if (!m_gvpart) - { - factory = KLibLoader::self()->factory( "libkghostview" ); - if (factory) - { - // Create the part - m_gvpart = (KParts::ReadOnlyPart *)factory->create( this, "kgvpart", - "KParts::ReadOnlyPart" ); - // Set the main widget - setCentralWidget( m_gvpart->widget() ); - // Integrate its GUI - createGUI( m_gvpart ); - } - else - { - KMessageBox::error(this, "No libkghostview found !"); - } - } - // Set a reasonable size - resize( 600, 350 ); -} - -Shell::~Shell() -{ - delete m_gvpart; -} - -void Shell::openURL( const KURL & url ) -{ - m_gvpart->openURL( url ); -} - -void Shell::slotFileOpen() -{ - KURL url = KFileDialog::getOpenURL( TQString::null, "*.ps|Postscript files (*.ps)", 0L, "file dialog" ); - - if( !url.isEmpty() ) - openURL( url ); -} - -static KCmdLineOptions options[] = -{ - { "+file(s)", "Files to load", 0 }, - KCmdLineLastOption -}; -static const char version[] = "v0.0.1 2000 (c) David Faure"; -static const char description[] = "This is a test shell for the kghostview part."; - -int main( int argc, char **argv ) -{ - TDECmdLineArgs::init(argc, argv, "ghostviewtest", description, version); - TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options. - TDEApplication app; - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - Shell *shell = new Shell; - if ( args->count() == 1 ) - { - // Allow full paths, but also simple filenames from current dir - KURL url( TQDir::currentDirPath()+"/", args->arg(0) ); - shell->openURL( url ); - } - shell->show(); - return app.exec(); -} - -#include "ghostview.moc" diff --git a/kparts/tests/ghostview.h b/kparts/tests/ghostview.h deleted file mode 100644 index 5d99d4f0e..000000000 --- a/kparts/tests/ghostview.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __example_h__ -#define __example_h__ - -#include <kparts/mainwindow.h> - -class Shell : public KParts::MainWindow -{ - Q_OBJECT -public: - Shell(); - virtual ~Shell(); - - void openURL( const KURL & url ); - -protected slots: - void slotFileOpen(); - -private: - KParts::ReadOnlyPart *m_gvpart; -}; - -#endif diff --git a/kparts/tests/ghostviewtest_shell.rc b/kparts/tests/ghostviewtest_shell.rc deleted file mode 100644 index 0bae67c82..000000000 --- a/kparts/tests/ghostviewtest_shell.rc +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="KGVShell"> -<MenuBar> - <Menu name="file"><Text>&File</Text> - <Action name="file_open"/> - <Action name="file_quit"/> - </Menu> -</MenuBar> -<ToolBar name="KGV-ToolBar"> - <Action name="file_open"/> - <Action name="file_quit"/> -</ToolBar> -<StatusBar/> -</kpartgui> - diff --git a/kparts/tests/kpartstest_part1.rc b/kparts/tests/kpartstest_part1.rc deleted file mode 100644 index 9f4a75687..000000000 --- a/kparts/tests/kpartstest_part1.rc +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="Part"> -<MenuBar> - <Menu name="file"><Text>&File</Text> - <Action name="p1_blah"/> - </Menu> - <Menu name="Part1Menu"><text>Part1's Menu</text> - <Action name="p1_blah"/> - <Menu name="Part1Sub"><text>Stupid Submenu</text> - <Action name="p1_blah"/> - </Menu> - </Menu> -</MenuBar> -<ToolBar name="Part1-ToolBar"> - <Action name="p1_blah"/> -</ToolBar> -<StatusBar/> -</kpartgui> diff --git a/kparts/tests/kpartstest_shell.rc b/kparts/tests/kpartstest_shell.rc deleted file mode 100644 index 52790f9b6..000000000 --- a/kparts/tests/kpartstest_shell.rc +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="Shell"> -<MenuBar> - <Menu name="file"><Text>&File</Text> - <Action name="open_local_file"/> - <Action name="open_remote_file"/> - <Separator/> - <Action name="edit_file"/> - <Action name="close_editor"/> - <Merge name="NotepadPart"/> - <Separator/> - <Merge/> - <Separator/> - <Action name="shell_quit"/> - </Menu> - <Merge/> - <Menu name="blah"><Text>BlahFoo</Text> - <Action name="shell_yami"/> - <Menu name="nonsense"><Text>Dummdidumm</Text> - <Action name="shell_yasmi"/> - </Menu> - </Menu> -</MenuBar> -<ToolBar name="mainToolBar"> - <Action name="shell_quit"/> -</ToolBar> -<StatusBar/> -</kpartgui> diff --git a/kparts/tests/normalktm.cpp b/kparts/tests/normalktm.cpp deleted file mode 100644 index 913686bf9..000000000 --- a/kparts/tests/normalktm.cpp +++ /dev/null @@ -1,122 +0,0 @@ - -#include "normalktm.h" -#include "parts.h" -#include "notepad.h" - -#include <tqsplitter.h> -#include <tqcheckbox.h> -#include <tqdir.h> - -#include <kiconloader.h> -#include <kstandarddirs.h> -#include <kapplication.h> -#include <kmessagebox.h> -#include <kaction.h> -#include <klocale.h> - -#include <kmenubar.h> - -Shell::Shell() -{ - // We can do this "switch active part" because we have a splitter with - // two items in it. - // I wonder what tdevelop uses/will use to embed kedit, BTW. - m_splitter = new TQSplitter( this ); - - m_part1 = new Part1(this, m_splitter); - m_part2 = new Part2(this, m_splitter); - - TQPopupMenu * pFile = new TQPopupMenu( this ); - menuBar()->insertItem( "File", pFile ); - TQObject * coll = this; - KAction * paLocal = new KAction( "&View local file", 0, this, TQT_SLOT( slotFileOpen() ), coll, "open_local_file" ); - // No XML : we need to plug our actions ourselves - paLocal->plug( pFile ); - - KAction * paRemote = new KAction( "&View remote file", 0, this, TQT_SLOT( slotFileOpenRemote() ), coll, "open_remote_file" ); - paRemote->plug( pFile ); - - m_paEditFile = new KAction( "&Edit file", 0, this, TQT_SLOT( slotFileEdit() ), coll, "edit_file" ); - m_paEditFile->plug( pFile ); - - m_paCloseEditor = new KAction( "&Close file editor", 0, this, TQT_SLOT( slotFileCloseEditor() ), coll, "close_editor" ); - m_paCloseEditor->setEnabled(false); - m_paCloseEditor->plug( pFile ); - - KAction * paQuit = new KAction( "&Quit", 0, this, TQT_SLOT( close() ), coll, "shell_quit" ); - paQuit->setIconSet(TQIconSet(BarIcon("exit"))); - paQuit->plug( pFile ); - - setCentralWidget( m_splitter ); - m_splitter->setMinimumSize( 400, 300 ); - - m_splitter->show(); - - m_editorpart = 0; -} - -Shell::~Shell() -{ -} - -void Shell::slotFileOpen() -{ - if ( ! m_part1->openURL( locate("data", TDEGlobal::instance()->instanceName()+"/kpartstest_shell.rc" ) ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -void Shell::slotFileOpenRemote() -{ - KURL u ( "http://www.kde.org/index.html" ); - if ( ! m_part1->openURL( u ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -void Shell::embedEditor() -{ - // replace part2 with the editor part - delete m_part2; - m_part2 = 0L; - m_editorpart = new NotepadPart( m_splitter, "editor", - this, "NotepadPart" ); - m_editorpart->setReadWrite(); // read-write mode - ////// m_manager->addPart( m_editorpart ); - m_editorpart->widget()->show(); //// we need to do this in a normal KTM.... - m_paEditFile->setEnabled(false); - m_paCloseEditor->setEnabled(true); -} - -void Shell::slotFileCloseEditor() -{ - delete m_editorpart; - m_editorpart = 0L; - m_part2 = new Part2(this, m_splitter); - ////// m_manager->addPart( m_part2 ); - m_part2->widget()->show(); //// we need to do this in a normal KTM.... - m_paEditFile->setEnabled(true); - m_paCloseEditor->setEnabled(false); -} - -void Shell::slotFileEdit() -{ - if ( !m_editorpart ) - embedEditor(); - // TODO use KFileDialog to allow testing remote files - if ( ! m_editorpart->openURL( TQDir::current().absPath()+"/kpartstest_shell.rc" ) ) - KMessageBox::error(this,"Couldn't open file !"); -} - -int main( int argc, char **argv ) -{ - TDEApplication app( argc, argv, "kpartstest" ); // we cheat and call ourselves kpartstest for Shell::slotFileOpen() - - Shell *shell = new Shell; - - shell->show(); - - app.exec(); - - return 0; -} - -#include "normalktm.moc" diff --git a/kparts/tests/normalktm.h b/kparts/tests/normalktm.h deleted file mode 100644 index e8b1e12ef..000000000 --- a/kparts/tests/normalktm.h +++ /dev/null @@ -1,38 +0,0 @@ - -#ifndef __normalktm_h__ -#define __normalktm_h__ - -#include <kparts/part.h> -#include <kmainwindow.h> - -class KAction; -class TQWidget; - -class Shell : public KMainWindow -{ - Q_OBJECT -public: - Shell(); - virtual ~Shell(); - -protected slots: - void slotFileOpen(); - void slotFileOpenRemote(); - void slotFileEdit(); - void slotFileCloseEditor(); - -protected: - void embedEditor(); - -private: - - KAction * m_paEditFile; - KAction * m_paCloseEditor; - - KParts::ReadOnlyPart *m_part1; - KParts::Part *m_part2; - KParts::ReadWritePart *m_editorpart; - TQWidget *m_splitter; -}; - -#endif diff --git a/kparts/tests/notepad.cpp b/kparts/tests/notepad.cpp deleted file mode 100644 index 844a4ba17..000000000 --- a/kparts/tests/notepad.cpp +++ /dev/null @@ -1,101 +0,0 @@ - -#include "notepad.h" -#include <kparts/partmanager.h> -#include <kparts/mainwindow.h> - -#include <tqsplitter.h> -#include <tqfile.h> -#include <tqtextstream.h> -#include <tqmultilineedit.h> - -#include <kaboutdata.h> -#include <kapplication.h> -#include <kdebug.h> -#include <kaction.h> -#include <klocale.h> -#include <kstatusbar.h> -#include <kstandarddirs.h> - -NotepadPart::NotepadPart( TQWidget* parentWidget, const char*, - TQObject* parent, const char* name, - const TQStringList& ) - : KParts::ReadWritePart( parent, name ) -{ - setInstance( NotepadFactory::instance() ); - - m_edit = new TQMultiLineEdit( parentWidget, "NotepadPart's multiline edit" ); - setWidget( m_edit ); - - (void)new KAction( "Search and replace", 0, this, TQT_SLOT( slotSearchReplace() ), actionCollection(), "searchreplace" ); - setXMLFile( "notepadpart.rc" ); - setReadWrite( true ); -} - -NotepadPart::~NotepadPart() -{ -} - -void NotepadPart::setReadWrite( bool rw ) -{ - m_edit->setReadOnly( !rw ); - if (rw) - connect( m_edit, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( setModified() ) ); - else - disconnect( m_edit, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( setModified() ) ); - - ReadWritePart::setReadWrite( rw ); -} - -TDEAboutData* NotepadPart::createAboutData() -{ - return new TDEAboutData( "notepadpart", I18N_NOOP( "Notepad" ), "2.0" ); -} - -bool NotepadPart::openFile() -{ - kdDebug() << "NotepadPart: opening " << m_file << endl; - // Hehe this is from a tutorial I did some time ago :) - TQFile f(m_file); - TQString s; - if ( f.open(IO_ReadOnly) ) { - TQTextStream t( &f ); - while ( !t.eof() ) { - s += t.readLine() + "\n"; - } - f.close(); - } - m_edit->setText(s); - - emit setStatusBarText( m_url.prettyURL() ); - - return true; -} - -bool NotepadPart::saveFile() -{ - if ( !isReadWrite() ) - return false; - TQFile f(m_file); - TQString s; - if ( f.open(IO_WriteOnly) ) { - TQTextStream t( &f ); - t << m_edit->text(); - f.close(); - return true; - } else - return false; -} - -void NotepadPart::slotSearchReplace() -{ - // What's this ? (David) -/* - TQValueList<KParts::XMLGUIServant *> plugins = KParts::Plugin::pluginServants( this ); - TQValueList<KParts::XMLGUIServant *>::ConstIterator it = plugins.begin(); - TQValueList<KParts::XMLGUIServant *>::ConstIterator end = plugins.end(); - for (; it != end; ++it ) - factory()->removeServant( *it ); -*/ -} - -#include "notepad.moc" diff --git a/kparts/tests/notepad.desktop b/kparts/tests/notepad.desktop deleted file mode 100644 index a529d69a1..000000000 --- a/kparts/tests/notepad.desktop +++ /dev/null @@ -1,86 +0,0 @@ -[Desktop Entry] -Name=Notepad (example) -Name[af]=Notablok (voorbeeld) -Name[ar]=مفكرة (مثال) -Name[az]=Qeyd dəftəri (misal) -Name[be]=Нататнік (узор) -Name[bn]=নোটপ্যাড (উদাহরণ) -Name[br]=Skrabvloc'h (skouer) -Name[bs]=Notepad (primjer) -Name[ca]=Bloc de notes (exemple) -Name[cs]=Poznámkový blok (příklad) -Name[csb]=Notownik (przëmiôr) -Name[cy]=Pad ysgrifennu (enghraifft) -Name[da]=Notepad (eksempel) -Name[de]=Notizblock-Beispiel -Name[el]=Σημειωματάριο (παράδειγμα) -Name[eo]=Notlibro (ekzemplo) -Name[es]=Bloc de notas (ejemplo) -Name[et]=Notepad (näidis) -Name[eu]=Notepad (adibidea) -Name[fa]=دفترچه یادداشت)مثال( -Name[fi]=Muistio (esimerkki) -Name[fr]=Bloc-notes (exemple) -Name[fy]=Skriuwboekje (foarbyld) -Name[ga]=Notepad (sampla) -Name[gl]=Caderno de Notas (exemplo) -Name[he]=פנקס רשימות (דוגמה) -Name[hi]=नोटपैड (उदाहरण) -Name[hr]=Notepad (primjer) -Name[hu]=Jegyzettömb (példa) -Name[id]=Notepad (contoh) -Name[is]=Notepad (sýnishorn) -Name[it]=Blocco note (esempio) -Name[ja]=ノートパッド (例) -Name[ka]=ბლიკნოტი (მაგალითი) -Name[kk]=Блокнот (мысал) -Name[km]=Notepad (ឧទាហរណ៍) -Name[ko]=쪽지장 (보기) -Name[lb]=Notizblock (Beispill) -Name[lt]=Notepad (pavyzdys) -Name[lv]=Notepads (piemērs) -Name[mk]=Тетратка (пример) -Name[mn]=Тэмдэглэлийн блок (Жишээ) -Name[ms]=Notepad (contoh) -Name[mt]=Notepad (eżempju) -Name[nb]=Notisblokk (eksempel) -Name[nds]=Notizzeddel (Bispeel) -Name[ne]=नोटप्याड (उदाहरण) -Name[nl]=Kladblok (voorbeeld) -Name[nn]=Notisblokk (døme) -Name[nso]=Notepad (mohlala) -Name[oc]=Bloc de notes (exemple) -Name[pa]=ਨੋਟਪੈਡ (ਉਦਾਹਰਨ) -Name[pl]=Notatnik (przykład) -Name[pt]=Bloco de Notas (exemplo) -Name[pt_BR]=Bloco de notas (exemplo) -Name[ro]=Notepad (exemplu) -Name[ru]=Блокнот (пример) -Name[rw]=Notepad (urugero) -Name[se]=Čállingirjjáš (ovdamearka) -Name[sk]=Poznámkový blok (Príklad) -Name[sl]=Beležnica (zgled) -Name[sq]=Notepad (shembull) -Name[sr]=Бележница (пример) -Name[sr@Latn]=Beležnica (primer) -Name[sv]=Notepad (exempel) -Name[ta]=நோட்பாட் (உதாரணம்) -Name[te]=నోట్ పేడ్ (ఉదాహరణ) -Name[tg]=Дафтари ёддошт (мисол) -Name[th]=โน้ตแพด (ตัวอย่าง) -Name[tr]=Not defteri (örnek) -Name[tt]=Däftär (ürnäk) -Name[uk]=Записна книжка (приклад) -Name[uz]=Yon daftarcha (misol) -Name[uz@cyrillic]=Ён дафтарча (мисол) -Name[ven]=Hau nwalela notsi (Tsumbo) -Name[vi]=Tập giấy (thí dụ) -Name[xh]=Iphetshan lokubhala (umzekelo) -Name[zh_CN]=记事本(例子) -Name[zh_HK]=記事本(範例) -Name[zh_TW]=記事本(範例) -Name[zu]=Incwadi yokubhala (umfanekiso) -MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; -ServiceTypes=KParts/ReadOnlyPart -X-TDE-Library=libnotepadpart -Type=Service diff --git a/kparts/tests/notepad.h b/kparts/tests/notepad.h deleted file mode 100644 index 9cc4f2d9a..000000000 --- a/kparts/tests/notepad.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef __notepad_h__ -#define __notepad_h__ - -#include <kparts/genericfactory.h> -#include <kparts/part.h> - -class TDEAboutData; -class TQMultiLineEdit; - -/** - * Who said writing a part should be complex ? :-) - * Here is a very simple kedit-like part - * @internal - */ -class NotepadPart : public KParts::ReadWritePart -{ - Q_OBJECT -public: - NotepadPart( TQWidget*, const char* widgetName, - TQObject* parent, const char* name, - const TQStringList& args = TQStringList() ); - virtual ~NotepadPart(); - - virtual void setReadWrite( bool rw ); - - static TDEAboutData* createAboutData(); - -protected: - virtual bool openFile(); - virtual bool saveFile(); - -protected slots: - void slotSearchReplace(); - -protected: - TQMultiLineEdit * m_edit; -}; - -typedef KParts::GenericFactory<NotepadPart> NotepadFactory; - -#endif diff --git a/kparts/tests/notepadpart.cpp b/kparts/tests/notepadpart.cpp deleted file mode 100644 index 072503fd1..000000000 --- a/kparts/tests/notepadpart.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "notepad.h" - -// The entry point for the part. -K_EXPORT_COMPONENT_FACTORY( libnotepadpart, NotepadFactory ) - diff --git a/kparts/tests/notepadpart.rc b/kparts/tests/notepadpart.rc deleted file mode 100644 index ba30eb322..000000000 --- a/kparts/tests/notepadpart.rc +++ /dev/null @@ -1,14 +0,0 @@ -<!DOCTYPE kpartgui> -<kpartgui name="NotepadPart" version="2"> -<MenuBar> - <Menu name="file"><Text>&File</Text> - <Menu name="NotepadSubMenu"><text>Notepad Stuff</text> - <Action name="searchreplace"/> - </Menu> - </Menu> - <Menu name="edit"><Text>&Edit</Text> - <Action name="searchreplace"/> - </Menu> -</MenuBar> -<StatusBar/> -</kpartgui> diff --git a/kparts/tests/parts.cpp b/kparts/tests/parts.cpp deleted file mode 100644 index 97ebdd4fb..000000000 --- a/kparts/tests/parts.cpp +++ /dev/null @@ -1,90 +0,0 @@ - -#include <kparts/event.h> - -#include "parts.h" - -#include <tqcheckbox.h> -#include <tqfile.h> -#include <tqdir.h> -#include <tqtextstream.h> -#include <tqmultilineedit.h> -#include <tqlineedit.h> -#include <tqvbox.h> - -#include <kiconloader.h> -#include <kapplication.h> -#include <kdebug.h> -#include <kmessagebox.h> -#include <kaction.h> -#include <klocale.h> - -Part1::Part1( TQObject *parent, TQWidget * parentWidget ) - : KParts::ReadOnlyPart( parent, "Part1" ) -{ - m_instance = new TDEInstance( "kpartstestpart" ); - setInstance( m_instance ); - m_edit = new TQMultiLineEdit( parentWidget ); - setWidget( m_edit ); - setXMLFile( "kpartstest_part1.rc" ); - - /*KAction * paBlah = */ new KAction( "Blah", "filemail", 0, actionCollection(), "p1_blah" ); -} - -Part1::~Part1() -{ - delete m_instance; -} - -bool Part1::openFile() -{ - kdDebug() << "Part1: opening " << TQFile::encodeName(m_file) << endl; - // Hehe this is from a tutorial I did some time ago :) - TQFile f(m_file); - TQString s; - if ( f.open(IO_ReadOnly) ) { - TQTextStream t( &f ); - while ( !t.eof() ) { - s += t.readLine() + "\n"; - } - f.close(); - } else - return false; - m_edit->setText(s); - - emit setStatusBarText( m_url.prettyURL() ); - - return true; -} - -Part2::Part2( TQObject *parent, TQWidget * parentWidget ) - : KParts::Part( parent, "Part2" ) -{ - m_instance = new TDEInstance( "part2" ); - setInstance( m_instance ); - TQWidget * w = new TQWidget( parentWidget, "Part2Widget" ); - setWidget( w ); - - TQCheckBox * cb = new TQCheckBox( "something", w ); - - TQLineEdit * l = new TQLineEdit( "something", widget() ); - l->move(0,50); - // Since the main widget is a dummy one, we HAVE to set - // strong focus for it, otherwise we get the - // the famous activating-file-menu-switches-part bug. - w->setFocusPolicy( TQWidget::ClickFocus ); - - // setXMLFile( ... ); // no actions currently -} - -Part2::~Part2() -{ - delete m_instance; -} - -void Part2::guiActivateEvent( KParts::GUIActivateEvent * event ) -{ - if (event->activated()) - emit setWindowCaption("[part2 activated]"); -} - -#include "parts.moc" diff --git a/kparts/tests/parts.h b/kparts/tests/parts.h deleted file mode 100644 index 0d4e6480a..000000000 --- a/kparts/tests/parts.h +++ /dev/null @@ -1,43 +0,0 @@ - -#ifndef __parts_h__ -#define __parts_h__ - -#include <kparts/part.h> - -class TQMultiLineEdit; -namespace KParts { -class GUIActivateEvent; -}; - -class Part1 : public KParts::ReadOnlyPart -{ - Q_OBJECT -public: - Part1( TQObject *parent, TQWidget * parentWidget ); - virtual ~Part1(); - -protected: - virtual bool openFile(); - -protected: - TQMultiLineEdit * m_edit; - TDEInstance *m_instance; -}; - -class Part2 : public KParts::Part -{ - Q_OBJECT -public: - Part2( TQObject *parent, TQWidget * parentWidget ); - virtual ~Part2(); - -protected: - // This is not mandatory - only if you care about setting the - // part caption when the part is used in a multi-part environment - // (i.e. in a part manager) - // There is a default impl for ReadOnlyPart... - virtual void guiActivateEvent( KParts::GUIActivateEvent * ); - TDEInstance *m_instance; -}; - -#endif diff --git a/kparts/tests/plugin_foobar.rc b/kparts/tests/plugin_foobar.rc deleted file mode 100644 index e614e505f..000000000 --- a/kparts/tests/plugin_foobar.rc +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE kpartplugin> -<kpartplugin library="libfoobar"> -<MenuBar> - <Menu name="file"><Text>&File</Text> - <Action name="searchreplace"/> - </Menu> - <Menu name="woohoo"><Text>fun</Text> - <Action name="searchreplace"/> - </Menu> -</MenuBar> -<ToolBar name="gah"/> -</kpartplugin> diff --git a/kparts/tests/plugin_spellcheck.cpp b/kparts/tests/plugin_spellcheck.cpp deleted file mode 100644 index 5521bf22f..000000000 --- a/kparts/tests/plugin_spellcheck.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "notepad.h" // this plugin applies to a notepad part -#include <tqmultilineedit.h> -#include "plugin_spellcheck.h" -#include <kaction.h> -#include <kgenericfactory.h> -#include <kmessagebox.h> -#include <klocale.h> -#include <kdebug.h> - -PluginSpellCheck::PluginSpellCheck( TQObject* parent, const char* name, - const TQStringList& ) - : Plugin( parent, name ) -{ - (void) new KAction( "&Select current line (plugin)", 0, this, TQT_SLOT(slotSpellCheck()), - actionCollection(), "spellcheck" ); -} - -PluginSpellCheck::~PluginSpellCheck() -{ -} - -void PluginSpellCheck::slotSpellCheck() -{ - kdDebug() << "Plugin parent : " << parent()->name() << " (" << parent()->className() << ")" << endl; - // The parent is assumed to be a NotepadPart - if ( !parent()->inherits("NotepadPart") ) - KMessageBox::error(0L,"You just called the spell-check action on a wrong part (not NotepadPart)"); - else - { - NotepadPart * part = (NotepadPart *) parent(); - TQMultiLineEdit * widget = (TQMultiLineEdit *) part->widget(); - widget->selectAll(); //selects current line ! - } -} - -K_EXPORT_COMPONENT_FACTORY( libspellcheckplugin, - KGenericFactory<PluginSpellCheck> ); - -#include <plugin_spellcheck.moc> diff --git a/kparts/tests/plugin_spellcheck.h b/kparts/tests/plugin_spellcheck.h deleted file mode 100644 index 56f0e657a..000000000 --- a/kparts/tests/plugin_spellcheck.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __plugin_spellcheck_h -#define __plugin_spellcheck_h - -#include <kparts/plugin.h> - -class PluginSpellCheck : public KParts::Plugin -{ - Q_OBJECT -public: - PluginSpellCheck( TQObject* parent = 0, const char* name = 0, - const TQStringList& = TQStringList() ); - virtual ~PluginSpellCheck(); - -public slots: - void slotSpellCheck(); -}; - -#endif diff --git a/kparts/tests/plugin_spellcheck.rc b/kparts/tests/plugin_spellcheck.rc deleted file mode 100644 index 1980186cf..000000000 --- a/kparts/tests/plugin_spellcheck.rc +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE kpartplugin> -<kpartplugin library="libspellcheckplugin"> -<MenuBar> - <Menu name="edit"><Text>&Edit</Text> - <Action name="spellcheck"/> - </Menu> - <Menu name="SomePluginMenu"><text>Some Cool Plugin Menu</text> - <Action name="spellcheck"/> - <Action name="searchreplace"/> - <Menu name="WhatASubMenu"><text>Yep</text> - <Action name="searchreplace"/> - </Menu> - </Menu> -</MenuBar> -</kpartplugin> |