Logo ROOT  
Reference Guide
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 "TGPicture.h"
35#include "TGFSContainer.h"
36#include "TGFileDialog.h"
37#include "TGListTree.h"
38#include "TInterpreter.h"
39#include "TApplication.h"
40#include "TKey.h"
41#include "TObjString.h"
42#include "TGTableLayout.h"
43#include "TProof.h"
44#include "TFileInfo.h"
45#include "TGMsgBox.h"
46#include "TRegexp.h"
47#include "TVirtualX.h"
48
51
52/* not yet used
53static const char *gParTypes[] = {
54 "Par files", "*.par",
55 "All files", "*",
56 0, 0
57};
58*/
59
60static const char *gDatasetTypes[] = {
61 "ROOT files", "*.root",
62 "All files", "*",
63 0, 0
64};
65
66static const char *gFileTypes[] = {
67 "C files", "*.[C|c]*",
68 "ROOT files", "*.root",
69 "All files", "*",
70 0, 0
71};
72
73//////////////////////////////////////////////////////////////////////////
74// New Chain Dialog
75//////////////////////////////////////////////////////////////////////////
76
77////////////////////////////////////////////////////////////////////////////////
78/// Create a new chain dialog box. Used to list chains present in memory
79/// and offers the possibility to create new ones by executing macros
80/// directly from the associate file container.
81
84{
85 Pixel_t backgnd;
86 if (!p || !main) return;
88 fClient->GetColorByName("#F0FFF0", backgnd);
89 AddFrame(new TGLabel(this, new TGHotString("List of Chains in Memory :")),
90 new TGLayoutHints(kLHintsLeft, 5, 5, 7, 2) );
91
92 // Add TGListView used to show objects in memory
93 fListView = new TGListView(this, 300, 100);
99
100 fListView->Connect("Clicked(TGLVEntry*, Int_t)", "TNewChainDlg",
101 this, "OnElementClicked(TGLVEntry* ,Int_t)");
102
103 // Add text entry showing type and name of user's selection
104 TGCompositeFrame* frmSel = new TGHorizontalFrame(this, 300, 100);
105 frmSel->SetCleanup(kDeepCleanup);
106 frmSel->AddFrame(new TGLabel(frmSel, new TGHotString("Selected chain :")),
107 new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 5, 5) );
108 fNameBuf = new TGTextBuffer(100);
109 fName = new TGTextEntry(frmSel, fNameBuf);
111 fName->Associate(this);
113 fName->ChangeBackground(backgnd);
115 AddFrame(frmSel, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
116
117 AddFrame(new TGLabel(this, "Double-click on the macro to be executed to create a new Chain:"),
118 new TGLayoutHints(kLHintsCenterX, 5, 5, 5, 2));
119
120 // Add TGListview / TGFileContainer to allow user to execute Macros
121 // for the creation of new TChains / TDSets
122 TGListView* lv = new TGListView(this, 300, 100);
124
125 Pixel_t white;
126 gClient->GetColorByName("white",white);
129 fContents->SetFilter("*.[C|c]*");
131 fContents->Associate(this);
134 fContents->AddFile(".."); // up level directory
135 fContents->Resize();
136 fContents->StopRefreshTimer(); // stop refreshing
137
138 // position relative to the parent's window
139 Window_t wdummy;
140 Int_t ax, ay;
141 gVirtualX->TranslateCoordinates( main->GetId(),
143 0, 0, ax, ay, wdummy);
144 Move(ax + 200, ay + 35);
145
146 TGCompositeFrame *tmp;
147 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
150 // Apply and Close buttons
151 tmp->AddFrame(fOkButton = new TGTextButton(tmp, "&Ok", 0),
152 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
153 tmp->AddFrame(fCancelButton = new TGTextButton(tmp, "&Cancel", 1),
154 new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
155 fOkButton->Associate(this);
158
159 SetWindowName("Chain Selection Dialog");
161 Layout();
163 MapWindow();
164 UpdateList();
165}
166
167////////////////////////////////////////////////////////////////////////////////
168/// Delete chain dialog.
169
171{
172 if (IsZombie()) return;
173 delete fLVContainer;
174 delete fContents;
175 Cleanup();
176}
177
178////////////////////////////////////////////////////////////////////////////////
179/// Emits OnElementSelected signal if dset is not zero.
180
182{
183 if (obj && (obj->IsA() == TChain::Class() ||
184 obj->IsA() == TDSet::Class())) {
185 Emit("OnElementSelected(TObject *)", (Long_t)obj);
186 }
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Handle click in the Memory list view and put the type
191/// and name of selected object in the text entry.
192
194{
195 fChain = (TObject *)entry->GetUserData();
196 if (fChain->IsA() == TChain::Class()) {
197 TString s = TString::Format("%s : %s" , ((TChain *)fChain)->GetTitle(),
198 ((TChain *)fChain)->GetName());
199 fName->SetText(s);
200 }
201 else if (fChain->IsA() == TDSet::Class()) {
202 TString s = TString::Format("%s : %s" , ((TDSet *)fChain)->GetName(),
203 ((TDSet *)fChain)->GetObjName());
204 fName->SetText(s);
205 }
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Update Memory list view.
211
213{
214 TGLVEntry *item=0;
215 TObject *obj = 0;
216 fChains = gROOT->GetListOfDataSets();
218 if (!fChains) return;
219 TIter next(fChains);
220 // loop on the list of chains/datasets in memory,
221 // and fill the associated listview
222 while ((obj = (TObject *)next())) {
223 item = 0;
224 if (obj->IsA() == TChain::Class()) {
225 const char *title = ((TChain *)obj)->GetTitle();
226 if (!title[0])
227 ((TChain *)obj)->SetTitle("TChain");
228 item = new TGLVEntry(fLVContainer, ((TChain *)obj)->GetName(),
229 ((TChain *)obj)->GetTitle());
230 }
231 else if (obj->IsA() == TDSet::Class()) {
232 item = new TGLVEntry(fLVContainer, ((TDSet *)obj)->GetObjName(),
233 ((TDSet *)obj)->GetName());
234 }
235 if (item) {
236 item->SetUserData(obj);
237 fLVContainer->AddItem(item);
238 }
239 }
241 Resize();
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// Display content of directory.
246
248{
250 gSystem->ChangeDirectory(fname);
253 fContents->AddFile(".."); // up level directory
254 Resize();
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// Handle double click in the File container.
259
261{
262 if (btn!=kButton1) return;
263 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kWatch));
264
265 TString name(f->GetTitle());
266
267 // Check if the file is a root macro file type
268 if (name.Contains(".C")) {
269 // form the command
270 TString command = TString::Format(".x %s/%s",
272 name.Data());
273 // and process
274 gApplication->ProcessLine(command.Data());
275 UpdateList();
276 } else {
277 // if double clicked on a directory, then display it
279 }
280 gVirtualX->SetCursor(fContents->GetId(),gVirtualX->CreateCursor(kPointer));
281}
282
283////////////////////////////////////////////////////////////////////////////////
284/// Process messages for new chain dialog.
285
287{
288 switch (GET_MSG(msg)) {
289 case kC_COMMAND:
290 switch (GET_SUBMSG(msg)) {
291 case kCM_BUTTON:
292 switch (parm1) {
293
294 case 0:
295 // Apply button
298 DeleteWindow();
299 break;
300
301 case 1:
302 // Close button
303 fChain = 0;
304 DeleteWindow();
305 break;
306 }
307 break;
308 default:
309 break;
310 }
311 break;
312
313 case kC_CONTAINER:
314 switch (GET_SUBMSG(msg)) {
315 case kCT_ITEMDBLCLICK:
316 if (parm1==kButton1) {
317 TGLVEntry *lv_entry = (TGLVEntry *)fContents->GetLastActive();
318 if (lv_entry) OnDoubleClick(lv_entry, parm1);
319 }
320 break;
321 }
322 break;
323 default:
324 break;
325 }
326 return kTRUE;
327}
328
329////////////////////////////////////////////////////////////////////////////////
330/// Close file dialog.
331
333{
334 DeleteWindow();
335}
336
337
338//////////////////////////////////////////////////////////////////////////
339// New Query Dialog
340//////////////////////////////////////////////////////////////////////////
341
342////////////////////////////////////////////////////////////////////////////////
343/// Create a new Query dialog, used by the Session Viewer, to Edit a Query if
344/// the editmode flag is set, or to create a new one if not set.
345
347 TQueryDescription *query, Bool_t editmode) :
348 TGTransientFrame(gClient->GetRoot(), gui, Width, Height)
349{
350 Window_t wdummy;
351 Int_t ax, ay;
352 fEditMode = editmode;
354 fChain = 0;
355 fQuery = query;
356 if (fQuery && fQuery->fChain) {
358 }
359 Build(gui);
360 // if in edit mode, update fields with query description data
361 if (editmode && query)
362 UpdateFields(query);
363 else if (!editmode) {
364 TQueryDescription *fquery;
366 if(fquery)
368 else
369 fTxtQueryName->SetText("Query 1");
370 }
372 Resize(Width, Height);
373 // hide options frame
375 fBtnMore->SetText(" More >> ");
376 SetWMSizeHints(Width+5, Height+25, Width+5, Height+25, 1, 1);
378 Layout();
379 SetWindowName("Query Dialog");
380 // Position relative to parent
381 gVirtualX->TranslateCoordinates( fViewer->GetId(),
383 0, 0, ax, ay, wdummy);
384 Move(ax + fViewer->GetWidth()/2, ay + 35);
385}
386
387////////////////////////////////////////////////////////////////////////////////
388/// Delete query dialog.
389
391{
392 if (IsZombie()) return;
393 Cleanup();
394}
395
396////////////////////////////////////////////////////////////////////////////////
397/// Build the "new query" dialog.
398
400{
401 TGButton* btnTmp;
402 fViewer = gui;
405 SetMinWidth(500);
406 fFrmNewQuery = new TGGroupFrame(this, "New Query");
408
410 kLHintsExpandY, 2, 2, 2, 2));
412
413 // add "Query Name" label and text entry
414 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Query Name :"),
415 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 4, 0));
417 (const char *)0, 1), new TGTableLayoutHints(1, 2, 0, 1,
418 kLHintsCenterY, 5, 5, 4, 0));
419
420 // add "TChain" label and text entry
421 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "TChain :"),
422 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 4, 0));
424 (const char *)0, 2), new TGTableLayoutHints(1, 2, 1, 2,
425 kLHintsCenterY, 5, 5, 4, 0));
426 fTxtChain->SetToolTipText("Specify TChain or TDSet from memory or file");
428 // add "Browse" button
429 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
430 new TGTableLayoutHints(2, 3, 1, 2, kLHintsCenterY, 5, 0, 4, 8));
431 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseChain()");
432
433 // add "Selector" label and text entry
434 fFrmNewQuery->AddFrame(new TGLabel(fFrmNewQuery, "Selector :"),
435 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
437 (const char *)0, 3), new TGTableLayoutHints(1, 2, 2, 3,
438 kLHintsCenterY, 5, 5, 0, 0));
439 // add "Browse" button
440 fFrmNewQuery->AddFrame(btnTmp = new TGTextButton(fFrmNewQuery, "Browse..."),
441 new TGTableLayoutHints(2, 3, 2, 3, kLHintsCenterY, 5, 0, 0, 8));
442 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseSelector()");
443
444 // add "Less <<" ("More >>") button
446 new TGTableLayoutHints(2, 3, 4, 5, kLHintsCenterY, 5, 5, 4, 0));
447 fBtnMore->Connect("Clicked()", "TNewQueryDlg", this, "OnNewQueryMore()");
448
449 // add (initially hidden) options frame
450 fFrmMore = new TGCompositeFrame(fFrmNewQuery, 200, 200);
452
456
457 // add "Options" label and text entry
458 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Options :"),
459 new TGTableLayoutHints(0, 1, 0, 1, kLHintsCenterY, 0, 5, 0, 0));
461 (const char *)0, 4), new TGTableLayoutHints(1, 2, 0, 1, 0, 22,
462 0, 0, 8));
463 fTxtOptions->SetText("ASYN");
464
465 // add "Nb Entries" label and number entry
466 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Nb Entries :"),
467 new TGTableLayoutHints(0, 1, 1, 2, kLHintsCenterY, 0, 5, 0, 0));
471 0, 22, 0, 0, 8));
472 // coverity[negative_returns]: no problem with -1, the format is kNESInteger
474 // add "First Entry" label and number entry
475 fFrmMore->AddFrame(new TGLabel(fFrmMore, "First entry :"),
476 new TGTableLayoutHints(0, 1, 2, 3, kLHintsCenterY, 0, 5, 0, 0));
480 22, 0, 0, 8));
481
482 // add "Event list" label and text entry
483 fFrmMore->AddFrame(new TGLabel(fFrmMore, "Event list :"),
484 new TGTableLayoutHints(0, 1, 3, 4, kLHintsCenterY, 0, 5, 0, 0));
486 (const char *)0, 6), new TGTableLayoutHints(1, 2, 3, 4, 0, 22,
487 5, 0, 0));
488 // add "Browse" button
489 fFrmMore->AddFrame(btnTmp = new TGTextButton(fFrmMore, "Browse..."),
490 new TGTableLayoutHints(2, 3, 3, 4, 0, 6, 0, 0, 8));
491 btnTmp->Connect("Clicked()", "TNewQueryDlg", this, "OnBrowseEventList()");
492
494 fTxtChain->Associate(this);
495 fTxtSelector->Associate(this);
496 fTxtOptions->Associate(this);
497 fNumEntries->Associate(this);
500
501 fTxtQueryName->Connect("TextChanged(char*)", "TNewQueryDlg", this,
502 "SettingsChanged()");
503 fTxtChain->Connect("TextChanged(char*)", "TNewQueryDlg", this,
504 "SettingsChanged()");
505 fTxtSelector->Connect("TextChanged(char*)", "TNewQueryDlg", this,
506 "SettingsChanged()");
507 fTxtOptions->Connect("TextChanged(char*)", "TNewQueryDlg", this,
508 "SettingsChanged()");
509 fNumEntries->Connect("ValueChanged(Long_t)", "TNewQueryDlg", this,
510 "SettingsChanged()");
511 fNumFirstEntry->Connect("ValueChanged(Long_t)", "TNewQueryDlg", this,
512 "SettingsChanged()");
513 fTxtEventList->Connect("TextChanged(char*)", "TNewQueryDlg", this,
514 "SettingsChanged()");
515
516 TGCompositeFrame *tmp;
517 AddFrame(tmp = new TGCompositeFrame(this, 140, 20, kHorizontalFrame),
520 // Add "Save" and "Save & Submit" buttons if we are in edition mode
521 // or "Add" and "Add & Submit" if we are not in edition mode.
522 if (fEditMode) {
523 fBtnSave = new TGTextButton(tmp, "Save");
524 fBtnSubmit = new TGTextButton(tmp, "Save && Submit");
525 }
526 else {
527 fBtnSave = new TGTextButton(tmp, "Add");
528 fBtnSubmit = new TGTextButton(tmp, "Add && Submit");
529 }
531 3, 3, 3, 3));
533 3, 3, 3, 3));
534 fBtnSave->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSaveClicked()");
535 fBtnSubmit->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnSubmitClicked()");
536 tmp->AddFrame(fBtnClose = new TGTextButton(tmp, "Close"),
537 new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 3, 3, 3, 3));
538 fBtnClose->Connect("Clicked()", "TNewQueryDlg", this, "OnBtnCloseClicked()");
541}
542
543////////////////////////////////////////////////////////////////////////////////
544/// Called when window is closed via the window manager.
545
547{
548 DeleteWindow();
549}
550
551////////////////////////////////////////////////////////////////////////////////
552/// Show/hide options frame and update button text accordingly.
553
555{
558 fBtnMore->SetText(" More >> ");
559 }
560 else {
562 fBtnMore->SetText(" Less << ");
563 }
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Call new chain dialog.
568
570{
571 TNewChainDlg *dlg = new TNewChainDlg(fClient->GetRoot(), this);
572 dlg->Connect("OnElementSelected(TObject *)", "TNewQueryDlg",
573 this, "OnElementSelected(TObject *)");
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Handle OnElementSelected signal coming from new chain dialog.
578
580{
581 if (obj) {
582 fChain = obj;
583 if (obj->IsA() == TChain::Class())
585 else if (obj->IsA() == TDSet::Class())
586 fTxtChain->SetText(((TDSet *)fChain)->GetObjName());
587 }
588}
589
590////////////////////////////////////////////////////////////////////////////////
591/// Open file browser to choose selector macro.
592
594{
595 TGFileInfo fi;
597 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
598 if (!fi.fFilename) return;
600}
601
602////////////////////////////////////////////////////////////////////////////////
603///Browse event list
604
606{
607}
608
609////////////////////////////////////////////////////////////////////////////////
610/// Save current settings in main session viewer.
611
613{
614 // if we are in edition mode and query description is valid,
615 // use it, otherwise create a new one
616 TQueryDescription *newquery;
617 if (fEditMode && fQuery)
618 newquery = fQuery;
619 else
620 newquery = new TQueryDescription();
621
622 // update query description fields
623 newquery->fSelectorString = fTxtSelector->GetText();
624 if (fChain) {
625 newquery->fTDSetString = fChain->GetName();
626 newquery->fChain = fChain;
627 }
628 else {
629 newquery->fTDSetString = "";
630 newquery->fChain = 0;
631 }
632 newquery->fQueryName = fTxtQueryName->GetText();
633 newquery->fOptions.Form("%s",fTxtOptions->GetText());
634 newquery->fNoEntries = fNumEntries->GetIntNumber();
636 newquery->fNbFiles = 0;
637 newquery->fResult = 0;
638
639 if (newquery->fChain) {
640 if (newquery->fChain->IsA() == TChain::Class())
641 newquery->fNbFiles = ((TChain *)newquery->fChain)->GetListOfFiles()->GetEntriesFast();
642 else if (newquery->fChain->IsA() == TDSet::Class())
643 newquery->fNbFiles = ((TDSet *)newquery->fChain)->GetListOfElements()->GetSize();
644 }
645 if (!fEditMode) {
646 // if not in editor mode, create a new list tree item
647 // and set user data to the newly created query description
648 newquery->fResult = 0;
650
651 TQueryDescription *fquery;
653 while (fquery) {
654 int e = 1, j = 0, idx = 0;
655 const char *name = fquery->fQueryName;
656 for (int i=strlen(name)-1;i>0;i--) {
657 if (isdigit(name[i])) {
658 idx += (name[i]-'0') * e;
659 e *= 10;
660 j++;
661 }
662 else
663 break;
664 }
665 if (idx > 0) {
666 idx++;
667 newquery->fQueryName.Remove(strlen(name)-j,j);
668 newquery->fQueryName.Append(Form("%d",idx));
669 }
670 else
671 newquery->fQueryName.Append(" 1");
673 }
674 fTxtQueryName->SetText(newquery->fQueryName);
675 fViewer->GetActDesc()->fQueries->Add((TObject *)newquery);
680 item2->SetUserData(newquery);
685 fViewer->OnListTreeClicked(item2, 1, 0, 0);
686 }
687 else {
688 // else if in editor mode, just update user data with modified
689 // query description
692 item->SetUserData(newquery);
693 }
694 // update list tree
700}
701
702////////////////////////////////////////////////////////////////////////////////
703/// Save and submit query description.
704
706{
709}
710
711////////////////////////////////////////////////////////////////////////////////
712/// Close dialog.
713
715{
716 Int_t result = kMBNo;
717 if (fModified) {
718 new TGMsgBox(fClient->GetRoot(), this, "Modified Settings",
719 "Do you wish to SAVE changes ?", 0,
720 kMBYes | kMBNo | kMBCancel, &result);
721 if (result == kMBYes) {
723 }
724 }
725 if (result == kMBNo) {
726 DeleteWindow();
727 }
728}
729
730////////////////////////////////////////////////////////////////////////////////
731/// Display dialog and set focus to query name text entry.
732
734{
735 MapWindow();
737}
738
739////////////////////////////////////////////////////////////////////////////////
740/// Settings have changed, update GUI accordingly.
741
743{
744 if (fEditMode && fQuery) {
745 if ((strcmp(fQuery->fSelectorString.Data(), fTxtSelector->GetText())) ||
746 (strcmp(fQuery->fQueryName.Data(), fTxtQueryName->GetText())) ||
747 (strcmp(fQuery->fOptions.Data(), fTxtOptions->GetText())) ||
750 (fQuery->fChain != fChain)) {
752 }
753 else {
755 }
756 }
757 else {
758 if ((fTxtQueryName->GetText()) &&
759 ((fTxtQueryName->GetText()) ||
760 (fTxtChain->GetText())))
762 else
764 }
765 if (fModified) {
768 }
769 else {
772 }
773}
774
775////////////////////////////////////////////////////////////////////////////////
776/// Update entry fields with query description values.
777
779{
780 fQuery = desc;
782 fTxtChain->SetText("");
783 if (desc->fChain)
790}
791////////////////////////////////////////////////////////////////////////////////
792/// Process messages for new query dialog.
793/// Essentially used to navigate between text entry fields.
794
796{
797 switch (GET_MSG(msg)) {
798 case kC_TEXTENTRY:
799 switch (GET_SUBMSG(msg)) {
800 case kTE_ENTER:
801 case kTE_TAB:
802 switch (parm1) {
803 case 1: // Query Name
806 break;
807 case 2: // Chain Name
810 break;
811 case 3: // Selector Name
814 break;
815 case 4: // Options
818 break;
819 case 6: // Event List
822 break;
823 }
824 break;
825
826 default:
827 break;
828 }
829 break;
830
831 default:
832 break;
833 }
834 return kTRUE;
835}
836
837//////////////////////////////////////////////////////////////////////////
838// Upload DataSet Dialog
839//////////////////////////////////////////////////////////////////////////
840
841////////////////////////////////////////////////////////////////////////////////
842/// Create a Upload DataSet dialog box. Used to create and upload a dataset
843
845 TGTransientFrame(gClient->GetRoot(), gui, w, h)
846{
848 if (!gui) return;
849 fViewer = gui;
850
852 TGHorizontalFrame *hFrame1 = new TGHorizontalFrame(this);
853 hFrame1->SetCleanup(kDeepCleanup);
854 hFrame1->AddFrame(new TGLabel(hFrame1,"Name of DataSet :"),
856 10, 10, 5, 5));
857 fDSetName = new TGTextEntry(hFrame1, new TGTextBuffer(50));
858 fDSetName->SetText("DataSet1");
861 10, 10, 5, 5));
863 2, 2, 2, 2));
864
865 // "DataSet Files" group frame
866 TGGroupFrame *groupFrame1 = new TGGroupFrame(this, "DataSet Files");
867 groupFrame1->SetCleanup(kDeepCleanup);
868
869 // horizontal frame for files location URL
870 TGHorizontalFrame *hFrame11 = new TGHorizontalFrame(groupFrame1);
871 hFrame11->SetCleanup(kDeepCleanup);
872 hFrame11->AddFrame(new TGLabel(hFrame11,"Location URL :"),
874 10, 10, 5, 5));
875 fLocationURL = new TGTextEntry(hFrame11, new TGTextBuffer(150));
876 fLocationURL->SetToolTipText("Enter location URL (i.e \"root://host//path/to/file.root\")");
879 kLHintsCenterY, 10, 10, 5, 5));
880 fAddButton = new TGTextButton(hFrame11, " Add >> ", 0);
881 fAddButton->SetToolTipText("Add file(s) to the list");
882 fAddButton->Associate(this);
884 kLHintsExpandX, 5, 10, 5, 5));
885 groupFrame1->AddFrame(hFrame11, new TGLayoutHints(kLHintsLeft | kLHintsTop |
886 kLHintsExpandX, 2, 2, 2, 2));
887 // horizontal frame for the list view displaying list of files
888 // and for a vertical frame with control buttons
889 TGHorizontalFrame *hFrame2 = new TGHorizontalFrame(groupFrame1);
890 hFrame2->SetCleanup(kDeepCleanup);
891
892 // list view
893 // Add TGListView used to show list of files
894 fListView = new TGListView(hFrame2, 300, 100);
900 fLVContainer->SetHeader("File Name", kTextLeft, kTextLeft , 0);
902 kLHintsExpandX | kLHintsExpandY, 2, 2, 10, 10));
903
904 // vertical frame for control buttons
905 TGVerticalFrame *vFrame1 = new TGVerticalFrame(hFrame2);
906 vFrame1->SetCleanup(kDeepCleanup);
907
908 fBrowseButton = new TGTextButton(vFrame1, " Browse... ", 1);
909 fBrowseButton->SetToolTipText("Add file(s) to the list");
912 kLHintsExpandX, 15, 5, 5, 5));
913 fRemoveButton = new TGTextButton(vFrame1, " Remove ", 2);
914 fRemoveButton->SetToolTipText("Remove selected file from the list");
917 kLHintsExpandX, 15, 5, 5, 5));
918 fClearButton = new TGTextButton(vFrame1, " Clear ", 3);
919 fClearButton->SetToolTipText("Clear list of files");
920 fClearButton->Associate(this);
922 kLHintsExpandX, 15, 5, 5, 5));
923
924 fOverwriteDSet = new TGCheckButton(vFrame1, "Overwrite DataSet");
925 fOverwriteDSet->SetToolTipText("Overwrite DataSet");
927 kLHintsExpandX, 15, 5, 5, 5));
928 fOverwriteFiles = new TGCheckButton(vFrame1, "Overwrite Files");
929 fOverwriteFiles->SetToolTipText("Overwrite files in DataSet");
931 kLHintsExpandX, 15, 5, 5, 5));
932 fAppendFiles = new TGCheckButton(vFrame1, "Append Files");
933 fAppendFiles->SetToolTipText("Append files in DataSet");
935 kLHintsExpandX, 15, 5, 5, 5));
936
937 fOverwriteDSet->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
938 "OnOverwriteDataset(Bool_t)");
939 fOverwriteFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
940 "OnOverwriteFiles(Bool_t)");
941 fAppendFiles->Connect("Toggled(Bool_t)", "TUploadDataSetDlg", this,
942 "OnAppendFiles(Bool_t)");
943
944 hFrame2->AddFrame(vFrame1, new TGLayoutHints(kLHintsRight | kLHintsTop |
945 kLHintsExpandY, 2, 2, 2, 2));
946 groupFrame1->AddFrame(hFrame2, new TGLayoutHints(kLHintsLeft | kLHintsTop |
947 kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 2));
948
949 AddFrame(groupFrame1, new TGLayoutHints(kLHintsLeft | kLHintsTop |
950 kLHintsExpandX, 5, 5, 2, 2));
951
952 // horizontal frame for destination URL
953 TGHorizontalFrame *hFrame3 = new TGHorizontalFrame(this);
954 hFrame3->SetCleanup(kDeepCleanup);
955 hFrame3->AddFrame(new TGLabel(hFrame3,"Destination URL :"),
957 15, 10, 5, 5));
958 fDestinationURL = new TGTextEntry(hFrame3, new TGTextBuffer(150));
959 if (fViewer->GetActDesc()->fConnected &&
963 // const char *dest = fViewer->GetActDesc()->fProof->GetDataPoolUrl();
964 // fDestinationURL->SetText(dest);
965 }
966 fDestinationURL->SetToolTipText("Enter destination URL ( relative to \" root://host//proofpool/user/ \" )");
969 kLHintsCenterY, 10, 15, 5, 5));
971 2, 2, 2, 2));
972
973 // horizontal frame for upload and close buttons
974 TGHorizontalFrame *hFrame4 = new TGHorizontalFrame(this);
975 hFrame4->SetCleanup(kDeepCleanup);
976 fUploadButton = new TGTextButton(hFrame4, "Upload DataSet", 10);
977 fUploadButton->SetToolTipText("Upload the dataset to the cluster");
980 kLHintsExpandX, 15, 15, 2, 2));
981 fCloseDlgButton = new TGTextButton(hFrame4, "Close Dialog", 11);
982 fCloseDlgButton->SetToolTipText("Close the dialog");
985 kLHintsExpandX, 15, 15, 2, 2));
987 2, 2, 2, 2));
988
989 // position relative to the parent's window
990 Window_t wdummy;
991 Int_t ax, ay;
992 gVirtualX->TranslateCoordinates( gui->GetId(),
994 0, 0, ax, ay, wdummy);
995 Move(ax + 250, ay + 200);
996
997 SetWindowName("Upload DataSet Dialog");
999 MapWindow();
1000
1001 Resize(w, h);
1002 SetWMSizeHints(w+5, h+5, w+5, h+5, 1, 1);
1004 Layout();
1005}
1006
1007////////////////////////////////////////////////////////////////////////////////
1008/// Delete chain dialog.
1009
1011{
1012 if (IsZombie()) return;
1013 Cleanup();
1014}
1015
1016////////////////////////////////////////////////////////////////////////////////
1017/// Close upload dataset dialog.
1018
1020{
1021 if (!fUploading)
1022 DeleteWindow();
1023}
1024
1025////////////////////////////////////////////////////////////////////////////////
1026/// Process messages for upload dataset dialog.
1027
1029{
1030 switch (GET_MSG(msg)) {
1031 case kC_COMMAND:
1032 switch (GET_SUBMSG(msg)) {
1033 case kCM_BUTTON:
1034 switch (parm1) {
1035 case 0:
1036 // Add button
1037 if (fLocationURL->GetText())
1039 break;
1040 case 1:
1041 // Add button
1042 BrowseFiles();
1043 break;
1044 case 2:
1045 // Remove button
1046 RemoveFile();
1047 break;
1048 case 3:
1049 // Clear button
1050 ClearFiles();
1051 break;
1052 case 10:
1053 // Upload button
1054 UploadDataSet();
1055 break;
1056 case 11:
1057 // Close button
1058 CloseWindow();
1059 break;
1060 }
1061 break;
1062 default:
1063 break;
1064 }
1065 break;
1066
1067 default:
1068 break;
1069 }
1070 return kTRUE;
1071}
1072
1073////////////////////////////////////////////////////////////////////////////////
1074/// Add File name(s) from the file location URL to the list view.
1075
1076void TUploadDataSetDlg::AddFiles(const char *fileName)
1077{
1078 if (strlen(fileName) < 5)
1079 return;
1080 if (strstr(fileName,"*.")) {
1081 // wildcarding case
1082 void *filesDir = gSystem->OpenDirectory(gSystem->GetDirName(fileName));
1083 const char* ent;
1084 TString filesExp(gSystem->BaseName(fileName));
1085 filesExp.ReplaceAll("*",".*");
1086 TRegexp rg(filesExp);
1087 while ((ent = gSystem->GetDirEntry(filesDir))) {
1088 TString entryString(ent);
1089 if (entryString.Index(rg) != kNPOS &&
1090 gSystem->AccessPathName(Form("%s/%s", gSystem->GetDirName(fileName).Data(),
1091 ent), kReadPermission) == kFALSE) {
1092 TString text = TString::Format("%s/%s",
1093 gSystem->UnixPathName(gSystem->GetDirName(fileName)), ent);
1094 if (!fLVContainer->FindItem(text.Data())) {
1095 TGLVEntry *entry = new TGLVEntry(fLVContainer, text.Data(), text.Data());
1096 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1097 gClient->GetPicture("rootdb_t.xpm"));
1098 fLVContainer->AddItem(entry);
1099 }
1100 }
1101 }
1102 }
1103 else {
1104 // single file
1105 if (!fLVContainer->FindItem(fileName)) {
1106 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName, fileName);
1107 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1108 gClient->GetPicture("rootdb_t.xpm"));
1109 fLVContainer->AddItem(entry);
1110 }
1111 }
1112 // update list view
1114 fListView->Layout();
1116}
1117
1118////////////////////////////////////////////////////////////////////////////////
1119/// Add File name(s) from the file location URL to the list view.
1120
1122{
1123 TObjString *el;
1124 TIter next(fileList);
1125 while ((el = (TObjString *) next())) {
1126 TString fileName = TString::Format("%s/%s",
1128 gSystem->BaseName(el->GetString()));
1129 // single file
1130 if (!fLVContainer->FindItem(fileName.Data())) {
1131 TGLVEntry *entry = new TGLVEntry(fLVContainer, fileName.Data(), fileName.Data());
1132 entry->SetPictures(gClient->GetPicture("rootdb_t.xpm"),
1133 gClient->GetPicture("rootdb_t.xpm"));
1134 fLVContainer->AddItem(entry);
1135 }
1136 }
1137 // update list view
1139 fListView->Layout();
1141}
1142
1143////////////////////////////////////////////////////////////////////////////////
1144/// Opens the TGFileDialog to allow user to select local file(s) to be added
1145/// in the list view of dataset files.
1146
1148{
1149 TGFileInfo fi;
1151 fi.SetFilename("*.root");
1152 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);
1153 if (fi.fMultipleSelection && fi.fFileNamesList) {
1155 }
1156 else if (fi.fFilename) {
1157 AddFiles(fi.fFilename);
1158 }
1159}
1160
1161////////////////////////////////////////////////////////////////////////////////
1162/// Clear content of the list view.
1163
1165{
1167 fListView->Layout();
1168 // update list view
1170}
1171
1172////////////////////////////////////////////////////////////////////////////////
1173/// Notification of Overwrite Dataset check button.
1174
1176{
1177 if (on && fAppendFiles->IsOn())
1179}
1180
1181////////////////////////////////////////////////////////////////////////////////
1182/// Notification of Overwrite Files check button.
1183
1185{
1186}
1187
1188////////////////////////////////////////////////////////////////////////////////
1189/// Notification of Append Files check button.
1190
1192{
1193 if (on && fOverwriteDSet->IsOn())
1195}
1196
1197////////////////////////////////////////////////////////////////////////////////
1198/// Remove the selected entry from the list view.
1199
1201{
1203 fLVContainer->RemoveItem(item);
1204 // update list view
1206 fListView->Layout();
1208}
1209
1210////////////////////////////////////////////////////////////////////////////////
1211/// Upload the dataset to the server.
1212
1214{
1215 Int_t retval;
1216 TString fileList;
1217 const char *dsetName = fDSetName->GetText();
1218 const char *destination = fDestinationURL->GetText();
1219 UInt_t flags = 0;
1220
1221 if (fUploading)
1222 return;
1223
1224 if (!fViewer->GetActDesc()->fConnected ||
1226 !fViewer->GetActDesc()->fProof ||
1227 !fViewer->GetActDesc()->fProof->IsValid()) {
1228 return;
1229 }
1230
1231 TList *skippedFiles = new TList();
1232 TList *datasetFiles = new TList();
1233
1234 // Format upload flags with user selection
1235 if (fOverwriteDSet->IsOn())
1237 else
1239 if (fOverwriteFiles->IsOn())
1241 else
1243 if (fAppendFiles->IsOn()) {
1244 flags |= TProof::kAppend;
1245 if (flags & TProof::kNoOverwriteDataSet)
1246 flags &= ~TProof::kNoOverwriteDataSet;
1247 }
1248
1249 Int_t ret = 0;
1250 TIter next(fLVContainer->GetList());
1251 TGFrameElement *el;
1252 TGLVEntry *entry;
1253
1254 while ((el = (TGFrameElement *)next())) {
1255 entry = (TGLVEntry *) el->fFrame;
1256 const char *fname = gSystem->UnixPathName(entry->GetTitle());
1257 datasetFiles->Add(new TFileInfo(fname));
1258 }
1259 fUploading = kTRUE;
1262
1263 if (strlen(destination) < 2) destination = 0;
1264
1265 // GG 17/8/2012 -- BEGIN
1266 // NB: UploadDataSet is obsolete; these changes are the minimal ones to make
1267 // the build after the removal of an obsolete structure in TProof.h;
1268 // but all this needs to be reconsidered.
1269 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1270 datasetFiles, destination, flags, skippedFiles);
1271#if 0
1272 if (ret == TProof::kDataSetExists) {
1273 // ask user what to do :
1274 // cancel/overwrite and change option
1275 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1276 TString::Format("The dataset \"%s\" already exists on the cluster ! Overwrite ?",
1278 &retval);
1279 if (retval == kMBYes) {
1280 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1281 datasetFiles, destination,
1284 skippedFiles);
1285 }
1286 if (retval == kMBAppend) {
1287 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1288 datasetFiles, destination,
1291 skippedFiles);
1292 }
1293 }
1294#endif
1295 if (ret != 0) {
1296 // Inform user
1297 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1298 "Failed uploading dataset/files to the cluster",
1299 kMBIconExclamation, kMBOk, &retval);
1303 return;
1304 }
1305 // Here we cope with files that existed on the cluster and were skipped.
1306 if (skippedFiles->GetSize()) {
1307 TIter nexts(skippedFiles);
1308 while (TFileInfo *obj = (TFileInfo*)nexts()) {
1309 // Notify user that file: obj->GetFirstUrl()->GetUrl() exists on
1310 // the cluster and ask user what to do
1311 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1312 TString::Format("The file \"%s\" already exists on the cluster ! Overwrite ?",
1313 obj->GetFirstUrl()->GetUrl()), kMBIconQuestion,
1314 kMBYes | kMBNo | kMBYesAll | kMBNoAll | kMBDismiss, &retval);
1315 if (retval == kMBYesAll) {
1316 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1317 skippedFiles, destination,
1320 if (ret != 0) {
1321 // Inform user
1322 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1323 TString::Format("Failed uploading \"%s\" to the cluster",
1324 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1325 kMBOk, &retval);
1326 }
1327 else {
1328 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1329 "Files have been successfully uploaded to the cluster",
1330 kMBIconAsterisk, kMBOk, &retval);
1331 }
1335 return;
1336 }
1337 if ((retval == kMBNoAll) || (retval == kMBDismiss)) {
1338 break;
1339 }
1340 if (retval == kMBYes) {
1341 // Append one file to the dataSet
1342 ret = fViewer->GetActDesc()->fProof->UploadDataSet(dsetName,
1343 obj->GetFirstUrl()->GetUrl(), destination,
1345 if (ret != 0) {
1346 // Inform user
1347 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1348 TString::Format("Failed uploading \"%s\" to the cluster",
1349 obj->GetFirstUrl()->GetUrl()), kMBIconExclamation,
1350 kMBOk, &retval);
1351 }
1352 else {
1353 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1354 "Files have been successfully uploaded to the cluster",
1355 kMBIconAsterisk, kMBOk, &retval);
1356 }
1357 }
1358 }
1359 skippedFiles->Clear();
1360 }
1361 else {
1362 new TGMsgBox(fClient->GetRoot(), this, "Upload DataSet",
1363 "Files have been successfully uploaded to the cluster",
1364 kMBIconAsterisk, kMBOk, &retval);
1365 }
1366 // GG 17/8/2012 -- END
1367
1368 // finally, update list of datasets in session viewer
1373}
1374
void Class()
Definition: Class.C:29
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedSize
Definition: GuiTypes.h:390
@ kWatch
Definition: GuiTypes.h:374
@ kPointer
Definition: GuiTypes.h:374
ULong_t Pixel_t
Definition: GuiTypes.h:39
@ kButton1
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
#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:113
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:166
@ kFDOpen
Definition: TGFileDialog.h:38
@ kDeepCleanup
Definition: TGFrame.h:51
@ 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:43
@ kMBNoAll
Definition: TGMsgBox.h:52
@ kMBYes
Definition: TGMsgBox.h:42
@ kMBAppend
Definition: TGMsgBox.h:53
@ kMBCancel
Definition: TGMsgBox.h:48
@ kMBOk
Definition: TGMsgBox.h:44
@ kMBYesAll
Definition: TGMsgBox.h:51
@ kMBDismiss
Definition: TGMsgBox.h:50
@ kMBIconExclamation
Definition: TGMsgBox.h:35
@ kMBIconAsterisk
Definition: TGMsgBox.h:36
@ kMBIconQuestion
Definition: TGMsgBox.h:34
@ kTextLeft
Definition: TGWidget.h:34
char name[80]
Definition: TGX11.cxx:109
#define gROOT
Definition: TROOT.h:406
static const char * gFileTypes[]
static const char * gDatasetTypes[]
char * Form(const char *fmt,...)
@ kReadPermission
Definition: TSystem.h:46
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#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:34
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
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:36
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:397
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:411
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
virtual Bool_t IsOn() const
Definition: TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1202
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:394
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:984
virtual TList * GetList() const
Definition: TGFrame.h:347
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1027
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
Bool_t IsVisible(TGFrame *f) const
Get state of sub frame.
Definition: TGFrame.cxx:1215
virtual void Associate(const TGWindow *w)
Definition: TGCanvas.h:99
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition: TGCanvas.cxx:655
virtual TGFrame * GetLastActive() const
Definition: TGCanvas.h:137
virtual void RemoveAll()
Remove all items from the container.
Definition: TGCanvas.cxx:636
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1685
virtual TGFileItem * AddFile(const char *name, const TGPicture *pic=0, const TGPicture *lpic=0)
Add file in container.
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 void SetFilter(const char *filter)
Set file selection filter.
const char * GetDirectory() const
TList * fFileNamesList
Definition: TGFileDialog.h:67
char * fFilename
Definition: TGFileDialog.h:61
const char ** fFileTypes
Definition: TGFileDialog.h:63
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
Definition: TGFileDialog.h:66
TGFrame * fFrame
Definition: TGLayout.h:119
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:693
virtual void SetMinWidth(UInt_t w)
Definition: TGFrame.h:273
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
Definition: TGFrame.cxx:277
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:577
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void MapWindow()
map window
Definition: TGFrame.h:229
UInt_t GetWidth() const
Definition: TGFrame.h:249
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.
Definition: TGListView.cxx:610
virtual void SetPictures(const TGPicture *bigpic=0, const TGPicture *smallpic=0)
change pictures
Definition: TGListView.cxx:294
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:1864
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
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:596
virtual void SetFocus()
Set focus to this text entry.
const char * GetText() const
Definition: TGTextEntry.h:134
void SetEnabled(Bool_t flag=kTRUE)
Definition: TGTextEntry.h:164
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:84
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:326
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:577
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:692
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
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:357
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:149
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
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:131
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
TString & Append(const char *cs)
Definition: TString.h:559
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:2311
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:832
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:1291
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:849
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:858
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1058
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:930
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1027
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(int argc, char **argv)
static constexpr double s
auto * lv
Definition: textalign.C:5