- Bug fix: Checkbox for automatic share of the incoming directory doesn't correctly set with setDown, use setChecked
- ShareManager and RSettingsWin doesn't need to be created all the time
- RSettingsWin: Save the last active page for the current runtime
- ShareManager and DirectoryPage: Show changed shared directories direct after the change




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2777 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-04-24 22:09:47 +00:00
parent 900ae2332f
commit 0773e92f85
9 changed files with 136 additions and 46 deletions

View file

@ -35,11 +35,14 @@
#include "rsettingswin.h"
RSettingsWin *RSettingsWin::_instance = NULL;
int RSettingsWin::lastPage = 0;
RSettingsWin::RSettingsWin(QWidget * parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
setAttribute(Qt::WA_DeleteOnClose, true);
setModal(false);
initStackedWidget();
@ -48,12 +51,47 @@ RSettingsWin::RSettingsWin(QWidget * parent, Qt::WFlags flags)
connect(okButton, SIGNAL(clicked( bool )), this, SLOT( saveChanges()) );
}
RSettingsWin::~RSettingsWin()
{
lastPage = stackedWidget->currentIndex ();
_instance = NULL;
}
void
RSettingsWin::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
/*static*/ void RSettingsWin::showYourself(QWidget *parent)
{
if(_instance == NULL) {
_instance = new RSettingsWin(parent);
}
if (_instance->isHidden()) {
_instance->setNewPage(lastPage);
}
_instance->show();
_instance->activateWindow();
}
/*static*/ void RSettingsWin::postModDirectories(bool update_local)
{
if (_instance == NULL || _instance->isHidden() || _instance->stackedWidget == NULL) {
return;
}
if (update_local) {
if (_instance->stackedWidget->currentIndex() == Directories) {
ConfigPage *Page = (ConfigPage*) _instance->stackedWidget->currentWidget();
if (Page) {
Page->load();
}
}
}
}
void
RSettingsWin::initStackedWidget()
{