@ -61,35 +61,35 @@ WirelessAssistant::WirelessAssistant(TQWidget* parent, const char* name, bool mo
frameDevice - > hide ( ) ;
/// Network List Widget
connect ( buttonScan , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( netScan ( ) ) ) ;
connect ( buttonScan , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( netScan ( ) ) ) ;
connect ( buttonConnect , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( itemAction ( ) ) ) ;
connect ( buttonConnect , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( itemAction ( ) ) ) ;
connect ( buttonClose , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( close ( ) ) ) ;
connect ( buttonClose , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( close ( ) ) ) ;
connect ( devCombo , TQ T _SIGNAL( activated ( const TQString & ) ) ,
this , TQ T _SLOT( setDev ( const TQString & ) ) ) ;
connect ( devCombo , TQ _SIGNAL( activated ( const TQString & ) ) ,
this , TQ _SLOT( setDev ( const TQString & ) ) ) ;
connect ( netList , TQ T _SIGNAL( rightButtonPressed ( TQListViewItem * , const TQPoint & , int ) ) ,
TQ T _SLOT( showItemContextMenu ( TQListViewItem * , const TQPoint & , int ) ) ) ;
connect ( netList , TQ _SIGNAL( rightButtonPressed ( TQListViewItem * , const TQPoint & , int ) ) ,
TQ _SLOT( showItemContextMenu ( TQListViewItem * , const TQPoint & , int ) ) ) ;
/// Settings Widget
connect ( buttonOptions , TQ T _SIGNAL( toggled ( bool ) ) ,
this , TQ T _SLOT( togglePage ( bool ) ) ) ;
connect ( buttonOptions , TQ _SIGNAL( toggled ( bool ) ) ,
this , TQ _SLOT( togglePage ( bool ) ) ) ;
connect ( buttonEnableAllMessages , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( enableAllMessages ( ) ) ) ;
connect ( buttonEnableAllMessages , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( enableAllMessages ( ) ) ) ;
/// Global KDE Options
connect ( TDEApplication : : kApplication ( ) , TQ T _SIGNAL( settingsChanged ( int ) ) ,
this , TQ T _SLOT( updateConfiguration ( int ) ) ) ;
connect ( TDEApplication : : kApplication ( ) , TQ _SIGNAL( settingsChanged ( int ) ) ,
this , TQ _SLOT( updateConfiguration ( int ) ) ) ;
setMouseBehaviour ( ) ;
TQTimer : : singleShot ( 10 , this , TQ T _SLOT( init ( ) ) ) ; //WAIT FOR THE UI TO BE READY BEFORE FURTHER SETUP (msec)
TQTimer : : singleShot ( 10 , this , TQ _SLOT( init ( ) ) ) ; //WAIT FOR THE UI TO BE READY BEFORE FURTHER SETUP (msec)
}
WirelessAssistant : : ~ WirelessAssistant ( )
@ -190,8 +190,8 @@ void WirelessAssistant::init()
connectedItem = 0 ;
timerGui = new TQTimer ( ) ;
timerConnectionCheck = new TQTimer ( ) ;
connect ( timerGui , TQ T _SIGNAL( timeout ( ) ) , TQ T _SLOT( updateConnectedItem ( ) ) ) ;
connect ( timerConnectionCheck , TQ T _SIGNAL( timeout ( ) ) , TQ T _SLOT( checkConnectionStatus ( ) ) ) ;
connect ( timerGui , TQ _SIGNAL( timeout ( ) ) , TQ _SLOT( updateConnectedItem ( ) ) ) ;
connect ( timerConnectionCheck , TQ _SIGNAL( timeout ( ) ) , TQ _SLOT( checkConnectionStatus ( ) ) ) ;
////////////////////////
///// DETECT & SET PATHS /////
@ -208,9 +208,9 @@ void WirelessAssistant::init()
///////////////////////////////////////
///// SCAN FOR AVAILABLE NETWORKS /////
if ( autoConnect )
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( netAutoConnect ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( netAutoConnect ( ) ) ) ;
else
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( netScan ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( netScan ( ) ) ) ;
}
void WirelessAssistant : : checkConnectionStatus ( )
@ -291,7 +291,7 @@ void WirelessAssistant::netScan()
timerConnectionCheck - > stop ( ) ; //stop while scanning.
netScan ( NetParams ) ;
if ( netList - > childCount ( ) > 0 ) {
TQTimer : : singleShot ( 0 , this , TQ T _SLOT( checkConnectionStatus ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQ _SLOT( checkConnectionStatus ( ) ) ) ;
timerConnectionCheck - > start ( WA_CONNECTION_CHECK_INTERVAL ) ;
}
}
@ -878,21 +878,21 @@ void WirelessAssistant::enableAllMessages()
void WirelessAssistant : : setMouseBehaviour ( )
{
if ( TDEGlobalSettings : : singleClick ( ) ) {
disconnect ( netList , TQ T _SIGNAL( selectionChanged ( TQListViewItem * ) ) ,
this , TQ T _SLOT( updateConnectButton ( TQListViewItem * ) ) ) ;
disconnect ( netList , TQ T _SIGNAL( doubleClicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ T _SLOT( itemAction ( ) ) ) ;
connect ( netList , TQ T _SIGNAL( clicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ T _SLOT( itemAction ( ) ) ) ;
disconnect ( netList , TQ _SIGNAL( selectionChanged ( TQListViewItem * ) ) ,
this , TQ _SLOT( updateConnectButton ( TQListViewItem * ) ) ) ;
disconnect ( netList , TQ _SIGNAL( doubleClicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ _SLOT( itemAction ( ) ) ) ;
connect ( netList , TQ _SIGNAL( clicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ _SLOT( itemAction ( ) ) ) ;
buttonConnect - > hide ( ) ;
} else {
disconnect ( netList , TQ T _SIGNAL( clicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ T _SLOT( itemAction ( ) ) ) ;
disconnect ( netList , TQ _SIGNAL( clicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ _SLOT( itemAction ( ) ) ) ;
connect ( netList , TQ T _SIGNAL( selectionChanged ( TQListViewItem * ) ) ,
this , TQ T _SLOT( updateConnectButton ( TQListViewItem * ) ) ) ;
connect ( netList , TQ T _SIGNAL( doubleClicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ T _SLOT( itemAction ( ) ) ) ;
connect ( netList , TQ _SIGNAL( selectionChanged ( TQListViewItem * ) ) ,
this , TQ _SLOT( updateConnectButton ( TQListViewItem * ) ) ) ;
connect ( netList , TQ _SIGNAL( doubleClicked ( TQListViewItem * , const TQPoint & , int ) ) ,
this , TQ _SLOT( itemAction ( ) ) ) ;
buttonConnect - > show ( ) ;
}
}
@ -930,7 +930,7 @@ TQString WirelessAssistant::runCommand( const TQStringList & cmd, int timeout, b
// a very basic and easy-to-workaround attepmt to restrict using dangerous commands via custom commands setting. This *REALLY* needs a working solution.
if ( cmd [ 0 ] = = " rm " | | cmd [ 0 ] = = " mv " | | cmd [ 0 ] = = " cp " | | cmd [ 0 ] = = " ln " ) return TQString ( ) ;
TQProcess * p = new TQProcess ( TQT_TQOBJECT ( this ) ) ;
TQProcess * p = new TQProcess ( this ) ;
p - > setArguments ( cmd ) ;
p - > start ( ) ;
@ -941,20 +941,20 @@ TQString WirelessAssistant::runCommand( const TQStringList & cmd, int timeout, b
TQTimer * timerProc = new TQTimer ( ) ; //timeout timer
if ( timeout > 0 & & ! detached ) {
connect ( timerProc , TQ T _SIGNAL( timeout ( ) ) , p , TQ T _SLOT( kill ( ) ) ) ;
connect ( timerProc , TQ _SIGNAL( timeout ( ) ) , p , TQ _SLOT( kill ( ) ) ) ;
timerProc - > start ( timeout * 1000 ) ; //convert sec to msec
}
connect ( buttonClose , TQ T _SIGNAL( clicked ( ) ) ,
p , TQ T _SLOT( kill ( ) ) ) ;
connect ( buttonClose , TQ _SIGNAL( clicked ( ) ) ,
p , TQ _SLOT( kill ( ) ) ) ;
int i = 0 ;
while ( p - > isRunning ( ) ) { // PROCESS USER EVENTS
TDEApplication : : eventLoop ( ) - > processEvents ( TQEventLoop : : AllEvents ) ;
usleep ( 75 * 1000 ) ; //75msec on Linux (75000msec on Windows...)
if ( i = = 27 ) { // ca 2sec have passed and the process is still running. Replace the 'Close' button with 'Stop'.
disconnect ( buttonClose , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( close ( ) ) ) ;
disconnect ( buttonClose , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( close ( ) ) ) ;
buttonClose - > setIconSet ( SmallIconSet ( " process-stop " ) ) ;
buttonClose - > setText ( i18n ( " &Stop " ) ) ;
TQToolTip : : remove
@ -965,11 +965,11 @@ TQString WirelessAssistant::runCommand( const TQStringList & cmd, int timeout, b
i + + ;
}
disconnect ( buttonClose , TQ T _SIGNAL( clicked ( ) ) ,
p , TQ T _SLOT( kill ( ) ) ) ;
disconnect ( buttonClose , TQ _SIGNAL( clicked ( ) ) ,
p , TQ _SLOT( kill ( ) ) ) ;
if ( i > 27 ) { //set 'stop' back to 'close' if needed
connect ( buttonClose , TQ T _SIGNAL( clicked ( ) ) ,
this , TQ T _SLOT( close ( ) ) ) ;
connect ( buttonClose , TQ _SIGNAL( clicked ( ) ) ,
this , TQ _SLOT( close ( ) ) ) ;
buttonClose - > setIconSet ( SmallIconSet ( " window-close " ) ) ;
buttonClose - > setText ( i18n ( " &Quit " ) ) ;
TQToolTip : : remove
@ -1034,19 +1034,19 @@ void WirelessAssistant::showItemContextMenu( TQListViewItem* i, const TQPoint& p
icm - > insertTitle ( nvi - > essid ( ) ) ;
if ( isConfigured ) {
if ( nvi - > isConnected ( ) ) {
icm - > insertItem ( SmallIcon ( " connect_no " ) , i18n ( " Disconnect... " ) , this , TQ T _SLOT( netDisconnect ( ) ) ) ;
//icm->insertItem( SmallIcon("reload"), i18n("Reconnect"), this, TQ T _SLOT(netConnect()) );
icm - > insertItem ( SmallIcon ( " connect_no " ) , i18n ( " Disconnect... " ) , this , TQ _SLOT( netDisconnect ( ) ) ) ;
//icm->insertItem( SmallIcon("reload"), i18n("Reconnect"), this, TQ _SLOT(netConnect()) );
} else
icm - > insertItem ( SmallIcon ( " connect_creating " ) , i18n ( " Connect " ) , this , TQ T _SLOT( netConnect ( ) ) ) ;
icm - > insertItem ( SmallIcon ( " connect_creating " ) , i18n ( " Connect " ) , this , TQ _SLOT( netConnect ( ) ) ) ;
icm - > insertSeparator ( ) ;
icm - > insertItem ( i18n ( " Forget Settings... " ) , this , TQ T _SLOT( removeNetParams ( ) ) ) ;
icm - > insertItem ( i18n ( " Edit Settings... " ) , this , TQ T _SLOT( editNetParams ( ) ) ) ;
icm - > insertItem ( i18n ( " Forget Settings... " ) , this , TQ _SLOT( removeNetParams ( ) ) ) ;
icm - > insertItem ( i18n ( " Edit Settings... " ) , this , TQ _SLOT( editNetParams ( ) ) ) ;
} else {
if ( nvi - > isConnected ( ) ) {
icm - > insertItem ( SmallIcon ( " connect_no " ) , i18n ( " Disconnect... " ) , this , TQ T _SLOT( netDisconnect ( ) ) ) ;
//icm->insertItem( SmallIcon("reload"), i18n("Configure and Reconnect..."), this, TQ T _SLOT(netConnect()) );
icm - > insertItem ( SmallIcon ( " connect_no " ) , i18n ( " Disconnect... " ) , this , TQ _SLOT( netDisconnect ( ) ) ) ;
//icm->insertItem( SmallIcon("reload"), i18n("Configure and Reconnect..."), this, TQ _SLOT(netConnect()) );
} else
icm - > insertItem ( SmallIcon ( " connect_creating " ) , i18n ( " Configure and Connect... " ) , this , TQ T _SLOT( netConnect ( ) ) ) ;
icm - > insertItem ( SmallIcon ( " connect_creating " ) , i18n ( " Configure and Connect... " ) , this , TQ _SLOT( netConnect ( ) ) ) ;
}
icm - > exec ( TQCursor : : pos ( ) ) ;
}
@ -1211,7 +1211,7 @@ bool WirelessAssistant::setWpaClientEnabled( bool e, const TQString& iface, TQSt
std : : cout < < " Using wpa_supplicant driver: " < < driver . ascii ( ) < < std : : endl ;
}
TQProcess * wp = new TQProcess ( TQT_TQOBJECT ( this ) ) ;
TQProcess * wp = new TQProcess ( this ) ;
wp - > clearArguments ( ) ;
wp - > addArgument ( Commands . wpa_supplicant ) ;
wp - > addArgument ( " -W " ) ; //wait for control interface