void FavoriteHubsFrame::openSelected() { if (!checkNick()) return; int i = -1; while ((i = ctrlHubs.GetNextItem(i, LVNI_SELECTED)) != -1) { FavoriteHubEntry* entry = (FavoriteHubEntry*)ctrlHubs.GetItemData(i); RecentHubEntry r; r.setName(entry->getName()); r.setDescription(entry->getDescription()); r.setUsers("*"); r.setShared("*"); r.setServer(entry->getServer()); FavoriteManager::getInstance()->addRecent(r); HubFrame::openWindow(true, entry->getServer(), entry->getName(), entry->getRawOne(), entry->getRawTwo(), entry->getRawThree(), entry->getRawFour(), entry->getRawFive(), entry->getWindowPosX(), entry->getWindowPosY(), entry->getWindowSizeX(), entry->getWindowSizeY(), entry->getWindowType(), entry->getChatUserSplit(), entry->getUserListState(), entry->getSuppressChatAndPM()); } return; }
void PublicHubsFrame::openHub(int ind) // [+] IRainman fix. { RecentHubEntry r; r.setName(m_ctrlHubs.ExGetItemText(ind, COLUMN_NAME)); r.setDescription(m_ctrlHubs.ExGetItemText(ind, COLUMN_DESCRIPTION)); r.setUsers(m_ctrlHubs.ExGetItemText(ind, COLUMN_USERS)); r.setShared(m_ctrlHubs.ExGetItemText(ind, COLUMN_SHARED)); const string l_server = Util::formatDchubUrl(m_ctrlHubs.ExGetItemText(ind, COLUMN_SERVER)); r.setServer(l_server); FavoriteManager::getInstance()->addRecent(r); HubFrame::openWindow(false, l_server); }
void FavoriteHubsFrame::openSelected() { if(!checkNick()) return; int i = -1; while( (i = ctrlHubs.GetNextItem(i, LVNI_SELECTED)) != -1) { FavoriteHubEntry* entry = (FavoriteHubEntry*)ctrlHubs.GetItemData(i); RecentHubEntry r; r.setName(entry->getName()); r.setDescription(entry->getDescription()); r.setUsers("*"); r.setShared("*"); r.setServer(entry->getServer()); FavoriteManager::getInstance()->addRecent(r); HubFrame::openWindow(Text::toT(entry->getServer()) , entry->getChatUserSplit(), entry->getUserListState()); } return; }
LRESULT RecentHubsFrame::onEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { int i = -1; if ((i = ctrlHubs.GetNextItem(i, LVNI_SELECTED)) != -1) { RecentHubEntry* r = (RecentHubEntry*)ctrlHubs.GetItemData(i); dcassert(r != NULL); LineDlg dlg; dlg.description = TSTRING(DESCRIPTION); dlg.title = Text::toT(r->getName()); dlg.line = Text::toT(r->getDescription()); if (dlg.DoModal(m_hWnd) == IDOK) { r->setDescription(Text::fromT(dlg.line)); ctrlHubs.SetItemText(i, COLUMN_DESCRIPTION, Text::toT(r->getDescription()).c_str()); } } return 0; }