/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
User interface services - QT Emb System
Copyright (C) Jay Sorg 2004-2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*///#define SHARP
#ifdef SHARP#include<qpe/qpeapplication.h>#else#include<qapplication.h>#endif#include<qcursor.h>#include<qmainwindow.h>#include<qwidget.h>#include<qpainter.h>#include<qimage.h>#include<qsocketnotifier.h>#include<qscrollview.h>#include<qmessagebox.h>#include<qpushbutton.h>#include<qlineedit.h>#include<qcombobox.h>#include<qlabel.h>#include<qfile.h>#include<qcheckbox.h>#include<qpopupmenu.h>#include<stdlib.h>#include<stdarg.h>// va_list va_start va_end
#include<unistd.h>// gethostname
#include<pwd.h>// getpwuid
#include"../rdesktop.h"#include"qtewin.h"#define QT_OPTI/* types */structQColorMap{uint32RGBColors[256];uint32NumColors;};structbitmap{intw;inth;uint8*data;};externintg_tcp_port_rdp;externintg_dsp_fd;#ifdef WITH_RDPSNDBOOLg_rdpsnd=True;externintg_dsp_busy;#endifintg_encryption=1;intg_bitmap_cache=1;intg_bitmap_cache_persist_enable=0;intg_bitmap_cache_precache=1;intg_use_rdp5=1;intg_desktop_save=1;intg_bitmap_compression=1;intg_rdp5_performanceflags=0;intg_console_session=0;intg_keylayout=0x409;/* Defaults to US keyboard layout */intg_width=640;intg_height=480;intg_server_bpp=8;charg_hostname[16]="";charg_username[100]="";staticintg_client_width=640;staticintg_client_height=480;staticuint32g_flags=RDP_LOGON_NORMAL;staticcharg_server[64]="";staticcharg_domain[16]="";staticcharg_password[16]="";staticcharg_shell[128]="";staticcharg_directory[32]="";staticintg_fullscreen=0;staticintg_global_sock=0;staticintg_deactivated=0;staticuint32g_ext_disc_reason=0;staticQSocketNotifier*g_SocketNotifier=0;staticQSocketNotifier*g_SoundNotifier=0;#ifdef SHARPstaticQPEApplication*g_App=0;#elsestaticQApplication*g_App=0;#endifstaticQMyMainWindow*g_MW=0;staticQMyScrollView*g_SV=0;staticstructQColorMap*g_CM=0;staticuint8*g_BS=0;/* the screen data */staticintg_clipx=0;staticintg_clipy=0;staticintg_clipcx=0;staticintg_clipcy=0;#define BPP ((g_server_bpp + 7) / 8)#define GETPIXEL8(d, x, y, w) (*(((uint8*)d) + ((y) * (w) + (x))))#define GETPIXEL16(d, x, y, w) (*(((uint16*)d) + ((y) * (w) + (x))))#define GETPIXEL32(d, x, y, w) (*(((uint32*)d) + ((y) * (w) + (x))))#define SETPIXEL8(d, x, y, w, v) *(((uint8*)d) + ((y) * (w) + (x))) = v#define SETPIXEL16(d, x, y, w, v) *(((uint16*)d) + ((y) * (w) + (x))) = v#define SETPIXEL32(d, x, y, w, v) *(((uint32*)d) + ((y) * (w) + (x))) = v/******************************************************************************/voidCleanString(QString*Item){inti;i=Item->length()-1;while(i>=0){if(Item->at(i)==10||Item->at(i)==13)Item->remove(i,1);i--;}}/******************************************************************************/QMyDialog::QMyDialog(QWidget*parent):QDialog(parent,"Settings",true){inti,j;char*home;charText[256];QStringLine;QStringItemName;QStringItemValue;// resize dialog
resize(230,270);// main list box
ListBox=newQListBox(this);ListBox-