git-svn-id: svn://db.shs.com.ru/libs@275 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -356,7 +356,7 @@ void BlockBusItem::checkDelete() {
|
|||||||
|
|
||||||
|
|
||||||
void BlockBusItem::emitAction(BlockItemBase::Action a) {
|
void BlockBusItem::emitAction(BlockItemBase::Action a) {
|
||||||
QMetaObject::invokeMethod(scene()->views().back(), "actionEvent", Q_ARG(BlockItemBase::Action, a), Q_ARG(QList<QGraphicsItem*>, QList<QGraphicsItem*>() << this));
|
QMetaObject::invokeMethod(scene()->views().back(), "schemeAction", Q_ARG(BlockItemBase::Action, a), Q_ARG(QList<QGraphicsItem*>, QList<QGraphicsItem*>() << this));
|
||||||
QMetaObject::invokeMethod(scene()->views().back(), "connectionsChanged");
|
QMetaObject::invokeMethod(scene()->views().back(), "connectionsChanged");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ void BlockEditor::loadFile(QString path) {
|
|||||||
if (f.open(QIODevice::ReadOnly)) {
|
if (f.open(QIODevice::ReadOnly)) {
|
||||||
cur_file = path;
|
cur_file = path;
|
||||||
loadModel(f.readAll());
|
loadModel(f.readAll());
|
||||||
|
QDir::setCurrent(QFileInfo(path).dir().path());
|
||||||
}
|
}
|
||||||
setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(path).baseName()));
|
setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(path).baseName()));
|
||||||
}
|
}
|
||||||
@@ -159,6 +160,19 @@ void BlockEditor::on_actionRemove_items_triggered() {
|
|||||||
|
|
||||||
|
|
||||||
void BlockEditor::on_buttonSave_clicked() {
|
void BlockEditor::on_buttonSave_clicked() {
|
||||||
|
if (cur_file.isEmpty()) {
|
||||||
|
on_buttonSaveAs_clicked();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QFile f(cur_file);
|
||||||
|
if (f.open(QIODevice::WriteOnly)) {
|
||||||
|
f.write(saveModel());
|
||||||
|
//setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BlockEditor::on_buttonSaveAs_clicked() {
|
||||||
QString c = QFileDialog::getSaveFileName(this, "Save block model to file", cur_file, "*.blockmodel");
|
QString c = QFileDialog::getSaveFileName(this, "Save block model to file", cur_file, "*.blockmodel");
|
||||||
if (!c.isEmpty()) {
|
if (!c.isEmpty()) {
|
||||||
QFile f(c);
|
QFile f(c);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ private slots:
|
|||||||
void arrangePins();
|
void arrangePins();
|
||||||
void on_actionRemove_items_triggered();
|
void on_actionRemove_items_triggered();
|
||||||
void on_buttonSave_clicked();
|
void on_buttonSave_clicked();
|
||||||
|
void on_buttonSaveAs_clicked();
|
||||||
void on_buttonLoad_clicked();
|
void on_buttonLoad_clicked();
|
||||||
void on_buttonClear_clicked();
|
void on_buttonClear_clicked();
|
||||||
void on_buttonPinAdd_clicked();
|
void on_buttonPinAdd_clicked();
|
||||||
|
|||||||
@@ -41,7 +41,16 @@
|
|||||||
<property name="labelAlignment">
|
<property name="labelAlignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@@ -124,7 +133,16 @@
|
|||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -176,7 +194,7 @@
|
|||||||
<string>Add</string>
|
<string>Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -187,7 +205,7 @@
|
|||||||
<string>Clone</string>
|
<string>Clone</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/edit-copy.png</normaloff>:/icons/edit-copy.png</iconset>
|
<normaloff>:/icons/edit-copy.png</normaloff>:/icons/edit-copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -214,7 +232,7 @@
|
|||||||
<string>Remove selected</string>
|
<string>Remove selected</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -225,7 +243,7 @@
|
|||||||
<string>Remove all</string>
|
<string>Remove all</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -268,7 +286,16 @@
|
|||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="layoutProperties">
|
<layout class="QHBoxLayout" name="layoutProperties">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -300,10 +327,40 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="buttonSave">
|
<widget class="QPushButton" name="buttonSave">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save ...</string>
|
<string>Save</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+S</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="buttonSaveAs">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save as ...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
@@ -360,7 +417,7 @@
|
|||||||
<string>Clear</string>
|
<string>Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -370,7 +427,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionRemove_items">
|
<action name="actionRemove_items">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../qad_blockview.qrc">
|
<iconset resource="../../utils/qad_utils.qrc">
|
||||||
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -394,6 +451,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
|
<include location="../../utils/qad_utils.qrc"/>
|
||||||
<include location="../qad_blockview.qrc"/>
|
<include location="../qad_blockview.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
Reference in New Issue
Block a user