Graphic UI objects names change, Ribbon init() now remember current tab
This commit is contained in:
@@ -40,19 +40,19 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
||||
ui = new Ui::Graphic();
|
||||
ui->setupUi(this);
|
||||
QActionGroup * agroup = new QActionGroup(this);
|
||||
agroup->addAction(ui->actionGuidesFree );
|
||||
agroup->addAction(ui->actionGuidesTraceX);
|
||||
agroup->addAction(ui->actionGuidesTraceY);
|
||||
ui->actionGuidesFree ->setProperty("_value", (int)Free );
|
||||
ui->actionGuidesTraceX->setProperty("_value", (int)TraceX);
|
||||
ui->actionGuidesTraceY->setProperty("_value", (int)TraceY);
|
||||
ui->actionGuidesFree->setChecked(true);
|
||||
agroup->addAction(ui->graphic_actionGuidesFree );
|
||||
agroup->addAction(ui->graphic_actionGuidesTraceX);
|
||||
agroup->addAction(ui->graphic_actionGuidesTraceY);
|
||||
ui->graphic_actionGuidesFree ->setProperty("_value", (int)Free );
|
||||
ui->graphic_actionGuidesTraceX->setProperty("_value", (int)TraceX);
|
||||
ui->graphic_actionGuidesTraceY->setProperty("_value", (int)TraceY);
|
||||
ui->graphic_actionGuidesFree->setChecked(true);
|
||||
connect(agroup, SIGNAL(triggered(QAction*)), this, SLOT(actionGuidesTriggered(QAction*)));
|
||||
ui->checkGuides->addAction(ui->actionGuidesFree );
|
||||
ui->checkGuides->addAction(ui->actionGuidesTraceX);
|
||||
ui->checkGuides->addAction(ui->actionGuidesTraceY);
|
||||
ui->buttonAutofit->addAction(ui->actionExpandX);
|
||||
ui->buttonAutofit->addAction(ui->actionExpandY);
|
||||
ui->graphic_checkGuides ->addAction(ui->graphic_actionGuidesFree );
|
||||
ui->graphic_checkGuides ->addAction(ui->graphic_actionGuidesTraceX);
|
||||
ui->graphic_checkGuides ->addAction(ui->graphic_actionGuidesTraceY);
|
||||
ui->graphic_buttonAutofit->addAction(ui->graphic_actionExpandX);
|
||||
ui->graphic_buttonAutofit->addAction(ui->graphic_actionExpandY);
|
||||
line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min);
|
||||
@@ -540,7 +540,7 @@ void Graphic::clear() {
|
||||
graphics[i].max_x = 0.;
|
||||
graphics[i].cvrect = QRectF();
|
||||
}
|
||||
if (isFit) on_buttonAutofit_clicked();
|
||||
if (isFit) on_graphic_buttonAutofit_clicked();
|
||||
}
|
||||
|
||||
|
||||
@@ -553,9 +553,9 @@ void Graphic::setAntialiasing(bool enabled) {
|
||||
|
||||
void Graphic::setPaused(bool yes) {
|
||||
pause_ = yes;
|
||||
ui->checkPause->blockSignals(true);
|
||||
ui->checkPause->setChecked(yes);
|
||||
ui->checkPause->blockSignals(false);
|
||||
ui->graphic_checkPause->blockSignals(true);
|
||||
ui->graphic_checkPause->setChecked(yes);
|
||||
ui->graphic_checkPause->blockSignals(false);
|
||||
for (int i = 0; i < graphics.size(); ++i)
|
||||
graphics[i].cvrect = QRectF();
|
||||
if (!pause_) {
|
||||
@@ -592,17 +592,17 @@ void Graphic::setHistorySize(double val) {
|
||||
|
||||
void Graphic::setMaxVisibleTime(double val) {
|
||||
visible_time = val;
|
||||
if (isFit) on_buttonAutofit_clicked();
|
||||
if (isFit) on_graphic_buttonAutofit_clicked();
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setOnlyExpandY(bool yes) {
|
||||
ui->actionExpandY->setChecked(yes);
|
||||
ui->graphic_actionExpandY->setChecked(yes);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setOnlyExpandX(bool yes) {
|
||||
ui->actionExpandX->setChecked(yes);
|
||||
ui->graphic_actionExpandX->setChecked(yes);
|
||||
}
|
||||
|
||||
|
||||
@@ -649,25 +649,25 @@ void Graphic::setGraphicsDataRaw(const QByteArray & ba) {
|
||||
|
||||
|
||||
void Graphic::setFloatingAxisEnabled(bool on) {
|
||||
ui->checkGuides->setChecked(on);
|
||||
ui->graphic_checkGuides->setChecked(on);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setButtons(Graphic::Buttons b) {
|
||||
buttons_ = b;
|
||||
ui->buttonAutofit->setVisible(b.testFlag(Autofit));
|
||||
ui->checkGrid->setVisible(b.testFlag(Grid));
|
||||
ui->checkGuides->setVisible(b.testFlag(CursorAxis));
|
||||
ui->buttonFullscreen->setVisible(b.testFlag(Fullscreen));
|
||||
ui->checkBorderInputs->setVisible(b.testFlag(BorderInputs));
|
||||
ui->checkLegend->setVisible(b.testFlag(Legend));
|
||||
ui->buttonClear->setVisible(b.testFlag(Clear));
|
||||
ui->buttonConfigure->setVisible(b.testFlag(Configure));
|
||||
ui->buttonSave->setVisible(b.testFlag(Save));
|
||||
ui->buttonClose->setVisible(b.testFlag(Close));
|
||||
ui->checkPause->setVisible(b.testFlag(Pause));
|
||||
if (ui->buttonAutofit->isVisible() || ui->checkGrid->isVisible() || ui->checkGuides->isVisible() ||
|
||||
ui->buttonConfigure->isVisible() || ui->buttonSave->isVisible() || ui->checkPause->isVisible())
|
||||
ui->graphic_buttonAutofit->setVisible(b.testFlag(Autofit));
|
||||
ui->graphic_checkGrid->setVisible(b.testFlag(Grid));
|
||||
ui->graphic_checkGuides->setVisible(b.testFlag(CursorAxis));
|
||||
ui->graphic_buttonFullscreen->setVisible(b.testFlag(Fullscreen));
|
||||
ui->graphic_checkBorderInputs->setVisible(b.testFlag(BorderInputs));
|
||||
ui->graphic_checkLegend->setVisible(b.testFlag(Legend));
|
||||
ui->graphic_buttonClear->setVisible(b.testFlag(Clear));
|
||||
ui->graphic_buttonConfigure->setVisible(b.testFlag(Configure));
|
||||
ui->graphic_buttonSave->setVisible(b.testFlag(Save));
|
||||
ui->graphic_buttonClose->setVisible(b.testFlag(Close));
|
||||
ui->graphic_checkPause->setVisible(b.testFlag(Pause));
|
||||
if (ui->graphic_buttonAutofit ->isVisible() || ui->graphic_checkGrid ->isVisible() || ui->graphic_checkGuides->isVisible() ||
|
||||
ui->graphic_buttonConfigure->isVisible() || ui->graphic_buttonSave->isVisible() || ui->graphic_checkPause ->isVisible())
|
||||
ui->verticalSpacer->changeSize(0, 30, QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
else
|
||||
ui->verticalSpacer->changeSize(0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
@@ -1447,7 +1447,7 @@ void Graphic::tick(int index, bool slide, bool update_) {
|
||||
}
|
||||
|
||||
|
||||
void Graphic::on_buttonAutofit_clicked() {
|
||||
void Graphic::on_graphic_buttonAutofit_clicked() {
|
||||
isFit = true;
|
||||
bool isEmpty = true;
|
||||
foreach (const GraphicType & t, graphics) {
|
||||
@@ -1464,7 +1464,7 @@ void Graphic::on_buttonAutofit_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void Graphic::on_buttonConfigure_clicked() {
|
||||
void Graphic::on_graphic_buttonConfigure_clicked() {
|
||||
conf->graphicItems.clear();
|
||||
for (int i = 0; i < graphics.size(); i++) {
|
||||
GraphicConf::GraphicItem item;
|
||||
@@ -1510,7 +1510,7 @@ void Graphic::on_buttonConfigure_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void Graphic::on_checkGuides_toggled(bool checked) {
|
||||
void Graphic::on_graphic_checkGuides_toggled(bool checked) {
|
||||
guides = checked;
|
||||
setGuidesCursor();
|
||||
update();
|
||||
@@ -1594,8 +1594,8 @@ void Graphic::graphicVisibleChange(bool checked) {
|
||||
QCheckBox * cb = qobject_cast<QCheckBox*>(sender());
|
||||
int i = cb->property("graphic_num").toInt();
|
||||
graphics[i].visible = checked;
|
||||
if (isFit) on_buttonAutofit_clicked();
|
||||
else update();
|
||||
if (isFit) on_graphic_buttonAutofit_clicked();
|
||||
else {update();}
|
||||
emit graphicSettingsChanged();
|
||||
}
|
||||
|
||||
@@ -1607,8 +1607,8 @@ void Graphic::graphicAllVisibleChange(bool checked) {
|
||||
graphics[i].pb->setChecked(checked);
|
||||
}
|
||||
visible_update = false;
|
||||
if (isFit) on_buttonAutofit_clicked();
|
||||
else update();
|
||||
if (isFit) on_graphic_buttonAutofit_clicked();
|
||||
else {update();}
|
||||
emit graphicSettingsChanged();
|
||||
}
|
||||
|
||||
@@ -1759,14 +1759,14 @@ void Graphic::setCaption(const QString & str) {
|
||||
|
||||
|
||||
void Graphic::setGridEnabled(bool enabled) {
|
||||
ui->checkGrid->setChecked(enabled);
|
||||
ui->graphic_checkGrid->setChecked(enabled);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setBorderInputsVisible(bool visible) {
|
||||
ui->widgetLX->setVisible(visible);
|
||||
ui->widgetLY->setVisible(visible);
|
||||
ui->checkBorderInputs->setChecked(visible);
|
||||
ui->graphic_checkBorderInputs->setChecked(visible);
|
||||
if (visible) setRectToLines();
|
||||
}
|
||||
|
||||
@@ -1778,24 +1778,24 @@ void Graphic::setStatusVisible(bool visible) {
|
||||
|
||||
void Graphic::setLegendVisible(bool visible) {
|
||||
ui->widgetLegend->setVisible(visible);
|
||||
ui->checkLegend->setChecked(visible);
|
||||
ui->graphic_checkLegend->setChecked(visible);
|
||||
updateLegend();
|
||||
}
|
||||
|
||||
|
||||
void Graphic::on_actionExpandX_triggered(bool checked) {
|
||||
void Graphic::on_graphic_actionExpandX_triggered(bool checked) {
|
||||
only_expand_x = checked;
|
||||
ui->actionExpandX->setIcon(checked ? icon_exp_x : icon_exp_sx);
|
||||
ui->graphic_actionExpandX->setIcon(checked ? icon_exp_x : icon_exp_sx);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::on_actionExpandY_triggered(bool checked) {
|
||||
void Graphic::on_graphic_actionExpandY_triggered(bool checked) {
|
||||
only_expand_y = checked;
|
||||
ui->actionExpandY->setIcon(checked ? icon_exp_y : icon_exp_sy);
|
||||
ui->graphic_actionExpandY->setIcon(checked ? icon_exp_y : icon_exp_sy);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::actionGuidesTriggered(QAction * a) {
|
||||
ui->checkGuides->setChecked(true);
|
||||
ui->graphic_checkGuides->setChecked(true);
|
||||
setFloatingAxisType((FloatingAxisType)a->property("_value").toInt());
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public slots:
|
||||
void addGraphic(const GraphicType & gd, bool update = true) {graphics << gd; if (update) updateLegend();}
|
||||
void setVisualRect(const QRectF & rect);
|
||||
void setDefaultRect(const QRectF & rect);
|
||||
void autofit() {on_buttonAutofit_clicked();}
|
||||
void autofit() {on_graphic_buttonAutofit_clicked();}
|
||||
void saveImage();
|
||||
void clear();
|
||||
void update(bool force = false);
|
||||
@@ -416,19 +416,19 @@ protected slots:
|
||||
void lineXMaxChanged(double value) {selrect.setRight(value); checkLines();}
|
||||
void lineYMinChanged(double value) {selrect.setBottom(value); checkLines();}
|
||||
void lineYMaxChanged(double value) {selrect.setTop(value); checkLines();}
|
||||
void on_buttonClose_clicked() {emit closeRequest(this);}
|
||||
void on_buttonClear_clicked() {clear(); emit cleared();}
|
||||
void on_buttonAutofit_clicked();
|
||||
void on_buttonConfigure_clicked();
|
||||
void on_buttonFullscreen_clicked() {fullscreen();}
|
||||
void on_buttonSave_clicked() {saveImage();}
|
||||
void on_checkGrid_toggled(bool checked) {grid = checked; update();}
|
||||
void on_checkGuides_toggled(bool checked);
|
||||
void on_actionExpandX_triggered(bool checked);
|
||||
void on_actionExpandY_triggered(bool checked);
|
||||
void on_checkBorderInputs_toggled(bool checked) {setBorderInputsVisible(checked);}
|
||||
void on_checkLegend_toggled(bool checked) {setLegendVisible(checked);}
|
||||
void on_checkPause_toggled(bool checked) {setPaused(checked);}
|
||||
void on_graphic_buttonClose_clicked() {emit closeRequest(this);}
|
||||
void on_graphic_buttonClear_clicked() {clear(); emit cleared();}
|
||||
void on_graphic_buttonAutofit_clicked();
|
||||
void on_graphic_buttonConfigure_clicked();
|
||||
void on_graphic_buttonFullscreen_clicked() {fullscreen();}
|
||||
void on_graphic_buttonSave_clicked() {saveImage();}
|
||||
void on_graphic_checkGrid_toggled(bool checked) {grid = checked; update();}
|
||||
void on_graphic_checkGuides_toggled(bool checked);
|
||||
void on_graphic_actionExpandX_triggered(bool checked);
|
||||
void on_graphic_actionExpandY_triggered(bool checked);
|
||||
void on_graphic_checkBorderInputs_toggled(bool checked) {setBorderInputsVisible(checked);}
|
||||
void on_graphic_checkLegend_toggled(bool checked) {setLegendVisible(checked);}
|
||||
void on_graphic_checkPause_toggled(bool checked) {setPaused(checked);}
|
||||
void actionGuidesTriggered(QAction * a);
|
||||
void enterFullscreen();
|
||||
void leaveFullscreen();
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonAutofit">
|
||||
<widget class="QToolButton" name="graphic_buttonAutofit">
|
||||
<property name="toolTip">
|
||||
<string>Autofit</string>
|
||||
</property>
|
||||
@@ -59,7 +59,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="checkGrid">
|
||||
<widget class="QToolButton" name="graphic_checkGrid">
|
||||
<property name="toolTip">
|
||||
<string>Grid</string>
|
||||
</property>
|
||||
@@ -76,7 +76,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="checkGuides">
|
||||
<widget class="QToolButton" name="graphic_checkGuides">
|
||||
<property name="toolTip">
|
||||
<string>Cursor axis</string>
|
||||
</property>
|
||||
@@ -90,7 +90,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonFullscreen">
|
||||
<widget class="QToolButton" name="graphic_buttonFullscreen">
|
||||
<property name="toolTip">
|
||||
<string>Fullscreen</string>
|
||||
</property>
|
||||
@@ -101,7 +101,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="checkBorderInputs">
|
||||
<widget class="QToolButton" name="graphic_checkBorderInputs">
|
||||
<property name="toolTip">
|
||||
<string>Border inputs</string>
|
||||
</property>
|
||||
@@ -118,7 +118,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="checkLegend">
|
||||
<widget class="QToolButton" name="graphic_checkLegend">
|
||||
<property name="toolTip">
|
||||
<string>Legend</string>
|
||||
</property>
|
||||
@@ -135,7 +135,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="checkPause">
|
||||
<widget class="QToolButton" name="graphic_checkPause">
|
||||
<property name="toolTip">
|
||||
<string>Pause</string>
|
||||
</property>
|
||||
@@ -149,23 +149,23 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonConfigure">
|
||||
<widget class="QToolButton" name="graphic_buttonConfigure">
|
||||
<property name="toolTip">
|
||||
<string>Configure ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_graphic.qrc">
|
||||
<iconset resource="../application/qad_application.qrc">
|
||||
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonSave">
|
||||
<widget class="QToolButton" name="graphic_buttonSave">
|
||||
<property name="toolTip">
|
||||
<string>Save image ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_graphic.qrc">
|
||||
<iconset resource="../blockview/qad_blockview.qrc">
|
||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -187,23 +187,23 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonClear">
|
||||
<widget class="QToolButton" name="graphic_buttonClear">
|
||||
<property name="toolTip">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_graphic.qrc">
|
||||
<iconset resource="../application/qad_application.qrc">
|
||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonClose">
|
||||
<widget class="QToolButton" name="graphic_buttonClose">
|
||||
<property name="toolTip">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_graphic.qrc">
|
||||
<iconset resource="../blockview/qad_blockview.qrc">
|
||||
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -397,7 +397,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionGuidesFree">
|
||||
<action name="graphic_actionGuidesFree">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -405,7 +405,7 @@
|
||||
<string>Free</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGuidesTraceX">
|
||||
<action name="graphic_actionGuidesTraceX">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -413,7 +413,7 @@
|
||||
<string>Trace X</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGuidesTraceY">
|
||||
<action name="graphic_actionGuidesTraceY">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -421,7 +421,7 @@
|
||||
<string>Trace Y</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExpandX">
|
||||
<action name="graphic_actionExpandX">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -429,7 +429,7 @@
|
||||
<string>Only expand X</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExpandY">
|
||||
<action name="graphic_actionExpandY">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -449,6 +449,8 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../application/qad_application.qrc"/>
|
||||
<include location="../blockview/qad_blockview.qrc"/>
|
||||
<include location="qad_graphic.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user