mirror of https://github.com/cy384/ssheven.git
add cancel button to intro dialog
This commit is contained in:
parent
516e60887f
commit
bd24d05a91
|
@ -356,7 +356,7 @@ void ssh_setup_terminal(void)
|
||||||
SSH_CHECK(libssh2_channel_shell(ssh_con.channel));
|
SSH_CHECK(libssh2_channel_shell(ssh_con.channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
void intro_dialog(char* hostname, char* username, char* password)
|
int intro_dialog(char* hostname, char* username, char* password)
|
||||||
{
|
{
|
||||||
|
|
||||||
// modal dialog setup
|
// modal dialog setup
|
||||||
|
@ -394,7 +394,7 @@ void intro_dialog(char* hostname, char* username, char* password)
|
||||||
short item;
|
short item;
|
||||||
do {
|
do {
|
||||||
ModalDialog(NULL, &item);
|
ModalDialog(NULL, &item);
|
||||||
} while(item != 1);
|
} while(item != 1 && item != 9);
|
||||||
|
|
||||||
// copy the text out of the boxes
|
// copy the text out of the boxes
|
||||||
GetDialogItemText((Handle)address_text_box, hostname);
|
GetDialogItemText((Handle)address_text_box, hostname);
|
||||||
|
@ -404,6 +404,9 @@ void intro_dialog(char* hostname, char* username, char* password)
|
||||||
// clean it up
|
// clean it up
|
||||||
CloseDialog(dlg);
|
CloseDialog(dlg);
|
||||||
FlushEvents(everyEvent, -1);
|
FlushEvents(everyEvent, -1);
|
||||||
|
|
||||||
|
// if we hit cancel, 0
|
||||||
|
if (item == 9) return 0; else return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//enum { WAIT, READ, EXIT } read_thread_command = WAIT;
|
//enum { WAIT, READ, EXIT } read_thread_command = WAIT;
|
||||||
|
@ -461,7 +464,7 @@ int main(int argc, char** argv)
|
||||||
InitWindows();
|
InitWindows();
|
||||||
InitMenus();
|
InitMenus();
|
||||||
|
|
||||||
intro_dialog(hostname, username, password);
|
if (!intro_dialog(hostname, username, password)) return 0;
|
||||||
|
|
||||||
console_setup();
|
console_setup();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue