Changeset 4838

Show
Ignore:
Timestamp:
01/27/07 18:23:17 (23 months ago)
Author:
flynd
Message:

Merged revisions 4797-4799,4801-4833,4835-4837 via svnmerge from
svn+ssh://licq/trunk/qt-gui

........

r4797 | erijo | 2006-12-13 18:40:55 +0100 (Wed, 13 Dec 2006) | 1 line


Goto end of history when opening a new send dialog

........

r4798 | erijo | 2006-12-13 19:17:19 +0100 (Wed, 13 Dec 2006) | 4 lines


Return focus to text edit after canceling a send.


Fixes #1466.

........

r4804 | erijo | 2007-01-04 22:18:44 +0100 (Thu, 04 Jan 2007) | 4 lines


Auto popup message if client status is away or na (in addition to online and ffc).


Closes #1416.

........

r4805 | erijo | 2007-01-05 14:18:07 +0100 (Fri, 05 Jan 2007) | 4 lines


Revert r4804 since it caused problems. The fix should either be an option or something completely different has to be implemented.


Reopens #1416.

........

r4816 | erijo | 2007-01-09 23:25:03 +0100 (Tue, 09 Jan 2007) | 6 lines


Don't include . , : ; ? ! or <space> in the url if one of them appear at
the end. This way, in e.g. this message:
"Check out http://trac.licq.org/timeline!"
the link will become "http://trac.licq.org/timeline" instead of
"http://trac.licq.org/timeline!".

........

r4837 | flynd | 2007-01-27 09:56:03 +0100 (Sat, 27 Jan 2007) | 4 lines


Created a spinbox for editing timezones and changed the user info dialog to allow timezone of contacts to be changed.
This implements one part of the feature in #1.
Changing the owners timezone is disabled as licq uses system setting instead.

........

Location:
branches/qt-gui_qt4
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4

    • Property svnmerge-integrated changed from /trunk/qt-gui:1-4775,4778-4794,4800 to /trunk/qt-gui:1-4775,4778-4794,4797-4833,4835-4837
  • branches/qt-gui_qt4/src/ewidgets.cpp

    r4810 r4838  
    5757#include "licq_history.h" 
    5858#include "licq_events.h" 
     59#include "licq_user.h" 
    5960#include "mainwin.h" 
    6061#include "eventdesc.h" 
     
    466467} 
    467468 
     469// ----------------------------------------------------------------------------- 
     470 
     471CTimeZoneField::CTimeZoneField(QWidget *parent) 
     472    : QSpinBox(-24, 24, 1, parent) 
     473{ 
     474  // The world is round so let timezones wrap 
     475  setWrapping(true); 
     476 
     477  // Plus and minus seems more fitting than up and down 
     478  setButtonSymbols(QSpinBox::PlusMinus); 
     479 
     480  // Force the input to be in format GMT+500, GMT-1030, etc... 
     481  setPrefix("GMT"); 
     482  setValidator(new QRegExpValidator(QRegExp("^[\\+\\-](1[012]|\\d)[03]0$|^Unknown$"), this)); 
     483 
     484  // Allow the value to be undefined as well. This will replace the lowest value (-24) 
     485  setSpecialValueText(tr("Unknown")); 
     486} 
     487 
     488void CTimeZoneField::setData(char data) 
     489{ 
     490  // The spinbox uses the lowest value to mark the undefined state but the constant is some other value so we need to change it 
     491  // For all defined values, the sign is inverted 
     492  setValue(data == TIMEZONE_UNKNOWN ? undefinedValue : static_cast<int>(-data)); 
     493} 
     494 
     495char CTimeZoneField::data() 
     496{ 
     497  int v = value(); 
     498  if (v == undefinedValue) 
     499    return TIMEZONE_UNKNOWN; 
     500  return static_cast<char>(-v); 
     501} 
     502 
     503QString CTimeZoneField::mapValueToText(int v) 
     504{ 
     505  // The internal value in the spinbox is 30min intervals so convert it to something more readable 
     506  return QString("%1%2%3").arg(v < 0 ? "-" : "+").arg(abs(v) / 2).arg(v % 2 ? "30" : "00"); 
     507} 
     508 
     509int CTimeZoneField::mapTextToValue(bool *ok) 
     510{ 
     511  // The user entered something so now we must try and convert it back to the internal int 
     512  QRegExp rx("^(\\+|-)(\\d+)(0|3)0$"); 
     513  if (rx.search(cleanText()) == -1) 
     514  { 
     515    *ok = false; 
     516    return 0; 
     517  } 
     518  int ret = rx.cap(2).toInt() * 2; 
     519  if (rx.cap(3) == "3") 
     520    ret++; 
     521  if (rx.cap(1) == "-") 
     522    ret = -ret; 
     523  *ok = true; 
     524  return ret; 
     525} 
    468526 
    469527// ----------------------------------------------------------------------------- 
     
    473531{ 
    474532  setTextFormat(Qt::RichText); 
    475 }; 
     533} 
    476534 
    477535// ----------------------------------------------------------------------------- 
  • branches/qt-gui_qt4/src/ewidgets.h

    r4810 r4838  
    4040#include <QtCore/QEvent> 
    4141#include <QtCore/QStringList> 
     42#include <qspinbox.h> 
    4243 
    4344#include "mlview.h" 
     
    146147}; 
    147148 
     149/* ----------------------------------------------------------------------------- */ 
     150 
     151/** 
     152 * Input field for timezones. 
     153 */ 
     154class CTimeZoneField : public QSpinBox 
     155{ 
     156public: 
     157  CTimeZoneField(QWidget *parent); 
     158  void setData(char data); 
     159  char data(); 
     160protected: 
     161  QString mapValueToText(int v); 
     162  int mapTextToValue(bool* ok); 
     163 
     164  static const int undefinedValue = -24; 
     165}; 
    148166 
    149167/* ----------------------------------------------------------------------------- */ 
  • branches/qt-gui_qt4/src/mlview.cpp

    r4801 r4838  
    8686      "[a-z0-9.-]+\\.([a-z]+|[0-9]+)"               // hostname.tld or ip address 
    8787      "(:[0-9]+)?"                                  // optional port 
    88       "(/([-\\w%{}|\\\\^~`;/?:@=&$_.+!*'(),#]|\\[|\\])*)?"); 
     88      "(/(([-\\w%{}|\\\\^~`;/?:@=&$_.+!*'(),#]|\\[|\\])*[^.,:;?!\\s])*)?"); 
    8989    reURL.setMinimal(false); 
    9090    reURL.setCaseSensitive(false); 
  • branches/qt-gui_qt4/src/usereventdlg.cpp

    r4801 r4838  
    16461646        if (tmp != "") 
    16471647          mleHistory->append(tmp); 
     1648 
     1649        mleHistory->GotoEnd(); 
    16481650      } 
    16491651    } 
     
    23552357    disconnect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(sendDone_common(ICQEvent *))); 
    23562358 
     2359  if (mleSend != NULL) 
     2360    mleSend->setFocus(); 
     2361 
    23572362  if (e->Result() != EVENT_ACKED) 
    23582363  { 
  • branches/qt-gui_qt4/src/userinfodlg.cpp

    r4822 r4838  
    315315  lay->addWidget(nfoStatus, CR, 1); 
    316316  lay->addWidget(new QLabel(tr("Timezone:"), p), CR, 3); 
    317   nfoTime = new CInfoField(p, true); 
    318   lay->addWidget(nfoTime, CR, 4); 
     317  tznZone = new CTimeZoneField(p); 
     318  lay->addWidget(tznZone, CR, 4); 
    319319 
    320320  lay->addWidget(new QLabel(tr("Name:"), p), ++CR, 0); 
     
    421421  } 
    422422  nfoIp->setData(ip); 
    423   if (u->GetTimezone() == TIMEZONE_UNKNOWN) 
    424     nfoTime->setText(tr("Unknown")); 
    425   else 
    426   { 
    427     nfoTime->setText(tr("GMT%1%2%3") 
    428        .arg(u->GetTimezone() > 0 ? "-" : "+") 
    429        .arg(abs(u->GetTimezone() / 2)).arg(u->GetTimezone() % 2 ? "30" : "00") ); 
    430   } 
     423  tznZone->setData(u->GetTimezone()); 
    431424  nfoStatus->setData(u->StatusStr()); 
    432425  if (m_bOwner) 
    433426  { 
     427    // Owner timezone is not editable, it is taken from system timezone instead 
     428    tznZone->setEnabled(false); 
     429 
    434430    const SCountry *c = GetCountryByCode(u->GetCountryCode()); 
    435431    if (c == NULL) 
     
    498494    u->SetCountryCode(GetCountryByIndex(i)->nCode); 
    499495  } 
     496  u->SetTimezone(tznZone->data()); 
    500497 
    501498  u->SetEnableSave(true); 
  • branches/qt-gui_qt4/src/userinfodlg.h

    r4794 r4838  
    108108             *nfoAlias, *nfoIp, *nfoUin, *nfoCity, *nfoState, 
    109109             *nfoZipCode, *nfoAddress, *nfoCountry, *nfoFax, *nfoCellular, 
    110              *nfoPhone, *nfoTime, *nfoStatus; 
     110             *nfoPhone, *nfoStatus; 
    111111  QCheckBox *chkKeepAliasOnUpdate; 
    112112  CEComboBox *cmbCountry; 
    113113  QLabel *lblAuth, *lblICQHomepage; 
     114  CTimeZoneField *tznZone; 
    114115 
    115116  // More info