mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-24 00:40:11 -05:00
Added switch to enable native dialogs at build time
CONFIG+=use_native_dialogs
This commit is contained in:
parent
3822d277ad
commit
584b9039c9
@ -123,7 +123,11 @@ void ShareManager::doubleClickedCell(int row,int column)
|
||||
{
|
||||
if(column == COLUMN_PATH)
|
||||
{
|
||||
#ifdef NATIVEDIALOGS
|
||||
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Choose directory"),QString(), QFileDialog::ShowDirsOnly);
|
||||
#else
|
||||
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Choose directory"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||
#endif
|
||||
|
||||
if(!dirname.isNull())
|
||||
{
|
||||
@ -357,7 +361,11 @@ void ShareManager::showEvent(QShowEvent *event)
|
||||
|
||||
void ShareManager::addShare()
|
||||
{
|
||||
#ifdef NATIVEDIALOGS
|
||||
QString fname = QFileDialog::getExistingDirectory(NULL,tr("Choose a directory to share"),QString(), QFileDialog::ShowDirsOnly);
|
||||
#else
|
||||
QString fname = QFileDialog::getExistingDirectory(NULL,tr("Choose a directory to share"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||
#endif
|
||||
|
||||
if(fname.isNull())
|
||||
return;
|
||||
|
@ -1487,7 +1487,11 @@ void ChatWidget::chooseFont()
|
||||
{
|
||||
bool ok;
|
||||
//Use NULL as parent as with this QFontDialog don't take care of title nether options.
|
||||
#ifdef NATIVEDIALOGS
|
||||
QFont font = QFontDialog::getFont(&ok, currentFont, NULL, tr("Choose your font.") );
|
||||
#else
|
||||
QFont font = QFontDialog::getFont(&ok, currentFont, NULL, tr("Choose your font."),QFontDialog::DontUseNativeDialog);
|
||||
#endif
|
||||
if (ok) {
|
||||
currentFont = font;
|
||||
setFont();
|
||||
|
@ -415,7 +415,11 @@ ChatPage::load()
|
||||
void ChatPage::on_pushButtonChangeChatFont_clicked()
|
||||
{
|
||||
bool ok;
|
||||
#ifdef NATIVEDIALOGS
|
||||
QFont font = QFontDialog::getFont(&ok, fontTempChat, this, tr("Choose your default font for Chat.") );
|
||||
#else
|
||||
QFont font = QFontDialog::getFont(&ok, fontTempChat, this, tr("Choose your default font for Chat."),QFontDialog::DontUseNativeDialog);
|
||||
#endif
|
||||
if (ok) {
|
||||
fontTempChat = font;
|
||||
// using fontTempChat.rawname() does not always work!
|
||||
|
@ -315,7 +315,11 @@ bool misc::getOpenFileName(QWidget *parent, RshareSettings::enumLastDir type
|
||||
{
|
||||
QString lastDir = Settings->getLastDir(type);
|
||||
|
||||
#ifdef NATIVEDIALOGS
|
||||
file = QFileDialog::getOpenFileName(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | options);
|
||||
#else
|
||||
file = QFileDialog::getOpenFileName(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog | options);
|
||||
#endif
|
||||
|
||||
if (file.isEmpty())
|
||||
return false;
|
||||
@ -338,7 +342,11 @@ bool misc::getOpenFileNames(QWidget *parent, RshareSettings::enumLastDir type
|
||||
{
|
||||
QString lastDir = Settings->getLastDir(type);
|
||||
|
||||
#ifdef NATIVEDIALOGS
|
||||
files = QFileDialog::getOpenFileNames(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | options);
|
||||
#else
|
||||
files = QFileDialog::getOpenFileNames(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog | options);
|
||||
#endif
|
||||
|
||||
if (files.isEmpty())
|
||||
return false;
|
||||
@ -364,7 +372,11 @@ bool misc::getSaveFileName(QWidget *parent, RshareSettings::enumLastDir type
|
||||
{
|
||||
QString lastDir = Settings->getLastDir(type) + "/" + file;
|
||||
|
||||
#ifdef NATIVEDIALOGS
|
||||
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, options);
|
||||
#else
|
||||
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, QFileDialog::DontUseNativeDialog | options);
|
||||
#endif
|
||||
|
||||
if (file.isEmpty())
|
||||
return false;
|
||||
|
@ -187,6 +187,10 @@ rs_deep_search:CONFIG -= no_rs_deep_search
|
||||
#RS_EXTRA_VERSION=git
|
||||
|
||||
|
||||
# To enable native dialogs append the following assignation to qmake command line
|
||||
# "CONFIG+=use_native_dialogs"
|
||||
use_native_dialogs:DEFINES *= NATIVEDIALOGS
|
||||
|
||||
###########################################################################################################################################################
|
||||
#
|
||||
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_001:
|
||||
|
Loading…
x
Reference in New Issue
Block a user