コード例 #1
0
ファイル: kaptan.py プロジェクト: pars-linux/uludag
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)
        self.screens = availableScreens
        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.createWidgets(self.screens)

        self.screenId = []
        for each in self.screens:
            #title = each.Widget().windowTitle()
            title = "camera"
            self.screenId.append(title)

            if self.screens.index(each) == 0:
                self.menuText += self.putBold(title)
            else:
                self.menuText += self.putBr(title)

        self.ui.labelMenu.setText(self.menuText)

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"),
                               self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"),
                               self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
コード例 #2
0
ファイル: kaptan.py プロジェクト: hasanakgoz/Pardus-2011-Svn-
class Kaptan(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)
        self.screens = availableScreens
        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.createWidgets(self.screens)

        self.screenId = []
        for each in self.screens:
            # title = each.Widget().windowTitle()
            title = "camera"
            self.screenId.append(title)

            if self.screens.index(each) == 0:
                self.menuText += self.putBold(title)
            else:
                self.menuText += self.putBr(title)

        self.ui.labelMenu.setText(self.menuText)

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"), self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"), self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))

    def slotFinished(self):
        if wallpaperWidget.Widget.selectedWallpaper:
            config = KConfig("plasma-appletsrc")
            group = config.group("Containments")
            for each in list(group.groupList()):
                subgroup = group.group(each)
                subcomponent = subgroup.readEntry("plugin")
                if subcomponent == "desktop" or subcomponent == "folderview":
                    subg = subgroup.group("Wallpaper")
                    subg_2 = subg.group("image")
                    subg_2.writeEntry("wallpaper", wallpaperWidget.Widget.selectedWallpaper)
            self.killPlasma()
            QtGui.qApp.quit()
        else:
            QtGui.qApp.quit()

    def killPlasma(self):
        p = subprocess.Popen(["pidof", "-s", "plasma"], stdout=subprocess.PIPE)
        out, err = p.communicate()
        pidOfPlasma = int(out)

        try:
            os.kill(pidOfPlasma, 15)
            self.startPlasma()
        except OSError, e:
            print "WARNING: failed os.kill: %s" % e
            print "Trying SIGKILL"
            os.kill(pidOfPlasma, 9)
            self.startPlasma()
コード例 #3
0
    def __init__(self, parent=None):

        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)

        # Kaptan screen settings
        self.commonScreens = [
            welcomeWidget, avatarWidget, mouseWidget, styleWidget, menuWidget,
            wallpaperWidget, networkWidget
        ]
        self.endScreens = [summaryWidget, goodbyeWidget]
        self.screens = self.appendOtherScreens(
            self.commonScreens) + self.endScreens

        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.titles = []
        self.descriptions = []

        # Draw progress pie
        self.countScreens = len(self.screens)
        self.pie = DrawPie(self.countScreens, self.ui.labelProgress)

        # Add screens to StackWidget
        self.createWidgets(self.screens)

        # Get Screen Titles
        for screen in self.screens:
            title = screen.Widget.title.toString()
            self.titles.append(title)

        # Initialize Menu
        self.menu = Menu(self.titles, self.ui.labelMenu)
        self.menu.start()

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"),
                               self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"),
                               self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
コード例 #4
0
ファイル: kaptan.py プロジェクト: hasanakgoz/Pardus-2011-Svn-
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)
        self.screens = availableScreens
        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.createWidgets(self.screens)

        self.screenId = []
        for each in self.screens:
            # title = each.Widget().windowTitle()
            title = "camera"
            self.screenId.append(title)

            if self.screens.index(each) == 0:
                self.menuText += self.putBold(title)
            else:
                self.menuText += self.putBr(title)

        self.ui.labelMenu.setText(self.menuText)

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"), self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"), self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
コード例 #5
0
ファイル: kaptan.py プロジェクト: dhirajkhatiwada1/uludag
    def __init__(self, parent = None):

        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)

        # Kaptan screen settings
        self.commonScreens = [welcomeWidget, avatarWidget, mouseWidget, styleWidget, menuWidget, wallpaperWidget, networkWidget]
        self.endScreens = [summaryWidget, goodbyeWidget]
        self.screens = self.appendOtherScreens(self.commonScreens) + self.endScreens

        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.titles = []
        self.descriptions = []

        # Draw progress pie
        self.countScreens = len(self.screens)
        self.pie = DrawPie(self.countScreens, self.ui.labelProgress)

        # Add screens to StackWidget
        self.createWidgets(self.screens)

        # Get Screen Titles
        for screen in self.screens:
            title = screen.Widget.title.toString()
            self.titles.append(title)

        # Initialize Menu
        self.menu = Menu(self.titles, self.ui.labelMenu)
        self.menu.start()

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"), self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"), self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
コード例 #6
0
class Kaptan(QtGui.QWidget):
    def __init__(self, parent=None):

        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)

        # Kaptan screen settings
        self.commonScreens = [
            welcomeWidget, avatarWidget, mouseWidget, styleWidget, menuWidget,
            wallpaperWidget, networkWidget
        ]
        self.endScreens = [summaryWidget, goodbyeWidget]
        self.screens = self.appendOtherScreens(
            self.commonScreens) + self.endScreens

        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.titles = []
        self.descriptions = []

        # Draw progress pie
        self.countScreens = len(self.screens)
        self.pie = DrawPie(self.countScreens, self.ui.labelProgress)

        # Add screens to StackWidget
        self.createWidgets(self.screens)

        # Get Screen Titles
        for screen in self.screens:
            title = screen.Widget.title.toString()
            self.titles.append(title)

        # Initialize Menu
        self.menu = Menu(self.titles, self.ui.labelMenu)
        self.menu.start()

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"),
                               self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"),
                               self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))

    def smoltProfileSent(self):
        ''' Do not show smolt screen if profile was already sended.'''
        smolt_uuid_path = "/etc/smolt/pub-uuid-smolt.pardus.org.tr"

        if os.path.exists(smolt_uuid_path):
            if os.path.getsize(smolt_uuid_path) > 0:
                return True

        return False

    def appendOtherScreens(self, commonScreens):
        screens = commonScreens

        # Append other screens depending on the following cases
        if tools.isLiveCD():
            screens.append(keyboardWidget)

        else:
            if self.smoltProfileSent():
                screens.append(packageWidget)
                screens.append(searchWidget)
            else:
                screens.append(searchWidget)
                screens.append(smoltWidget)
                screens.append(packageWidget)

        return screens

    def slotFinished(self):
        if wallpaperWidget.Widget.selectedWallpaper:
            config = KConfig("plasma-desktop-appletsrc")
            group = config.group("Containments")
            for each in list(group.groupList()):
                subgroup = group.group(each)
                subcomponent = subgroup.readEntry('plugin')
                if subcomponent == 'desktop' or subcomponent == 'folderview':
                    subg = subgroup.group('Wallpaper')
                    subg_2 = subg.group('image')
                    subg_2.writeEntry("wallpaper",
                                      wallpaperWidget.Widget.selectedWallpaper)
            self.killPlasma()
            QtGui.qApp.quit()
        else:
            QtGui.qApp.quit()

    def killPlasma(self):
        p = subprocess.Popen(["pidof", "-s", "plasma-desktop"],
                             stdout=subprocess.PIPE)
        out, err = p.communicate()
        pidOfPlasma = int(out)

        try:
            os.kill(pidOfPlasma, 15)
            self.startPlasma()
        except OSError, e:
            print 'WARNING: failed os.kill: %s' % e
            print "Trying SIGKILL"
            os.kill(pidOfPlasma, 9)
            self.startPlasma()
コード例 #7
0
ファイル: kaptan.py プロジェクト: dhirajkhatiwada1/uludag
class Kaptan(QtGui.QWidget):
    def __init__(self, parent = None):

        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)

        # Kaptan screen settings
        self.commonScreens = [welcomeWidget, avatarWidget, mouseWidget, styleWidget, menuWidget, wallpaperWidget, networkWidget]
        self.endScreens = [summaryWidget, goodbyeWidget]
        self.screens = self.appendOtherScreens(self.commonScreens) + self.endScreens

        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.titles = []
        self.descriptions = []

        # Draw progress pie
        self.countScreens = len(self.screens)
        self.pie = DrawPie(self.countScreens, self.ui.labelProgress)

        # Add screens to StackWidget
        self.createWidgets(self.screens)

        # Get Screen Titles
        for screen in self.screens:
            title = screen.Widget.title.toString()
            self.titles.append(title)

        # Initialize Menu
        self.menu = Menu(self.titles, self.ui.labelMenu)
        self.menu.start()

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"), self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"), self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))

    def smoltProfileSent(self):
        ''' Do not show smolt screen if profile was already sended.'''
        smolt_uuid_path = "/etc/smolt/pub-uuid-smolt.pardus.org.tr"

        if os.path.exists(smolt_uuid_path):
            if os.path.getsize(smolt_uuid_path) > 0:
                return True

        return False

    def appendOtherScreens(self, commonScreens):
        screens = commonScreens

        # Append other screens depending on the following cases
        if tools.isLiveCD():
            screens.append(keyboardWidget)

        else:
            if self.smoltProfileSent():
                screens.append(packageWidget)
                screens.append(searchWidget)
            else:
                screens.append(searchWidget)
                screens.append(smoltWidget)
                screens.append(packageWidget)

        return screens

    def slotFinished(self):
        if wallpaperWidget.Widget.selectedWallpaper:
            config =  KConfig("plasma-desktop-appletsrc")
            group = config.group("Containments")
            for each in list(group.groupList()):
                subgroup = group.group(each)
                subcomponent = subgroup.readEntry('plugin')
                if subcomponent == 'desktop' or subcomponent == 'folderview':
                    subg = subgroup.group('Wallpaper')
                    subg_2 = subg.group('image')
                    subg_2.writeEntry("wallpaper", wallpaperWidget.Widget.selectedWallpaper)
            self.killPlasma()
            QtGui.qApp.quit()
        else:
            QtGui.qApp.quit()

    def killPlasma(self):
        p = subprocess.Popen(["pidof", "-s", "plasma-desktop"], stdout=subprocess.PIPE)
        out, err = p.communicate()
        pidOfPlasma = int(out)

        try:
            os.kill(pidOfPlasma, 15)
            self.startPlasma()
        except OSError, e:
            print 'WARNING: failed os.kill: %s' % e
            print "Trying SIGKILL"
            os.kill(pidOfPlasma, 9)
            self.startPlasma()
コード例 #8
0
ファイル: kaptan.py プロジェクト: pars-linux/uludag
class Kaptan(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_kaptanUI()

        self.ui.setupUi(self)
        self.screens = availableScreens
        self.screenData = None
        self.moveInc = 1
        self.menuText = ""
        self.config = KConfig("kaptanrc")
        self.createWidgets(self.screens)

        self.screenId = []
        for each in self.screens:
            #title = each.Widget().windowTitle()
            title = "camera"
            self.screenId.append(title)

            if self.screens.index(each) == 0:
                self.menuText += self.putBold(title)
            else:
                self.menuText += self.putBr(title)

        self.ui.labelMenu.setText(self.menuText)

        QtCore.QObject.connect(self.ui.buttonNext, QtCore.SIGNAL("clicked()"),
                               self.slotNext)
        QtCore.QObject.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked()"),
                               self.slotBack)
        QtCore.QObject.connect(self.ui.buttonFinish,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))
        QtCore.QObject.connect(self.ui.buttonCancel,
                               QtCore.SIGNAL("clicked()"), QtGui.qApp,
                               QtCore.SLOT("quit()"))

    def slotFinished(self):
        if wallpaperWidget.Widget.selectedWallpaper:
            config = KConfig("plasma-appletsrc")
            group = config.group("Containments")
            for each in list(group.groupList()):
                subgroup = group.group(each)
                subcomponent = subgroup.readEntry('plugin')
                if subcomponent == 'desktop' or subcomponent == 'folderview':
                    subg = subgroup.group('Wallpaper')
                    subg_2 = subg.group('image')
                    subg_2.writeEntry("wallpaper",
                                      wallpaperWidget.Widget.selectedWallpaper)
            self.killPlasma()
            QtGui.qApp.quit()
        else:
            QtGui.qApp.quit()

    def killPlasma(self):
        p = subprocess.Popen(["pidof", "-s", "plasma"], stdout=subprocess.PIPE)
        out, err = p.communicate()
        pidOfPlasma = int(out)

        try:
            os.kill(pidOfPlasma, 15)
            self.startPlasma()
        except OSError, e:
            print 'WARNING: failed os.kill: %s' % e
            print "Trying SIGKILL"
            os.kill(pidOfPlasma, 9)
            self.startPlasma()