Allow hiding API settings in notifications option page
This commit is contained in:
parent
bae7f7c4c8
commit
07a47f1b06
|
@ -337,8 +337,9 @@ void ConnectionOptionPage::applyAndReconnect()
|
|||
}
|
||||
|
||||
// NotificationsOptionPage
|
||||
NotificationsOptionPage::NotificationsOptionPage(QWidget *parentWidget)
|
||||
NotificationsOptionPage::NotificationsOptionPage(bool noApi, QWidget *parentWidget)
|
||||
: NotificationsOptionPageBase(parentWidget)
|
||||
, m_noApi(noApi)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -346,6 +347,13 @@ NotificationsOptionPage::~NotificationsOptionPage()
|
|||
{
|
||||
}
|
||||
|
||||
QWidget *NotificationsOptionPage::setupWidget()
|
||||
{
|
||||
auto *w = NotificationsOptionPageBase::setupWidget();
|
||||
ui()->apiGroupBox->setHidden(m_noApi);
|
||||
return w;
|
||||
}
|
||||
|
||||
bool NotificationsOptionPage::apply()
|
||||
{
|
||||
bool ok = true;
|
||||
|
|
|
@ -45,7 +45,14 @@ std::vector<Data::SyncthingConnectionSettings> m_secondarySettings;
|
|||
int m_currentIndex;
|
||||
END_DECLARE_OPTION_PAGE
|
||||
|
||||
DECLARE_UI_FILE_BASED_OPTION_PAGE(NotificationsOptionPage)
|
||||
BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_CTOR(NotificationsOptionPage)
|
||||
public:
|
||||
NotificationsOptionPage(bool noApi = false, QWidget *parentWidget = nullptr);
|
||||
|
||||
private:
|
||||
DECLARE_SETUP_WIDGETS
|
||||
bool m_noApi;
|
||||
END_DECLARE_OPTION_PAGE
|
||||
|
||||
DECLARE_UI_FILE_BASED_OPTION_PAGE(AppearanceOptionPage)
|
||||
|
||||
|
|
Loading…
Reference in New Issue