Exemple #1
0
    def reloadConfiguration(self):
        Settings.loadFromFile()

        self.prefix = Settings.value('runner.prefix', '')
        self.limit = Settings.value('runner.max_results', 5)

        # If no 'runner' specific settings, use standard Koo defaults
        self.language = Settings.value('runner.language',
                                       Settings.value('client.language'))
        self.url = Settings.value('runner.url', Settings.value('login.url'))
        self.database = Settings.value('runner.db', Settings.value('login.db'))

        Localization.initializeTranslations(self.language)
        if not Rpc.session.login(self.url, self.database):
            print('### KooRunner: Could not log in.')
from PyQt5.QtWidgets import QApplication, QMainWindow, QDialog, QHBoxLayout
#from PyQt5.QtCore import SIGNAL

import sys
sys.path.insert(0, '..')
sys.path.insert(0, '.')

from Koo.Rpc import Rpc
from Koo.Common import Api
from Koo.Common import Localization
Localization.initializeTranslations()
from Koo.Dialogs import WindowService

x = Rpc.session.login('http://*****:*****@localhost:8069', 'test_1519123854')

app = QApplication([])


class TestWindow(QMainWindow):
    def addWindow(self, window, target):
        parent = QApplication.activeModalWidget()
        if not parent:
            parent = self
        dialog = QDialog(parent)
        dialog.setWindowTitle(_('Wizard'))
        dialog.setModal(True)
        layout = QHBoxLayout(dialog)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(window)
        window.setParent(dialog)
        # self.connect( window, SIGNAL('closed()'), dialog.accept )
Exemple #3
0
# Note that we need translations in order to parse command line arguments
# because we might have to print information to the user. However, koo's
# language configuration is stored in the .rc file users might provide in
# the command line.
#
# To solve this problem we load translations twice: one before command line
# parsing and another one after, with the definitive language.
#
# Under windows, loading language twice doesn't work, and the first one loaded
# will be the one used so we first load settings from default file and registre,
# then load translations based on that file, then parse command line arguments
# and eventually load definitive translations (which windows will ignore silently).
Settings.loadFromFile()
Settings.loadFromRegistry()
Localization.initializeTranslations(Settings.value('client.language'))

arguments = CommandLine.parseArguments(sys.argv)

Localization.initializeTranslations(Settings.value('client.language'))


imports = {}

from PyQt5.QtCore import *
from PyQt5.QtGui import *
from Koo.Common import Notifier, Common
from Koo.Common import DBus

# Declare notifier handlers for the whole application
Notifier.errorHandler = Common.error
Exemple #4
0
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
##############################################################################


from Koo.Common import Localization
Localization.initializeTranslations()

# Load this after localization as these modules depend on it
from Koo.Common import Notifier, Common

# Declare notifier handlers for the whole application
Notifier.errorHandler = Common.error
Notifier.warningHandler = Common.warning
Notifier.concurrencyErrorHandler = Common.concurrencyError


from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
from MainWindow import *