This commit is contained in:
Kovid Goyal 2011-01-21 14:06:36 -07:00
parent ab87388e07
commit ff97a9279f

View File

@ -170,7 +170,7 @@ class MetadataSingleDialogBase(ResizableDialog):
self.__custom_col_layouts = [layout] self.__custom_col_layouts = [layout]
# }}} # }}}
def set_custom_metadata_tab_order(self, before=None, after=None): def set_custom_metadata_tab_order(self, before=None, after=None): # {{{
sto = QWidget.setTabOrder sto = QWidget.setTabOrder
if getattr(self, 'custom_metadata_widgets', []): if getattr(self, 'custom_metadata_widgets', []):
ans = self.custom_metadata_widgets ans = self.custom_metadata_widgets
@ -185,12 +185,11 @@ class MetadataSingleDialogBase(ResizableDialog):
sto(ans[i].widgets[c-1], ans[i].widgets[c+1]) sto(ans[i].widgets[c-1], ans[i].widgets[c+1])
if after is not None: if after is not None:
pass # Do something pass # Do something
def do_layout(self): # {{{
raise NotImplementedError()
# }}} # }}}
def do_layout(self):
raise NotImplementedError()
def __call__(self, id_): def __call__(self, id_):
self.book_id = id_ self.book_id = id_
for widget in self.basic_metadata_widgets: for widget in self.basic_metadata_widgets:
@ -201,6 +200,7 @@ class MetadataSingleDialogBase(ResizableDialog):
#self.fetch_metadata_button.setFocus(Qt.OtherFocusReason) #self.fetch_metadata_button.setFocus(Qt.OtherFocusReason)
# Miscellaneous interaction methods {{{
def update_window_title(self, *args): def update_window_title(self, *args):
title = self.title.current_val title = self.title.current_val
if len(title) > 50: if len(title) > 50:
@ -287,6 +287,7 @@ class MetadataSingleDialogBase(ResizableDialog):
def fetch_metadata(self, *args): def fetch_metadata(self, *args):
pass # TODO: fetch metadata pass # TODO: fetch metadata
# }}}
def apply_changes(self): def apply_changes(self):
self.changed.add(self.book_id) self.changed.add(self.book_id)
@ -323,6 +324,7 @@ class MetadataSingleDialogBase(ResizableDialog):
def save_state(self): def save_state(self):
gprefs['metasingle_window_geometry3'] = bytearray(self.saveGeometry()) gprefs['metasingle_window_geometry3'] = bytearray(self.saveGeometry())
# Dialog use methods {{{
def start(self, row_list, current_row, view_slot=None): def start(self, row_list, current_row, view_slot=None):
self.row_list = row_list self.row_list = row_list
self.current_row = current_row self.current_row = current_row
@ -364,6 +366,7 @@ class MetadataSingleDialogBase(ResizableDialog):
x = getattr(self, b, None) x = getattr(self, b, None)
if x is not None: if x is not None:
disconnect(x.clicked) disconnect(x.clicked)
# }}}
class MetadataSingleDialog(MetadataSingleDialogBase): # {{{ class MetadataSingleDialog(MetadataSingleDialogBase): # {{{