mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 11:56:37 -05:00
Applied changes from the trunk to the GXS forums.
Cleaned old and unused files. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5868 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ae0e93ac41
commit
55d562238e
44 changed files with 1744 additions and 9594 deletions
|
|
@ -1,234 +0,0 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* 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 <QMessageBox>
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "CreateGxsForum.h"
|
||||
#include "gui/common/PeerDefs.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#define CREATEGXSFORUMS_NEWFORUMID 1
|
||||
|
||||
|
||||
/** Constructor */
|
||||
CreateGxsForum::CreateGxsForum(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
mForumQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
|
||||
|
||||
// connect up the buttons.
|
||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
||||
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
|
||||
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
|
||||
|
||||
if (!ui.pubKeyShare_cb->isChecked()) {
|
||||
ui.contactsdockWidget->hide();
|
||||
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
|
||||
}
|
||||
|
||||
/* initialize key share list */
|
||||
ui.keyShareList->setHeaderText(tr("Contacts:"));
|
||||
ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK);
|
||||
ui.keyShareList->start();
|
||||
|
||||
newForum();
|
||||
}
|
||||
|
||||
void CreateGxsForum::newForum()
|
||||
{
|
||||
/* enforce Public for the moment */
|
||||
ui.typePublic->setChecked(true);
|
||||
|
||||
ui.typePrivate->setEnabled(false);
|
||||
ui.typeEncrypted->setEnabled(true);
|
||||
|
||||
#ifdef RS_RELEASE_VERSION
|
||||
ui.typePrivate->setVisible(false);
|
||||
ui.typeEncrypted->setVisible(true);
|
||||
#endif
|
||||
|
||||
ui.msgAnon->setChecked(true);
|
||||
//ui.msgAuth->setEnabled(false);
|
||||
|
||||
ui.forumName->clear();
|
||||
ui.forumDesc->clear();
|
||||
|
||||
ui.forumName->setFocus();
|
||||
}
|
||||
|
||||
void CreateGxsForum::createForum()
|
||||
{
|
||||
QString name = misc::removeNewLine(ui.forumName->text());
|
||||
QString desc = ui.forumDesc->toPlainText(); //toHtml();
|
||||
uint32_t flags = 0;
|
||||
|
||||
if(name.isEmpty()) {
|
||||
/* error message */
|
||||
QMessageBox::warning(this, "RetroShare", tr("Please add a Name"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
return; //Don't add a empty name!!
|
||||
}
|
||||
|
||||
#ifdef TOGXS
|
||||
if (ui.typePublic->isChecked()) {
|
||||
flags |= RS_DISTRIB_PUBLIC;
|
||||
} else if (ui.typePrivate->isChecked()) {
|
||||
flags |= RS_DISTRIB_PRIVATE;
|
||||
} else if (ui.typeEncrypted->isChecked()) {
|
||||
flags |= RS_DISTRIB_ENCRYPTED;
|
||||
}
|
||||
|
||||
if (ui.msgAuth->isChecked()) {
|
||||
flags |= RS_DISTRIB_AUTHEN_REQ;
|
||||
} else if (ui.msgAnon->isChecked()) {
|
||||
flags |= RS_DISTRIB_AUTHEN_ANON;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rsGxsForums) {
|
||||
|
||||
|
||||
uint32_t token;
|
||||
RsGxsForumGroup grp;
|
||||
grp.mMeta.mGroupName = std::string(name.toUtf8());
|
||||
grp.mDescription = std::string(desc.toUtf8());
|
||||
grp.mMeta.mGroupFlags = flags;
|
||||
|
||||
rsGxsForums->createGroup(token, grp);
|
||||
|
||||
// get the Queue to handle response.
|
||||
mForumQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_SUMMARY, CREATEGXSFORUMS_NEWFORUMID);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsForum::completeCreateNewForum(const RsGroupMetaData &newForumMeta)
|
||||
{
|
||||
sendShareList(newForumMeta.mGroupId);
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
void CreateGxsForum::sendShareList(std::string forumId)
|
||||
{
|
||||
if (!rsGxsForums)
|
||||
{
|
||||
std::cerr << "CreateGxsForum::sendShareList() GxsForums not active";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui.pubKeyShare_cb->isChecked())
|
||||
{
|
||||
std::list<std::string> shareList;
|
||||
ui.keyShareList->selectedSslIds(shareList, false);
|
||||
#ifdef TOGXS
|
||||
rsGxsForums->groupShareKeys(forumId, shareList);
|
||||
#endif
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CreateGxsForum::setShareList()
|
||||
{
|
||||
if (ui.pubKeyShare_cb->isChecked()){
|
||||
this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height());
|
||||
ui.contactsdockWidget->show();
|
||||
} else { // hide share widget
|
||||
ui.contactsdockWidget->hide();
|
||||
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsForum::cancelForum()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void CreateGxsForum::loadNewForumId(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "CreateGxsForum::loadNewForumId()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
rsGxsForums->getGroupSummary(token, groupInfo);
|
||||
|
||||
if (groupInfo.size() == 1)
|
||||
{
|
||||
RsGroupMetaData fi = groupInfo.front();
|
||||
completeCreateNewForum(fi);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "CreateGxsForum::loadNewForumId() ERROR INVALID Number of Forums Created";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CreateGxsForum::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "CreateGxsForum::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (queue == mForumQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
{
|
||||
|
||||
case CREATEGXSFORUMS_NEWFORUMID:
|
||||
loadNewForumId(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "CreateGxsForum::loadRequest() UNKNOWN UserType ";
|
||||
std::cerr << std::endl;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* 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 _CREATE_GXSFORUM_DIALOG_H
|
||||
#define _CREATE_GXSFORUM_DIALOG_H
|
||||
|
||||
#include "ui_CreateGxsForum.h"
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
class CreateGxsForum : public QDialog, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CreateGxsForum(QWidget *parent = 0);
|
||||
|
||||
void newForum(); /* cleanup */
|
||||
|
||||
// Callback for all Loads.
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
private slots:
|
||||
/* actions to take.... */
|
||||
void createForum();
|
||||
void cancelForum();
|
||||
|
||||
// set private forum key share list
|
||||
void setShareList();
|
||||
|
||||
private:
|
||||
void sendShareList(std::string forumId);
|
||||
void completeCreateNewForum(const RsGroupMetaData &newForumMeta);
|
||||
void loadNewForumId(const uint32_t &token);
|
||||
|
||||
|
||||
std::list<std::string> mShareList;
|
||||
|
||||
QPixmap picture;
|
||||
|
||||
TokenQueue *mForumQueue;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::CreateGxsForum ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,374 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CreateGxsForum</class>
|
||||
<widget class="QDialog" name="CreateGxsForum">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>672</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create new Forum</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelicon">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/konversation64.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="textlabelcreatforums">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; font-size:24pt; font-weight:600; color:#ffffff;">New Forum</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="forumName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="3" rowspan="6">
|
||||
<widget class="QDockWidget" name="contactsdockWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>524287</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>check peers you would like to share private publish key with</string>
|
||||
</property>
|
||||
<property name="floating">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::NoDockWidgetFeatures</set>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Share Key With</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QGridLayout" name="_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="FriendSelectionWidget" name="keyShareList" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>4</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="forumDesc"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="tyoeGroupBox">
|
||||
<property name="title">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="typePublic">
|
||||
<property name="text">
|
||||
<string>Public - Anyone can read and publish (Shared Publish Key)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="typePrivate">
|
||||
<property name="text">
|
||||
<string>Restricted - Anyone can read, limited publishing (Private Publish Key)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="typeEncrypted">
|
||||
<property name="text">
|
||||
<string>Private - (Private Publish Key required to view Messages)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="msgGroupBox_2">
|
||||
<property name="title">
|
||||
<string>Key Sharing</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pubKeyShare_cb">
|
||||
<property name="toolTip">
|
||||
<string>Key recipients can publish to restricted-type channels, and can view and publish for private-type channels</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Share Private Publish Key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<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="4" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="msgGroupBox">
|
||||
<property name="title">
|
||||
<string>Allowed Messages</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="msgAuth">
|
||||
<property name="text">
|
||||
<string>Authenticated Messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="msgAnon">
|
||||
<property name="text">
|
||||
<string>Anonymous Messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<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="5" column="0">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>238</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="createButton">
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>FriendSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/common/FriendSelectionWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -35,6 +35,7 @@
|
|||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/common/Emoticons.h"
|
||||
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/misc.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
|
@ -46,8 +47,8 @@
|
|||
|
||||
|
||||
/** Constructor */
|
||||
CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
|
||||
: QMainWindow(NULL), mForumId(fId), mParentId(pId)
|
||||
CreateGxsForumMsg::CreateGxsForumMsg(const std::string &fId, const std::string &pId)
|
||||
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), mForumId(fId), mParentId(pId)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
|
@ -56,6 +57,12 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
|
|||
/* Setup Queue */
|
||||
mForumQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
|
||||
|
||||
QString text = pId.empty() ? tr("Start New Thread") : tr("Post Forum Message");
|
||||
setWindowTitle(text);
|
||||
|
||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/konversation64.png"));
|
||||
ui.headerFrame->setHeaderText(text);
|
||||
|
||||
Settings->loadWidgetInformation(this);
|
||||
|
||||
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
|
||||
|
|
@ -63,8 +70,8 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
|
|||
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
// connect up the buttons.
|
||||
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
|
||||
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
||||
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(createMsg()));
|
||||
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||
connect( ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
|
||||
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
|
||||
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
|
||||
|
|
@ -80,9 +87,9 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
|
|||
}
|
||||
|
||||
/** context menu searchTablewidget2 **/
|
||||
void CreateGxsForumMsg::forumMessageCostumPopupMenu( QPoint /*point*/ )
|
||||
void CreateGxsForumMsg::forumMessageCostumPopupMenu(QPoint point)
|
||||
{
|
||||
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu();
|
||||
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu(point);
|
||||
|
||||
contextMnu->addSeparator();
|
||||
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
||||
|
|
@ -233,10 +240,9 @@ void CreateGxsForumMsg::loadFormInformation()
|
|||
void CreateGxsForumMsg::createMsg()
|
||||
{
|
||||
QString name = misc::removeNewLine(ui.forumSubject->text());
|
||||
QString desc = ui.forumMessage->toHtml();
|
||||
QString desc;
|
||||
|
||||
if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml())
|
||||
desc = ui.forumMessage->toPlainText() ;
|
||||
RsHtml::optimizeHtml(ui.forumMessage, desc);
|
||||
|
||||
if(name.isEmpty())
|
||||
{ /* error message */
|
||||
|
|
@ -324,11 +330,6 @@ void CreateGxsForumMsg::closeEvent (QCloseEvent * /*event*/)
|
|||
Settings->saveWidgetInformation(this);
|
||||
}
|
||||
|
||||
void CreateGxsForumMsg::cancelMsg()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void CreateGxsForumMsg::smileyWidgetForums()
|
||||
{
|
||||
Emoticons::showSmileyWidget(this, ui.emoticonButton, SLOT(addSmileys()), false);
|
||||
|
|
|
|||
|
|
@ -29,17 +29,16 @@
|
|||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
|
||||
|
||||
class CreateGxsForumMsg : public QMainWindow, public TokenResponse
|
||||
class CreateGxsForumMsg : public QDialog, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CreateGxsForumMsg(std::string fId, std::string pId);
|
||||
CreateGxsForumMsg(const std::string &fId, const std::string &pId);
|
||||
|
||||
void newMsg(); /* cleanup */
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
|
||||
private slots:
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void forumMessageCostumPopupMenu( QPoint point );
|
||||
|
|
@ -47,7 +46,6 @@ private slots:
|
|||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
/* actions to take.... */
|
||||
void createMsg();
|
||||
void cancelMsg();
|
||||
void pasteLink();
|
||||
void pasteLinkFull();
|
||||
void pasteOwnCertificateLink();
|
||||
|
|
@ -60,17 +58,16 @@ protected:
|
|||
void closeEvent (QCloseEvent * event);
|
||||
|
||||
private:
|
||||
|
||||
void saveForumInfo(const RsGroupMetaData &meta);
|
||||
void saveParentMsg(const RsGxsForumMsg &msg);
|
||||
void loadFormInformation();
|
||||
|
||||
void loadForumInfo(const uint32_t &token);
|
||||
void loadParentMsg(const uint32_t &token);
|
||||
|
||||
|
||||
std::string mForumId;
|
||||
std::string mParentId;
|
||||
|
||||
|
||||
bool mParentMsgLoaded;
|
||||
bool mForumMetaLoaded;
|
||||
RsGxsForumMsg mParentMsg;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CreateGxsForumMsg</class>
|
||||
<widget class="QMainWindow" name="CreateGxsForumMsg">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::NonModal</enum>
|
||||
</property>
|
||||
<widget class="QDialog" name="CreateGxsForumMsg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>482</width>
|
||||
<height>497</height>
|
||||
<height>448</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -20,24 +17,27 @@
|
|||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png)}</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="HeaderFrame" name="headerFrame"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="subjectFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
|
|
@ -45,64 +45,49 @@
|
|||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Forum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="forumName">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="forumLabel">
|
||||
<property name="text">
|
||||
<string>Forum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="forumName">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Subject</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="forumSubject"/>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="subjectLabel">
|
||||
<property name="text">
|
||||
<string>Subject</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="forumSubject"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="toolBarFrame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>38</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FEFEFE, stop:1 #E8E8E8);
|
||||
|
||||
border: 1px solid #CCCCCC;}</string>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="margin">
|
||||
|
|
@ -219,107 +204,65 @@ border: 1px solid #CCCCCC;}</string>
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="messageGroupBox">
|
||||
<property name="title">
|
||||
<string>Forum Post</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Forum Post</string>
|
||||
<widget class="QTextEdit" name="forumMessage">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="forumMessage">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Attach files via drag and drop</string>
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html></string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="HashBox" name="hashBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>You can attach files via drag and drop here in this window</string>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="hashGroupBox">
|
||||
<property name="title">
|
||||
<string>Attach files via drag and drop</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="HashBox" name="hashBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>You can attach files via drag and drop here in this window</string>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string notr="true">toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="postmessage_action"/>
|
||||
<addaction name="close_action"/>
|
||||
</widget>
|
||||
<action name="postmessage_action">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/mail_send24.png</normaloff>:/images/mail_send24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Post Forum Msg</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="close_action">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/button_cancel.png</normaloff>:/images/button_cancel.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
@ -327,6 +270,12 @@ p, li { white-space: pre-wrap; }
|
|||
<extends>QComboBox</extends>
|
||||
<header>gui/gxs/GxsIdChooser.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HeaderFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>gui/common/HeaderFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>HashBox</class>
|
||||
<extends>QScrollArea</extends>
|
||||
|
|
|
|||
|
|
@ -31,13 +31,14 @@
|
|||
|
||||
|
||||
/** Default constructor */
|
||||
EditGxsForumDetails::EditGxsForumDetails(std::string forumId, QWidget *parent, Qt::WFlags flags)
|
||||
: QDialog(parent, flags), m_forumId(forumId)
|
||||
EditGxsForumDetails::EditGxsForumDetails(std::string forumId, QWidget *parent)
|
||||
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), m_forumId(forumId)
|
||||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
|
||||
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyDialog()));
|
||||
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||
|
||||
loadForum();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class EditGxsForumDetails : public QDialog
|
|||
|
||||
public:
|
||||
/** Default constructor */
|
||||
EditGxsForumDetails(std::string forumId = "", QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
EditGxsForumDetails(std::string forumId = "", QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
void configChanged();
|
||||
|
|
|
|||
|
|
@ -21,35 +21,9 @@
|
|||
<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>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -109,22 +83,5 @@
|
|||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>cancelButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>EditForumDetails</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>307</x>
|
||||
<y>333</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>217</x>
|
||||
<y>177</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include "GxsForumDetails.h"
|
||||
//#AFTER MERGE #include "util/DateTime.h"
|
||||
|
||||
#include <retroshare/rsiface.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
|
@ -37,16 +38,13 @@
|
|||
#define DATETIME_FMT "MMM dd hh:mm:ss"
|
||||
|
||||
/** Default constructor */
|
||||
GxsForumDetails::GxsForumDetails(QWidget *parent, Qt::WFlags flags)
|
||||
: QDialog(parent, flags)
|
||||
GxsForumDetails::GxsForumDetails(QWidget *parent)
|
||||
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
|
||||
{
|
||||
/* 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"));
|
||||
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||
|
||||
ui.nameline ->setReadOnly(true);
|
||||
ui.popline ->setReadOnly(true);
|
||||
|
|
@ -72,16 +70,6 @@ GxsForumDetails::show()
|
|||
}
|
||||
}
|
||||
|
||||
void GxsForumDetails::closeEvent (QCloseEvent * event)
|
||||
{
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void GxsForumDetails::closeinfodlg()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void GxsForumDetails::showDetails(std::string mCurrForumId)
|
||||
{
|
||||
fId = mCurrForumId;
|
||||
|
|
@ -108,10 +96,7 @@ void GxsForumDetails::loadDialog()
|
|||
|
||||
// Set Last Post Date
|
||||
if (fi.lastPost) {
|
||||
QDateTime qtime;
|
||||
qtime.setTime_t(fi.lastPost);
|
||||
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
||||
ui.postline->setText(timestamp);
|
||||
ui.postline->setText(DateTime::formatLongDateTime(fi.lastPost));
|
||||
}
|
||||
|
||||
// Set Forum ID
|
||||
|
|
@ -133,14 +118,3 @@ void GxsForumDetails::loadDialog()
|
|||
#endif
|
||||
|
||||
}
|
||||
|
||||
void GxsForumDetails::applyDialog()
|
||||
{
|
||||
|
||||
/* reload now */
|
||||
loadDialog();
|
||||
|
||||
/* close the Dialog after the Changes applied */
|
||||
closeinfodlg();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ class GxsForumDetails : public QDialog
|
|||
public:
|
||||
|
||||
/** Default constructor */
|
||||
GxsForumDetails(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
GxsForumDetails(QWidget *parent = 0);
|
||||
|
||||
void showDetails(std::string mCurrForumId);
|
||||
|
||||
|
|
@ -45,14 +44,6 @@ public slots:
|
|||
/** Overloaded QWidget.show */
|
||||
void show();
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent * event);
|
||||
|
||||
private slots:
|
||||
|
||||
void closeinfodlg();
|
||||
void applyDialog();
|
||||
|
||||
private:
|
||||
|
||||
void loadDialog();
|
||||
|
|
|
|||
|
|
@ -158,35 +158,9 @@
|
|||
<item row="1" column="0">
|
||||
<layout class="QGridLayout">
|
||||
<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>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue