void PreferencesDialog::on_buttonBox_clicked(QAbstractButton *button) { switch (ui->buttonBox->buttonRole(button)) { case QDialogButtonBox::AcceptRole: case QDialogButtonBox::ApplyRole: savePreferences(); break; case QDialogButtonBox::ResetRole: restorePreferences(); break; case QDialogButtonBox::RejectRole: break; case QDialogButtonBox::NRoles: // Number of roles qDebug() << "NRoles"; break; case QDialogButtonBox::YesRole: case QDialogButtonBox::NoRole: case QDialogButtonBox::HelpRole: case QDialogButtonBox::ActionRole: case QDialogButtonBox::DestructiveRole: case QDialogButtonBox::InvalidRole: break; // default: // ui->buttonBox->clicked(button); } }
PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PreferencesDialog) { ui->setupUi(this); if (parent && parent->isVisible()) setWindowFlags(Qt::Sheet); ui->filePath->setText(QSettings().fileName()); restorePreferences(); }
BOOL CPlugin::initEmbed(ULONG dwInitData) { restorePreferences(); HWND hWndParent = (HWND)dwInitData; if(WinIsWindow((HAB)0, hWndParent)) m_hWndParent = hWndParent; WinLoadDlg(m_hWndParent, m_hWndParent, (PFNWP)TesterDlgProc, m_hInst, IDD_DIALOG_TESTER, (PVOID)this); m_bPluginReady = (m_hWnd != NULL); return m_bPluginReady; }
CPlugin::CPlugin(NPP pNPInstance, WORD wMode) : CPluginBase(pNPInstance, wMode), m_hInst(hInst), m_hWnd(NULL), m_hWndManual(NULL), m_hWndAuto(NULL), m_hWndParent(NULL), m_hWndStandAloneLogWindow(NULL), m_bPluginReady(FALSE), m_hWndLastEditFocus(NULL), m_iWidth(200), m_iHeight(500) { restorePreferences(); pLogger->setLogToFileFlag(m_Pref_bToFile); pLogger->blockDumpToFile(FALSE); }