--- a/src/misc.cpp Fri Jun 05 19:13:44 2015 +0300 +++ b/src/misc.cpp Sat Jun 06 22:03:00 2015 +0300 @@ -16,8 +16,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <QFileDialog> +#include <QMessageBox> #include "misc.h" -#include <QMessageBox> + +// +// ----------------------------------------------------------------------------- +// uint32 makeByteID (uint8 a, uint8 b, uint8 c, uint8 d) { @@ -37,19 +42,6 @@ // ----------------------------------------------------------------------------- // -void addVersion (const ZandronumVersion& version) -{ - QList<QVariant> versions = getVersions(); - QVariant var; - var.setValue (version); - versions.append (var); - Config::set ("versions", versions); -} - -// -// ----------------------------------------------------------------------------- -// - QString basename (const QString& path) { int lastpos = path.lastIndexOf ("/"); @@ -68,4 +60,20 @@ { return QMessageBox::question (NULL, QObject::tr ("Confirm"), text, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) != QMessageBox::No; +} + +// +// ------------------------------------------------------------------------------------------------- +// + +QString getBinaryPath (QWidget* parent) +{ +#ifdef _WIN32 +# define ZAN_EXE_NAME "zandronum.exe" +#else +# define ZAN_EXE_NAME "zandronum" +#endif + + return QFileDialog::getOpenFileName (parent, "", "", + "Zandronum Binaries (" ZAN_EXE_NAME ")(" ZAN_EXE_NAME ");;All files (*)(*)"); } \ No newline at end of file