Removed own settings for news feed.

Added parameter to RSettingsWin::showYourself to show the options with a specific page.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4104 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-03-26 22:17:15 +00:00
parent c820826260
commit 5250c27fed
10 changed files with 20 additions and 353 deletions

View File

@ -334,7 +334,6 @@ HEADERS += rshare.h \
gui/feeds/SubFileItem.h \
gui/feeds/SubDestItem.h \
gui/feeds/AttachFileItem.h \
gui/feeds/FeedSettings.h \
gui/connect/ConnectFriendWizard.h \
gui/groups/CreateGroup.h
@ -410,7 +409,6 @@ FORMS += gui/StartDialog.ui \
gui/feeds/SubFileItem.ui \
gui/feeds/SubDestItem.ui \
gui/feeds/AttachFileItem.ui \
gui/feeds/FeedSettings.ui \
gui/im_history/ImHistoryBrowser.ui \
gui/groups/CreateGroup.ui \
gui/common/GroupTreeWidget.ui
@ -556,7 +554,6 @@ SOURCES += main.cpp \
gui/feeds/SubFileItem.cpp \
gui/feeds/SubDestItem.cpp \
gui/feeds/AttachFileItem.cpp \
gui/feeds/FeedSettings.cpp \
gui/connect/ConnectFriendWizard.cpp \
gui/groups/CreateGroup.cpp

View File

@ -30,7 +30,7 @@
#include "feeds/ChanMsgItem.h"
#include "feeds/ForumNewItem.h"
#include "feeds/ForumMsgItem.h"
#include "feeds/FeedSettings.h"
#include "settings/rsettingswin.h"
#ifdef BLOGS
#include "feeds/BlogNewItem.h"
@ -493,6 +493,5 @@ void NewsFeed::sendNewsFeedChanged()
void NewsFeed::feedoptions()
{
FeedSettings fs (this);
fs.exec ();
RSettingsWin::showYourself(this, RSettingsWin::Notify);
}

View File

@ -152,7 +152,7 @@ p, li { white-space: pre-wrap; }
<item row="0" column="2">
<widget class="QPushButton" name="feedOptionsButton">
<property name="text">
<string>Edit Options</string>
<string>Options</string>
</property>
</widget>
</item>

View File

@ -1,124 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "FeedSettings.h"
#include <rshare.h>
#include <retroshare/rsnotify.h>
#include "gui/settings/rsharesettings.h"
/** Default constructor */
FeedSettings::FeedSettings(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
ui.applyButton->setToolTip(tr("Apply and Close"));
load();
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
void FeedSettings::show()
{
if(!this->isVisible()) {
QDialog::show();
}
}
void FeedSettings::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
/** Saves the changes on this page */
bool FeedSettings::save()
{
/* extract from rsNotify the flags */
uint newsflags = 0;
if (ui.notify_Peers->isChecked())
newsflags |= RS_FEED_TYPE_PEER;
if (ui.notify_Channels->isChecked())
newsflags |= RS_FEED_TYPE_CHAN;
if (ui.notify_Forums->isChecked())
newsflags |= RS_FEED_TYPE_FORUM;
if (ui.notify_Blogs->isChecked())
newsflags |= RS_FEED_TYPE_BLOG;
if (ui.notify_Chat->isChecked())
newsflags |= RS_FEED_TYPE_CHAT;
if (ui.notify_Messages->isChecked())
newsflags |= RS_FEED_TYPE_MSG;
if (ui.notify_Chat->isChecked())
newsflags |= RS_FEED_TYPE_CHAT;
Settings->setNewsFeedFlags(newsflags);
Settings->setAddFeedsAtEnd(ui.addFeedsAtEnd->isChecked());
load();
return true;
}
/** Loads the news feed settings */
void FeedSettings::load()
{
/* extract from rsNotify the flags */
uint newsflags = Settings->getNewsFeedFlags();
ui.notify_Peers->setChecked(newsflags & RS_FEED_TYPE_PEER);
ui.notify_Channels->setChecked(newsflags & RS_FEED_TYPE_CHAN);
ui.notify_Forums->setChecked(newsflags & RS_FEED_TYPE_FORUM);
ui.notify_Blogs->setChecked(newsflags & RS_FEED_TYPE_BLOG);
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.notify_Messages->setChecked(newsflags & RS_FEED_TYPE_MSG);
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd());
}
void FeedSettings::closeinfodlg()
{
close();
}
void FeedSettings::applyDialog()
{
/* reload now */
save();
/* close the Dialog after the Changes applied */
closeinfodlg();
}

View File

@ -1,68 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _FEEDSETTINGS_H
#define _FEEDSETTINGS_H
#include <QDialog>
#include "ui_FeedSettings.h"
class FeedSettings : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
FeedSettings(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
/** Saves the changes */
bool save();
/** Loads the news feed settings */
void load();
signals:
void configChanged() ;
public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();
void applyDialog();
private:
/** Qt Designer generated object */
Ui::FeedSettings ui;
};
#endif

View File

@ -1,148 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FeedSettings</class>
<widget class="QDialog" name="FeedSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>329</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit your News Feed Settings</string>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="notify_ForumNewMsg">
<property name="title">
<string>News Feed</string>
</property>
<layout class="QVBoxLayout" name="_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="notify_Peers">
<property name="text">
<string>Peers</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Channels">
<property name="text">
<string>Channels</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Forums">
<property name="text">
<string>Forums</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Blogs">
<property name="text">
<string>Blogs</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Messages">
<property name="text">
<string>Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notify_Chat">
<property name="text">
<string>Chat</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="addFeedsAtEnd">
<property name="text">
<string>Add feeds at end</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -68,15 +68,21 @@ RSettingsWin::closeEvent (QCloseEvent * event)
QWidget::closeEvent(event);
}
/*static*/ void RSettingsWin::showYourself(QWidget *parent)
/*static*/ void RSettingsWin::showYourself(QWidget *parent, PageType page /*= LastPage*/)
{
if(_instance == NULL) {
_instance = new RSettingsWin(parent);
}
if (_instance->isHidden()) {
_instance->setNewPage(lastPage);
if (page != LastPage) {
/* show given page */
_instance->setNewPage(page);
} else {
if (_instance->isHidden()) {
_instance->setNewPage(lastPage);
}
}
_instance->show();
_instance->activateWindow();
}

View File

@ -31,10 +31,10 @@ class RSettingsWin: public QDialog, private Ui::Settings
Q_OBJECT
public:
enum PageType { General = 0, Server, Transfer,
enum PageType { LastPage = -1, General = 0, Server, Transfer,
Directories, Notify, Security, Message, Forum, Chat, Appearance, Sound, Fileassociations };
static void showYourself(QWidget *parent);
static void showYourself(QWidget *parent, PageType page = LastPage);
static void postModDirectories(bool update_local);
protected:

View File

@ -6988,6 +6988,11 @@ p, li { white-space: pre-wrap; }
<source>Remove All</source>
<translation>Alle entfernen</translation>
</message>
<message>
<location line="+20"/>
<source>Options</source>
<translation>Optionen</translation>
</message>
</context>
<context>
<name>NotifyPage</name>
@ -9171,7 +9176,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>RSettingsWin</name>
<message>
<location filename="../gui/settings/rsettingswin.cpp" line="+131"/>
<location filename="../gui/settings/rsettingswin.cpp" line="+137"/>
<source>General</source>
<translation>Allgemein</translation>
</message>