def reload(self): self.config = ConfigParser.RawConfigParser() self.config.readfp(getConfig()) self.tray.setIcon(self.inactiveIcon) self.controller.core.restart_core() if self.config.getboolean("main", "aot"): self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) else: self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
def __init__(self, parent=None): self.uri = "" self.config = ConfigParser.RawConfigParser() self.config.readfp(getConfig()) super(Dialer, self).__init__(parent, QtCore.Qt.FramelessWindowHint) self.errortimer = QtCore.QTimer() self.errortimer.setInterval(1000) self.setupUi(self) try: if self.config.getboolean("main", "aot"): self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) except: pass try: if not self.config.getboolean("main", "ust"): a = 1 / 0 else: self.dialButton.setIcon(QtGui.QIcon.fromTheme("call-start")) self.hangupButton.setIcon(QtGui.QIcon.fromTheme("call-stop")) except: self.setStyleSheet( """QPushButton,QToolButton {background-color: rgb(40,40,40); height: 20px; color: rgb(255,255,255); border-style: outset; border-width: 1px; border-color: rgb(50,50,50);} QDialog {background-color: rgb(10,10,10); color: rgb(255,255,255); border-style: outset; border-width: 1px; border-color: rgb(50,50,50); } QLabel {color: rgb(255,255,255);} QLineEdit {color: white; background-color: rgb(30,30,30); border-style: outset; border-width: 1px; border-color: rgb(50,50,50); }""" ) self.numberEdit.button.setStyleSheet("background: transparent; border: none; margin-right: 5px") self.notify = NotifyManager() self.inactiveIcon = QtGui.QIcon(":/inactive.png") self.connectedIcon = QtGui.QIcon(":/connected.png") self.errorIcon = QtGui.QIcon(":/error.png") self.dialIcon = QtGui.QIcon(":/call.png") self.hangupIcon = QtGui.QIcon(":/stop.png") self.settings = SettingsForm() self.controller = Controller(self) self.settings.load() self.createTrayIcon() self.connectSignals() self.server = None self.login = None self.password = None try: self.server = self.config.get("sip", "server") self.login = self.config.get("sip", "login") self.password = self.config.get("sip", "password") except: pass for sd in self.controller.core.lib.enum_snd_dev(): self.settings.inputComboBox.addItem(self.trans(sd.name)) self.settings.outputComboBox.addItem(self.trans(sd.name)) self.settings.load() try: self.controller.core.lib.set_snd_dev( self.settings.inputComboBox.currentIndex(), self.settings.outputComboBox.currentIndex() ) except: debug(_("Audio-device error"))
def start(self): self.config = ConfigParser.RawConfigParser() self.config.readfp(getConfig()) self._start_lib() self._start_acc()
def __init__(self, parent=None): self.uri = "" self.callswidgets = [] self.contactswidgets = [] self.config = ConfigParser.RawConfigParser() self.config.readfp(getConfig()) super(Dialer, self).__init__(parent, QtCore.Qt.FramelessWindowHint) self.errortimer = QtCore.QTimer() self.errortimer.setInterval(1000) self.setupUi(self) try: if self.config.getboolean("main", "aot"): self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) except: pass try: if not self.config.getboolean("main", "ust"): a = 1 / 0 else: self.dialButton.setIcon(QtGui.QIcon.fromTheme("call-start")) self.hangupButton.setIcon(QtGui.QIcon.fromTheme("call-stop")) except: self.setStyleSheet( """QPushButton,QToolButton {background-color: rgb(40,40,40); height: 20px; color: rgb(255,255,255); border-style: outset; border-width: 1px; border-color: rgb(50,50,50);} QDialog {background-color: rgb(10,10,10); color: rgb(255,255,255); border-style: outset; border-width: 1px; border-color: rgb(50,50,50); } QLabel {color: rgb(255,255,255);} QLineEdit {color: white; background-color: rgb(30,30,30); border-style: outset; border-width: 1px; border-color: rgb(50,50,50); }""") self.contactsForm = ContactsForm() self.numberEdit.button.setStyleSheet( "background: transparent; border: none; margin-right: 5px") self.notify = NotifyManager() self.inactiveIcon = QtGui.QIcon(":/inactive.png") self.connectedIcon = QtGui.QIcon(":/connected.png") self.errorIcon = QtGui.QIcon(":/error.png") self.dialIcon = QtGui.QIcon(":/call.png") self.hangupIcon = QtGui.QIcon(":/stop.png") self.settings = SettingsForm() self.controller = Controller(self) self.settings.load() self.createTrayIcon() self.connectSignals() self.server = None self.login = None self.password = None self.calls = HistoryAdapter() self.contacts = ContactsAdapter() try: self.server = self.config.get("sip", "server") self.login = self.config.get("sip", "login") self.password = self.config.get("sip", "password") except: pass for sd in self.controller.core.lib.enum_snd_dev(): self.settings.inputComboBox.addItem(self.trans(sd.name)) self.settings.outputComboBox.addItem(self.trans(sd.name)) self.settings.load() try: self.controller.core.lib.set_snd_dev( self.settings.inputComboBox.currentIndex(), self.settings.outputComboBox.currentIndex()) except: debug(_("Audio-device error"))
def reset_config(): config.readfp(getConfig())
# 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 PyQt4 import QtCore, QtGui BaseClass = QtGui.QDialog from ui_settings import Ui_SettingsDialog as formClass import sys from debug import debug import os from StringIO import StringIO from settings_file import getConfig, saveSettings import ConfigParser config = ConfigParser.RawConfigParser() config.readfp(getConfig()) import traceback def reset_config(): config.readfp(getConfig()) class SettingsForm(formClass, BaseClass): def __init__(self, parent=None): super(SettingsForm, self).__init__(parent) self.setupUi(self) def load(self, checkpass = True): reset_config() try: self.serverEdit.setText(unicode(config.get("sip", "server"))) self.portEdit.setText(unicode(config.get("sip", "port")))