33 from PyQt5.QtWidgets import QLabel, QWidget, QDockWidget, QVBoxLayout, QHBoxLayout, QPushButton, QToolButton, QCheckBox
35 from classes.logger
import log
36 from classes.settings
import get_settings
37 from classes.app
import get_app
49 painter = QPainter(self)
50 painter.setRenderHint(QPainter.Antialiasing)
51 frameColor = QColor(
"#53a0ed")
55 path.addRoundedRect(QRectF(31, 0, self.width()-31, self.height()), 10, 10)
56 painter.setPen(Qt.NoPen)
57 painter.fillPath(path, frameColor)
58 painter.drawPath(path)
62 path.addRoundedRect(QRectF(32, 1, self.width()-33, self.height()-2), 10, 10)
63 painter.setPen(Qt.NoPen)
64 painter.fillPath(path, self.palette().color(QPalette.Window))
65 painter.drawPath(path)
72 path.lineTo (31, 35 - arrow_height)
73 path.lineTo (31, (35 - arrow_height) + (arrow_height * 2))
75 painter.fillPath(path, frameColor)
76 painter.drawPath(path)
82 if state == Qt.Checked:
84 s.set(
"send_metrics",
True)
93 s.set(
"send_metrics",
False)
97 QWidget.__init__(self, *args)
109 vbox.setContentsMargins(32,10,10,10)
113 self.label.setText(text)
114 self.label.setTextFormat(Qt.RichText)
115 self.label.setWordWrap(
True)
116 self.label.setStyleSheet(
"margin-left: 20px;")
117 vbox.addWidget(self.
label)
127 checkbox_metrics = QCheckBox()
128 checkbox_metrics.setText(_(
"Yes, I would like to improve OpenShot!"))
129 checkbox_metrics.setStyleSheet(
"margin-left: 25px; margin-bottom: 5px;")
130 if s.get(
"send_metrics"):
131 checkbox_metrics.setCheckState(Qt.Checked)
133 checkbox_metrics.setCheckState(Qt.Unchecked)
135 vbox.addWidget(checkbox_metrics)
139 hbox.setContentsMargins(20,10,0,0)
143 self.btn_close_tips.setText(_(
"Hide Tutorial"))
145 self.btn_next_tip.setText(_(
"Next"))
146 self.btn_next_tip.setStyleSheet(
"font-weight:bold;")
155 self.setMinimumWidth(350)
156 self.setMinimumHeight(100)
159 self.setAttribute(Qt.WA_NoSystemBackground,
True)
160 self.setAttribute(Qt.WA_TranslucentBackground,
True)
182 tutorial_id = tutorial_details[
"id"]
183 tutorial_object_id = tutorial_details[
"object_id"]
184 tutorial_text = tutorial_details[
"text"]
185 tutorial_x_offset = tutorial_details[
"x"]
186 tutorial_y_offset = tutorial_details[
"y"]
187 turorial_arrow = tutorial_details[
"arrow"]
190 tutorial_object = self.
get_object(tutorial_object_id)
200 tutorial_dialog =
TutorialDialog(tutorial_id, tutorial_text, turorial_arrow)
203 tutorial_dialog.btn_next_tip.clicked.connect(functools.partial(self.
next_tip, tutorial_id))
204 tutorial_dialog.btn_close_tips.clicked.connect(functools.partial(self.
hide_tips, tutorial_id,
True))
207 self.dock.setWidget(tutorial_dialog)
211 self.dock.adjustSize()
212 self.dock.setEnabled(
True)
221 if object_id ==
"filesTreeView":
222 return self.win.filesTreeView
223 elif object_id ==
"timeline":
224 return self.win.timeline
225 elif object_id ==
"dockVideoContents":
226 return self.win.dockVideoContents
227 elif object_id ==
"propertyTableView":
228 return self.win.propertyTableView
229 elif object_id ==
"transitionsTreeView":
230 return self.win.transitionsTreeView
231 elif object_id ==
"effectsTreeView":
232 return self.win.effectsTreeView
233 elif object_id ==
"export_button":
236 for toolbutton
in self.win.toolBar.children():
237 if type(toolbutton) == QToolButton
and toolbutton.defaultAction()
and toolbutton.defaultAction().objectName() ==
"actionExportVideo":
257 tutorial_id = tutorial_object[
"id"]
258 if tutorial_id == tid:
263 self.tutorial_ids.append(str(tid))
270 s.set(
"tutorial_enabled",
False)
277 self.dock.setEnabled(
False)
284 self.win.dockFiles.visibilityChanged.disconnect()
285 self.win.dockTransitions.visibilityChanged.disconnect()
286 self.win.dockEffects.visibilityChanged.disconnect()
287 self.win.dockProperties.visibilityChanged.disconnect()
288 self.win.dockVideo.visibilityChanged.disconnect()
307 """ Move widget next to its position widget """
308 x = self.position_widget.mapToGlobal(self.position_widget.pos()).x()
309 y = self.position_widget.mapToGlobal(self.position_widget.pos()).y()
329 self.
tutorial_objects = [ {
"id":
"0",
"x":400,
"y":0,
"object_id":
"filesTreeView",
"text":_(
"<b>Welcome!</b> OpenShot Video Editor is an award-winning, open-source video editing application! This tutorial will walk you through the basics.<br><br>Would you like to automatically send errors and metrics to help improve OpenShot?"),
"arrow":
False},
330 {
"id":
"1",
"x":20,
"y":0,
"object_id":
"filesTreeView",
"text":_(
"<b>Project Files:</b> Get started with your project by adding video, audio, and image files here. Drag and drop files from your file system."),
"arrow":
True},
331 {
"id":
"2",
"x":200,
"y":-15,
"object_id":
"timeline",
"text":_(
"<b>Timeline:</b> Arrange your clips on the timeline here. Overlap clips to create automatic transitions. Access lots of fun presets and options by right-clicking on clips."),
"arrow":
True},
332 {
"id":
"3",
"x":200,
"y":100,
"object_id":
"dockVideoContents",
"text":_(
"<b>Video Preview:</b> Watch your timeline video preview here. Use the buttons (play, rewind, fast-forward) to control the video playback."),
"arrow":
True},
333 {
"id":
"4",
"x":20,
"y":-35,
"object_id":
"propertyTableView",
"text":_(
"<b>Properties:</b> View and change advanced properties of clips and effects here. Right-clicking on clips is usually faster than manually changing properties."),
"arrow":
True},
334 {
"id":
"5",
"x":20,
"y":10,
"object_id":
"transitionsTreeView",
"text":_(
"<b>Transitions:</b> Create a gradual fade from one clip to another. Drag and drop a transition onto the timeline and position it on top of a clip (usually at the beginning or ending)."),
"arrow":
True},
335 {
"id":
"6",
"x":20,
"y":20,
"object_id":
"effectsTreeView",
"text":_(
"<b>Effects:</b> Adjust brightness, contrast, saturation, and add exciting special effects. Drag and drop an effect onto the timeline and position it on top of a clip (or track)"),
"arrow":
True},
336 {
"id":
"7",
"x":-265,
"y":-22,
"object_id":
"export_button",
"text":_(
"<b>Export Video:</b> When you are ready to create your finished video, click this button to export your timeline as a single video file."),
"arrow":
True}
340 self.dock.setTitleBarWidget(QWidget())
341 self.dock.setAttribute(Qt.WA_NoSystemBackground,
True)
342 self.dock.setAttribute(Qt.WA_TranslucentBackground,
True)
343 self.dock.setWindowFlags(Qt.FramelessWindowHint)
344 self.dock.setFloating(
True)
348 self.win.dockFiles.visibilityChanged.connect(functools.partial(self.
process,
"dockFiles"))
349 self.win.dockTransitions.visibilityChanged.connect(functools.partial(self.
process,
"dockTransitions"))
350 self.win.dockEffects.visibilityChanged.connect(functools.partial(self.
process,
"dockEffects"))
351 self.win.dockProperties.visibilityChanged.connect(functools.partial(self.
process,
"dockProperties"))
352 self.win.dockVideo.visibilityChanged.connect(functools.partial(self.
process,
"dockVideo"))
def re_position_dialog
Reposition a tutorial dialog next to another widget.
def track_metric_screen
Track a GUI screen being shown.
def paintEvent
Custom paint event.
def get_app
Returns the current QApplication instance of OpenShot.
def next_tip
Mark the current tip completed, and show the next one.
def exit_manager
Disconnect from all signals, and shutdown tutorial manager.
Manage and present a list of tutorial dialogs.
A customized QWidget used to instruct a user how to use a certain feature.
def checkbox_metrics_callback
Callback for error and anonymous usage checkbox.
def re_show_dialog
Re show an active dialog.
def hide_tips
Hide the current tip, and don't show anymore.
def get_object
Get an object from the main window by object id.
def close_dialogs
Close any open tutorial dialogs.
def process
Process and show the first non-completed tutorial.
def get_settings
Get the current QApplication's settings instance.