diff -r aff86e2f2a4a -r 9c86935835a4 mainwindow.cpp --- a/mainwindow.cpp Wed May 02 15:31:18 2007 +0000 +++ b/mainwindow.cpp Wed May 02 15:31:20 2007 +0000 @@ -92,14 +92,22 @@ procBrowser=NULL; - // Initialize history window; + // Satellite windows ////////////////////////////////////////// + + // history window historyWindow=new HistoryWindow(); - - // Initialize properties window + connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); + + // properties window branchPropertyWindow = new BranchPropertyWindow(); - branchPropertyWindow->move (20,20); - branchPropertyWindow->resize (settings.value( "/branchpropertywindow/geometry/size",QSize (150,100)).toSize()); - branchPropertyWindow->move (settings.value( "/branchpropertywindow/geometry/pos", QPoint(20,20)).toPoint()); + connect (branchPropertyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); + + // Connect TextEditor, so that we can update flags if text changes + connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag())); + connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions())); + + // Connect HistoryWindow, so that we can update flags + connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); // Initialize script editor @@ -109,6 +117,15 @@ connect( scriptEditor, SIGNAL( runScript ( QString ) ), this, SLOT( runScript( QString ) ) ); + + // Initialize Find window + findWindow=new FindWindow(NULL); + findWindow->move (x(),y()+70); + connect (findWindow, SIGNAL( findButton(QString) ), + this, SLOT(editFind(QString) ) ); + connect (findWindow, SIGNAL( somethingChanged() ), + this, SLOT(editFindChanged() ) ); + // Initialize some settings, which are platform dependant QString p,s; @@ -165,23 +182,6 @@ restoreState (settings.value("/mainwindow/state",0).toByteArray()); - // Satellite windows ////////////////////////////////////////// - - // Initialize Find window - findWindow=new FindWindow(NULL); - findWindow->move (x(),y()+70); - connect (findWindow, SIGNAL( findButton(QString) ), - this, SLOT(editFind(QString) ) ); - connect (findWindow, SIGNAL( somethingChanged() ), - this, SLOT(editFindChanged() ) ); - - // Connect TextEditor, so that we can update flags if text changes - connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag())); - connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions())); - - // Connect HistoryWindow, so that we can update flags - connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); - updateGeometry(); } @@ -637,15 +637,15 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) ); actionEditHeading2URL=a; - a = new QAction(tr( "Create URL to Bugzilla","Edit menu" ), this); - a->setStatusTip ( tr( "Create URL to Bugzilla" )); + a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this); + a->setStatusTip ( tr( "Create URL to Novell Bugzilla" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); actionEditBugzilla2URL=a; - a = new QAction(tr( "Create URL to FATE","Edit menu" ), this); - a->setStatusTip ( tr( "Create URL to FATE" )); + a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this); + a->setStatusTip ( tr( "Create URL to Novell FATE" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) ); @@ -792,9 +792,10 @@ a->setStatusTip (tr( "Set properties for selection" )); a->setShortcut ( Qt::CTRL + Qt::Key_I ); //Property window a->setShortcutContext (Qt::WindowShortcut); + a->setToggleAction (true); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( windowToggleProperty() ) ); - actionTogglePropertyWindow=a; + actionViewTogglePropertyWindow=a; } // Format Actions @@ -942,15 +943,12 @@ viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( viewZoomOut() ) ); + viewMenu->addSeparator(); a = new QAction(QPixmap(flagsPath+"flag-note.png"), tr( "Show Note Editor","View action" ),this); a->setStatusTip ( tr( "Show Note Editor" )); a->setShortcut ( Qt::CTRL + Qt::Key_E ); a->setToggleAction(true); - if (textEditor->showWithMain()) - a->setOn(true); - else - a->setOn(false); a->addTo( tb ); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) ); @@ -965,7 +963,9 @@ connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) ); actionViewToggleHistoryWindow=a; - viewMenu->addAction (actionTogglePropertyWindow); + viewMenu->addAction (actionViewTogglePropertyWindow); + + viewMenu->addSeparator(); a = new QAction(tr( "Antialiasing","View action" ),this ); a->setStatusTip ( tr( "Antialiasing" )); @@ -1485,7 +1485,7 @@ // Context Menu for branch or mapcenter branchContextMenu =new QMenu (this); - branchContextMenu->addAction (actionTogglePropertyWindow); + branchContextMenu->addAction (actionViewTogglePropertyWindow); branchContextMenu->addSeparator(); // Submenu "Add" @@ -1629,7 +1629,7 @@ void Main::showEvent (QShowEvent * ) { - if (textEditor->showWithMain()) textEditor->showNormal(); + //FIXME if (textEditor->showWithMain()) textEditor->showNormal(); } bool Main::reallyWriteDirectory(const QString &dir) @@ -2465,7 +2465,7 @@ me=(MapEditor*)tabWidget->page(i); // If something changed, ask what to do - if (me->isUnsaved()) + if (me->hasChanged()) { tabWidget->setCurrentPage(i); QMessageBox mb( vymName, @@ -3263,10 +3263,10 @@ void Main::windowToggleNoteEditor() { - if (textEditor->showWithMain() ) - windowHideNoteEditor(); + if (textEditor->isVisible() ) + textEditor->hide(); else - windowShowNoteEditor(); + textEditor->show(); } void Main::windowToggleHistory() @@ -3284,6 +3284,7 @@ branchPropertyWindow->hide(); else branchPropertyWindow->show(); + if(currentMapEditor()) { LinkableMapObj *sel=currentMapEditor()->getSelection(); @@ -3348,8 +3349,9 @@ historyWindow->setCaption (tr("History for %1").arg(currentMapEditor()->getFileName())); // updateActions is also called when NoteEditor is closed - actionViewToggleNoteEditor->setOn (textEditor->showWithMain()); - actionViewToggleHistoryWindow->setOn (historyWindow->showWithMain()); + actionViewToggleNoteEditor->setOn (textEditor->isVisible()); + actionViewToggleHistoryWindow->setOn (historyWindow->isVisible()); + actionViewTogglePropertyWindow->setOn (branchPropertyWindow->isVisible()); if (me->getMapLinkColorHint()==LinkableMapObj::HeadingColor) actionFormatLinkColorHint->setOn(true); @@ -3384,7 +3386,7 @@ actionFormatLinkColor->setIconSet( pix ); - actionFileSave->setEnabled( me->isUnsaved() ); + actionFileSave->setEnabled( me->hasChanged() ); if (me->isUndoAvailable()) actionEditUndo->setEnabled( true); else @@ -3548,14 +3550,12 @@ void Main::windowShowNoteEditor() { - textEditor->setShowWithMain(true); textEditor->show(); actionViewToggleNoteEditor->setOn (true); } void Main::windowHideNoteEditor() { - textEditor->setShowWithMain(false); textEditor->hide(); actionViewToggleNoteEditor->setOn (false); }