1.1 Binary file demos/todo.vym has changed
2.1 --- a/exportoofiledialog.cpp Wed Jul 05 10:29:54 2006 +0000
2.2 +++ b/exportoofiledialog.cpp Thu Jul 06 14:47:01 2006 +0000
2.3 @@ -2,12 +2,12 @@
2.4
2.5 #include "exportoofiledialog.h"
2.6
2.7 -ExportOOFileDialog::ExportOOFileDialog():Q3FileDialog()
2.8 +ExportOOFileDialog::ExportOOFileDialog():QFileDialog()
2.9 {
2.10 init();
2.11 }
2.12
2.13 -ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const char* name, bool modal):Q3FileDialog(parent, name,modal)
2.14 +ExportOOFileDialog::ExportOOFileDialog (QWidget * parent, const QString &caption ):QFileDialog(parent, caption)
2.15 {
2.16 init();
2.17 }
2.18 @@ -18,7 +18,7 @@
2.19 QStringList::Iterator itf=filters.begin();
2.20 while (itf != filters.end())
2.21 {
2.22 - if (*itf==lastFilter) return *itpath;
2.23 + if (*itf==selectedFilter()) return *itpath;
2.24 itpath++;
2.25 itf++;
2.26 }
2.27 @@ -33,31 +33,36 @@
2.28
2.29 QString ExportOOFileDialog::selectedFile()
2.30 {
2.31 - return Q3FileDialog::selectedFile();
2.32 + return QFileDialog::selectedFile();
2.33 }
2.34
2.35
2.36 +void ExportOOFileDialog::show()
2.37 +{
2.38 + setFilters (filters);
2.39 + QFileDialog::show();
2.40 +}
2.41 +
2.42 +void ExportOOFileDialog::init()
2.43 +{
2.44 + setMode( QFileDialog::AnyFile );
2.45 + QDir d;
2.46 + d.setPath ("/usr/share/vym/exports");
2.47 + scanExportConfigs(d);
2.48 + d.setPath (d.homeDirPath()+"/.vym/exports");
2.49 + scanExportConfigs(d);
2.50 + d.setPath (d.currentPath()+"/exports");
2.51 + scanExportConfigs(d);
2.52 +
2.53 + connect (
2.54 + this,SIGNAL (filterSelected(const QString&)),
2.55 + this, SLOT( newConfigPath(const QString &)));
2.56 +}
2.57 +
2.58 void ExportOOFileDialog::addFilter(const QString &f)
2.59 {
2.60 lastFilter=f;
2.61 filters.append (f);
2.62 - Q3FileDialog::addFilter (f);
2.63 -}
2.64 -
2.65 -void ExportOOFileDialog::init()
2.66 -{
2.67 - setMode( Q3FileDialog::AnyFile );
2.68 - QDir d;
2.69 - d.setPath ("/usr/share/vym/exports");
2.70 - scanExportConfigs(d);
2.71 - d.setPath (d.homeDirPath()+"/.vym/exports");
2.72 - scanExportConfigs(d);
2.73 - d.setPath ("exports");
2.74 - scanExportConfigs(d);
2.75 -
2.76 - connect (
2.77 - this,SIGNAL (filterSelected(const QString&)),
2.78 - this, SLOT( newConfigPath(const QString &)));
2.79 }
2.80
2.81 void ExportOOFileDialog::scanExportConfigs(QDir dir)
2.82 @@ -68,7 +73,6 @@
2.83 if (dir.exists())
2.84 {
2.85 // Traverse files
2.86 - QDir dir;
2.87 dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
2.88
2.89 QFileInfoList list = dir.entryInfoList();
3.1 --- a/exportoofiledialog.h Wed Jul 05 10:29:54 2006 +0000
3.2 +++ b/exportoofiledialog.h Thu Jul 06 14:47:01 2006 +0000
3.3 @@ -1,28 +1,28 @@
3.4 #ifndef EXPORTOOFILEDIALOG
3.5 #define EXPORTOOFILEDIALOG
3.6
3.7 -#include <q3filedialog.h>
3.8 -#include <qstringlist.h>
3.9 +#include <QFileDialog>
3.10 +#include <QStringList>
3.11
3.12 #include "settings.h"
3.13
3.14 -class ExportOOFileDialog:public Q3FileDialog
3.15 +class ExportOOFileDialog:public QFileDialog
3.16 {
3.17 Q_OBJECT
3.18 public:
3.19 ExportOOFileDialog();
3.20
3.21 - ExportOOFileDialog (QWidget * parent = 0, const char * name = 0, bool
3.22 - modal = false);
3.23 + ExportOOFileDialog (QWidget * parent = 0, const QString &caption=QString());
3.24 QString selectedConfig();
3.25 QString selectedFile();
3.26 - void addFilter(const QString &);
3.27 + void show();
3.28
3.29 private slots:
3.30 void newConfigPath (const QString&f);
3.31
3.32 private:
3.33 void init();
3.34 + void addFilter(const QString &);
3.35 void scanExportConfigs(QDir );
3.36 QStringList configPaths;
3.37 QStringList filters;
4.1 --- a/exports.cpp Wed Jul 05 10:29:54 2006 +0000
4.2 +++ b/exports.cpp Thu Jul 06 14:47:01 2006 +0000
4.3 @@ -1,6 +1,6 @@
4.4 #include <q3filedialog.h>
4.5 #include <qmessagebox.h>
4.6 -#include <q3process.h>
4.7 +#include <QProcess>
4.8 //Added by qt3to4:
4.9 #include <QTextStream>
4.10
4.11 @@ -58,10 +58,10 @@
4.12 {
4.13 if (mapCenter && mapCenter->getMapEditor())
4.14 {
4.15 - Q3FileDialog *fd=new Q3FileDialog( mapCenter->getMapEditor(), caption);
4.16 - fd->addFilter (filter);
4.17 + QFileDialog *fd=new QFileDialog( mapCenter->getMapEditor(), caption);
4.18 + fd->setFilter (filter);
4.19 fd->setCaption(caption);
4.20 - fd->setMode( Q3FileDialog::AnyFile );
4.21 + fd->setMode( QFileDialog::AnyFile );
4.22 fd->show();
4.23
4.24 if ( fd->exec() == QDialog::Accepted )
4.25 @@ -186,17 +186,14 @@
4.26 p.process();
4.27
4.28 QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
4.29 - Q3Process *proc = new Q3Process( );
4.30 - proc->addArgument(ub);
4.31 -
4.32 - if ( !proc->start() )
4.33 + QProcess *proc= new QProcess ();
4.34 + proc->start( ub);
4.35 + if (!proc->waitForStarted());
4.36 {
4.37 QMessageBox::warning(0,
4.38 QObject::tr("Warning"),
4.39 QObject::tr("Couldn't find script %1\nto notifiy Browsers of changed bookmarks.").arg(ub));
4.40 }
4.41 -
4.42 -
4.43 }
4.44 }
4.45
5.1 --- a/main.cpp Wed Jul 05 10:29:54 2006 +0000
5.2 +++ b/main.cpp Thu Jul 06 14:47:01 2006 +0000
5.3 @@ -11,7 +11,6 @@
5.4 #include "settings.h"
5.5 #include "options.h"
5.6 #include "mainwindow.h"
5.7 -
5.8 #include "flagrowobj.h"
5.9
5.10 // Global variables
6.1 --- a/mainwindow.cpp Wed Jul 05 10:29:54 2006 +0000
6.2 +++ b/mainwindow.cpp Thu Jul 06 14:47:01 2006 +0000
6.3 @@ -1,15 +1,14 @@
6.4 +#include "mainwindow.h"
6.5 +
6.6 #include <QtGui>
6.7 -
6.8 -#include "mainwindow.h"
6.9 -
6.10 -#include <qpainter.h>
6.11 -#include <qprinter.h>
6.12 -#include <qfile.h>
6.13 +#include <QPainter>
6.14 +#include <QPrinter>
6.15 +#include <QFile>
6.16 #include <q3filedialog.h>
6.17 -#include <qcolor.h>
6.18 -#include <qcolordialog.h>
6.19 -#include <qbitmap.h>
6.20 -#include <qinputdialog.h>
6.21 +#include <QColor>
6.22 +#include <QColorDialog>
6.23 +#include <QBitmap>
6.24 +#include <QInputDialog>
6.25 //Added by qt3to4:
6.26 #include <Q3StrList>
6.27 #include <QPixmap>
6.28 @@ -2353,13 +2352,13 @@
6.29 void Main::fileExportOOPresentation()
6.30 {
6.31 ExportOOFileDialog *fd=new ExportOOFileDialog( this,__VYM " - "+tr("Export to")+" Open Office");
6.32 - // FIXME add extra info in dialog
6.33 + // TODO add preview in dialog
6.34 //ImagePreview *p =new ImagePreview (fd);
6.35 //fd->setContentsPreviewEnabled( TRUE );
6.36 //fd->setContentsPreview( p, p );
6.37 //fd->setPreviewMode( QFileDialog::Contents );
6.38 fd->setCaption(__VYM " - " +tr("Export to")+" Open Office");
6.39 - //fd->setDir (lastImageDir);
6.40 + fd->setDir (QDir().current());
6.41 fd->show();
6.42
6.43 if ( fd->exec() == QDialog::Accepted )
7.1 --- a/mapeditor.cpp Wed Jul 05 10:29:54 2006 +0000
7.2 +++ b/mapeditor.cpp Thu Jul 06 14:47:01 2006 +0000
7.3 @@ -1,24 +1,23 @@
7.4 #include "mapeditor.h"
7.5
7.6 #include <qstatusbar.h>
7.7 -#include <qmessagebox.h>
7.8 +#include <QMessageBox>
7.9 #include <qapplication.h>
7.10 #include <qpainter.h>
7.11 #include <q3popupmenu.h>
7.12 #include <qprinter.h>
7.13 #include <q3paintdevicemetrics.h>
7.14 -#include <qfile.h>
7.15 +#include <QFile>
7.16 #include <q3filedialog.h>
7.17 -#include <qdir.h>
7.18 -#include <qcolor.h>
7.19 -#include <qcolordialog.h>
7.20 -#include <qbitmap.h>
7.21 -#include <q3process.h>
7.22 +#include <QDir>
7.23 +#include <QColor>
7.24 +#include <QColorDialog>
7.25 +#include <QBitmap>
7.26 #include <qinputdialog.h>
7.27 #include <q3dragobject.h>
7.28 #include <q3urloperator.h>
7.29 #include <q3networkprotocol.h>
7.30 -#include <qregexp.h>
7.31 +#include <QRegExp>
7.32 //Added by qt3to4:
7.33 #include <QResizeEvent>
7.34 #include <QContextMenuEvent>
7.35 @@ -2234,6 +2233,9 @@
7.36
7.37 BranchObj* MapEditor::findText (QString s, bool cs)
7.38 {
7.39 + QTextDocument::FindFlags flags=0;
7.40 + if (cs) flags=QTextDocument::QTextDocument::FindCaseSensitively;
7.41 +
7.42 if (!itFind)
7.43 { // Nothing found or new find process
7.44 if (EOFind)
7.45 @@ -2258,7 +2260,7 @@
7.46 adjustCanvasSize();
7.47 ensureSelectionVisible();
7.48 }
7.49 - if (textEditor->findText(s,cs))
7.50 + if (textEditor->findText(s,flags))
7.51 {
7.52 searching=false;
7.53 foundNote=true;
7.54 @@ -3111,10 +3113,10 @@
7.55 return;
7.56
7.57 QString ub=vymBaseDir.path()+"/scripts/update-bookmarks";
7.58 - Q3Process *proc = new Q3Process( this );
7.59 - proc->addArgument(ub);
7.60 -
7.61 - if ( !proc->start() )
7.62 +
7.63 + QProcess *proc= new QProcess (this);
7.64 + proc->start( ub);
7.65 + if (!proc->waitForStarted());
7.66 {
7.67 QMessageBox::warning(0,
7.68 tr("Warning"),
7.69 @@ -3122,7 +3124,7 @@
7.70 }
7.71
7.72
7.73 -/*
7.74 +/* Hide hidden stuff temporary, maybe add this as regular function somewhere
7.75 if (hidemode==HideNone)
7.76 {
7.77 setHideTmpMode (HideExport);
8.1 --- a/texteditor.cpp Wed Jul 05 10:29:54 2006 +0000
8.2 +++ b/texteditor.cpp Thu Jul 06 14:47:01 2006 +0000
8.3 @@ -1,24 +1,17 @@
8.4 #include "texteditor.h"
8.5
8.6 -#include <q3canvas.h>
8.7 -#include <qpainter.h>
8.8 -#include <qprinter.h>
8.9 -#include <qfile.h>
8.10 -#include <q3filedialog.h>
8.11 -#include <q3toolbar.h>
8.12 -#include <q3popupmenu.h>
8.13 +#include <QPainter>
8.14 +#include <QPrinter>
8.15 +#include <QFile>
8.16 +#include <QFileDialog>
8.17 #include <qmenubar.h>
8.18 -#include <q3textedit.h>
8.19 #include <qtextstream.h>
8.20 -#include <q3paintdevicemetrics.h>
8.21 -#include <qsettings.h>
8.22 -#include <qfontdialog.h>
8.23 -#include <qmessagebox.h>
8.24 -#include <qcolordialog.h>
8.25 -#include <qregexp.h>
8.26 -#include <q3simplerichtext.h>
8.27 -//Added by qt3to4:
8.28 -#include <Q3ValueList>
8.29 +#include <QSettings>
8.30 +#include <QFontDialog>
8.31 +#include <QMessageBox>
8.32 +#include <QColorDialog>
8.33 +#include <QRegExp>
8.34 +#include <QList>
8.35 #include <QPixmap>
8.36 #include <QCloseEvent>
8.37
8.38 @@ -29,7 +22,6 @@
8.39 #include "noteobj.h"
8.40 #include "version.h"
8.41
8.42 -extern Q3Canvas* actCanvas;
8.43 extern int statusbarTime;
8.44 extern QSettings settings;
8.45
8.46 @@ -56,6 +48,7 @@
8.47 e->setTextFormat(Qt::RichText); // default
8.48 e->setTabStopWidth (20); // unit is pixel
8.49 e->setColor (Qt::black);
8.50 + e->setAutoFillBackground (true);
8.51 connect (e, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
8.52 setCentralWidget( e );
8.53 statusBar()->message( "Ready", statusbarTime);
8.54 @@ -68,9 +61,6 @@
8.55 setupSettingsActions();
8.56
8.57 // Various states
8.58 - emptyPaper = QBrush(Qt::gray);
8.59 - filledPaper = QBrush(Qt::white);
8.60 - inactivePaper= QBrush(Qt::black);
8.61 setInactive();
8.62
8.63 // Load Settings
8.64 @@ -137,7 +127,7 @@
8.65
8.66 bool TextEditor::isEmpty()
8.67 {
8.68 - if (e->text().length())
8.69 + if (e->toPlainText().length()>0)
8.70 return false;
8.71 else
8.72 return true;
8.73 @@ -208,10 +198,9 @@
8.74 return filenameHint;
8.75 }
8.76
8.77 -bool TextEditor::findText(const QString &t, const bool &cs)
8.78 +bool TextEditor::findText(const QString &t, const QTextDocument::FindFlags &flags)
8.79 {
8.80 - bool wo=false; // word matches
8.81 - if (e->find (t, cs, wo, true, 0, 0 ))
8.82 + if (e->find (t,flags))
8.83 return true;
8.84 else
8.85 return false;
8.86 @@ -358,18 +347,20 @@
8.87 // comboFont = new QComboBox( true, tb );
8.88 comboFont = new QComboBox;
8.89 tb->addWidget (comboFont);
8.90 - QFontDatabase db;
8.91 - comboFont->insertStringList( db.families() );
8.92 + QFontDatabase fontDB;
8.93 + comboFont->insertStringList( fontDB.families() );
8.94 connect( comboFont, SIGNAL( activated( const QString & ) ),
8.95 this, SLOT( textFamily( const QString & ) ) );
8.96 comboFont->addItem( QApplication::font().family() );
8.97 -// comboSize = new QComboBox( true, tb );
8.98 comboSize = new QComboBox;
8.99 tb->addWidget (comboSize);
8.100 - Q3ValueList<int> sizes = db.standardSizes();
8.101 - Q3ValueList<int>::Iterator it = sizes.begin();
8.102 - for ( ; it != sizes.end(); ++it )
8.103 - comboSize->insertItem( QString::number( *it ) );
8.104 + QList<int> sizes=fontDB.standardSizes();
8.105 + QList<int>::iterator i = sizes.begin();
8.106 + while (i != sizes.end())
8.107 + {
8.108 + ++i; // increment i before using it
8.109 + comboSize->insertItem ( QString::number(*i));
8.110 + }
8.111 connect( comboSize, SIGNAL( activated( const QString & ) ),
8.112 this, SLOT( textSize( const QString & ) ) );
8.113 comboSize->addItem ( QString::number( QApplication::font().pointSize() ) );
8.114 @@ -461,10 +452,12 @@
8.115 this, SLOT( fontChanged( const QFont & ) ) );
8.116 connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
8.117 this, SLOT( colorChanged( const QColor & ) ) );
8.118 + /*
8.119 connect( e, SIGNAL( currentAlignmentChanged( int ) ),
8.120 this, SLOT( alignmentChanged( int ) ) );
8.121 connect( e, SIGNAL( currentVerticalAlignmentChanged(int)),
8.122 this, SLOT( verticalAlignmentChanged(int)));
8.123 + */
8.124
8.125 }
8.126
8.127 @@ -497,7 +490,7 @@
8.128 {
8.129 if (state!=inactiveEditor)
8.130 {
8.131 - if (e->length())
8.132 + if (e->text().length())
8.133 {
8.134 QMessageBox mb( __VYM " - " +tr("Note Editor"),
8.135 "Loading will overwrite the existing note",
8.136 @@ -513,9 +506,13 @@
8.137 }
8.138 }
8.139 // Load note
8.140 - Q3FileDialog *fd=new Q3FileDialog( this);
8.141 - fd->addFilter ("ASCII texts (*.txt)");
8.142 - fd->addFilter ("VYM notes (*.html)");
8.143 + QFileDialog *fd=new QFileDialog( this);
8.144 + QStringList types;
8.145 + types<< "VYM notes (*.html)" <<
8.146 + "ASCII texts (*.txt)" <<
8.147 + "All filed (*)";
8.148 + fd->setFilters (types);
8.149 + fd->setDirectory (QDir().current());
8.150 fd->show();
8.151 QString fn;
8.152 if ( fd->exec() == QDialog::Accepted )
8.153 @@ -544,7 +541,10 @@
8.154
8.155 QString TextEditor::getText()
8.156 {
8.157 - return e->text();
8.158 + if (e->toPlainText().isEmpty())
8.159 + return "";
8.160 + else
8.161 + return e->text();
8.162 }
8.163
8.164 void TextEditor::editorChanged()
8.165 @@ -555,9 +555,9 @@
8.166 state=filledEditor;
8.167
8.168 if (state==emptyEditor)
8.169 - e->setPaper (emptyPaper);
8.170 + setState (emptyEditor);
8.171 else
8.172 - e->setPaper (filledPaper);
8.173 + setState (filledEditor);
8.174 // SLOT is LinkableMapObj, which will update systemFlag
8.175 emit (textHasChanged() );
8.176 }
8.177 @@ -565,12 +565,8 @@
8.178
8.179 void TextEditor::setText(QString t)
8.180 {
8.181 - if ( !Q3StyleSheet::mightBeRichText( t ) )
8.182 - t = Q3StyleSheet::convertFromPlainText( t, Q3StyleSheetItem::WhiteSpaceNormal );
8.183 e->setReadOnly(false);
8.184 e->setText(t);
8.185 -// editorChanged(); //not called automagically FIXME or is it?
8.186 -
8.187 enableActions();
8.188 }
8.189
8.190 @@ -578,7 +574,7 @@
8.191 {
8.192 state=inactiveEditor;
8.193 setText("");
8.194 - e->setPaper (inactivePaper);
8.195 + setState (inactiveEditor);
8.196 e->setReadOnly (true);
8.197
8.198 disableActions();
8.199 @@ -592,7 +588,7 @@
8.200
8.201 void TextEditor::textSaveAs()
8.202 {
8.203 - QString fn = Q3FileDialog::getSaveFileName( QString::null, "VYM Note (HTML) (*.html);;All files (*)",
8.204 + QString fn = QFileDialog::getSaveFileName( QString::null, "VYM Note (HTML) (*.html);;All files (*)",
8.205 this,"export note dialog",tr("Export Note to single file") );
8.206
8.207 if ( !fn.isEmpty() )
8.208 @@ -662,9 +658,21 @@
8.209 // In X11 a copy&paste generates paragraphs,
8.210 // which is not always wanted
8.211 // This function replaces paragraphs by linebreaks.
8.212 +
8.213 + e->setBackgroundRole (QPalette::Text);
8.214 + cout << "dark\n";
8.215 +
8.216 + QString t;
8.217 + t=e->text();
8.218 + QRegExp re("<p.*>");
8.219 + re.setMinimal(true);
8.220 + t.replace (re,"");
8.221 + t.replace ("</p>","<br />");
8.222 + e->setText(t);
8.223 +
8.224 + /* FIXME QT3 use seletion ()
8.225 int parFrom, parTo, indFrom, indTo;
8.226 e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
8.227 - QString t;
8.228 if (parFrom>-1)
8.229 t=e->selectedText();
8.230 else
8.231 @@ -687,10 +695,15 @@
8.232 e->setText (e->text().replace(marker,t));
8.233 } else
8.234 e->setText(t);
8.235 + */
8.236 }
8.237
8.238 void TextEditor::textJoinLines()
8.239 {
8.240 + e->setBackgroundRole (QPalette::Light);
8.241 + cout << "light\n";
8.242 +
8.243 +/* FIXME QT3
8.244 int parFrom, parTo, indFrom, indTo;
8.245 e->getSelection (&parFrom,&indFrom,&parTo,&indTo);
8.246 QString t;
8.247 @@ -721,6 +734,7 @@
8.248 e->setText (e->text().replace(marker,t));
8.249 } else
8.250 e->setText(t);
8.251 +*/
8.252 }
8.253
8.254 void TextEditor::textExportAsASCII()
8.255 @@ -735,7 +749,7 @@
8.256 s=filenameHint;
8.257 } else
8.258 s=QString::null;
8.259 - fn = Q3FileDialog::getSaveFileName( s, "VYM Note (ASCII) (*.txt);;All files (*)", this,"export note dialog",tr("Export Note to single file (ASCII)") );
8.260 + fn = QFileDialog::getSaveFileName( s, "VYM Note (ASCII) (*.txt);;All files (*)", this,"export note dialog",tr("Export Note to single file (ASCII)") );
8.261 int ret=-1;
8.262
8.263 if ( !fn.isEmpty() )
8.264 @@ -776,41 +790,16 @@
8.265
8.266 void TextEditor::textPrint()
8.267 {
8.268 - printer->setFullPage(TRUE);
8.269 - if ( printer->setup( this ) )
8.270 - {
8.271 - QPainter p( printer );
8.272 - // Check that there is a valid device to print to.
8.273 - if ( !p.device() ) return;
8.274 - Q3PaintDeviceMetrics metrics( p.device() );
8.275 - int dpiy = metrics.logicalDpiY();
8.276 - int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
8.277 - QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
8.278 - QFont font( e->currentFont() );
8.279 - font.setPointSize( 10 ); // we define 10pt to be a nice base size for printing
8.280
8.281 - Q3SimpleRichText richText( e->text(), font,
8.282 - e->context(),
8.283 - e->styleSheet(),
8.284 - e->mimeSourceFactory(),
8.285 - body.height() );
8.286 - richText.setWidth( &p, body.width() );
8.287 - QRect view( body );
8.288 - int page = 1;
8.289 - do
8.290 - {
8.291 - richText.draw( &p, body.left(), body.top(), view, colorGroup() );
8.292 - view.moveBy( 0, body.height() );
8.293 - p.translate( 0 , -body.height() );
8.294 - p.setFont( font );
8.295 - p.drawText( view.right() - p.fontMetrics().width( QString::number( page ) ),
8.296 - view.bottom() + p.fontMetrics().ascent() + 5, QString::number( page ) );
8.297 - if ( view.top() >= richText.height() )
8.298 - break;
8.299 - printer->newPage();
8.300 - page++;
8.301 - } while (TRUE);
8.302 - }
8.303 + QTextDocument *document = e->document();
8.304 + QPrinter printer;
8.305 +
8.306 + QPrintDialog *dialog = new QPrintDialog(&printer, this);
8.307 + dialog->setWindowTitle(tr("Print Document"));
8.308 + if (dialog->exec() != QDialog::Accepted)
8.309 + return;
8.310 +
8.311 + document->print(&printer);
8.312 }
8.313
8.314 void TextEditor::textEditUndo()
8.315 @@ -820,12 +809,12 @@
8.316 void TextEditor::toggleFonthint()
8.317 {
8.318 setUpdatesEnabled (false);
8.319 - e->selectAll (true);
8.320 + e->selectAll ();
8.321 if (!actionFormatUseFixedFont->isOn() )
8.322 e->setCurrentFont (varFont);
8.323 else
8.324 e->setCurrentFont (fixedFont);
8.325 - e->selectAll (false);
8.326 + e->selectAll ();
8.327 setUpdatesEnabled (true);
8.328 repaint();
8.329 }
8.330 @@ -901,13 +890,15 @@
8.331
8.332 void TextEditor::textVAlign()
8.333 {
8.334 +/* FIXME QT3
8.335 if ( sender() == actionAlignSuperScript && actionAlignSuperScript->isOn()) {
8.336 - e->setVerticalAlignment( Q3TextEdit::AlignSuperScript);
8.337 + e->setVerticalAlignment( QTextEdit::AlignSuperScript);
8.338 } else if (sender() == actionAlignSubScript && actionAlignSubScript->isOn()) {
8.339 - e->setVerticalAlignment( Q3TextEdit::AlignSubScript);
8.340 + e->setVerticalAlignment( QTextEdit::AlignSubScript);
8.341 } else {
8.342 - e->setVerticalAlignment( Q3TextEdit::AlignNormal);
8.343 + e->setVerticalAlignment( QTextEdit::AlignNormal);
8.344 }
8.345 +*/
8.346 }
8.347
8.348
8.349 @@ -943,16 +934,18 @@
8.350
8.351 void TextEditor::verticalAlignmentChanged(int a)
8.352 {
8.353 - if (a == Q3TextEdit::AlignSuperScript ) {
8.354 + /* FIXME QT3
8.355 + if (a == QTextEdit::AlignSuperScript ) {
8.356 actionAlignSuperScript->setOn(true);
8.357 actionAlignSubScript->setOn(false);
8.358 - } else if (a == Q3TextEdit::AlignSubScript ) {
8.359 + } else if (a == QTextEdit::AlignSubScript ) {
8.360 actionAlignSuperScript->setOn(false);
8.361 actionAlignSubScript->setOn(true);
8.362 } else {
8.363 actionAlignSuperScript->setOn(false);
8.364 actionAlignSubScript->setOn(false);
8.365 }
8.366 + */
8.367 }
8.368
8.369
8.370 @@ -991,4 +984,20 @@
8.371 actionFormatUseFixedFont->setEnabled(false);
8.372 }
8.373
8.374 +void TextEditor::setState (EditorState s)
8.375 +{
8.376 +
8.377 + QPalette p=palette();
8.378 + QColor c;
8.379 + switch (s)
8.380 + {
8.381 + case emptyEditor: c=QColor (150,150,150); break;
8.382 + case filledEditor: c=QColor (255,255,255); break;
8.383 + case inactiveEditor: c=QColor (0,0,0);
8.384 + }
8.385 + p.setColor(QPalette::Active, static_cast<QPalette::ColorRole>(9), c);
8.386 + p.setColor(QPalette::Inactive, static_cast<QPalette::ColorRole>(9), c);
8.387 + e->setPalette(p);
8.388 +}
8.389
8.390 +
9.1 --- a/texteditor.h Wed Jul 05 10:29:54 2006 +0000
9.2 +++ b/texteditor.h Thu Jul 06 14:47:01 2006 +0000
9.3 @@ -1,13 +1,10 @@
9.4 -/* emacs: -*- Mode: C; c-style: "bsd"; c-basic-offset: 4; c-recognize-knr-p: nil; -*- */
9.5 #ifndef TEXTEDITOR_H
9.6 #define TEXTEDITOR_H
9.7
9.8 #include <QtGui>
9.9 -#include <q3mainwindow.h>
9.10 -#include <q3textedit.h>
9.11 -#include <qfontdatabase.h>
9.12 -#include <qcombobox.h>
9.13 -//Added by qt3to4:
9.14 +#include <QTextEdit>
9.15 +#include <QFontDatabase>
9.16 +#include <QComboBox>
9.17 #include <QCloseEvent>
9.18
9.19
9.20 @@ -31,7 +28,7 @@
9.21 QString getFilename ();
9.22 void setFilenameHint (const QString&);
9.23 QString getFilenameHint ();
9.24 - bool findText(const QString &, const bool &); // find Text
9.25 + bool findText(const QString &, const QTextDocument::FindFlags &); // find Text
9.26
9.27 protected:
9.28 void setupFileActions();
9.29 @@ -81,6 +78,7 @@
9.30 void verticalAlignmentChanged(int a);
9.31 void enableActions();
9.32 void disableActions();
9.33 + void setState (EditorState);
9.34
9.35 private:
9.36 QPrinter *printer;
9.37 @@ -129,7 +127,7 @@
9.38 *actionAlignSuperScript;
9.39 };
9.40
9.41 -/* Wraps currentVerticalAlignmentChanged(VerticalAlignment)
9.42 +/* FIXME Wraps currentVerticalAlignmentChanged(VerticalAlignment)
9.43 * to currentVerticalAlignmentChanged(int)
9.44 * this way the signal can be used without use of the internal
9.45 * VerticalAlignment enum of QTextEdit
9.46 @@ -137,26 +135,31 @@
9.47 * have been no problems!
9.48 */
9.49
9.50 -class MyTextEdit : public Q3TextEdit
9.51 +class MyTextEdit : public QTextEdit
9.52 {
9.53 Q_OBJECT;
9.54 public:
9.55 - MyTextEdit(QWidget *parent, const char *name) : Q3TextEdit(parent, name) {
9.56 - connect(this,
9.57 - SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)),
9.58 - this,
9.59 - SLOT(verticalAlignmentChanged(VerticalAlignment)));
9.60 + MyTextEdit(QWidget *parent, const char *name) : QTextEdit(parent, name)
9.61 + {
9.62 + /*
9.63 + connect(
9.64 + this, SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)),
9.65 + this, SLOT(verticalAlignmentChanged(VerticalAlignment)));
9.66 + */
9.67 }
9.68 - int verticalAlignment() const { return m_verticalAlignment; }
9.69 +// int verticalAlignment() const { return m_verticalAlignment; }
9.70 signals:
9.71 - void currentVerticalAlignmentChanged(int a);
9.72 +// void currentVerticalAlignmentChanged(int a);
9.73 public slots:
9.74 - void verticalAlignmentChanged(VerticalAlignment a) {
9.75 - m_verticalAlignment = a;
9.76 - emit currentVerticalAlignmentChanged((int)a);
9.77 + /*
9.78 + void verticalAlignmentChanged(VerticalAlignment a)
9.79 + {
9.80 + m_verticalAlignment = a;
9.81 + emit currentVerticalAlignmentChanged((int)a);
9.82 }
9.83 +*/
9.84 private:
9.85 - int m_verticalAlignment;
9.86 +// int m_verticalAlignment;
9.87 };
9.88
9.89 #endif
10.1 --- a/version.h Wed Jul 05 10:29:54 2006 +0000
10.2 +++ b/version.h Thu Jul 06 14:47:01 2006 +0000
10.3 @@ -3,6 +3,6 @@
10.4
10.5 #define __VYM "VYM"
10.6 #define __VYM_VERSION "1.8.50"
10.7 -#define __BUILD_DATE "June 16, 2006"
10.8 +#define __BUILD_DATE "July 5, 2006"
10.9
10.10 #endif