Exemplo n.º 1
0
TDMCancelShutdown::TDMCancelShutdown( int how, int start, int timeout,
                                      int force, int uid, const char *os,
                                      TQWidget *_parent )
	: inherited( -1, _parent )
{
	if (force == SHUT_FORCE) {
		if (_allowNuke == SHUT_NONE)
			mayOk = false;
		else if (_allowNuke == SHUT_ROOT)
			mayNuke = doesNuke = true;
	}
	TQLabel *lab = new TQLabel( mayOk ?
	                          i18n("Abort pending shutdown:") :
	                          i18n("No permission to abort pending shutdown:"),
	                          this );
	box->addWidget( lab );
	TQDateTime qdt;
	TQString strt, end;
	if (start < time( 0 ))
		strt = i18n("now");
	else {
		qdt.setTime_t( start );
		strt = qdt.toString( Qt::LocalDate );
	}
	if (timeout == TO_INF)
		end = i18n("infinite");
	else {
		qdt.setTime_t( timeout );
		end = qdt.toString( Qt::LocalDate );
	}
	TQString trg =
		i18n("Owner: %1"
		     "\nType: %2%5"
		     "\nStart: %3"
		     "\nTimeout: %4")
		.arg( uid == -2 ?
		      i18n("console user") :
		      uid == -1 ?
		      i18n("control socket") :
		      KUser( uid ).loginName() )
		.arg( how == SHUT_HALT ?
		      i18n("turn off computer") :
		      i18n("restart computer") )
		.arg( strt ).arg( end )
		.arg( os ?
		      i18n("\nNext boot: %1").arg( TQString::fromLocal8Bit( os ) ) :
		      TQString() );
	if (timeout != TO_INF)
		trg += i18n("\nAfter timeout: %1")
		       .arg( force == SHUT_FORCE ?
		             i18n("abort all sessions") :
		             force == SHUT_FORCEMY ?
		             i18n("abort own sessions") :
		             i18n("cancel shutdown") );
	lab = new TQLabel( trg, this );
	box->addWidget( lab );
	complete( 0 );
}
Exemplo n.º 2
0
TQString EvaChatView::wrapNickName(TQString &nick, TQDateTime time, TQColor color, bool isNormal)
{
    TQString htmlName = nick;
    EvaHtmlParser parser;
    parser.setAbsImagePath(EvaMain::images->getSmileyPath());
    parser.convertToHtml(htmlName, false, true);
    TQString msg = "<span style=\"font-size: 9pt; color: " + color.name() +"\">" + htmlName + " ";
    if(!isNormal)
        msg+=i18n("(Auto-Reply)");

    TQDateTime current = TQDateTime::currentDateTime();
    TQString dateFormat = "hh:mm:ss";
    if(current.date() != time.date())
        dateFormat = "yyyy-MM-dd hh:mm:ss";
    msg+="  "+time.toString(dateFormat) + "</span><br>";
    return msg;
}
Exemplo n.º 3
0
void EvaAddingNoticeWindow::processSettings()
{
	printf("m_Type: %d\n", m_Type);
	TQString title;
	BuddyInfoCacheItem buddy = EvaMain::user->getSetting()->removeToBeAddedBuddy(m_ID);
	printf("cached: id: %d, nick: %s, face: %d, group:%d\n", buddy.id, buddy.nick.local8Bit().data(), buddy.face, buddy.group);
	m_Nick = buddy.nick;
	m_Face = buddy.face;
	TQPixmap *facePic = EvaMain::images->getFaceByID( m_Face );
	if(facePic){
		TQIconSet faceIcon;
		faceIcon.setPixmap(*facePic,TQIconSet::Large);
		tbFace->setIconSet(faceIcon);
	}

	TQString nick = buddy.nick.isEmpty()?(TQString::number(m_ID)):(TQString("%1(%2)").arg(m_Nick).arg(m_ID));
	switch(m_Type){
		case TQQ_MSG_SYS_ADD_FRIEND_APPROVED:{
			title = TQString(i18n("%1 has approved your request")).arg(nick);
			}
			break;
		case TQQ_MSG_SYS_ADD_FRIEND_REJECTED:{
			title = TQString(i18n("%1 has rejected your request")).arg(nick);
			}
			break;
		case TQQ_MSG_SYS_ADD_FRIEND_REQUEST_EX:{
			title = TQString(i18n("%1 wants to add you onto her/his contact list")).arg(nick);
			btngrpActions->setHidden(false);
			if(!m_AllowReverse || EvaMain::user->getFriendList().hasFriend(m_ID)){
				rbtnAcceptAdd->setEnabled( false );
				rbtnAcceptAdd->setHidden( true );
			}
			/// once user select reject, the lineedit should appear
			tbtnAuthSettings->setHidden(false);
			}
			break;
		case TQQ_MSG_SYS_ADD_FRIEND_APPROVED_AND_ADD:{
			title = TQString(i18n("%1 has approved your request and added you onto her/his contact list")).arg(nick);
			}
			break;
		case TQQ_MSG_SYS_ADDED_BY_CORRECT_ANSWER:
		case TQQ_MSG_SYS_BEING_ADDED_EX:{
			title = TQString(i18n("%1 has added you onto her/his contact list")).arg(nick);
			if(!EvaMain::user->getFriendList().hasFriend(m_ID))
				btnOk->setText( i18n("&Add to my list") );
			}
			break;
		case TQQ_MSG_SYS_BROADCAST:{
			// impossible, cuz this should use differnt dialog
			}
			break;
		default:{
			kdDebug() << "[EvaAddingNoticeWindow] unknown type: " << m_Type << endl;
			}
			break;
	}

	lblTitle->setText(title);

	if(!m_Message.isEmpty()){
		TQDateTime date = TQDateTime::currentDateTime(TQt::LocalTime);
		lblMessageTag->setText( TQString(i18n("Additional message(%1):")).arg(date.toString( "yyyy-MM-dd hh:mm:ss" ) ) );
		lblMessage->setText(m_Message);
		lblMessageTag->setHidden(false);
		lblMessage->setHidden(false);
	}
	adjustSize();
}
Exemplo n.º 4
0
TQString TDEABC::dateToVCardString( const TQDateTime &dateTime )
{
  return dateTime.toString("yyyyMMddThhmmssZ");
}