comparison kdiff3/src/kreplacements/kreplacements.cpp @ 34:a34c05324302

Fix for finding documentation
author joachim99
date Sun, 12 Oct 2003 11:36:57 +0000
parents 86d21651c8db
children c59d5a3a8ff3
comparison
equal deleted inserted replaced
33:940450647630 34:a34c05324302
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18 /*************************************************************************** 18 /***************************************************************************
19 * $Log$ 19 * $Log$
20 * Revision 1.2 2003/10/12 11:36:57 joachim99
21 * Fix for finding documentation
22 *
20 * Revision 1.1 2003/10/06 18:48:54 joachim99 23 * Revision 1.1 2003/10/06 18:48:54 joachim99
21 * KDiff3 version 0.9.70 24 * KDiff3 version 0.9.70
22 *
23 ***************************************************************************/ 25 ***************************************************************************/
24 26
25 #include "kreplacements.h" 27 #include "kreplacements.h"
26 28
27 #include <assert.h> 29 #include <assert.h>
62 64
63 QString exePath; 65 QString exePath;
64 if (r!=0) { exePath = buf; } 66 if (r!=0) { exePath = buf; }
65 else { exePath = "."; } 67 else { exePath = "."; }
66 68
67 QFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); 69 QFileInfo helpFile( exePath + "\\doc\\en\\index.html" );
70 if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); }
71 if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\doc\\index.html" ); }
72 if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\index.html" ); }
68 if ( ! helpFile.exists() ) 73 if ( ! helpFile.exists() )
69 { 74 {
70 helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); 75 QMessageBox::warning( 0, "KDiff3 documentation not found",
71 if ( ! helpFile.exists() ) 76 "Couldn't find the documentation. \n\n"
72 { 77 "The documentation can also be found at the homepage:\n\n "
73 QMessageBox::warning( 0, "KDiff3 Helpfile not found", 78 " http://kdiff3.sourceforge.net/");
74 "Couldn't find the helpfile at: \n\n " 79 return;
75 + helpFile.absFilePath() + "\n\n"
76 "The documentation can also be found at the homepage:\n\n "
77 " http://kdiff3.sourceforge.net/");
78 return;
79 }
80 } 80 }
81 81
82 HINSTANCE hi = FindExecutableA( helpFile.fileName(), helpFile.dirPath(true), buf ); 82 HINSTANCE hi = FindExecutableA( helpFile.fileName(), helpFile.dirPath(true), buf );
83 if ( int(hi)<=32 ) 83 if ( int(hi)<=32 )
84 { 84 {
85 static QTextBrowser* pBrowser = 0; 85 static QTextBrowser* pBrowser = 0;
86 if (pBrowser==0) 86 if (pBrowser==0)
87 { 87 {
88 pBrowser = new QTextBrowser( 0 ); 88 pBrowser = new QTextBrowser( 0 );
117 } 117 }
118 118
119 int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption, 119 int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption,
120 const QString& button1 ) 120 const QString& button1 )
121 { 121 {
122 return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel; 122 return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel;
123 } 123 }
124 124
125 void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) 125 void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption )
126 { 126 {
127 QMessageBox::information( parent, caption, text ); 127 QMessageBox::information( parent, caption, text );
139 } 139 }
140 140
141 int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption, 141 int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption,
142 const QString& button1, const QString& button2 ) 142 const QString& button1, const QString& button2 )
143 { 143 {
144 int val = QMessageBox::warning( parent, caption, text, 144 int val = QMessageBox::warning( parent, caption, text,
145 button1, button2, "Cancel" ); 145 button1, button2, "Cancel" );
146 if ( val==0 ) return Yes; 146 if ( val==0 ) return Yes;
147 if ( val==1 ) return No; 147 if ( val==1 ) return No;
148 else return Cancel; 148 else return Cancel;
149 } 149 }