def _ShowGallerySeedLogFrame(self):

        gallery_seed_log = self._gallery_seed_log_get_callable()

        tlw = self.window()

        title = '{} log'.format(self._gallery_type_string)

        if isinstance(tlw, QP.Dialog):

            if self._gallery_seed_log_set_callable is None:  # throw up a dialog that edits the gallery_seed log in place

                with ClientGUITopLevelWindowsPanels.DialogNullipotent(
                        self, title) as dlg:

                    panel = EditGallerySeedLogPanel(
                        dlg, self._controller, self._read_only,
                        self._can_generate_more_pages,
                        self._gallery_type_string, gallery_seed_log)

                    dlg.SetPanel(panel)

                    dlg.exec()

            else:  # throw up a dialog that edits the gallery_seed log but can be cancelled

                dupe_gallery_seed_log = gallery_seed_log.Duplicate()

                with ClientGUITopLevelWindowsPanels.DialogEdit(self,
                                                               title) as dlg:

                    panel = EditGallerySeedLogPanel(
                        dlg, self._controller, self._read_only,
                        self._can_generate_more_pages,
                        self._gallery_type_string, dupe_gallery_seed_log)

                    dlg.SetPanel(panel)

                    if dlg.exec() == QW.QDialog.Accepted:

                        self._gallery_seed_log_set_callable(
                            dupe_gallery_seed_log)

        else:  # throw up a frame that edits the gallery_seed log in place

            frame_key = 'gallery_import_log'

            frame = ClientGUITopLevelWindowsPanels.FrameThatTakesScrollablePanel(
                self, title, frame_key)

            panel = EditGallerySeedLogPanel(frame, self._controller,
                                            self._read_only,
                                            self._can_generate_more_pages,
                                            self._gallery_type_string,
                                            gallery_seed_log)

            frame.SetPanel(panel)
Beispiel #2
0
 def _ModifyAccounts( self ):
     
     accounts = self._account_list.GetData( only_selected = True )
     
     if len( accounts ) > 0:
         
         subject_account_identifiers = [ HydrusNetwork.AccountIdentifier( account_key = account.GetAccountKey() ) for account in accounts ]
         
         frame = ClientGUITopLevelWindowsPanels.FrameThatTakesScrollablePanel( self.window().parentWidget(), 'manage accounts' )
         
         panel = ModifyAccountsPanel( frame, self._service_key, subject_account_identifiers )
         
         frame.SetPanel( panel )
    def _ShowFileSeedCacheFrame(self):

        file_seed_cache = self._file_seed_cache_get_callable()

        tlw = self.window()

        title = 'file log'

        if isinstance(tlw, QP.Dialog):

            if self._file_seed_cache_set_callable is None:  # throw up a dialog that edits the file_seed cache in place

                with ClientGUITopLevelWindowsPanels.DialogNullipotent(
                        self, title) as dlg:

                    panel = EditFileSeedCachePanel(dlg, self._controller,
                                                   file_seed_cache)

                    dlg.SetPanel(panel)

                    dlg.exec()

            else:  # throw up a dialog that edits the file_seed cache but can be cancelled

                dupe_file_seed_cache = file_seed_cache.Duplicate()

                with ClientGUITopLevelWindowsPanels.DialogEdit(self,
                                                               title) as dlg:

                    panel = EditFileSeedCachePanel(dlg, self._controller,
                                                   dupe_file_seed_cache)

                    dlg.SetPanel(panel)

                    if dlg.exec() == QW.QDialog.Accepted:

                        self._file_seed_cache_set_callable(
                            dupe_file_seed_cache)

        else:  # throw up a frame that edits the file_seed cache in place

            frame_key = 'file_import_status'

            frame = ClientGUITopLevelWindowsPanels.FrameThatTakesScrollablePanel(
                self, title, frame_key)

            panel = EditFileSeedCachePanel(frame, self._controller,
                                           file_seed_cache)

            frame.SetPanel(panel)