{
d_statusText->setText(QString::fromStdString(path));
d_okButton->setEnabled(true);
+ d_okButton->setDefault(true);
return true;
}
}
d_message->setText(tr("Input cell name"));
}
d_okButton->setEnabled(false);
+ d_cancelButton->setDefault(true);
return false;
}
</rect>
</property>
<property name="windowTitle">
- <string>MainWindow</string>
+ <string>dennco creator</string>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QMenuBar" name="menuBar">
static DCTreeViewWidget *s_treeViewWidget = NULL;
-static bool IsIndexUnderContainer(const QFileSystemModel *model, QModelIndex index)
+static bool IsIndexUnderContainer(const QFileSystemModel *model, QModelIndex index, bool includesContainerDir = false)
{
bool r = false;
- if (index.isValid())
- index = index.parent();
+ if (!includesContainerDir)
+ {
+ if (index.isValid())
+ index = index.parent();
+ }
while (index.isValid())
{
if (isDir)
{
addDictionaryAction = menu.addAction(tr("Add folder"));
- if (IsIndexUnderContainer(&d_fileSystemModel, index))
+ if (IsIndexUnderContainer(&d_fileSystemModel, index, true))
{
addPageAction = menu.addAction(tr("Add page..."));
}
if (d_scene != scene)
return;
+ if (d_eventHandler)
+ d_eventHandler->selectedPageChanged(requester);
+
d_requestRedraw = true;
}
virtual void keyPressEvent(QKeyEvent *event) = 0;
virtual void keyReleaseEvent(QKeyEvent *event) = 0;
virtual void showContextMenu(const QPoint &globalPos) = 0;
+ virtual void selectedPageChanged(const void *requester) = 0;
};
#endif // DCVEVENTHANDLER_H
// nothing was chosen
}
}
+
+void DCVLayoutModeHandler::selectedPageChanged(const void *requester)
+{
+
+}
virtual void keyPressEvent(QKeyEvent *event) ;
virtual void keyReleaseEvent(QKeyEvent *event) ;
virtual void showContextMenu(const QPoint &globalPos);
+ virtual void selectedPageChanged(const void *requester);
};
#endif // DCVLAYOUTMODEHANDLER_H
QPointF mousePos = event->scenePos();
+ d_draggedObject.assign(NULL);
+
DCVComponent *obj = getView()->getObjectAt(mousePos.x(), mousePos.y(), d_cursor);
if (!obj)
return;
return;
if (obj != getScene()->getTerminalEditCursor() && obj != page)
- return;
+ return;
switch(getScene()->getPersMode())
{
}
+void DCVTerminalFromAxonModeHandler::selectedPageChanged(const void *requester)
+{
+ if (requester == this)
+ return;
+
+ QList<DCVCPage*> pages = getScene()->getSelectedPages();
+ if (pages.length() == 0)
+ return;
+
+ if (d_cursor->getPageBelonging() != pages.at(0))
+ d_cursor->changePageBelonging(pages.at(0));
+}
virtual void keyPressEvent(QKeyEvent *event) ;
virtual void keyReleaseEvent(QKeyEvent *event) ;
virtual void showContextMenu(const QPoint &globalPos);
+ virtual void selectedPageChanged(const void *requester);
};
#endif // DCVTERMINALFROMAXONMODEHANDLER_H
QPointF mousePos = event->scenePos();
+ d_draggedObject.assign(NULL);
+
DCVComponent *obj = getView()->getObjectAt(mousePos.x(), mousePos.y(), d_cursor);
if (!obj)
return;
}
+void DCVTerminalFromReceptorModeHandler::selectedPageChanged(const void *requester)
+{
+ if (requester == this)
+ return;
+
+ QList<DCVCPage*> pages = getScene()->getSelectedPages();
+ if (pages.length() == 0)
+ return;
+
+ if (d_cursor->getPageBelonging() != pages.at(0))
+ d_cursor->changePageBelonging(pages.at(0));
+
+}
+
virtual void keyPressEvent(QKeyEvent *event) ;
virtual void keyReleaseEvent(QKeyEvent *event) ;
virtual void showContextMenu(const QPoint &globalPos);
+ virtual void selectedPageChanged(const void *requester);
};
#endif // DCVTERMINALFROMRECEPTORHANDLER_H
#include <QMouseEvent>
static const QString HOVERSTYLE =
- "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(0,0,0,60), stop: 0.3 rgba(70,80,70,60), stop: 0.9 rgba(70,80,70,60), stop: 1.0 rgba(0,0,0,60));"
- "border: 1px solid rgba(40,50,40,60); text-align:left; padding: 0 4px;";
+ "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgb(80,80,80), stop: 0.3 rgb(120,128,120), stop: 0.9 rgb(120,128,120), stop: 1.0 rgb(80,80,80));"
+ "border: 1px solid rgb(100,100,100); text-align:left; padding: 0 4px;";
static const QString NORMALSTYLE =
- "background: rgba(0,0,0,50); border: 1px solid rgba(0,0,0,60); text-align:left; padding: 0 4px;";
+ "background: rgb(80,80,80); border: 1px solid rgb(100,100,100); text-align:left; padding: 0 4px;";
static const QString EDITSTYLE =
"background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgb(0,0,0), stop: 0.3 rgb(40,40,40), stop: 1.0 rgb(40,40,40));"
- "border: 1px solid rgb(40,50,40); text-align:left; padding: 0 4px;";
+ "border: 1px solid rgb(80,80,80); text-align:left; padding: 0 4px;";
DCEditableLabel::DCEditableLabel(DCToolWindowBase *parent, const QString &text) :
QLineEdit(text), d_parent(parent), d_mouseOver(false)
const static QString DialogContentStyle =
"* {color: white} "
- "QDialog {background-color: rgba(255,255,255,60);} "
+ "QDialog {background-color: rgb(110,110,110);} "
"QRadioButton {background-color: transparent;} "
"QPlainTextEdit {background: black;} "
- "QGroupBox { border: 1px solid gray; border-radius: 3px;} "
+ "QGroupBox {border: 1px solid rgb(160,160,160); border-radius: 3px;} "
"QTableView { background: black;} "
"QPushButton { background-color: rgb(128,128,128);} "
- "QComboBox { background-color: rgb(128,128,128); "
- " border: 1px solid gray;"
+ "QComboBox { background-color: rgb(80,80,80); "
+ " border: 1px rgb(80,80,80);"
" border-radius: 3px;"
" padding: 1px 18px 1px 3px;"
" }"
- "QComboBox QAbstractItemView {"
- " background: rgb(128,128,128);"
+ "QAbstractItemView {"
+ " background: rgb(80,80,80);"
" color: white;"
- " selection-background-color: rgb(128,128,255);"
- "}";
+ " selection-background-color: rgb(80,80,255);"
+ "}"
+ ;
DCToolWindowBase::DCToolWindowBase(const QString &windowTitle,DCCreator *creator)
: QDialog(0,Qt::CustomizeWindowHint | Qt::FramelessWindowHint), d_collapsed(false), d_creator(creator)
DCToolWindowCellCodeEditor::DCToolWindowCellCodeEditor(DCCreator *creator) :
DCToolWindowBase("CELL CODE:", creator), d_mode(CELLCLASS_EDIT_MODE), d_container(NULL), d_cellCodeClass(NULL), d_ownerCell(NULL)
{
+ setWindowOpacity(0.95);
d_editor = new DCCodeEditor;
QHBoxLayout *layout = new QHBoxLayout;
d_uiClassName = new DCEditableLabel(this, "");
d_uiClassType = new DCCellCodeTypeComboBox(creator, this);
d_uiClassUnsetButton = new QPushButton(tr("Unset class"));
- d_uiClassUserList = new QTableView;
cellclassGroupBoxLayoutInnder1->addWidget(d_uiClassName, 0,1);
cellclassGroupBoxLayoutInnder1->addWidget(d_uiClassType, 1,1);
cellclassGroupBoxLayoutInnder1->addWidget(d_uiClassUnsetButton, 2,0,1,2);
- cellclassGroupBoxLayoutInnder1->addWidget(new QLabel(tr("Cells uses the cell code")), 3,0,1,2);
- cellclassGroupBoxLayoutInnder1->addWidget(d_uiClassUserList, 4,0,1,2);
QVBoxLayout *cellclassGroupBoxLayoutInnder2 = new QVBoxLayout;
d_uiClassAssignButton = new QPushButton(tr("Assign a class"));
QGroupBox *d_uiClassGroupBox;
DCEditableLabel *d_uiClassName;
DCCellCodeTypeComboBox *d_uiClassType;
- QTableView *d_uiClassUserList;
QPushButton *d_uiClassUnsetButton;
QPushButton *d_uiClassAssignButton;
if (!cell)
return false;
+ if (index.column() != 0)
+ {
+ return DCQtItemModel::setData(index, value, role);
+ }
+
DCQtItemModelItem *item = getItem(index);
QString oldReceptorName = item->data(index.column()).toString();
QString newReceptorName = value.toString().trimmed();
if (!cell)
return false;
+ if (index.column() != 0)
+ {
+ return DCQtItemModel::setData(index, value, role);
+ }
+
DCQtItemModelItem *item = getItem(index);
QString oldReceptorName = item->data(index.column()).toString();
QString newReceptorName = value.toString().trimmed();