34 from PyQt5.QtGui import QIcon, QStandardItemModel, QStandardItem
39 from classes
import info, ui_util, settings, qt_types, updates
40 from classes.app
import get_app
41 from classes.logger
import log
50 ui_path = os.path.join(info.PATH,
'windows',
'ui',
'profile.ui')
55 QDialog.__init__(self)
76 for profile_folder
in [info.USER_PROFILES_PATH, info.PROFILES_PATH]:
77 for file
in os.listdir(profile_folder):
79 profile_path = os.path.join(profile_folder, file)
80 profile = openshot.Profile(profile_path)
83 self.profile_names.append(profile.info.description)
87 self.profile_names.sort()
95 self.cboProfile.addItem(profile_name, self.
profile_paths[profile_name])
98 if app.project.get([
'profile']) == profile_name:
99 selected_index = box_index
106 self.cboProfile.currentIndexChanged.connect(functools.partial(self.
dropdown_index_changed, self.cboProfile))
109 self.cboProfile.setCurrentIndex(selected_index)
113 value = self.cboProfile.itemData(index)
117 profile = openshot.Profile(value)
120 self.lblSize.setText(
"%sx%s" % (profile.info.width, profile.info.height))
121 self.lblFPS.setText(
"%0.2f" % (profile.info.fps.num / profile.info.fps.den))
122 self.lblOther.setText(
"DAR: %s/%s, SAR: %s/%s, Interlaced: %s" % (profile.info.display_ratio.num, profile.info.display_ratio.den, profile.info.pixel_ratio.num, profile.info.pixel_ratio.den, profile.info.interlaced_frame))
125 get_app().updates.update([
"profile"], profile.info.description)
126 get_app().updates.update([
"width"], profile.info.width)
127 get_app().updates.update([
"height"], profile.info.height)
128 get_app().updates.update([
"fps"], {
"num" : profile.info.fps.num,
"den" : profile.info.fps.den})
131 get_app().window.timeline_sync.timeline.ApplyMapperToClips()
134 get_app().window.SetWindowTitle(profile.info.description)
def get_app()
Returns the current QApplication instance of OpenShot.
def get_settings()
Get the current QApplication's settings instance.
def init_ui(window)
Initialize all child widgets and action of a window or dialog.
def dropdown_index_changed(self, widget, index)
def track_metric_screen(screen_name)
Track a GUI screen being shown.
def load_ui(window, path)
Load a Qt *.ui file, and also load an XML parsed version.