comparison kdiff3/src/kreplacements/kreplacements.cpp @ 73:f7dad0aa6146

KDiff3-0.9.90-Qt4
author joachim99
date Sun, 14 May 2006 20:09:06 +0000
parents 88d8fab8691a
children
comparison
equal deleted inserted replaced
72:2bb0f4dc64c0 73:f7dad0aa6146
31 #include <qlabel.h> 31 #include <qlabel.h>
32 #include <q3textbrowser.h> 32 #include <q3textbrowser.h>
33 #include <qtextstream.h> 33 #include <qtextstream.h>
34 #include <qlayout.h> 34 #include <qlayout.h>
35 #include <q3dockarea.h> 35 #include <q3dockarea.h>
36 #include <QTabWidget>
36 //Added by qt3to4: 37 //Added by qt3to4:
37 #include <QPaintEvent> 38 #include <QPaintEvent>
38 #include <Q3VBoxLayout> 39 #include <Q3VBoxLayout>
39 #include <Q3Frame> 40 #include <Q3Frame>
40 #include <Q3CString> 41 #include <Q3CString>
120 int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); 121 int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 );
121 122
122 QString exePath; 123 QString exePath;
123 if (r!=0) { exePath = buf; } 124 if (r!=0) { exePath = buf; }
124 else { exePath = "."; } 125 else { exePath = "."; }
125 return exePath; 126 return exePath+"/translations";
126 #else 127 #else
127 return "."; 128 return ".";
128 #endif 129 #endif
129 } 130 }
130 131
208 Q3VBox* p = new Q3VBox(this, name.ascii()); 209 Q3VBox* p = new Q3VBox(this, name.ascii());
209 addTab( p, name ); 210 addTab( p, name );
210 return p; 211 return p;
211 } 212 }
212 213
213 Q3Frame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) 214 QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int )
214 { 215 {
215 Q3Frame* p = new Q3Frame(0); 216 QFrame* p = new QFrame();
216 p->setObjectName( name ); 217 p->setObjectName( name );
217 addTab( p, name ); 218 addTab( p, name );
218 return p; 219 return p;
219 } 220 }
220 221
365 KStdAction::aboutQt(actionCollection()); 366 KStdAction::aboutQt(actionCollection());
366 } 367 }
367 368
368 void KMainWindow::slotAbout() 369 void KMainWindow::slotAbout()
369 { 370 {
370 Q3TabDialog d; 371 QDialog d;
372 QVBoxLayout* l = new QVBoxLayout( &d );
373 QTabWidget* pTabWidget = new QTabWidget;
374 l->addWidget( pTabWidget );
375
376 QPushButton* pOkButton = new QPushButton(i18n("Ok"));
377 connect( pOkButton, SIGNAL(clicked()), &d, SLOT(accept()));
378 l->addWidget( pOkButton );
379
371 d.setCaption("About " + s_appName); 380 d.setCaption("About " + s_appName);
372 Q3TextBrowser* tb1 = new Q3TextBrowser(&d); 381 Q3TextBrowser* tb1 = new Q3TextBrowser();
373 tb1->setWordWrap( Q3TextEdit::NoWrap ); 382 tb1->setWordWrap( Q3TextEdit::NoWrap );
374 tb1->setText( 383 tb1->setText(
375 s_appName + " Version " + s_version + 384 s_appName + " Version " + s_version +
376 "\n\n" + s_description + 385 "\n\n" + s_description +
377 "\n\n" + s_copyright + 386 "\n\n" + s_copyright +
378 "\n\nHomepage: " + s_homepage + 387 "\n\nHomepage: " + s_homepage +
379 "\n\nLicence: GNU GPL Version 2" 388 "\n\nLicence: GNU GPL Version 2"
380 ); 389 );
381 d.addTab(tb1,i18n("&About")); 390 pTabWidget->addTab(tb1,i18n("&About"));
382 391
383 std::list<KAboutData::AboutDataEntry>::iterator i; 392 std::list<KAboutData::AboutDataEntry>::iterator i;
384 393
385 QString s2; 394 QString s2;
386 for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i ) 395 for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i )
389 if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n"; 398 if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n";
390 if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n"; 399 if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n";
391 if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; 400 if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n";
392 s2 += "\n"; 401 s2 += "\n";
393 } 402 }
394 Q3TextBrowser* tb2 = new Q3TextBrowser(&d); 403 Q3TextBrowser* tb2 = new Q3TextBrowser();
395 tb2->setWordWrap( Q3TextEdit::NoWrap ); 404 tb2->setWordWrap( Q3TextEdit::NoWrap );
396 tb2->setText(s2); 405 tb2->setText(s2);
397 d.addTab(tb2,i18n("A&uthor")); 406 pTabWidget->addTab(tb2,i18n("A&uthor"));
398 407
399 QString s3; 408 QString s3;
400 for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) 409 for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i )
401 { 410 {
402 if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n"; 411 if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n";
403 if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n"; 412 if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n";
404 if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n"; 413 if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n";
405 if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; 414 if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n";
406 s3 += "\n"; 415 s3 += "\n";
407 } 416 }
408 Q3TextBrowser* tb3 = new Q3TextBrowser(&d); 417 Q3TextBrowser* tb3 = new Q3TextBrowser();
409 tb3->setWordWrap( Q3TextEdit::NoWrap ); 418 tb3->setWordWrap( Q3TextEdit::NoWrap );
410 tb3->setText(s3); 419 tb3->setText(s3);
411 d.addTab(tb3,i18n("&Thanks To")); 420 pTabWidget->addTab(tb3,i18n("&Thanks To"));
412 421
413 d.resize(400,300); 422 d.resize(400,300);
414 d.exec(); 423 d.exec();
415 /* 424 /*
416 QMessageBox::information( 425 QMessageBox::information(