Merge pull request #715 from PhenomRetroShare/Fix_NatDisplayOptionSaving

Fix NAT Display setting saving.
This commit is contained in:
csoler 2017-03-03 22:26:32 +01:00 committed by GitHub
commit 9716b9298c
5 changed files with 32 additions and 32 deletions

View File

@ -1500,9 +1500,9 @@ void MainWindow::switchVisibilityStatus(StatusElement e,bool b)
case StatusGrpStatus : getInstance()->statusBar() ->setVisible(b); break ;
case StatusCompactMode : getInstance()->setCompactStatusMode(b) ; break ;
case StatusShowToolTip : getInstance()->toggleStatusToolTip(b) ; break ;
case StatusShowCBox : getInstance()->statusComboBoxInstance() ->setVisible(b); break ;
case StatusShowStatus : getInstance()->peerstatusInstance() ->setVisible(b); break ;
case StatusShowPeer : getInstance()->natstatusInstance() ->setVisible(b); break ;
case StatusShowStatus : getInstance()->statusComboBoxInstance() ->setVisible(b); break ;
case StatusShowPeer : getInstance()->peerstatusInstance() ->setVisible(b); break ;
case StatusShowNAT : getInstance()->natstatusInstance() ->setVisible(b); break ;
case StatusShowDHT : getInstance()->dhtstatusInstance() ->setVisible(b); break ;
case StatusShowHashing : getInstance()->hashingstatusInstance() ->setVisible(b); break ;
case StatusShowDisc : getInstance()->discstatusInstance() ->setVisible(b); break ;

View File

@ -111,20 +111,20 @@ public:
enum StatusElement {
StatusGrpStatus = 0x01,
StatusCompactMode = 0x02,
StatusShowToolTip = 0x03,
StatusShowStatus = 0x04,
StatusShowPeer = 0x05,
StatusShowDHT = 0x06,
StatusShowHashing = 0x07,
StatusShowDisc = 0x08,
StatusShowRate = 0x09,
StatusShowOpMode = 0x0a,
StatusShowSound = 0x0b,
StatusShowToaster = 0x0c,
StatusShowSystray = 0x0d,
StatusShowCBox = 0x0e
StatusGrpStatus = 0x01,
StatusCompactMode = 0x02,
StatusShowToolTip = 0x03,
StatusShowStatus = 0x04,
StatusShowPeer = 0x05,
StatusShowNAT = 0x06,
StatusShowDHT = 0x07,
StatusShowHashing = 0x08,
StatusShowDisc = 0x09,
StatusShowRate = 0x0a,
StatusShowOpMode = 0x0b,
StatusShowSound = 0x0c,
StatusShowToaster = 0x0d,
StatusShowSystray = 0x0e,
};
/** Create main window */
@ -159,7 +159,7 @@ public:
NewsFeed *newsFeed;
FriendsDialog *friendsDialog;
TransfersDialog *transfersDialog;
IdDialog *idDialog ;
IdDialog *idDialog;
ChatLobbyWidget *chatLobbyDialog;
MessagesDialog *messagesDialog;
SettingsPage *settingsDialog;

View File

@ -53,12 +53,12 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.cmboStyleSheet, SIGNAL(activated(int)), this, SLOT(loadStyleSheet(int)));
connect(ui.grpStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusBar(), */, SLOT(switch_status_grpStatus(bool)));
connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_compactMode(bool)));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_showToolTip(bool)));
connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusComboBoxInstance(), */, SLOT(switch_status_ShowCBox(bool)));
connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), this /* pMainWindow->peerstatusInstance(), */, SLOT(switch_status_ShowStatus(bool)));
connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), this /* pMainWindow->natstatusInstance(), */, SLOT(switch_status_ShowPeer(bool)));
connect(ui.grpStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusBar(), */, SLOT(switch_status_grpStatus(bool)));
connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_compactMode(bool)));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_showToolTip(bool)));
connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusComboBoxInstance(), */, SLOT(switch_status_ShowStatus(bool)));
connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), this /* pMainWindow->peerstatusInstance(), */, SLOT(switch_status_ShowPeer(bool)));
connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), this /* pMainWindow->natstatusInstance(), */, SLOT(switch_status_ShowNAT(bool)));
connect(ui.checkBoxShowDHTStatus, SIGNAL(toggled(bool)), this /* pMainWindow->dhtstatusInstance(), */, SLOT(switch_status_ShowDHT(bool)));
connect(ui.checkBoxShowHashingStatus, SIGNAL(toggled(bool)), this /* pMainWindow->hashingstatusInstance(), */, SLOT(switch_status_ShowHashing(bool)));
connect(ui.checkBoxShowDiscStatus, SIGNAL(toggled(bool)), this /* pMainWindow->discstatusInstance(), */, SLOT(switch_status_ShowDisc(bool)));
@ -103,6 +103,7 @@ void AppearancePage::switch_status_compactMode(bool b) { switch_status(Main
void AppearancePage::switch_status_showToolTip(bool b) { switch_status(MainWindow::StatusShowToolTip,"DisableSysTrayToolTip", b) ; }
void AppearancePage::switch_status_ShowStatus(bool b) { switch_status(MainWindow::StatusShowStatus ,"ShowStatus", b) ; }
void AppearancePage::switch_status_ShowPeer(bool b) { switch_status(MainWindow::StatusShowPeer ,"ShowPeer", b) ; }
void AppearancePage::switch_status_ShowNAT(bool b) { switch_status(MainWindow::StatusShowNAT ,"ShowNAT", b) ; }
void AppearancePage::switch_status_ShowDHT(bool b) { switch_status(MainWindow::StatusShowDHT ,"ShowDHT", b) ; }
void AppearancePage::switch_status_ShowHashing(bool b) { switch_status(MainWindow::StatusShowHashing,"ShowHashing", b) ; }
void AppearancePage::switch_status_ShowDisc(bool b) { switch_status(MainWindow::StatusShowDisc ,"ShowDisc", b) ; }
@ -111,7 +112,6 @@ void AppearancePage::switch_status_ShowOpMode(bool b) { switch_status(Main
void AppearancePage::switch_status_ShowSound(bool b) { switch_status(MainWindow::StatusShowSound ,"ShowSound", b) ; }
void AppearancePage::switch_status_ShowToaster(bool b) { switch_status(MainWindow::StatusShowToaster,"ShowToaster", b) ; }
void AppearancePage::switch_status_ShowSystray(bool b) { switch_status(MainWindow::StatusShowSystray,"ShowSysTrayOnStatusBar",b) ; }
void AppearancePage::switch_status_ShowCBox(bool b) { switch_status(MainWindow::StatusShowCBox, "ShowStatusCBox" ,b) ; }
void AppearancePage::switch_status(MainWindow::StatusElement s,const QString& key, bool b)
{
@ -304,7 +304,7 @@ void AppearancePage::load()
whileBlocking(ui.checkBoxShowNATStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowDHTStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowHashingStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowDiscStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "Show eDisc", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowDiscStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDisc", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowRateStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowOpModeStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowOpMode", QVariant(true)).toBool());
whileBlocking(ui.checkBoxShowSoundStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowSound", QVariant(true)).toBool());

View File

@ -49,6 +49,7 @@ private slots:
void switch_status_showToolTip(bool b) ;
void switch_status_ShowStatus(bool) ;
void switch_status_ShowPeer(bool) ;
void switch_status_ShowNAT(bool) ;
void switch_status_ShowDHT(bool) ;
void switch_status_ShowHashing(bool) ;
void switch_status_ShowDisc(bool) ;
@ -57,7 +58,6 @@ private slots:
void switch_status_ShowSound(bool) ;
void switch_status_ShowToaster(bool) ;
void switch_status_ShowSystray(bool) ;
void switch_status_ShowCBox(bool) ;
void updateLanguageCode() ;
void updateInterfaceStyle() ;

View File

@ -418,17 +418,17 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="checkBoxShowOpModeStatus">
<item row="4" column="2">
<widget class="QCheckBox" name="checkBoxShowSystrayOnStatus">
<property name="text">
<string>Show Operating Mode Status</string>
<string>Show SysTray on Status Bar</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="checkBoxShowSystrayOnStatus">
<widget class="QCheckBox" name="checkBoxShowOpModeStatus">
<property name="text">
<string>Show SysTray on Status Bar</string>
<string>Show Operating Mode Status</string>
</property>
</widget>
</item>