#include "preferences.h"
#include "vncview.h"
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
#include <QtMaemo5>
#include <QX11Info>
migrateConfiguration();
QSettings settings;
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5StackedWindow);
#endif
toolbar->addAction(tr("Esc"), this, SLOT(sendEsc()));
toolbar->addAction(tr("PgUp"), this, SLOT(sendPgUp()));
toolbar->addAction(tr("PgDn"), this, SLOT(sendPgDn()));
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/chat_enter.png"), "", this, SLOT(sendReturn()));
toolbar->addAction(QIcon("/usr/share/icons/hicolor/48x48/hildon/control_keyboard.png"), "", this, SLOT(showInputPanel()));
#endif
QAction *pref_action = new QAction(tr("Preferences"), this);
QAction *about_action = new QAction(tr("About"), this);
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
menuBar()->addAction(connect_action);
menuBar()->addAction(disconnect_action);
menuBar()->addAction(scaling);
grabZoomKeys(true);
reloadSettings();
- //TODO: can i replace this with resizeEvent?
- connect(QApplication::desktop(), SIGNAL(resized(int)),
- this, SLOT(forceResize()));
-
if(url.isNull()) {
disconnect_action->setEnabled(false);
toolbar->setEnabled(false);
void MainWindow::grabZoomKeys(bool grab)
{
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
unsigned long val = (grab)?1:0;
Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False);
if(!atom) {
switch(status) {
case RemoteView::Connecting:
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
#endif
break;
case RemoteView::Connected:
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
#endif
if(!scaling->isChecked()) {
break;
case RemoteView::Disconnecting:
if(old_status != RemoteView::Disconnected) { //Disconnecting also occurs while connecting, so check last state
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
QMaemo5InformationBox::information(this, tr("Connection lost"));
#endif
}
break;
case RemoteView::Disconnected:
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
#endif
if(old_status == RemoteView::Disconnecting) {
bool in_fullscreen = windowState() & Qt::WindowFullScreen;
//hide menu/toolbar in fullscreen (new state is !in_fullscreen)
toolbar->setVisible(show_toolbar->isChecked() and in_fullscreen);
+#ifndef Q_WS_MAEMO_5
menuBar()->setVisible(in_fullscreen);
+#endif
setWindowState(windowState() ^ Qt::WindowFullScreen);
forceResizeDelayed();
void MainWindow::reloadSettings()
{
QSettings settings;
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
int rotation = settings.value("screen_rotation", 0).toInt();
setAttribute(Qt::WA_Maemo5AutoOrientation, rotation == 0);
setAttribute(Qt::WA_Maemo5LandscapeOrientation, rotation == 1);
void MainWindow::showInputPanel()
{
-#ifdef Q_WS_HILDON
+#ifdef Q_WS_MAEMO_5
vnc_view->setAttribute(Qt::WA_InputMethodEnabled, true);
QEvent event(QEvent::RequestSoftwareInputPanel);
QApplication::sendEvent(vnc_view, &event);