added missing signal blocking calls in several config pages

This commit is contained in:
csoler 2017-02-27 23:13:45 +01:00
parent 58efbc2e10
commit 88afe51f3e
8 changed files with 99 additions and 91 deletions

View File

@ -30,6 +30,7 @@
#include <rshare.h> #include <rshare.h>
#include "AppearancePage.h" #include "AppearancePage.h"
#include "rsharesettings.h" #include "rsharesettings.h"
#include "util/misc.h"
#include "gui/MainWindow.h" #include "gui/MainWindow.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "gui/statusbar/peerstatus.h" #include "gui/statusbar/peerstatus.h"
@ -222,56 +223,56 @@ void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText(
void AppearancePage::load() void AppearancePage::load()
{ {
int index = ui.cmboLanguage->findData(Settings->getLanguageCode()); int index = ui.cmboLanguage->findData(Settings->getLanguageCode());
ui.cmboLanguage->setCurrentIndex(index); whileBlocking(ui.cmboLanguage)->setCurrentIndex(index);
index = ui.cmboStyle->findData(Rshare::style().toLower()); index = ui.cmboStyle->findData(Rshare::style().toLower());
ui.cmboStyle->setCurrentIndex(index); whileBlocking(ui.cmboStyle)->setCurrentIndex(index);
index = ui.cmboStyleSheet->findData(Settings->getSheetName()); index = ui.cmboStyleSheet->findData(Settings->getSheetName());
if (index == -1) { if (index == -1) {
/* set standard "no style sheet" */ /* set standard "no style sheet" */
index = ui.cmboStyleSheet->findData(""); index = ui.cmboStyleSheet->findData("");
} }
ui.cmboStyleSheet->setCurrentIndex(index); whileBlocking(ui.cmboStyleSheet)->setCurrentIndex(index);
ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc()); whileBlocking(ui.mainPageButtonType_CB)->setCurrentIndex(!Settings->getPageButtonLoc());
// ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc()); // ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
switch (Settings->getToolButtonStyle()) switch (Settings->getToolButtonStyle())
{ {
case Qt::ToolButtonIconOnly: case Qt::ToolButtonIconOnly:
ui.cmboTollButtonsStyle->setCurrentIndex(0); whileBlocking(ui.cmboTollButtonsStyle)->setCurrentIndex(0);
break; break;
case Qt::ToolButtonTextOnly: case Qt::ToolButtonTextOnly:
ui.cmboTollButtonsStyle->setCurrentIndex(1); whileBlocking(ui.cmboTollButtonsStyle)->setCurrentIndex(1);
break; break;
case Qt::ToolButtonTextBesideIcon: case Qt::ToolButtonTextBesideIcon:
ui.cmboTollButtonsStyle->setCurrentIndex(2); whileBlocking(ui.cmboTollButtonsStyle)->setCurrentIndex(2);
break; break;
case Qt::ToolButtonTextUnderIcon: case Qt::ToolButtonTextUnderIcon:
default: default:
ui.cmboTollButtonsStyle->setCurrentIndex(3); whileBlocking(ui.cmboTollButtonsStyle)->setCurrentIndex(3);
} }
switch (Settings->getToolButtonSize()) switch (Settings->getToolButtonSize())
{ {
case 8: case 8:
ui.cmboTollButtonsSize->setCurrentIndex(0); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(0);
break; break;
case 16: case 16:
ui.cmboTollButtonsSize->setCurrentIndex(1); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(1);
break; break;
case 24: case 24:
default: default:
ui.cmboTollButtonsSize->setCurrentIndex(2); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(2);
break; break;
case 32: case 32:
ui.cmboTollButtonsSize->setCurrentIndex(3); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(3);
break; break;
case 64: case 64:
ui.cmboTollButtonsSize->setCurrentIndex(4); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(4);
break; break;
case 128: case 128:
ui.cmboTollButtonsSize->setCurrentIndex(5); whileBlocking(ui.cmboTollButtonsSize)->setCurrentIndex(5);
} }
// switch (Settings->getListItemIconSize()) // switch (Settings->getListItemIconSize())
// { // {
@ -295,20 +296,20 @@ void AppearancePage::load()
// ui.cmboListItemSize->setCurrentIndex(5); // ui.cmboListItemSize->setCurrentIndex(5);
// } // }
ui.grpStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool()); whileBlocking(ui.grpStatus)->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool());
ui.checkBoxStatusCompactMode->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool()); whileBlocking(ui.checkBoxStatusCompactMode)->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool());
ui.checkBoxDisableSysTrayToolTip->setChecked(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool()); whileBlocking(ui.checkBoxDisableSysTrayToolTip)->setChecked(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool());
ui.checkBoxShowStatusStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowStatus", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowStatusStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowStatus", QVariant(true)).toBool());
ui.checkBoxShowPeerStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowPeer", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowPeerStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowPeer", QVariant(true)).toBool());
ui.checkBoxShowNATStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowNATStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool());
ui.checkBoxShowDHTStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowDHTStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool());
ui.checkBoxShowHashingStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowHashingStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool());
ui.checkBoxShowDiscStatus-> setChecked(Settings->valueFromGroup("StatusBar", "Show eDisc", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowDiscStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "Show eDisc", QVariant(true)).toBool());
ui.checkBoxShowRateStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowRateStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool());
ui.checkBoxShowOpModeStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowOpMode", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowOpModeStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowOpMode", QVariant(true)).toBool());
ui.checkBoxShowSoundStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowSound", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowSoundStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowSound", QVariant(true)).toBool());
ui.checkBoxShowToasterDisable->setChecked(Settings->valueFromGroup("StatusBar", "ShowToaster", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowToasterDisable)->setChecked(Settings->valueFromGroup("StatusBar", "ShowToaster", QVariant(true)).toBool());
ui.checkBoxShowSystrayOnStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool()); whileBlocking(ui.checkBoxShowSystrayOnStatus)->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
} }

View File

@ -21,6 +21,7 @@
#include "ChannelPage.h" #include "ChannelPage.h"
#include "rsharesettings.h" #include "rsharesettings.h"
#include "util/misc.h"
ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
: ConfigPage(parent, flags) : ConfigPage(parent, flags)
@ -44,6 +45,6 @@ ChannelPage::~ChannelPage()
/** Loads the settings for this page */ /** Loads the settings for this page */
void ChannelPage::load() void ChannelPage::load()
{ {
ui.loadThreadCheckBox->setChecked(Settings->getChannelLoadThread()); whileBlocking(ui.loadThreadCheckBox)->setChecked(Settings->getChannelLoadThread());
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Channel); ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Channel);
} }

View File

@ -34,6 +34,7 @@
#include "gui/chat/ChatDialog.h" #include "gui/chat/ChatDialog.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "rsharesettings.h" #include "rsharesettings.h"
#include "util/misc.h"
#include <retroshare/rsconfig.h> #include <retroshare/rsconfig.h>
#include <retroshare/rshistory.h> #include <retroshare/rshistory.h>
@ -299,26 +300,26 @@ void
ChatPage::load() ChatPage::load()
{ {
Settings->beginGroup(QString("Chat")); Settings->beginGroup(QString("Chat"));
ui.checkBox_emoteprivchat->setChecked(Settings->value("Emoteicons_PrivatChat", true).toBool()); whileBlocking(ui.checkBox_emoteprivchat)->setChecked(Settings->value("Emoteicons_PrivatChat", true).toBool());
ui.checkBox_emotegroupchat->setChecked(Settings->value("Emoteicons_GroupChat", true).toBool()); whileBlocking(ui.checkBox_emotegroupchat)->setChecked(Settings->value("Emoteicons_GroupChat", true).toBool());
ui.checkBox_enableCustomFonts->setChecked(Settings->value("EnableCustomFonts", true).toBool()); whileBlocking(ui.checkBox_enableCustomFonts)->setChecked(Settings->value("EnableCustomFonts", true).toBool());
ui.checkBox_enableCustomFontSize->setChecked(Settings->value("EnableCustomFontSize", true).toBool()); whileBlocking(ui.checkBox_enableCustomFontSize)->setChecked(Settings->value("EnableCustomFontSize", true).toBool());
ui.minimumFontSize->setValue(Settings->value("MinimumFontSize", 10).toInt()); whileBlocking(ui.minimumFontSize)->setValue(Settings->value("MinimumFontSize", 10).toInt());
ui.checkBox_enableBold->setChecked(Settings->value("EnableBold", true).toBool()); whileBlocking(ui.checkBox_enableBold)->setChecked(Settings->value("EnableBold", true).toBool());
ui.checkBox_enableItalics->setChecked(Settings->value("EnableItalics", true).toBool()); whileBlocking(ui.checkBox_enableItalics)->setChecked(Settings->value("EnableItalics", true).toBool());
ui.minimumContrast->setValue(Settings->value("MinimumContrast", 4.5).toDouble()); whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble());
Settings->endGroup(); Settings->endGroup();
// state of distant Chat combobox // state of distant Chat combobox
int index = Settings->value("DistantChat", 0).toInt(); int index = Settings->value("DistantChat", 0).toInt();
ui.distantChatComboBox->setCurrentIndex(index); whileBlocking(ui.distantChatComboBox)->setCurrentIndex(index);
fontTempChat.fromString(Settings->getChatScreenFont()); fontTempChat.fromString(Settings->getChatScreenFont());
ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn()); whileBlocking(ui.sendMessageWithCtrlReturn)->setChecked(Settings->getChatSendMessageWithCtrlReturn());
ui.sendAsPlainTextByDef->setChecked(Settings->getChatSendAsPlainTextByDef()); whileBlocking(ui.sendAsPlainTextByDef)->setChecked(Settings->getChatSendAsPlainTextByDef());
ui.loadEmbeddedImages->setChecked(Settings->getChatLoadEmbeddedImages()); whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getChatLoadEmbeddedImages());
ui.DontSendTyping->setChecked(Settings->getChatDoNotSendIsTyping()); whileBlocking(ui.DontSendTyping)->setChecked(Settings->getChatDoNotSendIsTyping());
std::string advsetting; std::string advsetting;
if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES")) if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
@ -326,36 +327,36 @@ ChatPage::load()
else else
ui.DontSendTyping->hide(); ui.DontSendTyping->hide();
ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch()); whileBlocking(ui.sbSearch_CharToStart)->setValue(Settings->getChatSearchCharToStartSearch());
ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively()); whileBlocking(ui.cbSearch_CaseSensitively)->setChecked(Settings->getChatSearchCaseSensitively());
ui.cbSearch_WholeWords->setChecked(Settings->getChatSearchWholeWords()); whileBlocking(ui.cbSearch_WholeWords)->setChecked(Settings->getChatSearchWholeWords());
ui.cbSearch_MoveToCursor->setChecked(Settings->getChatSearchMoveToCursor()); whileBlocking(ui.cbSearch_MoveToCursor)->setChecked(Settings->getChatSearchMoveToCursor());
ui.cbSearch_WithoutLimit->setChecked(Settings->getChatSearchSearchWithoutLimit()); whileBlocking(ui.cbSearch_WithoutLimit)->setChecked(Settings->getChatSearchSearchWithoutLimit());
ui.sbSearch_MaxLimitColor->setValue(Settings->getChatSearchMaxSearchLimitColor()); whileBlocking(ui.sbSearch_MaxLimitColor)->setValue(Settings->getChatSearchMaxSearchLimitColor());
rgbChatSearchFoundColor=Settings->getChatSearchFoundColor(); rgbChatSearchFoundColor=Settings->getChatSearchFoundColor();
QPixmap pix(24, 24); QPixmap pix(24, 24);
pix.fill(rgbChatSearchFoundColor); pix.fill(rgbChatSearchFoundColor);
ui.btSearch_FoundColor->setIcon(pix); ui.btSearch_FoundColor->setIcon(pix);
ui.publicChatLoadCount->setValue(Settings->getPublicChatHistoryCount()); whileBlocking(ui.publicChatLoadCount)->setValue(Settings->getPublicChatHistoryCount());
ui.privateChatLoadCount->setValue(Settings->getPrivateChatHistoryCount()); whileBlocking(ui.privateChatLoadCount)->setValue(Settings->getPrivateChatHistoryCount());
ui.lobbyChatLoadCount->setValue(Settings->getLobbyChatHistoryCount()); whileBlocking(ui.lobbyChatLoadCount)->setValue(Settings->getLobbyChatHistoryCount());
ui.publicChatEnable->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PUBLIC)); whileBlocking(ui.publicChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PUBLIC));
ui.privateChatEnable->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PRIVATE)); whileBlocking(ui.privateChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_PRIVATE));
ui.lobbyChatEnable->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_LOBBY)); whileBlocking(ui.lobbyChatEnable)->setChecked(rsHistory->getEnable(RS_HISTORY_TYPE_LOBBY));
ui.publicChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PUBLIC)); whileBlocking(ui.publicChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PUBLIC));
ui.privateChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PRIVATE)); whileBlocking(ui.privateChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PRIVATE));
ui.lobbyChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY)); whileBlocking(ui.lobbyChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY));
// using fontTempChat.rawname() does not always work! // using fontTempChat.rawname() does not always work!
// see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName // see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName
QStringList fontname = fontTempChat.toString().split(","); QStringList fontname = fontTempChat.toString().split(",");
ui.labelChatFontPreview->setText(fontname[0]); whileBlocking(ui.labelChatFontPreview)->setText(fontname[0]);
ui.labelChatFontPreview->setFont(fontTempChat); whileBlocking(ui.labelChatFontPreview)->setFont(fontTempChat);
ui.max_storage_period->setValue(rsHistory->getMaxStorageDuration()/86400) ; whileBlocking(ui.max_storage_period)->setValue(rsHistory->getMaxStorageDuration()/86400) ;
/* Load styles */ /* Load styles */
publicStylePath = loadStyleInfo(ChatStyle::TYPE_PUBLIC, ui.publicStyle, ui.publicComboBoxVariant, publicStyleVariant); publicStylePath = loadStyleInfo(ChatStyle::TYPE_PUBLIC, ui.publicStyle, ui.publicComboBoxVariant, publicStyleVariant);
@ -372,14 +373,14 @@ ChatPage::load()
uint chatflags = Settings->getChatFlags(); uint chatflags = Settings->getChatFlags();
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN); whileBlocking(ui.chat_NewWindow)->setChecked(chatflags & RS_CHAT_OPEN);
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS); whileBlocking(ui.chat_Focus)->setChecked(chatflags & RS_CHAT_FOCUS);
ui.chat_tabbedWindow->setChecked(chatflags & RS_CHAT_TABBED_WINDOW); whileBlocking(ui.chat_tabbedWindow)->setChecked(chatflags & RS_CHAT_TABBED_WINDOW);
ui.chat_Blink->setChecked(chatflags & RS_CHAT_BLINK); whileBlocking(ui.chat_Blink)->setChecked(chatflags & RS_CHAT_BLINK);
uint chatLobbyFlags = Settings->getChatLobbyFlags(); uint chatLobbyFlags = Settings->getChatLobbyFlags();
ui.chatLobby_Blink->setChecked(chatLobbyFlags & RS_CHATLOBBY_BLINK); whileBlocking(ui.chatLobby_Blink)->setChecked(chatLobbyFlags & RS_CHATLOBBY_BLINK);
// load personal invites // load personal invites
// //

View File

@ -21,6 +21,7 @@
#include "DirectoriesPage.h" #include "DirectoriesPage.h"
#include "gui/ShareManager.h" #include "gui/ShareManager.h"
#include "util/misc.h"
#include <QMessageBox> #include <QMessageBox>
#include "rshare.h" #include "rshare.h"
@ -62,15 +63,15 @@ void DirectoriesPage::updateFollowSymLinks() { rsFiles->setFollow
/** Loads the settings for this page */ /** Loads the settings for this page */
void DirectoriesPage::load() void DirectoriesPage::load()
{ {
ui.shareDownloadDirectoryCB->setChecked(rsFiles->getShareDownloadDirectory()); whileBlocking(ui.shareDownloadDirectoryCB)->setChecked(rsFiles->getShareDownloadDirectory());
int u = rsFiles->watchPeriod() ; int u = rsFiles->watchPeriod() ;
ui.autoCheckDirectoriesDelay_SB->setValue(u) ; whileBlocking(ui.autoCheckDirectoriesDelay_SB)->setValue(u) ;
ui.autoCheckDirectories_CB->setChecked(rsFiles->watchEnabled()) ; ; whileBlocking(ui.autoCheckDirectories_CB)->setChecked(rsFiles->watchEnabled()) ; ;
ui.incomingDir->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str())); whileBlocking(ui.incomingDir)->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str()));
ui.partialsDir->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str())); whileBlocking(ui.partialsDir)->setText(QString::fromUtf8(rsFiles->getPartialsDirectory().c_str()));
ui.followSymLinks_CB->setChecked(rsFiles->followSymLinks()); whileBlocking(ui.followSymLinks_CB)->setChecked(rsFiles->followSymLinks());
} }
void DirectoriesPage::setIncomingDirectory() void DirectoriesPage::setIncomingDirectory()

View File

@ -20,6 +20,7 @@
****************************************************************/ ****************************************************************/
#include "ForumPage.h" #include "ForumPage.h"
#include "util/misc.h"
#include "rsharesettings.h" #include "rsharesettings.h"
ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags) ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags)
@ -51,10 +52,10 @@ void ForumPage::updateLoadEmoticons() { Settings->setForumLoadEmoticons(
/** Loads the settings for this page */ /** Loads the settings for this page */
void ForumPage::load() void ForumPage::load()
{ {
ui.setMsgToReadOnActivate->setChecked(Settings->getForumMsgSetToReadOnActivate()); whileBlocking(ui.setMsgToReadOnActivate)->setChecked(Settings->getForumMsgSetToReadOnActivate());
ui.expandNewMessages->setChecked(Settings->getForumExpandNewMessages()); whileBlocking(ui.expandNewMessages)->setChecked(Settings->getForumExpandNewMessages());
ui.loadEmbeddedImages->setChecked(Settings->getForumLoadEmbeddedImages()); whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getForumLoadEmbeddedImages());
ui.loadEmoticons->setChecked(Settings->getForumLoadEmoticons()); whileBlocking(ui.loadEmoticons)->setChecked(Settings->getForumLoadEmoticons());
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Forum); ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Forum);
} }

View File

@ -27,6 +27,7 @@
#include "GeneralPage.h" #include "GeneralPage.h"
#include <util/stringutil.h> #include <util/stringutil.h>
#include <util/misc.h>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include "rsharesettings.h" #include "rsharesettings.h"
#include <gui/QuickStartWizard.h> #include <gui/QuickStartWizard.h>
@ -157,7 +158,7 @@ void GeneralPage::load()
ui.chkRunRetroshareAtSystemStartupMinimized->setChecked(minimized); ui.chkRunRetroshareAtSystemStartupMinimized->setChecked(minimized);
#endif #endif
ui.checkStartMinimized->setChecked(Settings->getStartMinimized()); whileBlocking(ui.checkStartMinimized)->setChecked(Settings->getStartMinimized());
bool advancedmode = false; bool advancedmode = false;
std::string advsetting; std::string advsetting;
@ -165,13 +166,13 @@ void GeneralPage::load()
{ {
advancedmode = true; advancedmode = true;
} }
ui.checkAdvanced->setChecked(advancedmode); whileBlocking(ui.checkAdvanced)->setChecked(advancedmode);
ui.checkQuit->setChecked(Settings->value("doQuit", false).toBool()); whileBlocking(ui.checkQuit)->setChecked(Settings->value("doQuit", false).toBool());
ui.checkCloseToTray->setChecked(Settings->getCloseToTray()); whileBlocking(ui.checkCloseToTray)->setChecked(Settings->getCloseToTray());
ui.autoLogin->setChecked(RsInit::getAutoLogin()); whileBlocking(ui.autoLogin)->setChecked(RsInit::getAutoLogin());
ui.registerRetroShareProtocol->setChecked(Settings->getRetroShareProtocol()); whileBlocking(ui.registerRetroShareProtocol)->setChecked(Settings->getRetroShareProtocol());
ui.useLocalServer->setChecked(Settings->getUseLocalServer()); whileBlocking(ui.useLocalServer)->setChecked(Settings->getUseLocalServer());
ui.idleSpinBox->setValue(Settings->getMaxTimeBeforeIdle()); whileBlocking(ui.idleSpinBox)->setValue(Settings->getMaxTimeBeforeIdle());
} }

View File

@ -1,6 +1,7 @@
#include <iostream> #include <iostream>
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "util/misc.h"
#include "GroupFrameSettingsWidget.h" #include "GroupFrameSettingsWidget.h"
#include "ui_GroupFrameSettingsWidget.h" #include "ui_GroupFrameSettingsWidget.h"
@ -33,8 +34,8 @@ void GroupFrameSettingsWidget::loadSettings(GroupFrameSettings::Type type)
GroupFrameSettings groupFrameSettings; GroupFrameSettings groupFrameSettings;
if (Settings->getGroupFrameSettings(type, groupFrameSettings)) { if (Settings->getGroupFrameSettings(type, groupFrameSettings)) {
ui->openAllInNewTabCheckBox->setChecked(groupFrameSettings.mOpenAllInNewTab); whileBlocking(ui->openAllInNewTabCheckBox)->setChecked(groupFrameSettings.mOpenAllInNewTab);
ui->hideTabBarWithOneTabCheckBox->setChecked(groupFrameSettings.mHideTabBarWithOneTab); whileBlocking(ui->hideTabBarWithOneTabCheckBox)->setChecked(groupFrameSettings.mHideTabBarWithOneTab);
} else { } else {
hide(); hide();
mEnable = false; mEnable = false;

View File

@ -24,6 +24,7 @@
#include "retroshare/rsmsgs.h" #include "retroshare/rsmsgs.h"
#include "MessagePage.h" #include "MessagePage.h"
#include "util/misc.h"
#include "gui/common/TagDefs.h" #include "gui/common/TagDefs.h"
#include <algorithm> #include <algorithm>
#include "NewTag.h" #include "NewTag.h"
@ -110,20 +111,20 @@ void MessagePage::updateMsgTags()
void void
MessagePage::load() MessagePage::load()
{ {
ui.setMsgToReadOnActivate->setChecked(Settings->getMsgSetToReadOnActivate()); whileBlocking(ui.setMsgToReadOnActivate)->setChecked(Settings->getMsgSetToReadOnActivate());
ui.loadEmbeddedImages->setChecked(Settings->getMsgLoadEmbeddedImages()); whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getMsgLoadEmbeddedImages());
ui.openComboBox->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen())); whileBlocking(ui.openComboBox)->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen()));
// state of filter combobox // state of filter combobox
uint32_t flags = rsMail->getDistantMessagingPermissionFlags() ; uint32_t flags = rsMail->getDistantMessagingPermissionFlags() ;
if(flags & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY) if(flags & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY)
ui.comboBox->setCurrentIndex(2); whileBlocking(ui.comboBox)->setCurrentIndex(2);
else if(flags & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS) else if(flags & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
ui.comboBox->setCurrentIndex(1); whileBlocking(ui.comboBox)->setCurrentIndex(1);
else else
ui.comboBox->setCurrentIndex(0); whileBlocking(ui.comboBox)->setCurrentIndex(0);
// fill items // fill items
rsMail->getMessageTagTypes(*m_pTags); rsMail->getMessageTagTypes(*m_pTags);