@ -38,9 +38,9 @@ static void formatBytes(double bytes, TQString &result) {
if ( bytes < 1024 )
result . setNum ( bytes ) ;
else if ( bytes < 1024 * 1024 )
result = i18n ( " %1 KB " ) . arg ( K Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 , 1 ) ) ;
result = i18n ( " %1 KB " ) . arg ( TDE Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 , 1 ) ) ;
else
result = i18n ( " %1 MB " ) . arg ( K Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 / 1024.0 , 1 ) ) ;
result = i18n ( " %1 MB " ) . arg ( TDE Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 / 1024.0 , 1 ) ) ;
}
static void formatBytesMonth ( double bytes , TQString & result ) {
@ -54,9 +54,9 @@ static void formatBytesMonth(double bytes, TQString &result) {
if ( bytes < 1024 )
result . setNum ( bytes ) ;
else if ( bytes < 1024 * 1024 )
result = i18n ( " %1 KB " ) . arg ( K Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 , 1 ) ) ;
result = i18n ( " %1 KB " ) . arg ( TDE Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 , 1 ) ) ;
else
result = i18n ( " %1 MB " ) . arg ( K Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 / 1024.0 , 1 ) ) ;
result = i18n ( " %1 MB " ) . arg ( TDE Global: : locale ( ) - > formatNumber ( ( float ) bytes / 1024.0 / 1024.0 , 1 ) ) ;
}
static void formatDuration ( int seconds , TQString & result ) {
@ -292,7 +292,7 @@ void MonthlyWidget::plotMonth() {
selectionItem = 0L ;
lv2 - > clear ( ) ;
const KCalendarSystem * calendar = K Global: : locale ( ) - > calendar ( ) ;
const KCalendarSystem * calendar = TDE Global: : locale ( ) - > calendar ( ) ;
TQDate startDate = periodeFirst ( ) ;
for ( int i = 0 ; i < ( int ) logList . count ( ) ; i + + ) {
@ -354,9 +354,9 @@ void MonthlyWidget::plotMonth() {
s_duration ) ;
TQString s_lifrom , s_liuntil , s_costs ;
s_lifrom = K Global: : locale ( ) - > formatTime ( li - > from ( ) . time ( ) , false ) ;
s_liuntil = K Global: : locale ( ) - > formatTime ( li - > until ( ) . time ( ) , false ) ;
s_costs = K Global: : locale ( ) - > formatMoney ( li - > sessionCosts ( ) ) ;
s_lifrom = TDE Global: : locale ( ) - > formatTime ( li - > from ( ) . time ( ) , false ) ;
s_liuntil = TDE Global: : locale ( ) - > formatTime ( li - > until ( ) . time ( ) , false ) ;
s_costs = TDE Global: : locale ( ) - > formatMoney ( li - > sessionCosts ( ) ) ;
( void ) new LogListItem ( li , lv , con , day , s_lifrom , s_liuntil , s_duration , s_costs , _bin , _bout ) ;
}
@ -384,7 +384,7 @@ void MonthlyWidget::plotMonth() {
formatDuration ( duration ,
s_duration ) ;
TQString s_costs ( K Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString s_costs ( TDE Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
selectionItem = new LogListItem ( 0 , lv2 ,
i18n ( " Selection (%n connection) " , " Selection (%n connections) " , 0 ) ,
@ -394,7 +394,7 @@ void MonthlyWidget::plotMonth() {
i18n ( " %n connection " , " %n connections " , count ) ,
s_duration , s_costs , _bin , _bout , TQString ( ) , TQString ( ) , TQString ( ) ) ;
const KCalendarSystem * calendar = K Global: : locale ( ) - > calendar ( ) ;
const KCalendarSystem * calendar = TDE Global: : locale ( ) - > calendar ( ) ;
if ( calendar - > month ( periodeFirst ( ) ) = = calendar - > month ( TQDate : : currentDate ( ) ) ) {
@ -414,7 +414,7 @@ void MonthlyWidget::plotMonth() {
formatDurationMonth ( duration , m_duration ) ;
costsMonth ( costs , costs ) ;
TQString m_costs ( K Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString m_costs ( TDE Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
( void ) new TQListViewItem ( lv2 , selectionItem ,
i18n ( " Monthly estimates " ) , m_duration , m_costs , m_bin , m_bout ,
@ -443,19 +443,19 @@ void MonthlyWidget::slotConnections(int) {
}
void MonthlyWidget : : nextMonth ( ) {
m_periodeFirst = K Global: : locale ( ) - > calendar ( ) - > addMonths ( m_periodeFirst , 1 ) ;
m_periodeFirst = TDE Global: : locale ( ) - > calendar ( ) - > addMonths ( m_periodeFirst , 1 ) ;
plotMonth ( ) ;
}
void MonthlyWidget : : prevMonth ( ) {
m_periodeFirst = K Global: : locale ( ) - > calendar ( ) - > addMonths ( m_periodeFirst , - 1 ) ;
m_periodeFirst = TDE Global: : locale ( ) - > calendar ( ) - > addMonths ( m_periodeFirst , - 1 ) ;
plotMonth ( ) ;
}
void MonthlyWidget : : currentMonth ( ) {
const KCalendarSystem * calendar = K Global: : locale ( ) - > calendar ( ) ;
const KCalendarSystem * calendar = TDE Global: : locale ( ) - > calendar ( ) ;
TQDate dt = TQDate : : currentDate ( ) ;
calendar - > setYMD ( m_periodeFirst , calendar - > year ( dt ) , calendar - > month ( dt ) , 1 ) ;
@ -463,7 +463,7 @@ void MonthlyWidget::currentMonth() {
}
void MonthlyWidget : : exportWizard ( ) {
const KCalendarSystem * calendar = K Global: : locale ( ) - > calendar ( ) ;
const KCalendarSystem * calendar = TDE Global: : locale ( ) - > calendar ( ) ;
TQString date = TQString : : fromLatin1 ( " %1-%2 " ) // e.g.: June-2001
. arg ( calendar - > monthName ( periodeFirst ( ) ) )
. arg ( calendar - > year ( periodeFirst ( ) ) ) ;
@ -565,9 +565,9 @@ void MonthlyWidget::exportWizard() {
s_duration ) ;
TQString s_lifrom , s_liuntil , s_costs ;
s_lifrom = K Global: : locale ( ) - > formatTime ( li - > from ( ) . time ( ) , false ) ;
s_liuntil = K Global: : locale ( ) - > formatTime ( li - > until ( ) . time ( ) , false ) ;
s_costs = K Global: : locale ( ) - > formatMoney ( li - > sessionCosts ( ) ) ;
s_lifrom = TDE Global: : locale ( ) - > formatTime ( li - > from ( ) . time ( ) , false ) ;
s_liuntil = TDE Global: : locale ( ) - > formatTime ( li - > until ( ) . time ( ) , false ) ;
s_costs = TDE Global: : locale ( ) - > formatMoney ( li - > sessionCosts ( ) ) ;
// call export method
exportIFace - > addDataline ( con , day , s_lifrom , s_liuntil , s_duration ,
@ -593,9 +593,9 @@ void MonthlyWidget::exportWizard() {
formatDurationMonth ( duration , m_duration ) ;
costsMonth ( costs , costs ) ;
TQString m_costs ( K Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString m_costs ( TDE Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString datetime = K Global: : locale ( ) - > formatDateTime ( TQDateTime : : currentDateTime ( ) , true ) ;
TQString datetime = TDE Global: : locale ( ) - > formatDateTime ( TQDateTime : : currentDateTime ( ) , true ) ;
exportIFace - > addEmptyLine ( ) ;
exportIFace - > addDataline ( i18n ( " Monthly estimates (%1) " ) . arg ( datetime ) ,
@ -624,7 +624,7 @@ void MonthlyWidget::exportWizard() {
formatDuration ( duration ,
s_duration ) ;
TQString s_costs ( K Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString s_costs ( TDE Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
// call export methods
exportIFace - > addEmptyLine ( ) ;
@ -650,7 +650,7 @@ TQDate MonthlyWidget::periodeFirst() const
TQDate MonthlyWidget : : periodeLast ( ) const
{
const KCalendarSystem * calendar = K Global: : locale ( ) - > calendar ( ) ;
const KCalendarSystem * calendar = TDE Global: : locale ( ) - > calendar ( ) ;
// One month minus one day
return calendar - > addDays ( calendar - > addMonths ( m_periodeFirst , 1 ) , - 1 ) ;
@ -716,7 +716,7 @@ void MonthlyWidget::slotSelectionChanged()
formatDuration ( duration ,
s_duration ) ;
TQString s_costs ( K Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
TQString s_costs ( TDE Global: : locale ( ) - > formatMoney ( costs , TQString ( ) , 2 ) ) ;
selectionItem - > setText ( 0 , i18n ( " Selection (%n connection) " , " Selection (%n connections) " , count ) ) ;
selectionItem - > setText ( 1 , s_duration ) ;
selectionItem - > setText ( 2 , s_costs ) ;