Beispiel #1
0
    def __init__(self,parent,type):
        WizardPageSimple.__init__(self,parent)
        self.parent = parent
        self.utility = parent.utility
        
        mainbox = wx.BoxSizer(wx.VERTICAL)
        text = wx.StaticText(self, -1, self.utility.lang.get('rwid_explanation'))
        text.Wrap(400)
        mainbox.Add(text, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5)

        # Real-World Identifiers
        rwidbox = wx.BoxSizer(wx.VERTICAL)
        self.rwidlist = RWIDList(self)
        rwidbox.Add(self.rwidlist, 1, wx.EXPAND|wx.ALL, 5)
        
        rwidbtnbox = wx.BoxSizer(wx.HORIZONTAL)
        
        button = wx.Button(self, -1, self.utility.lang.get('addrwid'), style = wx.BU_EXACTFIT)
        self.Bind(wx.EVT_BUTTON, self.OnAddRWID, button)
        rwidbtnbox.Add(button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3)

        button = wx.Button(self, -1, self.utility.lang.get('remrwid'), style = wx.BU_EXACTFIT)
        self.Bind(wx.EVT_BUTTON, self.OnRemoveRWID, button)
        rwidbtnbox.Add(button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3)
        rwidbox.Add(rwidbtnbox, 0, wx.EXPAND)
        mainbox.Add(rwidbox, 0, wx.EXPAND)

        self.SetSizerAndFit(mainbox)

        self.rwidlist.loadList()
Beispiel #2
0
 def __init__(self, parent):
     self.parent = parent
     self._sizer = None
     self._levels = []
     WizardPageSimple.__init__(self, parent)
     self.LabelText = wx.StaticText(self, -1, label="Select titles of directories on selected levels:")
     self.__set_properties()
     self.__do_layout()
Beispiel #3
0
    def __init__(self, parent, type):
        WizardPageSimple.__init__(self, parent)
        self.utility = parent.utility

        # 0. mainbox
        mainbox = wx.BoxSizer(wx.VERTICAL)

        # 1. topbox
        topbox = wx.BoxSizer(wx.VERTICAL)

        # Ask public name
        name = self.utility.session.get_nickname()

        name_box = wx.BoxSizer(wx.HORIZONTAL)
        self.myname = wx.TextCtrl(self, -1, name)
        name_box.Add(wx.StaticText(self, -1, self.utility.lang.get('myname')),
                     0, wx.ALIGN_CENTER_VERTICAL)
        name_box.Add(self.myname, 0,
                     wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
        topbox.Add(name_box, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT,
                   5)

        # Ask public user icon / avatar
        icon_box = wx.BoxSizer(wx.HORIZONTAL)
        icon_box.Add(wx.StaticText(self, -1, self.utility.lang.get('myicon')),
                     0, wx.ALIGN_CENTER_VERTICAL)

        ## TODO: integrate this code with makefriends.py, especially checking code
        self.iconbtn = None
        self.iconmime, self.icondata = self.utility.session.get_mugshot()
        if self.icondata:
            bm = data2wxBitmap(self.iconmime, self.icondata)
        else:
            im = IconsManager.getInstance()
            bm = im.get_default('PEER_THUMB')

        if sys.platform == 'darwin':
            path = get_home_dir()
            self.iconbtn = wx.FilePickerCtrl(self, -1, path)
            self.Bind(wx.EVT_FILEPICKER_CHANGED,
                      self.OnIconSelected,
                      id=self.iconbtn.GetId())
            icon_box.Add(self.iconbtn, 0,
                         wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
        else:
            self.iconbtn = wx.BitmapButton(self, -1, bm)
            icon_box.Add(self.iconbtn, 0,
                         wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 5)
            #label = wx.StaticText(self, -1, self.utility.lang.get('obligiconformat'))
            #icon_box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            self.Bind(wx.EVT_BUTTON, self.OnIconButton, self.iconbtn)

        topbox.Add(icon_box, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT,
                   5)

        mainbox.Add(topbox, 0, wx.EXPAND)
        self.SetSizerAndFit(mainbox)
Beispiel #4
0
 def __init__(self, parent):
     self.parent = parent
     self.drag_item_list = None
     WizardPageSimple.__init__(self, parent)
     self.LabelText = wx.StaticText(self, -1, label="Drag and drop FDF options in a tree to create selected "
                                                    "directory hierarchy:")
     self.DirTree = DDTreeCtrl(self, -1, style=wx.TR_HAS_BUTTONS)
     self.ids = {'root': self.DirTree.AddRoot('Root directory')}
     self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.on_drag_begin, self.DirTree)
     self.Bind(wx.EVT_TREE_END_DRAG, self.on_drag_end, self.DirTree)
     self.__set_properties()
     self.__do_layout()
Beispiel #5
0
    def __init__(self,parent,type):
        WizardPageSimple.__init__(self,parent)
        self.utility = parent.utility

        # 0. mainbox
        mainbox = wx.BoxSizer(wx.VERTICAL)

        # 1. topbox
        topbox = wx.BoxSizer(wx.VERTICAL)

        # Ask public name
        name = self.utility.session.get_nickname()

        name_box = wx.BoxSizer(wx.HORIZONTAL)
        self.myname = wx.TextCtrl(self, -1, name)
        name_box.Add(wx.StaticText(self, -1, self.utility.lang.get('myname')), 0, wx.ALIGN_CENTER_VERTICAL)
        name_box.Add(self.myname, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, 5)
        topbox.Add(name_box, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, 5)

        # Ask public user icon / avatar
        icon_box = wx.BoxSizer(wx.HORIZONTAL)
        icon_box.Add(wx.StaticText(self, -1, self.utility.lang.get('myicon')), 0, wx.ALIGN_CENTER_VERTICAL)

        ## TODO: integrate this code with makefriends.py, especially checking code
        self.iconbtn = None
        self.iconmime, self.icondata = self.utility.session.get_mugshot()
        if self.icondata:
            bm = data2wxBitmap(self.iconmime, self.icondata)
        else:
            im = IconsManager.getInstance()
            bm = im.get_default('personsMode','DEFAULT_THUMB')

        if sys.platform == 'darwin':
            path = get_home_dir()
            self.iconbtn = wx.FilePickerCtrl(self, -1, path)
            self.Bind(wx.EVT_FILEPICKER_CHANGED,self.OnIconSelected,id=self.iconbtn.GetId())
            icon_box.Add(self.iconbtn, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, 5)
        else:
            self.iconbtn = wx.BitmapButton(self, -1, bm)
            icon_box.Add(self.iconbtn, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, 5)
            #label = wx.StaticText(self, -1, self.utility.lang.get('obligiconformat'))
            #icon_box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            self.Bind(wx.EVT_BUTTON, self.OnIconButton, self.iconbtn)
        
        topbox.Add(icon_box, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, 5)


        mainbox.Add(topbox, 0, wx.EXPAND)
        self.SetSizerAndFit(mainbox)
Beispiel #6
0
    def __init__(self, parent):
        WizardPageSimple.__init__(self, parent)

        # Attributes
        self.pubkey = None
        self.privkey = None

        self.parent = parent
        self._label = wx.StaticText(self, label=_('Give Passphrase'))
        self._entry_passphrase = wx.TextCtrl(self, style=wx.TE_PASSWORD)
        self._label_repeat = wx.StaticText(self, label=_('Repeat passphrase'))
        self._entry_repeat_passphrase = wx.TextCtrl(self, style=wx.TE_PASSWORD)

        self.Bind(EVT_WIZARD_PAGE_CHANGING, self.store_keys)
        self.Bind(EVT_WIZARD_PAGE_CHANGED, self.layout)
Beispiel #7
0
 def __init__(self, parent):
     self.parent = parent
     self.page_names = []
     self.pages = []
     WizardPageSimple.__init__(self, parent)
     self.LabelText = wx.StaticText(self, -1, label="Add values to selected FDF options:")
     self.Notebook = wx.Notebook(self, -1, style=wx.NB_TOP)
     self.AddBtn = wx.Button(self, -1, "Add")
     self.RemoveBtn = wx.Button(self, -1, "Remove")
     # binding events
     self.Bind(wx.EVT_BUTTON, self.on_AddBtn, self.AddBtn)
     self.Bind(wx.EVT_BUTTON, self.on_RemoveBtn, self.RemoveBtn)
     self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.on_Notebook, self.Notebook)
     self.__set_properties()
     self.__do_layout()
Beispiel #8
0
 def __init__(self, parent):
     self.parent = parent
     WizardPageSimple.__init__(self, parent)
     self.selected_options = []
     self.LabelText = wx.StaticText(self, -1, label="Select FDF options to include in batch run:")
     self.OptionsTree = wx.TreeCtrl(self, -1, style=wx.TR_HIDE_ROOT | wx.TR_HAS_BUTTONS)
     self.SelectBtn = wx.Button(self, -1, ">>")
     self.DeselectBtn = wx.Button(self, -1, "<<")
     self.OptionsList = wx.ListCtrl(self, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
     # initialize OptionsList
     self.OptionsList.InsertColumn(0, 'Options', width=180)
     # binding events
     self.Bind(wx.EVT_BUTTON, self.on_SelectBtn, self.SelectBtn)
     self.Bind(wx.EVT_BUTTON, self.on_DeselectBtn, self.DeselectBtn)
     self.__set_properties()
     self.__do_layout()
Beispiel #9
0
    def __init__(self, parent):
        """Constructor"""
        WizardPageSimple.__init__(self, parent)

        # Attributes
        self.parent = parent
        self._sizer = wx.BoxSizer(wx.VERTICAL)
        self._label = wx.TextCtrl(self)
        self._url = wx.TextCtrl(self)
        self._selected_dir = wx.TextCtrl(self, style=wx.TE_READONLY)
        self.btn_select_dir = wx.Button(self, label=_('Select'), size=(95, 30))

        # Layout
        self._DoLayout()

        self.Bind(wx.EVT_BUTTON, self.select_localbox_dir, self.btn_select_dir)
        self.Bind(EVT_WIZARD_BEFORE_PAGE_CHANGED, self.is_authenticated)
        self.Bind(EVT_WIZARD_PAGE_CHANGING, self.validate_new_sync_inputs)
Beispiel #10
0
    def __init__(self, parent):
        WizardPageSimple.__init__(self, parent)

        # Attributes
        self.parent = parent
        self.is_authenticated = False
        self._username = wx.TextCtrl(self)
        self._password = wx.TextCtrl(self, style=wx.TE_PASSWORD)

        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.main_sizer = main_sizer

        input_sizer = wx.BoxSizer(wx.VERTICAL)
        input_sizer.Add(wx.StaticText(self, label=_("Username:"******"Password:")),
                        0,
                        wx.ALL | wx.ALIGN_LEFT,
                        border=gui_utils.DEFAULT_BORDER)
        input_sizer.Add(self._password, 0, wx.ALL | wx.EXPAND)

        main_sizer.Add(input_sizer,
                       1,
                       wx.ALL | wx.EXPAND,
                       border=gui_utils.DEFAULT_BORDER)

        self.already_authenticated_sizer = wx.BoxSizer(wx.VERTICAL)
        self._label_already_authenticated = wx.StaticText(self, label='')
        self.already_authenticated_sizer.Add(self._label_already_authenticated,
                                             1,
                                             wx.ALL | wx.EXPAND,
                                             border=gui_utils.DEFAULT_BORDER)

        self.Bind(EVT_WIZARD_BEFORE_PAGE_CHANGED,
                  self.call_password_authentication)
        # self.Bind(EVT_WIZARD_BEFORE_PAGE_CHANGED, self.should_login)
        # self.Bind(EVT_WIZARD_PAGE_CHANGING, self.passphrase_page)

        self.layout_inputs()
Beispiel #11
0
    def __init__(self, parent, type):
        WizardPageSimple.__init__(self, parent)
        self.parent = parent
        self.utility = parent.utility

        mainbox = wx.BoxSizer(wx.VERTICAL)
        text = wx.StaticText(self, -1,
                             self.utility.lang.get('rwid_explanation'))
        text.Wrap(400)
        mainbox.Add(text, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)

        # Real-World Identifiers
        rwidbox = wx.BoxSizer(wx.VERTICAL)
        self.rwidlist = RWIDList(self)
        rwidbox.Add(self.rwidlist, 1, wx.EXPAND | wx.ALL, 5)

        rwidbtnbox = wx.BoxSizer(wx.HORIZONTAL)

        button = wx.Button(self,
                           -1,
                           self.utility.lang.get('addrwid'),
                           style=wx.BU_EXACTFIT)
        self.Bind(wx.EVT_BUTTON, self.OnAddRWID, button)
        rwidbtnbox.Add(button, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)

        button = wx.Button(self,
                           -1,
                           self.utility.lang.get('remrwid'),
                           style=wx.BU_EXACTFIT)
        self.Bind(wx.EVT_BUTTON, self.OnRemoveRWID, button)
        rwidbtnbox.Add(button, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        rwidbox.Add(rwidbtnbox, 0, wx.EXPAND)
        mainbox.Add(rwidbox, 0, wx.EXPAND)

        self.SetSizerAndFit(mainbox)

        self.rwidlist.loadList()
Beispiel #12
0
    def __init__(self, parent):
        WizardPageSimple.__init__(self, parent)

        # Attributes
        self.parent = parent
        self._label = wx.StaticText(self, label=_('Give Passphrase'))
        self._entry_passphrase = wx.TextCtrl(self, style=wx.TE_PASSWORD)

        # Layout
        main_sizer = wx.BoxSizer(wx.VERTICAL)

        input_sizer = wx.BoxSizer(wx.VERTICAL)
        input_sizer.Add(self._label, 0, flag=wx.EXPAND | wx.ALL)
        input_sizer.Add(self._entry_passphrase, 0, flag=wx.EXPAND | wx.ALL)

        main_sizer.Add(input_sizer,
                       1,
                       flag=wx.EXPAND | wx.ALL,
                       border=gui_utils.DEFAULT_BORDER)

        self.SetSizer(main_sizer)
        self.Layout()

        self.Bind(EVT_WIZARD_PAGE_CHANGING, self.store_keys)
Beispiel #13
0
    def __init__(self, parent):
        WizardPageSimple.__init__(self, parent)

        # Attributes
        self.parent = parent
        self.is_authenticated = False
        self._username = wx.TextCtrl(self)
        self._password = wx.TextCtrl(self, style=wx.TE_PASSWORD)

        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.main_sizer = main_sizer

        input_sizer = wx.BoxSizer(wx.VERTICAL)

        # Server logo
        selected_server = self.getSelectedServer()
        image = gui_utils.image_from_url(
            selected_server.picture if selected_server else None).Scale(
                100, 100).ConvertToBitmap()
        self.imageBitmap = wx.StaticBitmap(self,
                                           wx.ID_ANY,
                                           image,
                                           size=(100, 100))
        input_sizer.Add(self.imageBitmap, 0, wx.ALL | wx.CENTER)
        input_sizer.Add(wx.StaticText(self, label=_("Server")), 0,
                        wx.ALL | wx.CENTER)

        # Horizontal grid for servers dropdown and add server button
        hbox = wx.BoxSizer(wx.HORIZONTAL)

        ## Servers dropdown select
        servers = self.parent.ctrl.getServers()
        self.server_choices = wx.Choice(
            self, wx.ID_ANY, choices=[server.label for server in servers])
        self.server_choices.Bind(wx.EVT_CHOICE, self.OnChoice)
        self.server_choices.SetSelection(0)
        hbox.Add(self.server_choices, 0, wx.ALL)

        ## Add server button
        self.add_server_button = wx.Button(self,
                                           wx.ID_ANY,
                                           style=wx.BU_EXACTFIT,
                                           size=(35,
                                                 self.server_choices.Size[1]))
        self.add_server_button.SetBitmapLabel(
            wx.ArtProvider.GetBitmap(wx.ART_PLUS, wx.ART_MENU))
        self.add_server_button.Bind(wx.EVT_BUTTON, self.OnButton)
        hbox.Add(self.add_server_button, 0, wx.ALL)

        input_sizer.Add(hbox, 1, wx.ALL | wx.CENTER)

        input_sizer.Add(wx.StaticText(self, label=_("Username")), 0,
                        wx.ALL | wx.ALIGN_LEFT)
        input_sizer.Add(self._username, 0, wx.ALL | wx.EXPAND)
        input_sizer.Add(wx.StaticText(self, label=_("Password")), 0,
                        wx.ALL | wx.ALIGN_LEFT)
        input_sizer.Add(self._password, 0, wx.ALL | wx.EXPAND)

        main_sizer.Add(input_sizer,
                       1,
                       wx.ALL | wx.EXPAND,
                       border=gui_utils.DEFAULT_BORDER)
        self.SetSizer(self.main_sizer)

        self.already_authenticated_sizer = wx.BoxSizer(wx.VERTICAL)
        self._label_already_authenticated = wx.StaticText(self, label='')
        self.already_authenticated_sizer.Add(self._label_already_authenticated,
                                             1,
                                             wx.ALL | wx.EXPAND,
                                             border=gui_utils.DEFAULT_BORDER)

        if wx.__version__ < '3.0.3':
            self.Bind(EVT_WIZARD_PAGE_CHANGING,
                      self.call_password_authentication)

        else:
            self.Bind(EVT_WIZARD_BEFORE_PAGE_CHANGED,
                      self.call_password_authentication)
        # self.Bind(EVT_WIZARD_BEFORE_PAGE_CHANGED, self.should_login)
        # self.Bind(EVT_WIZARD_PAGE_CHANGING, self.passphrase_page)

        self.layout_inputs()
        if self.getSelectedServer():
            self.parent.selected_server = self.getSelectedServer()
            self.check_server_connection(self.getSelectedServer())
Beispiel #14
0
 def __init__(self, parent, title):
     WizardPageSimple.__init__(self, parent)
     self.sizer = self.makePageTitle(title)