37 #include "ui_newpart.h" |
37 #include "ui_newpart.h" |
38 #include "widgets.h" |
38 #include "widgets.h" |
39 |
39 |
40 extern_cfg (Bool, gl_wireframe); |
40 extern_cfg (Bool, gl_wireframe); |
41 extern_cfg (Bool, gl_colorbfc); |
41 extern_cfg (Bool, gl_colorbfc); |
|
42 extern_cfg (String, ld_defaultname); |
|
43 extern_cfg (String, ld_defaultuser); |
|
44 extern_cfg (Int, ld_defaultlicense); |
42 |
45 |
43 // ============================================================================= |
46 // ============================================================================= |
44 // ----------------------------------------------------------------------------- |
47 // ----------------------------------------------------------------------------- |
45 DEFINE_ACTION (New, CTRL_SHIFT (N)) { |
48 DEFINE_ACTION (New, CTRL_SHIFT (N)) { |
46 QDialog* dlg = new QDialog (g_win); |
49 QDialog* dlg = new QDialog (g_win); |
47 Ui::NewPartUI ui; |
50 Ui::NewPartUI ui; |
48 ui.setupUi (dlg); |
51 ui.setupUi (dlg); |
|
52 |
|
53 str authortext = ld_defaultname; |
|
54 |
|
55 if (!ld_defaultuser.value.isEmpty()) |
|
56 authortext.append (fmt (" [%1]", ld_defaultuser)); |
|
57 |
|
58 ui.le_author->setText (authortext); |
|
59 |
|
60 switch (ld_defaultlicense) { |
|
61 case 0: |
|
62 ui.rb_license_ca->setChecked (true); |
|
63 break; |
|
64 |
|
65 case 1: |
|
66 ui.rb_license_nonca->setChecked (true); |
|
67 break; |
|
68 |
|
69 case 2: |
|
70 ui.rb_license_none->setChecked (true); |
|
71 break; |
|
72 |
|
73 default: |
|
74 QMessageBox::warning (null, "Warning", |
|
75 fmt ("Unknown ld_defaultlicense value %1!", ld_defaultlicense)); |
|
76 break; |
|
77 } |
49 |
78 |
50 if (dlg->exec() == false) |
79 if (dlg->exec() == false) |
51 return; |
80 return; |
52 |
81 |
53 newFile(); |
82 newFile(); |