Index: qtnx-0.9/keyboards =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ qtnx-0.9/keyboards 2008-10-14 10:43:03.000000000 +0200 @@ -0,0 +1,86 @@ +al,0x041C,Albanian +ar,0x0001,Arabic +am,,Armenian +az,,Azerbaijani +bg,0x0402,Bulgarian +by,0x0423,Belarusian +be,,Belgian +ben,,Bengali +bs,,Bosnian +mm,,Burmese +hr,0x041A,Croatian +hr_US,,Croatian (US) +cz,0x0405,Czech +cz_qwerty,,Czech (QWERTY) +dk,0x0406,Danish +nl,0x0413,Dutch (Netherlands) +dvorak,,Dvorak +us,0x0009,English +en_US,0x0409,English (United States) +gb,0x0809,English (United Kingdom) +ca,0x1009,English (Canada) +ee,0x0425,Estonian +fi,0x040B,Finnish +fr,0x040C,French (France) +fr_latin9,,French (Alternative) +ca_enhanced,0x0C0C,French (Canada) +ge_la,,Georgian (latin) +ge_ru,,Georgian (russian) +de,0x0407,German (Germany) +el,0x0408,Greek +guj,,Gujarati +gur,,Gurmukhi +dev,0x0439,Hindi +hu,0x040E,Hungarian +hu_US,,Hungarian (US) +hu_qwerty,,Hungarian (qwerty) +is,0x040F,Icelandic +iu,,Inuktitut +ir,,Iranian +ie,,Irish +il,,Israeli +il_phonetic,,Israeli (phonetic) +it,0x0410,Italian (Italy) +jp,0x0411,Japanese +kan,,Kannada +ko,0x0412,Korean +la,,Latin America +lv,0x0426,Latvian +lt,0x0427,Lithuanian +lt_std,,Lithuanian azerty standard +mk,0x042F,FYRO Macedonian +ml,0x043E,Malay (Malaysia) +mt_US,,Maltese (US layout) +ogham,,Ogham +oriya,,Oriya +no,0x0814,Norwegian +pl,0x0415,Polish +pl2,,Polish (qwertz) +br,0x0416,Portuguese (Brazil) +pt,0x0816,Portuguese (Portugal) +ro,0x0418,Romanian +ru,0x0419,Russian +ru_yawerty,,Russian (cyrillic phonetic) +se_FI,,Northern Saami (Finland) +se_NO,,Northern Saami (Norway) +se_SE,,Northern Saami (Sweden) +sr,0x081A,Serbian +sk,0x041B,Slovak +si,0x0424,Slovenian +es,0x040A,Spanish (Traditional Sort) +se,0x041D,Swedish +fr_CH,0x100c,Swiss French +de_CH,0x0807,Swiss German +syr,,Syriac +tj,,Tajik +tml,,Tamil +tel,,Telugu +th,0x041E,Thai +th_tis,0x041E,Thai (TIS-820.2538) +th_pat,,Thai (Pattachote) +tr,0x041F,Turkish +ua,0x0422,Ukrainian +vn,0x042A,Vietnamese +yu,,Yugoslavian +fo,0x0438,Faroese +nl-be,0x0813,Dutch (Belgian) Index: qtnx-0.9/qtnxsettings.cpp =================================================================== --- qtnx-0.9.orig/qtnxsettings.cpp 2008-10-14 10:43:02.000000000 +0200 +++ qtnx-0.9/qtnxsettings.cpp 2008-10-14 14:02:04.000000000 +0200 @@ -45,6 +45,8 @@ connect(ui_sd.imageCompressionType, SIGNAL(currentIndexChanged(QString)), this, SLOT(compressionChanged(QString))); connect(ui_sd.keyboard, SIGNAL(currentIndexChanged(QString)), this, SLOT(keyboardChanged(QString))); connect(ui_sd.defaultKey, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int))); + connect(ui_sd.useProxy, SIGNAL(stateChanged(int)), this, SLOT(proxyChanged(int))); + connect(ui_sd.proxyAuthenticated, SIGNAL(stateChanged(int)), this, SLOT(proxyAuthChanged(int))); connect(ui_sd.applyButton, SIGNAL(pressed()), this, SLOT(applyPressed())); connect(ui_sd.okButton, SIGNAL(pressed()), this, SLOT(okPressed())); connect(ui_sd.cancelButton, SIGNAL(pressed()), this, SLOT(cancelPressed())); @@ -58,6 +60,14 @@ void QtNXSettings::parseFile() { if (!fileName.isEmpty()) { + + config.useProxy = false; + config.proxyHost = ""; + config.proxyPort = 8080; + config.proxyAuthenticated = false; + config.proxyPass = ""; + config.proxyUser = ""; + NXParseXML handler; handler.setData(&config); @@ -145,6 +155,24 @@ } } + if (config.useProxy == true) { + ui_sd.useProxy->setChecked(true); + ui_sd.proxyHost->setEnabled(true); + ui_sd.proxyPort->setEnabled(true); + ui_sd.proxyAuthenticated->setEnabled(true); + } + + if (config.proxyAuthenticated == true) { + ui_sd.proxyAuthenticated->setChecked(true); + ui_sd.proxyUser->setEnabled(true); + ui_sd.proxyPass->setEnabled(true); + } + + ui_sd.proxyHost->setText(QString::fromStdString(config.proxyHost)); + ui_sd.proxyPort->setValue(config.proxyPort); + ui_sd.proxyUser->setText(QString::fromStdString(config.proxyUser)); + ui_sd.proxyPass->setText(QString::fromStdString(config.proxyPass)); + ui_sd.encryption->setChecked(config.encryption); ui_sd.memoryCache->setValue(config.cache); ui_sd.diskCache->setValue(config.images); @@ -199,6 +227,30 @@ ui_sd.setAuthKeyButton->setEnabled(true); } +void QtNXSettings::proxyChanged(int state) +{ + if (state == Qt::Checked) { + ui_sd.proxyHost->setEnabled(true); + ui_sd.proxyPort->setEnabled(true); + ui_sd.proxyAuthenticated->setEnabled(true); + } else { + ui_sd.proxyHost->setEnabled(false); + ui_sd.proxyPort->setEnabled(false); + ui_sd.proxyAuthenticated->setEnabled(false); + } +} + +void QtNXSettings::proxyAuthChanged(int state) +{ + if (state == Qt::Checked) { + ui_sd.proxyUser->setEnabled(true); + ui_sd.proxyPass->setEnabled(true); + } else { + ui_sd.proxyUser->setEnabled(false); + ui_sd.proxyPass->setEnabled(false); + } +} + void QtNXSettings::cancelPressed() { close(); @@ -315,6 +367,25 @@ else config.render = false; + if (ui_sd.useProxy->checkState() == Qt::Checked) { + config.useProxy = true; + + if (ui_sd.proxyAuthenticated->checkState() == Qt::Checked) + { + config.proxyAuthenticated = true; + } else + { + config.proxyAuthenticated = false; + } + config.proxyHost = ui_sd.proxyHost->text().toStdString(); + config.proxyPort = ui_sd.proxyPort->value(); + config.proxyUser = ui_sd.proxyUser->text().toStdString(); + config.proxyPass = ui_sd.proxyPass->text().toStdString(); + } else + { + config.useProxy = false; + } + NXWriteXML writeData; writeData.setSessionData(config); writeData.write(QDir::homePath() + "/.qtnx/" + ui_sd.sessionName->text() + ".nxml"); Index: qtnx-0.9/qtnxsettings.h =================================================================== --- qtnx-0.9.orig/qtnxsettings.h 2008-10-14 10:43:02.000000000 +0200 +++ qtnx-0.9/qtnxsettings.h 2008-10-14 10:43:03.000000000 +0200 @@ -34,13 +34,15 @@ QtNXSettings(QString); ~QtNXSettings(); void parseFile(); - public slots: - void resolutionChanged(QString); + public slots: + void resolutionChanged(QString); void compressionChanged(QString); void platformChanged(QString); void keyboardChanged(QString); void typeChanged(QString); void keyChanged(int); + void proxyAuthChanged(int); + void proxyChanged(int); void applyPressed(); void cancelPressed(); void okPressed(); @@ -48,7 +50,7 @@ void authKeyPressed(); void keyDialogAccept(); void keyDialogReject(); -signals: + signals: void closing(QString); private: Ui::SettingsDialog ui_sd; Index: qtnx-0.9/qtnxwindow.cpp =================================================================== --- qtnx-0.9.orig/qtnxwindow.cpp 2008-10-14 10:43:02.000000000 +0200 +++ qtnx-0.9/qtnxwindow.cpp 2008-10-14 14:02:04.000000000 +0200 @@ -28,6 +28,10 @@ #include #endif +#ifdef Q_CYGWIN_WIN + #include +#endif + using namespace nxcl; using namespace std; @@ -125,16 +129,72 @@ #ifdef Q_CYGWIN_WIN QString filePath = qApp->applicationDirPath(); + QString tempPath = filePath; // On Windows QtNX will ship with the NX system components in NX/ relative to the // QtNX binary filePath.append("/NX"); setenv("NX_SYSTEM", filePath.toStdString().c_str(), 1); filePath.append("/bin"); + tempPath.append("/NX/tmp/"); + setenv("NX_TEMP", tempPath.toStdString().c_str(), 1); + setenv("TEMP", tempPath.toStdString().c_str(), 1); m_NXClient->setCustomPath(filePath.toStdString()); #endif + +#ifdef Q_WS_X11 + binaryPath = qApp->applicationDirPath(); + QString libPath = binaryPath; + + binaryPath.append("/bin"); + + m_NXClient->setCustomPath(binaryPath.toStdString()); + + libPath.append("/lib:"); + libPath.append(getenv("LD_LIBRARY_PATH")); + + cout << libPath.toStdString() << endl; + setenv("LD_LIBRARY_PATH", libPath.toStdString().c_str(), 1); +#endif + } +QString QtNXWindow::keyboardLayout() +{ +#ifdef Q_CYGWIN_WIN + HKL dwlayout = GetKeyboardLayout(0); + + WORD layout = LOWORD(dwlayout); + + // On Windows QtNX will ship with the keyboards file in NX/ relative to the + // QtNX binary + QString filePath = qApp->applicationDirPath(); + filePath.append("/NX/keyboards"); + + QFile keymaps(filePath); + + bool ok; + + if (keymaps.open(QIODevice::ReadOnly)) { + QTextStream stream(&keymaps); + QString line; + + while (!stream.atEnd()) { + line = stream.readLine(); + + if (line.startsWith("#")) + continue; + + if (line.section(",", 1, 1).toInt(&ok, 16) == (int)layout) + return line.section(",", 0, 0); + } + keymaps.close(); + } +#endif + return "defkeymap"; +} + + void QtNXWindow::setupUI() { logWindow = new QDialog(0); @@ -259,6 +319,21 @@ setDefaultData(); + if (config.useProxy) { + string proxyUsername(""); + string proxyPassword(""); + + if (config.proxyAuthenticated) { + proxyUsername = config.proxyUser; + proxyPassword = config.proxyPass; + } + + m_NXClient->setProxy(config.proxyHost, + proxyUsername, + proxyPassword, + config.proxyPort); + } + if (ui_lg.link->currentText() == tr("Modem")) session.linkType = "modem"; else if (ui_lg.link->currentText() == tr("ISDN")) @@ -425,6 +500,8 @@ ui_lg.session->setCurrentIndex( ui_lg.session->findText(sessionName)); + + parseXML(); } void QtNXWindow::resumeNewPressed() @@ -482,16 +559,16 @@ switch (id) { case NXCL_PROCESS_STARTED: - handleStatus(tr("Process started")); + handleStatus(tr("Starting login process")); break; case NXCL_PROCESS_EXITED: - handleStatus(tr("Process exited")); + handleStatus(tr("")); break; case NXCL_AUTH_FAILED: handleStatus(tr("Invalid authentication key")); break; case NXCL_AUTHENTICATING: - handleStatus(tr("Authenticating client")); + handleStatus(tr("Authenticating")); break; case NXCL_LOGIN_FAILED: handleStatus(tr("Invalid username or password")); @@ -501,7 +578,7 @@ handleStatus(tr("Host key verification failed")); break; case NXCL_INVOKE_PROXY: - handleStatus(tr("Starting NX proxy")); + handleStatus(tr("Loading remote desktop")); break; case NXCL_STARTING: handleStatus(tr("Starting session")); @@ -510,10 +587,10 @@ handleStatus(tr("Finished connecting")); break; case NXCL_ALIVE: - handleStatus(tr("NX session active")); + handleStatus(tr("Session running")); break; case NXCL_PROCESS_ERROR: - handleStatus(tr("Process error")); + handleStatus(tr("An error occurred running a helper program")); break; default: break; Index: qtnx-0.9/nxparsexml.cpp =================================================================== --- qtnx-0.9.orig/nxparsexml.cpp 2008-10-14 10:11:40.000000000 +0200 +++ qtnx-0.9/nxparsexml.cpp 2008-10-14 14:02:04.000000000 +0200 @@ -133,6 +133,36 @@ sessionData->fullscreen = false; } + if (attributes.value("key") == "Use Proxy") { + if (attributes.value("value") == "True") + sessionData->useProxy = true; + else + sessionData->useProxy = false; + } + + if (attributes.value("key") == "Proxy Host") { + sessionData->proxyHost = attributes.value("value").toStdString(); + } + + if (attributes.value("key") == "Proxy Port") { + sessionData->proxyPort = attributes.value("value").toInt(); + } + + if (attributes.value("key") == "Use Proxy Authentication") { + if (attributes.value("value") == "True") + sessionData->proxyAuthenticated = true; + else + sessionData->proxyAuthenticated = false; + } + + if (attributes.value("key") == "Proxy Username") { + sessionData->proxyUser = attributes.value("value").toStdString(); + } + + if (attributes.value("key") == "Proxy Password") { + sessionData->proxyPass = attributes.value("value").toStdString(); + } + return true; } Index: qtnx-0.9/nxwritexml.cpp =================================================================== --- qtnx-0.9.orig/nxwritexml.cpp 2008-10-14 10:11:40.000000000 +0200 +++ qtnx-0.9/nxwritexml.cpp 2008-10-14 14:02:04.000000000 +0200 @@ -130,6 +130,36 @@ xml << "\n"; + if (sessionData.useProxy == true) + xml << "\n"; + else + xml << "\n"; + + xml << "\n"; + + xml << "\n"; + + if (sessionData.proxyAuthenticated == true) + xml << "\n"; + else + xml << "\n"; + + xml << "\n"; + + xml << "\n"; + if (sessionData.fullscreen == true) xml << "\n"; Index: qtnx-0.9/qtnxwindow.h =================================================================== --- qtnx-0.9.orig/qtnxwindow.h 2008-10-14 10:11:40.000000000 +0200 +++ qtnx-0.9/qtnxwindow.h 2008-10-14 10:43:03.000000000 +0200 @@ -126,11 +126,13 @@ // Decided to split up the code void setupUI(); + void parseXML(); void setDefaultData(); void initialiseClient(); - void parseXML(); void reinitialiseClient(); + QString keyboardLayout(); + int getWidth(); int getHeight(); int getDepth(); @@ -160,4 +162,5 @@ QString binaryPath; }; + #endif Index: qtnx-0.9/settingsdialog.ui =================================================================== --- qtnx-0.9.orig/settingsdialog.ui 2008-10-14 10:43:02.000000000 +0200 +++ qtnx-0.9/settingsdialog.ui 2008-10-14 14:02:04.000000000 +0200 @@ -5,8 +5,8 @@ 0 0 - 480 - 543 + 454 + 559 @@ -15,13 +15,7 @@ true - - - 6 - - - 9 - + @@ -32,13 +26,25 @@ 0 0 - 458 - 521 + 432 + 501 + + + 0 + 0 + + + + + 0 + 0 + + 0 @@ -46,548 +52,564 @@ Basic - - - 6 + + + + 9 + 9 + 391 + 72 + - - 9 + + General - - - - General - - + + + 6 + + + 9 + + + 6 - 9 + 0 - - - 6 + + + + 0 + 0 + - - 0 + + Session Name: - - - - - 0 - 0 - - - - Session Name: - - - - - - - + + + + - - - - - - Server - - + + + + + + + 9 + 87 + 391 + 106 + + + + Server + + + + 6 + + + 9 + + + 6 - 9 + 0 - - - 6 + + + + 0 + 0 + - - 0 + + Hostname: - - - - - 0 - 0 - - - - Hostname: - - - - - - - - - - - 0 - 0 - - - - Port: - - - - - - - 1 - - - 65535 - - - 22 - - - - + - - - 6 + + + + + + + 0 + 0 + - - 0 + + Port: - - - - Use default key - - - true - - - - - - - false - - - &Set Authentication Key... - - - - + + + + + + 1 + + + 65535 + + + 22 + + - - - - - - Desktop - - + + + 6 - 9 + 0 - - - 6 + + + Use default key - - 0 + + true - - - - - 0 - 0 - - - - Platform: - - - - - - - - UNIX - - - - - Windows - - - - - VNC Proxy - - - - - - - - - 0 - 0 - - - - Type: - - - - - - - - KDE - - - - - GNOME - - - - - CDE - - - - - XDM - - - - - Custom - - - - - - - - - 0 - 0 - - - - Link: - - - - - - - - Modem - - - - - ISDN - - - - - ADSL - - - - - WAN - - - - - LAN - - - - - + - - - 6 + + + false - - 0 + + &Set Authentication Key... - - - - Qt::Horizontal - - - - 173 - 20 - - - - - - - - false - - - &Settings... - - - - + - - - - - - Geometry - - + + + + + + + 9 + 199 + 391 + 105 + + + + Desktop + + + + 6 + + + 9 + + + 6 - 9 + 0 - - - 6 + + + + 0 + 0 + - - 0 + + Platform: + + + + - - - - 0 - 0 - - - - Resolution: - - + + UNIX + - - - - 640x480 - - - - - 800x600 - - - - - 1024x768 - - - - - Fullscreen - - - - - Custom - - - + + Windows + - - - - 0 - 0 - - - - Compression: - - + + VNC Proxy + + + + + + + + 0 + 0 + + + + Type: + + + + + - - - - PNG - - - - - JPEG - - - - - Raw X11 - - - + + KDE + + + + + GNOME + - + + + CDE + + + + + XDM + + + + + Custom + + + - - - 6 + + + + 0 + 0 + - - 0 + + Link: + + + + - - - - 0 - 0 - - - - JPEG Quality: - - + + Modem + - - - false - - - 1 - - - 9 - - - 9 - - - 6 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 1 - - + + ISDN + - + + + ADSL + + + + + WAN + + + + + LAN + + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 173 + 20 + + + - - - 6 + + + false - - 0 + + &Settings... + + + + + + + + + + 9 + 310 + 391 + 133 + + + + Geometry + + + + 6 + + + 9 + + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + Resolution: + + + + + - - - Use RENDER Extension - - - true - - + + 640x480 + - - - - 0 - 0 - - - - Width: - - + + 800x600 + - - - false - - - 9999 - - - 800 - - + + 1024x768 + - - - - 0 - 0 - - - - Height: - - + + Fullscreen + - - - false - - - 9999 - - - 600 - - + + Custom + - + + + + + + + 0 + 0 + + + + Compression: + + + + + + + + PNG + + + + + JPEG + + + + + Raw X11 + + + - - - + + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + JPEG Quality: + + + + + + + false + + + 1 + + + 9 + + + 9 + + + 6 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1 + + + + + + + + + 6 + + + 0 + + + + + Use RENDER Extension + + + true + + + + + + + + 0 + 0 + + + + Width: + + + + + + + false + + + 9999 + + + 800 + + + + + + + + 0 + 0 + + + + Height: + + + + + + + false + + + 9999 + + + 600 + + + + + + + @@ -599,22 +621,24 @@ Network - - - - 11 - 28 - 396 - 22 - - - - Use SSH Tunneling + + + 6 - - true + + 9 - + + + + Use SSH Tunneling + + + true + + + + @@ -622,7 +646,7 @@ Cache - + 6 @@ -630,7 +654,7 @@ 9 - + 6 @@ -703,13 +727,13 @@ - + Keyboard - + - + 6 @@ -746,7 +770,7 @@ - + 6 @@ -789,7 +813,7 @@ - + Qt::Horizontal @@ -805,7 +829,126 @@ - + + + Proxy Settings + + + + + + + + Use proxy to connect + + + + + + + + + Hostname: + + + + + + + false + + + + + + + + + + + Port: + + + + + + + false + + + 32768 + + + 8080 + + + + + + + + + + + + + false + + + Proxy requires authentication + + + + + + + + + + + Username: + + + + + + + Password: + + + + + + + + + + + false + + + + + + + false + + + QLineEdit::Password + + + + + + + + + + + + + + Qt::Vertical @@ -821,63 +964,60 @@ - - - - 6 - - - 0 - - - - - &Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &OK - - - false - - - true - - - - - - - &Apply - - - false - - - - - + + + + QLayout::SetMinimumSize + + + + + &Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &OK + + + false + + + true + + + + + + + &Apply + + + false + + + + +