Skip to content

Commit

Permalink
button to view graph online
Browse files Browse the repository at this point in the history
  • Loading branch information
JC3 committed Jul 16, 2023
1 parent 3db629f commit 38614eb
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 16 deletions.
13 changes: 13 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,16 @@ void MainWindow::on_actStyleEditor_triggered()
sedit_->show();
}


void MainWindow::on_btnViewGraph_clicked()
{
QString graph = ui_->txtNetlistOut->toPlainText().trimmed();
if (graph == "") {
QMessageBox::warning(this, "Nope", "Please generate a graph first.");
return;
}
QString encoded = QString::fromLatin1(QUrl::toPercentEncoding(graph));
QUrl url("https://dreampuf.github.io/GraphvizOnline/#" + encoded);
QDesktopServices::openUrl(url);
}

2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ private slots:
void on_actBugReports_triggered();
void on_actStyleEditor_triggered();

void on_btnViewGraph_clicked();

private:

struct FontDesc {
Expand Down
56 changes: 40 additions & 16 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="tabConvert">
<attribute name="title">
Expand Down Expand Up @@ -720,17 +720,17 @@
<string>Analysis Tools</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="3">
<widget class="QPlainTextEdit" name="txtNetlistOut"/>
</item>
<item row="1" column="3">
<widget class="QLabel" name="lblGraphStats">
<property name="text">
<string>-</string>
<item row="0" column="0" rowspan="3">
<widget class="QPlainTextEdit" name="txtNetlistBP">
<property name="plainText">
<string>VCB+AAAAxuWfA/oCAAAAHgAAACsAAAEzAAAAAAAAFCgotS/9YCgT7QgAhAI4TUf/TTg+/6GYVlNVcgAuR13//8ZjoVWXrnT/AL//ZGpXVpOhJEF6fKjAFbMG0IISkSFuAxJgMggBDREwKIIgIEKQIoQIERIBETChIY4IHDNcmQepcXQOsro1vjb+hF3H7+ltDuenMf5c0Ke/tHA/UTs1281X+xAshg/jm19C4U2vlEdZ84d4VdAA96Sy5vOulu771sS9PMM7Uy2H/1/nT6uxc6H6Nn6TncyHQ+bvVIjd96Y+VMWTzePkdhIWXidnNEcFXElkewMQX10r5hOTwwrZZ3hj8KyumjJiq6ilxGUEnDaU/h7G9LMIj2M7hlg34YPF4YW1CSW/0qjzPGgz0NqxRu5UjPBO7Hd1Cq8vL6/7R2NsVtKm61kGAAAAHwAAAAEAABQoKLUv/WAoE00AABAAAAEAI9QDLAAAAB8AAAACAAAUKCi1L/1gKBNNAAAQAAABACPUAyw=</string>
</property>
<property name="placeholderText">
<string>Blueprint string</string>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<item row="0" column="1" rowspan="3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer_5">
Expand Down Expand Up @@ -929,13 +929,37 @@
</item>
</layout>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QPlainTextEdit" name="txtNetlistBP">
<property name="plainText">
<string>VCB+AAAAxuWfA/oCAAAAHgAAACsAAAEzAAAAAAAAFCgotS/9YCgT7QgAhAI4TUf/TTg+/6GYVlNVcgAuR13//8ZjoVWXrnT/AL//ZGpXVpOhJEF6fKjAFbMG0IISkSFuAxJgMggBDREwKIIgIEKQIoQIERIBETChIY4IHDNcmQepcXQOsro1vjb+hF3H7+ltDuenMf5c0Ke/tHA/UTs1281X+xAshg/jm19C4U2vlEdZ84d4VdAA96Sy5vOulu771sS9PMM7Uy2H/1/nT6uxc6H6Nn6TncyHQ+bvVIjd96Y+VMWTzePkdhIWXidnNEcFXElkewMQX10r5hOTwwrZZ3hj8KyumjJiq6ilxGUEnDaU/h7G9LMIj2M7hlg34YPF4YW1CSW/0qjzPGgz0NqxRu5UjPBO7Hd1Cq8vL6/7R2NsVtKm61kGAAAAHwAAAAEAABQoKLUv/WAoE00AABAAAAEAI9QDLAAAAB8AAAACAAAUKCi1L/1gKBNNAAAQAAABACPUAyw=</string>
<item row="1" column="3">
<widget class="QPushButton" name="btnViewGraph">
<property name="text">
<string>View Graph Online...</string>
</property>
<property name="placeholderText">
<string>Blueprint string</string>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2" colspan="2">
<widget class="QPlainTextEdit" name="txtNetlistOut">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="lblGraphStats">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1056,7 +1080,7 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="grpConvertLayer"/>
<buttongroup name="grpFontChoice"/>
<buttongroup name="grpConvertLayer"/>
</buttongroups>
</ui>

0 comments on commit 38614eb

Please sign in to comment.