Moved SelectExe to Utils
FossilOrigin-Name: 5dcb374fdf60b627d8f0452cea8add32a2c900e8
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "SettingsDialog.h"
|
||||
#include "ui_SettingsDialog.h"
|
||||
#include <QFileDialog>
|
||||
#include "Utils.h"
|
||||
|
||||
#include <QSettings>
|
||||
@@ -11,28 +10,6 @@
|
||||
#include <QTextCodec>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
QString SettingsDialog::SelectExe(QWidget *parent, const QString &description)
|
||||
{
|
||||
QString filter(tr("Applications"));
|
||||
#ifdef Q_OS_WIN
|
||||
filter += " (*.exe)";
|
||||
#else
|
||||
filter += " (*)";
|
||||
#endif
|
||||
QString path = QFileDialog::getOpenFileName(
|
||||
parent,
|
||||
description,
|
||||
QString(),
|
||||
filter,
|
||||
&filter);
|
||||
|
||||
if(!QFile::exists(path))
|
||||
return QString();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
SettingsDialog::SettingsDialog(QWidget *parent, Settings &_settings) :
|
||||
QDialog(parent, Qt::Sheet),
|
||||
|
@@ -97,7 +97,6 @@ private slots:
|
||||
void on_btnClearMessageHistory_clicked();
|
||||
|
||||
private:
|
||||
static QString SelectExe(QWidget *parent, const QString &description);
|
||||
QString LangIdToName(const QString &id);
|
||||
QString LangNameToId(const QString &name);
|
||||
void CreateLangMap();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "Utils.h"
|
||||
#include <QMessageBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
QMessageBox::StandardButton DialogQuery(QWidget *parent, const QString &title, const QString &query, QMessageBox::StandardButtons buttons)
|
||||
@@ -29,6 +30,27 @@ QStringList QuotePaths(const QStringList &paths)
|
||||
return res;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString SelectExe(QWidget *parent, const QString &description)
|
||||
{
|
||||
QString filter(QObject::tr("Applications"));
|
||||
#ifdef Q_OS_WIN
|
||||
filter += " (*.exe)";
|
||||
#else
|
||||
filter += " (*)";
|
||||
#endif
|
||||
QString path = QFileDialog::getOpenFileName(
|
||||
parent,
|
||||
description,
|
||||
QString(),
|
||||
filter,
|
||||
&filter);
|
||||
|
||||
if(!QFile::exists(path))
|
||||
return QString();
|
||||
|
||||
return path;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
#if 0 // Unused
|
||||
#include <QInputDialog>
|
||||
|
@@ -15,6 +15,7 @@
|
||||
QMessageBox::StandardButton DialogQuery(QWidget *parent, const QString &title, const QString &query, QMessageBox::StandardButtons buttons = QMessageBox::Yes|QMessageBox::No);
|
||||
QString QuotePath(const QString &path);
|
||||
QStringList QuotePaths(const QStringList &paths);
|
||||
QString SelectExe(QWidget *parent, const QString &description);
|
||||
|
||||
|
||||
typedef QMap<QString, QModelIndex> name_modelindex_map_t;
|
||||
|
Reference in New Issue
Block a user