comparison kdiff3/src/kreplacements/kreplacements.cpp @ 51:c59d5a3a8ff3

0.9.80
author joachim99
date Tue, 09 Dec 2003 20:29:43 +0000
parents a34c05324302
children 32d5cbf9db71
comparison
equal deleted inserted replaced
50:8c9752066f09 51:c59d5a3a8ff3
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18 /***************************************************************************
19 * $Log$
20 * Revision 1.2 2003/10/12 11:36:57 joachim99
21 * Fix for finding documentation
22 *
23 * Revision 1.1 2003/10/06 18:48:54 joachim99
24 * KDiff3 version 0.9.70
25 ***************************************************************************/
26 18
27 #include "kreplacements.h" 19 #include "kreplacements.h"
28 20
29 #include <assert.h> 21 #include <assert.h>
30 22
92 pBrowser->show(); 84 pBrowser->show();
93 } 85 }
94 else 86 else
95 { 87 {
96 QFileInfo prog( buf ); 88 QFileInfo prog( buf );
97 _spawnlp( _P_NOWAIT , prog.filePath(), prog.fileName(), (const char*)helpFile.absFilePath(), NULL ); 89 _spawnlp( _P_NOWAIT , prog.filePath(), prog.fileName(), (const char*)("file:///"+helpFile.absFilePath()), NULL );
98 } 90 }
99 91
100 #else 92 #else
101 static QTextBrowser* pBrowser = 0; 93 static QTextBrowser* pBrowser = 0;
102 if (pBrowser==0) 94 if (pBrowser==0)
289 menuBar()->insertItem(tr("&File"), fileMenu); 281 menuBar()->insertItem(tr("&File"), fileMenu);
290 editMenu = new QPopupMenu(); 282 editMenu = new QPopupMenu();
291 menuBar()->insertItem(tr("&Edit"), editMenu); 283 menuBar()->insertItem(tr("&Edit"), editMenu);
292 directoryMenu = new QPopupMenu(); 284 directoryMenu = new QPopupMenu();
293 menuBar()->insertItem(tr("&Directory"), directoryMenu); 285 menuBar()->insertItem(tr("&Directory"), directoryMenu);
286 dirCurrentItemMenu = 0;
287 dirCurrentSyncItemMenu = 0;
294 movementMenu = new QPopupMenu(); 288 movementMenu = new QPopupMenu();
295 menuBar()->insertItem(tr("&Movement"), movementMenu); 289 menuBar()->insertItem(tr("&Movement"), movementMenu);
296 mergeMenu = new QPopupMenu(); 290 mergeMenu = new QPopupMenu();
297 menuBar()->insertItem(tr("&Merge"), mergeMenu); 291 menuBar()->insertItem(tr("&Merge"), mergeMenu);
298 windowsMenu = new QPopupMenu(); 292 windowsMenu = new QPopupMenu();
614 return strList; 608 return strList;
615 } 609 }
616 610
617 611
618 KAction::KAction(const QString& text, const QIconSet& icon, int accel, 612 KAction::KAction(const QString& text, const QIconSet& icon, int accel,
619 QWidget* receiver, const char* slot, KActionCollection* actionCollection, 613 QObject* receiver, const char* slot, KActionCollection* actionCollection,
620 const QString& name, bool bToggle, bool bMenu 614 const QString& name, bool bToggle, bool bMenu
621 ) 615 )
622 : QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) 616 : QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle )
623 { 617 {
624 KMainWindow* p = actionCollection->m_pMainWindow; 618 KMainWindow* p = actionCollection->m_pMainWindow;
635 if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); 629 if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar );
636 630
637 if (bMenu) 631 if (bMenu)
638 { 632 {
639 if( name[0]=='g') addTo( p->movementMenu ); 633 if( name[0]=='g') addTo( p->movementMenu );
634 else if( name.left(16)=="dir_current_sync")
635 {
636 if ( p->dirCurrentItemMenu==0 )
637 {
638 p->dirCurrentItemMenu = new QPopupMenu();
639 p->directoryMenu->insertItem(tr("Current &Item Merge Operation"), p->dirCurrentItemMenu);
640 p->dirCurrentSyncItemMenu = new QPopupMenu();
641 p->directoryMenu->insertItem(tr("Current Item Sync Operation"), p->dirCurrentSyncItemMenu);
642 }
643 addTo( p->dirCurrentItemMenu );
644 }
645 else if( name.left(11)=="dir_current")
646 {
647 if ( p->dirCurrentItemMenu==0 )
648 {
649 p->dirCurrentItemMenu = new QPopupMenu();
650 p->directoryMenu->insertItem(tr("Current &Item Merge Operation"), p->dirCurrentItemMenu);
651 p->dirCurrentSyncItemMenu = new QPopupMenu();
652 p->directoryMenu->insertItem(tr("Current Item Sync Operation"), p->dirCurrentSyncItemMenu);
653 }
654 addTo( p->dirCurrentSyncItemMenu );
655 }
640 else if( name[0]=='d') addTo( p->directoryMenu ); 656 else if( name[0]=='d') addTo( p->directoryMenu );
641 else if( name[0]=='f') addTo( p->fileMenu ); 657 else if( name[0]=='f') addTo( p->fileMenu );
642 else if( name[0]=='w') addTo( p->windowsMenu ); 658 else if( name[0]=='w') addTo( p->windowsMenu );
643 else addTo( p->mergeMenu ); 659 else addTo( p->mergeMenu );
644 } 660 }
645 } 661 }
646 662
647 KAction::KAction(const QString& text, int accel, 663 KAction::KAction(const QString& text, int accel,
648 QWidget* receiver, const char* slot, KActionCollection* actionCollection, 664 QObject* receiver, const char* slot, KActionCollection* actionCollection,
649 const QString& name, bool bToggle, bool bMenu 665 const QString& name, bool bToggle, bool bMenu
650 ) 666 )
651 : QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) 667 : QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle )
652 { 668 {
653 KMainWindow* p = actionCollection->m_pMainWindow; 669 KMainWindow* p = actionCollection->m_pMainWindow;
661 } 677 }
662 } 678 }
663 if (bMenu) 679 if (bMenu)
664 { 680 {
665 if( name[0]=='g') addTo( p->movementMenu ); 681 if( name[0]=='g') addTo( p->movementMenu );
682 else if( name.left(16)=="dir_current_sync")
683 {
684 if ( p->dirCurrentItemMenu==0 )
685 {
686 p->dirCurrentItemMenu = new QPopupMenu();
687 p->directoryMenu->insertItem(tr("Current &Item Merge Operation"), p->dirCurrentItemMenu);
688 p->dirCurrentSyncItemMenu = new QPopupMenu();
689 p->directoryMenu->insertItem(tr("Current Item Sync Operation"), p->dirCurrentSyncItemMenu);
690 }
691 addTo( p->dirCurrentItemMenu );
692 }
693 else if( name.left(11)=="dir_current")
694 {
695 if ( p->dirCurrentItemMenu==0 )
696 {
697 p->dirCurrentItemMenu = new QPopupMenu();
698 p->directoryMenu->insertItem(tr("Current &Item Merge Operation"), p->dirCurrentItemMenu);
699 p->dirCurrentSyncItemMenu = new QPopupMenu();
700 p->directoryMenu->insertItem(tr("Current Item Sync Operation"), p->dirCurrentSyncItemMenu);
701 }
702 addTo( p->dirCurrentSyncItemMenu );
703 }
666 else if( name[0]=='d') addTo( p->directoryMenu ); 704 else if( name[0]=='d') addTo( p->directoryMenu );
667 else if( name[0]=='f') addTo( p->fileMenu ); 705 else if( name[0]=='f') addTo( p->fileMenu );
668 else if( name[0]=='w') addTo( p->windowsMenu ); 706 else if( name[0]=='w') addTo( p->windowsMenu );
669 else addTo( p->mergeMenu ); 707 else addTo( p->mergeMenu );
670 } 708 }
678 { 716 {
679 addTo(menu); 717 addTo(menu);
680 } 718 }
681 719
682 720
683 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QWidget* parent, const char* slot, KActionCollection* actionCollection, const QString& name, bool bMenu) 721 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const QString& name, bool bMenu)
684 : KAction( text, icon, accel, parent, slot, actionCollection, name, true, bMenu) 722 : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu)
685 { 723 {
686 } 724 }
687 725
688 KToggleAction::KToggleAction(const QString& text, int accel, QWidget* parent, const char* slot, KActionCollection* actionCollection, const QString& name, bool bMenu) 726 KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const QString& name, bool bMenu)
689 : KAction( text, accel, parent, slot, actionCollection, name, true, bMenu) 727 : KAction( text, accel, receiver, slot, actionCollection, name, true, bMenu)
690 { 728 {
691 } 729 }
692 730
693 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const QString& name, bool bMenu) 731 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const QString& name, bool bMenu)
694 : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) 732 : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu)
939 s_description = description; 977 s_description = description;
940 s_version = version; 978 s_version = version;
941 s_homepage = homepage; 979 s_homepage = homepage;
942 } 980 }
943 981
944 KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const QString& version ) 982 KAboutData::KAboutData( const QString& /*name*/, const QString& /*appName*/, const QString& /*version*/ )
945 { 983 {
946 } 984 }
947 985
948 void KAboutData::addAuthor(const QString& /*name*/, int, const QString& /*email*/) 986 void KAboutData::addAuthor(const QString& /*name*/, int, const QString& /*email*/)
949 { 987 {
967 static std::vector<QCStringList> s_vOption; 1005 static std::vector<QCStringList> s_vOption;
968 static std::vector<const char*> s_vArg; 1006 static std::vector<const char*> s_vArg;
969 1007
970 KCmdLineArgs* KCmdLineArgs::parsedArgs() // static 1008 KCmdLineArgs* KCmdLineArgs::parsedArgs() // static
971 { 1009 {
972 return &s_cmdLineArgs; 1010 return &s_cmdLineArgs;
973 } 1011 }
974 1012
975 void KCmdLineArgs::init( int argc, char**argv, KAboutData* ) // static 1013 void KCmdLineArgs::init( int argc, char**argv, KAboutData* ) // static
976 { 1014 {
977 s_argc = argc; 1015 s_argc = argc;