summaryrefslogtreecommitdiffstats
path: root/krdc/krdc.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /krdc/krdc.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krdc/krdc.cpp')
-rw-r--r--krdc/krdc.cpp238
1 files changed, 119 insertions, 119 deletions
diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp
index 36939c91..6c08de5d 100644
--- a/krdc/krdc.cpp
+++ b/krdc/krdc.cpp
@@ -34,10 +34,10 @@
#include <kwin.h>
#include <kstartupinfo.h>
-#include <qdockarea.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
+#include <tqdockarea.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
#define BUMP_SCROLL_CONSTANT (200)
@@ -57,29 +57,29 @@ const int KRDC::TOOLBAR_FPS_1000 = 10000;
const int KRDC::TOOLBAR_SPEED_DOWN = 34;
const int KRDC::TOOLBAR_SPEED_UP = 20;
-QScrollView2::QScrollView2(QWidget *w, const char *name) :
- QScrollView(w, name) {
+QScrollView2::QScrollView2(TQWidget *w, const char *name) :
+ TQScrollView(w, name) {
setMouseTracking(true);
viewport()->setMouseTracking(true);
horizontalScrollBar()->setMouseTracking(true);
verticalScrollBar()->setMouseTracking(true);
}
-void QScrollView2::mouseMoveEvent( QMouseEvent *e )
+void QScrollView2::mouseMoveEvent( TQMouseEvent *e )
{
e->ignore();
}
-QString KRDC::m_lastHost = "";
+TQString KRDC::m_lastHost = "";
-KRDC::KRDC(WindowMode wm, const QString &host,
- Quality q, const QString &encodings,
- const QString &password,
+KRDC::KRDC(WindowMode wm, const TQString &host,
+ Quality q, const TQString &encodings,
+ const TQString &password,
bool scale,
bool localCursor,
- QSize initialWindowSize) :
- QWidget(0, 0, Qt::WStyle_ContextHelp),
+ TQSize initialWindowSize) :
+ TQWidget(0, 0, Qt::WStyle_ContextHelp),
m_layout(0),
m_scrollView(0),
m_view(0),
@@ -101,8 +101,8 @@ KRDC::KRDC(WindowMode wm, const QString &host,
m_localCursor(localCursor),
m_initialWindowSize(initialWindowSize)
{
- connect(&m_autoHideTimer, SIGNAL(timeout()), SLOT(hideFullscreenToolbarNow()));
- connect(&m_bumpScrollTimer, SIGNAL(timeout()), SLOT(bumpScroll()));
+ connect(&m_autoHideTimer, TQT_SIGNAL(timeout()), TQT_SLOT(hideFullscreenToolbarNow()));
+ connect(&m_bumpScrollTimer, TQT_SIGNAL(timeout()), TQT_SLOT(bumpScroll()));
m_pindown = UserIcon("pindown");
m_pinup = UserIcon("pinup");
@@ -116,8 +116,8 @@ KRDC::KRDC(WindowMode wm, const QString &host,
bool KRDC::start()
{
- QString userName, password;
- QString serverHost;
+ TQString userName, password;
+ TQString serverHost;
int serverPort = 5900;
int ret_status;
@@ -141,11 +141,11 @@ bool KRDC::start()
MainDialog mainDlg(this, "MainDialog");
mainDlg.setRemoteHost(m_lastHost);
- if (mainDlg.exec() == QDialog::Rejected) {
+ if (mainDlg.exec() == TQDialog::Rejected) {
return false;
}
- QString m_host = mainDlg.remoteHost();
+ TQString m_host = mainDlg.remoteHost();
m_lastHost = m_host;
if (m_host.startsWith("vnc:/"))
m_protocol = PROTOCOL_VNC;
@@ -164,9 +164,9 @@ bool KRDC::start()
setCaption(i18n("%1 - Remote Desktop Connection").arg(serverHost));
m_scrollView = new QScrollView2(this, "remote scrollview");
- m_scrollView->setFrameStyle(QFrame::NoFrame);
- m_scrollView->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
- QSizePolicy::Expanding));
+ m_scrollView->setFrameStyle(TQFrame::NoFrame);
+ m_scrollView->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,
+ TQSizePolicy::Expanding));
switch(m_protocol)
{
@@ -190,20 +190,20 @@ bool KRDC::start()
m_view->setViewOnly(kapp->config()->readBoolEntry("viewOnly", false));
m_scrollView->addChild(m_view);
- QWhatsThis::add(m_view, i18n("Here you can see the remote desktop. If the other side allows you to control it, you can also move the mouse, click or enter keystrokes. If the content does not fit your screen, click on the toolbar's full screen button or scale button. To end the connection, just close the window."));
+ TQWhatsThis::add(m_view, i18n("Here you can see the remote desktop. If the other side allows you to control it, you can also move the mouse, click or enter keystrokes. If the content does not fit your screen, click on the toolbar's full screen button or scale button. To end the connection, just close the window."));
- connect(m_view, SIGNAL(changeSize(int,int)), SLOT(setSize(int,int)));
- connect(m_view, SIGNAL(connected()), SLOT(show()));
- connect(m_view, SIGNAL(disconnected()), SIGNAL(disconnected()));
+ connect(m_view, TQT_SIGNAL(changeSize(int,int)), TQT_SLOT(setSize(int,int)));
+ connect(m_view, TQT_SIGNAL(connected()), TQT_SLOT(show()));
+ connect(m_view, TQT_SIGNAL(disconnected()), TQT_SIGNAL(disconnected()));
// note that the disconnectedError() will be disconnected when kremoteview
// is completely initialized
- connect(m_view, SIGNAL(disconnectedError()), SIGNAL(disconnectedError()));
- connect(m_view, SIGNAL(statusChanged(RemoteViewStatus)),
- SLOT(changeProgress(RemoteViewStatus)));
- connect(m_view, SIGNAL(showingPasswordDialog(bool)),
- SLOT(showingPasswordDialog(bool)));
- connect(m_keyCaptureDialog, SIGNAL(keyPressed(XEvent*)),
- m_view, SLOT(pressKey(XEvent*)));
+ connect(m_view, TQT_SIGNAL(disconnectedError()), TQT_SIGNAL(disconnectedError()));
+ connect(m_view, TQT_SIGNAL(statusChanged(RemoteViewStatus)),
+ TQT_SLOT(changeProgress(RemoteViewStatus)));
+ connect(m_view, TQT_SIGNAL(showingPasswordDialog(bool)),
+ TQT_SLOT(showingPasswordDialog(bool)));
+ connect(m_keyCaptureDialog, TQT_SIGNAL(keyPressed(XEvent*)),
+ m_view, TQT_SLOT(pressKey(XEvent*)));
ret_status = m_view->start();
@@ -212,15 +212,15 @@ bool KRDC::start()
void KRDC::changeProgress(RemoteViewStatus s) {
if (!m_progressDialog) {
- m_progressDialog = new KProgressDialog(0, 0, QString::null,
+ m_progressDialog = new KProgressDialog(0, 0, TQString::null,
"1234567890", false);
m_progressDialog->showCancelButton(true);
m_progressDialog->setMinimumDuration(0x7fffffff);//disable effectively
m_progress = m_progressDialog->progressBar();
m_progress->setTextEnabled(false);
m_progress->setTotalSteps(3);
- connect(m_progressDialog, SIGNAL(cancelClicked()),
- SIGNAL(disconnectedError()));
+ connect(m_progressDialog, TQT_SIGNAL(cancelClicked()),
+ TQT_SIGNAL(disconnectedError()));
}
if (s == REMOTE_VIEW_CONNECTING) {
@@ -243,10 +243,10 @@ void KRDC::changeProgress(RemoteViewStatus s) {
m_progress->setValue(3);
hideProgressDialog();
if (s == REMOTE_VIEW_CONNECTED) {
- QObject::disconnect(m_view, SIGNAL(disconnectedError()),
- this, SIGNAL(disconnectedError()));
- connect(m_view, SIGNAL(disconnectedError()),
- SIGNAL(disconnected()));
+ TQObject::disconnect(m_view, TQT_SIGNAL(disconnectedError()),
+ this, TQT_SIGNAL(disconnectedError()));
+ connect(m_view, TQT_SIGNAL(disconnectedError()),
+ TQT_SIGNAL(disconnected()));
if (m_view->startFullscreen()) {
// m_view instance is asking to start in fullscreen mode
enableFullscreen(true);
@@ -268,7 +268,7 @@ void KRDC::showingPasswordDialog(bool b) {
void KRDC::showProgressDialog() {
m_showProgress = true;
- QTimer::singleShot(400, this, SLOT(showProgressTimeout()));
+ TQTimer::singleShot(400, this, TQT_SLOT(showProgressTimeout()));
}
void KRDC::hideProgressDialog() {
@@ -293,11 +293,11 @@ void KRDC::quit() {
emit disconnected();
}
-bool KRDC::parseHost(QString &str, Protocol &prot, QString &serverHost, int &serverPort,
- QString &userName, QString &password) {
- QString s = str;
- userName = QString::null;
- password = QString::null;
+bool KRDC::parseHost(TQString &str, Protocol &prot, TQString &serverHost, int &serverPort,
+ TQString &userName, TQString &password) {
+ TQString s = str;
+ userName = TQString::null;
+ password = TQString::null;
if (prot == PROTOCOL_AUTO) {
if(s.startsWith("smb:/")>0) { //we know it's more likely to be windows..
@@ -340,15 +340,15 @@ bool KRDC::parseHost(QString &str, Protocol &prot, QString &serverHost, int &ser
if (url.port()) {
if (url.hasUser())
- str = QString("%1@%2:%3").arg(userName).arg(serverHost).arg(url.port());
+ str = TQString("%1@%2:%3").arg(userName).arg(serverHost).arg(url.port());
else
- str = QString("%1:%2").arg(serverHost).arg(url.port());
+ str = TQString("%1:%2").arg(serverHost).arg(url.port());
}
else {
if (url.hasUser())
- str = QString("%1@%2").arg(userName).arg(serverHost);
+ str = TQString("%1@%2").arg(userName).arg(serverHost);
else
- str = QString("%1").arg(serverHost);
+ str = TQString("%1").arg(serverHost);
}
return true;
}
@@ -373,26 +373,26 @@ void KRDC::enableFullscreen(bool on)
m_view->switchFullscreen(on);
}
-QSize KRDC::sizeHint()
+TQSize KRDC::sizeHint()
{
if ((m_isFullscreen != WINDOW_MODE_FULLSCREEN) && m_toolbar) {
int dockHint = m_dockArea->sizeHint().height();
dockHint = dockHint < 1 ? 1 : dockHint; // fix wrong size hint
- return QSize(m_view->framebufferSize().width(),
+ return TQSize(m_view->framebufferSize().width(),
dockHint + m_view->framebufferSize().height());
}
else
return m_view->framebufferSize();
}
-QPopupMenu *KRDC::createPopupMenu(QWidget *parent) const {
+TQPopupMenu *KRDC::createPopupMenu(TQWidget *parent) const {
KPopupMenu *pu = new KPopupMenu(parent);
- pu->insertItem(i18n("View Only"), this, SLOT(viewOnlyToggled()), 0, VIEW_ONLY_ID);
+ pu->insertItem(i18n("View Only"), this, TQT_SLOT(viewOnlyToggled()), 0, VIEW_ONLY_ID);
pu->setCheckable(true);
pu->setItemChecked(VIEW_ONLY_ID, m_view->viewOnly());
if (m_view->supportsLocalCursor()) {
pu->insertItem(i18n("Always Show Local Cursor"), this,
- SLOT(showLocalCursorToggled()), 0,
+ TQT_SLOT(showLocalCursorToggled()), 0,
SHOW_LOCAL_CURSOR_ID);
pu->setCheckable(true);
pu->setItemChecked(SHOW_LOCAL_CURSOR_ID,
@@ -407,9 +407,9 @@ void KRDC::switchToFullscreen(bool scaling)
bool fromFullscreen = (m_isFullscreen == WINDOW_MODE_FULLSCREEN);
- QWidget *desktop = QApplication::desktop();
- QSize ds = desktop->size();
- QSize fbs = m_view->framebufferSize();
+ TQWidget *desktop = TQApplication::desktop();
+ TQSize ds = desktop->size();
+ TQSize fbs = m_view->framebufferSize();
bool scalingPossible = m_view->supportsScaling() &&
((fbs.width() >= ds.width()) || (fbs.height() >= ds.height()));
@@ -421,9 +421,9 @@ void KRDC::switchToFullscreen(bool scaling)
fbs.height(),
x, y);
if (m_oldResolution.valid)
- m_fullscreenResolution = QSize(x, y);
+ m_fullscreenResolution = TQSize(x, y);
else
- m_fullscreenResolution = QApplication::desktop()->size();
+ m_fullscreenResolution = TQApplication::desktop()->size();
m_isFullscreen = WINDOW_MODE_FULLSCREEN;
if (!scalingPossible)
m_windowScaling = m_view->scaling();
@@ -449,7 +449,7 @@ void KRDC::switchToFullscreen(bool scaling)
if (m_layout)
delete m_layout;
- m_layout = new QVBoxLayout(this);
+ m_layout = new TQVBoxLayout(this);
m_layout->addWidget(m_scrollView);
if (scalingPossible) {
@@ -464,36 +464,36 @@ void KRDC::switchToFullscreen(bool scaling)
m_view->enableScaling(false);
m_fsToolbar = new KFullscreenPanel(this, "fstoolbar", m_fullscreenResolution);
- connect(m_fsToolbar, SIGNAL(mouseEnter()), SLOT(showFullscreenToolbar()));
- connect(m_fsToolbar, SIGNAL(mouseLeave()), SLOT(hideFullscreenToolbarDelayed()));
+ connect(m_fsToolbar, TQT_SIGNAL(mouseEnter()), TQT_SLOT(showFullscreenToolbar()));
+ connect(m_fsToolbar, TQT_SIGNAL(mouseLeave()), TQT_SLOT(hideFullscreenToolbarDelayed()));
KToolBar *t = new KToolBar(m_fsToolbar);
m_fsToolbarWidget = t;
t->setIconSize(KIcon::Panel);
- QIconSet pinIconSet;
- pinIconSet.setPixmap(m_pinup, QIconSet::Automatic, QIconSet::Normal, QIconSet::On);
- pinIconSet.setPixmap(m_pindown, QIconSet::Automatic, QIconSet::Normal, QIconSet::Off);
+ TQIconSet pinIconSet;
+ pinIconSet.setPixmap(m_pinup, TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::On);
+ pinIconSet.setPixmap(m_pindown, TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::Off);
t->insertButton("pinup", FS_AUTOHIDE_ID);
KToolBarButton *pinButton = t->getButton(FS_AUTOHIDE_ID);
pinButton->setIconSet(pinIconSet);
- QToolTip::add(pinButton, i18n("Autohide on/off"));
+ TQToolTip::add(pinButton, i18n("Autohide on/off"));
t->setToggle(FS_AUTOHIDE_ID);
- t->addConnection(FS_AUTOHIDE_ID, SIGNAL(toggled(bool)), this, SLOT(setFsToolbarAutoHide(bool)));
+ t->addConnection(FS_AUTOHIDE_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setFsToolbarAutoHide(bool)));
t->insertButton("window_nofullscreen", FS_FULLSCREEN_ID);
KToolBarButton *fullscreenButton = t->getButton(FS_FULLSCREEN_ID);
- QToolTip::add(fullscreenButton, i18n("Fullscreen"));
+ TQToolTip::add(fullscreenButton, i18n("Fullscreen"));
t->setToggle(FS_FULLSCREEN_ID);
t->setButton(FS_FULLSCREEN_ID, true);
- t->addConnection(FS_FULLSCREEN_ID, SIGNAL(toggled(bool)), this, SLOT(enableFullscreen(bool)));
+ t->addConnection(FS_FULLSCREEN_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFullscreen(bool)));
m_popup = createPopupMenu(t);
t->insertButton("configure", FS_ADVANCED_ID, m_popup, true, i18n("Advanced options"));
KToolBarButton *advancedButton = t->getButton(FS_ADVANCED_ID);
- QToolTip::add(advancedButton, i18n("Advanced options"));
+ TQToolTip::add(advancedButton, i18n("Advanced options"));
- QLabel *hostLabel = new QLabel(t);
+ TQLabel *hostLabel = new TQLabel(t);
hostLabel->setName("kde toolbar widget");
hostLabel->setAlignment(Qt::AlignCenter);
hostLabel->setText(" "+m_host+" ");
@@ -503,21 +503,21 @@ void KRDC::switchToFullscreen(bool scaling)
if (scalingPossible) {
t->insertButton("viewmagfit", FS_SCALE_ID);
KToolBarButton *scaleButton = t->getButton(FS_SCALE_ID);
- QToolTip::add(scaleButton, i18n("Scale view"));
+ TQToolTip::add(scaleButton, i18n("Scale view"));
t->setToggle(FS_SCALE_ID);
t->setButton(FS_SCALE_ID, scaling);
- t->addConnection(FS_SCALE_ID, SIGNAL(toggled(bool)), this, SLOT(switchToFullscreen(bool)));
+ t->addConnection(FS_SCALE_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(switchToFullscreen(bool)));
}
t->insertButton("iconify", FS_ICONIFY_ID);
KToolBarButton *iconifyButton = t->getButton(FS_ICONIFY_ID);
- QToolTip::add(iconifyButton, i18n("Minimize"));
- t->addConnection(FS_ICONIFY_ID, SIGNAL(clicked()), this, SLOT(iconify()));
+ TQToolTip::add(iconifyButton, i18n("Minimize"));
+ t->addConnection(FS_ICONIFY_ID, TQT_SIGNAL(clicked()), this, TQT_SLOT(iconify()));
t->insertButton("close", FS_CLOSE_ID);
KToolBarButton *closeButton = t->getButton(FS_CLOSE_ID);
- QToolTip::add(closeButton, i18n("Close"));
- t->addConnection(FS_CLOSE_ID, SIGNAL(clicked()), this, SLOT(quit()));
+ TQToolTip::add(closeButton, i18n("Close"));
+ t->addConnection(FS_CLOSE_ID, TQT_SIGNAL(clicked()), this, TQT_SLOT(quit()));
m_fsToolbar->setChild(t);
@@ -574,36 +574,36 @@ void KRDC::switchToNormal(bool scaling)
}
if (!m_toolbar) {
- m_dockArea = new QDockArea(Qt::Horizontal, QDockArea::Normal, this);
- m_dockArea->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,
- QSizePolicy::Fixed));
+ m_dockArea = new TQDockArea(Qt::Horizontal, TQDockArea::Normal, this);
+ m_dockArea->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding,
+ TQSizePolicy::Fixed));
KToolBar *t = new KToolBar(m_dockArea);
m_toolbar = t;
t->setIconText(KToolBar::IconTextRight);
- connect(t, SIGNAL(placeChanged(QDockWindow::Place)), SLOT(toolbarChanged()));
+ connect(t, TQT_SIGNAL(placeChanged(TQDockWindow::Place)), TQT_SLOT(toolbarChanged()));
t->insertButton("window_fullscreen", 0, true, i18n("Fullscreen"));
KToolBarButton *fullscreenButton = t->getButton(0);
- QToolTip::add(fullscreenButton, i18n("Fullscreen"));
- QWhatsThis::add(fullscreenButton, i18n("Switches to full screen. If the remote desktop has a different screen resolution, Remote Desktop Connection will automatically switch to the nearest resolution."));
+ TQToolTip::add(fullscreenButton, i18n("Fullscreen"));
+ TQWhatsThis::add(fullscreenButton, i18n("Switches to full screen. If the remote desktop has a different screen resolution, Remote Desktop Connection will automatically switch to the nearest resolution."));
t->setToggle(0);
t->setButton(0, false);
- t->addConnection(0, SIGNAL(toggled(bool)), this, SLOT(enableFullscreen(bool)));
+ t->addConnection(0, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFullscreen(bool)));
if (m_view->supportsScaling()) {
t->insertButton("viewmagfit", 1, true, i18n("Scale"));
KToolBarButton *scaleButton = t->getButton(1);
- QToolTip::add(scaleButton, i18n("Scale view"));
- QWhatsThis::add(scaleButton, i18n("This option scales the remote screen to fit your window size."));
+ TQToolTip::add(scaleButton, i18n("Scale view"));
+ TQWhatsThis::add(scaleButton, i18n("This option scales the remote screen to fit your window size."));
t->setToggle(1);
t->setButton(1, scaling);
- t->addConnection(1, SIGNAL(toggled(bool)), this, SLOT(switchToNormal(bool)));
+ t->addConnection(1, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(switchToNormal(bool)));
}
t->insertButton("key_enter", 2, true, i18n("Special Keys"));
KToolBarButton *skButton = t->getButton(2);
- QToolTip::add(skButton, i18n("Enter special keys."));
- QWhatsThis::add(skButton, i18n("This option allows you to send special key combinations like Ctrl-Alt-Del to the remote host."));
- t->addConnection(2, SIGNAL(clicked()), m_keyCaptureDialog, SLOT(execute()));
+ TQToolTip::add(skButton, i18n("Enter special keys."));
+ TQWhatsThis::add(skButton, i18n("This option allows you to send special key combinations like Ctrl-Alt-Del to the remote host."));
+ t->addConnection(2, TQT_SIGNAL(clicked()), m_keyCaptureDialog, TQT_SLOT(execute()));
if (m_popup) {
m_popup->deleteLater();
@@ -613,14 +613,14 @@ void KRDC::switchToNormal(bool scaling)
m_popup = createPopupMenu(t);
t->insertButton("configure", 3, m_popup, true, i18n("Advanced"));
KToolBarButton *advancedButton = t->getButton(3);
- QToolTip::add(advancedButton, i18n("Advanced options"));
+ TQToolTip::add(advancedButton, i18n("Advanced options"));
if (m_layout)
delete m_layout;
- m_layout = new QVBoxLayout(this);
+ m_layout = new TQVBoxLayout(this);
m_layout->addWidget(m_dockArea);
m_layout->addWidget(m_scrollView);
- m_layout->setGeometry(QRect(0, 0, m_scrollView->width(),
+ m_layout->setGeometry(TQRect(0, 0, m_scrollView->width(),
m_dockArea->height() + m_scrollView->height()));
}
@@ -641,7 +641,7 @@ void KRDC::switchToNormal(bool scaling)
if (!fromFullscreen) {
if (m_initialWindowSize.isValid()) {
resize(m_initialWindowSize);
- m_initialWindowSize = QSize();
+ m_initialWindowSize = TQSize();
}
else if (!scalingChanged)
resize(sizeHint());
@@ -684,18 +684,18 @@ void KRDC::toolbarChanged() {
setMaximumSize(sizeHint());
// resize window when toolbar is docked and it was maximized
- QSize fs = m_view->framebufferSize();
- QSize cs = size();
- QSize cs1(cs.width(), cs.height()-1); // adjusted for QDockArea.height()==1
+ TQSize fs = m_view->framebufferSize();
+ TQSize cs = size();
+ TQSize cs1(cs.width(), cs.height()-1); // adjusted for TQDockArea.height()==1
if ((fs == cs) || (fs == cs1))
resize(sizeHint());
}
-bool KRDC::event(QEvent *e) {
+bool KRDC::event(TQEvent *e) {
/* used to change resolution when fullscreen was minimized */
- if ((!m_fullscreenMinimized) || (e->type() != QEvent::WindowActivate))
- return QWidget::event(e);
+ if ((!m_fullscreenMinimized) || (e->type() != TQEvent::WindowActivate))
+ return TQWidget::event(e);
m_fullscreenMinimized = false;
int x, y;
@@ -705,9 +705,9 @@ bool KRDC::event(QEvent *e) {
m_view->height(),
x, y);
if (m_oldResolution.valid)
- m_fullscreenResolution = QSize(x, y);
+ m_fullscreenResolution = TQSize(x, y);
else
- m_fullscreenResolution = QApplication::desktop()->size();
+ m_fullscreenResolution = TQApplication::desktop()->size();
showFullScreen();
setGeometry(0, 0, m_fullscreenResolution.width(),
@@ -717,17 +717,17 @@ bool KRDC::event(QEvent *e) {
m_view->switchFullscreen( true );
KWin::setState(winId(), NET::StaysOnTop);
- return QWidget::event(e);
+ return TQWidget::event(e);
}
-bool KRDC::eventFilter(QObject *watched, QEvent *e) {
-/* used to get events from QScrollView on resize for scale mode*/
+bool KRDC::eventFilter(TQObject *watched, TQEvent *e) {
+/* used to get events from TQScrollView on resize for scale mode*/
if (watched != m_scrollView)
return false;
- if (e->type() != QEvent::Resize)
+ if (e->type() != TQEvent::Resize)
return false;
- QResizeEvent *re = (QResizeEvent*) e;
+ TQResizeEvent *re = (TQResizeEvent*) e;
m_view->resize(re->size());
return false;
}
@@ -736,7 +736,7 @@ void KRDC::setSize(int w, int h)
{
int dw, dh;
- QWidget *desktop = QApplication::desktop();
+ TQWidget *desktop = TQApplication::desktop();
dw = desktop->width();
dh = desktop->height();
@@ -763,10 +763,10 @@ void KRDC::repositionView(bool fullscreen) {
if (!m_scrollView)
return;
- QSize s = m_view->size();
+ TQSize s = m_view->size();
if (fullscreen) {
- QSize d = m_fullscreenResolution;
+ TQSize d = m_fullscreenResolution;
bool margin = false;
if (d.width() > s.width())
ox = (d.width() - s.width()) / 2;
@@ -807,10 +807,10 @@ void KRDC::hideFullscreenToolbarNow() {
}
void KRDC::bumpScroll() {
- int x = QCursor::pos().x();
- int y = QCursor::pos().y();
- QSize s = m_view->size();
- QSize d = m_fullscreenResolution;
+ int x = TQCursor::pos().x();
+ int y = TQCursor::pos().y();
+ TQSize s = m_view->size();
+ TQSize d = m_fullscreenResolution;
if (d.width() < s.width()) {
if (x == 0)
@@ -838,7 +838,7 @@ void KRDC::hideFullscreenToolbarDelayed() {
m_autoHideTimer.start(TOOLBAR_AUTOHIDE_TIMEOUT, true);
}
-void KRDC::mouseMoveEvent(QMouseEvent *e) {
+void KRDC::mouseMoveEvent(TQMouseEvent *e) {
if (m_isFullscreen != WINDOW_MODE_FULLSCREEN)
return;
@@ -847,8 +847,8 @@ void KRDC::mouseMoveEvent(QMouseEvent *e) {
/* Bump Scrolling */
- QSize s = m_view->size();
- QSize d = m_fullscreenResolution;
+ TQSize s = m_view->size();
+ TQSize d = m_fullscreenResolution;
if ((d.width() < s.width()) || d.height() < s.height()) {
if ((x == 0) || (x >= d.width()-1) ||
(y == 0) || (y >= d.height()-1))
@@ -874,7 +874,7 @@ void KRDC::mouseMoveEvent(QMouseEvent *e) {
e->accept();
}
-void KRDC::setLastHost(const QString &lastHost) {
+void KRDC::setLastHost(const TQString &lastHost) {
m_lastHost = lastHost;
}