FileTransferDlg::FileTransferDlg(FileMessage *msg) : FileTransferBase(NULL, "filetransfer", false, WDestructiveClose) { m_msg = msg; SET_WNDPROC("filetransfer") setIcon(Pict("file")); setButtonsPict(this); setCaption((msg->getFlags() & MESSAGE_RECEIVED) ? i18n("Receive file") : i18n("Send file")); disableWidget(edtTime); disableWidget(edtEstimated); disableWidget(edtSpeed); msg->m_transfer->setNotify(new FileTransferDlgNotify(this)); sldSpeed->setValue(m_msg->m_transfer->speed()); connect(sldSpeed, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); m_time = 0; m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); m_timer->start(1000); printTime(); m_bTransfer = false; m_transferTime = 0; m_speed = 0; m_nAverage = 0; m_files = 0; m_bytes = 0; m_fileSize = 0; m_totalBytes = 0; m_totalSize = 0; m_state = FileTransfer::Unknown; connect(btnCancel, SIGNAL(clicked()), this, SLOT(close())); chkClose->setChecked(CorePlugin::m_plugin->getCloseTransfer()); connect(chkClose, SIGNAL(toggled(bool)), this, SLOT(closeToggled(bool))); }
void InterestsInfo::cmbChanged(int) { QComboBox *cmbs[4] = { cmbBg1, cmbBg2, cmbBg3, cmbBg4 }; QLineEdit *edts[4] = { edtBg1, edtBg2, edtBg3, edtBg4 }; unsigned n = 0; unsigned i; for (i = 0; i < 4; i++){ unsigned short value = getComboValue(cmbs[i], interests); if (value){ if (i != n){ cmbs[n]->setEnabled(true); edts[n]->setEnabled(true); initCombo(cmbs[n], value, interests, true); edts[n]->setText(edts[i]->text()); } edts[n]->setEnabled(true); n++; } } if (n >= 4) return; cmbs[n]->setEnabled(true); disableWidget(edts[n]); cmbs[n]->setCurrentItem(0); edts[n]->setText(""); for (n++; n < 4; n++){ disableWidget(cmbs[n]); disableWidget(edts[n]); initCombo(cmbs[n], 0, interests, true); edts[n]->setText(""); } }
void PastInfo::cmbAfChanged(int) { QComboBox *cmbs[3] = { cmbAf1, cmbAf2, cmbAf3 }; QLineEdit *edts[3] = { edtAf1, edtAf2, edtAf3 }; unsigned n = 0; unsigned i; for (i = 0; i < 3; i++){ unsigned short value = getComboValue(cmbs[i], affilations); if (value){ if (i != n){ cmbs[n]->setEnabled(true); edts[n]->setEnabled(true); initCombo(cmbs[n], value, affilations, true); edts[n]->setText(edts[i]->text()); } edts[n]->setEnabled(true); edts[n]->setReadOnly(false); n++; } } if (n >= 3) return; cmbs[n]->setEnabled(true); disableWidget(edts[n]); cmbs[n]->setCurrentItem(0); edts[n]->setText(""); for (n++; n < 3; n++){ disableWidget(cmbs[n]); disableWidget(edts[n]); initCombo(cmbs[n], 0, affilations, true); edts[n]->setText(""); } }
DiscoInfo::DiscoInfo(JabberBrowser *browser) : DiscoInfoBase(browser, NULL, false, WDestructiveClose) { m_browser = browser; SET_WNDPROC("jbrowser") setIcon(Pict("Jabber_online")); setTitle(); setButtonsPict(this); connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply())); m_bVersion = true; m_bTime = true; m_bLast = true; m_bStat = true; m_bVCard = true; m_about = NULL; load_data(jabberUserData, &m_data, NULL); disableWidget(edtJName); disableWidget(edtType); disableWidget(edtCategory); edtNameSpace->setReadOnly(true); disableWidget(edtName); disableWidget(edtVersion); disableWidget(edtSystem); disableWidget(edtTime); disableWidget(edtLast); lstStat->addColumn(i18n("Name")); lstStat->addColumn(i18n("Units")); lstStat->addColumn(i18n("Value")); lstStat->setExpandingColumn(2); btnUrl->setPixmap(Pict("home")); connect(btnUrl, SIGNAL(clicked()), this, SLOT(goUrl())); connect(edtUrl, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&))); }
HomeInfo::HomeInfo(QWidget *parent, struct ICQUserData *data, ICQClient *client) : HomeInfoBase(parent) { m_data = data; m_client = client; if (m_data){ edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbZone); } fill(); }
HomeInfo::HomeInfo(QWidget *p, bool readOnly) : HomeInfoBase(p) { edtState->setMaxLength(5); if (!readOnly) { load(pClient->owner); return; } edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbZone); }
HomeInfo::HomeInfo(QWidget *p, bool readOnly) : HomeInfoBase(p) { lblPict->setPixmap(Pict("home")); if (!readOnly) { load(pClient); return; } edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbZone); }
AIMInfo::AIMInfo(QWidget *parent, struct ICQUserData *data, ICQClient *client) : AIMInfoBase(parent) { m_bInit = false; m_client = client; m_data = data; edtScreen->setReadOnly(true); if (m_data){ edtFirst->setReadOnly(true); edtLast->setReadOnly(true); edtMiddle->setReadOnly(true); edtMaiden->setReadOnly(true); edtNick->setReadOnly(true); edtStreet->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); edtAutoReply->setReadOnly(true); disableWidget(cmbCountry); }else{ edtAutoReply->hide(); } edtOnline->setReadOnly(true); edtNA->setReadOnly(true); edtExtIP->setReadOnly(true); edtIntIP->setReadOnly(true); edtClient->setReadOnly(true); fill(); }
HomeInfo::HomeInfo(QWidget *parent, struct ICQUserData *data, unsigned contact, ICQClient *client) : QWidget( parent) { setupUi( this); m_data = data; m_client = client; m_contact = contact; if (m_data){ edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbZone); } fill(); }
Launcher_page::Launcher_page(QWidget *parent) : QWidget(parent), ui(new Ui::Launcher_page) { // ui->setupUi(this); initWidget(); disableWidget(); }
CommonPage::CommonPage(QWidget *parent) : QWidget(parent), ui(new Ui::CommonPage) { ui->setupUi(this); initWidget(); disableWidget(); }
void JabberInfo::fill() { JabberUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; edtID->setText(QString::fromUtf8(data->ID) + "@" + QString::fromUtf8(data->VHost)); edtFirstName->setText(data->FirstName ? QString::fromUtf8(data->FirstName) : QString("")); edtNick->setText(data->Nick ? QString::fromUtf8(data->Nick) : QString("")); edtBirthday->setText(data->Bday ? QString::fromUtf8(data->Bday) : QString("")); edtUrl->setText(data->Url ? QString::fromUtf8(data->Url) : QString("")); urlChanged(edtUrl->text()); int current = 0; const char *text = NULL; unsigned status = m_data ? m_data->Status : m_client->getStatus(); for (const CommandDef *cmd = m_client->protocol()->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon), i18n(cmd->text)); } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatTime(data->StatusTime)); lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime){ edtOnline->setText(formatTime(data->OnlineTime)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatTime(data->StatusTime)); } } if ((status != STATUS_ONLINE) && (status != STATUS_OFFLINE) && m_data){ QString autoReply; if (m_data->AutoReply) autoReply = QString::fromUtf8(m_data->AutoReply); edtAutoReply->setText(autoReply); }else{ edtAutoReply->hide(); } edtResource->setText(data->Resource ? QString::fromUtf8(data->Resource) : QString("")); }
MainInfo::MainInfo(QWidget *parent, Contact *contact) : MainInfoBase(parent) { m_contact = contact; m_bInit = false; cmbDisplay->setEditable(true); lstMails->addColumn(i18n("EMail")); lstPhones->addColumn(i18n("Type")); lstPhones->addColumn(i18n("Phone")); lstMails->setMenu(MenuMailList); lstPhones->setMenu(MenuPhoneList); if (m_contact == NULL) { lstMails->addColumn(i18n("Publish")); lstPhones->addColumn(i18n("Publish")); lblCurrent->setText(i18n("I'm currently available at:")); cmbStatus->insertItem(i18n("Don't show")); cmbStatus->insertItem(Pict("phone"), i18n("Available")); cmbStatus->insertItem(Pict("nophone"), i18n("Busy")); cmbStatus->setCurrentItem(getContacts()->owner()->getPhoneStatus()); } else { lblCurrent->setText(i18n("User is crrently available at:")); disableWidget(cmbCurrent); lblStatus->hide(); cmbStatus->hide(); } bool bHide = true; for (unsigned i = 0; i < getContacts()->nClients(); i++) { if (getContacts()->getClient(i)->protocol()->description()->flags & PROTOCOL_FOLLOWME) { bHide = false; break; } } if (bHide) { lblCurrent->hide(); cmbCurrent->hide(); lblStatus->hide(); cmbStatus->hide(); } lstMails->setExpandingColumn(0); lstPhones->setExpandingColumn(PHONE_NUMBER); if (m_contact == NULL) tabMain->removePage(tabNotes); fill(); connect(lstMails, SIGNAL(selectionChanged()), this, SLOT(mailSelectionChanged())); connect(lstPhones, SIGNAL(selectionChanged()), this, SLOT(phoneSelectionChanged())); connect(lstMails, SIGNAL(deleteItem(QListViewItem*)), this, SLOT(deleteMail(QListViewItem*))); connect(lstPhones, SIGNAL(deleteItem(QListViewItem*)), this, SLOT(deletePhone(QListViewItem*))); connect(btnMailAdd, SIGNAL(clicked()), this, SLOT(addMail())); connect(btnMailEdit, SIGNAL(clicked()), this, SLOT(editMail())); connect(btnMailDelete, SIGNAL(clicked()), this, SLOT(deleteMail())); connect(btnPhoneAdd, SIGNAL(clicked()), this, SLOT(addPhone())); connect(btnPhoneEdit, SIGNAL(clicked()), this, SLOT(editPhone())); connect(btnPhoneDelete, SIGNAL(clicked()), this, SLOT(deletePhone())); }
WorkInfo::WorkInfo(QWidget *p, bool readOnly) : WorkInfoBase(p) { btnSite->setPixmap(Pict("home")); connect(btnSite, SIGNAL(clicked()), this, SLOT(goUrl())); if (!readOnly) { load(pClient->owner); return; } edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbOccupation); edtName->setReadOnly(true); edtDept->setReadOnly(true); edtPosition->setReadOnly(true); edtSite->setReadOnly(true); }
PastInfo::PastInfo(QWidget *parent, struct ICQUserData *data, unsigned contact, ICQClient *client) : PastInfoBase(parent) { m_data = data; m_client = client; m_contact = contact; if (m_data){ edtBg1->setReadOnly(true); edtBg2->setReadOnly(true); edtBg3->setReadOnly(true); edtAf1->setReadOnly(true); edtAf2->setReadOnly(true); edtAf3->setReadOnly(true); disableWidget(cmbBg1); disableWidget(cmbBg2); disableWidget(cmbBg3); disableWidget(cmbAf1); disableWidget(cmbAf2); disableWidget(cmbAf3); }else{ connect(cmbBg1, SIGNAL(activated(int)), this, SLOT(cmbBgChanged(int))); connect(cmbBg2, SIGNAL(activated(int)), this, SLOT(cmbBgChanged(int))); connect(cmbBg3, SIGNAL(activated(int)), this, SLOT(cmbBgChanged(int))); connect(cmbAf1, SIGNAL(activated(int)), this, SLOT(cmbAfChanged(int))); connect(cmbAf2, SIGNAL(activated(int)), this, SLOT(cmbAfChanged(int))); connect(cmbAf3, SIGNAL(activated(int)), this, SLOT(cmbAfChanged(int))); } fill(); }
MoreInfo::MoreInfo(QWidget *parent, struct ICQUserData *data, ICQClient *client) : MoreInfoBase(parent) { m_data = data; m_client = client; btnHomePage->setPixmap(Pict("home")); connect(btnHomePage, SIGNAL(clicked()), this, SLOT(goUrl())); QDate now = QDate::currentDate(); spnAge->setSpecialValueText(" "); spnAge->setRange(0, 100); connect(cmbLang1, SIGNAL(activated(int)), this, SLOT(setLang(int))); connect(cmbLang2, SIGNAL(activated(int)), this, SLOT(setLang(int))); connect(cmbLang3, SIGNAL(activated(int)), this, SLOT(setLang(int))); connect(edtDate, SIGNAL(changed()), this, SLOT(birthDayChanged())); if (m_data){ disableWidget(spnAge); edtHomePage->setReadOnly(true); disableWidget(cmbGender); disableWidget(edtDate); disableWidget(cmbLang1); disableWidget(cmbLang2); disableWidget(cmbLang3); }else{ connect(edtHomePage, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&))); } fill(); }
InterestsInfo::InterestsInfo(QWidget *parent, struct ICQUserData *data, ICQClient *client) : InterestsInfoBase(parent) { m_data = data; m_client = client; if (m_data){ edtBg1->setReadOnly(true); edtBg2->setReadOnly(true); edtBg3->setReadOnly(true); edtBg4->setReadOnly(true); disableWidget(cmbBg1); disableWidget(cmbBg2); disableWidget(cmbBg3); disableWidget(cmbBg4); }else{ connect(cmbBg1, SIGNAL(activated(int)), this, SLOT(cmbChanged(int))); connect(cmbBg2, SIGNAL(activated(int)), this, SLOT(cmbChanged(int))); connect(cmbBg3, SIGNAL(activated(int)), this, SLOT(cmbChanged(int))); connect(cmbBg4, SIGNAL(activated(int)), this, SLOT(cmbChanged(int))); } fill(); }
WorkInfo::WorkInfo(QWidget *parent, struct ICQUserData *data, ICQClient *client) : WorkInfoBase(parent) { m_data = data; m_client = client; btnSite->setPixmap(Pict("home")); connect(btnSite, SIGNAL(clicked()), this, SLOT(goUrl())); if (m_data){ edtAddress->setReadOnly(true); edtCity->setReadOnly(true); edtState->setReadOnly(true); edtZip->setReadOnly(true); disableWidget(cmbCountry); disableWidget(cmbOccupation); edtName->setReadOnly(true); edtDept->setReadOnly(true); edtPosition->setReadOnly(true); edtSite->setReadOnly(true); }else{ connect(edtSite, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&))); } fill(); }
DiscoInfo::DiscoInfo(JabberBrowser *browser, const QString &features, const QString &name, const QString &type, const QString &category) : QDialog( NULL) { setAttribute( Qt::WA_DeleteOnClose); setupUi( this); m_browser = browser; SET_WNDPROC("jbrowser") setIcon(Pict("Jabber_online").pixmap()); setTitle(); setButtonsPict(this); connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply())); m_bVersion = true; m_bTime = true; m_bLast = true; m_bStat = true; m_bVCard = true; m_about = NULL; m_features = features; m_name = name; m_type = type; m_category = category; load_data(jabberUserData, &m_data, NULL); disableWidget(edtJName); disableWidget(edtType); disableWidget(edtCategory); edtNameSpace->setReadOnly(true); disableWidget(edtName); disableWidget(edtVersion); disableWidget(edtSystem); disableWidget(edtTime); disableWidget(edtLast); lstStat->addColumn(i18n("Name")); lstStat->addColumn(i18n("Units")); lstStat->addColumn(i18n("Value")); lstStat->setExpandingColumn(2); btnUrl->setPixmap(Pict("home").pixmap()); connect(btnUrl, SIGNAL(clicked()), this, SLOT(goUrl())); connect(edtUrl, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&))); }
void MSNInfo::fill() { MSNUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; edtEMail->setText(QString::fromUtf8(data->EMail.ptr)); edtNick->setText(data->ScreenName.ptr ? QString::fromUtf8(data->ScreenName.ptr) : edtEMail->text()); int current = 0; const char *text = NULL; unsigned status = m_data ? m_data->Status.value : m_client->getStatus(); for (const CommandDef *cmd = m_client->protocol()->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon).pixmap(), i18n(cmd->text)); } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatDateTime(data->StatusTime.value)); lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime.value){ edtOnline->setText(formatDateTime(data->OnlineTime.value)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatDateTime(data->StatusTime.value)); } } }
JabberInfo::JabberInfo(QWidget *parent, struct JabberUserData *data, JabberClient *client) : JabberInfoBase(parent) { m_client = client; m_data = data; btnUrl->setPixmap(Pict("home")); connect(btnUrl, SIGNAL(clicked()), this, SLOT(goUrl())); edtOnline->setReadOnly(true); edtNA->setReadOnly(true); edtResource->setReadOnly(true); edtID->setReadOnly(true); if (m_data){ edtFirstName->setReadOnly(true); edtNick->setReadOnly(true); disableWidget(edtDate); edtUrl->setReadOnly(true); edtAutoReply->setReadOnly(true); }else{ connect(edtUrl, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&))); edtAutoReply->hide(); } fill(); }
void ICQInfo::fill() { ICQUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; edtUin->setText(QString::number(data->Uin.value)); Contact *contact = getContacts()->contact(m_contact); edtFirst->setText(getContacts()->toUnicode(contact, data->FirstName.ptr)); edtLast->setText(getContacts()->toUnicode(contact, data->LastName.ptr)); edtNick->setText(getContacts()->toUnicode(contact, data->Nick.ptr)); if (m_data == NULL){ if (edtFirst->text().isEmpty()) { QString firstName = getContacts()->owner()->getFirstName(); firstName = getToken(firstName, '/'); edtFirst->setText(firstName); } if (edtLast->text().isEmpty()) { QString lastName = getContacts()->owner()->getLastName(); lastName = getToken(lastName, '/'); edtLast->setText(lastName); } password->setEnabled(m_client->getState() == Client::Connected); } cmbStatus->clear(); unsigned status = STATUS_ONLINE; if (m_data){ unsigned s = m_data->Status.value; if (s == ICQ_STATUS_OFFLINE){ status = STATUS_OFFLINE; }else if (s & ICQ_STATUS_DND){ status = STATUS_DND; }else if (s & ICQ_STATUS_OCCUPIED){ status = STATUS_OCCUPIED; }else if (s & ICQ_STATUS_NA){ status = STATUS_NA; }else if (s & ICQ_STATUS_AWAY){ status = STATUS_AWAY; }else if (s & ICQ_STATUS_FFC){ status = STATUS_FFC; } }else{ status = m_client->getStatus(); initCombo(cmbRandom, m_client->getRandomChatGroup(), chat_groups); } if ((status != STATUS_ONLINE) && (status != STATUS_OFFLINE) && m_data){ edtAutoReply->setText(getContacts()->toUnicode(getContacts()->contact(m_contact), m_data->AutoReply.ptr)); }else{ edtAutoReply->hide(); } int current = 0; const char *text = NULL; if (m_data && (status == STATUS_OFFLINE) && m_data->bInvisible.bValue){ cmbStatus->insertItem(Pict("ICQ_invisible"), i18n("Possibly invisible")); }else{ for (const CommandDef *cmd = ICQPlugin::m_icq->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon), i18n(cmd->text)); } } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatDateTime(data->StatusTime.value)); lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime.value){ edtOnline->setText(formatDateTime(data->OnlineTime.value)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatDateTime(data->StatusTime.value)); } } if (data->IP.ptr){ edtExtIP->setText(formatAddr(data->IP, data->Port.value)); }else{ lblExtIP->hide(); edtExtIP->hide(); } if ((data->RealIP.ptr) && ((data->IP.ptr == NULL) || (get_ip(data->IP) != get_ip(data->RealIP)))){ edtIntIP->setText(formatAddr(data->RealIP, data->Port.value)); }else{ lblIntIP->hide(); edtIntIP->hide(); } if (m_data){ string client_name = m_client->clientName(data); if (client_name.length()){ edtClient->setText(client_name.c_str()); }else{ lblClient->hide(); edtClient->hide(); } }else{ string name = PACKAGE; name += " "; name += VERSION; #ifdef WIN32 name += "/win32"; #endif edtClient->setText(name.c_str()); } }
void YahooInfo::fill() { YahooUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; edtLogin->setText(QString::fromUtf8(data->Login.ptr)); edtNick->setText(data->Nick.ptr ? QString::fromUtf8(data->Nick.ptr) : QString("")); edtFirst->setText(data->First.ptr ? QString::fromUtf8(data->First.ptr) : QString("")); edtLast->setText(data->Last.ptr ? QString::fromUtf8(data->Last.ptr) : QString("")); int current = 0; const char *text = NULL; unsigned long status = STATUS_OFFLINE; if (m_data == NULL){ if (m_client->getState() == Client::Connected){ const char *statusIcon = NULL; unsigned style = 0; m_client->contactInfo(&m_client->data.owner, status, style, statusIcon); } }else{ const char *statusIcon = NULL; unsigned style = 0; m_client->contactInfo(data, status, style, statusIcon); } for (const CommandDef *cmd = m_client->protocol()->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon), i18n(cmd->text)); } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ if (data->StatusTime.value){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatDateTime(data->StatusTime.value)); lblOnline->show(); edtOnline->show(); }else{ lblOnline->hide(); edtOnline->hide(); } lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime.value){ edtOnline->setText(formatDateTime(data->OnlineTime.value)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatDateTime(data->StatusTime.value)); } } if (m_bInit) return; m_bInit = true; fillEncoding(data); }
void AIMInfo::fill() { ICQUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; setText(edtScreen, data->Screen.ptr); setText(edtFirst, data->FirstName.ptr); setText(edtLast, data->LastName.ptr); setText(edtMiddle, data->MiddleName.ptr); setText(edtMaiden, data->Maiden.ptr); setText(edtNick, data->Nick.ptr); setText(edtStreet, data->Address.ptr); setText(edtCity, data->City.ptr); setText(edtState, data->State.ptr); setText(edtZip, data->Zip.ptr); initCombo(cmbCountry, (unsigned short)(data->Country.value), getCountries(), true, getCountryCodes()); if (m_data == NULL){ if (edtFirst->text().isEmpty()) edtFirst->setText(getContacts()->owner()->getFirstName()); if (edtLast->text().isEmpty()) edtLast->setText(getContacts()->owner()->getLastName()); } cmbStatus->clear(); unsigned status = STATUS_ONLINE; if (m_data){ unsigned s = m_data->Status.value; if (s == ICQ_STATUS_OFFLINE){ status = STATUS_OFFLINE; }else if (s & ICQ_STATUS_AWAY){ status = STATUS_AWAY; } }else{ status = m_client->getStatus(); } if ((status != STATUS_ONLINE) && (status != STATUS_OFFLINE) && m_data){ edtAutoReply->setText(m_client->toUnicode(m_data->AutoReply.ptr, m_data)); }else{ edtAutoReply->hide(); } int current = 0; const char *text = NULL; for (const CommandDef *cmd = m_client->protocol()->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon), i18n(cmd->text)); } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatDateTime(data->StatusTime.value)); lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime.value){ edtOnline->setText(formatDateTime(data->OnlineTime.value)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatDateTime(data->StatusTime.value)); } } if (data->IP.ptr){ edtExtIP->setText(formatAddr(data->IP, data->Port.value)); }else{ lblExtIP->hide(); edtExtIP->hide(); } if (data->RealIP.ptr && ((data->IP.ptr == NULL) || (get_ip(data->IP) != get_ip(data->RealIP)))){ edtIntIP->setText(formatAddr(data->RealIP, data->Port.value)); }else{ lblIntIP->hide(); edtIntIP->hide(); } if (m_data){ string client_name = m_client->clientName(data); if (client_name.length()){ edtClient->setText(client_name.c_str()); }else{ lblClient->hide(); edtClient->hide(); } }else{ string name = PACKAGE; name += " "; name += VERSION; #ifdef WIN32 name += "/win32"; #endif edtClient->setText(name.c_str()); } if (m_bInit) return; m_bInit = true; m_client->fillEncoding(cmbEncoding, data); }
void ICQInfo::fill() { ICQUserData *data = m_data; if (data == NULL) data = &m_client->data.owner; edtUin->setText(QString::number(data->Uin)); edtFirst->setText(m_client->toUnicode(data->FirstName, data)); edtLast->setText(m_client->toUnicode(data->LastName, data)); edtNick->setText(m_client->toUnicode(data->Nick, data)); if (m_data == NULL){ if (edtFirst->text().isEmpty()) edtFirst->setText(getContacts()->owner()->getFirstName()); if (edtLast->text().isEmpty()) edtLast->setText(getContacts()->owner()->getLastName()); } cmbStatus->clear(); unsigned status = STATUS_ONLINE; if (m_data){ unsigned s = m_data->Status; if (s == ICQ_STATUS_OFFLINE){ status = STATUS_OFFLINE; }else if (s & ICQ_STATUS_DND){ status = STATUS_DND; }else if (s & ICQ_STATUS_OCCUPIED){ status = STATUS_OCCUPIED; }else if (s & ICQ_STATUS_NA){ status = STATUS_NA; }else if (s & ICQ_STATUS_AWAY){ status = STATUS_AWAY; }else if (s & ICQ_STATUS_FFC){ status = STATUS_FFC; } }else{ status = m_client->getStatus(); initCombo(cmbRandom, m_client->getRandomChatGroup(), chat_groups); } if ((status != STATUS_ONLINE) && (status != STATUS_OFFLINE) && m_data){ edtAutoReply->setText(m_client->toUnicode(m_data->AutoReply, m_data)); }else{ edtAutoReply->hide(); } int current = 0; const char *text = NULL; if (m_data && (status == STATUS_OFFLINE) && m_data->bInvisible){ cmbStatus->insertItem(Pict("ICQ_invisible"), i18n("Possibly invisible")); }else{ for (const CommandDef *cmd = m_client->protocol()->statusList(); cmd->id; cmd++){ if (cmd->flags & COMMAND_CHECK_STATE) continue; if (status == cmd->id){ current = cmbStatus->count(); text = cmd->text; } cmbStatus->insertItem(Pict(cmd->icon), i18n(cmd->text)); } } cmbStatus->setCurrentItem(current); disableWidget(cmbStatus); if (status == STATUS_OFFLINE){ lblOnline->setText(i18n("Last online") + ":"); edtOnline->setText(formatTime(data->StatusTime)); lblNA->hide(); edtNA->hide(); }else{ if (data->OnlineTime){ edtOnline->setText(formatTime(data->OnlineTime)); }else{ lblOnline->hide(); edtOnline->hide(); } if ((status == STATUS_ONLINE) || (text == NULL)){ lblNA->hide(); edtNA->hide(); }else{ lblNA->setText(i18n(text)); edtNA->setText(formatTime(data->StatusTime)); } } if (data->IP){ edtExtIP->setText(formatAddr(data->IP, data->Port)); }else{ lblExtIP->hide(); edtExtIP->hide(); } if ((data->RealIP) && ((data->IP == NULL) || (get_ip(data->IP) != get_ip(data->RealIP)))){ edtIntIP->setText(formatAddr(data->RealIP, data->Port)); }else{ lblIntIP->hide(); edtIntIP->hide(); } if (m_data){ string client_name = m_client->clientName(data); if (client_name.length()){ edtClient->setText(client_name.c_str()); }else{ lblClient->hide(); edtClient->hide(); } }else{ string name = PACKAGE; name += " "; name += VERSION; #ifdef WIN32 name += "/win32"; #endif edtClient->setText(name.c_str()); } if (m_bInit) return; m_bInit = true; current = 0; int n_item = 1; cmbEncoding->clear(); cmbEncoding->insertItem("Default"); QStringList l; const ENCODING *e; QStringList main; QStringList::Iterator it; for (e = encodingTbl; e->language; e++){ if (!e->bMain) continue; main.append(i18n(e->language) + " (" + e->codec + ")"); } main.sort(); for (it = main.begin(); it != main.end(); ++it, n_item++){ QString str = *it; int n = str.find('('); str = str.mid(n + 1); n = str.find(')'); str = str.left(n); if (data->Encoding && !strcmp(data->Encoding, str.latin1())) current = n_item; cmbEncoding->insertItem(*it); } QStringList noMain; for (e = encodingTbl; e->language; e++){ if (e->bMain) continue; noMain.append(i18n(e->language) + " (" + e->codec + ")"); } noMain.sort(); for (it = noMain.begin(); it != noMain.end(); ++it, n_item++){ QString str = *it; int n = str.find('('); str = str.mid(n + 1); n = str.find(')'); str = str.left(n); if (data->Encoding && !strcmp(data->Encoding, str.latin1())) current = n_item; cmbEncoding->insertItem(*it); } cmbEncoding->setCurrentItem(current); }