Changeset 105021 in vbox
- Timestamp:
- Jun 25, 2024 1:58:19 PM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
r105019 r105021 1031 1031 { 1032 1032 /* Update actions: */ 1033 slt CurrentChanged();1033 sltUpdateActions(); 1034 1034 break; 1035 1035 } … … 1066 1066 m_pTableView->setFocus(); 1067 1067 m_pTableView->setCurrentIndex(m_pTableModel->index(m_pTableModel->rowCount() - 1, 0)); 1068 slt CurrentChanged();1068 sltUpdateActions(); 1069 1069 sltAdjustTable(); 1070 1070 } … … 1075 1075 m_pTableView->setFocus(); 1076 1076 m_pTableView->setCurrentIndex(m_pTableModel->index(m_pTableModel->rowCount() - 1, 0)); 1077 slt CurrentChanged();1077 sltUpdateActions(); 1078 1078 sltAdjustTable(); 1079 1079 } … … 1083 1083 m_pTableModel->removeRule(m_pTableView->currentIndex()); 1084 1084 m_pTableView->setFocus(); 1085 slt CurrentChanged();1085 sltUpdateActions(); 1086 1086 sltAdjustTable(); 1087 1087 } … … 1093 1093 } 1094 1094 1095 void UIPortForwardingTable::slt CurrentChanged()1095 void UIPortForwardingTable::sltUpdateActions() 1096 1096 { 1097 1097 bool fTableFocused = m_pTableView->hasFocus(); … … 1168 1168 #endif 1169 1169 1170 /* Prepare table-view: */ 1170 /* Prepare model: */ 1171 prepareTableModel(); 1172 /* Prepare view: */ 1171 1173 prepareTableView(); 1172 1174 1173 1175 /* Prepare toolbar: */ 1174 1176 prepareToolbar(); 1175 }1176 }1177 1178 void UIPortForwardingTable::prepareTableView()1179 {1180 /* Create table-view: */1181 m_pTableView = new UIPortForwardingView(m_fIPv6, this);1182 if (m_pTableView)1183 {1184 /* Configure table-view: */1185 m_pTableView->installEventFilter(this);1186 1187 /* Prepare model: */1188 prepareTableModel();1189 1190 /* Finish configure table-view (after model is configured): */1191 connect(m_pTableView, &UIPortForwardingView::sigCurrentChanged,1192 this, &UIPortForwardingTable::sltCurrentChanged);1193 connect(m_pTableView, &UIPortForwardingView::customContextMenuRequested,1194 this, &UIPortForwardingTable::sltShowTableContexMenu);1195 1196 /* Add into layout: */1197 m_pLayout->addWidget(m_pTableView);1198 1177 } 1199 1178 } … … 1206 1185 { 1207 1186 /* Configure table-model: */ 1208 m_pTableView->setModel(m_pTableModel);1209 1187 connect(m_pTableModel, &UIPortForwardingModel::dataChanged, 1210 1188 this, &UIPortForwardingTable::sltTableDataChanged); … … 1213 1191 connect(m_pTableModel, &UIPortForwardingModel::rowsRemoved, 1214 1192 this, &UIPortForwardingTable::sltTableDataChanged); 1193 } 1194 } 1195 1196 void UIPortForwardingTable::prepareTableView() 1197 { 1198 /* Create table-view: */ 1199 m_pTableView = new UIPortForwardingView(m_fIPv6, this); 1200 if (m_pTableView) 1201 { 1202 /* Assign model: */ 1203 if (m_pTableModel) 1204 m_pTableView->setModel(m_pTableModel); 1205 1206 /* Finish configure table-view (after model is assigned): */ 1207 connect(m_pTableView, &UIPortForwardingView::sigCurrentChanged, 1208 this, &UIPortForwardingTable::sltUpdateActions); 1209 connect(m_pTableView, &UIPortForwardingView::customContextMenuRequested, 1210 this, &UIPortForwardingTable::sltShowTableContexMenu); 1211 1212 /* Add into layout: */ 1213 m_pLayout->addWidget(m_pTableView); 1215 1214 } 1216 1215 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
r105007 r105021 262 262 void sltTableDataChanged(); 263 263 264 /** Handles current item change. */ 265 void sltCurrentChanged(); 264 /** Updates actions. */ 265 void sltUpdateActions(); 266 266 267 /** Handles request to show context-menu in certain @a position. */ 267 268 void sltShowTableContexMenu(const QPoint &position); 269 268 270 /** Adjusts table column sizes. */ 269 271 void sltAdjustTable(); … … 275 277 /** Prepares layout. */ 276 278 void prepareLayout(); 279 /** Prepares table-model. */ 280 void prepareTableModel(); 277 281 /** Prepares table-view. */ 278 282 void prepareTableView(); 279 /** Prepares table-model. */280 void prepareTableModel();281 283 /** Prepares toolbar. */ 282 284 void prepareToolbar();
Note:
See TracChangeset
for help on using the changeset viewer.