summaryrefslogtreecommitdiffstats
path: root/krdc/krdc.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /krdc/krdc.cpp
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krdc/krdc.cpp')
-rw-r--r--krdc/krdc.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/krdc/krdc.cpp b/krdc/krdc.cpp
index 6c08de5d..5719ad65 100644
--- a/krdc/krdc.cpp
+++ b/krdc/krdc.cpp
@@ -57,7 +57,7 @@ const int KRDC::TOOLBAR_FPS_1000 = 10000;
const int KRDC::TOOLBAR_SPEED_DOWN = 34;
const int KRDC::TOOLBAR_SPEED_UP = 20;
-QScrollView2::QScrollView2(TQWidget *w, const char *name) :
+TQScrollView2::TQScrollView2(TQWidget *w, const char *name) :
TQScrollView(w, name) {
setMouseTracking(true);
viewport()->setMouseTracking(true);
@@ -65,7 +65,7 @@ QScrollView2::QScrollView2(TQWidget *w, const char *name) :
verticalScrollBar()->setMouseTracking(true);
}
-void QScrollView2::mouseMoveEvent( TQMouseEvent *e )
+void TQScrollView2::mouseMoveEvent( TQMouseEvent *e )
{
e->ignore();
}
@@ -79,7 +79,7 @@ KRDC::KRDC(WindowMode wm, const TQString &host,
bool scale,
bool localCursor,
TQSize initialWindowSize) :
- TQWidget(0, 0, Qt::WStyle_ContextHelp),
+ TQWidget(0, 0, TQt::WStyle_ContextHelp),
m_layout(0),
m_scrollView(0),
m_view(0),
@@ -161,11 +161,11 @@ bool KRDC::start()
}
}
- setCaption(i18n("%1 - Remote Desktop Connection").arg(serverHost));
+ setCaption(i18n("%1 - Remote Desktop Connection").tqarg(serverHost));
- m_scrollView = new QScrollView2(this, "remote scrollview");
+ m_scrollView = new TQScrollView2(this, "remote scrollview");
m_scrollView->setFrameStyle(TQFrame::NoFrame);
- m_scrollView->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,
+ m_scrollView->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,
TQSizePolicy::Expanding));
switch(m_protocol)
@@ -198,8 +198,8 @@ bool KRDC::start()
// note that the disconnectedError() will be disconnected when kremoteview
// is completely initialized
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(statusChanged(RemoteViewtqStatus)),
+ TQT_SLOT(changeProgress(RemoteViewtqStatus)));
connect(m_view, TQT_SIGNAL(showingPasswordDialog(bool)),
TQT_SLOT(showingPasswordDialog(bool)));
connect(m_keyCaptureDialog, TQT_SIGNAL(keyPressed(XEvent*)),
@@ -210,9 +210,9 @@ bool KRDC::start()
return ret_status;
}
-void KRDC::changeProgress(RemoteViewStatus s) {
+void KRDC::changeProgress(RemoteViewtqStatus s) {
if (!m_progressDialog) {
- m_progressDialog = new KProgressDialog(0, 0, TQString::null,
+ m_progressDialog = new KProgressDialog(0, 0, TQString(),
"1234567890", false);
m_progressDialog->showCancelButton(true);
m_progressDialog->setMinimumDuration(0x7fffffff);//disable effectively
@@ -296,16 +296,16 @@ void KRDC::quit() {
bool KRDC::parseHost(TQString &str, Protocol &prot, TQString &serverHost, int &serverPort,
TQString &userName, TQString &password) {
TQString s = str;
- userName = TQString::null;
- password = TQString::null;
+ userName = TQString();
+ password = TQString();
if (prot == PROTOCOL_AUTO) {
if(s.startsWith("smb:/")>0) { //we know it's more likely to be windows..
s = "rdp:/" + s.section("smb:/", 1);
prot = PROTOCOL_RDP;
- } else if(s.contains("://") > 0) {
+ } else if(s.tqcontains("://") > 0) {
s = s.section("://",1);
- } else if(s.contains(":/") > 0) {
+ } else if(s.tqcontains(":/") > 0) {
s = s.section(":/", 1);
}
}
@@ -340,15 +340,15 @@ bool KRDC::parseHost(TQString &str, Protocol &prot, TQString &serverHost, int &s
if (url.port()) {
if (url.hasUser())
- str = TQString("%1@%2:%3").arg(userName).arg(serverHost).arg(url.port());
+ str = TQString("%1@%2:%3").tqarg(userName).tqarg(serverHost).tqarg(url.port());
else
- str = TQString("%1:%2").arg(serverHost).arg(url.port());
+ str = TQString("%1:%2").tqarg(serverHost).tqarg(url.port());
}
else {
if (url.hasUser())
- str = TQString("%1@%2").arg(userName).arg(serverHost);
+ str = TQString("%1@%2").tqarg(userName).tqarg(serverHost);
else
- str = TQString("%1").arg(serverHost);
+ str = TQString("%1").tqarg(serverHost);
}
return true;
}
@@ -373,10 +373,10 @@ void KRDC::enableFullscreen(bool on)
m_view->switchFullscreen(on);
}
-TQSize KRDC::sizeHint()
+TQSize KRDC::tqsizeHint()
{
if ((m_isFullscreen != WINDOW_MODE_FULLSCREEN) && m_toolbar) {
- int dockHint = m_dockArea->sizeHint().height();
+ int dockHint = m_dockArea->tqsizeHint().height();
dockHint = dockHint < 1 ? 1 : dockHint; // fix wrong size hint
return TQSize(m_view->framebufferSize().width(),
dockHint + m_view->framebufferSize().height());
@@ -385,8 +385,8 @@ TQSize KRDC::sizeHint()
return m_view->framebufferSize();
}
-TQPopupMenu *KRDC::createPopupMenu(TQWidget *parent) const {
- KPopupMenu *pu = new KPopupMenu(parent);
+TQPopupMenu *KRDC::createPopupMenu(TQWidget *tqparent) const {
+ KPopupMenu *pu = new KPopupMenu(tqparent);
pu->insertItem(i18n("View Only"), this, TQT_SLOT(viewOnlyToggled()), 0, VIEW_ONLY_ID);
pu->setCheckable(true);
pu->setItemChecked(VIEW_ONLY_ID, m_view->viewOnly());
@@ -407,7 +407,7 @@ void KRDC::switchToFullscreen(bool scaling)
bool fromFullscreen = (m_isFullscreen == WINDOW_MODE_FULLSCREEN);
- TQWidget *desktop = TQApplication::desktop();
+ TQWidget *desktop = TQT_TQWIDGET(TQApplication::desktop());
TQSize ds = desktop->size();
TQSize fbs = m_view->framebufferSize();
bool scalingPossible = m_view->supportsScaling() &&
@@ -479,14 +479,14 @@ void KRDC::switchToFullscreen(bool scaling)
pinButton->setIconSet(pinIconSet);
TQToolTip::add(pinButton, i18n("Autohide on/off"));
t->setToggle(FS_AUTOHIDE_ID);
- t->addConnection(FS_AUTOHIDE_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setFsToolbarAutoHide(bool)));
+ t->addConnection(FS_AUTOHIDE_ID, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(setFsToolbarAutoHide(bool)));
t->insertButton("window_nofullscreen", FS_FULLSCREEN_ID);
KToolBarButton *fullscreenButton = t->getButton(FS_FULLSCREEN_ID);
TQToolTip::add(fullscreenButton, i18n("Fullscreen"));
t->setToggle(FS_FULLSCREEN_ID);
t->setButton(FS_FULLSCREEN_ID, true);
- t->addConnection(FS_FULLSCREEN_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFullscreen(bool)));
+ t->addConnection(FS_FULLSCREEN_ID, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(enableFullscreen(bool)));
m_popup = createPopupMenu(t);
t->insertButton("configure", FS_ADVANCED_ID, m_popup, true, i18n("Advanced options"));
@@ -495,7 +495,7 @@ void KRDC::switchToFullscreen(bool scaling)
TQLabel *hostLabel = new TQLabel(t);
hostLabel->setName("kde toolbar widget");
- hostLabel->setAlignment(Qt::AlignCenter);
+ hostLabel->tqsetAlignment(TQt::AlignCenter);
hostLabel->setText(" "+m_host+" ");
t->insertWidget(FS_HOSTLABEL_ID, 150, hostLabel);
t->setItemAutoSized(FS_HOSTLABEL_ID, true);
@@ -506,18 +506,18 @@ void KRDC::switchToFullscreen(bool scaling)
TQToolTip::add(scaleButton, i18n("Scale view"));
t->setToggle(FS_SCALE_ID);
t->setButton(FS_SCALE_ID, scaling);
- t->addConnection(FS_SCALE_ID, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(switchToFullscreen(bool)));
+ t->addConnection(FS_SCALE_ID, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(switchToFullscreen(bool)));
}
t->insertButton("iconify", FS_ICONIFY_ID);
KToolBarButton *iconifyButton = t->getButton(FS_ICONIFY_ID);
TQToolTip::add(iconifyButton, i18n("Minimize"));
- t->addConnection(FS_ICONIFY_ID, TQT_SIGNAL(clicked()), this, TQT_SLOT(iconify()));
+ t->addConnection(FS_ICONIFY_ID, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(iconify()));
t->insertButton("close", FS_CLOSE_ID);
KToolBarButton *closeButton = t->getButton(FS_CLOSE_ID);
TQToolTip::add(closeButton, i18n("Close"));
- t->addConnection(FS_CLOSE_ID, TQT_SIGNAL(clicked()), this, TQT_SLOT(quit()));
+ t->addConnection(FS_CLOSE_ID, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(quit()));
m_fsToolbar->setChild(t);
@@ -575,7 +575,7 @@ void KRDC::switchToNormal(bool scaling)
if (!m_toolbar) {
m_dockArea = new TQDockArea(Qt::Horizontal, TQDockArea::Normal, this);
- m_dockArea->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding,
+ m_dockArea->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding,
TQSizePolicy::Fixed));
KToolBar *t = new KToolBar(m_dockArea);
m_toolbar = t;
@@ -587,7 +587,7 @@ void KRDC::switchToNormal(bool scaling)
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, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(enableFullscreen(bool)));
+ t->addConnection(0, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(enableFullscreen(bool)));
if (m_view->supportsScaling()) {
t->insertButton("viewmagfit", 1, true, i18n("Scale"));
@@ -596,14 +596,14 @@ void KRDC::switchToNormal(bool scaling)
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, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(switchToNormal(bool)));
+ t->addConnection(1, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(switchToNormal(bool)));
}
t->insertButton("key_enter", 2, true, i18n("Special Keys"));
KToolBarButton *skButton = t->getButton(2);
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()));
+ t->addConnection(2, TQT_SIGNAL(clicked()), TQT_TQOBJECT(m_keyCaptureDialog), TQT_SLOT(execute()));
if (m_popup) {
m_popup->deleteLater();
@@ -633,7 +633,7 @@ void KRDC::switchToNormal(bool scaling)
m_view->resize(m_view->framebufferSize());
}
- setMaximumSize(sizeHint());
+ setMaximumSize(tqsizeHint());
repositionView(false);
@@ -644,7 +644,7 @@ void KRDC::switchToNormal(bool scaling)
m_initialWindowSize = TQSize();
}
else if (!scalingChanged)
- resize(sizeHint());
+ resize(tqsizeHint());
show();
if (scalingChanged)
m_view->update();
@@ -681,14 +681,14 @@ void KRDC::iconify()
}
void KRDC::toolbarChanged() {
- setMaximumSize(sizeHint());
+ setMaximumSize(tqsizeHint());
// resize window when toolbar is docked and it was maximized
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());
+ resize(tqsizeHint());
}
@@ -722,7 +722,7 @@ bool KRDC::event(TQEvent *e) {
bool KRDC::eventFilter(TQObject *watched, TQEvent *e) {
/* used to get events from TQScrollView on resize for scale mode*/
- if (watched != m_scrollView)
+ if (TQT_BASE_OBJECT(watched) != TQT_BASE_OBJECT(m_scrollView))
return false;
if (e->type() != TQEvent::Resize)
return false;
@@ -736,7 +736,7 @@ void KRDC::setSize(int w, int h)
{
int dw, dh;
- TQWidget *desktop = TQApplication::desktop();
+ TQWidget *desktop = TQT_TQWIDGET(TQApplication::desktop());
dw = desktop->width();
dh = desktop->height();