Skip to content

Commit

Permalink
Reload layout button
Browse files Browse the repository at this point in the history
  • Loading branch information
jbendes committed Nov 22, 2024
1 parent add5819 commit 34b3592
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plotjuggler_app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,9 @@ bool MainWindow::loadLayoutFromFile(QString filename)

linkedZoomOut();

_loaded_layout_filename = filename;
ui->buttonReloadLayout->setEnabled(true);

_undo_states.clear();
_undo_states.push_back(domDocument);
return true;
Expand Down Expand Up @@ -3540,6 +3543,11 @@ void MainWindow::on_buttonReloadData_clicked()
ui->buttonReloadData->setEnabled(!_loaded_datafiles_previous.empty());
}

void MainWindow::on_buttonReloadLayout_clicked()
{
MainWindow::loadLayoutFromFile(_loaded_layout_filename);
}

void MainWindow::on_buttonCloseStatus_clicked()
{
ui->widgetStatusBar->hide();
Expand Down
3 changes: 3 additions & 0 deletions plotjuggler_app/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public slots:
std::vector<FileLoadInfo> _loaded_datafiles_previous;
CurveTracker::Parameter _tracker_param;

QString _loaded_layout_filename;

std::map<CurveTracker::Parameter, QIcon> _tracker_button_icons;

MonitoredValue _time_offset;
Expand Down Expand Up @@ -287,6 +289,7 @@ private slots:
void on_actionColorMap_Editor_triggered();

void on_buttonReloadData_clicked();
void on_buttonReloadLayout_clicked();

void on_buttonCloseStatus_clicked();

Expand Down
26 changes: 26 additions & 0 deletions plotjuggler_app/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,32 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="buttonReloadLayout">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Quick Reload&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Reload the last layout.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/resources/svg/reload.svg</normaloff>:/resources/svg/reload.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonRecentLayout">
<property name="sizePolicy">
Expand Down

0 comments on commit 34b3592

Please sign in to comment.