+ def createMainDialog(self):
+ """ Build the main dialog layout """
+
+ self.setWindowTitle("Profile manager / Dboxswitch - dropbox profile switcher")
+
+ self.la = QtGui.QFormLayout()
+ self.la.sizePolicy = QtGui.QSizePolicy.Expanding
+ self.la.setVerticalSpacing(15)
+ self.la.setHorizontalSpacing(15)
+ self.formGroupBox = QtGui.QGroupBox("Manage profiles:")
+ self.formGroupBox.setLayout(self.la)
+ mainLayout = QtGui.QVBoxLayout()
+ mainLayout.addWidget(self.formGroupBox)
+ self.setLayout(mainLayout)
+
+
+ def show(self):
+ """ Show the main dialog for dealing with profiles """
+
+ profiles = self.profileManager.getProfilesList()
+
+ for pr in profiles:
+ prname = self.profileManager.getBaseProfileName(pr)
+ delButton = QtGui.QToolButton()
+ label = QtGui.QLabel(prname)
+ self.la.addRow(label, delButton)
+ delAction = QtGui.QAction(QtGui.QIcon(appconf.delpicon),"Delete", self,
+ triggered=self.deleteProfileAction(prname, (label, delButton)))
+ delButton.setDefaultAction(delAction)
+ self.profiles.append((label, delButton))
+
+ self.sizeHint()
+ super(Gui, self).show()
+
+ def hide(self):
+ """ Hides the main dialog """
+
+ #Hides all the profiles in the Dialog
+ #User can deal with profiles like removing the dir manually
+
+ for ws in self.profiles:
+ for w in ws:
+ w.setParent(None)
+ w.close()
+ super(Gui, self).hide()