Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSessionDialogs.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Marek Biskup, Jakub Madejczyk, Bertrand Bellenot 10/08/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13/** \class TSessionDialogs
14 \ingroup sessionviewer
15
16This file defines several dialogs that are used by TSessionViewer.
17The following dialogs are available: TNewChainDlg and TNewQueryDlg.
18
19*/
20
21
22#include "TSessionDialogs.h"
23#include "TSessionViewer.h"
24#include "TROOT.h"
25#include "TSystem.h"
26#include "TGButton.h"
27#include "TList.h"
28#include "TChain.h"
29#include "TDSet.h"
30#include "TGTextEntry.h"
31#include "TGTextBuffer.h"
32#include "TGNumberEntry.h"
33#include "TGLabel.h"
34#include "TGListView.h"
35#include "TGFSContainer.h"
36#include "TGFileDialog.h"
37#include "TGListTree.h"
38#include "TInterpreter.h"
39#include "TApplication.h"
40#include "TObjString.h"
41#include "TGTableLayout.h"
42#include "TProof.h"
43#include "TFileInfo.h"
44#include "TGMsgBox.h"
45#include "TRegexp.h"
46#include "TVirtualX.h"
47
50
51/* not yet used
52static const char *gParTypes[] = {
53 "Par files", "*.par",
54 "All files", "*",
55 0, 0
56};
57*/
58
59static const char *gDatasetTypes[] = {
60 "ROOT files", "*.root",
61 "All files", "*",
62 0, 0
63};
64
65static const char *gFileTypes[] = {
66 "C files", "*.[C|c]*",
67 "ROOT files", "*.root",
68 "All files", "*",
69 0, 0
70};
71
72//////////////////////////////////////////////////////////////////////////
73// New Chain Dialog
74//////////////////////////////////////////////////////////////////////////
75
76////////////////////////////////////////////////////////////////////////////////
77/// Create a new chain dialog box. Used to list chains present in memory
78/// and offers the possibility to create new ones by executing macros
79/// directly from the associate file container.
80
83{
84 Pixel_t backgnd;
85 if (!p || !main) return;
87 fClient->GetColorByName("#F0FFF0", backgnd);
88 AddFrame(new TGLabel(this, new TGHotString("List of Chains in Memory :")),
89 new TGLayoutHints(kLHintsLeft, 5, 5, 7, 2) );
90
91 // Add TGListView used to show objects in memory
92 fListView = new TGListView(this, 300, 100);
98
99 fListView->Connect("Clicked(TGLVEntry*, Int_t)", "TNewChainDlg",
100 this, "OnElementClicked(TGLVEntry* ,Int_t)");
101
102 // Add text entry showing type and name of user's selection
103 TGCompositeFrame* frmSel = new TGHorizontalFrame(this, 300, 100);
104 frmSel->SetCleanup(kDeepCleanup);
105 frmSel->AddFrame(new TGLabel(frmSel, new TGHotString("Selected chain :")),
106 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 5, 5) );
107 fNameBuf = new TGTextBuffer(100);
108 fName = new TGTextEntry(frmSel, fNameBuf);
110 fName->Associate(this);
112 fName->ChangeBackground(backgnd);
114 AddFrame(frmSel, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
115
116 AddFrame(new TGLabel(this, "Double-click on the macro to be executed to create a new Chain:"),
117 new TGLayoutHints(kLHintsCenterX, 5, 5, 5, 2));
118
119 // Add TGListview / TGFileContainer to allow user to execute Macros
120 // for the creation of new TChains / TDSets
121 TGListView* lv = new TGListView(this, 300, 100);
123
124 Pixel_t white;
125 gClient->GetColorByName("white",white);
128 fContents->SetFilter("*.[C|c]*");
130 fContents->Associate(this);
133 fContents->AddFile(".."); // up level directory
134 fContents->Resize();
135 fContents->StopRefreshTimer(); // stop refreshing
136
137 // position relative to the parent's window
138 Window_t wdummy;
139 Int_t ax, ay;
140 gVirtualX->TranslateCoordinates( main->GetId(),
142 0, 0, ax, ay, wdummy);
143 Move(ax + 200, ay + 35);
144
145 TGCompositeFrame *tmp;
146 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
149 // Apply and Close buttons
150 tmp->AddFrame(fOkButton = new TGTextButton(tmp, "&Ok", 0),
151 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
152 tmp->AddFrame(fCancelButton = new TGTextButton(tmp, "&Cancel", 1),
153 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
154 fOkButton->Associate(this);
157
158 SetWindowName("Chain Selection Dialog");
160 Layout();
162 MapWindow();
163 UpdateList();
164}
165
166////////////////////////////////////////////////////////////////////////////////
167/// Delete chain dialog.
168
170{
171 if (IsZombie()) return;
172 delete fLVContainer;
173 delete fContents;
174 Cleanup();
175}
176
177////////////////////////////////////////////////////////////////////////////////
178/// Emits OnElementSelected signal if dset is not zero.
179
181{
182 if (obj && (obj->IsA() == TChain::Class() ||
183 obj->IsA() == TDSet::Class())) {
184 Emit("OnElementSelected(TObject *)", (Longptr_t)obj);
185 }
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Handle click in the Memory list view and put the type
190/// and name of selected object in the text entry.
191
193{
194 fChain = (TObject *)entry->GetUserData();
195 if (fChain->IsA() == TChain::Class()) {
196 TString s = TString::Format("%s : %s" , ((TChain *)fChain)->GetTitle(),
197 ((TChain *)fChain)->GetName());
198 fName->SetText(s);
199 }
200 else if (fChain->IsA() == TDSet::Class()) {
201 TString s = TString::Format("%s : %s" , ((TDSet *)fChain)->GetName(),
202 ((TDSet *)fChain)->GetObjName());
203 fName->SetText(s);
204 }
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Update Memory list view.
210
212{
213 TGLVEntry *item=0;
214 TObject *obj = 0;
215 fChains = gROOT->GetListOfDataSets();
217 if (!fChains) return;
218 TIter next(fChains);
219 // loop on the list of chains/datasets in memory,
220 // and fill the associated listview
221 while ((obj = (TObject *)next())) {
222 item = 0;
223 if (obj->IsA() == TChain::Class()) {
224 const char *title = ((TChain *)obj)->GetTitle();
225 if (!title[0])
226 ((TChain *)obj)->SetTitle("TChain");
227 item = new TGLVEntry(fLVContainer, ((TChain *)obj)->GetName(),
228 ((TChain *)obj)->GetTitle());
229 }
230 else if (obj->IsA() == TDSet::Class()) {
231 item = new TGLVEntry(fLVContainer, ((TDSet *)obj)->GetObjName(),
232 ((TDSet *)obj)->GetName());
233 }
234 if (item) {
235 item->SetUserData(obj);
236 fLVContainer->AddItem(item);
237 }
238 }
240 Resize();
241}
242
243////////////////////////////////////////////////////////////////////////////////
244/// Display content of directory.
245
247{
249 gSystem->ChangeDirectory(fname);
252 fContents->AddFile(".."); // up level directory
253 Resize();
254}
255
256////////////////////////////////////////////////////////////////////////////////
257/// Handle double click in the File container.
258
260{
261 if (btn!=kButton1) return;
262 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kWatch));
263
264 TString name(f->GetTitle());
265
266 // Check if the file is a root macro file type
267 if (name.Contains(".C")) {
268 // form the command
269 TString command = TString::Format(".x %s/%s",
271 name.Data());
272 // and process
273 gApplication->ProcessLine(command.Data());
274 UpdateList();
275 } else {
276 // if double clicked on a directory, then display it
278 }
279 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kPointer));
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Process messages for new chain dialog.
284
286{
287 switch (GET_MSG(msg)) {
288 case kC_COMMAND:
289 switch (GET_SUBMSG(msg)) {
290 case kCM_BUTTON:
291 switch (parm1) {
292
293 case 0:
294 // Apply button
297 DeleteWindow();
298 break;
299
300 case 1:
301 // Close button
302 fChain = 0;
303 DeleteWindow();
304 break;
305 }
306 break;
307 default:
308 break;
309 }
310 break;
311
312 case kC_CONTAINER:
313 switch (GET_SUBMSG(msg)) {
314 case kCT_ITEMDBLCLICK:
315 if (parm1==kButton1) {
316 TGLVEntry *lv_entry = (TGLVEntry *)fContents->GetLastActive();
317 if (lv_entry) OnDoubleClick(lv_entry, parm1);
318 }
319 break;
320 }
321 break;
322 default:
323 break;
324 }
325 return kTRUE;
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Close file dialog.
330
332{
333 DeleteWindow();
334}
335
336
337//////////////////////////////////////////////////////////////////////////
338// New Query Dialog
339//////////////////////////////////////////////////////////////////////////
340
341////////////////////////////////////////////////////////////////////////////////
342/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
343/// the editmode flag is set, or to create a new one if not set.
344
346 TQueryDescription *query, Bool_t editmode) :
347 TGTransientFrame(gClient->GetRoot(), gui, Width, Height)
348{
349 Window_t wdummy;
350 Int_t ax, ay;
351 fEditMode = editmode;
353 fChain = 0;
354 fQuery = query;
355 if (fQuery && fQuery->fChain) {
357 }
358 Build(gui);
359 // if in edit mode, update fields with query description data
360 if (editmode && query)
361 UpdateFields(query);
362 else if (!editmode) {
363 TQueryDescription *fquery;
365 if(fquery)
367 else
368 fTxtQueryName->SetText("Query 1");
369 }
371 Resize(Width, Height);
372 // hide options frame
374 fBtnMore->SetText(" More >> ");
375 SetWMSizeHints(Width+5, Height+25, Width+5, Height+25, 1, 1);
377 Layout();
378 SetWindowName("Query Dialog");
379 // Position relative to parent
380 gVirtualX->TranslateCoordinates( fViewer->GetId(),
382 0, 0, ax, ay, wdummy);
383 Move(ax + fViewer->GetWidth()/2, ay + 35);
384}
385
386////////////////////////////////////////////////////////////////////////////////
387/// Delete query dialog.
388
390{
391 if (IsZombie()) return;
392 Cleanup();
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Build the "new query" dialog.
397
399{
400 TGButton* btnTmp;
401 fViewer = gui;
404 SetMinWidth(500);
405 fFrmNewQuery = new TGGroupFrame(this, "New Query");
407
409 kLHintsExpandY, 2, 2, 2, 2));
411
412 // add "Query Name" label and text entry
413 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Query Name :"),
414 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 4, 0));
416 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
417 kLHintsCenterY, 5, 5, 4, 0));
418
419 // add "TChain" label and text entry
420 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "TChain :"),
421 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 4, 0));
423 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
424 kLHintsCenterY, 5, 5, 4, 0));
425 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
427 // add "Browse" button
428 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
429 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
430 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseChain()");
431
432 // add "Selector" label and text entry
433 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Selector :"),
434 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
436 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
437 kLHintsCenterY, 5, 5, 0, 0));
438 // add "Browse" button
439 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
440 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
441 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseSelector()");
442
443 // add "Less <<" ("More >>") button
445 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
446 fBtnMore->Connect("Clicked()", "TNewQueryDlg", this, "OnNewQueryMore()");
447
448 // add (initially hidden) options frame
449 fFrmMore = new TGCompositeFrame(fFrmNewQuery, 200, 200);
451
455
456 // add "Options" label and text entry
457 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
458 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 0, 0));
460 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 22,
461 0, 0, 8));
462 fTxtOptions->SetText("ASYN");
463
464 // add "Nb Entries" label and number entry
465 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
466 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 0, 0));
470 0, 22, 0, 0, 8));
471 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
473 // add "First Entry" label and number entry
474 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
475 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
479 22, 0, 0, 8));
480
481 // add "Event list" label and text entry
482 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
483 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 0, 5, 0, 0));
485 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 22,
486 5, 0, 0));
487 // add "Browse" button
488 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
489 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
490 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseEventList()");
491
493 fTxtChain->Associate(this);
494 fTxtSelector->Associate(this);
495 fTxtOptions->Associate(this);
496 fNumEntries->Associate(this);
499
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()");
514
515 TGCompositeFrame *tmp;
516 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
519 // Add "Save" and "Save & Submit" buttons if we are in edition mode
520 // or "Add" and "Add & Submit" if we are not in edition mode.
521 if (fEditMode) {
522 fBtnSave = new TGTextButton(tmp, "Save");
523 fBtnSubmit = new TGTextButton(tmp, "Save && Submit");
524 }
525 else {
526 fBtnSave = new TGTextButton(tmp, "Add");
527 fBtnSubmit = new TGTextButton(tmp, "Add && Submit");
528 }
530 3, 3, 3, 3));
532 3, 3, 3, 3));
533 fBtnSave->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSaveClicked()");
534 fBtnSubmit->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSubmitClicked()");
535 tmp->AddFrame(fBtnClose = new TGTextButton(tmp, "Close"),
536 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 3, 3, 3, 3));
537 fBtnClose->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnCloseClicked()");
540}
541
542////////////////////////////////////////////////////////////////////////////////
543/// Called when window is closed via the window manager.
544
546{
547 DeleteWindow();
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Show/hide options frame and update button text accordingly.
552
554{
557 fBtnMore->SetText(" More >> ");
558 }
559 else {
561 fBtnMore->SetText(" Less << ");
562 }
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// Call new chain dialog.
567
569{
570 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
571 dlg->Connect("OnElementSelected(TObject *)", "TNewQueryDlg",
572 this, "OnElementSelected(TObject *)");
573}
574
575////////////////////////////////////////////////////////////////////////////////
576/// Handle OnElementSelected signal coming from new chain dialog.
577
579{
580 if (obj) {
581 fChain = obj;
582 if (obj->IsA() == TChain::Class())
584 else if (obj->IsA() == TDSet::Class())
585 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
586 }
587}
588
589////////////////////////////////////////////////////////////////////////////////
590/// Open file browser to choose selector macro.
591
593{
594 TGFileInfo fi;
596 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
597 if (!fi.fFilename) return;
599}
600
601////////////////////////////////////////////////////////////////////////////////
602///Browse event list
603
605{
606}
607
608////////////////////////////////////////////////////////////////////////////////
609/// Save current settings in main session viewer.
610
612{
613 // if we are in edition mode and query description is valid,
614 // use it, otherwise create a new one
615 TQueryDescription *newquery;
616 if (fEditMode && fQuery)
617 newquery = fQuery;
618 else
619 newquery = new TQueryDescription();
620
621 // update query description fields
622 newquery->fSelectorString = fTxtSelector->GetText();
623 if (fChain) {
624 newquery->fTDSetString = fChain->GetName();
625 newquery->fChain = fChain;
626 }
627 else {
628 newquery->fTDSetString = "";
629 newquery->fChain = 0;
630 }
631 newquery->fQueryName = fTxtQueryName->GetText();
632 newquery->fOptions.Form("%s",fTxtOptions->GetText());
633 newquery->fNoEntries = fNumEntries->GetIntNumber();
635 newquery->fNbFiles = 0;
636 newquery->fResult = 0;
637
638 if (newquery->fChain) {
639 if (newquery->fChain->IsA() == TChain::Class())
640 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
641 else if (newquery->fChain->IsA() == TDSet::Class())
642 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
643 }
644 if (!fEditMode) {
645 // if not in editor mode, create a new list tree item
646 // and set user data to the newly created query description
647 newquery->fResult = 0;
649
650 TQueryDescription *fquery;
652 while (fquery) {
653 int e = 1, j = 0, idx = 0;
654 const char *name = fquery->fQueryName;
655 for (int i=strlen(name)-1;i>0;i--) {
656 if (isdigit(name[i])) {
657 idx += (name[i]-'0') * e;
658 e *= 10;
659 j++;
660 }
661 else
662 break;
663 }
664 if (idx > 0) {
665 idx++;
666 newquery->fQueryName.Remove(strlen(name)-j,j);
667 newquery->fQueryName.Append(Form("%d",idx));
668 }
669 else
670 newquery->fQueryName.Append(" 1");
672 }
673 fTxtQueryName->SetText(newquery->fQueryName);
674 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
679 item2->SetUserData(newquery);
684 fViewer->OnListTreeClicked(item2, 1, 0, 0);
685 }
686 else {
687 // else if in editor mode, just update user data with modified
688 // query description
691 item->SetUserData(newquery);
692 }
693 // update list tree
699}
700
701////////////////////////////////////////////////////////////////////////////////
702/// Save and submit query description.
703
705{
708}
709
710////////////////////////////////////////////////////////////////////////////////
711/// Close dialog.
712
714{
716 if (fModified) {
717 new TGMsgBox(fClient->GetRoot(), this, "Modified Settings",
718 "Do you wish to SAVE changes ?", 0,
720 if (result == kMBYes) {
722 }
723 }
724 if (result == kMBNo) {
725 DeleteWindow();
726 }
727}
728
729////////////////////////////////////////////////////////////////////////////////
730/// Display dialog and set focus to query name text entry.
731
733{
734 MapWindow();
736}
737
738////////////////////////////////////////////////////////////////////////////////
739/// Settings have changed, update GUI accordingly.
740
742{
743 if (fEditMode && fQuery) {
744 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
745 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
746 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
749 (fQuery->fChain != fChain)) {
751 }
752 else {
754 }
755 }
756 else {
757 if ((fTxtQueryName->GetText()) &&
758 ((fTxtQueryName->GetText()) ||
759 (fTxtChain->GetText())))
761 else
763 }
764 if (fModified) {
767 }
768 else {
771 }
772}
773
774////////////////////////////////////////////////////////////////////////////////
775/// Update entry fields with query description values.
776
778{
779 fQuery = desc;
781 fTxtChain->SetText("");
782 if (desc->fChain)
789}
790////////////////////////////////////////////////////////////////////////////////
791/// Process messages for new query dialog.
792/// Essentially used to navigate between text entry fields.
793
795{
796 switch (GET_MSG(msg)) {
797 case kC_TEXTENTRY:
798 switch (GET_SUBMSG(msg)) {
799 case kTE_ENTER:
800 case kTE_TAB:
801 switch (parm1) {
802 case 1: // Query Name
805 break;
806 case 2: // Chain Name
809 break;
810 case 3: // Selector Name
813 break;
814 case 4: // Options
817 break;
818 case 6: // Event List
821 break;
822 }
823 break;
824
825 default:
826 break;
827 }
828 break;
829
830 default:
831 break;
832 }
833 return kTRUE;
834}
835
836//////////////////////////////////////////////////////////////////////////
837// Upload DataSet Dialog
838//////////////////////////////////////////////////////////////////////////
839
840////////////////////////////////////////////////////////////////////////////////
841/// Create a Upload DataSet dialog box. Used to create and upload a dataset
842
844 TGTransientFrame(gClient->GetRoot(), gui, w, h)
845{
847 if (!gui) return;
848 fViewer = gui;
849
851 TGHorizontalFrame *hFrame1 = new TGHorizontalFrame(this);
852 hFrame1->SetCleanup(kDeepCleanup);
853 hFrame1->AddFrame(new TGLabel(hFrame1,"Name of DataSet :"),
855 10, 10, 5, 5));
856 fDSetName = new TGTextEntry(hFrame1, new TGTextBuffer(50));
857 fDSetName->SetText("DataSet1");
860 10, 10, 5, 5));
862 2, 2, 2, 2));
863
864 // "DataSet Files" group frame
865 TGGroupFrame *groupFrame1 = new TGGroupFrame(this, "DataSet Files");
866 groupFrame1->SetCleanup(kDeepCleanup);
867
868 // horizontal frame for files location URL
869 TGHorizontalFrame *hFrame11 = new TGHorizontalFrame(groupFrame1);
870 hFrame11->SetCleanup(kDeepCleanup);
871 hFrame11->AddFrame(new TGLabel(hFrame11,"Location URL :"),
873 10, 10, 5, 5));
874 fLocationURL = new TGTextEntry(hFrame11, new TGTextBuffer(150));
875 fLocationURL->SetToolTipText("Enter location URL (i.e \"root://host//path/to/file.root\")");
878 kLHintsCenterY, 10, 10, 5, 5));
879 fAddButton = new TGTextButton(hFrame11, " Add >> ", 0);
880 fAddButton->SetToolTipText("Add file(s) to the list");
881 fAddButton->Associate(this);
883 kLHintsExpandX, 5, 10, 5, 5));
884 groupFrame1->AddFrame(hFrame11, new TGLayoutHints(kLHintsLeft | kLHintsTop |
885 kLHintsExpandX, 2, 2, 2, 2));
886 // horizontal frame for the list view displaying list of files
887 // and for a vertical frame with control buttons
888 TGHorizontalFrame *hFrame2 = new TGHorizontalFrame(groupFrame1);
889 hFrame2->SetCleanup(kDeepCleanup);
890
891 // list view
892 // Add TGListView used to show list of files
893 fListView = new TGListView(hFrame2, 300, 100);
899 fLVContainer->SetHeader("File Name", kTextLeft, kTextLeft , 0);
901 kLHintsExpandX | kLHintsExpandY, 2, 2, 10, 10));
902
903 // vertical frame for control buttons
904 TGVerticalFrame *vFrame1 = new TGVerticalFrame(hFrame2);
905 vFrame1->SetCleanup(kDeepCleanup);
906
907 fBrowseButton = new TGTextButton(vFrame1, " Browse... ", 1);
908 fBrowseButton->SetToolTipText("Add file(s) to the list");
911 kLHintsExpandX, 15, 5, 5, 5));
912 fRemoveButton = new TGTextButton(vFrame1, " Remove ", 2);
913 fRemoveButton->SetToolTipText("Remove selected file from the list");
916 kLHintsExpandX, 15, 5, 5, 5));
917 fClearButton = new TGTextButton(vFrame1, " Clear ", 3);
918 fClearButton->SetToolTipText("Clear list of files");
919 fClearButton->Associate(this);
921 kLHintsExpandX, 15, 5, 5, 5));
922
923 fOverwriteDSet = new TGCheckButton(vFrame1, "Overwrite DataSet");
924 fOverwriteDSet->SetToolTipText("Overwrite DataSet");
926 kLHintsExpandX, 15, 5, 5, 5));
927 fOverwriteFiles = new TGCheckButton(vFrame1, "Overwrite Files");
928 fOverwriteFiles->SetToolTipText("Overwrite files in DataSet");
930 kLHintsExpandX, 15, 5, 5, 5));
931 fAppendFiles = new TGCheckButton(vFrame1, "Append Files");
932 fAppendFiles->SetToolTipText("Append files in DataSet");
934 kLHintsExpandX, 15, 5, 5, 5));
935
936 fOverwriteDSet->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
937 "OnOverwriteDataset(Bool_t)");
938 fOverwriteFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
939 "OnOverwriteFiles(Bool_t)");
940 fAppendFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
941 "OnAppendFiles(Bool_t)");
942
943 hFrame2->AddFrame(vFrame1, new TGLayoutHints(kLHintsRight | kLHintsTop |
944 kLHintsExpandY, 2, 2, 2, 2));
945 groupFrame1->AddFrame(hFrame2, new TGLayoutHints(kLHintsLeft | kLHintsTop |
946 kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2));
947
948 AddFrame(groupFrame1, new TGLayoutHints(kLHintsLeft | kLHintsTop |
949 kLHintsExpandX, 5, 5, 2, 2));
950
951 // horizontal frame for destination URL
952 TGHorizontalFrame *hFrame3 = new TGHorizontalFrame(this);
953 hFrame3->SetCleanup(kDeepCleanup);
954 hFrame3->AddFrame(new TGLabel(hFrame3,"Destination URL :"),
956 15, 10, 5, 5));
957 fDestinationURL = new TGTextEntry(hFrame3, new TGTextBuffer(150));
958 if (fViewer->GetActDesc()->fConnected &&
962 // const char *dest = fViewer->GetActDesc()->fProof->GetDataPoolUrl();
963 // fDestinationURL->SetText(dest);
964 }
965 fDestinationURL->SetToolTipText("Enter destination URL ( relative to \" root://host//proofpool/user/ \" )");
968 kLHintsCenterY, 10, 15, 5, 5));
970 2, 2, 2, 2));
971
972 // horizontal frame for upload and close buttons
973 TGHorizontalFrame *hFrame4 = new TGHorizontalFrame(this);
974 hFrame4->SetCleanup(kDeepCleanup);
975 fUploadButton = new TGTextButton(hFrame4, "Upload DataSet", 10);
976 fUploadButton->SetToolTipText("Upload the dataset to the cluster");
979 kLHintsExpandX, 15, 15, 2, 2));
980 fCloseDlgButton = new TGTextButton(hFrame4, "Close Dialog", 11);
981 fCloseDlgButton->SetToolTipText("Close the dialog");
984 kLHintsExpandX, 15, 15, 2, 2));
986 2, 2, 2, 2));
987
988 // position relative to the parent's window
989 Window_t wdummy;
990 Int_t ax, ay;
991 gVirtualX->TranslateCoordinates( gui->GetId(),
993 0, 0, ax, ay, wdummy);
994 Move(ax + 250, ay + 200);
995
996 SetWindowName("Upload DataSet Dialog");
998 MapWindow();
999
1000 Resize(w, h);
1001 SetWMSizeHints(w+5, h+5, w+5, h+5, 1, 1);
1003 Layout();
1004}
1005
1006////////////////////////////////////////////////////////////////////////////////
1007/// Delete chain dialog.
1008
1010{
1011 if (IsZombie()) return;
1012 Cleanup();
1013}
1014
1015////////////////////////////////////////////////////////////////////////////////
1016/// Close upload dataset dialog.
1017
1019{
1020 if (!fUploading)
1021 DeleteWindow();
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Process messages for upload dataset dialog.
1026
1028{
1029 switch (GET_MSG(msg)) {
1030 case kC_COMMAND:
1031 switch (GET_SUBMSG(msg)) {
1032 case kCM_BUTTON:
1033 switch (parm1) {
1034 case 0:
1035 // Add button
1036 if (fLocationURL->GetText())
1038 break;
1039 case 1:
1040 // Add button
1041 BrowseFiles();
1042 break;
1043 case 2:
1044 // Remove button
1045 RemoveFile();
1046 break;
1047 case 3:
1048 // Clear button
1049 ClearFiles();
1050 break;
1051 case 10:
1052 // Upload button
1053 UploadDataSet();
1054 break;
1055 case 11:
1056 // Close button
1057 CloseWindow();
1058 break;
1059 }
1060 break;
1061 default:
1062 break;
1063 }
1064 break;
1065
1066 default:
1067 break;
1068 }
1069 return kTRUE;
1070}
1071
1072////////////////////////////////////////////////////////////////////////////////
1073/// Add File name(s) from the file location URL to the list view.
1074
1075void TUploadDataSetDlg::AddFiles(const char *fileName)
1076{
1077 if (strlen(fileName) < 5)
1078 return;
1079 if (strstr(fileName,"*.")) {
1080 // wildcarding case
1081 void *filesDir = gSystem->OpenDirectory(gSystem->GetDirName(fileName));
1082 const char* ent;
1083 TString filesExp(gSystem->BaseName(fileName));
1084 filesExp.ReplaceAll("*",".*");
1085 TRegexp rg(filesExp);
1086 while ((ent = gSystem->GetDirEntry(filesDir))) {
1087 TString entryString(ent);
1088 if (entryString.Index(rg) != kNPOS &&
1089 gSystem->AccessPathName(Form("%s/%s", gSystem->GetDirName(fileName).Data(),
1090 ent), kReadPermission) == kFALSE) {
1091 TString text = TString::Format("%s/%s",
1092 gSystem->UnixPathName(gSystem->GetDirName(fileName)), ent);
1093 if (!fLVContainer->FindItem(text.Data())) {
1094 TGLVEntry *entry = new TGLVEntry(fLVContainer, text.Data(), text.Data());
1095 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1096 gClient->GetPicture("rootdb_t.xpm"));
1097 fLVContainer->AddItem(entry);
1098 }
1099 }
1100 }
1101 }
1102 else {
1103 // single file
1104 if (!fLVContainer->FindItem(fileName)) {
1105 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName, fileName);
1106 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1107 gClient->GetPicture("rootdb_t.xpm"));
1108 fLVContainer->AddItem(entry);
1109 }
1110 }
1111 // update list view
1113 fListView->Layout();
1115}
1116
1117////////////////////////////////////////////////////////////////////////////////
1118/// Add File name(s) from the file location URL to the list view.
1119
1121{
1122 TObjString *el;
1123 TIter next(fileList);
1124 while ((el = (TObjString *) next())) {
1125 TString fileName = TString::Format("%s/%s",
1127 gSystem->BaseName(el->GetString()));
1128 // single file
1129 if (!fLVContainer->FindItem(fileName.Data())) {
1130 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName.Data(), fileName.Data());
1131 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1132 gClient->GetPicture("rootdb_t.xpm"));
1133 fLVContainer->AddItem(entry);
1134 }
1135 }
1136 // update list view
1138 fListView->Layout();
1140}
1141
1142////////////////////////////////////////////////////////////////////////////////
1143/// Opens the TGFileDialog to allow user to select local file(s) to be added
1144/// in the list view of dataset files.
1145
1147{
1148 TGFileInfo fi;
1150 fi.SetFilename("*.root");
1151 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
1152 if (fi.fMultipleSelection && fi.fFileNamesList) {
1154 }
1155 else if (fi.fFilename) {
1156 AddFiles(fi.fFilename);
1157 }
1158}
1159
1160////////////////////////////////////////////////////////////////////////////////
1161/// Clear content of the list view.
1162
1164{
1166 fListView->Layout();
1167 // update list view
1169}
1170
1171////////////////////////////////////////////////////////////////////////////////
1172/// Notification of Overwrite Dataset check button.
1173
1175{
1176 if (on && fAppendFiles->IsOn())
1178}
1179
1180////////////////////////////////////////////////////////////////////////////////
1181/// Notification of Overwrite Files check button.
1182
1184{
1185}
1186
1187////////////////////////////////////////////////////////////////////////////////
1188/// Notification of Append Files check button.
1189
1191{
1192 if (on && fOverwriteDSet->IsOn())
1194}
1195
1196////////////////////////////////////////////////////////////////////////////////
1197/// Remove the selected entry from the list view.
1198
1200{
1202 fLVContainer->RemoveItem(item);
1203 // update list view
1205 fListView->Layout();
1207}
1208
1209////////////////////////////////////////////////////////////////////////////////
1210/// Upload the dataset to the server.
1211
1213{
1214 Int_t retval;
1215 TString fileList;
1216 const char *dsetName = fDSetName->GetText();
1217 const char *destination = fDestinationURL->GetText();
1218 UInt_t flags = 0;
1219
1220 if (fUploading)
1221 return;
1222
1223 if (!fViewer->GetActDesc()->fConnected ||
1225 !fViewer->GetActDesc()->fProof ||
1226 !fViewer->GetActDesc()->fProof->IsValid()) {
1227 return;
1228 }
1229
1230 TList *skippedFiles = new TList();
1231 TList *datasetFiles = new TList();
1232
1233 // Format upload flags with user selection
1234 if (fOverwriteDSet->IsOn())
1236 else
1238 if (fOverwriteFiles->IsOn())
1240 else
1242 if (fAppendFiles->IsOn()) {
1243 flags |= TProof::kAppend;
1244 if (flags & TProof::kNoOverwriteDataSet)
1245 flags &= ~TProof::kNoOverwriteDataSet;
1246 }
1247
1248 Int_t ret = 0;
1249 TIter next(fLVContainer->GetList());
1250 TGFrameElement *el;
1251 TGLVEntry *entry;
1252
1253 while ((el = (TGFrameElement *)next())) {
1254 entry = (TGLVEntry *) el->fFrame;
1255 const char *fname = gSystem->UnixPathName(entry->GetTitle());
1256 datasetFiles->Add(new TFileInfo(fname));
1257 }
1258 fUploading = kTRUE;
1261
1262 if (strlen(destination) < 2) destination = 0;
1263
1264 // GG 17/8/2012 -- BEGIN
1265 // NB: UploadDataSet is obsolete; these changes are the minimal ones to make
1266 // the build after the removal of an obsolete structure in TProof.h;
1267 // but all this needs to be reconsidered.
1268 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1269 datasetFiles, destination, flags, skippedFiles);
1270#if 0
1271 if (ret == TProof::kDataSetExists) {
1272 // ask user what to do :
1273 // cancel/overwrite and change option
1274 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1275 TString::Format("The dataset \"%s\" already exists on the cluster ! Overwrite ?",
1277 &retval);
1278 if (retval == kMBYes) {
1279 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1280 datasetFiles, destination,
1283 skippedFiles);
1284 }
1285 if (retval == kMBAppend) {
1286 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1287 datasetFiles, destination,
1290 skippedFiles);
1291 }
1292 }
1293#endif
1294 if (ret != 0) {
1295 // Inform user
1296 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1297 "Failed uploading dataset/files to the cluster",
1298 kMBIconExclamation, kMBOk, &retval);
1302 return;
1303 }
1304 // Here we cope with files that existed on the cluster and were skipped.
1305 if (skippedFiles->GetSize()) {
1306 TIter nexts(skippedFiles);
1307 while (TFileInfo *obj = (TFileInfo*)nexts()) {
1308 // Notify user that file: obj->GetFirstUrl()->GetUrl() exists on
1309 // the cluster and ask user what to do
1310 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1311 TString::Format("The file \"%s\" already exists on the cluster ! Overwrite ?",
1312 obj->GetFirstUrl()->GetUrl()), kMBIconQuestion,
1313 kMBYes | kMBNo | kMBYesAll | kMBNoAll | kMBDismiss, &retval);
1314 if (retval == kMBYesAll) {
1315 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1316 skippedFiles, destination,
1319 if (ret != 0) {
1320 // Inform user
1321 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1322 TString::Format("Failed uploading \"%s\" to the cluster",
1323 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1324 kMBOk, &retval);
1325 }
1326 else {
1327 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1328 "Files have been successfully uploaded to the cluster",
1329 kMBIconAsterisk, kMBOk, &retval);
1330 }
1334 return;
1335 }
1336 if ((retval == kMBNoAll) || (retval == kMBDismiss)) {
1337 break;
1338 }
1339 if (retval == kMBYes) {
1340 // Append one file to the dataSet
1341 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1342 obj->GetFirstUrl()->GetUrl(), destination,
1344 if (ret != 0) {
1345 // Inform user
1346 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1347 TString::Format("Failed uploading \"%s\" to the cluster",
1348 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1349 kMBOk, &retval);
1350 }
1351 else {
1352 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1353 "Files have been successfully uploaded to the cluster",
1354 kMBIconAsterisk, kMBOk, &retval);
1355 }
1356 }
1357 }
1358 skippedFiles->Clear();
1359 }
1360 else {
1361 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1362 "Files have been successfully uploaded to the cluster",
1363 kMBIconAsterisk, kMBOk, &retval);
1364 }
1365 // GG 17/8/2012 -- END
1366
1367 // finally, update list of datasets in session viewer
1372}
1373
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
int main()
Definition Prototype.cxx:12
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
long Longptr_t
Definition RtypesCore.h:82
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:124
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
static const char * gFileTypes[]
R__EXTERN TApplication * gApplication
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kFDOpen
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kLVDetails
Definition TGListView.h:25
@ kLVSmallIcons
Definition TGListView.h:23
@ kMBNo
Definition TGMsgBox.h:32
@ kMBNoAll
Definition TGMsgBox.h:41
@ kMBYes
Definition TGMsgBox.h:31
@ kMBAppend
Definition TGMsgBox.h:42
@ kMBCancel
Definition TGMsgBox.h:37
@ kMBOk
Definition TGMsgBox.h:33
@ kMBYesAll
Definition TGMsgBox.h:40
@ kMBDismiss
Definition TGMsgBox.h:39
@ kMBIconExclamation
Definition TGMsgBox.h:24
@ kMBIconAsterisk
Definition TGMsgBox.h:25
@ kMBIconQuestion
Definition TGMsgBox.h:23
@ kTextLeft
Definition TGWidget.h:23
winID h TVirtualViewer3D TVirtualGLPainter p
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
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:407
static const char * gFileTypes[]
static const char * gDatasetTypes[]
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
@ kReadPermission
Definition TSystem.h:47
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
#define gVirtualX
Definition TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kTE_TAB
@ kC_TEXTENTRY
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
A chain is a collection of files containing TTree objects.
Definition TChain.h:33
static TClass * Class()
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.
Definition TDSet.h:153
static TClass * Class()
Class describing a generic file including meta information.
Definition TFileInfo.h:39
A button abstract base class.
Definition TGButton.h:68
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:445
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:459
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
Selects different options.
Definition TGButton.h:264
Bool_t IsOn() const override
Definition TGButton.h:310
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:234
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:224
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
Definition TGClient.cxx:395
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:372
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:1000
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1043
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1231
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition TGCanvas.cxx:660
virtual TGFrame * GetLastActive() const
Definition TGCanvas.h:127
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
void RemoveAll() override
Remove all items from the container.
Definition TGCanvas.cxx:641
void StopRefreshTimer()
stop refresh timer
virtual void ChangeDirectory(const char *path)
Change current directory.
virtual void DisplayDirectory()
Display the contents of the current directory in the container.
virtual TGFileItem * AddFile(const char *name, const TGPicture *pic=nullptr, const TGPicture *lpic=nullptr)
Add file in container.
virtual void SetFilter(const char *filter)
Set file selection filter.
const char * GetDirectory() const
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
TGFrame * fFrame
Definition TGLayout.h:112
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:709
virtual void SetMinWidth(UInt_t w)
Definition TGFrame.h:248
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
void MapWindow() override
map window
Definition TGFrame.h:204
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:593
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:276
virtual UInt_t GetOptions() const
Definition TGFrame.h:197
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
Definition TGFrame.cxx:293
UInt_t GetWidth() const
Definition TGFrame.h:224
A composite frame with a border and a title.
Definition TGFrame.h:522
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
void SetDefaultHeaders()
Definition TGListView.h:237
void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)
Definition TGListView.h:235
void SetHeaders(Int_t ncolumns)
Definition TGListView.h:234
virtual void AddItem(TGLVEntry *item)
Definition TGListView.h:207
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode for container.
virtual void SetPictures(const TGPicture *bigpic=nullptr, const TGPicture *smallpic=nullptr)
change pictures
const char * GetTitle() const override
Returns title of object.
Definition TGListView.h:89
void * GetUserData() const
Definition TGListView.h:95
void SetUserData(void *userData)
Definition TGListView.h:94
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition TGListTree.h:79
void ClearHighlighted()
Un highlight items.
void RenameItem(TGListTreeItem *item, const char *string)
Rename item in list tree.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
TGListTreeItem * GetSelected() const
Definition TGListTree.h:382
void SetSelected(TGListTreeItem *item)
Definition TGListTree.h:353
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
A list view is a widget that can contain a number of items arranged in a grid or list.
Definition TGListView.h:115
virtual void AdjustHeaders()
Definition TGListView.h:154
void Layout() override
Layout list view components (container and contents of container).
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
TGNumberEntry is a number entry input widget with up/down buttons.
virtual void SetIntNumber(Long_t val, Bool_t emit=kTRUE)
void Associate(const TGWindow *w) override
Make w the window that will receive the generated messages.
virtual Long_t GetIntNumber() const
@ kNEANonNegative
Non-negative number.
@ kNEAAnyNumber
Attributes of number entry field.
@ kNESInteger
Style of number entry field.
@ kNELNoLimits
Limit selection of number entry field.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
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.
Definition TGButton.h:142
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:644
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
virtual void SetFocus()
Set focus to this text entry.
const char * GetText() const
void SetEnabled(Bool_t flag=kTRUE)
virtual void SelectAll()
Selects all text (i.e.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:498
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:336
A doubly linked list.
Definition TList.h:38
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:402
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
Definition TList.cxx:578
void Add(TObject *obj) override
Definition TList.h:81
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
~TNewChainDlg() override
Delete chain dialog.
virtual void OnDoubleClick(TGLVEntry *, Int_t)
Handle double click in the File container.
TGTextButton * fOkButton
TGTextButton * fCancelButton
TGListView * fListView
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.
TObject * fChain
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.
TSeqCollection * fChains
TGLVContainer * fLVContainer
void UpdateList()
Update Memory list view.
TGFileContainer * fContents
virtual void DisplayDirectory(const TString &fname)
Display content of directory.
TGTextBuffer * fNameBuf
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.
TGTextEntry * fName
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.
TGTextButton * fBtnMore
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,...
TGTextButton * fBtnClose
TGTextEntry * fTxtEventList
TGCompositeFrame * fFrmNewQuery
TGTextEntry * fTxtOptions
void OnBtnSaveClicked()
Save current settings in main session viewer.
TQueryDescription * fQuery
TGTextEntry * fTxtChain
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
TSessionViewer * fViewer
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
TGTextButton * fBtnSave
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.
TObject * fChain
Collectable string class.
Definition TObjString.h:28
const TString & GetString() const
Definition TObjString.h:46
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:439
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition TObject.h:153
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:483
virtual TClass * IsA() const
Definition TObject.h:243
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
Bool_t IsValid() const
Definition TProof.h:937
Int_t UploadDataSet(const char *, TList *, const char *=0, Int_t=0, TList *=0)
*** This function is deprecated and will disappear in future versions *** *** It is just a wrapper ar...
Definition TProof.cxx:10635
@ kOverwriteAllFiles
Definition TProof.h:357
@ kAppend
Definition TProof.h:354
@ kOverwriteNoFiles
Definition TProof.h:358
@ kNoOverwriteDataSet
Definition TProof.h:356
@ kOverwriteDataSet
Definition TProof.h:355
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
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.
Definition TQObject.cxx:869
ESessionQueryStatus fStatus
TQueryResult * fResult
Regular expression class.
Definition TRegexp.h:31
void UpdateListOfDataSets()
Update list of dataset present on the cluster.
void OnBtnSubmit()
Submit query.
Widget used to manage PROOF or local sessions, PROOF connections, queries construction and results ha...
TSessionQueryFrame * GetQueryFrame() const
TGListTree * GetSessionHierarchy() const
void OnListTreeClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y)
Handle mouse clicks in list tree.
TSessionFrame * GetSessionFrame() const
TGListTreeItem * GetSessionItem() const
const TGPicture * GetQueryConPict() const
TSessionDescription * GetActDesc() const
void WriteConfiguration(const char *filename=nullptr)
Save actual configuration in config file "filename".
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
TString & Remove(Ssiz_t pos)
Definition TString.h:685
TString & Append(const char *cs)
Definition TString.h:576
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2356
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2334
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition TSystem.cxx:823
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition TSystem.cxx:1283
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition TSystem.cxx:840
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition TSystem.cxx:849
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1050
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:921
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition TSystem.cxx:1019
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.
TSessionViewer * fViewer
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
TGTextEntry * fDSetName
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
TGListView * fListView
TLine lv
Definition textalign.C:5