Mercurial > hg > easyhg-kdiff3
comparison kdiff3/src/kreplacements/kreplacements.cpp @ 70:5bbfe4784324
KDiff3 0.9.89 for Qt4
author | joachim99 |
---|---|
date | Tue, 18 Apr 2006 20:19:57 +0000 |
parents | 8febbfb1148c |
children | 88d8fab8691a |
comparison
equal
deleted
inserted
replaced
69:8febbfb1148c | 70:5bbfe4784324 |
---|---|
21 | 21 |
22 #include <assert.h> | 22 #include <assert.h> |
23 | 23 |
24 #include <qnamespace.h> | 24 #include <qnamespace.h> |
25 #include <qmessagebox.h> | 25 #include <qmessagebox.h> |
26 #include <qpopupmenu.h> | 26 #include <q3popupmenu.h> |
27 #include <qmenubar.h> | 27 #include <qmenubar.h> |
28 #include <qpainter.h> | 28 #include <qpainter.h> |
29 #include <qcolordialog.h> | 29 #include <qcolordialog.h> |
30 #include <qfontdialog.h> | 30 #include <qfontdialog.h> |
31 #include <qlabel.h> | 31 #include <qlabel.h> |
32 #include <qtextbrowser.h> | 32 #include <q3textbrowser.h> |
33 #include <qtextstream.h> | 33 #include <qtextstream.h> |
34 #include <qlayout.h> | 34 #include <qlayout.h> |
35 #include <qdockarea.h> | 35 #include <q3dockarea.h> |
36 //Added by qt3to4: | |
37 #include <QPaintEvent> | |
38 #include <Q3VBoxLayout> | |
39 #include <Q3Frame> | |
40 #include <Q3CString> | |
41 #include <Q3ValueList> | |
42 #include <QPixmap> | |
36 | 43 |
37 #include <vector> | 44 #include <vector> |
38 #include <iostream> | 45 #include <iostream> |
39 #include <algorithm> | 46 #include <algorithm> |
40 | 47 |
77 } | 84 } |
78 | 85 |
79 HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); | 86 HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); |
80 if ( int(hi)<=32 ) | 87 if ( int(hi)<=32 ) |
81 { | 88 { |
82 static QTextBrowser* pBrowser = 0; | 89 static Q3TextBrowser* pBrowser = 0; |
83 if (pBrowser==0) | 90 if (pBrowser==0) |
84 { | 91 { |
85 pBrowser = new QTextBrowser( 0 ); | 92 pBrowser = new Q3TextBrowser( 0 ); |
86 pBrowser->setMinimumSize( 600, 400 ); | 93 pBrowser->setMinimumSize( 600, 400 ); |
87 } | 94 } |
88 pBrowser->setSource(helpFile.filePath()); | 95 pBrowser->setSource(helpFile.filePath()); |
89 pBrowser->show(); | 96 pBrowser->show(); |
90 } | 97 } |
93 QFileInfo prog( buf ); | 100 QFileInfo prog( buf ); |
94 _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("file:///"+helpFile.absFilePath()).ascii(), NULL ); | 101 _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("file:///"+helpFile.absFilePath()).ascii(), NULL ); |
95 } | 102 } |
96 | 103 |
97 #else | 104 #else |
98 static QTextBrowser* pBrowser = 0; | 105 static Q3TextBrowser* pBrowser = 0; |
99 if (pBrowser==0) | 106 if (pBrowser==0) |
100 { | 107 { |
101 pBrowser = new QTextBrowser( 0 ); | 108 pBrowser = new Q3TextBrowser( 0 ); |
102 pBrowser->setMinimumSize( 600, 400 ); | 109 pBrowser->setMinimumSize( 600, 400 ); |
103 } | 110 } |
104 pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); | 111 pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); |
105 pBrowser->show(); | 112 pBrowser->show(); |
106 #endif | 113 #endif |
160 } | 167 } |
161 | 168 |
162 | 169 |
163 KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, | 170 KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, |
164 bool /*modal*/, bool ) | 171 bool /*modal*/, bool ) |
165 : QTabDialog( parent, name, true /* modal */ ) | 172 : Q3TabDialog( parent, name, true /* modal */ ) |
166 { | 173 { |
167 setCaption( caption ); | 174 setCaption( caption ); |
168 setDefaultButton(); | 175 setDefaultButton(); |
169 setHelpButton(); | 176 setHelpButton(); |
170 setCancelButton(); | 177 setCancelButton(); |
194 { | 201 { |
195 return 0; // Not used for replacement. | 202 return 0; // Not used for replacement. |
196 } | 203 } |
197 | 204 |
198 | 205 |
199 QVBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) | 206 Q3VBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) |
200 { | 207 { |
201 QVBox* p = new QVBox(this, name.ascii()); | 208 Q3VBox* p = new Q3VBox(this, name.ascii()); |
202 addTab( p, name ); | 209 addTab( p, name ); |
203 return p; | 210 return p; |
204 } | 211 } |
205 | 212 |
206 QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) | 213 Q3Frame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) |
207 { | 214 { |
208 QFrame* p = new QFrame( this, name.ascii() ); | 215 Q3Frame* p = new Q3Frame( this, name.ascii() ); |
209 addTab( p, name ); | 216 addTab( p, name ); |
210 return p; | 217 return p; |
211 } | 218 } |
212 | 219 |
213 int KDialogBase::spacingHint() | 220 int KDialogBase::spacingHint() |
224 s_bAccepted = false; | 231 s_bAccepted = false; |
225 s_inAccept = true; | 232 s_inAccept = true; |
226 slotOk(); | 233 slotOk(); |
227 s_inAccept = false; | 234 s_inAccept = false; |
228 if ( s_bAccepted ) | 235 if ( s_bAccepted ) |
229 QTabDialog::accept(); | 236 Q3TabDialog::accept(); |
230 } | 237 } |
231 else | 238 else |
232 { | 239 { |
233 s_bAccepted = true; | 240 s_bAccepted = true; |
234 } | 241 } |
254 | 261 |
255 KURL KFileDialog::getSaveURL( const QString &startDir, | 262 KURL KFileDialog::getSaveURL( const QString &startDir, |
256 const QString &filter, | 263 const QString &filter, |
257 QWidget *parent, const QString &caption) | 264 QWidget *parent, const QString &caption) |
258 { | 265 { |
259 QString s = QFileDialog::getSaveFileName(startDir, filter, parent, 0, caption); | 266 QString s = Q3FileDialog::getSaveFileName(startDir, filter, parent, 0, caption); |
260 return KURL(s); | 267 return KURL(s); |
261 } | 268 } |
262 | 269 |
263 KURL KFileDialog::getOpenURL( const QString & startDir, | 270 KURL KFileDialog::getOpenURL( const QString & startDir, |
264 const QString & filter, | 271 const QString & filter, |
265 QWidget * parent, | 272 QWidget * parent, |
266 const QString & caption ) | 273 const QString & caption ) |
267 { | 274 { |
268 QString s = QFileDialog::getOpenFileName(startDir, filter, parent, 0, caption); | 275 QString s = Q3FileDialog::getOpenFileName(startDir, filter, parent, 0, caption); |
269 return KURL(s); | 276 return KURL(s); |
270 } | 277 } |
271 | 278 |
272 KURL KFileDialog::getExistingURL( const QString & startDir, | 279 KURL KFileDialog::getExistingURL( const QString & startDir, |
273 QWidget * parent, | 280 QWidget * parent, |
274 const QString & caption) | 281 const QString & caption) |
275 { | 282 { |
276 QString s = QFileDialog::getExistingDirectory(startDir, parent, 0, caption); | 283 QString s = Q3FileDialog::getExistingDirectory(startDir, parent, 0, caption); |
277 return KURL(s); | 284 return KURL(s); |
278 } | 285 } |
279 | 286 |
280 QString KFileDialog::getSaveFileName (const QString &startDir, | 287 QString KFileDialog::getSaveFileName (const QString &startDir, |
281 const QString &filter, | 288 const QString &filter, |
282 QWidget *parent, | 289 QWidget *parent, |
283 const QString &caption) | 290 const QString &caption) |
284 { | 291 { |
285 return QFileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); | 292 return Q3FileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); |
286 } | 293 } |
287 | 294 |
288 | 295 |
289 KToolBar::BarPosition KToolBar::barPos() | 296 KToolBar::BarPosition KToolBar::barPos() |
290 { | 297 { |
295 return Top; | 302 return Top; |
296 } | 303 } |
297 | 304 |
298 void KToolBar::setBarPos(BarPosition bp) | 305 void KToolBar::setBarPos(BarPosition bp) |
299 { | 306 { |
300 if ( bp == Left ) m_pMainWindow->moveDockWindow( this, DockLeft ); | 307 if ( bp == Left ) m_pMainWindow->moveDockWindow( this, Qt::DockLeft ); |
301 else if ( bp == Right ) m_pMainWindow->moveDockWindow( this, DockRight ); | 308 else if ( bp == Right ) m_pMainWindow->moveDockWindow( this, Qt::DockRight ); |
302 else if ( bp == Bottom ) m_pMainWindow->moveDockWindow( this, DockBottom ); | 309 else if ( bp == Bottom ) m_pMainWindow->moveDockWindow( this, Qt::DockBottom ); |
303 else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, DockTop ); | 310 else if ( bp == Top ) m_pMainWindow->moveDockWindow( this, Qt::DockTop ); |
304 } | 311 } |
305 | 312 |
306 KToolBar::KToolBar( QMainWindow* parent ) | 313 KToolBar::KToolBar( Q3MainWindow* parent ) |
307 : QToolBar( parent ) | 314 : Q3ToolBar( parent ) |
308 { | 315 { |
309 m_pMainWindow = parent; | 316 m_pMainWindow = parent; |
310 } | 317 } |
311 | 318 |
312 | 319 |
313 KMainWindow::KMainWindow( QWidget* parent, const char* name ) | 320 KMainWindow::KMainWindow( QWidget* parent, const char* name ) |
314 : QMainWindow( parent, name ), m_actionCollection(this) | 321 : Q3MainWindow( parent, name ), m_actionCollection(this) |
315 { | 322 { |
316 fileMenu = new QPopupMenu(); | 323 fileMenu = new Q3PopupMenu(); |
317 menuBar()->insertItem(i18n("&File"), fileMenu); | 324 menuBar()->insertItem(i18n("&File"), fileMenu); |
318 editMenu = new QPopupMenu(); | 325 editMenu = new Q3PopupMenu(); |
319 menuBar()->insertItem(i18n("&Edit"), editMenu); | 326 menuBar()->insertItem(i18n("&Edit"), editMenu); |
320 directoryMenu = new QPopupMenu(); | 327 directoryMenu = new Q3PopupMenu(); |
321 menuBar()->insertItem(i18n("&Directory"), directoryMenu); | 328 menuBar()->insertItem(i18n("&Directory"), directoryMenu); |
322 dirCurrentItemMenu = 0; | 329 dirCurrentItemMenu = 0; |
323 dirCurrentSyncItemMenu = 0; | 330 dirCurrentSyncItemMenu = 0; |
324 movementMenu = new QPopupMenu(); | 331 movementMenu = new Q3PopupMenu(); |
325 menuBar()->insertItem(i18n("&Movement"), movementMenu); | 332 menuBar()->insertItem(i18n("&Movement"), movementMenu); |
326 diffMenu = new QPopupMenu(); | 333 diffMenu = new Q3PopupMenu(); |
327 menuBar()->insertItem(i18n("D&iffview"), diffMenu); | 334 menuBar()->insertItem(i18n("D&iffview"), diffMenu); |
328 mergeMenu = new QPopupMenu(); | 335 mergeMenu = new Q3PopupMenu(); |
329 menuBar()->insertItem(i18n("&Merge"), mergeMenu); | 336 menuBar()->insertItem(i18n("&Merge"), mergeMenu); |
330 windowsMenu = new QPopupMenu(); | 337 windowsMenu = new Q3PopupMenu(); |
331 menuBar()->insertItem(i18n("&Window"), windowsMenu); | 338 menuBar()->insertItem(i18n("&Window"), windowsMenu); |
332 settingsMenu = new QPopupMenu(); | 339 settingsMenu = new Q3PopupMenu(); |
333 menuBar()->insertItem(i18n("&Settings"), settingsMenu); | 340 menuBar()->insertItem(i18n("&Settings"), settingsMenu); |
334 helpMenu = new QPopupMenu(); | 341 helpMenu = new Q3PopupMenu(); |
335 menuBar()->insertItem(i18n("&Help"), helpMenu); | 342 menuBar()->insertItem(i18n("&Help"), helpMenu); |
336 | 343 |
337 m_pToolBar = new KToolBar(this); | 344 m_pToolBar = new KToolBar(this); |
338 | 345 |
339 memberList = new QList<KMainWindow>; | 346 memberList = new QList<KMainWindow*>; |
340 memberList->append(this); | 347 memberList->append(this); |
341 } | 348 } |
342 | 349 |
343 KToolBar* KMainWindow::toolBar(const QString&) | 350 KToolBar* KMainWindow::toolBar(const QString&) |
344 { | 351 { |
357 KStdAction::aboutQt(actionCollection()); | 364 KStdAction::aboutQt(actionCollection()); |
358 } | 365 } |
359 | 366 |
360 void KMainWindow::slotAbout() | 367 void KMainWindow::slotAbout() |
361 { | 368 { |
362 QTabDialog d; | 369 Q3TabDialog d; |
363 d.setCaption("About " + s_appName); | 370 d.setCaption("About " + s_appName); |
364 QTextBrowser* tb1 = new QTextBrowser(&d); | 371 Q3TextBrowser* tb1 = new Q3TextBrowser(&d); |
365 tb1->setWordWrap( QTextEdit::NoWrap ); | 372 tb1->setWordWrap( Q3TextEdit::NoWrap ); |
366 tb1->setText( | 373 tb1->setText( |
367 s_appName + " Version " + s_version + | 374 s_appName + " Version " + s_version + |
368 "\n\n" + s_description + | 375 "\n\n" + s_description + |
369 "\n\n" + s_copyright + | 376 "\n\n" + s_copyright + |
370 "\n\nHomepage: " + s_homepage + | 377 "\n\nHomepage: " + s_homepage + |
381 if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n"; | 388 if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n"; |
382 if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n"; | 389 if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n"; |
383 if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; | 390 if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; |
384 s2 += "\n"; | 391 s2 += "\n"; |
385 } | 392 } |
386 QTextBrowser* tb2 = new QTextBrowser(&d); | 393 Q3TextBrowser* tb2 = new Q3TextBrowser(&d); |
387 tb2->setWordWrap( QTextEdit::NoWrap ); | 394 tb2->setWordWrap( Q3TextEdit::NoWrap ); |
388 tb2->setText(s2); | 395 tb2->setText(s2); |
389 d.addTab(tb2,i18n("A&uthor")); | 396 d.addTab(tb2,i18n("A&uthor")); |
390 | 397 |
391 QString s3; | 398 QString s3; |
392 for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) | 399 for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) |
395 if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n"; | 402 if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n"; |
396 if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n"; | 403 if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n"; |
397 if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; | 404 if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; |
398 s3 += "\n"; | 405 s3 += "\n"; |
399 } | 406 } |
400 QTextBrowser* tb3 = new QTextBrowser(&d); | 407 Q3TextBrowser* tb3 = new Q3TextBrowser(&d); |
401 tb3->setWordWrap( QTextEdit::NoWrap ); | 408 tb3->setWordWrap( Q3TextEdit::NoWrap ); |
402 tb3->setText(s3); | 409 tb3->setText(s3); |
403 d.addTab(tb3,i18n("&Thanks To")); | 410 d.addTab(tb3,i18n("&Thanks To")); |
404 | 411 |
405 d.resize(400,300); | 412 d.resize(400,300); |
406 d.exec(); | 413 d.exec(); |
447 { | 454 { |
448 m_fileName = KStandardDirs().findResource("config","kdiff3rc"); | 455 m_fileName = KStandardDirs().findResource("config","kdiff3rc"); |
449 } | 456 } |
450 | 457 |
451 QFile f( m_fileName ); | 458 QFile f( m_fileName ); |
452 if ( f.open(IO_ReadOnly) ) | 459 if ( f.open(QIODevice::ReadOnly) ) |
453 { // file opened successfully | 460 { // file opened successfully |
454 QTextStream t( &f ); // use a text stream | 461 QTextStream t( &f ); // use a text stream |
455 load(t); | 462 load(t); |
456 f.close(); | 463 f.close(); |
457 } | 464 } |
458 } | 465 } |
459 | 466 |
460 KConfig::~KConfig() | 467 KConfig::~KConfig() |
461 { | 468 { |
462 QFile f(m_fileName); | 469 QFile f(m_fileName); |
463 if ( f.open( IO_WriteOnly | IO_Translate ) ) | 470 if ( f.open( QIODevice::WriteOnly | QIODevice::Text ) ) |
464 { // file opened successfully | 471 { // file opened successfully |
465 QTextStream t( &f ); // use a text stream | 472 QTextStream t( &f ); // use a text stream |
466 save(t); | 473 save(t); |
467 f.close(); | 474 f.close(); |
468 } | 475 } |
492 if( n[0]=='g') addTo( p->movementMenu ); | 499 if( n[0]=='g') addTo( p->movementMenu ); |
493 else if( n.left(16)=="dir_current_sync") | 500 else if( n.left(16)=="dir_current_sync") |
494 { | 501 { |
495 if ( p->dirCurrentItemMenu==0 ) | 502 if ( p->dirCurrentItemMenu==0 ) |
496 { | 503 { |
497 p->dirCurrentItemMenu = new QPopupMenu(); | 504 p->dirCurrentItemMenu = new Q3PopupMenu(); |
498 p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); | 505 p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); |
499 p->dirCurrentSyncItemMenu = new QPopupMenu(); | 506 p->dirCurrentSyncItemMenu = new Q3PopupMenu(); |
500 p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); | 507 p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); |
501 } | 508 } |
502 addTo( p->dirCurrentItemMenu ); | 509 addTo( p->dirCurrentItemMenu ); |
503 } | 510 } |
504 else if( n.left(11)=="dir_current") | 511 else if( n.left(11)=="dir_current") |
505 { | 512 { |
506 if ( p->dirCurrentItemMenu==0 ) | 513 if ( p->dirCurrentItemMenu==0 ) |
507 { | 514 { |
508 p->dirCurrentItemMenu = new QPopupMenu(); | 515 p->dirCurrentItemMenu = new Q3PopupMenu(); |
509 p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); | 516 p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); |
510 p->dirCurrentSyncItemMenu = new QPopupMenu(); | 517 p->dirCurrentSyncItemMenu = new Q3PopupMenu(); |
511 p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); | 518 p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); |
512 } | 519 } |
513 addTo( p->dirCurrentSyncItemMenu ); | 520 addTo( p->dirCurrentSyncItemMenu ); |
514 } | 521 } |
515 else if( n.left(4)=="diff") addTo( p->diffMenu ); | 522 else if( n.left(4)=="diff") addTo( p->diffMenu ); |
519 else addTo( p->mergeMenu ); | 526 else addTo( p->mergeMenu ); |
520 } | 527 } |
521 } | 528 } |
522 | 529 |
523 | 530 |
524 KAction::KAction(const QString& text, const QIconSet& icon, int accel, | 531 KAction::KAction(const QString& text, const QIcon& icon, int accel, |
525 QObject* receiver, const char* slot, KActionCollection* actionCollection, | 532 QObject* receiver, const char* slot, KActionCollection* actionCollection, |
526 const char* name, bool bToggle, bool bMenu | 533 const char* name, bool bToggle, bool bMenu |
527 ) | 534 ) |
528 : QAction ( text, icon, text, accel, actionCollection->m_pMainWindow, name, bToggle ) | 535 : QAction ( icon, text, accel, actionCollection->m_pMainWindow, name ) |
529 { | 536 { |
537 setToggleAction( bToggle ); | |
530 KMainWindow* p = actionCollection->m_pMainWindow; | 538 KMainWindow* p = actionCollection->m_pMainWindow; |
531 if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); | 539 if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); |
532 | 540 |
533 init(receiver,slot,actionCollection,name,bToggle,bMenu); | 541 init(receiver,slot,actionCollection,name,bToggle,bMenu); |
534 } | 542 } |
535 | 543 |
536 KAction::KAction(const QString& text, int accel, | 544 KAction::KAction(const QString& text, int accel, |
537 QObject* receiver, const char* slot, KActionCollection* actionCollection, | 545 QObject* receiver, const char* slot, KActionCollection* actionCollection, |
538 const char* name, bool bToggle, bool bMenu | 546 const char* name, bool bToggle, bool bMenu |
539 ) | 547 ) |
540 : QAction ( text, text, accel, actionCollection->m_pMainWindow, name, bToggle ) | 548 : QAction ( text, accel, actionCollection->m_pMainWindow, name ) |
541 { | 549 { |
550 setToggleAction( bToggle ); | |
542 init(receiver,slot,actionCollection,name,bToggle,bMenu); | 551 init(receiver,slot,actionCollection,name,bToggle,bMenu); |
543 } | 552 } |
544 | 553 |
545 void KAction::setStatusText(const QString&) | 554 void KAction::setStatusText(const QString&) |
546 { | 555 { |
547 } | 556 } |
548 | 557 |
549 void KAction::plug(QPopupMenu* menu) | 558 void KAction::plug(Q3PopupMenu* menu) |
550 { | 559 { |
551 addTo(menu); | 560 addTo(menu); |
552 } | 561 } |
553 | 562 |
554 | 563 |
555 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) | 564 KToggleAction::KToggleAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) |
556 : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu) | 565 : KAction( text, icon, accel, receiver, slot, actionCollection, name, true, bMenu) |
557 { | 566 { |
558 } | 567 } |
559 | 568 |
560 KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) | 569 KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) |
561 : KAction( text, accel, receiver, slot, actionCollection, name, true, bMenu) | 570 : KAction( text, accel, receiver, slot, actionCollection, name, true, bMenu) |
562 { | 571 { |
563 } | 572 } |
564 | 573 |
565 KToggleAction::KToggleAction(const QString& text, const QIconSet& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) | 574 KToggleAction::KToggleAction(const QString& text, const QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu) |
566 : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) | 575 : KAction( text, icon, accel, 0, 0, actionCollection, name, true, bMenu) |
567 { | 576 { |
568 } | 577 } |
569 | 578 |
570 void KToggleAction::setChecked(bool bChecked) | 579 void KToggleAction::setChecked(bool bChecked) |
584 //static | 593 //static |
585 KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) | 594 KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) |
586 { | 595 { |
587 #include "../xpm/fileopen.xpm" | 596 #include "../xpm/fileopen.xpm" |
588 KMainWindow* p = actionCollection->m_pMainWindow; | 597 KMainWindow* p = actionCollection->m_pMainWindow; |
589 KAction* a = new KAction( i18n("Open"), QIconSet(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); | 598 KAction* a = new KAction( i18n("Open"), QIcon(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); |
590 if(p){ a->addTo( p->fileMenu ); } | 599 if(p){ a->addTo( p->fileMenu ); } |
591 return a; | 600 return a; |
592 } | 601 } |
593 | 602 |
594 KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) | 603 KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) |
595 { | 604 { |
596 #include "../xpm/filesave.xpm" | 605 #include "../xpm/filesave.xpm" |
597 KMainWindow* p = actionCollection->m_pMainWindow; | 606 KMainWindow* p = actionCollection->m_pMainWindow; |
598 KAction* a = new KAction( i18n("Save"), QIconSet(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); | 607 KAction* a = new KAction( i18n("Save"), QIcon(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); |
599 if(p){ a->addTo( p->fileMenu ); } | 608 if(p){ a->addTo( p->fileMenu ); } |
600 return a; | 609 return a; |
601 } | 610 } |
602 | 611 |
603 KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) | 612 KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) |
610 | 619 |
611 KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) | 620 KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) |
612 { | 621 { |
613 #include "../xpm/fileprint.xpm" | 622 #include "../xpm/fileprint.xpm" |
614 KMainWindow* p = actionCollection->m_pMainWindow; | 623 KMainWindow* p = actionCollection->m_pMainWindow; |
615 KAction* a = new KAction( i18n("Print..."), QIconSet(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); | 624 KAction* a = new KAction( i18n("Print..."), QIcon(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); |
616 if(p) a->addTo( p->fileMenu ); | 625 if(p) a->addTo( p->fileMenu ); |
617 return a; | 626 return a; |
618 } | 627 } |
619 | 628 |
620 KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) | 629 KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) |
729 | 738 |
730 KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) | 739 KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) |
731 : QWidget(pParent) | 740 : QWidget(pParent) |
732 { | 741 { |
733 m_pParent = pParent; | 742 m_pParent = pParent; |
734 QVBoxLayout* pLayout = new QVBoxLayout( this ); | 743 Q3VBoxLayout* pLayout = new Q3VBoxLayout( this ); |
735 m_pSelectFont = new QPushButton(i18n("Select Font"), this ); | 744 m_pSelectFont = new QPushButton(i18n("Select Font"), this ); |
736 connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); | 745 connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); |
737 pLayout->addWidget(m_pSelectFont); | 746 pLayout->addWidget(m_pSelectFont); |
738 | 747 |
739 m_pLabel = new QLabel( "", this ); | 748 m_pLabel = new QLabel( "", this ); |
822 } | 831 } |
823 | 832 |
824 KPrinter::KPrinter() | 833 KPrinter::KPrinter() |
825 { | 834 { |
826 } | 835 } |
827 QValueList<int> KPrinter::pageList() | 836 Q3ValueList<int> KPrinter::pageList() |
828 { | 837 { |
829 QValueList<int> vl; | 838 Q3ValueList<int> vl; |
830 int to = toPage(); | 839 int to = toPage(); |
831 for(int i=fromPage(); i<=to; ++i) | 840 for(int i=fromPage(); i<=to; ++i) |
832 { | 841 { |
833 vl.push_back(i); | 842 vl.push_back(i); |
834 } | 843 } |
930 { | 939 { |
931 const char* optName = s_pOptions[j].name; | 940 const char* optName = s_pOptions[j].name; |
932 const char* pos = strchr( optName,' ' ); | 941 const char* pos = strchr( optName,' ' ); |
933 int len = pos==0 ? strlen( optName ) : pos - optName; | 942 int len = pos==0 ? strlen( optName ) : pos - optName; |
934 | 943 |
935 if( s == (const char*)( QCString( optName, len+1) ) ) | 944 if( s == (const char*)( Q3CString( optName, len+1) ) ) |
936 { | 945 { |
937 return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); | 946 return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); |
938 } | 947 } |
939 } | 948 } |
940 assert(false); | 949 assert(false); |
949 { | 958 { |
950 const char* optName = s_pOptions[j].name; | 959 const char* optName = s_pOptions[j].name; |
951 const char* pos = strchr( optName,' ' ); | 960 const char* pos = strchr( optName,' ' ); |
952 int len = pos==0 ? strlen( optName ) : pos - optName; | 961 int len = pos==0 ? strlen( optName ) : pos - optName; |
953 | 962 |
954 if( s == (const char*)( QCString( optName, len+1) ) ) | 963 if( s == (const char*)( Q3CString( optName, len+1) ) ) |
955 { | 964 { |
956 return s_vOption[j]; | 965 return s_vOption[j]; |
957 } | 966 } |
958 } | 967 } |
959 | 968 |
1008 configFileName = s_argv[i+1]; | 1017 configFileName = s_argv[i+1]; |
1009 } | 1018 } |
1010 } | 1019 } |
1011 m_config.readConfigFile(configFileName); | 1020 m_config.readConfigFile(configFileName); |
1012 | 1021 |
1013 QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QString("-u;-query;-html;-abort"), '|'); | 1022 QStringList ignorableCmdLineOptionsList = m_config.readListEntry("IgnorableCmdLineOptions", QStringList("-u;-query;-html;-abort"), '|'); |
1014 QString ignorableCmdLineOptions; | 1023 QString ignorableCmdLineOptions; |
1015 if ( !ignorableCmdLineOptionsList.isEmpty() ) | 1024 if ( !ignorableCmdLineOptionsList.isEmpty() ) |
1016 ignorableCmdLineOptions = ignorableCmdLineOptionsList.front() + ";"; | 1025 ignorableCmdLineOptions = ignorableCmdLineOptionsList.front() + ";"; |
1017 | 1026 |
1018 s_vOption.resize(nofOptions); | 1027 s_vOption.resize(nofOptions); |
1047 } | 1056 } |
1048 } | 1057 } |
1049 if (j==nofOptions) | 1058 if (j==nofOptions) |
1050 { | 1059 { |
1051 QString s; | 1060 QString s; |
1052 s = QString("Unknown option: ") + s_argv[i] + "\n"; | 1061 s = QString("Unknown option: ") + QString(s_argv[i]) + "\n"; |
1053 s += "If KDiff3 should ignore this option, run KDiff3 normally and edit\n" | 1062 s += "If KDiff3 should ignore this option, run KDiff3 normally and edit\n" |
1054 "the \"Command line options to ignore\" in the \"Integration Settings\".\n\n"; | 1063 "the \"Command line options to ignore\" in the \"Integration Settings\".\n\n"; |
1055 | 1064 |
1056 s += "KDiff3-Usage when starting via commandline: \n"; | 1065 s += "KDiff3-Usage when starting via commandline: \n"; |
1057 s += "- Comparing 2 files:\t\tkdiff3 file1 file2\n"; | 1066 s += "- Comparing 2 files:\t\tkdiff3 file1 file2\n"; |