# Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.pyqt5 import DBusQtMainLoop
        DBusQtMainLoop(set_as_default = True)

    # Use raster to make it faster
    #QApplication.setGraphicsSystem('raster')

    usage = unicode(i18n("%prog packages_to_install"))
    parser = OptionParser(usage=usage)

    packages = filter(lambda x: not x.startswith('-'), sys.argv[1:])

    if len(sys.argv) > 1:

        app = QUniqueApplication(sys.argv, catalog='pm-install')
        setSystemLocale()

        # Set application font from system
        font = Pds.settings('font','Sans,10').split(',')
        app.setFont(QFont(font[0], int(font[1])))

        window = PmWindow(app, packages)
        window.show()

        app.exec_()

    else:
        parser.print_usage()
        sys.exit(1)
Beispiel #2
0
        app = KApplication()

        # Create Main Widget
        mainWindow = ServiceManager(None, aboutData.appName)
        mainWindow.show()

    else:

        # Application Stuff
        from servicemanager.base import MainManager

        # Pds Stuff
        from pds.quniqueapp import QUniqueApplication
        from servicemanager.context import KIcon, i18n

        # Create a QUniqueApplication instance
        app = QUniqueApplication(sys.argv, catalog=about.appName)

        # Create Main Widget and make some settings
        mainWindow = MainManager(None)
        mainWindow.show()
        mainWindow.resize(640, 480)
        mainWindow.setWindowTitle(i18n(about.PACKAGE))
        mainWindow.setWindowIcon(KIcon(about.icon))

    # Create connection for lastWindowClosed signal to quit app
    app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)

    # Run the applications
    app.exec_()
Beispiel #3
0
    # Catch signals
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    # Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.qt import DBusQtMainLoop
        DBusQtMainLoop(set_as_default=True)

    # Use raster to make it faster
    QApplication.setGraphicsSystem('raster')

    pid = os.fork()
    if pid:
        os._exit(0)

    app = QUniqueApplication(sys.argv, catalog='package-manager')
    setSystemLocale()

    # Set application font from system
    font = Pds.settings('font', 'Sans,10').split(',')
    app.setFont(QFont(font[0], int(font[1])))

    manager = MainWindow(app)
    app.setMainWindow(manager)

    if config.PMConfig().systemTray():
        app.setQuitOnLastWindowClosed(False)

    if not config.PMConfig().systemTray() or "--show-mainwindow" in sys.argv:
        manager.show()
Beispiel #4
0
        KCmdLineArgs.init(sys.argv,aboutData)
        #Create a KApplication instance
        app=KApplication()
        window = MainWindow()
        print "tayfur"
        window.show()
        #Run the application
        app.exec_()
    else:
        import gettext

        __trans=gettext.translation('user-manager',fallback=True)
        i18n=__trans.ugettext

        from pds.quniqueapp import QUniqueApplication
        app=QUniqueApplication(sys.argv, catalog='user-manager')
        window=MainWindow()
        window.show()
        window.resize(680,550)
        window.setWindowTitle(i18n('User Manager'))
        window.setWindowIcon(KIcon('computer'))
        app.exec_()
"""
class Module(KCModule):
   def __init__(self, component_data, parent):
        KCModule.__init__(self, component_data, parent)

        KGlobal.locale().insertCatalog(catalog)

        if not dbus.get_default_main_loop():
            from dbus.mainloop.qt import DBusQtMainLoop
Beispiel #5
0
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    # Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.pyqt5 import DBusQtMainLoop
        DBusQtMainLoop(set_as_default = True)

    #Use raster to make it faster
    #QApplication nın böyle bir özelliği yok
    #QApplication.setGraphicsSystem('raster')

    pid = os.fork()
    if pid:
        os._exit(0)

    app = QUniqueApplication(sys.argv, catalog='package-manager')
    setSystemLocale()

    # Set application font from system
    font = Pds.settings('font','Sans,10').split(',')
    app.setFont(QFont(font[0], int(font[1])))

    manager = MainWindow()
    app.setMainWindow(manager)

    if config.PMConfig().systemTray():
        app.setQuitOnLastWindowClosed(False)

    if not config.PMConfig().systemTray() or "--show-mainwindow" in sys.argv:
        manager.show()
Beispiel #6
0
    # Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.qt import DBusQtMainLoop
        DBusQtMainLoop(set_as_default=True)

    # Use raster to make it faster
    QApplication.setGraphicsSystem('raster')

    usage = unicode(i18n("%prog packages_to_install"))
    parser = OptionParser(usage=usage)

    packages = filter(lambda x: not x.startswith('-'), sys.argv[1:])

    if len(sys.argv) > 1:

        app = QUniqueApplication(sys.argv, catalog='pm-install')
        setSystemLocale()

        # Set application font from system
        font = Pds.settings('font', 'Sans,10').split(',')
        app.setFont(QFont(font[0], int(font[1])))

        window = PmWindow(app, packages)
        window.show()

        app.exec_()

    else:
        parser.print_usage()
        sys.exit(1)
Beispiel #7
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Pardus Desktop Services
# Copyright (C) 2010, TUBITAK/UEKAE
# 2010 - Gökmen Göksel <gokmen:pardus.org.tr>

# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.

import sys
from pds.quniqueapp import QUniqueApplication

app = QUniqueApplication(sys.argv, catalog='test-app')

if app.readyToRun:
    print 'Application started !'

app.exec_()
Beispiel #8
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Pardus Desktop Services
# Copyright (C) 2010, TUBITAK/UEKAE
# 2010 - Gökmen Göksel <gokmen:pardus.org.tr>

# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.

import sys
from pds.quniqueapp import QUniqueApplication

app = QUniqueApplication(sys.argv, catalog = 'test-app')

if app.readyToRun:
    print 'Application started !'

app.exec_()
Beispiel #9
0
        KCmdLineArgs.init(sys.argv, aboutData)

        #Create a Kapplication instance
        app = KApplication()

        #Create Main Window
        window = MainWindow()
        window.show()

    else:
        #Boot Manager Pds stuff
        from pds.quniqueapp import QUniqueApplication
        from bootmanager.context import KIcon, i18n

        #Create a QUniqueApplication instance
        app = QUniqueApplication(sys.argv, catalog="boot-manager")

        #Create Main Window
        window = MainWindow()

        window.show()
        window.resize(640, 480)

        #Set Main  Window Title
        window.setWindowTitle(i18n("Boot Manager"))

        #Set Main Window Icon
        window.setWindowIcon(KIcon("computer"))

    #Run the application
    app.exec_()
Beispiel #10
0
        # Create connection for lastWindowClosed signal to quit app
        app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)

        # Run the application
        app.exec_()

    else:

        import gettext

        __trans = gettext.translation('service-manager', fallback=True)
        i18n = __trans.ugettext

        from servicemanager.base import MainManager
        from pds.quniqueapp import QUniqueApplication

        app = QUniqueApplication(sys.argv, catalog="service-manager")

        mainWindow = MainManager(None)
        mainWindow.show()
        mainWindow.resize(640, 480)
        mainWindow.setWindowTitle(i18n("Service Manager"))
        mainWindow.setWindowIcon(KIcon("flag-yellow"))

        app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)

        app.exec_()


Beispiel #11
0
                               description, license, copyright, text, homePage,
                               bugEmail)

        KCmdLineArgs.init(sys.argv, aboutData)
        app = kdeui.KApplication()

        # attach dbus to main loop
        tools.DBus()

        kaptan = Kaptan()
        kaptan.show()
        tools.centerWindow(kaptan)
        app.exec_()

    else:

        # attach dbus to main loop
        tools.DBus()
        import gettext
        __trans = gettext.translation('kaptan', fallback=True)
        i18n = __trans.ugettext

        from pds.quniqueapp import QUniqueApplication

        app = QUniqueApplication(sys.argv, catalog="kaptan")
        from pds.quniqueapp import QUniqueApplication
        kaptan = Kaptan()
        kaptan.show()
        tools.centerWindow(kaptan)
        app.exec_()
Beispiel #12
0
        KCmdLineArgs.init(sys.argv, aboutData)
        #Create a Kapplication instance
        app = KApplication()
        window = FirewallManager()
        window.show()

        app.exec_()
    else:

        import gettext

        __trans = gettext.translation('firewall-manager', fallback=True)
        i18n = __trans.ugettext

        from firewallmanager.main import MainWidget
        from pds.quniqueapp import QUniqueApplication

        app = QUniqueApplication(sys.argv, catalog="firewall-manager")

        mainWindow = MainWidget(None)
        mainWindow.show()
        mainWindow.resize(640, 480)
        mainWindow.setWindowTitle(i18n("Firewall Manager"))
        mainWindow.setWindowIcon(KIcon("security-high"))
        app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)
        app.exec_()


def CreatePlugin(widget_parent, parent, component_data):
    return Module(component_data, parent)
Beispiel #13
0
import sys

# PDS
from pds import Pds
from pds.quniqueapp import QUniqueApplication
from gui import UmMainScreen

from PyQt4.QtGui import QMessageBox

# Translations
_pds = Pds('upgrade-manager', debug = False)
_ = _pds.i18n

if __name__ == '__main__':

    app = QUniqueApplication(sys.argv, catalog='um')

    if not os.geteuid() == 0:
        QMessageBox.critical(None, _("Upgrade Manager"),
                                   _("You must have super user privileges to launch upgrade-manager"))
        sys.exit()

    if '--start-from-step2' in sys.argv:
        step = 2
    elif '--start-from-step3' in sys.argv:
        step = 3
    else:
        step = 1

    def oldStep():
        step_file = os.path.expanduser("~/.umstep")
Beispiel #14
0
import sys

# PDS
from pds import Pds
from pds.quniqueapp import QUniqueApplication
from gui import UmMainScreen

from PyQt4.QtGui import QMessageBox

# Translations
_pds = Pds('upgrade-manager', debug = False)
_ = _pds.i18n

if __name__ == '__main__':

    app = QUniqueApplication(sys.argv, catalog='um')

    if not os.geteuid() == 0:
        QMessageBox.critical(None, _("Upgrade Manager"),
                                   _("You must have super user privileges to launch upgrade-manager"))
        sys.exit()

    if '--start-from-step2' in sys.argv:
        step = 2
    elif '--start-from-step3' in sys.argv:
        step = 3
    else:
        step = 1

    def oldStep():
        step_file = os.path.expanduser("~/.umstep")
Beispiel #15
0
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    # Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.pyqt5 import DBusQtMainLoop
        DBusQtMainLoop(set_as_default = True)

    #Use raster to make it faster
    #QApplication nın böyle bir özelliği yok
    #QApplication.setGraphicsSystem('raster')

    pid = os.fork()
    if pid:
        os._exit(0)

    app = QUniqueApplication(sys.argv, catalog='package-manager')
    setSystemLocale()
    
    lang=setSystemLocale(True)
    translator=QTranslator()
    translator.load("/usr/share/package-manager/lang/{}.qm".format(lang))
    app.installTranslator(translator)
    app.setApplicationDisplayName(_translate("Main","Package Manager"))
    # Set application font from system
    
    font = Pds.settings('font','Sans,10').split(',')
    app.setFont(QFont(font[0], int(font[1])))
    
    manager = MainWindow(app)
    app.setMainWindow(manager)
Beispiel #16
0
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    # Create a dbus mainloop if its not exists
    if not dbus.get_default_main_loop():
        from dbus.mainloop.pyqt5 import DBusQtMainLoop
        DBusQtMainLoop(set_as_default=True)

    #Use raster to make it faster
    #QApplication nın böyle bir özelliği yok
    #QApplication.setGraphicsSystem('raster')

    pid = os.fork()
    if pid:
        os._exit(0)

    app = QUniqueApplication(sys.argv, catalog='package-manager')
    setSystemLocale()

    lang = setSystemLocale(True)
    translator = QTranslator()
    translator.load("/usr/share/package-manager/lang/{}.qm".format(lang))
    app.installTranslator(translator)
    app.setApplicationDisplayName(_translate("Main", "Package Manager"))
    # Set application font from system

    font = Pds.settings('font', 'Sans,10').split(',')
    app.setFont(QFont(font[0], int(font[1])))

    manager = MainWindow(app)
    app.setMainWindow(manager)