void KLocaleConfigTime::slotTimeFmtChanged(const QString &t) { // m_locale->setTimeFormat(t); m_locale->setTimeFormat( userToStore( timeMap(), t ) ); emit localeChanged(); }
static Opm::TimeMapPtr createXDaysTimeMap(size_t numDays) { boost::gregorian::date startDate( 2010 , boost::gregorian::Jan , 1); Opm::TimeMapPtr timeMap(new Opm::TimeMap(boost::posix_time::ptime(startDate))); for (size_t i = 0; i < numDays; i++) timeMap->addTStep( boost::posix_time::hours( (i+1) * 24 )); return timeMap; }
void KLocaleConfigTime::slotLocaleChanged() { typedef QValueVector<QString> CalendarVector; CalendarVector calendars(4); calendars[0] = "gregorian"; calendars[1] = "hijri"; calendars[2] = "hebrew"; calendars[3] = "jalali"; QString calendarType = m_locale->calendarType(); int calendarSystem = 0; CalendarVector::iterator it = qFind(calendars.begin(), calendars.end(), calendarType); if ( it != calendars.end() ) calendarSystem = it - calendars.begin(); kdDebug() << "calSys: " << calendarSystem << ": " << calendarType << endl; m_comboCalendarSystem->setCurrentItem( calendarSystem ); // m_edTimeFmt->setText( m_locale->timeFormat() ); m_comboTimeFmt->setEditText( storeToUser( timeMap(), m_locale->timeFormat() ) ); // m_edDateFmt->setText( m_locale->dateFormat() ); m_comboDateFmt->setEditText( storeToUser( dateMap(), m_locale->dateFormat() ) ); //m_edDateFmtShort->setText( m_locale->dateFormatShort() ); m_comboDateFmtShort->setEditText( storeToUser( dateMap(), m_locale->dateFormatShort() ) ); m_comboWeekStartDay->setCurrentItem( m_locale->weekStartDay() - 1 ); if ( m_locale->nounDeclension() ) m_chDateMonthNamePossessive->setChecked( m_locale->dateMonthNamePossessive() ); kdDebug(173) << "converting: " << m_locale->timeFormat() << endl; kdDebug(173) << storeToUser(timeMap(), m_locale->timeFormat()) << endl; kdDebug(173) << userToStore(timeMap(), QString::fromLatin1("HH:MM:SS AMPM test")) << endl; }