zz_configDialog.cpp

changeset 119
b93a64f5ee67
parent 116
4fde8fdf258a
child 120
607301744394
equal deleted inserted replaced
118:649110bb36a8 119:b93a64f5ee67
64 QVBoxLayout* layout = new QVBoxLayout; 64 QVBoxLayout* layout = new QVBoxLayout;
65 layout->addWidget (qTabs); 65 layout->addWidget (qTabs);
66 layout->addWidget (qButtons); 66 layout->addWidget (qButtons);
67 setLayout (layout); 67 setLayout (layout);
68 68
69 setWindowTitle (APPNAME_DISPLAY " - editing settings"); 69 setWindowTitle (APPNAME_DISPLAY " - Settings");
70 setWindowIcon (QIcon ("icons/settings.png")); 70 setWindowIcon (QIcon ("icons/settings.png"));
71 } 71 }
72 72
73 // ============================================================================= 73 // =============================================================================
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
76 void ConfigDialog::initMainTab () { 76 void ConfigDialog::initMainTab () {
77 qMainTab = new QWidget; 77 qMainTab = new QWidget;
78 78
79 // ========================================================================= 79 // =========================================================================
80 // LDraw path 80 // LDraw path
81 qLDrawPathLabel = new QLabel ("LDraw path:");
82
81 qLDrawPath = new QLineEdit; 83 qLDrawPath = new QLineEdit;
82 qLDrawPath->setText (io_ldpath.value.chars()); 84 qLDrawPath->setText (io_ldpath.value.chars());
83
84 qLDrawPathLabel = new QLabel ("LDraw path:");
85 85
86 qLDrawPathFindButton = new QPushButton; 86 qLDrawPathFindButton = new QPushButton;
87 qLDrawPathFindButton->setIcon (QIcon ("icons/folder.png")); 87 qLDrawPathFindButton->setIcon (QIcon ("icons/folder.png"));
88 connect (qLDrawPathFindButton, SIGNAL (clicked ()), 88 connect (qLDrawPathFindButton, SIGNAL (clicked ()),
89 this, SLOT (slot_findLDrawPath ())); 89 this, SLOT (slot_findLDrawPath ()));
90
91 QHBoxLayout* qLDrawPathLayout = new QHBoxLayout;
92 qLDrawPathLayout->addWidget (qLDrawPath);
93 qLDrawPathLayout->addWidget (qLDrawPathFindButton);
90 94
91 // ========================================================================= 95 // =========================================================================
92 // Background and foreground colors 96 // Background and foreground colors
93 qGLBackgroundLabel = new QLabel ("Background color:"); 97 qGLBackgroundLabel = new QLabel ("Background color:");
94 qGLBackgroundButton = new QPushButton; 98 qGLBackgroundButton = new QPushButton;
126 qGLSelFlash = new QCheckBox ("Selection flash"); 130 qGLSelFlash = new QCheckBox ("Selection flash");
127 INIT_CHECKBOX (qGLSelFlash, gl_selflash) 131 INIT_CHECKBOX (qGLSelFlash, gl_selflash)
128 132
129 QGridLayout* layout = new QGridLayout; 133 QGridLayout* layout = new QGridLayout;
130 layout->addWidget (qLDrawPathLabel, 0, 0); 134 layout->addWidget (qLDrawPathLabel, 0, 0);
131 layout->addWidget (qLDrawPath, 0, 1, 1, 2); 135 layout->addLayout (qLDrawPathLayout, 0, 1, 1, 3);
132 layout->addWidget (qLDrawPathFindButton, 0, 3);
133 136
134 layout->addWidget (qGLBackgroundLabel, 1, 0); 137 layout->addWidget (qGLBackgroundLabel, 1, 0);
135 layout->addWidget (qGLBackgroundButton, 1, 1); 138 layout->addWidget (qGLBackgroundButton, 1, 1);
136 layout->addWidget (qGLForegroundLabel, 1, 2); 139 layout->addWidget (qGLForegroundLabel, 1, 2);
137 layout->addWidget (qGLForegroundButton, 1, 3); 140 layout->addWidget (qGLForegroundButton, 1, 3);
142 layout->addWidget (qGLForegroundAlpha, 2, 3); 145 layout->addWidget (qGLForegroundAlpha, 2, 3);
143 146
144 layout->addWidget (qToolBarIconSizeLabel, 3, 0); 147 layout->addWidget (qToolBarIconSizeLabel, 3, 0);
145 layout->addWidget (qToolBarIconSize, 3, 1); 148 layout->addWidget (qToolBarIconSize, 3, 1);
146 149
147 layout->addWidget (qLVColorize, 4, 0); 150 layout->addWidget (qLVColorize, 4, 0, 1, 4);
148 layout->addWidget (qGLColorBFC, 5, 0); 151 layout->addWidget (qGLColorBFC, 5, 0, 1, 4);
149 layout->addWidget (qGLSelFlash, 6, 0); 152 layout->addWidget (qGLSelFlash, 6, 0, 1, 4);
150 qMainTab->setLayout (layout); 153 qMainTab->setLayout (layout);
151 154
152 // Add the tab to the manager 155 // Add the tab to the manager
153 qTabs->addTab (qMainTab, "Main settings"); 156 qTabs->addTab (qMainTab, "Main settings");
154 } 157 }
165 168
166 // Init table items 169 // Init table items
167 ulong i = 0; 170 ulong i = 0;
168 for (actionmeta meta : g_ActionMeta) { 171 for (actionmeta meta : g_ActionMeta) {
169 QAction* const qAct = *meta.qAct; 172 QAction* const qAct = *meta.qAct;
173
174 if (qAct->isEnabled() == false)
175 continue;
176
170 QListWidgetItem* qItem = new QListWidgetItem; 177 QListWidgetItem* qItem = new QListWidgetItem;
171 setShortcutText (qItem, meta); 178 setShortcutText (qItem, meta);
172 qItem->setIcon (qAct->icon ()); 179 qItem->setIcon (qAct->icon ());
173 180
174 qaShortcutItems.push_back (qItem); 181 qaShortcutItems.push_back (qItem);

mercurial