src/gui.cc

changeset 563
10939452bf86
parent 561
1d90296ad3fc
child 566
549c63863544
equal deleted inserted replaced
562:c4ff45e98551 563:10939452bf86
861 861
862 // If the document has unsaved changes, draw a little icon next to it to mark that. 862 // If the document has unsaved changes, draw a little icon next to it to mark that.
863 f->getListItem()->setIcon (f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon()); 863 f->getListItem()->setIcon (f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon());
864 } 864 }
865 865
866 void ForgeWindow::beginAction (QAction* act) 866 void ForgeWindow::beginAction (QAction* act) {}
867 { // Open the history so we can record the edits done during this action.
868 if (act == ui->actionUndo || act == ui->actionRedo || act == ui->actionOpen)
869 getCurrentDocument()->getHistory()->setIgnoring (true);
870 }
871 867
872 void ForgeWindow::endAction() 868 void ForgeWindow::endAction()
873 { // Close the history now. 869 { // Close the history now.
874 getCurrentDocument()->addHistoryStep(); 870 getCurrentDocument()->addHistoryStep();
875 871
876 // Update the list item of the current file - we may need to draw an icon 872 // Update the list item of the current file - we may need to draw an icon
877 // now that marks it as having unsaved changes. 873 // now that marks it as having unsaved changes.
878 updateDocumentListItem (getCurrentDocument()); 874 updateDocumentListItem (getCurrentDocument());
879
880 // We're done with the action, the history should stop ignoring now.
881 getCurrentDocument()->getHistory()->setIgnoring (false);
882 } 875 }
883 876
884 // ============================================================================= 877 // =============================================================================
885 // A file is selected from the list of files on the left of the screen. Find out 878 // A file is selected from the list of files on the left of the screen. Find out
886 // which file was picked and change to it. 879 // which file was picked and change to it.

mercurial