60 "ROOT files",
"*.root",
66 "C files",
"*.[C|c]*",
67 "ROOT files",
"*.root",
85 if (!p || !
main)
return;
87 fClient->GetColorByName(
"#F0FFF0", backgnd);
99 fListView->Connect(
"Clicked(TGLVEntry*, Int_t)",
"TNewChainDlg",
100 this,
"OnElementClicked(TGLVEntry* ,Int_t)");
109 fName->Resize(200,
fName->GetDefaultHeight());
110 fName->Associate(
this);
112 fName->ChangeBackground(backgnd);
116 AddFrame(
new TGLabel(
this,
"Double-click on the macro to be executed to create a new Chain:"),
125 gClient->GetColorByName(
"white",white);
141 fClient->GetDefaultRoot()->GetId(),
142 0, 0, ax, ay, wdummy);
143 Move(ax + 200, ay + 35);
221 while ((obj = (
TObject *)next())) {
224 const char *title = ((
TChain *)obj)->GetTitle();
226 ((
TChain *)obj)->SetTitle(
"TChain");
249 gSystem->ChangeDirectory(fname);
267 if (
name.Contains(
".C")) {
356 fChain = fQuery->fChain;
360 if (editmode && query)
362 else if (!editmode) {
381 fClient->GetDefaultRoot()->GetId(),
382 0, 0, ax, ay, wdummy);
425 fTxtChain->SetToolTipText(
"Specify TChain or TDSet from memory or file");
430 btnTmp->
Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBrowseChain()");
441 btnTmp->
Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBrowseSelector()");
446 fBtnMore->Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnNewQueryMore()");
490 btnTmp->
Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBrowseEventList()");
500 fTxtQueryName->Connect(
"TextChanged(char*)",
"TNewQueryDlg",
this,
501 "SettingsChanged()");
502 fTxtChain->Connect(
"TextChanged(char*)",
"TNewQueryDlg",
this,
503 "SettingsChanged()");
504 fTxtSelector->Connect(
"TextChanged(char*)",
"TNewQueryDlg",
this,
505 "SettingsChanged()");
506 fTxtOptions->Connect(
"TextChanged(char*)",
"TNewQueryDlg",
this,
507 "SettingsChanged()");
508 fNumEntries->Connect(
"ValueChanged(Long_t)",
"TNewQueryDlg",
this,
509 "SettingsChanged()");
510 fNumFirstEntry->Connect(
"ValueChanged(Long_t)",
"TNewQueryDlg",
this,
511 "SettingsChanged()");
512 fTxtEventList->Connect(
"TextChanged(char*)",
"TNewQueryDlg",
this,
513 "SettingsChanged()");
533 fBtnSave->Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBtnSaveClicked()");
534 fBtnSubmit->Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBtnSubmitClicked()");
537 fBtnClose->Connect(
"Clicked()",
"TNewQueryDlg",
this,
"OnBtnCloseClicked()");
571 dlg->
Connect(
"OnElementSelected(TObject *)",
"TNewQueryDlg",
572 this,
"OnElementSelected(TObject *)");
653 int e = 1, j = 0, idx = 0;
655 for (
int i=strlen(
name)-1;
i>0;
i--) {
656 if (isdigit(
name[
i])) {
678 newquery->fQueryName,
fViewer->GetQueryConPict(),
fViewer->GetQueryConPict());
680 fViewer->GetSessionHierarchy()->OpenItem(item);
681 fViewer->GetSessionHierarchy()->ClearHighlighted();
682 fViewer->GetSessionHierarchy()->HighlightItem(item2);
683 fViewer->GetSessionHierarchy()->SetSelected(item2);
684 fViewer->OnListTreeClicked(item2, 1, 0, 0);
707 fViewer->GetQueryFrame()->OnBtnSubmit();
718 "Do you wish to SAVE changes ?", 0,
875 fLocationURL->SetToolTipText(
"Enter location URL (i.e \"root://host//path/to/file.root\")");
880 fAddButton->SetToolTipText(
"Add file(s) to the list");
913 fRemoveButton->SetToolTipText(
"Remove selected file from the list");
932 fAppendFiles->SetToolTipText(
"Append files in DataSet");
936 fOverwriteDSet->Connect(
"Toggled(Bool_t)",
"TUploadDataSetDlg",
this,
937 "OnOverwriteDataset(Bool_t)");
939 "OnOverwriteFiles(Bool_t)");
940 fAppendFiles->Connect(
"Toggled(Bool_t)",
"TUploadDataSetDlg",
this,
941 "OnAppendFiles(Bool_t)");
958 if (
fViewer->GetActDesc()->fConnected &&
959 fViewer->GetActDesc()->fAttached &&
960 fViewer->GetActDesc()->fProof &&
961 fViewer->GetActDesc()->fProof->IsValid()) {
965 fDestinationURL->SetToolTipText(
"Enter destination URL ( relative to \" root://host//proofpool/user/ \" )");
976 fUploadButton->SetToolTipText(
"Upload the dataset to the cluster");
992 fClient->GetDefaultRoot()->GetId(),
993 0, 0, ax, ay, wdummy);
994 Move(ax + 250, ay + 200);
1077 if (strlen(fileName) < 5)
1079 if (strstr(fileName,
"*.")) {
1081 void *filesDir =
gSystem->OpenDirectory(
gSystem->GetDirName(fileName));
1086 while ((ent =
gSystem->GetDirEntry(filesDir))) {
1096 gClient->GetPicture(
"rootdb_t.xpm"));
1107 gClient->GetPicture(
"rootdb_t.xpm"));
1123 TIter next(fileList);
1132 gClient->GetPicture(
"rootdb_t.xpm"));
1216 const char *dsetName =
fDSetName->GetText();
1223 if (!
fViewer->GetActDesc()->fConnected ||
1224 !
fViewer->GetActDesc()->fAttached ||
1225 !
fViewer->GetActDesc()->fProof ||
1226 !
fViewer->GetActDesc()->fProof->IsValid()) {
1245 flags &=
~TProof::kNoOverwriteDataSet;
1262 if (strlen(destination) < 2) destination = 0;
1268 ret =
fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1269 datasetFiles, destination, flags, skippedFiles);
1271 if (ret == TProof::kDataSetExists) {
1275 TString::Format(
"The dataset \"%s\" already exists on the cluster ! Overwrite ?",
1279 ret =
fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1280 datasetFiles, destination,
1286 ret =
fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1287 datasetFiles, destination,
1297 "Failed uploading dataset/files to the cluster",
1305 if (skippedFiles->
GetSize()) {
1306 TIter nexts(skippedFiles);
1311 TString::Format(
"The file \"%s\" already exists on the cluster ! Overwrite ?",
1315 ret =
fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1316 skippedFiles, destination,
1328 "Files have been successfully uploaded to the cluster",
1341 ret =
fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1342 obj->GetFirstUrl()->GetUrl(), destination,
1353 "Files have been successfully uploaded to the cluster",
1358 skippedFiles->
Clear();
1362 "Files have been successfully uploaded to the cluster",
1368 fViewer->GetSessionFrame()->UpdateListOfDataSets();
Handle_t Window_t
Window handle.
ULong_t Pixel_t
Pixel value.
static const char * gFileTypes[]
R__EXTERN TApplication * gApplication
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
Option_t Option_t TPoint TPoint const char text
static const char * gDatasetTypes[]
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
int main(int argc, char *argv[])
A chain is a collection of files containing TTree objects.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class implements a data set to be used for PROOF processing.
Class describing a generic file including meta information.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
This class creates a file selection dialog.
TList * fFileNamesList
list of selected file names
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
if true, allow multiple file selection
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual void SetMinWidth(UInt_t w)
void MapWindow() override
map window
void Move(Int_t x, Int_t y) override
Move frame.
virtual void DeleteWindow()
Delete window.
virtual UInt_t GetOptions() const
A composite frame with a border and a title.
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
virtual void SetPictures(const TGPicture *bigpic=nullptr, const TGPicture *smallpic=nullptr)
change pictures
const char * GetTitle() const override
Returns title of object.
void * GetUserData() const
void SetUserData(void *userData)
This class handles GUI labels.
This class describes layout hints used by the layout classes.
virtual void SetUserData(void *, Bool_t=kFALSE)
A list view is a widget that can contain a number of items arranged in a grid or list.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
TGNumberEntry is a number entry input widget with up/down buttons.
TGClient * fClient
Connection to display server.
This class describes layout hints used by the TGTableLayout class.
A layout manager, which places child frames in a table arranged in rows and columns,...
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
TGTransientFrame(const TGTransientFrame &)=delete
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
~TNewChainDlg() override
Delete chain dialog.
virtual void OnDoubleClick(TGLVEntry *, Int_t)
Handle double click in the File container.
TGTextButton * fCancelButton
TNewChainDlg(const TGWindow *p=nullptr, const TGWindow *main=nullptr)
Create a new chain dialog box.
void OnElementSelected(TObject *obj)
Emits OnElementSelected signal if dset is not zero.
void CloseWindow() override
Close file dialog.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for new chain dialog.
TGLVContainer * fLVContainer
void UpdateList()
Update Memory list view.
TGFileContainer * fContents
virtual void DisplayDirectory(const TString &fname)
Display content of directory.
void OnElementClicked(TGLVEntry *entry, Int_t btn)
Handle click in the Memory list view and put the type and name of selected object in the text entry.
void UpdateFields(TQueryDescription *desc)
Update entry fields with query description values.
void OnElementSelected(TObject *obj)
Handle OnElementSelected signal coming from new chain dialog.
void OnBtnSubmitClicked()
Save and submit query description.
TNewQueryDlg(TSessionViewer *gui, Int_t Width, Int_t Height, TQueryDescription *query=nullptr, Bool_t editmode=kFALSE)
Create a new Query dialog, used by the Session Viewer, to Edit a Query if the editmode flag is set,...
TGTextEntry * fTxtEventList
TGCompositeFrame * fFrmNewQuery
TGTextEntry * fTxtOptions
void OnBtnSaveClicked()
Save current settings in main session viewer.
TQueryDescription * fQuery
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for new query dialog.
void OnBtnCloseClicked()
Close dialog.
void CloseWindow() override
Called when window is closed via the window manager.
~TNewQueryDlg() override
Delete query dialog.
void SettingsChanged()
Settings have changed, update GUI accordingly.
TGTextButton * fBtnSubmit
void Popup()
Display dialog and set focus to query name text entry.
void OnBrowseSelector()
Open file browser to choose selector macro.
TGNumberEntry * fNumFirstEntry
TGCompositeFrame * fFrmMore
TGTextEntry * fTxtQueryName
void OnBrowseChain()
Call new chain dialog.
TGNumberEntry * fNumEntries
void Build(TSessionViewer *gui)
Build the "new query" dialog.
void OnNewQueryMore()
Show/hide options frame and update button text accordingly.
TGTextEntry * fTxtSelector
void OnBrowseEventList()
Browse event list.
Collectable string class.
const TString & GetString() const
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t IsZombie() const
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const
This class controls a Parallel ROOT Facility, PROOF, cluster.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
ESessionQueryStatus fStatus
Regular expression class.
Widget used to manage PROOF or local sessions, PROOF connections, queries construction and results ha...
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void ClearFiles()
Clear content of the list view.
TUploadDataSetDlg(TSessionViewer *gui, Int_t w, Int_t h)
Create a Upload DataSet dialog box. Used to create and upload a dataset.
void OnAppendFiles(Bool_t on)
Notification of Append Files check button.
~TUploadDataSetDlg() override
Delete chain dialog.
void RemoveFile()
Remove the selected entry from the list view.
void BrowseFiles()
Opens the TGFileDialog to allow user to select local file(s) to be added in the list view of dataset ...
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for upload dataset dialog.
void CloseWindow() override
Close upload dataset dialog.
void UploadDataSet()
Upload the dataset to the server.
void OnOverwriteDataset(Bool_t on)
Notification of Overwrite Dataset check button.
TGLVContainer * fLVContainer
TGTextButton * fRemoveButton
TGTextButton * fUploadButton
TGTextEntry * fLocationURL
TGCheckButton * fOverwriteDSet
TGTextEntry * fDestinationURL
TGTextButton * fAddButton
TGTextButton * fCloseDlgButton
TGTextButton * fBrowseButton
TGCheckButton * fOverwriteFiles
void OnOverwriteFiles(Bool_t on)
Notification of Overwrite Files check button.
TGTextButton * fClearButton
void AddFiles(const char *fileName)
Add File name(s) from the file location URL to the list view.
TGCheckButton * fAppendFiles