Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4LoadedLibraries.ui.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 
00024 void TGo4LoadedLibraries::init()
00025 {
00026     RefreshLibs();
00027     UnloadLibBtn->hide();
00028 }
00029 
00030 void TGo4LoadedLibraries::LoadNewLibrary()
00031 {
00032   QFileDialog fd(this, "Load Library", TRUE );
00033   fd.setMode( QFileDialog::ExistingFiles);
00034   fd.setName( "Load Shared Library ");
00035   fd.setFilter( "Library (*.so)" );
00036 
00037   if ( fd.exec() != QDialog::Accepted ) return;
00038 
00039   QStringList list = fd.selectedFiles();
00040   QStringList::Iterator it = list.begin();
00041   while( it != list.end() ) {
00042      gSystem->Load((*it).latin1());
00043      ++it;
00044   }
00045 
00046   RefreshLibs();
00047 }
00048 
00049 void TGo4LoadedLibraries::UnloadLibrary()
00050 {
00051    QListViewItemIterator it(LoadedLibsD);
00052    for ( ; it.current(); ++it )
00053      if ( it.current()->isSelected() )
00054        gSystem->Unload(it.current()->text(0).latin1());
00055 
00056    RefreshLibs();
00057 }
00058 
00059 void TGo4LoadedLibraries::RefreshLibs()
00060 {
00061    char seps[]=" ,\t\n";
00062    char buffer[16];
00063 
00064    LoadedLibsD->clear();
00065    QString T = gInterpreter->GetSharedLibs();
00066 
00067    char* tokbuf = 0;
00068    char *token = strtok_r((char *)T.latin1(), seps, &tokbuf);
00069 
00070    while(token!=NULL) {
00071       QFileInfo fi(token);
00072       snprintf(buffer,15,"%d",fi.size());
00073       new QListViewItem(LoadedLibsD,token,QString(buffer),
00074                         fi.lastModified().toString(), fi.owner(), fi.group() );
00075       token = strtok_r(NULL, seps, &tokbuf);
00076    }
00077 
00078    LoadedLibsS->clear();
00079    QString T1 = gSystem->GetLinkedLibs();
00080 
00081    token =strtok_r((char *)T1.latin1(), seps, &tokbuf);
00082 
00083    while(token!=NULL) {
00084       new QListViewItem(LoadedLibsS,token);
00085       token = strtok_r(NULL, seps, &tokbuf);
00086    }
00087 }
00088 
00089 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:21 2008 for Go4-v3.04-1 by  doxygen 1.4.2