mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Cut/Copy/Paste menu entries are now enabled/disabled according to the current state of editor, selection and clipboard.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1563 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -452,6 +452,7 @@ void QETTitleBlockTemplateEditor::initWidgets() {
|
||||
SLOT(savePreviewWidthToApplicationSettings(int, int))
|
||||
);
|
||||
connect(undo_stack_, SIGNAL(cleanChanged(bool)), this, SLOT(updateEditorTitle()));
|
||||
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(updateActions()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -578,9 +579,13 @@ void QETTitleBlockTemplateEditor::updateActions() {
|
||||
|
||||
bool can_merge;
|
||||
bool can_split;
|
||||
int count;
|
||||
if (!read_only_) {
|
||||
template_edition_area_view_ -> analyzeSelectedCells(&can_merge, &can_split);
|
||||
template_edition_area_view_ -> analyzeSelectedCells(&can_merge, &can_split, &count);
|
||||
}
|
||||
cut_ -> setEnabled(!read_only_ && count);
|
||||
copy_ -> setEnabled(count);
|
||||
paste_ -> setEnabled(!read_only_ && count && template_edition_area_view_ -> mayPaste());
|
||||
merge_cells_ -> setEnabled(!read_only_ && can_merge);
|
||||
split_cell_ -> setEnabled(!read_only_ && can_split);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user