void CMainTabWnd::Localize() { SetTabText(m_aposTabs[TI_RESOURCE], GetResString(IDS_RESOURCE)); SetTabText(m_aposTabs[TI_DOWNLOAD], GetResString(IDS_DOWNLOAD)); SetTabText(m_aposTabs[TI_SHARE], GetResString(IDS_SHARE)); SetTabText(m_aposTabs[TI_ADVANCE], GetResString(IDS_ADVANCE)); SetTabText(m_aposTabs[TI_SEARCH], GetResString(IDS_SW_SEARCHBOX)); }
void Plugin::unPinTab (int index) { const int windowId = Proxy_->GetRootWindowsManager ()->GetPreferredWindowIndex (); auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId); if (!window) return; auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId); if (!tw) return; if (index == -1) index = sender ()->property ("Leechcraft/PinTab/CurrentIndex").toInt (); if (index < 0 || index >= tw->WidgetCount ()) { qWarning () << Q_FUNC_INFO << "invalid index " << index; return; } int realIndex = tw->TabData (index).toInt (); tw->Widget (index)-> setProperty ("SessionData/org.LeechCraft.PinTab.PinState", false); auto data = Window2PinTabsIndex2TabData_ [window].take (realIndex); tw->SetTabText (index, data.first); tw->SetTabClosable (index, true, data.second); tw->MoveTab (index, Window2PinTabsIndex2TabData_.value (window).count ()); }
void Plugin::pinTab (int index) { const int windowId = Proxy_->GetRootWindowsManager ()->GetPreferredWindowIndex (); auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId); if (!window) return; auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId); if (!tw) return; if (index == -1) index = sender ()->property ("Leechcraft/PinTab/CurrentIndex").toInt (); if (index < 0 || index >= tw->WidgetCount ()) { qWarning () << Q_FUNC_INFO << "invalid index " << index; return; } tw->Widget (index)-> setProperty ("SessionData/org.LeechCraft.PinTab.PinState", true); ++Window2Id_ [window]; auto pair = qMakePair (tw->TabText (index), tw->TabButton (index, CloseSide_)); tw->SetTabData (index, Window2Id_ [window]); tw->SetTabText (index, ""); tw->SetTabClosable (index, false); Window2PinTabsIndex2TabData_ [window] [Window2Id_.value (window, 0)] = pair; tw->MoveTab (index, Window2PinTabsIndex2TabData_ [window].count () - 1); }
////////////////////////////////////////////// // Definitions for the CContainOutput class CContainOutput::CContainOutput() { SetView(m_ViewOutput); SetDockCaption (_T("Output View - Docking container")); SetTabText(_T("Output")); SetTabIcon(IDI_TEXT); }
void CAdvanceTabWnd::Localize() { SetTabText(m_aposTabs[TI_SERVER], GetResString(IDS_SERVER)); SetTabText(m_aposTabs[TI_KAD], GetResString(IDS_EM_KADEMLIA)); SetTabText(m_aposTabs[TI_STAT], GetResString(IDS_EM_STATISTIC)); }