MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / on_actionOpen_triggered

Method on_actionOpen_triggered

DSView/pv/toolbars/filebar.cpp:132–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void FileBar::on_actionOpen_triggered()
133{
134 //open data file
135 AppConfig &app = AppConfig::Instance();
136
137 if (_session->have_hardware_data() && _session->is_first_store_confirm()){
138 if (MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CAPDATE), "Save captured data?"))){
139 sig_save();
140 return;
141 }
142 }
143
144 // Show the dialog
145 const QString file_name = QFileDialog::getOpenFileName(
146 this,
147 L_S(STR_PAGE_DLG, S_ID(IDS_DLG_OPEN_FILE), "Open File"),
148 app.userHistory.openDir,
149 "DSView Data (*.dsl)");
150
151 if (!file_name.isEmpty()) {
152 QString fname = path::GetDirectoryName(file_name);
153 if (fname != app.userHistory.openDir){
154 app.userHistory.openDir = fname;
155 app.SaveHistory();
156 }
157
158 sig_load_file(file_name);
159 }
160}
161
162void FileBar::on_actionLoad_triggered()
163{

Callers

nothing calls this directly

Calls 4

GetDirectoryNameFunction · 0.85
have_hardware_dataMethod · 0.80
SaveHistoryMethod · 0.80

Tested by

no test coverage detected