예제 #1
0
        def init_dictionary(self):
            self.dictionary = files_dictionary(paths=[self.get_path(), ],
                extensions=self.extensions, title_parser=self.title_parser)

            if self.use_user_option:
                self.dictionary['User'] = os.path.join(
                    CONTEXT['app_preview_path'], 'user.png')
예제 #2
0
        def init_dictionary(self):
            self.dictionary = files_dictionary(paths=[self.get_path(), ],
                extensions=self.extensions, title_parser=self.title_parser)

            if self.use_user_option:
                self.dictionary['User'] = os.path.join(
                    PATHS['PHATCH_DATA_PATH'], 'user.png')
예제 #3
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[
             PATHS["PHATCH_IMAGE_PATH"],
             PATHS["USER_WATERMARKS_PATH"],
         ],
         extensions=self.extensions)
예제 #4
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[
             CONTEXT["app_watermarks_path"],
             CONTEXT["user_watermarks_path"],
         ],
         extensions=self.extensions)
예제 #5
0
파일: models.py 프로젝트: Reimilia/Camellia
        def init_dictionary(self):
            self.dictionary = files_dictionary(paths=[
                self.get_path(),
            ],
                                               extensions=self.extensions,
                                               title_parser=self.title_parser)

            if self.use_user_option:
                self.dictionary['User'] = os.path.join(
                    PATHS['PHATCH_DATA_PATH'], 'user.png')
예제 #6
0
    def _menu(self):
        #export menu
        self.menu_file_export = \
            self.menu_file_export_actionlist_to_clipboard.GetMenu()
        #file history
        self.menu_file_recent = wx.Menu()
        self.filehistory = wx.FileHistory()
        self.filehistory.UseMenu(self.menu_file_recent)
        self._set_file_history(self.get_setting('file_history'))
        self.Bind(wx.EVT_MENU_RANGE, self.on_menu_file_history,
            id=wx.ID_FILE1, id2=wx.ID_FILE9)
        self.menu_file.InsertMenu(2, wx.ID_REFRESH,
            _("Open &Recent"),
            self.menu_file_recent, "")

        #library
        #actionlists = [(system.filename_to_title(a), a)
        #    for a in wx.GetApp().get_action_list_files()]
        #actionlists.sort()
        #library = self.menu_file_library = wx.Menu()
        #prefix = len(actionlists) < 10
        #self.library_files = {}
        #for index, actionlist in enumerate(actionlists):
        #    id = wx.NewId()
        #    label = actionlist[0]
        #    if prefix:
        #        label = '&%d %s' % (index + 1, label)
        #    item = library.Append(id, label)
        #    self.library_files[id] = actionlist[1]
        #    self.Bind(wx.EVT_MENU, self.on_menu_file_library, item)
        ##wx2.6 compatible
        #wx_ID_EDIT = 5030
        #self.menu_file.InsertMenu(3, wx_ID_EDIT, _("Open &Library"),
        #   library, "")
        self.library_files_dictionary = formField.files_dictionary(
                    paths=[config.PATHS["PHATCH_ACTIONLISTS_PATH"],
                    ct.USER_ACTIONLISTS_PATH],
                    extensions=['png'])

        #shell
        self.shell = None
        #menu_item (for enabling/disabling)
        edit = [getattr(self, attr) for attr in dir(self)
            if attr[:10] == 'menu_edit_']
        edit.remove(self.menu_edit_add)
        view = [getattr(self, attr) for attr in dir(self)
            if attr[:10] == 'menu_view_']
        self.menu_item = [
            (self.menu_file, [
                self.menu_file_new.GetId(),
                self.menu_file_save.GetId(),
                self.menu_file_save_as.GetId()]),
            (self.menu_edit, [item.GetId() for item in edit]),
            (self.menu_view, [item.GetId() for item in view]),
            (self.menu_tools, [
                self.menu_tools_execute.GetId(),
                self.menu_tools_show_report.GetId(),
                self.menu_tools_show_log.GetId()]),
            (self.menu_file_export, [
                self.menu_file_export_actionlist_to_clipboard.GetId()])]
        self.on_show_droplet(False)
        # Mac  tweaks
        if wx.Platform == "__WXMAC__":
            #todo: about doesn't seem to work: why?!
            app = wx.GetApp()
            #app.SetMacHelpMenuTitleName(_('&Help'))
            app.SetMacAboutMenuItemId(wx.ID_ABOUT)
            app.SetMacExitMenuItemId(wx.ID_EXIT)
            #app.SetMacPreferencesMenuItemId(wx.ID_PREFERENCES)
        else:
            self.menu_file.InsertSeparator(8)
예제 #7
0
파일: models.py 프로젝트: Reimilia/Camellia
 def init_dictionary(self):
     self.dictionary = files_dictionary(paths=[
         PATHS["PHATCH_PERSPECTIVE_PATH"],
     ],
                                        extensions=self.extensions)
예제 #8
0
파일: models.py 프로젝트: Reimilia/Camellia
 def init_dictionary(self):
     self.dictionary = files_dictionary(paths=[
         PATHS["PHATCH_IMAGE_PATH"],
         PATHS["USER_WATERMARKS_PATH"],
     ],
                                        extensions=self.extensions)
예제 #9
0
파일: models.py 프로젝트: Reimilia/Camellia
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[PATHS["PHATCH_MASKS_PATH"], PATHS["USER_MASKS_PATH"]],
         extensions=self.extensions)
예제 #10
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[
             PATHS["PHATCH_PERSPECTIVE_PATH"],
         ],
         extensions=self.extensions)
예제 #11
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[PATHS["PHATCH_MASKS_PATH"],
                 PATHS["USER_MASKS_PATH"]],
         extensions=self.extensions)
예제 #12
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[
             CONTEXT['app_preview_perspective_path'],
         ],
         extensions=self.extensions)
예제 #13
0
 def init_dictionary(self):
     self.dictionary = files_dictionary(
         paths=[CONTEXT["app_highlights_path"],
                        CONTEXT["user_highlights_path"]],
         extensions=self.extensions)
예제 #14
0
파일: gui.py 프로젝트: sean-abbott/phatch
 def _menu(self):
     #export menu
     self.menu_file_export = \
         self.menu_file_export_actionlist_to_clipboard.GetMenu()
     #file history
     self.menu_file_recent = wx.Menu()
     self.filehistory = wx.FileHistory()
     self.filehistory.UseMenu(self.menu_file_recent)
     self._set_file_history(self.get_setting('file_history'))
     self.Bind(wx.EVT_MENU_RANGE,
               self.on_menu_file_history,
               id=wx.ID_FILE1,
               id2=wx.ID_FILE9)
     self.menu_file.InsertMenu(2, wx.ID_REFRESH, _("Open &Recent"),
                               self.menu_file_recent, "")
     self.library_files_dictionary = formField.files_dictionary(
         paths=[
             CONTEXT['app_preview_actionlists_path'],
             CONTEXT["user_actionlists_path"]
         ],
         extensions=['png'],
     )
     #file associations
     if CONTEXT['windows']:
         self.menu_tools_associate = wx.MenuItem(
             self.menu_tools,
             -1,
             _("&Image Types Assocations..."),
             _("Associate Phatch and Image Inspector with image types"),
             wx.ITEM_NORMAL,
         )
         self.menu_tools.AppendItem(self.menu_tools_associate)
         self.Bind(
             wx.EVT_MENU,
             self.on_menu_tools_associate,
             self.menu_tools_associate,
         )
     #shell
     self.shell = None
     #menu_item (for enabling/disabling)
     edit = [
         getattr(self, attr) for attr in dir(self)
         if attr[:10] == 'menu_edit_'
     ]
     edit.remove(self.menu_edit_add)
     view = [
         getattr(self, attr) for attr in dir(self)
         if attr[:10] == 'menu_view_'
     ]
     self.menu_item = [
         (self.menu_file, [
             self.menu_file_new.GetId(),
             self.menu_file_save.GetId(),
             self.menu_file_save_as.GetId()
         ]), (self.menu_edit, [item.GetId() for item in edit]),
         (self.menu_view, [item.GetId() for item in view]),
         (self.menu_tools, [
             self.menu_tools_execute.GetId(),
             self.menu_tools_show_report.GetId(),
             self.menu_tools_show_log.GetId()
         ]),
         (self.menu_file_export,
          [self.menu_file_export_actionlist_to_clipboard.GetId()])
     ]
     self.on_show_droplet(False)
     # Mac  tweaks
     if wx.Platform == "__WXMAC__":
         #todo: about doesn't seem to work: why?!
         app = wx.GetApp()
         #app.SetMacHelpMenuTitleName(_('&Help'))
         app.SetMacAboutMenuItemId(wx.ID_ABOUT)
         app.SetMacExitMenuItemId(wx.ID_EXIT)
         #app.SetMacPreferencesMenuItemId(wx.ID_PREFERENCES)
     else:
         self.menu_file.InsertSeparator(8)
         self.menu_help.InsertSeparator(7)