src/gui_actions.cpp

changeset 498
791c831c8020
parent 497
c51941e590b6
child 504
6a1fa662bfc1
equal deleted inserted replaced
497:c51941e590b6 498:791c831c8020
240 240
241 // ============================================================================= 241 // =============================================================================
242 // ----------------------------------------------------------------------------- 242 // -----------------------------------------------------------------------------
243 DEFINE_ACTION (Help, KEY (F1)) 243 DEFINE_ACTION (Help, KEY (F1))
244 { 244 {
245
246 } 245 }
247 246
248 // ============================================================================= 247 // =============================================================================
249 // ----------------------------------------------------------------------------- 248 // -----------------------------------------------------------------------------
250 DEFINE_ACTION (About, 0) 249 DEFINE_ACTION (About, 0)
349 348
350 // ============================================================================= 349 // =============================================================================
351 // ----------------------------------------------------------------------------- 350 // -----------------------------------------------------------------------------
352 DEFINE_ACTION (InsertFrom, 0) 351 DEFINE_ACTION (InsertFrom, 0)
353 { str fname = QFileDialog::getOpenFileName(); 352 { str fname = QFileDialog::getOpenFileName();
354 ulong idx = g_win->getInsertionPoint(); 353 int idx = g_win->getInsertionPoint();
355 354
356 if (!fname.length()) 355 if (!fname.length())
357 return; 356 return;
358 357
359 File f (fname, File::Read); 358 File f (fname, File::Read);
406 } 405 }
407 406
408 // ============================================================================= 407 // =============================================================================
409 // ----------------------------------------------------------------------------- 408 // -----------------------------------------------------------------------------
410 DEFINE_ACTION (InsertRaw, 0) 409 DEFINE_ACTION (InsertRaw, 0)
411 { ulong idx = g_win->getInsertionPoint(); 410 { int idx = g_win->getInsertionPoint();
412 411
413 QDialog* const dlg = new QDialog; 412 QDialog* const dlg = new QDialog;
414 QVBoxLayout* const layout = new QVBoxLayout; 413 QVBoxLayout* const layout = new QVBoxLayout;
415 QTextEdit* const te_edit = new QTextEdit; 414 QTextEdit* const te_edit = new QTextEdit;
416 QDialogButtonBox* const bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 415 QDialogButtonBox* const bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
443 // ============================================================================= 442 // =============================================================================
444 // ----------------------------------------------------------------------------- 443 // -----------------------------------------------------------------------------
445 DEFINE_ACTION (Screenshot, 0) 444 DEFINE_ACTION (Screenshot, 0)
446 { setlocale (LC_ALL, "C"); 445 { setlocale (LC_ALL, "C");
447 446
448 ushort w, h; 447 int w, h;
449 uchar* imgdata = g_win->R()->screencap (w, h); 448 uchar* imgdata = g_win->R()->screencap (w, h);
450 QImage img = imageFromScreencap (imgdata, w, h); 449 QImage img = imageFromScreencap (imgdata, w, h);
451 450
452 str root = basename (LDFile::current()->name()); 451 str root = basename (LDFile::current()->name());
453 452
551 if (!file) 550 if (!file)
552 { critical ("couldn't load axle.dat"); 551 { critical ("couldn't load axle.dat");
553 return; 552 return;
554 } 553 }
555 554
556 ushort w, h; 555 int w, h;
557 556
558 GLRenderer* rend = new GLRenderer; 557 GLRenderer* rend = new GLRenderer;
559 rend->resize (64, 64); 558 rend->resize (64, 64);
560 rend->setAttribute (Qt::WA_DontShowOnScreen); 559 rend->setAttribute (Qt::WA_DontShowOnScreen);
561 rend->show(); 560 rend->show();

mercurial