Add don't show again button to driver dialogs, fix #4645
This commit is contained in:
parent
786dc6b08f
commit
6809c9585d
data/gui/dialogs
src
@ -5,7 +5,7 @@
|
||||
|
||||
<spacer height="5%" width="10" />
|
||||
|
||||
<buttonbar id="buttons" height="30%" width="30%" align="center">
|
||||
<buttonbar id="buttons" height="30%" width="70%" align="center">
|
||||
|
||||
<icon-button id="confirm" width="128" height="128" icon="gui/icons/green_check.png"
|
||||
I18N="In a 'are you sure?' dialog" text="Yes" align="center"/>
|
||||
|
24
src/main.cpp
24
src/main.cpp
@ -2410,6 +2410,22 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
class DriverDialog :
|
||||
public MessageDialog::IConfirmDialogListener
|
||||
{
|
||||
public:
|
||||
virtual void onConfirm()
|
||||
{
|
||||
GUIEngine::ModalDialog::dismiss();
|
||||
} // onConfirm
|
||||
// --------------------------------------------------------
|
||||
virtual void onCancel()
|
||||
{
|
||||
UserConfigParams::m_old_driver_popup = false;
|
||||
GUIEngine::ModalDialog::dismiss();
|
||||
} // onCancel
|
||||
}; // DriverDialog
|
||||
|
||||
if (GraphicsRestrictions::isDisabled(
|
||||
GraphicsRestrictions::GR_DRIVER_RECENT_ENOUGH))
|
||||
{
|
||||
@ -2418,7 +2434,9 @@ int main(int argc, char *argv[])
|
||||
MessageDialog *dialog =
|
||||
new MessageDialog(_("Your driver version is too old. "
|
||||
"Please install the latest video "
|
||||
"drivers."), /*from queue*/ true);
|
||||
"drivers."),
|
||||
MessageDialog::MESSAGE_DIALOG_OK_DONTSHOWAGAIN,
|
||||
new DriverDialog(), /*delete_listener*/ true, /*from queue*/ true);
|
||||
GUIEngine::DialogQueue::get()->pushDialog(dialog);
|
||||
}
|
||||
Log::warn("OpenGL", "Driver is too old!");
|
||||
@ -2438,7 +2456,9 @@ int main(int argc, char *argv[])
|
||||
"check if an update is available. SuperTuxKart "
|
||||
"recommends a driver supporting %s or better. The game "
|
||||
"will likely still run, but in a reduced-graphics mode.",
|
||||
version), /*from queue*/ true);
|
||||
version),
|
||||
MessageDialog::MESSAGE_DIALOG_OK_DONTSHOWAGAIN,
|
||||
new DriverDialog(), /*delete_listener*/ true, /*from queue*/ true);
|
||||
GUIEngine::DialogQueue::get()->pushDialog(dialog);
|
||||
}
|
||||
#endif
|
||||
|
@ -136,6 +136,13 @@ void MessageDialog::loadedFromFile()
|
||||
IconButtonWidget* yesbtn = getWidget<IconButtonWidget>("confirm");
|
||||
yesbtn->setText(_("OK"));
|
||||
}
|
||||
else if (m_type == MessageDialog::MESSAGE_DIALOG_OK_DONTSHOWAGAIN)
|
||||
{
|
||||
IconButtonWidget* yesbtn = getWidget<IconButtonWidget>("confirm");
|
||||
yesbtn->setText(_("OK"));
|
||||
IconButtonWidget* cancel = getWidget<IconButtonWidget>("cancel");
|
||||
cancel->setText(_("Don't show again"));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -63,7 +63,8 @@ public:
|
||||
};
|
||||
|
||||
enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM,
|
||||
MESSAGE_DIALOG_OK_CANCEL, MESSAGE_DIALOG_YESNO };
|
||||
MESSAGE_DIALOG_OK_CANCEL, MESSAGE_DIALOG_YESNO,
|
||||
MESSAGE_DIALOG_OK_DONTSHOWAGAIN };
|
||||
|
||||
MessageDialogType m_type;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user