diff --git a/retroshare-gui/src/gui/AddLinksDialog.cpp b/retroshare-gui/src/gui/AddLinksDialog.cpp index 46d675f2f..d5cc8922d 100644 --- a/retroshare-gui/src/gui/AddLinksDialog.cpp +++ b/retroshare-gui/src/gui/AddLinksDialog.cpp @@ -40,6 +40,8 @@ AddLinksDialog::AddLinksDialog(QString url, QWidget *parent) /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* add button */ connect(ui.addLinkButton, SIGNAL(clicked()), this, SLOT(addLinkComment())); connect(ui.closepushButton, SIGNAL(clicked()), this, SLOT(close())); diff --git a/retroshare-gui/src/gui/ChannelFeed.cpp b/retroshare-gui/src/gui/ChannelFeed.cpp index 7b5a71c08..dfbaf7b75 100644 --- a/retroshare-gui/src/gui/ChannelFeed.cpp +++ b/retroshare-gui/src/gui/ChannelFeed.cpp @@ -134,6 +134,12 @@ ChannelFeed::ChannelFeed(QWidget *parent) void ChannelFeed::channelListCustomPopupMenu( QPoint point ) { + ChannelInfo ci; + if (!rsChannels->getChannelInfo(mChannelId, ci)) + { + return; + } + QMenu contextMnu( this ); QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); @@ -150,13 +156,7 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point ) connect( channeldetailsAct , SIGNAL( triggered() ), this, SLOT( showChannelDetails() ) ); contextMnu.clear(); - - ChannelInfo ci; - if (!rsChannels->getChannelInfo(mChannelId, ci)) - { - return; - } - + if (ci.channelFlags & RS_DISTRIB_PUBLISH) { contextMnu.addAction( postchannelAct ); @@ -183,14 +183,14 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point ) void ChannelFeed::createChannel() { - CreateChannel *cf = new CreateChannel(NULL); + CreateChannel cf (this); - cf->setWindowTitle(tr("Create a new Channel")); - cf->ui.labelicon->setPixmap(QPixmap(":/images/add_channel64.png")); + cf.setWindowTitle(tr("Create a new Channel")); + cf.ui.labelicon->setPixmap(QPixmap(":/images/add_channel64.png")); QString titleStr("%1"); - cf->ui.textlabelcreatforums->setText( titleStr.arg( tr("New Channel") ) ) ; - cf->show(); + cf.ui.textlabelcreatforums->setText( titleStr.arg( tr("New Channel") ) ) ; + cf.exec(); } void ChannelFeed::channelSelection() @@ -231,7 +231,8 @@ void ChannelFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyT msgDialog->addDestination(type, grpId, inReplyTo); msgDialog->show(); - return; + + /* window will destroy itself! */ } void ChannelFeed::createMsg() @@ -244,7 +245,8 @@ void ChannelFeed::createMsg() CreateChannelMsg *msgDialog = new CreateChannelMsg(mChannelId); msgDialog->show(); - return; + + /* window will destroy itself! */ } void ChannelFeed::selectChannel( std::string cId) @@ -752,9 +754,8 @@ void ChannelFeed::showChannelDetails() if (!rsChannels) return; - static ChannelDetails *channelui = new ChannelDetails(); - - channelui->showDetails(mChannelId); - channelui->show(); + ChannelDetails channelui (this); + channelui.showDetails(mChannelId); + channelui.exec(); } diff --git a/retroshare-gui/src/gui/GeneralMsgDialog.cpp b/retroshare-gui/src/gui/GeneralMsgDialog.cpp index 6509bf6d1..9f7ab1333 100644 --- a/retroshare-gui/src/gui/GeneralMsgDialog.cpp +++ b/retroshare-gui/src/gui/GeneralMsgDialog.cpp @@ -42,6 +42,8 @@ GeneralMsgDialog::GeneralMsgDialog(QWidget *parent, uint32_t type) /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + connect(addButton, SIGNAL(clicked()), this, SLOT(newDestination())); connect(typeComboBox, SIGNAL(currentIndexChanged( int )), this, SLOT(updateGroupId())); diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index 291e5a6f5..ac937231b 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -385,6 +385,10 @@ void NewsFeed::deleteFeedItem(QWidget *item, uint32_t type) std::cerr << "NewsFeed::deleteFeedItem()"; std::cerr << std::endl; #endif + + if (item) { + item->close (); + } } void NewsFeed::openChat(std::string peerId) @@ -408,6 +412,7 @@ void NewsFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo) msgDialog->show(); + /* window will destroy itself! */ } diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index f4bf9f0d4..948d541de 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -417,6 +417,8 @@ void SharedFilesDialog::sendLinkToCloud() nAddLinksDialog->addLinkComment(); nAddLinksDialog->close(); + + /* window will destroy itself! */ } void SharedFilesDialog::addLinkToCloud() @@ -426,6 +428,8 @@ void SharedFilesDialog::addLinkToCloud() AddLinksDialog *nAddLinksDialog = new AddLinksDialog(QApplication::clipboard()->text()); nAddLinksDialog->show(); + + /* window will destroy itself! */ } void SharedFilesDialog::playselectedfiles() diff --git a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp index 5029ed754..303c1cccc 100644 --- a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp +++ b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp @@ -40,6 +40,8 @@ CreateChannelMsg::CreateChannelMsg(std::string cId) /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(sendMsg())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(cancelMsg())); diff --git a/retroshare-gui/src/gui/feeds/AttachFileItem.cpp b/retroshare-gui/src/gui/feeds/AttachFileItem.cpp index 6f45b4ab3..c28afa1fa 100644 --- a/retroshare-gui/src/gui/feeds/AttachFileItem.cpp +++ b/retroshare-gui/src/gui/feeds/AttachFileItem.cpp @@ -69,6 +69,8 @@ AttachFileItem::AttachFileItem(std::string hash, std::string name, uint64_t size /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + mMode = flags & AFI_MASK_STATE; mType = flags & AFI_MASK_TYPE; diff --git a/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp b/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp index de1bc5dd3..297354ccf 100644 --- a/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/BlogMsgItem.cpp @@ -39,6 +39,8 @@ BlogMsgItem::BlogMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp index 7461dfbfb..eb89e2cc4 100644 --- a/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChanMsgItem.cpp @@ -44,6 +44,8 @@ ChanMsgItem::ChanMsgItem(FeedHolder *parent, uint32_t feedId, std::string chanId /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/ChanNewItem.cpp b/retroshare-gui/src/gui/feeds/ChanNewItem.cpp index b1fd3a4e7..20fe72353 100644 --- a/retroshare-gui/src/gui/feeds/ChanNewItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChanNewItem.cpp @@ -39,6 +39,8 @@ ChanNewItem::ChanNewItem(FeedHolder *parent, uint32_t feedId, std::string chanId /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp index c86c2ec8d..49a15f4de 100644 --- a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp @@ -41,6 +41,8 @@ ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, std::string foru /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/ForumNewItem.cpp b/retroshare-gui/src/gui/feeds/ForumNewItem.cpp index 85f0ed1d4..ac4f53e25 100644 --- a/retroshare-gui/src/gui/feeds/ForumNewItem.cpp +++ b/retroshare-gui/src/gui/feeds/ForumNewItem.cpp @@ -39,6 +39,8 @@ ForumNewItem::ForumNewItem(FeedHolder *parent, uint32_t feedId, std::string foru /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 18199441c..04bd87ad1 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -41,6 +41,8 @@ MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, std::string msgId, bool is /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); diff --git a/retroshare-gui/src/gui/feeds/SubDestItem.cpp b/retroshare-gui/src/gui/feeds/SubDestItem.cpp index 402fe69a5..2139854ba 100644 --- a/retroshare-gui/src/gui/feeds/SubDestItem.cpp +++ b/retroshare-gui/src/gui/feeds/SubDestItem.cpp @@ -40,6 +40,8 @@ SubDestItem::SubDestItem(uint32_t type, std::string groupId, std::string inReply /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( void ) ) ); updateItemStatic(); diff --git a/retroshare-gui/src/gui/feeds/SubFileItem.cpp b/retroshare-gui/src/gui/feeds/SubFileItem.cpp index de494beff..c8188b447 100644 --- a/retroshare-gui/src/gui/feeds/SubFileItem.cpp +++ b/retroshare-gui/src/gui/feeds/SubFileItem.cpp @@ -72,6 +72,8 @@ SubFileItem::SubFileItem(std::string hash, std::string name, uint64_t size, /* Invoke the Qt Designer generated object setup routine */ setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + mMode = flags & SFI_MASK_STATE; mType = flags & SFI_MASK_TYPE; diff --git a/retroshare-gui/src/gui/unfinished/blogs/BlogDetails.cpp b/retroshare-gui/src/gui/unfinished/blogs/BlogDetails.cpp index ecb6fa4e7..a15752205 100644 --- a/retroshare-gui/src/gui/unfinished/blogs/BlogDetails.cpp +++ b/retroshare-gui/src/gui/unfinished/blogs/BlogDetails.cpp @@ -41,6 +41,8 @@ BlogDetails::BlogDetails(QWidget *parent, Qt::WFlags flags) /* Invoke Qt Designer generated QObject setup routine */ ui.setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); + connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog())); connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg())); diff --git a/retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp b/retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp index dd83d3c70..5cca51f6f 100644 --- a/retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp +++ b/retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp @@ -119,6 +119,12 @@ BlogsDialog::BlogsDialog(QWidget *parent) void BlogsDialog::blogListCustomPopupMenu( QPoint point ) { + BlogInfo bi; + if (!rsBlogs->getBlogInfo(mBlogId, bi)) + { + return; + } + QMenu contextMnu( this ); QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); @@ -135,13 +141,7 @@ void BlogsDialog::blogListCustomPopupMenu( QPoint point ) connect( blogdetailsAct , SIGNAL( triggered() ), this, SLOT( showBlogDetails() ) ); contextMnu.clear(); - - BlogInfo bi; - if (!rsBlogs->getBlogInfo(mBlogId, bi)) - { - return; - } - + if (bi.blogFlags & RS_DISTRIB_PUBLISH) { contextMnu.addAction( createblogpostAct ); @@ -168,10 +168,10 @@ void BlogsDialog::blogListCustomPopupMenu( QPoint point ) void BlogsDialog::createBlog() { - CreateBlog *cf = new CreateBlog(NULL, false); + CreateBlog cf (this, false); - cf->setWindowTitle(tr("Create a new Blog")); - cf->show(); + cf.setWindowTitle(tr("Create a new Blog")); + cf.exec(); } void BlogsDialog::blogSelection() @@ -211,7 +211,8 @@ void BlogsDialog::openMsg(uint32_t type, std::string grpId, std::string inReplyT msgDialog->addDestination(type, grpId, inReplyTo); msgDialog->show(); - return; + + /* window will destroy itself! */ } void BlogsDialog::createMsg() @@ -224,7 +225,8 @@ void BlogsDialog::createMsg() CreateBlogMsg *msgDialog = new CreateBlogMsg(mBlogId); msgDialog->show(); - return; + + /* window will destroy itself! */ } void BlogsDialog::selectBlog( std::string bId) @@ -605,9 +607,10 @@ void BlogsDialog::showBlogDetails() if (!rsBlogs) return; - static BlogDetails *blogui = new BlogDetails(); + BlogDetails *blogui = new BlogDetails(); blogui->showDetails(mBlogId); blogui->show(); + /* window will destroy itself! */ } diff --git a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp index d095fdfcd..9a56c3808 100644 --- a/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp +++ b/retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp @@ -65,7 +65,9 @@ CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); - + + setAttribute ( Qt::WA_DeleteOnClose, true ); + setupFileActions(); setupEditActions(); setupViewActions();