Skip to content

Commit

Permalink
Revert "Show model.png on settings page"
Browse files Browse the repository at this point in the history
This reverts commit 8adfbd9.
  • Loading branch information
t-sommer committed Feb 3, 2020
1 parent 8adfbd9 commit 973b4bc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 109 deletions.
11 changes: 0 additions & 11 deletions fmpy/gui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ def showContextMenu(self, point):

def load(self, filename):

import zipfile

if not self.isVisible():
self.show()

Expand All @@ -380,15 +378,6 @@ def load(self, filename):
QMessageBox.warning(self, "Failed to load FMU", "Failed to load %s. %s" % (filename, e))
return

# show model.png
try:
pixmap = QPixmap()
with zipfile.ZipFile(filename, 'r') as zf:
pixmap.loadFromData(zf.read('model.png'), format='PNG')
self.ui.modelImageLabel.setPixmap(pixmap)
except:
self.ui.modelImageLabel.setText("no image available")

self.filename = filename
platforms = supported_platforms(self.filename)

Expand Down
131 changes: 33 additions & 98 deletions fmpy/gui/forms/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1447</width>
<height>1469</height>
<width>1125</width>
<height>807</height>
</rect>
</property>
<property name="palette">
Expand Down Expand Up @@ -88,7 +88,7 @@
<bool>true</bool>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
Expand All @@ -101,7 +101,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item row="0" column="0">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
Expand Down Expand Up @@ -992,99 +992,34 @@
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<widget class="QGroupBox" name="portsGroupBox">
<property name="title">
<string>Ports</string>
</property>
<widget class="QWidget" name="portsTab">
<attribute name="title">
<string>Ports</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="modelImageTab">
<attribute name="title">
<string>Model</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1146</width>
<height>395</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="modelImageLabel">
<property name="text">
<string>no image available</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -1356,8 +1291,8 @@ QToolButton:checked, QToolButton:hover:pressed {
<rect>
<x>0</x>
<y>0</y>
<width>1447</width>
<height>38</height>
<width>1125</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
Expand Down

0 comments on commit 973b4bc

Please sign in to comment.