def __init__(self, parent = None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) self.Settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName()) self.loadSettings(self.Pass2Check.isChecked()) self.connect(self.DefaultsButton, SIGNAL("clicked()"),self.on_DefaultsButton_clicked) self.connect(self.okButton, SIGNAL("clicked()"),self.on_okButton_clicked) self.connect(self.Pass2Check, SIGNAL("toggled(bool)"), self.loadSettings) self.Pass2Check.setChecked(self.Settings.value("2pass",QVariant("False")).toBool())
def __init__(self, parent = None): """ Constructor """ QMainWindow.__init__(self, parent) #Use QMainWindow.__init___ self.setupUi(self) #setup the ui... #IMPORTANT: the line "QtCore.QMetaObject.connectSlotsByName(MainWindow)" in UI_MainWindow.py MUST be commented. self.settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName()) #Instantiate QSettings, using ini format always self.Fuze = fuze.Fuze(self) #Instantiate the Fuze class. self.resis = p2fuze.TransFuze(self) #AnotherTestPlugin her useful class. if os.name != 'nt': #If you are lucky and don't run that OS... self.mediaroot = "/media" #this is a very probable directory to start from to look for the fuze. else: self.mediaroot = os.path.join(os.path.expanduser("~"), "Desktop") #Otherwise, here we have the classical desktop... self.playlistname = self.mediaroot #Apply that for playlists too try: self.tableWidget.horizontalHeader().setResizeMode(3) #Try to fix size of tableWidgets self.tableWidget_2.horizontalHeader().setResizeMode(3) except: print "Your version of PyQt4 seems a bit out of date. This may lead to problems. But may not :)" #Most probable. The fact is that it doesn't work in PySide and older PyQt4. self.output = toPython(self.settings.value("outputdir",QVariant(os.path.expanduser("~"))).toString()) #Where to output things. self.setWindowTitle(QCoreApplication.applicationName()+" "+QCoreApplication.applicationVersion()) ##### These should be commented in case QtCore.QMetaObject.connectSlotsByName(MainWindow) in UI_MainWindow.py isn't commented. self.connect(self.actionAbout_Qt, SIGNAL("triggered()"),self.on_actionAbout_Qt_triggered) self.connect(self.RemoveButton, SIGNAL("clicked()"),self.on_RemoveButton_clicked) self.connect(self.RemoveButton_2, SIGNAL("clicked()"),self.on_RemoveButton_2_clicked) self.connect(self.RemoveButton_3, SIGNAL("clicked()"),self.on_RemoveButton_3_clicked) self.connect(self.ConvertButton, SIGNAL("clicked()"),self.on_ConvertButton_clicked) self.connect(self.ConvertButton_2, SIGNAL("clicked()"),self.on_ConvertButton_2_clicked) self.connect(self.actionPreferences, SIGNAL("triggered()"),self.on_actionPreferences_triggered) self.connect(self.actionAbout_video4fuze, SIGNAL("triggered()"),self.on_actionAbout_video4fuze_triggered) self.connect(self.AddButton, SIGNAL("clicked()"),self.on_AddButton_clicked) self.connect(self.AddDirButton, SIGNAL("clicked()"),self.on_AddDirButton_clicked) self.connect(self.AddButton_2, SIGNAL("clicked()"),self.on_AddButton_2_clicked) self.connect(self.SavePlaylist, SIGNAL("clicked()"),self.on_SavePlaylist_clicked) self.connect(self.SongsFromSD, SIGNAL("clicked()"),self.on_SongsFromSD_clicked) self.connect(self.SongsFromFuze, SIGNAL("clicked()"),self.on_SongsFromFuze_clicked) self.connect(self.OpenPlaylist, SIGNAL("clicked()"),self.on_OpenPlaylist_clicked) ##### self.connect(self.ToggleSort, SIGNAL("clicked()"),self.playlistWidget.sortItems) self.connect(self.SelectOutputButton, SIGNAL("clicked()"),self.SelectOutput) self.connect(self.SelectOutputButton_2, SIGNAL("clicked()"),self.SelectOutput)
def __init__(self, path: str, application: str, parent=None): super().__init__(QSettings.UserScope, QCoreApplication.organizationName(), application, parent)