Changeset 11088 for fact/tools/Edd
- Timestamp:
- 06/21/11 12:52:38 (14 years ago)
- Location:
- fact/tools/Edd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/Edd/Edd.cc
r10984 r11088 901 901 // Menu bar 902 902 QMenu* Menu = menuBar()->addMenu("&Menu"); 903 Menu->addAction("New history plot", this, SLOT(MenuNewHistory())); 903 Menu->addAction("Open history plot", this, SLOT(MenuNewHistory())); 904 Menu->addAction("Send command", this, SLOT(MenuCommand())); 904 905 Menu->addAction("Raw data browser", this, SLOT(MenuRawDataBrowser())); 905 906 Menu->addSeparator(); … … 939 940 } 940 941 941 // Open request fornew history plot942 // Open new history plot 942 943 void GUI::MenuNewHistory() { 943 944 … … 956 957 // Open dialog and open history window 957 958 QString Result = QInputDialog::getItem(this, "Edd Request", 958 "Enter DIM service name", List, 0, true, &OK); 959 "Enter or choose DIM service name (add index separated by colon)", List, 0, true, &OK); 960 961 // Check if cancelled or empty data 962 List = Result.trimmed().split(":", QString::SkipEmptyParts); 963 if (!OK || List.isEmpty()) return; 964 965 if (List.size() == 1) OpenHistory(List[0].toAscii().data(), 0); 966 else OpenHistory(List[0].toAscii().data(), atoi(List[1].toAscii().data())); 967 } 968 969 // Send command selected from list 970 void GUI::MenuCommand() { 971 972 QStringList List; 973 char *Name, *Format; 974 int Type; 975 bool OK; 976 977 // Find all DIM commands and sort 978 getServices("*"); 979 while ((Type = getNextService(Name, Format)) != 0) { 980 if (Type==DimCOMMAND) List.append(Name); 981 } 982 List.sort(); 983 984 // Open dialog and open window for entering command 985 QString Result = QInputDialog::getItem(this, "Edd Request", 986 "Enter or choose DIM command name", List, 0, true, &OK); 959 987 if (OK && !Result.isEmpty()) { 960 988 Result = Result.trimmed(); 961 QWidget *Hist = OpenHistory(Result.toAscii().data(), 0); 962 if (Hist != NULL) Hist->show(); 989 990 QMainWindow *M = new QMainWindow; 991 M->setCentralWidget(new QWidget(M)); 992 M->setStatusBar(new QStatusBar(M)); 993 M->setAttribute(Qt::WA_DeleteOnClose); 994 QWidget *W = new EddCommand(Result.toAscii().data()); 995 QFormLayout *FormLayout = new QFormLayout(M->centralWidget()); 996 FormLayout->setRowWrapPolicy(QFormLayout::WrapAllRows); 997 FormLayout->addRow("Enter argument for " + Result, W); 998 M->show(); 963 999 } 964 1000 } -
fact/tools/Edd/Edd.h
r10904 r11088 142 142 void MenuAbout(); 143 143 void MenuNewHistory(); 144 void MenuCommand(); 144 145 void MenuRawDataBrowser(); 145 146 void DetachTab(int, bool=false);
Note:
See TracChangeset
for help on using the changeset viewer.