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// //
14// TSessionDialogs //
15// //
16// This file defines several dialogs that are used by TSessionViewer. //
17// The following dialogs are available: TNewChainDlg and TNewQueryDlg. //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "TSessionDialogs.h"
22#include "TSessionViewer.h"
23#include "TROOT.h"
24#include "TSystem.h"
25#include "TGButton.h"
26#include "TList.h"
27#include "TChain.h"
28#include "TDSet.h"
29#include "TGTextEntry.h"
30#include "TGTextBuffer.h"
31#include "TGNumberEntry.h"
32#include "TGLabel.h"
33#include "TGListView.h"
34#include "TGFSContainer.h"
35#include "TGFileDialog.h"
36#include "TGListTree.h"
37#include "TInterpreter.h"
38#include "TApplication.h"
39#include "TObjString.h"
40#include "TGTableLayout.h"
41#include "TProof.h"
42#include "TFileInfo.h"
43#include "TGMsgBox.h"
44#include "TRegexp.h"
45#include "TVirtualX.h"
46
49
50/* not yet used
51static const char *gParTypes[] = {
52 "Par files", "*.par",
53 "All files", "*",
54 0, 0
55};
56*/
57
58static const char *gDatasetTypes[] = {
59 "ROOT files", "*.root",
60 "All files", "*",
61 0, 0
62};
63
64static const char *gFileTypes[] = {
65 "C files", "*.[C|c]*",
66 "ROOT files", "*.root",
67 "All files", "*",
68 0, 0
69};
70
71//////////////////////////////////////////////////////////////////////////
72// New Chain Dialog
73//////////////////////////////////////////////////////////////////////////
74
75////////////////////////////////////////////////////////////////////////////////
76/// Create a new chain dialog box. Used to list chains present in memory
77/// and offers the possibility to create new ones by executing macros
78/// directly from the associate file container.
79
82{
83 Pixel_t backgnd;
84 if (!p || !main) return;
86 fClient->GetColorByName("#F0FFF0", backgnd);
87 AddFrame(new TGLabel(this, new TGHotString("List of Chains in Memory :")),
88 new TGLayoutHints(kLHintsLeft, 5, 5, 7, 2) );
89
90 // Add TGListView used to show objects in memory
91 fListView = new TGListView(this, 300, 100);
97
98 fListView->Connect("Clicked(TGLVEntry*, Int_t)", "TNewChainDlg",
99 this, "OnElementClicked(TGLVEntry* ,Int_t)");
100
101 // Add text entry showing type and name of user's selection
102 TGCompositeFrame* frmSel = new TGHorizontalFrame(this, 300, 100);
103 frmSel->SetCleanup(kDeepCleanup);
104 frmSel->AddFrame(new TGLabel(frmSel, new TGHotString("Selected chain :")),
105 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 5, 5) );
106 fNameBuf = new TGTextBuffer(100);
107 fName = new TGTextEntry(frmSel, fNameBuf);
109 fName->Associate(this);
111 fName->ChangeBackground(backgnd);
113 AddFrame(frmSel, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
114
115 AddFrame(new TGLabel(this, "Double-click on the macro to be executed to create a new Chain:"),
116 new TGLayoutHints(kLHintsCenterX, 5, 5, 5, 2));
117
118 // Add TGListview / TGFileContainer to allow user to execute Macros
119 // for the creation of new TChains / TDSets
120 TGListView* lv = new TGListView(this, 300, 100);
122
123 Pixel_t white;
124 gClient->GetColorByName("white",white);
127 fContents->SetFilter("*.[C|c]*");
129 fContents->Associate(this);
132 fContents->AddFile(".."); // up level directory
133 fContents->Resize();
134 fContents->StopRefreshTimer(); // stop refreshing
135
136 // position relative to the parent's window
137 Window_t wdummy;
138 Int_t ax, ay;
139 gVirtualX->TranslateCoordinates( main->GetId(),
141 0, 0, ax, ay, wdummy);
142 Move(ax + 200, ay + 35);
143
144 TGCompositeFrame *tmp;
145 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
148 // Apply and Close buttons
149 tmp->AddFrame(fOkButton = new TGTextButton(tmp, "&Ok", 0),
150 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
151 tmp->AddFrame(fCancelButton = new TGTextButton(tmp, "&Cancel", 1),
152 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
153 fOkButton->Associate(this);
156
157 SetWindowName("Chain Selection Dialog");
159 Layout();
161 MapWindow();
162 UpdateList();
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Delete chain dialog.
167
169{
170 if (IsZombie()) return;
171 delete fLVContainer;
172 delete fContents;
173 Cleanup();
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Emits OnElementSelected signal if dset is not zero.
178
180{
181 if (obj && (obj->IsA() == TChain::Class() ||
182 obj->IsA() == TDSet::Class())) {
183 Emit("OnElementSelected(TObject *)", (Long_t)obj);
184 }
185}
186
187////////////////////////////////////////////////////////////////////////////////
188/// Handle click in the Memory list view and put the type
189/// and name of selected object in the text entry.
190
192{
193 fChain = (TObject *)entry->GetUserData();
194 if (fChain->IsA() == TChain::Class()) {
195 TString s = TString::Format("%s : %s" , ((TChain *)fChain)->GetTitle(),
196 ((TChain *)fChain)->GetName());
197 fName->SetText(s);
198 }
199 else if (fChain->IsA() == TDSet::Class()) {
200 TString s = TString::Format("%s : %s" , ((TDSet *)fChain)->GetName(),
201 ((TDSet *)fChain)->GetObjName());
202 fName->SetText(s);
203 }
205}
206
207////////////////////////////////////////////////////////////////////////////////
208/// Update Memory list view.
209
211{
212 TGLVEntry *item=0;
213 TObject *obj = 0;
214 fChains = gROOT->GetListOfDataSets();
216 if (!fChains) return;
217 TIter next(fChains);
218 // loop on the list of chains/datasets in memory,
219 // and fill the associated listview
220 while ((obj = (TObject *)next())) {
221 item = 0;
222 if (obj->IsA() == TChain::Class()) {
223 const char *title = ((TChain *)obj)->GetTitle();
224 if (!title[0])
225 ((TChain *)obj)->SetTitle("TChain");
226 item = new TGLVEntry(fLVContainer, ((TChain *)obj)->GetName(),
227 ((TChain *)obj)->GetTitle());
228 }
229 else if (obj->IsA() == TDSet::Class()) {
230 item = new TGLVEntry(fLVContainer, ((TDSet *)obj)->GetObjName(),
231 ((TDSet *)obj)->GetName());
232 }
233 if (item) {
234 item->SetUserData(obj);
235 fLVContainer->AddItem(item);
236 }
237 }
239 Resize();
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Display content of directory.
244
246{
248 gSystem->ChangeDirectory(fname);
251 fContents->AddFile(".."); // up level directory
252 Resize();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Handle double click in the File container.
257
259{
260 if (btn!=kButton1) return;
261 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kWatch));
262
263 TString name(f->GetTitle());
264
265 // Check if the file is a root macro file type
266 if (name.Contains(".C")) {
267 // form the command
268 TString command = TString::Format(".x %s/%s",
270 name.Data());
271 // and process
272 gApplication->ProcessLine(command.Data());
273 UpdateList();
274 } else {
275 // if double clicked on a directory, then display it
277 }
278 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kPointer));
279}
280
281////////////////////////////////////////////////////////////////////////////////
282/// Process messages for new chain dialog.
283
285{
286 switch (GET_MSG(msg)) {
287 case kC_COMMAND:
288 switch (GET_SUBMSG(msg)) {
289 case kCM_BUTTON:
290 switch (parm1) {
291
292 case 0:
293 // Apply button
296 DeleteWindow();
297 break;
298
299 case 1:
300 // Close button
301 fChain = 0;
302 DeleteWindow();
303 break;
304 }
305 break;
306 default:
307 break;
308 }
309 break;
310
311 case kC_CONTAINER:
312 switch (GET_SUBMSG(msg)) {
313 case kCT_ITEMDBLCLICK:
314 if (parm1==kButton1) {
315 TGLVEntry *lv_entry = (TGLVEntry *)fContents->GetLastActive();
316 if (lv_entry) OnDoubleClick(lv_entry, parm1);
317 }
318 break;
319 }
320 break;
321 default:
322 break;
323 }
324 return kTRUE;
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// Close file dialog.
329
331{
332 DeleteWindow();
333}
334
335
336//////////////////////////////////////////////////////////////////////////
337// New Query Dialog
338//////////////////////////////////////////////////////////////////////////
339
340////////////////////////////////////////////////////////////////////////////////
341/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
342/// the editmode flag is set, or to create a new one if not set.
343
345 TQueryDescription *query, Bool_t editmode) :
346 TGTransientFrame(gClient->GetRoot(), gui, Width, Height)
347{
348 Window_t wdummy;
349 Int_t ax, ay;
350 fEditMode = editmode;
352 fChain = 0;
353 fQuery = query;
354 if (fQuery && fQuery->fChain) {
356 }
357 Build(gui);
358 // if in edit mode, update fields with query description data
359 if (editmode && query)
360 UpdateFields(query);
361 else if (!editmode) {
362 TQueryDescription *fquery;
364 if(fquery)
366 else
367 fTxtQueryName->SetText("Query 1");
368 }
370 Resize(Width, Height);
371 // hide options frame
373 fBtnMore->SetText(" More >> ");
374 SetWMSizeHints(Width+5, Height+25, Width+5, Height+25, 1, 1);
376 Layout();
377 SetWindowName("Query Dialog");
378 // Position relative to parent
379 gVirtualX->TranslateCoordinates( fViewer->GetId(),
381 0, 0, ax, ay, wdummy);
382 Move(ax + fViewer->GetWidth()/2, ay + 35);
383}
384
385////////////////////////////////////////////////////////////////////////////////
386/// Delete query dialog.
387
389{
390 if (IsZombie()) return;
391 Cleanup();
392}
393
394////////////////////////////////////////////////////////////////////////////////
395/// Build the "new query" dialog.
396
398{
399 TGButton* btnTmp;
400 fViewer = gui;
403 SetMinWidth(500);
404 fFrmNewQuery = new TGGroupFrame(this, "New Query");
406
408 kLHintsExpandY, 2, 2, 2, 2));
410
411 // add "Query Name" label and text entry
412 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Query Name :"),
413 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 4, 0));
415 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
416 kLHintsCenterY, 5, 5, 4, 0));
417
418 // add "TChain" label and text entry
419 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "TChain :"),
420 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 4, 0));
422 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
423 kLHintsCenterY, 5, 5, 4, 0));
424 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
426 // add "Browse" button
427 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
428 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
429 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseChain()");
430
431 // add "Selector" label and text entry
432 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Selector :"),
433 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
435 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
436 kLHintsCenterY, 5, 5, 0, 0));
437 // add "Browse" button
438 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
439 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
440 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseSelector()");
441
442 // add "Less <<" ("More >>") button
444 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
445 fBtnMore->Connect("Clicked()", "TNewQueryDlg", this, "OnNewQueryMore()");
446
447 // add (initially hidden) options frame
448 fFrmMore = new TGCompositeFrame(fFrmNewQuery, 200, 200);
450
454
455 // add "Options" label and text entry
456 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
457 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 0, 0));
459 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 22,
460 0, 0, 8));
461 fTxtOptions->SetText("ASYN");
462
463 // add "Nb Entries" label and number entry
464 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
465 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 0, 0));
469 0, 22, 0, 0, 8));
470 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
472 // add "First Entry" label and number entry
473 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
474 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
478 22, 0, 0, 8));
479
480 // add "Event list" label and text entry
481 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
482 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 0, 5, 0, 0));
484 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 22,
485 5, 0, 0));
486 // add "Browse" button
487 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
488 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
489 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseEventList()");
490
492 fTxtChain->Associate(this);
493 fTxtSelector->Associate(this);
494 fTxtOptions->Associate(this);
495 fNumEntries->Associate(this);
498
499 fTxtQueryName->Connect("TextChanged(char*)", "TNewQueryDlg", this,
500 "SettingsChanged()");
501 fTxtChain->Connect("TextChanged(char*)", "TNewQueryDlg", this,
502 "SettingsChanged()");
503 fTxtSelector->Connect("TextChanged(char*)", "TNewQueryDlg", this,
504 "SettingsChanged()");
505 fTxtOptions->Connect("TextChanged(char*)", "TNewQueryDlg", this,
506 "SettingsChanged()");
507 fNumEntries->Connect("ValueChanged(Long_t)", "TNewQueryDlg", this,
508 "SettingsChanged()");
509 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TNewQueryDlg", this,
510 "SettingsChanged()");
511 fTxtEventList->Connect("TextChanged(char*)", "TNewQueryDlg", this,
512 "SettingsChanged()");
513
514 TGCompositeFrame *tmp;
515 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
518 // Add "Save" and "Save & Submit" buttons if we are in edition mode
519 // or "Add" and "Add & Submit" if we are not in edition mode.
520 if (fEditMode) {
521 fBtnSave = new TGTextButton(tmp, "Save");
522 fBtnSubmit = new TGTextButton(tmp, "Save && Submit");
523 }
524 else {
525 fBtnSave = new TGTextButton(tmp, "Add");
526 fBtnSubmit = new TGTextButton(tmp, "Add && Submit");
527 }
529 3, 3, 3, 3));
531 3, 3, 3, 3));
532 fBtnSave->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSaveClicked()");
533 fBtnSubmit->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSubmitClicked()");
534 tmp->AddFrame(fBtnClose = new TGTextButton(tmp, "Close"),
535 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 3, 3, 3, 3));
536 fBtnClose->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnCloseClicked()");
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Called when window is closed via the window manager.
543
545{
546 DeleteWindow();
547}
548
549////////////////////////////////////////////////////////////////////////////////
550/// Show/hide options frame and update button text accordingly.
551
553{
556 fBtnMore->SetText(" More >> ");
557 }
558 else {
560 fBtnMore->SetText(" Less << ");
561 }
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// Call new chain dialog.
566
568{
569 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
570 dlg->Connect("OnElementSelected(TObject *)", "TNewQueryDlg",
571 this, "OnElementSelected(TObject *)");
572}
573
574////////////////////////////////////////////////////////////////////////////////
575/// Handle OnElementSelected signal coming from new chain dialog.
576
578{
579 if (obj) {
580 fChain = obj;
581 if (obj->IsA() == TChain::Class())
583 else if (obj->IsA() == TDSet::Class())
584 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
585 }
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// Open file browser to choose selector macro.
590
592{
593 TGFileInfo fi;
595 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
596 if (!fi.fFilename) return;
598}
599
600////////////////////////////////////////////////////////////////////////////////
601///Browse event list
602
604{
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Save current settings in main session viewer.
609
611{
612 // if we are in edition mode and query description is valid,
613 // use it, otherwise create a new one
614 TQueryDescription *newquery;
615 if (fEditMode && fQuery)
616 newquery = fQuery;
617 else
618 newquery = new TQueryDescription();
619
620 // update query description fields
621 newquery->fSelectorString = fTxtSelector->GetText();
622 if (fChain) {
623 newquery->fTDSetString = fChain->GetName();
624 newquery->fChain = fChain;
625 }
626 else {
627 newquery->fTDSetString = "";
628 newquery->fChain = 0;
629 }
630 newquery->fQueryName = fTxtQueryName->GetText();
631 newquery->fOptions.Form("%s",fTxtOptions->GetText());
632 newquery->fNoEntries = fNumEntries->GetIntNumber();
634 newquery->fNbFiles = 0;
635 newquery->fResult = 0;
636
637 if (newquery->fChain) {
638 if (newquery->fChain->IsA() == TChain::Class())
639 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
640 else if (newquery->fChain->IsA() == TDSet::Class())
641 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
642 }
643 if (!fEditMode) {
644 // if not in editor mode, create a new list tree item
645 // and set user data to the newly created query description
646 newquery->fResult = 0;
648
649 TQueryDescription *fquery;
651 while (fquery) {
652 int e = 1, j = 0, idx = 0;
653 const char *name = fquery->fQueryName;
654 for (int i=strlen(name)-1;i>0;i--) {
655 if (isdigit(name[i])) {
656 idx += (name[i]-'0') * e;
657 e *= 10;
658 j++;
659 }
660 else
661 break;
662 }
663 if (idx > 0) {
664 idx++;
665 newquery->fQueryName.Remove(strlen(name)-j,j);
666 newquery->fQueryName.Append(Form("%d",idx));
667 }
668 else
669 newquery->fQueryName.Append(" 1");
671 }
672 fTxtQueryName->SetText(newquery->fQueryName);
673 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
678 item2->SetUserData(newquery);
683 fViewer->OnListTreeClicked(item2, 1, 0, 0);
684 }
685 else {
686 // else if in editor mode, just update user data with modified
687 // query description
690 item->SetUserData(newquery);
691 }
692 // update list tree
698}
699
700////////////////////////////////////////////////////////////////////////////////
701/// Save and submit query description.
702
704{
707}
708
709////////////////////////////////////////////////////////////////////////////////
710/// Close dialog.
711
713{
714 Int_t result = kMBNo;
715 if (fModified) {
716 new TGMsgBox(fClient->GetRoot(), this, "Modified Settings",
717 "Do you wish to SAVE changes ?", 0,
718 kMBYes | kMBNo | kMBCancel, &result);
719 if (result == kMBYes) {
721 }
722 }
723 if (result == kMBNo) {
724 DeleteWindow();
725 }
726}
727
728////////////////////////////////////////////////////////////////////////////////
729/// Display dialog and set focus to query name text entry.
730
732{
733 MapWindow();
735}
736
737////////////////////////////////////////////////////////////////////////////////
738/// Settings have changed, update GUI accordingly.
739
741{
742 if (fEditMode && fQuery) {
743 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
744 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
745 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
748 (fQuery->fChain != fChain)) {
750 }
751 else {
753 }
754 }
755 else {
756 if ((fTxtQueryName->GetText()) &&
757 ((fTxtQueryName->GetText()) ||
758 (fTxtChain->GetText())))
760 else
762 }
763 if (fModified) {
766 }
767 else {
770 }
771}
772
773////////////////////////////////////////////////////////////////////////////////
774/// Update entry fields with query description values.
775
777{
778 fQuery = desc;
780 fTxtChain->SetText("");
781 if (desc->fChain)
788}
789////////////////////////////////////////////////////////////////////////////////
790/// Process messages for new query dialog.
791/// Essentially used to navigate between text entry fields.
792
794{
795 switch (GET_MSG(msg)) {
796 case kC_TEXTENTRY:
797 switch (GET_SUBMSG(msg)) {
798 case kTE_ENTER:
799 case kTE_TAB:
800 switch (parm1) {
801 case 1: // Query Name
804 break;
805 case 2: // Chain Name
808 break;
809 case 3: // Selector Name
812 break;
813 case 4: // Options
816 break;
817 case 6: // Event List
820 break;
821 }
822 break;
823
824 default:
825 break;
826 }
827 break;
828
829 default:
830 break;
831 }
832 return kTRUE;
833}
834
835//////////////////////////////////////////////////////////////////////////
836// Upload DataSet Dialog
837//////////////////////////////////////////////////////////////////////////
838
839////////////////////////////////////////////////////////////////////////////////
840/// Create a Upload DataSet dialog box. Used to create and upload a dataset
841
843 TGTransientFrame(gClient->GetRoot(), gui, w, h)
844{
846 if (!gui) return;
847 fViewer = gui;
848
850 TGHorizontalFrame *hFrame1 = new TGHorizontalFrame(this);
851 hFrame1->SetCleanup(kDeepCleanup);
852 hFrame1->AddFrame(new TGLabel(hFrame1,"Name of DataSet :"),
854 10, 10, 5, 5));
855 fDSetName = new TGTextEntry(hFrame1, new TGTextBuffer(50));
856 fDSetName->SetText("DataSet1");
859 10, 10, 5, 5));
861 2, 2, 2, 2));
862
863 // "DataSet Files" group frame
864 TGGroupFrame *groupFrame1 = new TGGroupFrame(this, "DataSet Files");
865 groupFrame1->SetCleanup(kDeepCleanup);
866
867 // horizontal frame for files location URL
868 TGHorizontalFrame *hFrame11 = new TGHorizontalFrame(groupFrame1);
869 hFrame11->SetCleanup(kDeepCleanup);
870 hFrame11->AddFrame(new TGLabel(hFrame11,"Location URL :"),
872 10, 10, 5, 5));
873 fLocationURL = new TGTextEntry(hFrame11, new TGTextBuffer(150));
874 fLocationURL->SetToolTipText("Enter location URL (i.e \"root://host//path/to/file.root\")");
877 kLHintsCenterY, 10, 10, 5, 5));
878 fAddButton = new TGTextButton(hFrame11, " Add >> ", 0);
879 fAddButton->SetToolTipText("Add file(s) to the list");
880 fAddButton->Associate(this);
882 kLHintsExpandX, 5, 10, 5, 5));
883 groupFrame1->AddFrame(hFrame11, new TGLayoutHints(kLHintsLeft | kLHintsTop |
884 kLHintsExpandX, 2, 2, 2, 2));
885 // horizontal frame for the list view displaying list of files
886 // and for a vertical frame with control buttons
887 TGHorizontalFrame *hFrame2 = new TGHorizontalFrame(groupFrame1);
888 hFrame2->SetCleanup(kDeepCleanup);
889
890 // list view
891 // Add TGListView used to show list of files
892 fListView = new TGListView(hFrame2, 300, 100);
898 fLVContainer->SetHeader("File Name", kTextLeft, kTextLeft , 0);
900 kLHintsExpandX | kLHintsExpandY, 2, 2, 10, 10));
901
902 // vertical frame for control buttons
903 TGVerticalFrame *vFrame1 = new TGVerticalFrame(hFrame2);
904 vFrame1->SetCleanup(kDeepCleanup);
905
906 fBrowseButton = new TGTextButton(vFrame1, " Browse... ", 1);
907 fBrowseButton->SetToolTipText("Add file(s) to the list");
910 kLHintsExpandX, 15, 5, 5, 5));
911 fRemoveButton = new TGTextButton(vFrame1, " Remove ", 2);
912 fRemoveButton->SetToolTipText("Remove selected file from the list");
915 kLHintsExpandX, 15, 5, 5, 5));
916 fClearButton = new TGTextButton(vFrame1, " Clear ", 3);
917 fClearButton->SetToolTipText("Clear list of files");
918 fClearButton->Associate(this);
920 kLHintsExpandX, 15, 5, 5, 5));
921
922 fOverwriteDSet = new TGCheckButton(vFrame1, "Overwrite DataSet");
923 fOverwriteDSet->SetToolTipText("Overwrite DataSet");
925 kLHintsExpandX, 15, 5, 5, 5));
926 fOverwriteFiles = new TGCheckButton(vFrame1, "Overwrite Files");
927 fOverwriteFiles->SetToolTipText("Overwrite files in DataSet");
929 kLHintsExpandX, 15, 5, 5, 5));
930 fAppendFiles = new TGCheckButton(vFrame1, "Append Files");
931 fAppendFiles->SetToolTipText("Append files in DataSet");
933 kLHintsExpandX, 15, 5, 5, 5));
934
935 fOverwriteDSet->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
936 "OnOverwriteDataset(Bool_t)");
937 fOverwriteFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
938 "OnOverwriteFiles(Bool_t)");
939 fAppendFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
940 "OnAppendFiles(Bool_t)");
941
942 hFrame2->AddFrame(vFrame1, new TGLayoutHints(kLHintsRight | kLHintsTop |
943 kLHintsExpandY, 2, 2, 2, 2));
944 groupFrame1->AddFrame(hFrame2, new TGLayoutHints(kLHintsLeft | kLHintsTop |
945 kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2));
946
947 AddFrame(groupFrame1, new TGLayoutHints(kLHintsLeft | kLHintsTop |
948 kLHintsExpandX, 5, 5, 2, 2));
949
950 // horizontal frame for destination URL
951 TGHorizontalFrame *hFrame3 = new TGHorizontalFrame(this);
952 hFrame3->SetCleanup(kDeepCleanup);
953 hFrame3->AddFrame(new TGLabel(hFrame3,"Destination URL :"),
955 15, 10, 5, 5));
956 fDestinationURL = new TGTextEntry(hFrame3, new TGTextBuffer(150));
957 if (fViewer->GetActDesc()->fConnected &&
961 // const char *dest = fViewer->GetActDesc()->fProof->GetDataPoolUrl();
962 // fDestinationURL->SetText(dest);
963 }
964 fDestinationURL->SetToolTipText("Enter destination URL ( relative to \" root://host//proofpool/user/ \" )");
967 kLHintsCenterY, 10, 15, 5, 5));
969 2, 2, 2, 2));
970
971 // horizontal frame for upload and close buttons
972 TGHorizontalFrame *hFrame4 = new TGHorizontalFrame(this);
973 hFrame4->SetCleanup(kDeepCleanup);
974 fUploadButton = new TGTextButton(hFrame4, "Upload DataSet", 10);
975 fUploadButton->SetToolTipText("Upload the dataset to the cluster");
978 kLHintsExpandX, 15, 15, 2, 2));
979 fCloseDlgButton = new TGTextButton(hFrame4, "Close Dialog", 11);
980 fCloseDlgButton->SetToolTipText("Close the dialog");
983 kLHintsExpandX, 15, 15, 2, 2));
985 2, 2, 2, 2));
986
987 // position relative to the parent's window
988 Window_t wdummy;
989 Int_t ax, ay;
990 gVirtualX->TranslateCoordinates( gui->GetId(),
992 0, 0, ax, ay, wdummy);
993 Move(ax + 250, ay + 200);
994
995 SetWindowName("Upload DataSet Dialog");
997 MapWindow();
998
999 Resize(w, h);
1000 SetWMSizeHints(w+5, h+5, w+5, h+5, 1, 1);
1002 Layout();
1003}
1004
1005////////////////////////////////////////////////////////////////////////////////
1006/// Delete chain dialog.
1007
1009{
1010 if (IsZombie()) return;
1011 Cleanup();
1012}
1013
1014////////////////////////////////////////////////////////////////////////////////
1015/// Close upload dataset dialog.
1016
1018{
1019 if (!fUploading)
1020 DeleteWindow();
1021}
1022
1023////////////////////////////////////////////////////////////////////////////////
1024/// Process messages for upload dataset dialog.
1025
1027{
1028 switch (GET_MSG(msg)) {
1029 case kC_COMMAND:
1030 switch (GET_SUBMSG(msg)) {
1031 case kCM_BUTTON:
1032 switch (parm1) {
1033 case 0:
1034 // Add button
1035 if (fLocationURL->GetText())
1037 break;
1038 case 1:
1039 // Add button
1040 BrowseFiles();
1041 break;
1042 case 2:
1043 // Remove button
1044 RemoveFile();
1045 break;
1046 case 3:
1047 // Clear button
1048 ClearFiles();
1049 break;
1050 case 10:
1051 // Upload button
1052 UploadDataSet();
1053 break;
1054 case 11:
1055 // Close button
1056 CloseWindow();
1057 break;
1058 }
1059 break;
1060 default:
1061 break;
1062 }
1063 break;
1064
1065 default:
1066 break;
1067 }
1068 return kTRUE;
1069}
1070
1071////////////////////////////////////////////////////////////////////////////////
1072/// Add File name(s) from the file location URL to the list view.
1073
1074void TUploadDataSetDlg::AddFiles(const char *fileName)
1075{
1076 if (strlen(fileName) < 5)
1077 return;
1078 if (strstr(fileName,"*.")) {
1079 // wildcarding case
1080 void *filesDir = gSystem->OpenDirectory(gSystem->GetDirName(fileName));
1081 const char* ent;
1082 TString filesExp(gSystem->BaseName(fileName));
1083 filesExp.ReplaceAll("*",".*");
1084 TRegexp rg(filesExp);
1085 while ((ent = gSystem->GetDirEntry(filesDir))) {
1086 TString entryString(ent);
1087 if (entryString.Index(rg) != kNPOS &&
1088 gSystem->AccessPathName(Form("%s/%s", gSystem->GetDirName(fileName).Data(),
1089 ent), kReadPermission) == kFALSE) {
1090 TString text = TString::Format("%s/%s",
1091 gSystem->UnixPathName(gSystem->GetDirName(fileName)), ent);
1092 if (!fLVContainer->FindItem(text.Data())) {
1093 TGLVEntry *entry = new TGLVEntry(fLVContainer, text.Data(), text.Data());
1094 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1095 gClient->GetPicture("rootdb_t.xpm"));
1096 fLVContainer->AddItem(entry);
1097 }
1098 }
1099 }
1100 }
1101 else {
1102 // single file
1103 if (!fLVContainer->FindItem(fileName)) {
1104 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName, fileName);
1105 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1106 gClient->GetPicture("rootdb_t.xpm"));
1107 fLVContainer->AddItem(entry);
1108 }
1109 }
1110 // update list view
1112 fListView->Layout();
1114}
1115
1116////////////////////////////////////////////////////////////////////////////////
1117/// Add File name(s) from the file location URL to the list view.
1118
1120{
1121 TObjString *el;
1122 TIter next(fileList);
1123 while ((el = (TObjString *) next())) {
1124 TString fileName = TString::Format("%s/%s",
1126 gSystem->BaseName(el->GetString()));
1127 // single file
1128 if (!fLVContainer->FindItem(fileName.Data())) {
1129 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName.Data(), fileName.Data());
1130 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1131 gClient->GetPicture("rootdb_t.xpm"));
1132 fLVContainer->AddItem(entry);
1133 }
1134 }
1135 // update list view
1137 fListView->Layout();
1139}
1140
1141////////////////////////////////////////////////////////////////////////////////
1142/// Opens the TGFileDialog to allow user to select local file(s) to be added
1143/// in the list view of dataset files.
1144
1146{
1147 TGFileInfo fi;
1149 fi.SetFilename("*.root");
1150 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
1151 if (fi.fMultipleSelection && fi.fFileNamesList) {
1153 }
1154 else if (fi.fFilename) {
1155 AddFiles(fi.fFilename);
1156 }
1157}
1158
1159////////////////////////////////////////////////////////////////////////////////
1160/// Clear content of the list view.
1161
1163{
1165 fListView->Layout();
1166 // update list view
1168}
1169
1170////////////////////////////////////////////////////////////////////////////////
1171/// Notification of Overwrite Dataset check button.
1172
1174{
1175 if (on && fAppendFiles->IsOn())
1177}
1178
1179////////////////////////////////////////////////////////////////////////////////
1180/// Notification of Overwrite Files check button.
1181
1183{
1184}
1185
1186////////////////////////////////////////////////////////////////////////////////
1187/// Notification of Append Files check button.
1188
1190{
1191 if (on && fOverwriteDSet->IsOn())
1193}
1194
1195////////////////////////////////////////////////////////////////////////////////
1196/// Remove the selected entry from the list view.
1197
1199{
1201 fLVContainer->RemoveItem(item);
1202 // update list view
1204 fListView->Layout();
1206}
1207
1208////////////////////////////////////////////////////////////////////////////////
1209/// Upload the dataset to the server.
1210
1212{
1213 Int_t retval;
1214 TString fileList;
1215 const char *dsetName = fDSetName->GetText();
1216 const char *destination = fDestinationURL->GetText();
1217 UInt_t flags = 0;
1218
1219 if (fUploading)
1220 return;
1221
1222 if (!fViewer->GetActDesc()->fConnected ||
1224 !fViewer->GetActDesc()->fProof ||
1225 !fViewer->GetActDesc()->fProof->IsValid()) {
1226 return;
1227 }
1228
1229 TList *skippedFiles = new TList();
1230 TList *datasetFiles = new TList();
1231
1232 // Format upload flags with user selection
1233 if (fOverwriteDSet->IsOn())
1235 else
1237 if (fOverwriteFiles->IsOn())
1239 else
1241 if (fAppendFiles->IsOn()) {
1242 flags |= TProof::kAppend;
1243 if (flags & TProof::kNoOverwriteDataSet)
1244 flags &= ~TProof::kNoOverwriteDataSet;
1245 }
1246
1247 Int_t ret = 0;
1248 TIter next(fLVContainer->GetList());
1249 TGFrameElement *el;
1250 TGLVEntry *entry;
1251
1252 while ((el = (TGFrameElement *)next())) {
1253 entry = (TGLVEntry *) el->fFrame;
1254 const char *fname = gSystem->UnixPathName(entry->GetTitle());
1255 datasetFiles->Add(new TFileInfo(fname));
1256 }
1257 fUploading = kTRUE;
1260
1261 if (strlen(destination) < 2) destination = 0;
1262
1263 // GG 17/8/2012 -- BEGIN
1264 // NB: UploadDataSet is obsolete; these changes are the minimal ones to make
1265 // the build after the removal of an obsolete structure in TProof.h;
1266 // but all this needs to be reconsidered.
1267 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1268 datasetFiles, destination, flags, skippedFiles);
1269#if 0
1270 if (ret == TProof::kDataSetExists) {
1271 // ask user what to do :
1272 // cancel/overwrite and change option
1273 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1274 TString::Format("The dataset \"%s\" already exists on the cluster ! Overwrite ?",
1276 &retval);
1277 if (retval == kMBYes) {
1278 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1279 datasetFiles, destination,
1282 skippedFiles);
1283 }
1284 if (retval == kMBAppend) {
1285 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1286 datasetFiles, destination,
1289 skippedFiles);
1290 }
1291 }
1292#endif
1293 if (ret != 0) {
1294 // Inform user
1295 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1296 "Failed uploading dataset/files to the cluster",
1297 kMBIconExclamation, kMBOk, &retval);
1301 return;
1302 }
1303 // Here we cope with files that existed on the cluster and were skipped.
1304 if (skippedFiles->GetSize()) {
1305 TIter nexts(skippedFiles);
1306 while (TFileInfo *obj = (TFileInfo*)nexts()) {
1307 // Notify user that file: obj->GetFirstUrl()->GetUrl() exists on
1308 // the cluster and ask user what to do
1309 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1310 TString::Format("The file \"%s\" already exists on the cluster ! Overwrite ?",
1311 obj->GetFirstUrl()->GetUrl()), kMBIconQuestion,
1312 kMBYes | kMBNo | kMBYesAll | kMBNoAll | kMBDismiss, &retval);
1313 if (retval == kMBYesAll) {
1314 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1315 skippedFiles, destination,
1318 if (ret != 0) {
1319 // Inform user
1320 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1321 TString::Format("Failed uploading \"%s\" to the cluster",
1322 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1323 kMBOk, &retval);
1324 }
1325 else {
1326 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1327 "Files have been successfully uploaded to the cluster",
1328 kMBIconAsterisk, kMBOk, &retval);
1329 }
1333 return;
1334 }
1335 if ((retval == kMBNoAll) || (retval == kMBDismiss)) {
1336 break;
1337 }
1338 if (retval == kMBYes) {
1339 // Append one file to the dataSet
1340 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1341 obj->GetFirstUrl()->GetUrl(), destination,
1343 if (ret != 0) {
1344 // Inform user
1345 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1346 TString::Format("Failed uploading \"%s\" to the cluster",
1347 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1348 kMBOk, &retval);
1349 }
1350 else {
1351 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1352 "Files have been successfully uploaded to the cluster",
1353 kMBIconAsterisk, kMBOk, &retval);
1354 }
1355 }
1356 }
1357 skippedFiles->Clear();
1358 }
1359 else {
1360 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1361 "Files have been successfully uploaded to the cluster",
1362 kMBIconAsterisk, kMBOk, &retval);
1363 }
1364 // GG 17/8/2012 -- END
1365
1366 // finally, update list of datasets in session viewer
1371}
1372
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
const Ssiz_t kNPOS
Definition RtypesCore.h:115
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassImp(name)
Definition Rtypes.h:364
static const char * gFileTypes[]
R__EXTERN TApplication * gApplication
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:166
@ kFDOpen
@ kDeepCleanup
Definition TGFrame.h:50
@ kLHintsRight
Definition TGLayout.h:33
@ kLHintsExpandY
Definition TGLayout.h:38
@ kLHintsLeft
Definition TGLayout.h:31
@ kLHintsCenterY
Definition TGLayout.h:35
@ kLHintsCenterX
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:34
@ kLHintsExpandX
Definition TGLayout.h:37
@ kLVDetails
Definition TGListView.h:43
@ kLVSmallIcons
Definition TGListView.h:41
@ kMBNo
Definition TGMsgBox.h:39
@ kMBNoAll
Definition TGMsgBox.h:48
@ kMBYes
Definition TGMsgBox.h:38
@ kMBAppend
Definition TGMsgBox.h:49
@ kMBCancel
Definition TGMsgBox.h:44
@ kMBOk
Definition TGMsgBox.h:40
@ kMBYesAll
Definition TGMsgBox.h:47
@ kMBDismiss
Definition TGMsgBox.h:46
@ kMBIconExclamation
Definition TGMsgBox.h:31
@ kMBIconAsterisk
Definition TGMsgBox.h:32
@ kMBIconQuestion
Definition TGMsgBox.h:30
@ kTextLeft
Definition TGWidget.h:33
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:406
static const char * gFileTypes[]
static const char * gDatasetTypes[]
char * Form(const char *fmt,...)
@ kReadPermission
Definition TSystem.h:47
R__EXTERN TSystem * gSystem
Definition TSystem.h:559
#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 Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
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
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
Class describing a generic file including meta information.
Definition TFileInfo.h:39
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:398
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:412
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:188
virtual Bool_t IsOn() const
Definition TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
Bool_t GetColorByName(const char *name, Pixel_t &pixel) const
Get a color by name.
Definition TGClient.cxx:394
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:985
virtual TList * GetList() const
Definition TGFrame.h:346
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:952
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1028
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:352
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1189
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1175
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1216
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:99
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition TGCanvas.cxx:656
virtual TGFrame * GetLastActive() const
Definition TGCanvas.h:137
virtual void RemoveAll()
Remove all items from the container.
Definition TGCanvas.cxx:637
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
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
TList * fFileNamesList
char * fFilename
const char ** fFileTypes
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
TGFrame * fFrame
Definition TGLayout.h:119
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:694
virtual void SetMinWidth(UInt_t w)
Definition TGFrame.h:272
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:215
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:261
virtual UInt_t GetOptions() const
Definition TGFrame.h:221
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
Definition TGFrame.cxx:278
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition TGFrame.cxx:578
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
virtual void MapWindow()
map window
Definition TGFrame.h:228
UInt_t GetWidth() const
Definition TGFrame.h:248
void SetDefaultHeaders()
Definition TGListView.h:255
void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)
Definition TGListView.h:253
void SetHeaders(Int_t ncolumns)
Definition TGListView.h:252
virtual void AddItem(TGLVEntry *item)
Definition TGListView.h:225
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode for container.
virtual void SetPictures(const TGPicture *bigpic=0, const TGPicture *smallpic=0)
change pictures
void * GetUserData() const
Definition TGListView.h:113
virtual const char * GetTitle() const
Returns title of object.
Definition TGListView.h:107
void SetUserData(void *userData)
Definition TGListView.h:112
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition TGListTree.h:94
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:397
void SetSelected(TGListTreeItem *item)
Definition TGListTree.h:368
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
virtual void AdjustHeaders()
Definition TGListView.h:172
virtual void Layout()
Layout list view components (container and contents of container).
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition TGFrame.cxx:1865
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
virtual void SetIntNumber(Long_t val)
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
virtual Long_t GetIntNumber() const
TGClient * fClient
Definition TGObject.h:37
Handle_t GetId() const
Definition TGObject.h:47
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:597
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.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:82
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
A doubly linked list.
Definition TList.h:44
virtual void Add(TObject *obj)
Definition TList.h:87
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition TList.cxx:578
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition TList.cxx:402
virtual void OnDoubleClick(TGLVEntry *, Int_t)
Handle double click in the File container.
TGTextButton * fOkButton
TGTextButton * fCancelButton
TGListView * fListView
virtual ~TNewChainDlg()
Delete chain dialog.
void OnElementSelected(TObject *obj)
Emits OnElementSelected signal if dset is not zero.
TObject * fChain
TSeqCollection * fChains
TGLVContainer * fLVContainer
void UpdateList()
Update Memory list view.
TGFileContainer * fContents
virtual void DisplayDirectory(const TString &fname)
Display content of directory.
TNewChainDlg(const TGWindow *p=0, const TGWindow *main=0)
Create a new chain dialog box.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for new chain dialog.
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.
virtual void CloseWindow()
Close file dialog.
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
TGTextButton * fBtnClose
TGTextEntry * fTxtEventList
TGCompositeFrame * fFrmNewQuery
TGTextEntry * fTxtOptions
void OnBtnSaveClicked()
Save current settings in main session viewer.
TQueryDescription * fQuery
TGTextEntry * fTxtChain
virtual ~TNewQueryDlg()
Delete query dialog.
void OnBtnCloseClicked()
Close dialog.
void SettingsChanged()
Settings have changed, update GUI accordingly.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for new query dialog.
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
TNewQueryDlg(TSessionViewer *gui, Int_t Width, Int_t Height, TQueryDescription *query=0, 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 * 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.
void CloseWindow()
Called when window is closed via the window manager.
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:37
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:359
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition TObject.h:149
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:403
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:10625
@ 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:866
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.
TSessionQueryFrame * GetQueryFrame() const
TGListTree * GetSessionHierarchy() const
void WriteConfiguration(const char *filename=0)
Save actual configuration in config file "filename".
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
Basic string class.
Definition TString.h:136
const char * Data() const
Definition TString.h:369
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:692
TString & Remove(Ssiz_t pos)
Definition TString.h:673
TString & Append(const char *cs)
Definition TString.h:564
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:2331
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2309
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:639
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition TSystem.cxx:835
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:1294
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition TSystem.cxx:852
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition TSystem.cxx:861
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1061
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:933
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition TSystem.cxx:1030
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.
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 ...
TSessionViewer * fViewer
void UploadDataSet()
Upload the dataset to the server.
virtual ~TUploadDataSetDlg()
Delete chain dialog.
void OnOverwriteDataset(Bool_t on)
Notification of Overwrite Dataset check button.
TGLVContainer * fLVContainer
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for upload dataset dialog.
TGTextButton * fRemoveButton
TGTextButton * fUploadButton
TGTextEntry * fLocationURL
TGCheckButton * fOverwriteDSet
TGTextEntry * fDestinationURL
TGTextEntry * fDSetName
TGTextButton * fAddButton
virtual void CloseWindow()
Close upload dataset dialog.
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
TText * text
int main()
auto * lv
Definition textalign.C:5