def filechooser_popup(self):
     content = FileBrowser(ok_text='Add', directory_select=True)
     content.bind(on_cancel=self.filepopup_dismiss)
     content.bind(on_ok=self.add_directory)
     self.filepopup = filepopup = NormalPopup(title=self.title,
                                              content=content,
                                              size_hint=(0.9, 0.9))
     filepopup.open()
    def select_command(self):
        """Opens a popup filebrowser to select a program to run."""

        content = FileBrowser(ok_text='Select', filters=['*'])
        content.bind(on_cancel=lambda x: self.owner.owner.dismiss_popup())
        content.bind(on_ok=self.select_command_confirm)
        self.owner.owner.popup = filepopup = NormalPopup(
            title='Select A Program', content=content, size_hint=(0.9, 0.9))
        filepopup.open()
 def new_item(self,photoListRecyclerView):
     """Open new tag popup"""
     content = InputPopupTag(hint='Tag Name', text='Enter A Tag:')
     app = App.get_running_app()
     content.bind(on_answer=self.new_item_answer)
     self.photoListRecyclerView = photoListRecyclerView
     self.popup = NormalPopup(title='Create Tag', content=content, size_hint=(None, None),
                              size=(app.popup_x, app.button_scale * 5), auto_dismiss=False)
     self.popup.open()
示例#4
0
 def add_folder(self):
     content = FileBrowser(ok_text='Add', directory_select=True)
     content.bind(on_cancel=self.owner.owner.dismiss_popup)
     content.bind(on_ok=self.add_folder_confirm)
     self.owner.owner.popup = filepopup = NormalPopup(
         title='Select A Folder To Import From',
         content=content,
         size_hint=(0.9, 0.9))
     filepopup.open()
示例#5
0
    def select_watermark(self):
        """Open a filebrowser to select the watermark image."""

        content = FileBrowser(ok_text='Select', filters=['*.png'])
        content.bind(on_cancel=self.owner.owner.dismiss_popup)
        content.bind(on_ok=self.select_watermark_confirm)
        self.owner.owner.popup = filepopup = NormalPopup(
            title='Select Watermark PNG Image',
            content=content,
            size_hint=(0.9, 0.9))
        filepopup.open()
示例#6
0
    def select_export(self):
        """Activates a popup folder browser dialog to select the export folder."""

        content = FileBrowser(ok_text='Select', directory_select=True)
        content.bind(on_cancel=self.owner.owner.dismiss_popup)
        content.bind(on_ok=self.select_export_confirm)
        self.owner.owner.popup = filepopup = NormalPopup(
            title='Select An Export Folder',
            content=content,
            size_hint=(0.9, 0.9))
        filepopup.open()
    def add_folder(self):
        """Begin the add folder process, create an input popup."""

        content = InputPopup(hint='Folder Name', text='Enter A Folder Name:')
        app = App.get_running_app()
        content.bind(on_answer=self.add_folder_answer)
        self.popup = NormalPopup(title='Create Folder',
                                 content=content,
                                 size_hint=(None, None),
                                 size=(app.popup_x, app.button_scale * 4),
                                 auto_dismiss=False)
        self.popup.open()
示例#8
0
 def save_theme(self):
     content = FileBrowser(ok_text='Save',
                           directory_select=False,
                           file_editable=True,
                           export_mode=True,
                           file='theme.txt')
     content.bind(on_cancel=self.dismiss_popup)
     content.bind(on_ok=self.save_theme_check)
     self.popup = NormalPopup(title="Select File To Save Theme To",
                              content=content,
                              size_hint=(0.9, 0.9))
     self.popup.open()
示例#9
0
 def load_theme(self):
     content = FileBrowser(ok_text='Load',
                           directory_select=False,
                           file_editable=True,
                           export_mode=False,
                           file='theme.txt')
     content.bind(on_cancel=self.dismiss_popup)
     content.bind(on_ok=self.load_theme_finish)
     self.popup = NormalPopup(title="Select Theme To Load",
                              content=content,
                              size_hint=(0.9, 0.9))
     self.popup.open()
示例#10
0
 def _create_popup(self, instance):
     content = InputPopup(text='', input_text=self.value)
     app = App.get_running_app()
     content.bind(on_answer=self._validate)
     self.popup = NormalPopup(title=self.title,
                              content=content,
                              size_hint=(None, None),
                              size=(app.popup_x, app.button_scale * 5),
                              auto_dismiss=True)
     app = App.get_running_app()
     app.popup = self.popup
     self.popup.open()
示例#11
0
 def filechooser_popup(self):
     content = FileBrowser(ok_text='Export',
                           directory_select=False,
                           file_editable=True,
                           export_mode=True,
                           file='collage.jpg')
     content.bind(on_cancel=self.dismiss_popup)
     content.bind(on_ok=self.export_check)
     self.popup = NormalPopup(title="Select File To Export To",
                              content=content,
                              size_hint=(0.9, 0.9))
     self.popup.open()
    def rename_item(self, photoListRecyclerView):
        """Starts the folder renaming process, creates an input text popup."""

        content = InputPopup(hint=self.item.name, text='Rename To:')
        app = App.get_running_app()
        self.photoListRecyclerView = photoListRecyclerView
        content.bind(on_answer=self.rename_item_answer)
        self.photoListRecyclerView = photoListRecyclerView
        self.popup = NormalPopup(title='Rename Tag',
                                 content=content,
                                 size_hint=(None, None),
                                 size=(app.popup_x, app.button_scale * 5),
                                 auto_dismiss=False)
        self.popup.open()
示例#13
0
 def on_release(self):
     app = App.get_running_app()
     content = ConfirmPopup(text='Delete The Tag "' + self.to_remove + '"?',
                            yes_text='Delete',
                            no_text="Don't Delete",
                            warn_yes=True)
     content.bind(on_answer=self.on_answer)
     self.owner.popup = NormalPopup(title='Confirm Delete',
                                    content=content,
                                    size_hint=(None, None),
                                    size=(app.popup_x,
                                          app.button_scale * 4),
                                    auto_dismiss=False)
     self.owner.popup.open()
示例#14
0
    def export_finish(self):
        app = App.get_running_app()
        content = MessagePopup(text='Exporting Collage')
        if len(self.images) > 8:
            message = 'Exporting Collage, This May Take Several Minutes, Please Wait...'
        else:
            message = 'Exporting Collage, Please Wait...'
        self.popup = NormalPopup(title=message,
                                 content=content,
                                 size_hint=(None, None),
                                 size=(app.popup_x, app.button_scale * 4))
        self.popup.open()

        #Wait a cycle so the popup can display
        Clock.schedule_once(self.export_process)
    def delete_item(self, photoListRecyclerView):
        """Starts the delete folder process, creates the confirmation popup."""

        text = "Delete tag " + self.item.name + "\nThe Contained Files Will Not Be Deleted."
        content = ConfirmPopup(text=text,
                               yes_text='Delete',
                               no_text="Don't Delete",
                               warn_yes=True)
        app = App.get_running_app()
        self.photoListRecyclerView = photoListRecyclerView
        content.bind(on_answer=self.delete_item_answer)
        self.popup = NormalPopup(title='Confirm Delete',
                                 content=content,
                                 size_hint=(None, None),
                                 size=(app.popup_x, app.button_scale * 4),
                                 auto_dismiss=False)
        self.popup.open()
 def _create_popup(self, *_):
     app = App.get_running_app()
     if app.database_scanning:
         return
     content = BoxLayout(orientation='vertical')
     popup_width = min(0.95 * Window.width, dp(500))
     self.popup = popup = NormalPopup(title=self.title,
                                      content=content,
                                      size_hint=(None, 0.9),
                                      width=popup_width)
     if not self.value:
         content.add_widget(
             ShortLabel(
                 height=app.button_scale * 3,
                 text=
                 "You must set at least one screenDatabase directory.\n\nThis is a folder where your photos are stored.\nNew photos will be imported to a screenDatabase folder."
             ))
         content.add_widget(BoxLayout())
     else:
         folders = filter(None, self.value.split(';'))
         folderdata = []
         for folder in folders:
             folderdata.append({'text': folder})
         self.folderlist = folderlist = FolderSettingsList(size_hint=(1,
                                                                      .8),
                                                           id='folderlist')
         folderlist.data = folderdata
         content.add_widget(folderlist)
     buttons = BoxLayout(orientation='horizontal',
                         size_hint=(1, None),
                         height=app.button_scale)
     addbutton = NormalButton(text='+')
     addbutton.bind(on_release=self.add_path)
     removebutton = NormalButton(text='-')
     removebutton.bind(on_release=self.remove_path)
     okbutton = WideButton(text='OK')
     okbutton.bind(on_release=self._dismiss)
     buttons.add_widget(addbutton)
     buttons.add_widget(removebutton)
     buttons.add_widget(okbutton)
     content.add_widget(buttons)
     popup.open()
示例#17
0
    def delete_folder(self):
        """Starts the delete folder process, creates the confirmation popup."""

        app = App.get_running_app()
        if not os.listdir(self.path):
            text = "Delete The Selected Folder?"
            content = ConfirmPopup(text=text,
                                   yes_text='Delete',
                                   no_text="Don't Delete",
                                   warn_yes=True)
            content.bind(on_answer=self.delete_folder_answer)
            self.popup = NormalPopup(title='Confirm Delete',
                                     content=content,
                                     size_hint=(None, None),
                                     size=(app.popup_x, app.button_scale * 4),
                                     auto_dismiss=False)
            self.popup.open()
        else:
            app.popup_message(text='Could not delete, Folder is not empty',
                              title='Warning')
示例#18
0
 def save_theme_check(self, *_):
     path = self.popup.content.path
     file = self.popup.content.file
     self.dismiss_popup()
     self.filename = os.path.join(path, file)
     if os.path.isfile(self.filename):
         app = App.get_running_app()
         content = ConfirmPopup(text='Overwrite the file "' +
                                self.filename + '"?',
                                yes_text='Overwrite',
                                no_text="Cancel",
                                warn_yes=True)
         content.bind(on_answer=self.save_theme_finish)
         self.popup = NormalPopup(title='Confirm Overwrite',
                                  content=content,
                                  size_hint=(None, None),
                                  size=(app.popup_x, app.button_scale * 4),
                                  auto_dismiss=False)
         self.popup.open()
     else:
         self.save_theme_finish()