Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIL*: New tutorial system, better child window management #1726

Merged
merged 25 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7a0e8f3
Remove tutorials array from manager class
ferdnyc Jun 22, 2018
76aead5
Add a QDockWidget for the tutorial popups
ferdnyc Jun 23, 2018
e46e57e
Re-work communication with child windows
ferdnyc Jun 23, 2018
6e0e88a
Convert tutorial popups into floating QDockWidget
ferdnyc Jun 23, 2018
cbc3f9b
Merge branch 'develop' into tutorial2
ferdnyc Jun 23, 2018
6d01eac
Merge branch 'develop' into tutorial2
ferdnyc Jun 27, 2018
74a8bdc
Merge branch 'develop' into tutorial2
DylanC Jun 28, 2018
d0ce5e6
Use palette color for tutorial background
ferdnyc Jun 28, 2018
ca9bc3f
Merge branch 'develop' into tutorial2
ferdnyc Jul 1, 2018
2429c30
Merge branch 'develop' into tutorial2
ferdnyc Jul 3, 2018
1af4094
Set NoSystemBackground on tutorial dock
ferdnyc Jul 6, 2018
4fb7d66
Merge branch 'develop' into tutorial2
ferdnyc Jul 6, 2018
249d18f
Also set NoSystemBackground on widget
ferdnyc Jul 6, 2018
4b6071f
Merge branch 'tutorial2' of github.com:ferdnyc/openshot-qt into tutor…
ferdnyc Jul 6, 2018
db0b509
Merge branch 'develop' into tutorial2
DylanC Jul 7, 2018
16a0056
Merge branch 'develop' into tutorial2
ferdnyc Jul 9, 2018
4378386
Add contents widget to dockTutorial
ferdnyc Jul 11, 2018
50dbfe5
Resize main window geometry to 1200x800
ferdnyc Jul 11, 2018
c9d7ed7
Shift Video Preview tutorial popup right.
ferdnyc Jul 11, 2018
096de0b
Merge branch 'develop' into tutorial2
ferdnyc Jul 11, 2018
ca252e9
Merge branch 'tutorial2' of github.com:ferdnyc/openshot-qt into tutor…
ferdnyc Jul 11, 2018
361b7ae
Files end in NEWLINES dammit!
ferdnyc Jul 11, 2018
b224ee2
Fix damage I caused to main_window.ui
ferdnyc Jul 11, 2018
d70def9
Merge branch 'develop' into tutorial2
ferdnyc Jul 11, 2018
7953e12
Merge branch 'develop' into tutorial2
DylanC Jul 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2130,17 +2130,37 @@ def foundCurrentVersion(self, version):

def moveEvent(self, event):
""" Move tutorial dialogs also (if any)"""
QMainWindow.moveEvent(self, event)
if self.tutorial_manager:
#log.info("Sending move event to tutorial manager")
self.tutorial_manager.re_position_dialog()

def eventFilter(self, object, e):
""" Filter out certain types of window events """
if e.type() == QEvent.WindowActivate:
self.tutorial_manager.re_show_dialog()
elif e.type() == QEvent.WindowStateChange and self.isMinimized():
self.tutorial_manager.minimize()
def resizeEvent(self, event):
QMainWindow.resizeEvent(self, event)
if self.tutorial_manager:
#log.info("Sending resize event to tutorial manager")
self.tutorial_manager.re_position_dialog()

def showEvent(self, event):
""" Have any child windows follow main-window state """
#log.info("Showing main window")
QMainWindow.showEvent(self, event)
for child in self.findChildren(QDockWidget):
if child.isFloating() and child.isEnabled():
# child.setWindowState(self.windowState())
#log.info("Showing child {}".format(child.windowTitle()))
child.raise_()
child.show()

def hideEvent(self, event):
""" Have any child windows hide with main window """
#log.info("Hiding main window")
QMainWindow.hideEvent(self, event)
for child in self.findChildren(QDockWidget):
if child.isFloating() and child.isVisible():
#log.info("Hiding child {}".format(child.windowTitle()))
child.hide()

return False

def show_property_timeout(self):
"""Callback for show property timer"""
Expand Down Expand Up @@ -2393,9 +2413,6 @@ def __init__(self, mode=None):
self.ExportFrame.connect(self.FrameExported)
self.ExportEnded.connect(self.ExportFinished)

# Install event filter
self.installEventFilter(self)

# Save settings
s.save()

Expand Down
199 changes: 182 additions & 17 deletions src/windows/ui/main-window.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>808</width>
<height>631</height>
<width>1200</width>
<height>800</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -190,9 +190,18 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>9</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="tabFiles"/>
</item>
Expand All @@ -214,9 +223,18 @@
</attribute>
<widget class="QWidget" name="dockVideoContents">
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>9</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="1">
<layout class="QVBoxLayout" name="tabVideo"/>
</item>
Expand All @@ -232,9 +250,18 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents_3">
<layout class="QGridLayout" name="gridLayout_4">
<property name="margin">
<number>9</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="tabTransitions"/>
</item>
Expand All @@ -250,9 +277,18 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents_4">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>9</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="tabEffects"/>
</item>
Expand All @@ -274,9 +310,18 @@
</attribute>
<widget class="QWidget" name="dockPropertiesContent">
<layout class="QGridLayout" name="gridLayout_6">
<property name="margin">
<number>9</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="1" column="1">
<widget class="QLineEdit" name="txtPropertyFilter">
<property name="inputMask">
Expand All @@ -293,6 +338,93 @@
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="dockTutorial">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="cursor">
<cursorShape>ForbiddenCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="visible">
<bool>true</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="floating">
<bool>true</bool>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable</set>
</property>
<property name="allowedAreas">
<set>Qt::NoDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Tutorial</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="visible">
<bool>false</bool>
</property>
<attribute name="dockWidgetArea">
<number>0</number>
</attribute>
<widget class="QWidget" name="dockTutorialContents">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<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 row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout>
</widget>
</widget>
<action name="actionNew">
<property name="icon">
<iconset theme="document-new" resource="../../images/openshot.qrc">
Expand Down Expand Up @@ -779,6 +911,39 @@
<string>Clear</string>
</property>
</action>
<action name="actionEffectsShowAll">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show All</string>
</property>
<property name="toolTip">
<string>Show All</string>
</property>
</action>
<action name="actionEffectsShowVideo">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Video</string>
</property>
<property name="toolTip">
<string>Video</string>
</property>
</action>
<action name="actionEffectsShowAudio">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Audio</string>
</property>
<property name="toolTip">
<string>Audio</string>
</property>
</action>
<action name="actionEffectsClear">
<property name="icon">
<iconset theme="edit-clear" resource="../../images/openshot.qrc">
Expand Down
Loading