Skip to content

Commit

Permalink
FEAT(client): Profiles frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Jan 3, 2025
1 parent 093dba0 commit beb605b
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 48 deletions.
12 changes: 10 additions & 2 deletions src/mumble/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ ConfigDialog::ConfigDialog(QWidget *p) : QDialog(p) {
restoreGeometry(Global::get().s.qbaConfigGeometry);
}

for (const QString &profile : Global::get().s.profiles.allProfiles.keys()) {
qcbProfiles->addItem(profile);
}

updateTabOrder();
qlwIcons->setFocus();
}
Expand Down Expand Up @@ -230,13 +234,17 @@ void ConfigDialog::updateTabOrder() {
setTabOrder(cancelButton, okButton);
setTabOrder(okButton, qlwIcons);
setTabOrder(qlwIcons, contentFocusWidget);
setTabOrder(contentFocusWidget, qcbProfiles);
setTabOrder(qcbProfiles, qpbProfileAdd);
setTabOrder(qpbProfileAdd, qpbProfileRename);
setTabOrder(qpbProfileRename, qpbProfileDelete);
if (resetButton && restoreButton && restoreAllButton) {
setTabOrder(contentFocusWidget, resetButton);
setTabOrder(qpbProfileDelete, resetButton);
setTabOrder(resetButton, restoreButton);
setTabOrder(restoreButton, restoreAllButton);
setTabOrder(restoreAllButton, applyButton);
} else {
setTabOrder(contentFocusWidget, applyButton);
setTabOrder(qpbProfileDelete, applyButton);
}
setTabOrder(applyButton, cancelButton);
}
Expand Down
168 changes: 122 additions & 46 deletions src/mumble/ConfigDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,126 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QGroupBox" name="qgbProfiles">
<property name="title">
<string>Profile</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="qcbProfiles"/>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="qpbProfileAdd">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="qpbProfileRename">
<property name="text">
<string>Rename</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="qpbProfileDelete">
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="2">
<widget class="QStackedWidget" name="qswPages">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="spacer" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3"/>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDialogButtonBox" name="pageButtonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="dialogButtonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QListWidget" name="qlwIcons">
<property name="sizePolicy">
Expand All @@ -35,60 +155,16 @@
</size>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
<enum>QListView::ResizeMode::Adjust</enum>
</property>
<property name="layoutMode">
<enum>QListView::Batched</enum>
<enum>QListView::LayoutMode::Batched</enum>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDialogButtonBox" name="pageButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>474</width>
<height>22</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="dialogButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QStackedWidget" name="qswPages">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
Expand Down

0 comments on commit beb605b

Please sign in to comment.