From: Harishankar Date: Thu, 25 Oct 2018 16:27:08 +0000 (+0530) Subject: Added Address for communication X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=0d95ecc0aa9941f5130fd9f12249317bc541bcc0;p=resumebuilder.git Added Address for communication Added address for communication and some getters for field retrieval --- diff --git a/bindata.go b/bindata.go index b9ccd69..86ca043 100644 --- a/bindata.go +++ b/bindata.go @@ -68,7 +68,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _resourcesResumebuilderGlade = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x4b\x6f\xdb\x38\x10\xbe\xe7\x57\x70\x79\x5d\x38\x7e\x6d\xda\x04\xb0\x55\x20\x4d\xdd\x4b\xb7\x05\x36\x5d\xec\xd1\x18\x93\x63\x89\x6b\x86\xd4\x92\x94\x1f\xff\x7e\x41\x3b\x0f\x3f\x24\x59\x92\x63\xd9\x41\x73\x09\x62\x69\x66\x34\x9c\xef\xfb\x86\x0f\xa9\xf7\x69\xfe\x20\xc9\x14\x8d\x15\x5a\xf5\x69\xfb\xb2\x45\x09\x2a\xa6\xb9\x50\x61\x9f\xfe\xfd\x73\xd0\xb8\xa6\x9f\x82\x8b\xde\x6f\x8d\x06\xf9\x8a\x0a\x0d\x38\xe4\x64\x26\x5c\x44\x42\x09\x1c\x49\xf7\xb2\xd3\xb9\x6c\x93\x46\x23\xb8\xe8\x09\xe5\xd0\x8c\x81\x61\x70\x41\x48\xcf\xe0\x7f\x89\x30\x68\x89\x14\xa3\x3e\x0d\xdd\xe4\x77\xfa\xf2\xa0\xee\x65\xa7\x45\x9b\x4b\x3b\x3d\xfa\x17\x99\x23\x4c\x82\xb5\x7d\xfa\xd5\x4d\xfe\x11\x8a\xeb\x19\x25\x82\xf7\xe9\x9f\x20\xd4\xe3\x6f\x6f\x4c\x48\x2f\x36\x3a\x46\xe3\x16\x44\xc1\x03\xf6\xa9\xff\x4b\x83\x17\xb3\x5e\xf3\xc9\x20\xdd\x9e\x81\x1a\x8e\x35\x4b\x2c\x0d\x06\x20\x2d\xee\xb3\x9f\x2d\xa3\x0e\x63\x6d\x85\x13\x5a\xd1\x80\xa1\x1f\x65\x43\xab\x46\x0c\x06\x95\xdb\x09\xc0\x22\x21\xf9\xea\x7f\x1f\x4e\x02\xc3\x48\x4b\x8e\xa6\xf9\x68\xd0\x5c\xb3\xd8\xb2\xde\xa9\xc5\x77\xed\x70\xa4\xf5\x84\x3e\x99\xec\x66\x38\x15\x56\x8c\x24\xd2\xe0\xa7\x49\x76\x86\xb3\xa7\x04\x99\x2e\x1b\x69\xa5\xa7\x36\x10\x73\xe4\x74\xdd\xa6\x42\x6e\x55\x20\xca\x4e\x32\x3d\xd1\x2f\xca\x99\xc5\x8a\x4e\x03\x61\xac\xfb\xbe\xa4\xcc\x96\x5b\x1a\xf2\xdc\x45\x43\xcf\x62\xb4\x8e\x06\x9d\xce\x55\x56\x22\x95\x47\x5e\x11\x9d\x2c\x57\xa1\xe2\xc4\x0d\xe3\xc4\xc4\xda\x22\x0d\xfc\xc5\x6c\xf7\x5e\x73\x55\xa8\x9d\xeb\x31\xb0\x89\x50\xe1\xfe\xc7\xcd\x7d\x51\xda\x65\x12\x5c\xd0\xa0\x9d\xe3\xd0\x6b\xa6\x3e\x7b\x43\x30\xcf\x17\x0b\x82\xff\x0d\x46\x28\x0b\xa0\xfd\x1a\x78\xe5\xb2\x35\xcd\x57\x2e\x93\x23\xce\x80\xb2\x12\x1c\x8c\xa4\x2f\x12\xfa\x50\x9e\xa8\xa4\x06\x04\xbb\x1f\xcb\x02\x78\xfd\x0e\x60\x01\x00\xbf\xc1\x99\xe2\x77\x95\xe3\x70\x0c\xfc\xd6\xba\xaf\xaf\xc9\x7b\xf3\x25\xa7\x6b\xbe\x57\xad\xf3\xd4\xee\x36\xda\x7f\x94\x19\x57\x84\x22\x8c\xdc\x9a\x77\xce\x20\xcf\xbe\x6d\xdc\xe3\xfc\xdc\x1a\x46\xe7\x3a\x07\x8e\x63\xb0\xe6\x2f\xe0\x42\xdf\x26\xce\x69\xf5\xb4\x09\x90\x45\x7a\x46\x76\x55\x7d\x80\x32\xa3\xde\xe2\xe3\xd5\xcd\x41\x7c\x2c\xc5\xe6\x53\xb4\x2e\x83\x0c\xc5\x14\xed\x90\xe3\x18\x12\xe9\x2a\x30\x1a\x98\x13\xd3\x0a\x59\x73\x03\xb3\xa1\x50\x5c\x30\x70\xda\x14\xf0\xb7\x22\x54\x20\x1f\xbd\x9d\x0e\x43\x89\x9c\x92\x08\x14\x97\x68\xfa\xf4\x1e\xe7\x1e\xec\x7b\x94\xc8\x9c\xbf\x63\x67\x10\xc7\xc8\xfb\x54\x69\xda\x3c\x52\x1b\xce\x59\x11\x65\x28\xaa\x73\x62\x45\x0d\xf0\xe1\x50\x4d\xad\x42\x1c\xa0\xaa\x8f\xa5\xa6\xf4\x77\x55\x1d\x53\x55\x5b\xfe\xa1\xd1\x49\x5c\xa0\x6d\xee\x17\xe3\x8a\x25\x75\xca\xb1\xdb\x2a\xc5\xab\x53\xcb\xf1\x10\x09\xfe\x70\x11\x9a\x03\x14\xf8\xe1\x30\x05\x7e\x78\x57\x60\xa6\xdf\xf9\x28\x70\x49\x92\x5a\x05\x78\x93\x23\xa7\xf3\x10\xe0\x1b\x3d\x53\xb8\x03\x87\x44\x8f\xc9\xad\x30\x2e\x3a\xb7\x6d\xc2\x4d\xcd\xe7\x0a\xeb\xcb\x99\x7b\x98\xe2\x2b\xf4\x53\x1f\xe6\x80\x76\xda\xee\x96\xda\x79\x6e\xf7\xd3\xee\x1b\x5c\xd1\x94\x5b\xae\x33\x29\xd8\x64\xb3\x3f\x3d\x03\xf7\xf9\xe9\x5e\x0d\x0d\xaa\x53\x96\xdb\xb9\x1e\xc7\x20\xf7\x67\x90\xa8\x38\x98\x15\xbd\xbd\xee\x7f\x8c\x97\xaa\xaf\x70\x98\x92\x77\x60\xbb\x9f\x95\xed\xeb\xda\x8f\x53\xca\xba\x2e\x10\x0c\x0d\x3a\xad\x72\x03\x7d\xd0\xca\x97\xb3\xd4\xd6\x9e\xc3\x62\xef\xce\x63\x83\xf1\x1c\x16\x0d\xfb\x3c\xf7\x3e\xd3\xfe\x4e\xdf\xd6\xbb\x43\x2d\xd5\x5a\x7c\x33\x7f\x95\x23\x9f\xb4\xe4\xd3\x13\xdf\x4e\xc1\xc1\x68\x38\x16\x52\xe6\x4e\x9f\x29\x89\xec\x24\xb1\x12\x1c\x71\x8b\x78\x15\x75\x43\x3f\xc5\x16\x06\xf5\xbe\xd3\x2c\x3c\x59\xdd\x82\x15\x8c\xdc\xa1\x03\x21\x6d\x56\x81\xce\xa4\xfe\xf9\x45\x3f\xf1\x8b\xe4\xea\x55\x7a\xf9\x28\x20\xe3\x20\xfe\xd7\x66\xe8\x17\x9e\x30\xf0\xf5\xa9\xbd\xee\xf5\x12\x7a\xf7\x13\x8f\x0a\x40\x17\x0a\xb2\x59\xb2\xb5\x9b\x2f\x37\x7a\xcd\xb5\xaf\x70\xfe\x0f\x00\x00\xff\xff\xd9\xef\xb0\x57\xde\x23\x00\x00") +var _resourcesResumebuilderGlade = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x49\x6f\xe3\x36\x14\xbe\xe7\x57\xb0\xbc\x16\x8e\xb7\xc9\x4c\x02\xd8\x1a\x34\x93\xf1\x5c\xa6\x33\x40\x9d\xb6\x47\x81\x26\x9f\x25\xd6\x34\xa9\x92\x94\x97\x7f\x5f\xd0\x4b\xe2\x45\x92\x25\xd9\x96\x1d\x34\x97\x20\x96\xf8\xa8\xc7\x6f\x79\x5c\xc0\xce\xe7\xd9\x58\xa0\x09\x68\xc3\x95\xec\xe2\xe6\x6d\x03\x23\x90\x54\x31\x2e\x83\x2e\xfe\xf3\xb9\x57\xbb\xc7\x9f\xbd\x9b\xce\x2f\xb5\x1a\xfa\x06\x12\x34\xb1\xc0\xd0\x94\xdb\x10\x05\x82\x30\x40\xed\xdb\x56\xeb\xb6\x89\x6a\x35\xef\xa6\xc3\xa5\x05\x3d\x24\x14\xbc\x1b\x84\x3a\x1a\xfe\x8d\xb9\x06\x83\x04\x1f\x74\x71\x60\x47\xbf\xe2\xd7\x0f\xb5\x6f\x5b\x0d\x5c\x5f\xb4\x53\x83\x7f\x80\x5a\x44\x05\x31\xa6\x8b\xbf\xd9\xd1\xdf\x5c\x32\x35\xc5\x88\xb3\x2e\xfe\x9d\x70\xb9\xfa\xed\x1a\x23\xd4\x89\xb4\x8a\x40\xdb\x39\x92\x64\x0c\x5d\xec\xfe\x62\xef\xb5\x59\xa7\xbe\x6e\x90\xdc\x9e\x12\xe9\x0f\x15\x8d\x0d\xf6\x7a\x44\x18\x38\xd4\x7e\xba\xe8\xd5\x8f\x94\xe1\x96\x2b\x89\x3d\x0a\x6e\x94\x35\x25\x6b\x11\xd1\x20\xed\x5e\x07\x34\xe4\x82\x2d\xff\x77\xdd\x09\x42\x21\x54\x82\x81\xae\xaf\x1a\xd4\x37\x5a\xec\xb4\xde\xc3\xe2\x87\xb2\x30\x50\x6a\x84\xd7\x4d\xf6\x33\x9c\x70\xc3\x07\x02\xb0\xf7\xac\xe3\xbd\xe1\x1c\x80\x20\x35\x64\x2b\xad\xe4\xd4\x7a\x7c\x06\x0c\x6f\xb6\x29\x91\x5b\x19\x8a\xd2\x93\x4c\x4e\xf4\xab\xb4\x7a\xbe\x94\x53\x8f\x6b\x63\x7f\x2c\x24\xb3\x13\x96\xc4\x3c\xb3\xa1\xef\x54\x0c\xc6\x62\xaf\xd5\xba\x4b\x4b\xa4\xf4\xc8\x4b\xb2\x93\x16\xca\x65\x14\x5b\x3f\x8a\x75\xa4\x0c\x60\xcf\x3d\x4c\x0f\xef\xd4\x97\x40\xed\x3d\x8f\x08\x1d\x71\x19\x1c\xfe\xdc\xcc\x81\xd2\x2c\x92\xe0\x1c\x7b\xcd\x8c\x80\x4e\x3d\xf1\xdb\x5b\x86\x79\x79\x98\x93\xfc\xef\x64\x00\x22\x07\xdb\xa7\xe0\x2b\x53\xad\x49\xb1\x62\x91\x1c\xb2\x9a\x48\x23\x88\x25\x03\xe1\x40\x02\xd7\x95\x13\x2a\xaa\x80\xc1\xf6\xa7\xa2\x04\xde\xbf\x13\x98\x83\xc0\xef\xe4\x4a\xf9\xbb\xcb\x08\x38\x07\x7f\x1b\xd5\xd7\x61\xf2\x5e\x7c\xd1\xe5\x8a\xef\x5d\xe3\x3a\xbd\xbb\xcb\xf6\x87\x22\xe3\x0a\x81\x07\xa1\xdd\x88\xce\x18\xe4\xd5\x97\x8d\x3e\xcc\xae\xad\x60\xb4\xee\x33\xe8\x38\x87\x6a\xfe\x20\x8c\xab\xc7\xd8\x5a\x25\xd7\x9b\x00\x91\xa7\x66\xa4\xa3\xea\x3a\x28\x32\xea\x1d\x3d\xde\x3d\x1c\xa5\xc7\x42\x6a\xbe\x44\xe9\xd2\x40\x81\x4f\xc0\xf8\x0c\x86\x24\x16\xb6\x84\xa2\x09\xb5\x7c\x52\x22\x6b\xa6\xc9\xd4\xe7\x92\x71\x4a\xac\xd2\x39\xe2\x0d\x0f\x24\x11\xab\x68\xab\x82\x40\x00\xc3\x28\x24\x92\x09\xd0\x5d\xdc\x87\x99\x23\xbb\x0f\x02\xa8\x75\x6f\xcc\x94\x44\x11\xb0\x2e\x96\x0a\xd7\xcf\x54\x86\x33\x56\x44\x29\x8e\x6a\x5d\xd8\x51\x3d\x18\x1f\xeb\xa9\x65\x17\x47\xb8\xea\x53\xa1\x29\xfd\xdd\x55\xe7\x74\xd5\x4e\x7c\xa0\x55\x1c\xe5\x28\x9b\x87\xcd\xb8\x54\x49\x95\x76\x6c\x37\x0a\xe9\xea\xd2\x76\x3c\xc6\x82\x3f\x6d\x08\xfa\x08\x07\x7e\x3c\xce\x81\x1f\xdf\x1d\x98\x1a\x77\x3d\x0e\x5c\x88\xa4\x52\x03\x3e\x64\xd8\xe9\x3a\x0c\xf8\x46\xcf\x14\x9e\x88\x05\xa4\x86\xe8\x91\x6b\x1b\x5e\xdb\x36\xe1\xa1\xe2\x73\x85\xcd\xe5\x4c\x9f\x4c\xe0\x04\xf5\xd4\x75\x73\x44\x39\x6d\xb6\x0b\xed\x3c\x77\xeb\x69\xfb\x0d\xae\x68\x8a\x2d\xd7\xa9\xe0\x74\xb4\x5d\x9f\x5e\x88\xfb\xb2\x7e\x57\x41\x81\x2a\x36\x73\xcd\xb1\xf7\x21\x6b\xb5\x79\x0e\x71\x7f\x21\x02\x24\x23\x7a\x29\x6f\xe7\xfb\x9f\xc3\x85\xeb\x4b\x1c\xa6\x64\x1d\xd8\x1e\x56\x65\xf3\xbe\xf2\xe3\x94\xa2\xa1\x73\x20\x1a\x7b\xad\x46\xb1\x81\x8e\x95\x74\x70\x16\xda\xda\x33\x32\x3f\xb8\xf3\xd8\x52\x3c\x23\xf3\x9a\x79\x99\x7b\x5f\x64\xff\xa4\x1e\xab\xdd\xa1\x16\x2a\x2d\xae\x98\x57\xac\xf7\x37\x3a\x21\xff\xc6\x98\x06\x63\xd0\x50\x69\x44\xd5\x78\x1c\x4b\xb7\xde\xe3\x4a\x5e\xdb\xe4\x9c\x59\xf2\xce\x41\x68\x4f\x97\x3c\xe7\x3f\x6a\x0a\xad\xbe\x56\x95\x13\x93\x3f\x23\x82\x07\x12\x7b\x85\xf2\x35\x21\x61\x6a\xea\xdb\x79\x04\xd8\x93\x4a\x66\x7f\x37\x91\xa8\x64\xb2\xfa\x54\x2b\x21\x80\x6d\x5d\xb4\x38\x19\x7a\x07\x10\x2c\x13\xbe\x85\x04\xcf\x70\xdb\x21\x2c\x92\xf1\x78\x86\x99\xfd\x8b\xc3\xea\x0a\xca\xca\xe4\x29\xb0\x1c\x0d\xcd\x09\xe0\x49\xea\x82\x50\x0a\x91\x35\xbe\x25\x83\x1c\x2a\x5d\xf5\x91\x52\x9b\xd6\x6f\xd3\x25\x95\x1a\x98\x1a\xb4\xe4\x04\x39\x0a\xd7\xa6\xe0\x16\xc6\x89\x28\x27\x5c\xa2\xc9\xf1\x8d\x0b\x4d\x9d\xed\xf6\x49\x6e\x38\x24\x65\x9f\x9c\xf9\x6e\x0e\x96\x0c\xfc\x21\x17\x22\x93\xf6\x84\x44\xf6\x92\xd8\xa2\x68\xa1\xa3\xcd\x0e\x72\xcd\xe1\xd5\xde\x07\xca\x3d\x6f\x3f\x12\xc3\x29\x7a\x02\x4b\xb8\x30\x69\x00\x5d\x09\xfe\xd9\xa0\x5f\xf8\x12\x56\x79\x94\x5e\x2f\xd4\xa5\xd8\xe5\xff\xad\xd0\xaf\x2c\xce\x5a\x49\x9e\x11\xf7\x6a\x05\x9d\x5c\xd9\x0b\x12\x9d\xab\x93\x6d\xc8\x36\x5e\xbe\xbe\xe8\xd4\x37\x6e\xb0\xfe\x17\x00\x00\xff\xff\x39\xe0\xa7\xcf\x1a\x2b\x00\x00") func resourcesResumebuilderGladeBytes() ([]byte, error) { return bindataRead( @@ -83,7 +83,7 @@ func resourcesResumebuilderGlade() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "resources/resumebuilder.glade", size: 9182, mode: os.FileMode(436), modTime: time.Unix(1540399023, 0)} + info := bindataFileInfo{name: "resources/resumebuilder.glade", size: 11034, mode: os.FileMode(436), modTime: time.Unix(1540483777, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/resources/resumebuilder.glade b/resources/resumebuilder.glade index 090844a..f9bc334 100644 --- a/resources/resumebuilder.glade +++ b/resources/resumebuilder.glade @@ -151,8 +151,8 @@ - 327 - 327 + 326 + 424 @@ -171,6 +171,48 @@ 94 + + + True + False + Address for communication + + + 37 + 326 + + + + + 220 + 80 + True + False + 0 + none + + + True + True + in + + + True + True + False + + + + + + + + + + 224 + 331 + + False diff --git a/resumebuilder.go b/resumebuilder.go index 5e86a78..e1b26dd 100644 --- a/resumebuilder.go +++ b/resumebuilder.go @@ -12,6 +12,7 @@ type Applicant struct { LastName string DateOfBirth Date Sex Sex + Address string Education []Education } @@ -53,34 +54,56 @@ const ( } } */ -func getBasicDetails() (*Applicant, error) { - // Retrieve all the fields. - obj, err := ui.GetObject("FirstName") +func getLineText(fieldname string) (string, error) { + obj, err := ui.GetObject(fieldname) if err != nil { - return nil, err + return "", err } - fsname, ok := obj.(*gtk.Entry) + field, ok := obj.(*gtk.Entry) if !ok { - return nil, err + return "", err } - firstname, err := fsname.GetText() + fieldstr, err := field.GetText() if err != nil { - return nil, err + return "", err } - obj, err = ui.GetObject("LastName") + return fieldstr, nil +} + +func getMultilineText(fieldname string) (string, error) { + obj, err := ui.GetObject(fieldname) if err != nil { - return nil, err + return "", err } - lsname, ok := obj.(*gtk.Entry) + fieldctl, ok := obj.(*gtk.TextView) if !ok { + return "", err + } + textbuf, err := fieldctl.GetBuffer() + if err != nil { + return "", err + } + start, end := textbuf.GetBounds() + textstr, err := textbuf.GetText(start, end, true) + if err != nil { + return "", err + } + return textstr, nil +} + +func getBasicDetails() (*Applicant, error) { + // Retrieve all the fields. + + firstname, err := getLineText("FirstName") + if err != nil { return nil, err } - lastname, err := lsname.GetText() + lastname, err := getLineText("LastName") if err != nil { return nil, err } - obj, err = ui.GetObject("Male") + address, err := getMultilineText("Address") if err != nil { return nil, err } @@ -92,6 +115,7 @@ func getBasicDetails() (*Applicant, error) { applicant.LastName = lastname applicant.DateOfBirth = selecteddate applicant.Sex = selectedsex + applicant.Address = address return applicant, nil } @@ -109,19 +133,6 @@ func getWindow() (*gtk.Window, error) { return wnd, nil } -func getSaveButton() (*gtk.Button, error) { - btnobj, err := ui.GetObject("SaveButton") - if err != nil { - fmt.Println(err.Error()) - return nil, err - } - btn, ok := btnobj.(*gtk.Button) - if !ok { - return nil, err - } - return btn, nil -} - func LoadMain() { gtk.Init(nil) var err error