ported aboutdialog to QT4 completely qt4-port
authorinsilmaril
Wed Jul 05 10:29:54 2006 +0000 (2006-07-05)
branchqt4-port
changeset 821379539d952
parent 7 84f76a3876d7
child 9 f94317a94db1
ported aboutdialog to QT4 completely
aboutdialog.cpp
aboutdialog.h
demos/todo.vym
main.cpp
mainwindow.cpp
     1.1 --- a/aboutdialog.cpp	Tue Jul 04 12:10:56 2006 +0000
     1.2 +++ b/aboutdialog.cpp	Wed Jul 05 10:29:54 2006 +0000
     1.3 @@ -1,8 +1,6 @@
     1.4 -#include <qmime.h>
     1.5 -#include <q3process.h>
     1.6 -//Added by qt3to4:
     1.7 -#include <Q3VBoxLayout>
     1.8 -#include <Q3Frame>
     1.9 +#include <QProcess>
    1.10 +#include <QVBoxLayout>
    1.11 +#include <QFrame>
    1.12  
    1.13  #include "aboutdialog.h"
    1.14  #include "version.h"
    1.15 @@ -23,7 +21,7 @@
    1.16      tabs=new QTabWidget (this);
    1.17      credits=new AboutTextBrowser (parent,"credits");
    1.18  
    1.19 -    credits->setText (
    1.20 +    credits->setHtml(
    1.21  	"<center><img src=\""+iconPath+"vym-128x128.png\"></center>"
    1.22  	"<h3><center>VYM - View Your Mind </h3>"
    1.23  	"<p align=\"center\"> A tool to put the things you have got in your mind into a map.</p>"
    1.24 @@ -52,13 +50,15 @@
    1.25  	"<li>Matt from <a href=\"http://www.satbp.com\">www.satbp.com</a> for <a href=\"http://www.taskjuggler.org\">Taskjuggler</a> export</li>"
    1.26  	"</ul>"
    1.27  	"</li>");
    1.28 -    credits->setFrameStyle( Q3Frame::Panel | Q3Frame::Plain );
    1.29 +    credits->setFrameStyle( QFrame::Panel | QFrame::Plain );
    1.30      tabs->addTab (credits,"Credits");
    1.31  
    1.32      license=new AboutTextBrowser (parent,"license");
    1.33      license->setText (
    1.34 +	"<center>"
    1.35  	"<h3>VYM - View Your Mind</h3>"
    1.36      "<p>Copyright (C) 2004-2005  Uwe Drechsel</p>"  
    1.37 +	"</center>"
    1.38  
    1.39      "<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>"
    1.40  
    1.41 @@ -166,7 +166,7 @@
    1.42  "<p align=\"center\">END OF TERMS AND CONDITIONS</p>"
    1.43  	
    1.44  	);
    1.45 -    credits->setFrameStyle( Q3Frame::Panel | Q3Frame::Plain );
    1.46 +    credits->setFrameStyle( QFrame::Panel | QFrame::Plain );
    1.47      tabs->addTab (license,"License");
    1.48  
    1.49      mainLayout->addWidget (tabs);
    1.50 @@ -182,24 +182,14 @@
    1.51  }
    1.52  
    1.53  AboutTextBrowser::AboutTextBrowser(QWidget *parent, const char *name)
    1.54 -    : Q3TextBrowser(parent, name)
    1.55 +    : QTextBrowser(parent, name)
    1.56  {
    1.57      
    1.58  }
    1.59  
    1.60 -void AboutTextBrowser::setSource(const QString &name)
    1.61 +void AboutTextBrowser::setSource(const QUrl &url )
    1.62  {
    1.63 -    Q3MimeSourceFactory *factory = Q3MimeSourceFactory::defaultFactory();
    1.64 -    const QMimeSource *data = factory->data(name);
    1.65 -    if (data) {
    1.66 -	Q3TextBrowser::setSource(name);
    1.67 -    } else {
    1.68 -	Q3Process *proc = new Q3Process( this );
    1.69 -	proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL" ));
    1.70 -	proc->addArgument( name);
    1.71 -	
    1.72 -	if ( !proc->start() ) 
    1.73 -	    if (mainWindow->settingsURL() ) 
    1.74 -		setSource(name);
    1.75 -    }
    1.76 +	QProcess *proc= new QProcess ();
    1.77 +	proc->start( settings.readEntry("/vym/mainwindow/readerURL"),QStringList ()<<url.toString());
    1.78 +	if (!proc->waitForStarted() &&mainWindow->settingsURL() ) setSource(url);
    1.79  }
     2.1 --- a/aboutdialog.h	Tue Jul 04 12:10:56 2006 +0000
     2.2 +++ b/aboutdialog.h	Wed Jul 05 10:29:54 2006 +0000
     2.3 @@ -1,12 +1,12 @@
     2.4  #ifndef ABOUTDIALOG_H
     2.5  #define ABOUTDIALOG_H
     2.6  
     2.7 -#include <qtabwidget.h>
     2.8 -#include <q3textbrowser.h>
     2.9 -#include <qlayout.h>
    2.10 -#include <qdialog.h>
    2.11 -#include <qpushbutton.h>
    2.12 -#include <qstring.h>
    2.13 +#include <QTabWidget>
    2.14 +#include <QTextBrowser>
    2.15 +#include <QLayout>
    2.16 +#include <QDialog>
    2.17 +#include <QPushButton>
    2.18 +#include <QString>
    2.19  
    2.20  class AboutTextBrowser;
    2.21  /////////////////////////////////////////////////////////////////////////////
    2.22 @@ -29,13 +29,13 @@
    2.23  	
    2.24  };
    2.25  
    2.26 -class AboutTextBrowser : public Q3TextBrowser
    2.27 +class AboutTextBrowser : public QTextBrowser
    2.28  {
    2.29    Q_OBJECT;
    2.30   public:
    2.31    AboutTextBrowser(QWidget *parent, const char *name = 0);
    2.32   public slots:
    2.33 -   void setSource(const QString &name);
    2.34 +	virtual void setSource(const QUrl &url);
    2.35  };
    2.36  
    2.37  #endif
     3.1 Binary file demos/todo.vym has changed
     4.1 --- a/main.cpp	Tue Jul 04 12:10:56 2006 +0000
     4.2 +++ b/main.cpp	Wed Jul 05 10:29:54 2006 +0000
     4.3 @@ -1,13 +1,11 @@
     4.4  #include <QApplication>
     4.5 -#include <qpixmap.h>
     4.6 -#include <qtranslator.h>
     4.7 -#include <qdir.h>
     4.8 +#include <QPixmap>
     4.9 +#include <QTranslator>
    4.10 +#include <QDir>
    4.11  #include <q3ptrlist.h>
    4.12 -#include <qtextcodec.h>
    4.13 +#include <QTextCodec>
    4.14  #include <q3network.h>
    4.15 -#include <qmime.h>
    4.16 -//Added by qt3to4:
    4.17 -#include <Q3PopupMenu>
    4.18 +#include <QMenu>
    4.19  #include <QActionGroup>
    4.20  
    4.21  #include "settings.h"
    4.22 @@ -202,9 +200,6 @@
    4.23  		cout << "Testing: "<<options.getArg("test").ascii()<< endl;
    4.24  	}	
    4.25  
    4.26 -
    4.27 -    Q3MimeSourceFactory *factory = Q3MimeSourceFactory::defaultFactory();
    4.28 -    factory->setPixmap("vym-128x128", QPixmap(iconPath+"vym-128x128.png"));
    4.29      q3InitNetworkProtocols();
    4.30  
    4.31  
     5.1 --- a/mainwindow.cpp	Tue Jul 04 12:10:56 2006 +0000
     5.2 +++ b/mainwindow.cpp	Wed Jul 05 10:29:54 2006 +0000
     5.3 @@ -683,6 +683,7 @@
     5.4  	a = new QAction(QPixmap(), tr( "Edit URL"+QString("...") ), this);
     5.5  	a->setStatusTip ( tr( "Edit URL" ) );
     5.6  	a->setShortcut (Qt::SHIFT + Qt::CTRL+Qt::Key_U );
     5.7 +	a->setShortcutContext (Qt::WindowShortcut);
     5.8  	a->setEnabled (false);
     5.9  	actionListBranches.append(a);
    5.10      connect( a, SIGNAL( activated() ), this, SLOT( editURL() ) );
    5.11 @@ -1561,17 +1562,6 @@
    5.12  		saveImageFormatMenu->addAction ( a );
    5.13      }
    5.14  
    5.15 -/* FIXME  not needed any longer
    5.16 -	Q3StrList fmt = QImageWriter::supportedImageFormats();
    5.17 -	for (const char* f = fmt.first(); f; f = fmt.next()) 
    5.18 -	{
    5.19 -		saveImageFormatMenu->insertItem( f );
    5.20 -		exportImageFormatMenu->insertItem( f );
    5.21 -	}	
    5.22 -*/	
    5.23 -//	connect( saveImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( editSaveImage(int ) ) );
    5.24 -//	connect( exportImageFormatMenu, SIGNAL( activated(int) ), this, SLOT( fileExportImage(int ) ) );
    5.25 -	
    5.26  	floatimageContextMenu->addSeparator();	
    5.27  	actionEditCopy->addTo( floatimageContextMenu );
    5.28  	actionEditCut->addTo( floatimageContextMenu );