// File: eiskalteschatten[P]developersnotebook/src/views/ProjectsView.cpp
// Function: ProjectsView::fill_in_sidebar(ProjectsModel const*)
void ProjectsView::fill_in_sidebar(const ProjectsModel *row) {
    gtk_entry_set_text(GTK_ENTRY(project_name_input), row->get_name().c_str());
    gtk_entry_set_text(GTK_ENTRY(url_input), row->get_url().c_str());
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(is_complete_checkbox), row->get_is_complete());

    if (row->get_start_date() != "") {
        std::string date_str  = row->get_start_date();
        std::tm start_date_tm = get_date_from_string(&date_str);
        guint year            = start_date_tm.tm_year + 1900;

        gtk_calendar_select_month(GTK_CALENDAR(start_date_input), start_date_tm.tm_mon, year);
        gtk_calendar_select_day(GTK_CALENDAR(start_date_input), start_date_tm.tm_mday);
    }
    else {
        reset_calender(start_date_input);
    }

    if (row->get_end_date() != "") {
        std::string date_str = row->get_end_date();
        std::tm end_date_tm  = get_date_from_string(&date_str);
        guint year           = end_date_tm.tm_year + 1900;

        gtk_calendar_select_month(GTK_CALENDAR(end_date_input), end_date_tm.tm_mon, year);
        gtk_calendar_select_day(GTK_CALENDAR(end_date_input), end_date_tm.tm_mday);
    }
    else {
        reset_calender(end_date_input);
    }


    GtkTextIter start;
    GtkTextIter end;
    GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(notes_input));
    gtk_text_buffer_get_bounds(buffer, &start, &end);
    gtk_text_buffer_delete(buffer, &start, &end);

    if (row->get_notes() != "") {
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(notes_input));
        gtk_text_buffer_get_start_iter(buffer, &start);
        gtk_text_buffer_insert(buffer, &start, row->get_notes().c_str(), -1);
    }

    gtk_button_set_label(GTK_BUTTON(save_button), "Save Project");
    gtk_widget_set_sensitive(delete_button, TRUE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x270(%rbp)
movq 0x60(%rax), %rax
movq %rax, -0x268(%rbp)
callq 0xa630
movq -0x268(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x258(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x19190
movq -0x260(%rbp), %rdi
callq 0xa1d0
movq -0x258(%rbp), %rdi
movq %rax, %rsi
callq 0xae80
jmp 0x166c5
leaq -0x30(%rbp), %rdi
callq 0xb430
movq -0x270(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x288(%rbp)
callq 0xa630
movq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x278(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x19240
movq -0x280(%rbp), %rdi
callq 0xa1d0
movq -0x278(%rbp), %rdi
movq %rax, %rsi
callq 0xae80
jmp 0x1672f
leaq -0x60(%rbp), %rdi
callq 0xb430
movq -0x270(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x2a8(%rbp)
callq 0xb210
movq -0x2a8(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x2a0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x192c0
movq -0x2a0(%rbp), %rdi
movzbl %al, %esi
callq 0xb400
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x191c0
movq -0x298(%rbp), %rdi
leaq 0x3d483(%rip), %rsi     # 0x53c25
callq 0x19480
movb %al, -0x289(%rbp)
jmp 0x167af
leaq -0x80(%rbp), %rdi
callq 0xb430
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x167c7
jmp 0x1690a
movq -0x10(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x191c0
movq -0x2b0(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x1b040
jmp 0x167f3
movq -0x270(%rbp), %rax
movl -0xc4(%rbp), %ecx
addl $0x76c, %ecx            # imm = 0x76C
movl %ecx, -0xdc(%rbp)
movq 0x68(%rax), %rax
movq %rax, -0x2c0(%rbp)
callq 0xa700
movq -0x2c0(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x2b8(%rbp)
jmp 0x16834
movq -0x2b8(%rbp), %rdi
movl -0xc8(%rbp), %esi
movl -0xdc(%rbp), %edx
callq 0xb370
jmp 0x1684e
movq -0x270(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x2d0(%rbp)
callq 0xa700
movq -0x2d0(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x2c8(%rbp)
jmp 0x1687d
movq -0x2c8(%rbp), %rdi
movl -0xcc(%rbp), %esi
callq 0xaf50
jmp 0x16891
leaq -0xa0(%rbp), %rdi
callq 0xb430
jmp 0x1691a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq -0x270(%rbp), %rdi
movq 0x68(%rdi), %rsi
callq 0x1b400
movq -0x10(%rbp), %rsi
leaq -0x100(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x19200
movq -0x2e0(%rbp), %rdi
leaq 0x3d2e6(%rip), %rsi     # 0x53c25
callq 0x19480
movb %al, -0x2d1(%rbp)
jmp 0x1694c
leaq -0x100(%rbp), %rdi
callq 0xb430
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x16967
jmp 0x16a79
movq -0x10(%rbp), %rsi
leaq -0x120(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x19200
movq -0x2e8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x1b040
jmp 0x16993
movq -0x270(%rbp), %rax
movl -0x144(%rbp), %ecx
addl $0x76c, %ecx            # imm = 0x76C
movl %ecx, -0x15c(%rbp)
movq 0x78(%rax), %rax
movq %rax, -0x2f8(%rbp)
callq 0xa700
movq -0x2f8(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x2f0(%rbp)
jmp 0x169d4
movq -0x2f0(%rbp), %rdi
movl -0x148(%rbp), %esi
movl -0x15c(%rbp), %edx
callq 0xb370
jmp 0x169ee
movq -0x270(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x308(%rbp)
callq 0xa700
movq -0x308(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x300(%rbp)
jmp 0x16a1d
movq -0x300(%rbp), %rdi
movl -0x14c(%rbp), %esi
callq 0xaf50
jmp 0x16a31
leaq -0x120(%rbp), %rdi
callq 0xb430
jmp 0x16a89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq -0x270(%rbp), %rdi
movq 0x78(%rdi), %rsi
callq 0x1b400
movq -0x270(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x330(%rbp)
callq 0xaaf0
movq -0x330(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
callq 0xa450
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
movq %rsi, -0x328(%rbp)
leaq -0x200(%rbp), %rdx
movq %rdx, -0x320(%rbp)
callq 0xa0d0
movq -0x328(%rbp), %rsi
movq -0x320(%rbp), %rdx
movq -0x208(%rbp), %rdi
callq 0xaeb0
movq -0x10(%rbp), %rsi
leaq -0x228(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x19280
movq -0x318(%rbp), %rdi
leaq 0x3d0fd(%rip), %rsi     # 0x53c25
callq 0x19480
movb %al, -0x309(%rbp)
jmp 0x16b35
leaq -0x228(%rbp), %rdi
callq 0xb430
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0x16b50
jmp 0x16c32
movq -0x270(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x350(%rbp)
callq 0xaaf0
movq -0x350(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
callq 0xa450
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
movq %rsi, -0x338(%rbp)
callq 0xa0f0
movq -0x230(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x250(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x19280
movq -0x348(%rbp), %rdi
callq 0xa1d0
movq -0x340(%rbp), %rdi
movq -0x338(%rbp), %rsi
movq %rax, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xadb0
jmp 0x16bf0
leaq -0x250(%rbp), %rdi
callq 0xb430
jmp 0x16c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0xb430
jmp 0x16c8b
movq -0x270(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x358(%rbp)
callq 0xa8d0
movq -0x358(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
leaq 0x3c8ef(%rip), %rsi     # 0x53554
callq 0xa910
movq -0x270(%rbp), %rax
movq 0xa8(%rax), %rdi
movl $0x1, %esi
callq 0xb300
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xaa00
nopw %cs:(%rax,%rax)