ATLAS Offline Software
Loading...
Searching...
No Matches
VP1TabManager::Imp Class Reference
Collaboration diagram for VP1TabManager::Imp:

Public Member Functions

 Imp (VP1TabManager *tm, VP1TabWidget *tw, VP1ChannelManager *cm)
QMainWindow * channel2tab (IVP1ChannelWidget *cw)
QMainWindow * name2tab (const QString &tabname)
bool checkTabnameNotEmpty (const QString &tabname) const
bool checkTabnameExists (const QString &tabname) const
bool checkTabnameNotExists (const QString &tabname) const
bool checkChannelNameExists (const QString &channelbasename, const bool &isuniquename, const bool &checkfornonexistance=false) const
QMap< QString, QStringList > serializeTabAndChannelConfigInfo () const
void serializeTabAndChannelConfigInfo (QMap< QString, QMultiMap< QString, ChanState > > &tab2channels, QMap< QString, QByteArray > &tab2arrangements) const
QMainWindow * previousTab ()
QMainWindow * nextTab ()
QStringList channelsInTab (QMainWindow *tab)
QStringList channelsInTab (const QString &)

Public Attributes

VP1TabManagertabmanager
VP1TabWidgettabwidget
VP1ChannelManagerchannelmanager
std::map< QString, QMainWindow * > name_2_tab
std::map< IVP1ChannelWidget *, VP1DockWidget * > channelwidget_2_dockwidget
std::map< QMainWindow *, std::set< IVP1ChannelWidget * > > tab_2_channelwidgets
bool dontEmitVisibilityChanges
QSet< IVP1ChannelWidget * > lastvisible
QSet< IVP1ChannelWidget * > lastsoonvisible
VP1DockWidgetselecteddockwidget
VP1DockWidgetfullscreen_dockwidget
IVP1ChannelWidgetfullscreen_channelwidget
QString fullscreen_tabname
int fullscreen_tabindex
QMainWindow * fullscreen_tab
std::set< VP1DockWidget * > fullscreen_floatingdocks
bool tabcruisemode
QString channelWithPendingRemoval

Detailed Description

Definition at line 52 of file VP1TabManager.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1TabManager::Imp::Imp ( VP1TabManager * tm,
VP1TabWidget * tw,
VP1ChannelManager * cm )
inline

Member Function Documentation

◆ channel2tab()

QMainWindow * VP1TabManager::Imp::channel2tab ( IVP1ChannelWidget * cw)

Definition at line 661 of file VP1TabManager.cxx.

661 {
662 std::map<QMainWindow*,std::set<IVP1ChannelWidget*> >::iterator it = tab_2_channelwidgets.begin();
663 std::map<QMainWindow*,std::set<IVP1ChannelWidget*> >::iterator itE = tab_2_channelwidgets.end();
664 for (;it!=itE;++it) {
665 if (it->second.find(cw)!=it->second.end())
666 return it->first;
667 }
668 return 0;
669}
std::map< QMainWindow *, std::set< IVP1ChannelWidget * > > tab_2_channelwidgets

◆ channelsInTab() [1/2]

QStringList VP1TabManager::Imp::channelsInTab ( const QString & tabname)

Definition at line 225 of file VP1TabManager.cxx.

226{
227 //Get list of (unique) names of channels in this tab:
228 assert(name_2_tab.find(tabname)!=name_2_tab.end());
229 if (name_2_tab.find(tabname)==name_2_tab.end())
230 return QStringList();
231 return channelsInTab(name_2_tab[tabname]);
232}
std::map< QString, QMainWindow * > name_2_tab
QStringList channelsInTab(QMainWindow *tab)

◆ channelsInTab() [2/2]

QStringList VP1TabManager::Imp::channelsInTab ( QMainWindow * tab)

Definition at line 209 of file VP1TabManager.cxx.

210{
211 assert(tab_2_channelwidgets.find(tab)!=tab_2_channelwidgets.end());
212 if (tab_2_channelwidgets.find(tab)==tab_2_channelwidgets.end())
213 return QStringList();
214 std::set<IVP1ChannelWidget*>::const_iterator it, itE = tab_2_channelwidgets[tab].end();
215
216 QStringList l;
217 for (it = tab_2_channelwidgets[tab].begin();it!=itE;++it) {
218 l << (*it)->unique_name();
219 }
220
221 return l;
222}
l
Printing final latex table to .tex output file.

◆ checkChannelNameExists()

bool VP1TabManager::Imp::checkChannelNameExists ( const QString & channelbasename,
const bool & isuniquename,
const bool & checkfornonexistance = false ) const

Definition at line 192 of file VP1TabManager.cxx.

192 {
193 if (channelname.isEmpty()) {
194 QMessageBox::critical(0, "Error - Empty channel name provided",
195 "Empty channel name provided.",QMessageBox::Ok,QMessageBox::Ok);
196 return false;
197 }
198 if ( checkfornonexistance == ( isuniquename ? channelmanager->uniqueNameExists(channelname)
199 : channelmanager->baseNameExists(channelname) ) ) {
200 QString tmp = ( checkfornonexistance ? "already":"does not" );
201 QMessageBox::critical(0, "Error - Channel "+channelname+" "+tmp+" exists",
202 "Channel <i>"+channelname+"</i> "+tmp+" exists.",QMessageBox::Ok,QMessageBox::Ok);
203 return false;
204 }
205 return true;
206}

◆ checkTabnameExists()

bool VP1TabManager::Imp::checkTabnameExists ( const QString & tabname) const

Definition at line 158 of file VP1TabManager.cxx.

158 {
159 if (!checkTabnameNotEmpty(tabname))
160 return false;
161 if (name_2_tab.find(tabname)==name_2_tab.end()) {
162 QMessageBox::critical(0, "Error - Tab "+tabname+" does not exists",
163 "Tab <i>"+tabname+"</i> does not exists.",QMessageBox::Ok,QMessageBox::Ok);
164 return false;
165 }
166 return true;
167}
bool checkTabnameNotEmpty(const QString &tabname) const

◆ checkTabnameNotEmpty()

bool VP1TabManager::Imp::checkTabnameNotEmpty ( const QString & tabname) const

Definition at line 182 of file VP1TabManager.cxx.

182 {
183 if (tabname.isEmpty()) {
184 QMessageBox::critical(0, "Error - Empty tab name provided",
185 "Empty tab name provided.",QMessageBox::Ok,QMessageBox::Ok);
186 return false;
187 }
188 return true;
189}

◆ checkTabnameNotExists()

bool VP1TabManager::Imp::checkTabnameNotExists ( const QString & tabname) const

Definition at line 170 of file VP1TabManager.cxx.

170 {
171 if (!checkTabnameNotEmpty(tabname))
172 return false;
173 if (name_2_tab.find(tabname)!=name_2_tab.end()) {
174 QMessageBox::critical(0, "Error - Tab "+tabname+" already exists",
175 "Tab <i>"+tabname+"</i> already exists.",QMessageBox::Ok,QMessageBox::Ok);
176 return false;
177 }
178 return true;
179}

◆ name2tab()

QMainWindow * VP1TabManager::Imp::name2tab ( const QString & tabname)

Definition at line 673 of file VP1TabManager.cxx.

674{
675 if (name_2_tab.find(tabname)==name_2_tab.end())
676 return 0;
677 return name_2_tab[tabname];
678}

◆ nextTab()

QMainWindow * VP1TabManager::Imp::nextTab ( )

Definition at line 1048 of file VP1TabManager.cxx.

1048 {
1049 if (tabwidget->count()<=1)
1050 return 0;
1051 std::cout<<"currentindex:"<<tabwidget->currentIndex()<<std::endl;
1052 std::cout<<"nextindex:"<<(tabwidget->currentIndex() + 1) % tabwidget->count()<<std::endl;
1053 std::cout<<"ntabs:"<<tab_2_channelwidgets.size()<<std::endl;
1054 QMainWindow*nexttab=static_cast<QMainWindow*>(tabwidget->widget((tabwidget->currentIndex() + 1) % tabwidget->count()));
1055 assert(nexttab);
1056 assert(tab_2_channelwidgets.find(nexttab)!=tab_2_channelwidgets.end());
1057// if (tab_2_channelwidgets.find(nexttab)==tab_2_channelwidgets.end())
1058// return fullscreen_tab;
1059// else
1060 return nexttab;
1061}

◆ previousTab()

QMainWindow * VP1TabManager::Imp::previousTab ( )

Definition at line 1064 of file VP1TabManager.cxx.

1064 {
1065 if (tabwidget->count()<=1)
1066 return 0;
1067 int newindex = tabwidget->currentIndex() - 1;
1068 if (newindex<0)
1069 newindex += tabwidget->count();
1070 QMainWindow*prevtab = static_cast<QMainWindow*>(tabwidget->widget(newindex % tabwidget->count()));
1071 if (tab_2_channelwidgets.find(prevtab)==tab_2_channelwidgets.end())
1072 return fullscreen_tab;
1073 else
1074 return prevtab;
1075}

◆ serializeTabAndChannelConfigInfo() [1/2]

QMap< QString, QStringList > VP1TabManager::Imp::serializeTabAndChannelConfigInfo ( ) const

◆ serializeTabAndChannelConfigInfo() [2/2]

void VP1TabManager::Imp::serializeTabAndChannelConfigInfo ( QMap< QString, QMultiMap< QString, ChanState > > & tab2channels,
QMap< QString, QByteArray > & tab2arrangements ) const

Definition at line 1000 of file VP1TabManager.cxx.

1001 {
1002
1003 tab2channels.clear();
1004 tab2arrangements.clear();
1005 for (int i = 0; i< tabwidget->count();++i) {
1006 QString tabname = tabwidget->tabText(i);
1007 assert(name_2_tab.find(tabname)!=name_2_tab.end());
1008 QMainWindow * tab = name_2_tab.find(tabname)->second;
1009 QMultiMap<QString,ChanState> channelsinfo;
1010 std::map<QMainWindow*,std::set<IVP1ChannelWidget*> >::const_iterator itcws=tab_2_channelwidgets.find(tab);
1011 assert(itcws!=tab_2_channelwidgets.end());
1012 std::set<IVP1ChannelWidget*>::const_iterator it = itcws->second.begin();
1013 std::set<IVP1ChannelWidget*>::const_iterator itE = itcws->second.end();
1014 for (;it!=itE;++it) {
1015 ChanState chanstate;
1016 tabmanager->serializeChannelState(*it,chanstate);
1017 channelsinfo.insert((*it)->name(),chanstate);
1018 }
1019 tab2channels.insert(tabname,channelsinfo);
1020
1021
1022 tab2arrangements.insert(tabname,tab->saveState(0/*version*/));
1023 }
1024}
QPair< QByteArray, QMultiMap< QString, QByteArray > > ChanState

Member Data Documentation

◆ channelmanager

VP1ChannelManager* VP1TabManager::Imp::channelmanager

Definition at line 64 of file VP1TabManager.cxx.

◆ channelwidget_2_dockwidget

std::map<IVP1ChannelWidget*,VP1DockWidget*> VP1TabManager::Imp::channelwidget_2_dockwidget

Definition at line 72 of file VP1TabManager.cxx.

◆ channelWithPendingRemoval

QString VP1TabManager::Imp::channelWithPendingRemoval

Definition at line 108 of file VP1TabManager.cxx.

◆ dontEmitVisibilityChanges

bool VP1TabManager::Imp::dontEmitVisibilityChanges

Definition at line 83 of file VP1TabManager.cxx.

◆ fullscreen_channelwidget

IVP1ChannelWidget* VP1TabManager::Imp::fullscreen_channelwidget

Definition at line 90 of file VP1TabManager.cxx.

◆ fullscreen_dockwidget

VP1DockWidget* VP1TabManager::Imp::fullscreen_dockwidget

Definition at line 89 of file VP1TabManager.cxx.

◆ fullscreen_floatingdocks

std::set<VP1DockWidget*> VP1TabManager::Imp::fullscreen_floatingdocks

Definition at line 95 of file VP1TabManager.cxx.

◆ fullscreen_tab

QMainWindow* VP1TabManager::Imp::fullscreen_tab

Definition at line 94 of file VP1TabManager.cxx.

◆ fullscreen_tabindex

int VP1TabManager::Imp::fullscreen_tabindex

Definition at line 93 of file VP1TabManager.cxx.

◆ fullscreen_tabname

QString VP1TabManager::Imp::fullscreen_tabname

Definition at line 92 of file VP1TabManager.cxx.

◆ lastsoonvisible

QSet<IVP1ChannelWidget*> VP1TabManager::Imp::lastsoonvisible

Definition at line 85 of file VP1TabManager.cxx.

◆ lastvisible

QSet<IVP1ChannelWidget*> VP1TabManager::Imp::lastvisible

Definition at line 84 of file VP1TabManager.cxx.

◆ name_2_tab

std::map<QString,QMainWindow *> VP1TabManager::Imp::name_2_tab

Definition at line 71 of file VP1TabManager.cxx.

◆ selecteddockwidget

VP1DockWidget* VP1TabManager::Imp::selecteddockwidget

Definition at line 87 of file VP1TabManager.cxx.

◆ tab_2_channelwidgets

std::map<QMainWindow*,std::set<IVP1ChannelWidget*> > VP1TabManager::Imp::tab_2_channelwidgets

Definition at line 73 of file VP1TabManager.cxx.

◆ tabcruisemode

bool VP1TabManager::Imp::tabcruisemode

Definition at line 103 of file VP1TabManager.cxx.

◆ tabmanager

VP1TabManager* VP1TabManager::Imp::tabmanager

Definition at line 62 of file VP1TabManager.cxx.

◆ tabwidget

VP1TabWidget* VP1TabManager::Imp::tabwidget

Definition at line 63 of file VP1TabManager.cxx.


The documentation for this class was generated from the following file: