0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 00:18:06 +03:00

Insert item lock added

This commit is contained in:
Arin Alexander
2017-10-02 16:37:38 +03:00
parent e8e3562be6
commit c72014069f
4 changed files with 15 additions and 22 deletions

View File

@@ -64,7 +64,7 @@ ReportDesignWindow* ReportDesignWindow::m_instance=0;
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page)
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
{
initReportEditor(report);
createActions();
@@ -123,6 +123,7 @@ void ReportDesignWindow::createActions()
m_editModeAction->setIcon(QIcon(":/report/images/editMode"));
m_editModeAction->setCheckable(true);
m_editModeAction->setChecked(true);
m_editModeAction->setShortcut(QKeySequence(Qt::Key_Escape));
connect(m_editModeAction,SIGNAL(triggered()),this,SLOT(slotEditMode()));
m_undoAction = new QAction(tr("Undo"),this);
@@ -888,6 +889,7 @@ void ReportDesignWindow::slotNewTextItem()
{
if (m_newTextItemAction->isChecked()) {m_newTextItemAction->setCheckable(false);return;}
if (m_reportDesignWidget) {
m_reportItemIsLocked = QApplication::keyboardModifiers() == Qt::SHIFT;
m_reportDesignWidget->startInsertMode("TextItem");
m_newTextItemAction->setCheckable(true);
m_newTextItemAction->setChecked(true);
@@ -987,14 +989,19 @@ void ReportDesignWindow::slotInsertModeStarted()
void ReportDesignWindow::slotItemInserted(PageDesignIntf *, QPointF, const QString &ItemType)
{
m_editModeAction->setChecked(true);
if (m_actionMap.value(ItemType))
m_actionMap.value(ItemType)->setCheckable(false);
if (!m_reportItemIsLocked){
m_editModeAction->setChecked(true);
if (m_actionMap.value(ItemType))
m_actionMap.value(ItemType)->setCheckable(false);
} else {
m_reportDesignWidget->startInsertMode(ItemType);
}
}
void ReportDesignWindow::slotItemInsertCanceled(const QString &ItemType)
{
m_editModeAction->setChecked(true);
m_reportItemIsLocked = false;
if (m_actionMap.value(ItemType))
m_actionMap.value(ItemType)->setCheckable(false);
}
@@ -1169,6 +1176,7 @@ void ReportDesignWindow::slotItemActionCliked()
QAction* action=dynamic_cast<QAction*>(sender());
action->setCheckable(true);
action->setChecked(true);
m_reportItemIsLocked = QApplication::keyboardModifiers() == Qt::SHIFT;
m_reportDesignWidget->startInsertMode(action->whatsThis());
}