mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 04:03:52 +02:00
Fix unable to clear username/password in Fetch news dialog
This commit is contained in:
parent
a4e1bd8ab3
commit
85cf39ba16
3 changed files with 16 additions and 3 deletions
|
|
@ -11,9 +11,9 @@
|
|||
import calendar, textwrap
|
||||
from collections import OrderedDict
|
||||
|
||||
from PyQt4.Qt import QDialog, Qt, QTime, QObject, QMenu, QHBoxLayout, \
|
||||
QAction, QIcon, QMutex, QTimer, pyqtSignal, QWidget, QGridLayout, \
|
||||
QCheckBox, QTimeEdit, QLabel, QLineEdit, QDoubleSpinBox
|
||||
from PyQt4.Qt import (QDialog, Qt, QTime, QObject, QMenu, QHBoxLayout,
|
||||
QAction, QIcon, QMutex, QTimer, pyqtSignal, QWidget, QGridLayout,
|
||||
QCheckBox, QTimeEdit, QLabel, QLineEdit, QDoubleSpinBox)
|
||||
|
||||
from calibre.gui2.dialogs.scheduler_ui import Ui_Dialog
|
||||
from calibre.gui2 import config as gconf, error_dialog
|
||||
|
|
@ -317,6 +317,8 @@ def commit(self, urn=None):
|
|||
return False
|
||||
if un or pw:
|
||||
self.recipe_model.set_account_info(urn, un, pw)
|
||||
else:
|
||||
self.recipe_model.clear_account_info(urn)
|
||||
|
||||
if self.schedule.isChecked():
|
||||
schedule_type, schedule = \
|
||||
|
|
|
|||
|
|
@ -437,6 +437,14 @@ def get_account_info(self, urn):
|
|||
if x.get('id', False) == urn:
|
||||
return x.get('username', ''), x.get('password', '')
|
||||
|
||||
def clear_account_info(self, urn):
|
||||
with self.lock:
|
||||
for x in self.iter_accounts():
|
||||
if x.get('id', False) == urn:
|
||||
x.getparent().remove(x)
|
||||
self.write_scheduler_file()
|
||||
break
|
||||
|
||||
def get_customize_info(self, urn):
|
||||
keep_issues = 0
|
||||
add_title_tag = True
|
||||
|
|
|
|||
|
|
@ -354,6 +354,9 @@ def update_last_downloaded(self, urn):
|
|||
def set_account_info(self, urn, un, pw):
|
||||
self.scheduler_config.set_account_info(urn, un, pw)
|
||||
|
||||
def clear_account_info(self, urn):
|
||||
self.scheduler_config.clear_account_info(urn)
|
||||
|
||||
def get_account_info(self, urn):
|
||||
return self.scheduler_config.get_account_info(urn)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue