src/gui_actions.cpp

changeset 539
72ad83a67165
parent 538
2f85d4d286e5
child 542
46a33bdc0b36
equal deleted inserted replaced
538:2f85d4d286e5 539:72ad83a67165
135 135
136 // ============================================================================= 136 // =============================================================================
137 // ----------------------------------------------------------------------------- 137 // -----------------------------------------------------------------------------
138 DEFINE_ACTION (SaveAll, CTRL (L)) 138 DEFINE_ACTION (SaveAll, CTRL (L))
139 { for (LDFile* file : g_loadedFiles) 139 { for (LDFile* file : g_loadedFiles)
140 { if (file->implicit()) 140 { if (file->isImplicit())
141 continue; 141 continue;
142 142
143 g_win->save (file, false); 143 g_win->save (file, false);
144 } 144 }
145 } 145 }
257 } 257 }
258 258
259 // ============================================================================= 259 // =============================================================================
260 // ----------------------------------------------------------------------------- 260 // -----------------------------------------------------------------------------
261 DEFINE_ACTION (SelectAll, CTRL (A)) 261 DEFINE_ACTION (SelectAll, CTRL (A))
262 { for (LDObject* obj : LDFile::current()->objects()) 262 { for (LDObject* obj : LDFile::current()->getObjects())
263 obj->select(); 263 obj->select();
264 264
265 g_win->updateSelection(); 265 g_win->updateSelection();
266 } 266 }
267 267
273 if (colnum == -1) 273 if (colnum == -1)
274 return; // no consensus on color 274 return; // no consensus on color
275 275
276 LDFile::current()->clearSelection(); 276 LDFile::current()->clearSelection();
277 277
278 for (LDObject* obj : LDFile::current()->objects()) 278 for (LDObject* obj : LDFile::current()->getObjects())
279 if (obj->color() == colnum) 279 if (obj->getColor() == colnum)
280 obj->select(); 280 obj->select();
281 281
282 g_win->updateSelection(); 282 g_win->updateSelection();
283 } 283 }
284 284
296 // If we're selecting subfile references, the reference filename must also 296 // If we're selecting subfile references, the reference filename must also
297 // be uniform. 297 // be uniform.
298 str refName; 298 str refName;
299 299
300 if (type == LDObject::Subfile) 300 if (type == LDObject::Subfile)
301 { refName = static_cast<LDSubfile*> (selection()[0])->fileInfo()->name(); 301 { refName = static_cast<LDSubfile*> (selection()[0])->getFileInfo()->getName();
302 302
303 for (LDObject* obj : selection()) 303 for (LDObject* obj : selection())
304 if (static_cast<LDSubfile*> (obj)->fileInfo()->name() != refName) 304 if (static_cast<LDSubfile*> (obj)->getFileInfo()->getName() != refName)
305 return; 305 return;
306 } 306 }
307 307
308 LDFile::current()->clearSelection(); 308 LDFile::current()->clearSelection();
309 309
310 for (LDObject* obj : LDFile::current()->objects()) 310 for (LDObject* obj : LDFile::current()->getObjects())
311 { if (obj->getType() != type) 311 { if (obj->getType() != type)
312 continue; 312 continue;
313 313
314 if (type == LDObject::Subfile && static_cast<LDSubfile*> (obj)->fileInfo()->name() != refName) 314 if (type == LDObject::Subfile && static_cast<LDSubfile*> (obj)->getFileInfo()->getName() != refName)
315 continue; 315 continue;
316 316
317 obj->select(); 317 obj->select();
318 } 318 }
319 319
444 444
445 int w, h; 445 int w, h;
446 uchar* imgdata = g_win->R()->getScreencap (w, h); 446 uchar* imgdata = g_win->R()->getScreencap (w, h);
447 QImage img = imageFromScreencap (imgdata, w, h); 447 QImage img = imageFromScreencap (imgdata, w, h);
448 448
449 str root = basename (LDFile::current()->name()); 449 str root = basename (LDFile::current()->getName());
450 450
451 if (root.right (4) == ".dat") 451 if (root.right (4) == ".dat")
452 root.chop (4); 452 root.chop (4);
453 453
454 str defaultname = (root.length() > 0) ? fmt ("%1.png", root) : ""; 454 str defaultname = (root.length() > 0) ? fmt ("%1.png", root) : "";
472 472
473 // ============================================================================= 473 // =============================================================================
474 // ----------------------------------------------------------------------------- 474 // -----------------------------------------------------------------------------
475 DEFINE_ACTION (VisibilityToggle, 0) 475 DEFINE_ACTION (VisibilityToggle, 0)
476 { for (LDObject* obj : selection()) 476 { for (LDObject* obj : selection())
477 obj->setHidden (!obj->hidden()); 477 obj->toggleHidden();
478 478
479 g_win->refresh(); 479 g_win->refresh();
480 } 480 }
481 481
482 // ============================================================================= 482 // =============================================================================

mercurial