# HG changeset patch
# User insilmaril
# Date 1150280881 0
# Node ID 5cfbba1dc2f8fbdd9d7a8d8a7127bf9198bafa76
# Parent  ec3d2962893dd2447fae82ca76c8c9facb2d7009
Ported TextEditor Actions to QT4

diff -r ec3d2962893d -r 5cfbba1dc2f8 mainwindow.cpp
--- a/mainwindow.cpp	Tue Jun 13 13:54:53 2006 +0000
+++ b/mainwindow.cpp	Wed Jun 14 10:28:01 2006 +0000
@@ -2,10 +2,6 @@
 
 #include "mainwindow.h"
 
-//#include <qstatusbar.h>
-//#include <qmessagebox.h>
-//#include <qmenubar.h>
-//#include <qapplication.h>
 #include <qpainter.h>
 #include <qprinter.h>
 #include <qfile.h>
@@ -235,7 +231,7 @@
     setupHelpActions();
     
 	// After menu is created, we can enable some actions
-//FIXME testing	actionFilePrint->setEnabled (true);
+//FIXME  QT3 testing	actionFilePrint->setEnabled (true);
 
     statusBar();
 
@@ -455,8 +451,7 @@
 {
     QToolBar *tb = addToolBar( tr ("&Edit") );
     tb->setLabel( "Edit Actions" );
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Edit" ), menu );
+    QMenu *editMenu = menuBar()->addMenu( tr("&Edit") );
 
     QAction *a;
 	QAction *alt;
@@ -465,8 +460,8 @@
 	a->setStatusTip (tr( "Undo" ) );
 	a->setShortcut ( Qt::CTRL + Qt::Key_Z );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
 	actionEditUndo=a;
     
     if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
@@ -474,18 +469,17 @@
 		a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo" ), this); 
 		a->setStatusTip (tr( "Redo" ));
 		a->setShortcut (Qt::CTRL + Qt::Key_Y );
-		a->addTo( tb );
-		a->addTo( menu );
+		editMenu->addAction (a);
 		connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
 	}
    
-    menu->insertSeparator();
+	editMenu->addSeparator();
     a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy" ), this);
 	a->setStatusTip ( tr( "Copy" ) );
 	a->setShortcut (Qt::CTRL + Qt::Key_C );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
 	actionEditCopy=a;
 	
@@ -493,8 +487,8 @@
 	a->setStatusTip ( tr( "Cut" ) );
 	a->setShortcut (Qt::CTRL + Qt::Key_X );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
 	actionEditCut=a;
     connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
 	
@@ -503,16 +497,111 @@
 	a->setStatusTip ( tr( "Paste" ) );
 	a->setShortcut ( Qt::CTRL + Qt::Key_V );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
 	actionEditPaste=a;
 
+    // Shortcuts to modify heading:
+	/*
+    a = new QAction(tr( "Edit heading" ),this);
+	a->setStatusTip ( tr( "edit Heading" ));
+	a->setShortcut ( Qt::Key_Enter);
+    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
+	actionListBranches.append(a);
+	*/
+    a = new QAction( tr( "Edit heading" ), this);
+	a->setStatusTip (tr( "edit Heading" ));
+	a->setShortcut (Qt::Key_Return );
+    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
+	//actionListBranches.append(a);
+	editMenu->addAction (a);
+	actionEditHeading=a;
+	/*
+    a = new QAction( tr( "Edit heading" ),this);
+	a->setStatusTip (tr( "edit Heading" ));
+	a->setShortcut ( Qt::Key_F2 );
+    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
+	a->setEnabled (false);
+	actionListBranches.append(a);
+	*/
+    
+    // Shortcut to delete selection
+    a = new QAction( tr( "Delete Selection" ),this);
+	a->setStatusTip (tr( "Delete Selection" ));
+	a->setShortcut ( Qt::Key_Delete);
+    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
+	a->setEnabled (false);
+	actionEditDelete=a;
+    
+    // Shortcut to add branch
+	alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
+	alt->setStatusTip ( tr( "Add a branch as child of selection" ));
+	alt->setShortcut (Qt::Key_A);
+	connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
+	a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child" ), this);
+	a->setStatusTip ( tr( "Add a branch as child of selection" ));
+	a->setShortcut (Qt::Key_Insert);	
+//	a->setEnabled (false);
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
+	actionListBranches.append(a);
+	#if defined (Q_OS_MACX)
+		// In OSX show different shortcut in menues, the keys work indepently always			
+		actionEditAddBranch=alt;
+	#else	
+		actionEditAddBranch=a;
+	#endif	
+	editMenu->addAction (actionEditAddBranch);
+	tb->addAction (actionEditAddBranch);
+
+
+    // Add branch by inserting it at selection
+	a = new QAction(tr( "Add branch (insert)" ), this);
+	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
+	a->setShortcut (Qt::ALT + Qt::Key_Insert );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
+	a->setEnabled (false);
+	actionListBranches.append(a);
+	actionEditAddBranchHere=a;
+	a = new QAction(tr( "Add branch (insert)" ),this);
+	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
+	a->setShortcut ( Qt::ALT + Qt::Key_A );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
+	actionListBranches.append(a);
+
+	// Add branch above
+    a = new QAction(tr( "Add branch above" ), this);
+	a->setStatusTip ( tr( "Add a branch above selection" ));
+	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
+	a->setEnabled (false);
+	actionListBranches.append(a);
+	actionEditAddBranchAbove=a;
+    a = new QAction(tr( "Add branch above" ), this);
+	a->setStatusTip ( tr( "Add a branch above selection" ));
+	a->setShortcut (Qt::SHIFT+Qt::Key_A );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
+	actionListBranches.append(a);
+
+	// Add branch below 
+    a = new QAction(tr( "Add branch below" ), this);
+	a->setStatusTip ( tr( "Add a branch below selection" ));
+	a->setShortcut (Qt::CTRL +Qt::Key_Insert );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
+	a->setEnabled (false);
+	actionListBranches.append(a);
+	actionEditAddBranchBelow=a;
+    a = new QAction(tr( "Add branch below" ), this);
+	a->setStatusTip ( tr( "Add a branch below selection" ));
+	a->setShortcut (Qt::CTRL +Qt::Key_A );
+    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
+	actionListBranches.append(a);
+
     a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up" ), this);
 	a->setStatusTip ( tr( "Move branch up" ) );
 	a->setShortcut (Qt::Key_PageUp );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( editMoveUp() ) );
 	actionEditMoveUp=a;
 
@@ -521,8 +610,8 @@
 	a->setStatusTip (tr( "Move branch down" ) );
 	a->setShortcut ( Qt::Key_PageDown );
 	a->setEnabled (false);
-    a->addTo( tb );
-    a->addTo( menu );
+    tb->addAction (a);
+	editMenu->addAction (a);
 	actionEditMoveDown=a;
 	
 
@@ -541,29 +630,30 @@
 	#endif	
 	actionEditToggleScroll->setEnabled (false);
 	actionEditToggleScroll->setToggleAction(true);
-    actionEditToggleScroll->addTo( tb );
-    actionEditToggleScroll->addTo( menu );
+    tb->addAction (actionEditToggleScroll);
+    editMenu->addAction ( actionEditToggleScroll);
+	editMenu->addAction (actionEditToggleScroll);
 	actionListBranches.append(actionEditToggleScroll);
 	
     a = new QAction( tr( "Unscroll all scrolled branches" ), this);
 	a->setStatusTip (tr( "Unscroll all" ));
-    a->addTo( menu );
+	editMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( editUnScrollAll() ) );
 	
-    menu->insertSeparator();
+	editMenu->addSeparator();
 
 	a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find"+QString("...") ), this);
 	a->setStatusTip (tr( "Find" ) );
 	a->setShortcut (Qt::CTRL + Qt::Key_F );
-    a->addTo( menu );
+	editMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( editOpenFindWindow() ) );
     
-	menu->insertSeparator();
+	editMenu->addSeparator();
 
 	a = new QAction( QPixmap(flagsPath+"flag-url.png"), tr( "Open URL" ), this);
 	a->setShortcut (Qt::CTRL + Qt::Key_U );
 	a->setShortcut (tr( "Open URL" ));
-    a->addTo( tb );
+    tb->addAction (a);
 	a->setEnabled (false);
     connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) );
 	actionEditOpenURL=a;
@@ -606,7 +696,7 @@
 	
     a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Jump to map" ), this);
 	a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" ));
-    a->addTo( tb );
+    tb->addAction (a);
 	a->setEnabled (false);
     connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) );
 	actionEditOpenVymLink=a;
@@ -628,7 +718,7 @@
 	a->setStatusTip ( tr( "Hide object in exports" ) );
 	a->setShortcut (Qt::Key_H );
 	a->setToggleAction(true);
-    a->addTo( tb );
+    tb->addAction (a);
 	a->setEnabled (false);
     connect( a, SIGNAL( activated() ), this, SLOT( editToggleHideExport() ) );
 	actionEditToggleHideExport=a;
@@ -639,99 +729,7 @@
     connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) );
 	actionEditMapInfo=a;
 
-	menu->insertSeparator();
-
-    // Shortcuts to modify heading:
-	/*
-    a = new QAction(tr( "Edit heading" ),this);
-	a->setStatusTip ( tr( "edit Heading" ));
-	a->setShortcut ( Qt::Key_Enter);
-    connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
-	actionListBranches.append(a);
-	*/
-    a = new QAction( tr( "Edit heading" ), this);
-	a->setStatusTip (tr( "edit Heading" ));
-	a->setShortcut (Qt::Key_Return );
-    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
-	//actionListBranches.append(a);
-    a->addTo( menu );
-	actionEditHeading=a;
-	/*
-    a = new QAction( tr( "Edit heading" ),this);
-	a->setStatusTip (tr( "edit Heading" ));
-	a->setShortcut ( Qt::Key_F2 );
-    connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) );
-	a->setEnabled (false);
-	actionListBranches.append(a);
-	*/
-    
-    // Shortcut to delete selection
-    a = new QAction( tr( "Delete Selection" ),this);
-	a->setStatusTip (tr( "Delete Selection" ));
-	a->setShortcut ( Qt::Key_Delete);
-    connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) );
-	a->setEnabled (false);
-	actionEditDelete=a;
-    
-    // Shortcut to add branch
-	alt = new QAction(tr( "Add branch as child" ), this);
-	alt->setStatusTip ( tr( "Add a branch as child of selection" ));
-	alt->setShortcut (Qt::Key_A);
-	connect( alt, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
-	a = new QAction(tr( "Add branch as child" ), this);
-	a->setStatusTip ( tr( "Add a branch as child of selection" ));
-	a->setShortcut (Qt::Key_Insert);	
-//	a->setEnabled (false);
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranch() ) );
-	actionListBranches.append(a);
-	#if defined (Q_OS_MACX)
-		// In OSX show different shortcut in menues, the keys work independtly always			
-		actionEditAddBranch=alt;
-	#else	
-		actionEditAddBranch=a;
-	#endif	
-
-    // Add branch by inserting it at selection
-	a = new QAction(tr( "Add branch (insert)" ), this);
-	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
-	a->setShortcut (Qt::ALT + Qt::Key_Insert );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
-	a->setEnabled (false);
-	actionListBranches.append(a);
-	actionEditAddBranchHere=a;
-	a = new QAction(tr( "Add branch (insert)" ),this);
-	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
-	a->setShortcut ( Qt::ALT + Qt::Key_A );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
-	actionListBranches.append(a);
-
-	// Add branch above
-    a = new QAction(tr( "Add branch above" ), this);
-	a->setStatusTip ( tr( "Add a branch above selection" ));
-	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
-	a->setEnabled (false);
-	actionListBranches.append(a);
-	actionEditAddBranchAbove=a;
-    a = new QAction(tr( "Add branch above" ), this);
-	a->setStatusTip ( tr( "Add a branch above selection" ));
-	a->setShortcut (Qt::SHIFT+Qt::Key_A );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
-	actionListBranches.append(a);
-
-	// Add branch below 
-    a = new QAction(tr( "Add branch below" ), this);
-	a->setStatusTip ( tr( "Add a branch below selection" ));
-	a->setShortcut (Qt::CTRL +Qt::Key_Insert );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
-	a->setEnabled (false);
-	actionListBranches.append(a);
-	actionEditAddBranchBelow=a;
-    a = new QAction(tr( "Add branch below" ), this);
-	a->setStatusTip ( tr( "Add a branch below selection" ));
-	a->setShortcut (Qt::CTRL +Qt::Key_A );
-    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
-	actionListBranches.append(a);
+	editMenu->addSeparator();
 
 	// Import at selection (adding to selection)
     a = new QAction( tr( "Add map (insert)" ),this);
@@ -796,7 +794,7 @@
 	a->setStatusTip (tr( "Select first branch" ));
 	a->setShortcut (Qt::Key_Home );
 	a->setEnabled (false);
-    a->addTo ( menu );
+	editMenu->addAction (a);
 	actionListBranches.append(a);
 	actionEditSelectFirst=a;
     connect( a, SIGNAL( activated() ), this, SLOT( editFirstBranch() ) );
@@ -805,7 +803,7 @@
 	a->setShortcut ( Qt::Key_End );
     connect( a, SIGNAL( activated() ), this, SLOT( editLastBranch() ) );
 	a->setEnabled (false);
-    a->addTo ( menu );
+	editMenu->addAction (a);
 	actionListBranches.append(a);
 	actionEditSelectLast=a;
 
@@ -819,8 +817,7 @@
 // Format Actions
 void Main::setupFormatActions()
 {
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "F&ormat" ), menu );
+    QMenu *formatMenu = menuBar()->addMenu (tr ("F&ormat"));
 
     QToolBar *tb = addToolBar( tr("Format Actions","Toolbars"));
     QAction *a;
@@ -830,7 +827,7 @@
 	a->setStatusTip ( tr( "Set Color" ));
     connect( a, SIGNAL( activated() ), this, SLOT( formatSelectColor() ) );
     a->addTo( tb );
-    a->addTo( menu );
+	formatMenu->addAction (a);
 	actionFormatColor=a;
     a= new QAction( QPixmap(iconPath+"formatcolorpicker.png"), tr( "Pic&k color" ), this);
 	a->setStatusTip (tr( "Pick color\nHint: You can pick a color from another branch and color using CTRL+Left Button" ) );
@@ -838,7 +835,7 @@
     connect( a, SIGNAL( activated() ), this, SLOT( formatPickColor() ) );
 	a->setEnabled (false);
     a->addTo( tb );
-    a->addTo( menu );
+	formatMenu->addAction (a);
 	actionListBranches.append(a);
 	actionFormatPickColor=a;
 
@@ -848,7 +845,7 @@
     connect( a, SIGNAL( activated() ), this, SLOT( formatColorItem() ) );
 	a->setEnabled (false);
     a->addTo( tb );
-    a->addTo( menu );
+	formatMenu->addAction (a);
 	actionListBranches.append(a);
 	actionFormatColorBranch=a;
 
@@ -857,35 +854,39 @@
 	a->setShortcut (Qt::CTRL + Qt::Key_T);
     connect( a, SIGNAL( activated() ), this, SLOT( formatColorBranch() ) );
 	a->setEnabled (false);
-    a->addTo( menu );
+	formatMenu->addAction (a);
     a->addTo( tb );
 	actionListBranches.append(a);
 	actionFormatColorSubtree=a;
 
-    menu->insertSeparator();
+	formatMenu->addSeparator();
 	actionGroupFormatLinkStyles=new QActionGroup ( this);
 	actionGroupFormatLinkStyles->setExclusive (true);
     a= new QAction( tr( "Linkstyle Line" ), actionGroupFormatLinkStyles);
 	a->setStatusTip (tr( "Line" ));
 	a->setToggleAction(true);
     connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleLine() ) );
+	formatMenu->addAction (a);
 	actionFormatLinkStyleLine=a;
     a= new QAction( tr( "Linkstyle Parabel" ), actionGroupFormatLinkStyles);
 	a->setStatusTip (tr( "Line" ));
 	a->setToggleAction(true);
     connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStyleParabel() ) );
+	formatMenu->addAction (a);
 	actionFormatLinkStyleParabel=a;
     a= new QAction( tr( "Linkstyle Thick Line" ), actionGroupFormatLinkStyles );
 	a->setStatusTip (tr( "PolyLine" ));
 	a->setToggleAction(true);
     connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyLine() ) );
+	formatMenu->addAction (a);
 	actionFormatLinkStylePolyLine=a;
     a= new QAction( tr( "Linkstyle Thick Parabel" ), actionGroupFormatLinkStyles);
 	a->setStatusTip (tr( "PolyParabel" ) );
 	a->setToggleAction(true);
+	a->setChecked (true);
     connect( a, SIGNAL( activated() ), this, SLOT( formatLinkStylePolyParabel() ) );
+	formatMenu->addAction (a);
 	actionFormatLinkStylePolyParabel=a;
-	actionGroupFormatLinkStyles->addTo (menu);
 	
 	actionGroupFormatFrameTypes=new QActionGroup ( this);
 	actionGroupFormatFrameTypes->setExclusive (true);
@@ -918,24 +919,24 @@
     connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) );
 	actionFormatHideLinkUnselected=a;
 
-    menu->insertSeparator();
+	formatMenu->addSeparator();
     a= new QAction( tr( "&Use color of heading for link" ),  this);
 	a->setStatusTip (tr( "Use same color for links and headings" ));
 	a->setToggleAction(true);
     connect( a, SIGNAL( activated() ), this, SLOT( formatToggleLinkColorHint() ) );
-	a->addTo( menu );
+	formatMenu->addAction (a);
 	actionFormatLinkColorHint=a;
 
     pix.fill (Qt::white);
     a= new QAction( pix, tr( "Set &Link Color"+QString("...") ), this  );
 	a->setStatusTip (tr( "Set Link Color" ));
-    a->addTo( menu );
+	formatMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( formatSelectLinkColor() ) );
     actionFormatLinkColor=a;
 
     a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
 	a->setStatusTip (tr( "Set Background Color" ));
-    a->addTo( menu );
+	formatMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( formatSelectBackColor() ) );
     actionFormatBackColor=a;
 }
@@ -945,29 +946,28 @@
 {
     QToolBar *tb = addToolBar( tr("View Actions","Toolbars") );
     tb->setLabel( "View Actions" );
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&View" ), menu );
+    QMenu *viewMenu = menuBar()->addMenu ( tr( "&View" ));
 
     QAction *a;
     a = new QAction(QPixmap(iconPath+"viewmag-reset.png"), tr( "reset Zoom" ), this);
 	a->setStatusTip ( tr( "Zoom reset" ) );
 	a->setShortcut (Qt::CTRL + Qt::Key_0 );
     a->addTo( tb );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(viewZoomReset() ) );
 	
     a = new QAction( QPixmap(iconPath+"viewmag+.png"), tr( "Zoom in" ), this);
 	a->setStatusTip (tr( "Zoom in" ));
 	a->setShortcut (Qt::CTRL + Qt::Key_Plus);
     a->addTo( tb );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(viewZoomIn() ) );
 	
     a = new QAction( QPixmap(iconPath+"viewmag-.png"), tr( "Zoom out" ), this);
 	a->setStatusTip (tr( "Zoom out" ));
 	a->setShortcut (Qt::CTRL + Qt::Key_Minus );
     a->addTo( tb );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( viewZoomOut() ) );
 
 
@@ -980,7 +980,7 @@
 	else	
 		a->setOn(false);
     a->addTo( tb );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(windowToggleNoteEditor() ) );
 	actionViewToggleNoteEditor=a;
 
@@ -988,20 +988,20 @@
 	a->setStatusTip ( tr( "Show history window" ));
 	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
 	a->setToggleAction(false);
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(windowToggleHistory() ) );
 	actionViewToggleHistoryWindow=a;
 
     a = new QAction(tr( "Next Window" ), this);
 	a->setStatusTip ( tr( "&Next Window" ) );
 	a->setShortcut (Qt::ALT + Qt::Key_N );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(windowNextEditor() ) );
 
     a = new QAction (tr( "Previous Window" ), this );
 	a->setStatusTip (tr( "&Previous Window" ));
 	a->setShortcut (Qt::ALT + Qt::Key_P );
-    a->addTo( menu );
+	viewMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT(windowPreviousEditor() ) );
 }
 
@@ -1359,56 +1359,54 @@
 // Settings Actions
 void Main::setupSettingsActions()
 {
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Settings" ), menu );
+    QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ));
 
 	QAction *a;
 
-
     a = new QAction( tr( "Set application to open pdf files"), this);
     a->setStatusTip ( tr( "Set application to open pdf files"));
     connect( a, SIGNAL( activated() ), this, SLOT( settingsPDF() ) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 
     a = new QAction( tr( "Set application to open external links"), this);
     a->setStatusTip( tr( "Set application to open external links"));
     connect( a, SIGNAL( activated() ), this, SLOT( settingsURL() ) );
-    a->addTo( menu );
-
-    menu->insertSeparator();
+	settingsMenu->addAction (a);
+
+	settingsMenu->addSeparator();
     a = new QAction( tr( "Edit branch after adding it" ), this );
     a->setStatusTip( tr( "Edit branch after adding it" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoedit",true) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsAutoedit=a;
 
     a= new QAction( tr( "Select branch after adding it" ), this );
     a->setStatusTip( tr( "Select branch after adding it" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselect",false) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsAutoselectHeading=a;
 	
     a= new QAction(tr( "Select existing heading" ), this);
     a->setStatusTip( tr( "Select heading before editing" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/autoselectexistingtext",true) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsAutoselectText=a;
 	
     a= new QAction(tr( "pasting into new branch" ), this );
     a->setStatusTip( tr( "Pasting into new branch" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/newheadingisempty",true) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsPasteNewHeading=a;
 	
     a= new QAction( tr( "Delete key" ), this);
     a->setStatusTip( tr( "Delete key for deleting branches" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
     connect( a, SIGNAL( activated() ), this, SLOT( settingsToggleDelKey() ) );
 	actionSettingsUseDelKey=a;
 
@@ -1416,51 +1414,49 @@
     a->setStatusTip( tr( "Use exclusive flags in flag toolbars" ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useFlagGroups",true) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsUseFlagGroups=a;
 	
     a= new QAction( tr( "Use hide flags" ), this);
     a->setStatusTip( tr( "Use hide flag during exports " ));
 	a->setToggleAction(true);
 	a->setOn ( settings.readBoolEntry ("/vym/export/useHideExport",true) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsUseHideExport=a;
 }
 
 // Test Actions
 void Main::setupTestActions()
 {
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Test" ), menu );
+    QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
 
     QAction *a;
     a = new QAction( tr( "test flag" ), this);
     a->setStatusTip( tr( "Call test function" ));
     connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
-    a->addTo( menu );
+	testMenu->addAction (a);
 }
 
 // Help Actions
 void Main::setupHelpActions()
 {
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Help" ), menu );
+    QMenu *helpMenu = menuBar()->addMenu ( tr( "&Help" ));
 
     QAction *a;
     a = new QAction(  tr( "Open VYM Documentation (pdf) " ), this );
     a->setStatusTip( tr( "Open VYM Documentation (pdf)" ));
     connect( a, SIGNAL( activated() ), this, SLOT( helpDoc() ) );
-    a->addTo( menu );
+	helpMenu->addAction (a);
 
     a = new QAction( tr( "About VYM" ), this);
     a->setStatusTip( tr( "About VYM")+" "__VYM);
     connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
-    a->addTo( menu );
+	helpMenu->addAction (a);
 
     a = new QAction( tr( "About QT" ), this);
     a->setStatusTip( tr( "Information about QT toolkit" ));
     connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQT() ) );
-    a->addTo( menu );
+	helpMenu->addAction (a);
 }
 
 // Context Menus
@@ -1495,33 +1491,34 @@
 
 	actionEditSaveBranch->addTo( branchContextMenu );
 
-/*
 	branchContextMenu->addSeparator();	
-	actionEditOpenURL->addTo ( branchContextMenu );
-	actionEditOpenURLTab->addTo ( branchContextMenu );
-	actionEditURL->addTo ( branchContextMenu );
-	actionEditHeading2URL->addTo ( branchContextMenu );
-	actionEditBugzilla2URL->addTo( branchContextMenu );
+	branchContextMenu->addAction ( actionEditOpenURL );
+	branchContextMenu->addAction ( actionEditOpenURLTab );
+	branchContextMenu->addAction ( actionEditURL );
+	branchContextMenu->addAction ( actionEditHeading2URL );
+	branchContextMenu->addAction ( actionEditBugzilla2URL );
     if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
 	{
-		actionEditFATE2URL->addTo( branchContextMenu );
+		branchContextMenu->addAction ( actionEditFATE2URL );
 	}	
-	branchContextMenu->insertSeparator();	
-	actionEditOpenVymLink->addTo ( branchContextMenu );
-	actionEditVymLink->addTo ( branchContextMenu );
-	actionEditDeleteVymLink->addTo ( branchContextMenu );
+	branchContextMenu->addSeparator();	
+	branchContextMenu->addAction ( actionEditOpenVymLink );
+	branchContextMenu->addAction ( actionEditVymLink );
+	branchContextMenu->addAction ( actionEditDeleteVymLink );
 	
-	branchContextMenu->insertSeparator();	
-	actionGroupFormatFrameTypes->addTo( branchContextMenu );
-
-	branchContextMenu->insertSeparator();	
-	actionFormatIncludeImagesVer->addTo( branchContextMenu );
-	actionFormatIncludeImagesHor->addTo( branchContextMenu );
-	actionFormatHideLinkUnselected->addTo( branchContextMenu );
+	branchContextMenu->addSeparator();	
+	branchContextMenu->addAction ( actionFormatFrameNone );
+	branchContextMenu->addAction ( actionFormatFrameRectangle);
+
+	branchContextMenu->addSeparator();	
+	branchContextMenu->addAction ( actionFormatIncludeImagesVer );
+	branchContextMenu->addAction ( actionFormatIncludeImagesHor );
+	branchContextMenu->addAction ( actionFormatHideLinkUnselected );
 
 	// Context Menu for links in a branch menu
 	// This will be populated "on demand" in MapEditor::updateActions
-	branchContextMenu->insertSeparator();	
+	branchContextMenu->addSeparator();	
+	/* FIXME not yet ported from QT3
 	branchLinksContextMenu =new Q3PopupMenu (this);
 	branchLinksContextMenuDup =new Q3PopupMenu (this);
 	branchContextMenu->insertItem (tr("Edit XLink"),branchLinksContextMenuDup);
@@ -1529,8 +1526,8 @@
 
 	branchContextMenu->insertItem (tr("Goto XLink"),branchLinksContextMenu);
 	connect( branchLinksContextMenu, SIGNAL( activated(int) ), this, SLOT( editFollowXLink(int ) ) );
+	*/
 	
-*/	
 	// Context menu for floatimage
 	floatimageContextMenu =new QMenu (this);
 	saveImageFormatMenu=floatimageContextMenu->addMenu (tr("Save image"));
diff -r ec3d2962893d -r 5cfbba1dc2f8 texteditor.cpp
--- a/texteditor.cpp	Tue Jun 13 13:54:53 2006 +0000
+++ b/texteditor.cpp	Wed Jun 14 10:28:01 2006 +0000
@@ -1,10 +1,6 @@
 #include "texteditor.h"
 
 #include <q3canvas.h>
-#include <qstatusbar.h>
-#include <qmessagebox.h>
-#include <qaction.h>
-#include <qapplication.h>
 #include <qpainter.h>
 #include <qprinter.h>
 #include <qfile.h>
@@ -13,7 +9,6 @@
 #include <q3popupmenu.h>
 #include <qmenubar.h>
 #include <q3textedit.h>
-#include <q3accel.h>
 #include <qtextstream.h>
 #include <q3paintdevicemetrics.h>
 #include <qsettings.h>
@@ -21,12 +16,10 @@
 #include <qmessagebox.h>
 #include <qcolordialog.h>
 #include <qregexp.h>
-#include <qlineedit.h>
 #include <q3simplerichtext.h>
 //Added by qt3to4:
 #include <Q3ValueList>
 #include <QPixmap>
-#include <QActionGroup>
 #include <QCloseEvent>
 
 #include <iostream>
@@ -226,137 +219,130 @@
 
 void TextEditor::setupFileActions()
 {
-    Q3ToolBar *tb = new Q3ToolBar( this );
-    tb->setLabel( "File Actions" );
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&File" ), menu );
+    QToolBar *tb = addToolBar ( tr("File Actions") );
+    QMenu *fileMenu = menuBar()->addMenu( tr( "&File" ));
 
     QAction *a;
     a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Import..." ),this);
 	a->setStatusTip (tr( "Import" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_O );
     connect( a, SIGNAL( activated() ), this, SLOT( textLoad() ) );
-	a->setEnabled(false);
-    a->addTo( tb );
-    a->addTo( menu );
+	tb->addAction (a);
+	fileMenu->addAction (a);
 	actionFileLoad=a;
 
-    menu->insertSeparator();
+    fileMenu->addSeparator();
     a = new QAction( QPixmap(iconPath+"filesave.png" ), tr( "&Export..." ),this);
 	a->setStatusTip (tr( "Export Note (HTML)" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_S );
     connect( a, SIGNAL( activated() ), this, SLOT( textSave() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	tb->addAction (a);
+	fileMenu->addAction (a);
 	actionFileSave=a;
 	
     a = new QAction(  QPixmap(), tr( "Export &As... (HTML)" ), this);
 	a->setStatusTip (tr( "Export Note As (HTML) " ));
     connect( a, SIGNAL( activated() ), this, SLOT( textSaveAs() ) );
-    a->addTo( menu );
+	fileMenu->addAction (a);
 	actionFileSaveAs=a;
 
     a = new QAction(QPixmap(), tr( "Export &As...(ASCII)" ), this);
 	a->setStatusTip ( tr( "Export Note As (ASCII) " ) );
 	a->setShortcut(Qt::ALT + Qt::Key_X );
     connect( a, SIGNAL( activated() ), this, SLOT( textExportAsASCII() ) );
-    a->addTo( menu );
+	fileMenu->addAction (a);
 	actionFileSaveAs=a;
 
-    menu->insertSeparator();
+    fileMenu->addSeparator();
     a = new QAction( QPixmap(iconPath+"fileprint.png" ), tr( "&Print..." ),this);
 	a->setStatusTip (tr( "Print Note" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_P );
     connect( a, SIGNAL( activated() ), this, SLOT( textPrint() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	tb->addAction (a);
+	fileMenu->addAction (a);
 	actionFilePrint=a;
 }
 
 void TextEditor::setupEditActions()
 {
-    Q3ToolBar *tb = new Q3ToolBar( this );
-    tb->setLabel( "Edit Actions" );
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Edit" ), menu );
+    QToolBar *tb = addToolBar ( tr( "Edit Actions" ));
+    QMenu *editMenu = menuBar()->addMenu ( tr( "&Edit" ));
 
     QAction *a;
     a = new QAction(QPixmap(iconPath+"undo.png"), tr( "&Undo" ), this );
 	a->setStatusTip ( tr( "Undo" ) );
 	a->setShortcut(Qt::CTRL + Qt::Key_Z );
     connect( a, SIGNAL( activated() ), e, SLOT( undo() ) );
-    a->addTo( menu );
-    a->addTo( tb);
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditUndo=a;
 	
     a = new QAction(QPixmap(iconPath+"redo.png" ), tr( "&Redo" ),this); 
 	a->setStatusTip ( tr( "Redo" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_Y );
     connect( a, SIGNAL( activated() ), e, SLOT( redo() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditRedo=a;
 
-    menu->insertSeparator();
+    editMenu->addSeparator();
     a = new QAction(QPixmap(), tr( "Select and copy &all" ),this); 
 	a->setStatusTip ( tr( "Select and copy all" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_A );
     connect( a, SIGNAL( activated() ), this, SLOT( editCopyAll() ) );
-    a->addTo( menu );
+	editMenu->addAction (a);
 
-    menu->insertSeparator();
+    editMenu->addSeparator();
     a = new QAction(QPixmap(iconPath+"editcopy.png" ), tr( "&Copy" ),this);
 	a->setStatusTip ( tr( "Copy" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_C );
     connect( a, SIGNAL( activated() ), e, SLOT( copy() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditCopy=a;
 	
     a = new QAction(QPixmap(iconPath+"editcut.png" ), tr( "Cu&t" ),this);
 	a->setStatusTip ( tr( "Cut" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_X );
     connect( a, SIGNAL( activated() ), e, SLOT( cut() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditCut=a;
 
     a = new QAction(QPixmap(iconPath+"editpaste.png" ), tr( "&Paste" ),this);
 	a->setStatusTip ( tr( "Paste" ) );
 	a->setShortcut( Qt::CTRL + Qt::Key_V );
     connect( a, SIGNAL( activated() ), e, SLOT( paste() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditPaste=a;
 	
     a = new QAction( QPixmap( iconPath+"edittrash.png"), tr( "&Delete All" ), this);
 	a->setStatusTip (tr( "Delete all" ) );
     connect( a, SIGNAL( activated() ), e, SLOT( clear() ) );
-    a->addTo( tb );
-    a->addTo( menu );
+	editMenu->addAction (a);
+	tb->addAction (a);
 	actionEditDeleteAll=a;
 
 	a = new QAction(QPixmap(), tr( "&Convert Paragraphs" ),this);
 	a->setStatusTip(tr( "Convert paragraphs to linebreaks" )); 
 	a->setShortcut( Qt::ALT + Qt::Key_P );
     connect( a, SIGNAL( activated() ), this, SLOT( textConvertPar() ) );
-    a->addTo( menu );
+	editMenu->addAction (a);
 	actionEditConvertPar=a;
 
 	a = new QAction( QPixmap(), tr( "&Join lines" ), this);
 	a->setStatusTip(tr( "Join all lines of a paragraph" ) ); 
 	a->setShortcut(Qt::ALT + Qt::Key_J );
     connect( a, SIGNAL( activated() ), this, SLOT( textJoinLines() ) );
-    a->addTo( menu );
+	editMenu->addAction (a);
 	actionEditJoinLines=a;
 }
 
 void TextEditor::setupFormatActions()
 {
-    Q3ToolBar *tb = new Q3ToolBar( this );
-    tb->setLabel( "Format Actions" );
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "F&ormat" ), menu );
+    QToolBar *tb = addToolBar ( tr("Format Actions" ));
+    QMenu *formatMenu = menuBar()->addMenu ( tr( "F&ormat" ));
 
     QAction *a;
 
@@ -365,93 +351,112 @@
 	a->setToggleAction (true);
 	a->setOn (settings.readBoolEntry ("/vym/noteeditor/fonts/useFixedByDefault",false) );
     connect( a, SIGNAL( activated() ), this, SLOT( toggleFonthint() ) );
-    a->addTo( menu );
-    a->addTo( tb );
+	formatMenu->addAction (a);
+	tb->addAction (a);
 	actionFormatUseFixedFont=a;
 
-	menu->insertSeparator();
-
-    comboFont = new QComboBox( true, tb );
+//    comboFont = new QComboBox( true, tb );
+    comboFont = new QComboBox;
+	tb->addWidget (comboFont);
     QFontDatabase db;
     comboFont->insertStringList( db.families() );
     connect( comboFont, SIGNAL( activated( const QString & ) ),
 	     this, SLOT( textFamily( const QString & ) ) );
-    comboFont->lineEdit()->setText( QApplication::font().family() );
-
-    comboSize = new QComboBox( true, tb );
+    comboFont->addItem( QApplication::font().family() );
+//    comboSize = new QComboBox( true, tb );
+    comboSize = new QComboBox;
+	tb->addWidget (comboSize);
     Q3ValueList<int> sizes = db.standardSizes();
     Q3ValueList<int>::Iterator it = sizes.begin();
     for ( ; it != sizes.end(); ++it )
 	comboSize->insertItem( QString::number( *it ) );
     connect( comboSize, SIGNAL( activated( const QString & ) ),
 	     this, SLOT( textSize( const QString & ) ) );
-    comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) );
+    comboSize->addItem ( QString::number( QApplication::font().pointSize() ) );
 
-    menu->insertSeparator();
+    formatMenu->addSeparator();
 
     QPixmap pix( 16, 16 );
     pix.fill( e->color());
-    actionTextColor = new QAction( pix, tr( "&Color..." ), this);
-    actionTextColor->addTo( tb );
-    actionTextColor->addTo( menu );
-    connect( actionTextColor, SIGNAL( activated() ), this, SLOT( textColor() ) );
+    a = new QAction( pix, tr( "&Color..." ), this);
+	formatMenu->addAction (a);
+	tb->addAction (a);
+    connect( a, SIGNAL( activated() ), this, SLOT( textColor() ) );
+    actionTextColor=a;
 
-    actionTextBold = new QAction( QPixmap (iconPath+"text_bold.png"), tr( "&Bold" ), this);
-	actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B );
-    connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) );
-    actionTextBold->addTo( tb );
-    actionTextBold->addTo( menu );
-    actionTextBold->setToggleAction( true );
-    actionTextItalic = new QAction( QPixmap(iconPath+"text_italic.png"), tr( "&Italic" ),  this);
-	actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
-    connect( actionTextItalic, SIGNAL( activated() ), this, SLOT( textItalic() ) );
-    actionTextItalic->addTo( tb );
-    actionTextItalic->addTo( menu );
-    actionTextItalic->setToggleAction( true );
-    actionTextUnderline = new QAction( QPixmap (iconPath+"text_under.png"), tr( "&Underline" ), this);
-	actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U );
-    connect( actionTextUnderline, SIGNAL( activated() ), this, SLOT( textUnderline() ) );
-    actionTextUnderline->addTo( tb );
-    actionTextUnderline->addTo( menu );
-    actionTextUnderline->setToggleAction( true );
-    menu->insertSeparator();
+    a = new QAction( QPixmap (iconPath+"text_bold.png"), tr( "&Bold" ), this);
+	a->setShortcut(Qt::CTRL + Qt::Key_B );
+    connect( a, SIGNAL( activated() ), this, SLOT( textBold() ) );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    a->setToggleAction( true );
+    actionTextBold=a;
+	
+    a = new QAction( QPixmap(iconPath+"text_italic.png"), tr( "&Italic" ),  this);
+	a->setShortcut(Qt::CTRL + Qt::Key_I);
+    connect( a, SIGNAL( activated() ), this, SLOT( textItalic() ) );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    a->setToggleAction( true );
+    actionTextItalic=a;
+	
+    a = new QAction( QPixmap (iconPath+"text_under.png"), tr( "&Underline" ), this);
+	a->setShortcut(Qt::CTRL + Qt::Key_U );
+    connect( a, SIGNAL( activated() ), this, SLOT( textUnderline() ) );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    a->setToggleAction( true );
+    actionTextUnderline=a;
+    formatMenu->addSeparator();
 
     QActionGroup *grp = new QActionGroup( this );
     connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( textAlign( QAction* ) ) );
 
-    actionAlignLeft = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ),grp );
-	actionAlignLeft->setShortcut( Qt::CTRL+Qt::Key_L );
-    actionAlignLeft->setToggleAction( true );
-    actionAlignCenter = new QAction( QPixmap (iconPath+"text_center.png"), tr( "C&enter" ),grp);
-    actionAlignCenter->setShortcut(  Qt::CTRL + Qt::Key_E);
-    actionAlignCenter->setToggleAction( true );
-    actionAlignRight = new QAction( QPixmap (iconPath+"text_right.png" ), tr( "&Right" ), grp);
-	actionAlignRight->setShortcut(Qt::CTRL + Qt::Key_R );
-    actionAlignRight->setToggleAction( true );
-    actionAlignJustify = new QAction( QPixmap ( iconPath+"text_block.png"), tr( "&Justify" ), grp );
-	actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J );
-    actionAlignJustify->setToggleAction( true );
-
-    grp->addTo( tb );
-    grp->addTo( menu );
+    a = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ),grp );
+	a->setShortcut( Qt::CTRL+Qt::Key_L );
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    actionAlignLeft=a;
+    a = new QAction( QPixmap (iconPath+"text_center.png"), tr( "C&enter" ),grp);
+    a->setShortcut(  Qt::CTRL + Qt::Key_E);
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    actionAlignCenter=a;
+    a = new QAction( QPixmap (iconPath+"text_right.png" ), tr( "&Right" ), grp);
+	a->setShortcut(Qt::CTRL + Qt::Key_R );
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    actionAlignRight=a;
+    a = new QAction( QPixmap ( iconPath+"text_block.png"), tr( "&Justify" ), grp );
+	a->setShortcut(Qt::CTRL + Qt::Key_J );
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    actionAlignJustify=a;
 
     QActionGroup *grp2 = new QActionGroup( this );
-    grp2->setExclusive(false);
-    actionAlignSubScript = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
-	actionAlignSubScript->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
-    actionAlignSubScript->setToggleAction( true );
-    connect(actionAlignSubScript, SIGNAL(activated()), this, SLOT(textVAlign()));
+    grp2->setExclusive(true);
+    a = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ),grp2 );
+	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B );
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
+    actionAlignSubScript=a;
 
-    actionAlignSuperScript = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2  );
-	actionAlignSuperScript->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
-    actionAlignSuperScript->setToggleAction( true );
-    connect(actionAlignSuperScript, SIGNAL(activated()), this, SLOT(textVAlign()));
+    a = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ),grp2  );
+	a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_P );
+    a->setToggleAction( true );
+	tb->addAction (a);
+	formatMenu->addAction (a);
+    connect(a, SIGNAL(activated()), this, SLOT(textVAlign()));
+    actionAlignSuperScript=a;
 
-    menu->insertSeparator();
+    formatMenu->addSeparator();
     
-    grp2->addTo(tb);
-    grp2->addTo(menu);
-
     connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
 	     this, SLOT( fontChanged( const QFont & ) ) );
     connect( e, SIGNAL( currentColorChanged( const QColor & ) ),
@@ -465,27 +470,26 @@
 
 void TextEditor::setupSettingsActions()
 {
-    Q3PopupMenu *menu = new Q3PopupMenu( this );
-    menuBar()->insertItem( tr( "&Settings" ), menu );
+    QMenu *settingsMenu = menuBar()->addMenu ( tr( "&Settings" ));
 
     QAction *a;
     a = new QAction(tr( "Set &fixed font" ), this);
 	a->setStatusTip ( tr( "Set fixed font" ));
     connect( a, SIGNAL( activated() ), this, SLOT( setFixedFont() ) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsFixedFont=a;
 
     a = new QAction(tr( "Set &variable font" ), this);
 	a->setStatusTip ( tr( "Set variable font" ) );
     connect( a, SIGNAL( activated() ), this, SLOT( setVarFont() ) );
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsVarFont=a;
 
     a = new QAction(tr( "&fixed font is default" ),  this);
 	a->setStatusTip (tr( "Used fixed font by default" ) );
 	a->setToggleAction (true);
 	// set state later in constructor...
-    a->addTo( menu );
+	settingsMenu->addAction (a);
 	actionSettingsFonthintDefault=a;
 }
 
@@ -909,8 +913,10 @@
 
 void TextEditor::fontChanged( const QFont &f )
 {
+/*
     comboFont->lineEdit()->setText( f.family() );
     comboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
+*/	
     actionTextBold->setOn( f.bold() );
     actionTextItalic->setOn( f.italic() );
     actionTextUnderline->setOn( f.underline() );
diff -r ec3d2962893d -r 5cfbba1dc2f8 texteditor.h
--- a/texteditor.h	Tue Jun 13 13:54:53 2006 +0000
+++ b/texteditor.h	Wed Jun 14 10:28:01 2006 +0000
@@ -2,9 +2,9 @@
 #ifndef TEXTEDITOR_H 
 #define TEXTEDITOR_H
 
+#include <QtGui>
 #include <q3mainwindow.h>
 #include <q3textedit.h>
-#include <qaction.h>
 #include <qfontdatabase.h>
 #include <qcombobox.h>
 //Added by qt3to4:
@@ -15,7 +15,7 @@
 
 class MyTextEdit;
 
-class TextEditor : public Q3MainWindow {
+class TextEditor : public QMainWindow {
     Q_OBJECT
 public:
     TextEditor();
diff -r ec3d2962893d -r 5cfbba1dc2f8 version.h
--- a/version.h	Tue Jun 13 13:54:53 2006 +0000
+++ b/version.h	Wed Jun 14 10:28:01 2006 +0000
@@ -3,6 +3,6 @@
 
 #define __VYM "VYM"
 #define __VYM_VERSION "1.7.50"
-#define __BUILD_DATE "June 5, 2006"
+#define __BUILD_DATE "June 12, 2006"
 
 #endif