mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 08:37:36 -04:00
Added switch to enable native dialogs at build time
CONFIG+=use_native_dialogs
This commit is contained in:
parent
3822d277ad
commit
584b9039c9
5 changed files with 32 additions and 0 deletions
|
@ -123,7 +123,11 @@ void ShareManager::doubleClickedCell(int row,int column)
|
||||||
{
|
{
|
||||||
if(column == COLUMN_PATH)
|
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);
|
QString dirname = QFileDialog::getExistingDirectory(NULL,tr("Choose directory"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!dirname.isNull())
|
if(!dirname.isNull())
|
||||||
{
|
{
|
||||||
|
@ -357,7 +361,11 @@ void ShareManager::showEvent(QShowEvent *event)
|
||||||
|
|
||||||
void ShareManager::addShare()
|
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);
|
QString fname = QFileDialog::getExistingDirectory(NULL,tr("Choose a directory to share"),QString(),QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(fname.isNull())
|
if(fname.isNull())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1487,7 +1487,11 @@ void ChatWidget::chooseFont()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
//Use NULL as parent as with this QFontDialog don't take care of title nether options.
|
//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);
|
QFont font = QFontDialog::getFont(&ok, currentFont, NULL, tr("Choose your font."),QFontDialog::DontUseNativeDialog);
|
||||||
|
#endif
|
||||||
if (ok) {
|
if (ok) {
|
||||||
currentFont = font;
|
currentFont = font;
|
||||||
setFont();
|
setFont();
|
||||||
|
|
|
@ -415,7 +415,11 @@ ChatPage::load()
|
||||||
void ChatPage::on_pushButtonChangeChatFont_clicked()
|
void ChatPage::on_pushButtonChangeChatFont_clicked()
|
||||||
{
|
{
|
||||||
bool ok;
|
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);
|
QFont font = QFontDialog::getFont(&ok, fontTempChat, this, tr("Choose your default font for Chat."),QFontDialog::DontUseNativeDialog);
|
||||||
|
#endif
|
||||||
if (ok) {
|
if (ok) {
|
||||||
fontTempChat = font;
|
fontTempChat = font;
|
||||||
// using fontTempChat.rawname() does not always work!
|
// using fontTempChat.rawname() does not always work!
|
||||||
|
|
|
@ -315,7 +315,11 @@ bool misc::getOpenFileName(QWidget *parent, RshareSettings::enumLastDir type
|
||||||
{
|
{
|
||||||
QString lastDir = Settings->getLastDir(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);
|
file = QFileDialog::getOpenFileName(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog | options);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (file.isEmpty())
|
if (file.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
@ -338,7 +342,11 @@ bool misc::getOpenFileNames(QWidget *parent, RshareSettings::enumLastDir type
|
||||||
{
|
{
|
||||||
QString lastDir = Settings->getLastDir(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);
|
files = QFileDialog::getOpenFileNames(parent, caption, lastDir, filter, NULL, QFileDialog::DontResolveSymlinks | QFileDialog::DontUseNativeDialog | options);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (files.isEmpty())
|
if (files.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
@ -364,7 +372,11 @@ bool misc::getSaveFileName(QWidget *parent, RshareSettings::enumLastDir type
|
||||||
{
|
{
|
||||||
QString lastDir = Settings->getLastDir(type) + "/" + file;
|
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);
|
file = QFileDialog::getSaveFileName(parent, caption, lastDir, filter, selectedFilter, QFileDialog::DontUseNativeDialog | options);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (file.isEmpty())
|
if (file.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -187,6 +187,10 @@ rs_deep_search:CONFIG -= no_rs_deep_search
|
||||||
#RS_EXTRA_VERSION=git
|
#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:
|
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_001:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue