Example #1
0
    def __init__(self, parent, pref, dirs=''):
        self.parent = parent
        wx.Panel.__init__(self, parent, -1)

        self.pref = Globals.pref
        self.mainframe = Globals.mainframe
        self.running = 0
        self.stopping = 0
        self.starting = 0

        self.box = box = ui.VBox()
        box.add(
            ui.Label(
                tr("Multiple directories or extensions should be separated by semicolons ';'"
                   )))
        h = ui.HBox()
        h.add(ui.Label(tr("Search for:")))
        h.add(ui.ComboBox(Globals.mainframe.document.GetSelectedText(), choices=self.pref.searchinfile_searchlist), name='search')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Label(tr("Directories:")))
        h.add(ui.ComboBox(dirs, choices=self.pref.searchinfile_dirlist), name='sdirs')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Button('...', size=(22, -1)),
              name='btnBrow').bind('click', self.OnDirButtonClick)
        box.add(h, flag=wx.EXPAND)
        h = ui.HBox()
        h.add(ui.Label(tr("Extensions:")))
        if not self.pref.searchinfile_extlist:
            v = '*.*'
        else:
            v = self.pref.searchinfile_extlist[0]
        h.add(ui.ComboBox(v, choices=self.pref.searchinfile_extlist), name='extns')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Check(self.pref.searchinfile_case, tr("Case sensitive")),
              name='cs')
        h.add(ui.Check(self.pref.searchinfile_subdir,
                       tr("Search subdirectories")),
              name='ss')
        h.add(ui.Check(self.pref.searchinfile_regular,
                       tr("Regular expression")),
              name='re')
        h.add(ui.Check(self.pref.searchinfile_onlyfilename,
                       tr("Only show filename")),
              name='onlyfilename')
        box.add(h, flag=wx.EXPAND)
        box.add(ui.ListBox, name='results').bind(wx.EVT_LISTBOX_DCLICK,
                                                 self.OpenFound)
        h = ui.HBox()
        h.add(ui.Label(tr('Status:')))
        h.add(ui.Text(tr("Ready.")), name='status')
        h.add(ui.Button(tr("Start Search")),
              name='btnRun').bind('click', self.OnFindButtonClick)
        h.add(ui.Button(tr("CopyClipboard"))).bind('click',
                                                   self.OnCopyButtonClick)
        box.add(h, flag=wx.EXPAND)

        ui.create(self, box, namebinding='widget')

        self.status.Enable(False)
    def __init__(self,
                 parent,
                 size=(850, 500),
                 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
        self.initmixin()

        #config.ini
        self.ini = common.get_config_file_obj()

        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           title=tr("Preferences"),
                           size=size,
                           style=style)

        self.value_set = []
        self.pages = {}
        self.pagenames = {}
        self.values = {}

        self.parent = parent
        self.pref = self.parent.pref
        self.default_pref = Preference.Preference()

        self.box = box = ui.VBox(namebinding='widget')
        self.treebook = TreeBookPanel(self, -1)
        self.addPages(self.treebook)

        box.add(self.treebook, proportion=1, flag=wx.EXPAND | wx.ALL)

        box.add(wx.StaticLine(self), flag=wx.EXPAND | wx.ALL)

        buttons = [(tr('OK'), wx.ID_OK, 'btnOk'),
                   (tr('Cancel'), wx.ID_CANCEL, 'btnCancel'),
                   (tr('Apply'), wx.ID_APPLY, 'btnApply')]
        box.add(ui.simple_buttons(buttons), flag=wx.ALIGN_CENTER | wx.BOTTOM)
        box.bind('btnOk', 'click', self.OnOk)
        box.bind('btnApply', 'click', self.OnApply)

        self.create_pages()

        self.callplugin('initpreference', self)
        ui.create(self, box, 0)
        self.btnOk.SetDefault()

        self.treebook.select()
        self.values = self.get_values()

        wx.EVT_UPDATE_UI(self, self.btnApply.GetId(), self.OnUpdateApply)

        self.callplugin('aftercreate', self)
Example #3
0
    def __init__(self, parent, pref, dirs=''):
        self.parent = parent
        wx.Panel.__init__(self, parent, -1)

        self.pref = Globals.pref
        self.mainframe = Globals.mainframe
        self.running = 0
        self.stopping = 0
        self.starting = 0

        self.box = box = ui.VBox()
        box.add(ui.Label(tr("Multiple directories or extensions should be separated by semicolons ';'")))
        h = ui.HBox()
        h.add(ui.Label(tr("Search for:")))
        h.add(ui.ComboBox(Globals.mainframe.document.GetSelectedText(), choices=self.pref.searchinfile_searchlist), name='search')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Label(tr("Directories:")))
        h.add(ui.ComboBox(dirs, choices=self.pref.searchinfile_dirlist), name='sdirs')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Button('...', size=(22,-1)), name='btnBrow').bind('click', self.OnDirButtonClick)
        box.add(h, flag=wx.EXPAND)
        h = ui.HBox()
        h.add(ui.Label(tr("Extensions:")))
        if not self.pref.searchinfile_extlist:
            v = '*.*'
        else:
            v = self.pref.searchinfile_extlist[0]
        h.add(ui.ComboBox(v, choices=self.pref.searchinfile_extlist), name='extns')\
            .bind('enter', self.OnKeyDown)
        h.add(ui.Check(self.pref.searchinfile_case, tr("Case sensitive")), name='cs')
        h.add(ui.Check(self.pref.searchinfile_subdir, tr("Search subdirectories")), name='ss')
        h.add(ui.Check(self.pref.searchinfile_regular, tr("Regular expression")), name='re')
        h.add(ui.Check(self.pref.searchinfile_onlyfilename, tr("Only show filename")), name='onlyfilename')
        box.add(h, flag=wx.EXPAND)
        box.add(ui.ListBox, name='results').bind(wx.EVT_LISTBOX_DCLICK, self.OpenFound)
        h = ui.HBox()
        h.add(ui.Label(tr('Status:')))
        h.add(ui.Text(tr("Ready.")), name='status')
        h.add(ui.Button(tr("Start Search")), name='btnRun').bind('click', self.OnFindButtonClick)
        h.add(ui.Button(tr("CopyClipboard"))).bind('click', self.OnCopyButtonClick)
        box.add(h, flag=wx.EXPAND)
        
        ui.create(self, box, namebinding='widget')
        
        self.status.Enable(False)
Example #4
0
    def __init__(self, parent, size=(850, 500), style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER):
        self.initmixin()

        #config.ini
        self.ini = common.get_config_file_obj()
        
        wx.Dialog.__init__(self, parent, -1, title=tr("Preferences"), size=size, style=style)

        self.value_set = []
        self.pages = {}
        self.pagenames = {}
        self.values = {}

        self.parent = parent
        self.pref = self.parent.pref
        self.default_pref = Preference.Preference()
        
        self.box = box = ui.VBox(namebinding='widget')
        self.treebook = TreeBookPanel(self, -1)
        self.addPages(self.treebook)
        
        box.add(self.treebook, proportion=1, flag=wx.EXPAND|wx.ALL)

        box.add(wx.StaticLine(self), flag=wx.EXPAND|wx.ALL)
        
        buttons = [(tr('OK'), wx.ID_OK, 'btnOk'), 
            (tr('Cancel'), wx.ID_CANCEL, 'btnCancel'),
            (tr('Apply'), wx.ID_APPLY, 'btnApply')]
        box.add(ui.simple_buttons(buttons), flag=wx.ALIGN_CENTER|wx.BOTTOM)
        box.bind('btnOk', 'click', self.OnOk)
        box.bind('btnApply', 'click', self.OnApply)
        
        self.create_pages()
        
        self.callplugin('initpreference', self)
        ui.create(self, box, 0)
        self.btnOk.SetDefault()
        
        self.treebook.select()
        self.values = self.get_values()
        
        wx.EVT_UPDATE_UI(self, self.btnApply.GetId(), self.OnUpdateApply)

        self.callplugin('aftercreate', self)