51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "connectdialog.h"
-#include "fullscreenexitbutton.h"
#include "keymenu.h"
#include "mainwindow.h"
#include "preferences.h"
MainWindow::MainWindow(QString url, int quality, int listen_port, bool view_only):
QMainWindow(0),
vnc_view(0),
- scroll_area(new ScrollArea(0)),
+ scroll_area(new ScrollArea(this)),
input_toolbuttons(new QActionGroup(this)),
key_menu(0)
{
//set up toolbar
toolbar = new QToolBar(0);
- input_toolbuttons->addAction(toolbar->addAction(QChar(0x2026), this, SLOT(showKeyMenu()))); //"..." button
+ key_menu_button = input_toolbuttons->addAction(toolbar->addAction(QChar(0x2026), this, SLOT(showKeyMenu()))); //"..." button
+ key_menu_button->setCheckable(true); //used to indicate wether a modifier key is still pressed
input_toolbuttons->addAction(toolbar->addAction(tr("Tab"), this, SLOT(sendTab())));
input_toolbuttons->addAction(toolbar->addAction(tr("Esc"), this, SLOT(sendEsc())));
input_toolbuttons->addAction(toolbar->addAction(tr("PgUp"), this, SLOT(sendPgUp())));
setCentralWidget(scroll_area);
- FullScreenExitButton* fullscreen_exit_button = new FullScreenExitButton(this);
- connect(fullscreen_exit_button, SIGNAL(clicked()),
+ connect(scroll_area, SIGNAL(fullscreenButtonClicked()),
this, SLOT(toggleFullscreen()));
grabZoomKeys(true);
connect(vnc_view, SIGNAL(statusChanged(RemoteView::RemoteStatus)),
this, SLOT(statusChanged(RemoteView::RemoteStatus)));
+ connect(vnc_view, SIGNAL(errorMessage(QString, QString)),
+ scroll_area, SLOT(showMessage(QString, QString)));
scroll_area->setWidget(vnc_view);
vnc_view->start();
setWindowTitle(QString("Presence VNC - %1").arg(vnc_view->host()) + (view_only?tr(" [View Only]"):""));
{
key_menu->exec();
vnc_view->sendKeySequence(key_menu->getKeySequence());
+ key_menu_button->setChecked(key_menu->isAltChecked() or key_menu->isWinChecked());
}
void MainWindow::showPreferences()