diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/kopete/kopetewindow.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-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 'kopete/kopete/kopetewindow.cpp')
-rw-r--r-- | kopete/kopete/kopetewindow.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/kopete/kopete/kopetewindow.cpp b/kopete/kopete/kopetewindow.cpp index 08d3ab5b..8dbb1dad 100644 --- a/kopete/kopete/kopetewindow.cpp +++ b/kopete/kopete/kopetewindow.cpp @@ -82,8 +82,8 @@ #include "kopeteeditglobalidentitywidget.h" //BEGIN GlobalStatusMessageIconLabel -GlobalStatusMessageIconLabel::GlobalStatusMessageIconLabel(TQWidget *parent, const char *name) - : TQLabel(parent, name) +GlobalStatusMessageIconLabel::GlobalStatusMessageIconLabel(TQWidget *tqparent, const char *name) + : TQLabel(tqparent, name) {} void GlobalStatusMessageIconLabel::mouseReleaseEvent( TQMouseEvent *event ) @@ -120,8 +120,8 @@ void GlobalStatusMessageIconLabel::mouseReleaseEvent( TQMouseEvent *event ) * (session) quit. */ -KopeteWindow::KopeteWindow( TQWidget *parent, const char *name ) -: KMainWindow( parent, name, WType_TopLevel ) +KopeteWindow::KopeteWindow( TQWidget *tqparent, const char *name ) +: KMainWindow( tqparent, name, WType_TopLevel ) { // Applications should ensure that their StatusBar exists before calling createGUI() // so that the StatusBar is always correctly positioned when KDE is configured to use @@ -209,7 +209,7 @@ void KopeteWindow::initActions() actionCollection(), "AddContact" ); actionAddContact->setDelayed( false ); // this signal mapper is needed to call slotAddContact with the correct arguments - addContactMapper = new TQSignalMapper( this ); + addContactMapper = new TQSignalMapper( TQT_TQOBJECT(this) ); connect( addContactMapper, TQT_SIGNAL( mapped( const TQString & ) ), this, TQT_SLOT( slotAddContactDialogInternal( const TQString & ) ) ); @@ -220,10 +220,10 @@ void KopeteWindow::initActions() */ actionDisconnect = new KAction( i18n( "O&ffline" ), "connect_no", - 0, this, TQT_SLOT( slotDisconnectAll() ), + 0, TQT_TQOBJECT(this), TQT_SLOT( slotDisconnectAll() ), actionCollection(), "DisconnectAll" ); - actionExportContacts = new KAction( i18n( "&Export Contacts..." ), "", 0, this, + actionExportContacts = new KAction( i18n( "&Export Contacts..." ), "", 0, TQT_TQOBJECT(this), TQT_SLOT( showExportDialog() ),actionCollection(), "ExportContacts" ); /* the connection menu has been replaced by the set status menu @@ -238,16 +238,16 @@ void KopeteWindow::initActions() actionDisconnect->setEnabled(false); selectAway = new KAction( i18n("&Away"), SmallIcon("kopeteaway"), 0, - this, TQT_SLOT( slotGlobalAway() ), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT( slotGlobalAway() ), actionCollection(), "SetAwayAll" ); selectBusy = new KAction( i18n("&Busy"), SmallIcon("kopeteaway"), 0, - this, TQT_SLOT( slotGlobalBusy() ), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT( slotGlobalBusy() ), actionCollection(), "SetBusyAll" ); actionSetInvisible = new KAction( i18n( "&Invisible" ), "kopeteavailable", 0 , - this, TQT_SLOT( slotSetInvisibleAll() ), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT( slotSetInvisibleAll() ), actionCollection(), "SetInvisibleAll" ); @@ -258,12 +258,12 @@ void KopeteWindow::initActions() "SetAvailableAll" );*/ actionSetAvailable = new KAction( i18n("&Online"), - SmallIcon("kopeteavailable"), 0, this, + SmallIcon("kopeteavailable"), 0, TQT_TQOBJECT(this), TQT_SLOT( slotGlobalAvailable() ), actionCollection(), "SetAvailableAll" ); - actionAwayMenu = new KActionMenu( i18n("&Set Status"), "kopeteavailable", - actionCollection(), "Status" ); + actionAwayMenu = new KActionMenu( i18n("&Set tqStatus"), "kopeteavailable", + actionCollection(), "tqStatus" ); actionAwayMenu->setDelayed( false ); actionAwayMenu->insert(actionSetAvailable); actionAwayMenu->insert(selectAway); @@ -273,25 +273,25 @@ void KopeteWindow::initActions() actionPrefs = KopeteStdAction::preferences( actionCollection(), "settings_prefs" ); - KStdAction::quit(this, TQT_SLOT(slotQuit()), actionCollection()); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotQuit()), actionCollection()); setStandardToolBarMenuEnabled(true); - menubarAction = KStdAction::showMenubar(this, TQT_SLOT(showMenubar()), actionCollection(), "settings_showmenubar" ); - statusbarAction = KStdAction::showStatusbar(this, TQT_SLOT(showStatusbar()), actionCollection(), "settings_showstatusbar"); + menubarAction = KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(showMenubar()), actionCollection(), "settings_showmenubar" ); + statusbarAction = KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(showStatusbar()), actionCollection(), "settings_showstatusbar"); KStdAction::keyBindings( guiFactory(), TQT_SLOT( configureShortcuts() ), actionCollection(), "settings_keys" ); - new KAction( i18n( "Configure Plugins..." ), "input_devices_settings", 0, this, + new KAction( i18n( "Configure Plugins..." ), "input_devices_settings", 0, TQT_TQOBJECT(this), TQT_SLOT( slotConfigurePlugins() ), actionCollection(), "settings_plugins" ); - new KAction( i18n( "Configure &Global Shortcuts..." ), "configure_shortcuts", 0, this, + new KAction( i18n( "Configure &Global Shortcuts..." ), "configure_shortcuts", 0, TQT_TQOBJECT(this), TQT_SLOT( slotConfGlobalKeys() ), actionCollection(), "settings_global" ); - KStdAction::configureToolbars( this, TQT_SLOT(slotConfToolbar()), actionCollection() ); - KStdAction::configureNotifications(this, TQT_SLOT(slotConfNotifications()), actionCollection(), "settings_notifications" ); + KStdAction::configureToolbars( TQT_TQOBJECT(this), TQT_SLOT(slotConfToolbar()), actionCollection() ); + KStdAction::configureNotifications(TQT_TQOBJECT(this), TQT_SLOT(slotConfNotifications()), actionCollection(), "settings_notifications" ); actionShowOffliners = new KToggleAction( i18n( "Show Offline &Users" ), "show_offliners", CTRL + Key_U, - this, TQT_SLOT( slotToggleShowOffliners() ), actionCollection(), "settings_show_offliners" ); + TQT_TQOBJECT(this), TQT_SLOT( slotToggleShowOffliners() ), actionCollection(), "settings_show_offliners" ); actionShowEmptyGroups = new KToggleAction( i18n( "Show Empty &Groups" ), "folder", CTRL + Key_G, - this, TQT_SLOT( slotToggleShowEmptyGroups() ), actionCollection(), "settings_show_empty_groups" ); + TQT_TQOBJECT(this), TQT_SLOT( slotToggleShowEmptyGroups() ), actionCollection(), "settings_show_empty_groups" ); actionShowOffliners->setCheckedState(i18n("Hide Offline &Users")); actionShowEmptyGroups->setCheckedState(i18n("Hide Empty &Groups")); @@ -306,7 +306,7 @@ void KopeteWindow::initActions() // quick search bar - clear button KAction *resetQuickSearch = new KAction( i18n( "Reset Quick Search" ), TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase", - 0, searchBar, TQT_SLOT( clear() ), actionCollection(), "quicksearch_reset" ); + 0, TQT_TQOBJECT(searchBar), TQT_SLOT( clear() ), actionCollection(), "quicksearch_reset" ); resetQuickSearch->setWhatsThis( i18n( "Reset Quick Search\n" "Resets the quick search so that all contacts and groups are shown again." ) ); @@ -317,24 +317,24 @@ void KopeteWindow::initActions() editGlobalAction->setAutoSized( true ); // KActionMenu for selecting the global status message(kopeteonlinestatus_0) - KActionMenu * setStatusMenu = new KActionMenu( i18n( "Set Status Message" ), "kopeteeditstatusmessage", actionCollection(), "SetStatusMessage" ); + KActionMenu * setStatusMenu = new KActionMenu( i18n( "Set tqStatus Message" ), "kopeteeditstatusmessage", actionCollection(), "SetStatusMessage" ); setStatusMenu->setDelayed( false ); connect( setStatusMenu->popupMenu(), TQT_SIGNAL( aboutToShow() ), TQT_SLOT(slotBuildStatusMessageMenu() ) ); connect( setStatusMenu->popupMenu(), TQT_SIGNAL( activated( int ) ), TQT_SLOT(slotStatusMessageSelected( int ) ) ); // sync actions, config and prefs-dialog - connect ( KopetePrefs::prefs(), TQT_SIGNAL(saved()), this, TQT_SLOT(slotConfigChanged()) ); + connect ( KopetePrefs::prefs(), TQT_SIGNAL(saved()), TQT_TQOBJECT(this), TQT_SLOT(slotConfigChanged()) ); slotConfigChanged(); - globalAccel = new KGlobalAccel( this ); - globalAccel->insert( TQString::fromLatin1("Read Message"), i18n("Read Message"), i18n("Read the next pending message"), + globalAccel = new KGlobalAccel( TQT_TQOBJECT(this) ); + globalAccel->insert( TQString::tqfromLatin1("Read Message"), i18n("Read Message"), i18n("Read the next pending message"), CTRL+SHIFT+Key_I, KKey::QtWIN+CTRL+Key_I, Kopete::ChatSessionManager::self(), TQT_SLOT(slotReadMessage()) ); - globalAccel->insert( TQString::fromLatin1("Show/Hide Contact List"), i18n("Show/Hide Contact List"), i18n("Show or hide the contact list"), - CTRL+SHIFT+Key_S, KKey::QtWIN+CTRL+Key_S, this, TQT_SLOT(slotShowHide()) ); + globalAccel->insert( TQString::tqfromLatin1("Show/Hide Contact List"), i18n("Show/Hide Contact List"), i18n("Show or hide the contact list"), + CTRL+SHIFT+Key_S, KKey::QtWIN+CTRL+Key_S, TQT_TQOBJECT(this), TQT_SLOT(slotShowHide()) ); - globalAccel->insert( TQString::fromLatin1("Set Away/Back"), i18n("Set Away/Back"), i18n("Sets away from keyboard or sets back"), - CTRL+SHIFT+Key_W, KKey::QtWIN+CTRL+SHIFT+Key_W, this, TQT_SLOT(slotToggleAway()) ); + globalAccel->insert( TQString::tqfromLatin1("Set Away/Back"), i18n("Set Away/Back"), i18n("Sets away from keyboard or sets back"), + CTRL+SHIFT+Key_W, KKey::QtWIN+CTRL+SHIFT+Key_W, TQT_TQOBJECT(this), TQT_SLOT(slotToggleAway()) ); globalAccel->readSettings(); globalAccel->updateConnections(); @@ -722,12 +722,12 @@ void KopeteWindow::slotAccountRegistered( Kopete::Account *account ) TQT_SLOT( slotAccountStatusIconRightClicked( Kopete::Account *, const TQPoint & ) ) ); - m_accountStatusBarIcons.insert( account, sbIcon ); + m_accountStatusBarIcons.insert( account, TQT_TQOBJECT(sbIcon) ); slotAccountStatusIconChanged( account->myself() ); // add an item for this account to the add contact actionmenu TQString s = "actionAdd%1Contact"; - s.arg( account->accountId() ); + s.tqarg( account->accountId() ); KAction *action = new KAction( account->accountLabel(), account->accountIcon(), 0 , addContactMapper, TQT_SLOT( map() ), account, s.latin1() ); addContactMapper->setMapping( action, account->protocol()->pluginId() + TQChar(0xE000) + account->accountId() ); actionAddContact->insert( action ); @@ -744,7 +744,7 @@ void KopeteWindow::slotAccountUnregistered( const Kopete::Account *account) } // the (void*) is to remove the const. i don't know why TQPtrList doesn't accept const ptr as key. - KopeteAccountStatusBarIcon *sbIcon = static_cast<KopeteAccountStatusBarIcon *>( m_accountStatusBarIcons[ (void*)account ] ); + KopeteAccountStatusBarIcon *sbIcon = static_cast<KopeteAccountStatusBarIcon *>( TQT_TQWIDGET(m_accountStatusBarIcons[ (void*)account ]) ); if( !sbIcon ) return; @@ -756,7 +756,7 @@ void KopeteWindow::slotAccountUnregistered( const Kopete::Account *account) // update add contact actionmenu TQString s = "actionAdd%1Contact"; - s.arg( account->accountId() ); + s.tqarg( account->accountId() ); // KAction * action = actionCollection()->action( account->accountId() ); Kopete::Account * myAccount = const_cast< Kopete::Account * > ( account ); KAction * action = static_cast< KAction *>( myAccount->child( s.latin1() ) ); @@ -779,7 +779,7 @@ void KopeteWindow::slotAccountStatusIconChanged( Kopete::Contact *contact ) kdDebug( 14000 ) << k_funcinfo << contact->property( Kopete::Global::Properties::self()->awayMessage() ).value() << endl; // update the global status label if the change doesn't // TQString newAwayMessage = contact->property( Kopete::Global::Properties::self()->awayMessage() ).value().toString(); - Kopete::OnlineStatus status = contact->onlineStatus(); + Kopete::OnlineStatus status = contact->onlinetqStatus(); /* if ( status.status() != Kopete::OnlineStatus::Connecting ) { TQString globalMessage = m_globalStatusMessage->text(); @@ -816,7 +816,7 @@ void KopeteWindow::slotAccountStatusIconChanged( Kopete::Contact *contact ) } } - KopeteAccountStatusBarIcon *i = static_cast<KopeteAccountStatusBarIcon *>( m_accountStatusBarIcons[ contact->account() ] ); + KopeteAccountStatusBarIcon *i = static_cast<KopeteAccountStatusBarIcon *>( TQT_TQWIDGET(m_accountStatusBarIcons[ contact->account() ]) ); if( !i ) return; @@ -861,17 +861,17 @@ void KopeteWindow::makeTrayToolTip() { TQToolTip::remove(m_tray); - TQString tt = TQString::fromLatin1("<qt>"); + TQString tt = TQString::tqfromLatin1("<qt>"); TQPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts(); for(Kopete::Account *a = accounts.first(); a; a = accounts.next()) { Kopete::Contact *self = a->myself(); tt += i18n( "Account tooltip information: <nobr>ICON <b>PROTOCOL:</b> NAME (<i>STATUS</i>)<br/>", "<nobr><img src=\"kopete-account-icon:%3:%4\"> <b>%1:</b> %2 (<i>%5</i>)<br/>" ) - .arg( a->protocol()->displayName() ).arg( a->accountLabel(), KURL::encode_string( a->protocol()->pluginId() ), - KURL::encode_string( a->accountId() ), self->onlineStatus().description() ); + .tqarg( a->protocol()->displayName() ).tqarg( a->accountLabel(), KURL::encode_string( a->protocol()->pluginId() ), + KURL::encode_string( a->accountId() ), self->onlinetqStatus().description() ); } - tt += TQString::fromLatin1("</qt>"); + tt += TQString::tqfromLatin1("</qt>"); TQToolTip::add(m_tray, tt); } } @@ -931,7 +931,7 @@ void KopeteWindow::showEvent( TQShowEvent * ) void KopeteWindow::slotAutoHide() { - if ( this->geometry().contains( TQCursor::pos() ) == false ) + if ( this->tqgeometry().tqcontains( TQCursor::pos() ) == false ) { /* The autohide-timer doesn't need to emit * timeouts when the window is hidden already. */ @@ -954,11 +954,11 @@ void KopeteWindow::setStatusMessage( const TQString & message ) for ( TQPtrListIterator<Kopete::Account> it( Kopete::AccountManager::self()->accounts() ); it.current(); ++it ) { Kopete::Contact *self = it.current()->myself(); - bool isInvisible = self && self->onlineStatus().status() == Kopete::OnlineStatus::Invisible; + bool isInvisible = self && self->onlinetqStatus().status() == Kopete::OnlineStatus::Invisible; if ( it.current()->isConnected() && !isInvisible ) { changed = true; - it.current()->setOnlineStatus( self->onlineStatus(), message ); + it.current()->setOnlineStatus( self->onlinetqStatus(), message ); } } Kopete::Away::getInstance()->setGlobalAwayMessage( message ); @@ -968,13 +968,13 @@ void KopeteWindow::setStatusMessage( const TQString & message ) void KopeteWindow::slotBuildStatusMessageMenu() { - TQObject * senderObj = const_cast<TQObject *>( sender() ); - m_globalStatusMessageMenu = static_cast<KPopupMenu *>( senderObj ); + TQObject * senderObj = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>( sender() )); + m_globalStatusMessageMenu = static_cast<KPopupMenu *>( TQT_TQWIDGET(senderObj) ); m_globalStatusMessageMenu->clear(); // pop up a menu containing the away messages, and a lineedit // see kopeteaway //messageMenu = new KPopupMenu( this ); -// messageMenu->insertTitle( i18n( "Status Message" ) ); +// messageMenu->insertTitle( i18n( "tqStatus Message" ) ); TQHBox * newMessageBox = new TQHBox( 0 ); newMessageBox->setMargin( 1 ); TQLabel * newMessagePix = new TQLabel( newMessageBox ); @@ -985,12 +985,12 @@ void KopeteWindow::slotBuildStatusMessageMenu() m_newMessageEdit->setText(Kopete::Away::message()); newMessageBox->setFocusProxy( m_newMessageEdit ); - newMessageBox->setFocusPolicy( TQWidget::ClickFocus ); + newMessageBox->setFocusPolicy( TQ_ClickFocus ); /* newMessageLabel->setFocusProxy( newMessageEdit ); newMessageLabel->setBuddy( newMessageEdit ); - newMessageLabel->setFocusPolicy( TQWidget::ClickFocus );*/ + newMessageLabel->setFocusPolicy( TQ_ClickFocus );*/ newMessagePix->setFocusProxy( m_newMessageEdit ); - newMessagePix->setFocusPolicy( TQWidget::ClickFocus ); + newMessagePix->setFocusPolicy( TQ_ClickFocus ); connect( m_newMessageEdit, TQT_SIGNAL( returnPressed() ), TQT_SLOT( slotNewStatusMessageEntered() ) ); m_globalStatusMessageMenu->insertItem( newMessageBox ); |