tested/fixed all option buttons

This commit is contained in:
csoler 2017-01-31 23:07:59 +01:00
parent a357c52124
commit 79ef4031f7
6 changed files with 111 additions and 138 deletions

View File

@ -31,6 +31,7 @@
#include "AppearancePage.h"
#include "rsharesettings.h"
#include "gui/MainWindow.h"
#include "gui/notifyqt.h"
#include "gui/statusbar/peerstatus.h"
#include "gui/statusbar/natstatus.h"
#include "gui/statusbar/dhtstatus.h"
@ -90,9 +91,10 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
connect(ui.cmboStyleSheet, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSheetName() ));
connect(ui.rbtPageOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.rbtActionOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateActionButtonLoc() ));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
}
void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
@ -128,8 +130,16 @@ void AppearancePage::updateInterfaceStyle()
Settings->setInterfaceStyle(ui.cmboStyle->currentText());
}
void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); }
void AppearancePage::updateRbtPageOnToolBar() { Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());}
void AppearancePage::updateActionButtonLoc() { Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked()); }
void AppearancePage::updateRbtPageOnToolBar()
{
Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateActionButtonLoc()
{
Settings->setActionButtonLoc(!ui.menuItemsButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
void AppearancePage::updateCmboToolButtonStyle()
@ -149,6 +159,7 @@ void AppearancePage::updateCmboToolButtonStyle()
default:
Settings->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
}
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateCmboToolButtonSize()
@ -174,6 +185,7 @@ void AppearancePage::updateCmboToolButtonSize()
case 5:
Settings->setToolButtonSize(128);
}
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateCmboListItemSize()
{
@ -198,6 +210,7 @@ void AppearancePage::updateCmboListItemSize()
case 5:
Settings->setListItemIconSize(128);
}
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
@ -218,10 +231,9 @@ void AppearancePage::load()
}
ui.cmboStyleSheet->setCurrentIndex(index);
ui.rbtPageOnToolBar->setChecked(Settings->getPageButtonLoc());
ui.rbtPageOnListItem->setChecked(!Settings->getPageButtonLoc());
ui.rbtActionOnToolBar->setChecked(Settings->getActionButtonLoc());
ui.rbtActionOnListItem->setChecked(!Settings->getActionButtonLoc());
ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc());
ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
switch (Settings->getToolButtonStyle())
{
case Qt::ToolButtonIconOnly:

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1160</width>
<height>608</height>
<height>897</height>
</rect>
</property>
<property name="contextMenuPolicy">
@ -44,13 +44,6 @@
<string>Language</string>
</property>
<layout class="QGridLayout" name="grpLanguageGLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="labelLanguage">
<property name="text">
<string>Changes to language will only take effect after restarting RetroShare!</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="cmboLanguage">
<property name="minimumSize">
@ -70,7 +63,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="1" column="2">
<spacer name="grpLanguageHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -83,6 +76,13 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelLanguage">
<property name="text">
<string>(Needs restart)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -198,98 +198,28 @@
<property name="title">
<string>Tool Bar</string>
</property>
<layout class="QGridLayout" name="grpToolBarGLayout">
<item row="4" column="0">
<widget class="QFrame" name="frameAction">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="frameActionHLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="rbtActionOnToolBar">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelPageToolBar">
<property name="text">
<string>On Tool Bar</string>
<string>Main page items:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbtActionOnListItem">
<widget class="QComboBox" name="mainPageButtonType_CB">
<item>
<property name="text">
<string>On List Ite&amp;m</string>
<string>Buttons</string>
</property>
</widget>
</item>
<item>
<spacer name="frameActionHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>300</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelActionToolBar">
<property name="text">
<string>Where do you want to have the buttons for menu?</string>
<string>Item list</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="framePage">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="framePageHLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QRadioButton" name="rbtPageOnToolBar">
<property name="text">
<string>On Tool Bar</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbtPageOnListItem">
<property name="text">
<string>On List Item</string>
</property>
</widget>
</item>
<item>
@ -306,16 +236,46 @@
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelPageToolBar">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelActionToolBar">
<property name="text">
<string>Where do you want to have the buttons for the page?</string>
<string>Menu items:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item>
<widget class="QComboBox" name="menuItemsButtonType_CB">
<item>
<property name="text">
<string>Buttons</string>
</property>
</item>
<item>
<property name="text">
<string>Item list</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="frameActionHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>300</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frameToolListStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">

View File

@ -30,10 +30,9 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */
ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab"));
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
connect(ui.loadThreadCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateLoadThread)) ;
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
}
void ChannelPage::updateLoadThread() { Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked()); }

View File

@ -53,10 +53,7 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate()));
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
connect(ui.openComboBox, SIGNAL(currentItemChanged(int)),this,SLOT(updateMsgOpen() ));
connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateDistantMsgs() ));
connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateMsgTags() ));
connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
}
MessagePage::~MessagePage()

View File

@ -34,6 +34,8 @@ ServicePermissionsPage::ServicePermissionsPage(QWidget * parent, Qt::WindowFlags
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
ui.cb_hideOffline->setChecked(true);
connect(ui.cb_hideOffline, SIGNAL(toggled(bool)), ui.frame, SLOT(setHideOffline(bool)));
//QObject::connect(ui.tableWidget,SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableItemChanged(QTableWidgetItem *)));

View File

@ -148,6 +148,9 @@ void WebuiPage::onEnableCBClicked(bool checked)
ui.params_GB->setEnabled(false);
ui.applyStartBrowser_PB->setEnabled(false);
}
QString S;
updateParams(S);
}
void WebuiPage::onApplyClicked()