mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -04:00
Added to store the splitter position for the wiki dialog
* Added to store the splitter position for the wiki dialog * Fixing the missed icon for Photoshare * Correcting Indentation
This commit is contained in:
parent
566399440c
commit
5cea8c4335
4 changed files with 74 additions and 30 deletions
|
@ -20,7 +20,16 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="toolBarFrame">
|
<widget class="QFrame" name="toolBarFrame">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<property name="margin">
|
<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>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -29,8 +38,8 @@
|
||||||
<string>Create Album</string>
|
<string>Create Album</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../images.qrc">
|
<iconset resource="Photo_images.qrc">
|
||||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
<normaloff>:/images/album_create_64.png</normaloff>:/images/album_create_64.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -140,7 +149,16 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "WikiDialog.h"
|
#include "WikiDialog.h"
|
||||||
#include "gui/WikiPoos/WikiAddDialog.h"
|
#include "gui/WikiPoos/WikiAddDialog.h"
|
||||||
#include "gui/WikiPoos/WikiEditDialog.h"
|
#include "gui/WikiPoos/WikiEditDialog.h"
|
||||||
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/gxs/WikiGroupDialog.h"
|
#include "gui/gxs/WikiGroupDialog.h"
|
||||||
|
|
||||||
#include <retroshare/rswiki.h>
|
#include <retroshare/rswiki.h>
|
||||||
|
@ -105,6 +105,9 @@ WikiDialog::WikiDialog(QWidget *parent) : RsGxsUpdateBroadcastPage(rsWiki, paren
|
||||||
/* setup TokenQueue */
|
/* setup TokenQueue */
|
||||||
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
||||||
|
|
||||||
|
// Set initial size of the splitter
|
||||||
|
ui.listSplitter->setStretchFactor(0, 0);
|
||||||
|
ui.listSplitter->setStretchFactor(1, 1);
|
||||||
|
|
||||||
/* Setup Group Tree */
|
/* Setup Group Tree */
|
||||||
mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(), true);
|
mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(), true);
|
||||||
|
@ -112,13 +115,37 @@ WikiDialog::WikiDialog(QWidget *parent) : RsGxsUpdateBroadcastPage(rsWiki, paren
|
||||||
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(), false);
|
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(), false);
|
||||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(), false);
|
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(), false);
|
||||||
|
|
||||||
|
// load settings
|
||||||
|
processSettings(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
WikiDialog::~WikiDialog()
|
WikiDialog::~WikiDialog()
|
||||||
{
|
{
|
||||||
|
// save settings
|
||||||
|
processSettings(false);
|
||||||
|
|
||||||
delete(mWikiQueue);
|
delete(mWikiQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WikiDialog::processSettings(bool load)
|
||||||
|
{
|
||||||
|
Settings->beginGroup("WikiDialog");
|
||||||
|
|
||||||
|
if (load) {
|
||||||
|
// load settings
|
||||||
|
|
||||||
|
// state of splitter
|
||||||
|
ui.listSplitter->restoreState(Settings->value("SplitterList").toByteArray());
|
||||||
|
} else {
|
||||||
|
// save settings
|
||||||
|
|
||||||
|
// state of splitter
|
||||||
|
Settings->setValue("SplitterList", ui.listSplitter->saveState());
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
void WikiDialog::OpenOrShowAddPageDialog()
|
void WikiDialog::OpenOrShowAddPageDialog()
|
||||||
{
|
{
|
||||||
RsGxsGroupId groupId = getSelectedGroup();
|
RsGxsGroupId groupId = getSelectedGroup();
|
||||||
|
|
|
@ -77,31 +77,30 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void clearWikiPage();
|
void clearWikiPage();
|
||||||
void clearGroupTree();
|
void clearGroupTree();
|
||||||
|
|
||||||
void updateWikiPage(const RsWikiSnapshot &page);
|
void updateWikiPage(const RsWikiSnapshot &page);
|
||||||
|
|
||||||
bool getSelectedPage(RsGxsGroupId &groupId, RsGxsMessageId &pageId, RsGxsMessageId &origPageId);
|
|
||||||
std::string getSelectedPage();
|
|
||||||
const RsGxsGroupId &getSelectedGroup();
|
|
||||||
|
|
||||||
|
bool getSelectedPage(RsGxsGroupId &groupId, RsGxsMessageId &pageId, RsGxsMessageId &origPageId);
|
||||||
|
std::string getSelectedPage();
|
||||||
|
const RsGxsGroupId &getSelectedGroup();
|
||||||
|
|
||||||
// Using GroupTreeWidget.
|
// Using GroupTreeWidget.
|
||||||
void wikiSubscribe(bool subscribe);
|
void wikiSubscribe(bool subscribe);
|
||||||
void GroupMetaDataToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo);
|
void GroupMetaDataToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo);
|
||||||
void insertGroupsData(const std::list<RsGroupMetaData> &wikiList);
|
void insertGroupsData(const std::list<RsGroupMetaData> &wikiList);
|
||||||
|
|
||||||
|
void processSettings(bool load);
|
||||||
|
|
||||||
void requestGroupMeta();
|
void requestGroupMeta();
|
||||||
void loadGroupMeta(const uint32_t &token);
|
void loadGroupMeta(const uint32_t &token);
|
||||||
|
|
||||||
void requestPages(const std::list<RsGxsGroupId> &groupIds);
|
void requestPages(const std::list<RsGxsGroupId> &groupIds);
|
||||||
void loadPages(const uint32_t &token);
|
void loadPages(const uint32_t &token);
|
||||||
|
|
||||||
void requestWikiPage(const RsGxsGrpMsgIdPair &msgId);
|
|
||||||
void loadWikiPage(const uint32_t &token);
|
|
||||||
|
|
||||||
|
void requestWikiPage(const RsGxsGrpMsgIdPair &msgId);
|
||||||
|
void loadWikiPage(const uint32_t &token);
|
||||||
|
|
||||||
TokenQueue *mWikiQueue;
|
TokenQueue *mWikiQueue;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="listSplitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue