Exemple #1
0
 def login_dialog(self):
     while True:
         config['utm5']['login'], ok1 = QtGui.QInputDialog.getText(None,
                'Вход в личный кабинет', 'Введите логин:')
         config['utm5']['passwd'], ok2 = QtGui.QInputDialog.getText(None,
                'Вход в личный кабинет', 'Введите пароль:')
         if ok1 and ok2: break
     save_config()
    def on_confirm_button(self, widget):
        server = self.server_entry.get_text()
        if self.save_default_btn.get_active():
            options = load_config()
            options["http_stream_server"] = server
            save_config(options)

        self.emit("server-selected", server)
        self.close()
Exemple #3
0
    def __init__(self, parent=None, app=None):

        super(QWingsChat, self).__init__(parent)

        self.app = app
        self.error = 0

        self.setWindowTitle('КрыльяITV :: Чат')
        self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), 'wings_logo.png')))

        self.parser = ChatMsgParser()
        self.template = open(os.path.join(os.path.dirname(__file__), 'chattemplate.html')).read()

        if config['chat']['login'] is None:
            while True:
                login, ok = QtGui.QInputDialog.getText(self, 'Вход в чат', 'Выберите имя:')
                if ok:
                    break
            config['chat']['login'] = login
            save_config()
        else:
            login = config['chat']['login']

        self.chat = QWebView()
        self.chat.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
        self.message = QWingsChatLineEdit(login)

        vb = QtGui.QVBoxLayout()
        vb.setMargin(0)
        vb.setSpacing(0)
        vb.addWidget(self.chat)
        vb.addWidget(self.message)
        self.setLayout(vb)

        self.chat.setHtml(self.template)

        self.http = QHttp('torrent.mnx.net.ru')
        self.connect(self.http, QtCore.SIGNAL("done(bool)"), self.update_chat)

        self.timer = QtCore.QTimer()
        self.timer.singleShot(0, self.send_update_request)
Exemple #4
0
    def save_settings(self, this_session_only=False):
        ui_config = self.get_ui_config()

        if not ui_config:
            QMessageBox.critical(self, "Save error",
                                 "Saving new configuration has failed."
                                 "Fix the configuration options manually "
                                 "or reset to default settings and then save")
        else:
            if not this_session_only:
                if not settings.save_config(ui_config):
                    QMessageBox.critical(self, "Save error",
                                         "Saving new configuration has failed. "
                                         "The required file or folder could not be saved or created "
                                         "as '{}'".format(settings.config_file))
                    return

            if this_session_only:
                self.load_settings(from_dict=ui_config)
            else:
                self.load_settings()

            self.toggle_settings()
Exemple #5
0
 def on_confirm_button(self, widget):
     save_config(self.options)
     self.emit("config-saved")
     self.close()
Exemple #6
0
 def toggle_chat(self):
     self.chat.setVisible(not self.chat.isVisible())
     config['chat']['show'] = str(self.chat.isVisible())
     save_config()