mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-17 18:37:20 -05:00
* Move plugin Demo to ApplicationWindow
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@973 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cdc3a65165
commit
8d38e51536
@ -127,7 +127,6 @@ HEADERS += rshare.h \
|
||||
gui/SearchTreeWidget.h \
|
||||
gui/SearchDialog.h \
|
||||
gui/SharedFilesDialog.h \
|
||||
gui/ShareFilesDialog.h \
|
||||
gui/ShareManager.h \
|
||||
gui/StatisticDialog.h \
|
||||
gui/HelpDialog.h \
|
||||
@ -259,7 +258,6 @@ FORMS += gui/ChatDialog.ui \
|
||||
gui/PeersDialog.ui \
|
||||
gui/SearchDialog.ui \
|
||||
gui/SharedFilesDialog.ui \
|
||||
gui/ShareFilesDialog.ui \
|
||||
gui/ShareManager.ui \
|
||||
gui/StatisticDialog.ui \
|
||||
gui/MessagesDialog.ui \
|
||||
@ -352,7 +350,6 @@ SOURCES += main.cpp \
|
||||
gui/SearchTreeWidget.cpp \
|
||||
gui/SearchDialog.cpp \
|
||||
gui/SharedFilesDialog.cpp \
|
||||
gui/ShareFilesDialog.cpp \
|
||||
gui/ShareManager.cpp \
|
||||
gui/StatisticDialog.cpp \
|
||||
gui/MessagesDialog.cpp \
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "channels/channelsDialog.h"
|
||||
#include "BlogDialog.h"
|
||||
#include "CalDialog.h"
|
||||
#include "NewsFeed.h"
|
||||
#include "PeersFeed.h"
|
||||
#include "TransferFeed.h"
|
||||
#include "MsgFeed.h"
|
||||
@ -87,6 +86,8 @@
|
||||
#define IMAGE_MESSAGES ":/images/evolution.png"
|
||||
#define IMAGE_BLOGS ":/images/kblogger.png"
|
||||
#define IMAGE_LIBRARY ":/images/library.png"
|
||||
#define IMAGE_PLUGINS ":/images/extension_32.png"
|
||||
|
||||
|
||||
|
||||
/* Keys for UI Preferences */
|
||||
@ -102,6 +103,9 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
ui.setupUi(this);
|
||||
|
||||
setWindowTitle(tr("RetroShare %1").arg(retroshareVersion()));
|
||||
|
||||
RshareSettings config;
|
||||
config.loadWidgetInformation(this);
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
@ -118,10 +122,14 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
// ui.stackPages->add(channelsDialog = new ChannelsDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), grp));
|
||||
|
||||
NewsFeed *newsFeed = NULL;
|
||||
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
|
||||
|
||||
//NewsFeed *newsFeed = NULL;
|
||||
//ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
|
||||
|
||||
PluginsPage *pluginsPage = NULL;
|
||||
ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||
|
||||
PeersFeed *peersFeed = NULL;
|
||||
ui.stackPages->add(peersFeed = new PeersFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_PEERS), tr("Peers"), grp));
|
||||
@ -238,6 +246,9 @@ void ApplicationWindow::createActions()
|
||||
|
||||
void ApplicationWindow::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
RshareSettings config;
|
||||
config.saveWidgetInformation(this);
|
||||
|
||||
hide();
|
||||
e->ignore();
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "ExampleDialog.h"
|
||||
#include "PluginsPage.h"
|
||||
|
||||
#include "Settings/gsettingswin.h"
|
||||
|
||||
#include "ui_ApplicationWindow.h"
|
||||
|
@ -17,17 +17,18 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
||||
#include "rshare.h"
|
||||
#include "LibraryDialog.h"
|
||||
****************************************************************/
|
||||
|
||||
|
||||
#include "rshare.h"
|
||||
#include "LibraryDialog.h"
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rspeers.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
#include "rsiface/RemoteDirModel.h"
|
||||
#include "ShareFilesDialog.h"
|
||||
#include "ShareManager.h"
|
||||
|
||||
|
||||
#include "util/RsAction.h"
|
||||
#include "msgs/ChanMsgDialog.h"
|
||||
@ -50,7 +51,7 @@
|
||||
|
||||
/* Images for context menu icons */
|
||||
#define IMAGE_DOWNLOAD ":/images/download16.png"
|
||||
#define IMAGE_PLAY ":/images/start.png"
|
||||
#define IMAGE_PLAY ":/images/start.png"
|
||||
#define IMAGE_HASH_BUSY ":/images/settings.png"
|
||||
#define IMAGE_HASH_DONE ":/images/friendsfolder24.png"
|
||||
#define IMAGE_MSG ":/images/message-mail.png"
|
||||
@ -61,12 +62,12 @@
|
||||
|
||||
QString fileToFind;
|
||||
|
||||
|
||||
/** Constructor */
|
||||
LibraryDialog::LibraryDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
|
||||
/** Constructor */
|
||||
LibraryDialog::LibraryDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
||||
@ -88,11 +89,11 @@ LibraryDialog::LibraryDialog(QWidget *parent)
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void LibraryDialog::PopulateList()
|
||||
@ -188,8 +189,9 @@ void LibraryDialog::StopRename()
|
||||
|
||||
void LibraryDialog::CallShareFilesBtn_library()
|
||||
{
|
||||
ShareFilesDialog *sf=new ShareFilesDialog(this,0);
|
||||
sf->show();
|
||||
static ShareManager* sharemanager = new ShareManager(this);
|
||||
sharemanager->show();
|
||||
|
||||
}
|
||||
|
||||
void LibraryDialog::CallTileViewBtn_library()
|
||||
|
@ -112,7 +112,7 @@
|
||||
* #define RS_RELEASE_VERSION 1
|
||||
****/
|
||||
|
||||
#define RS_RELEASE_VERSION 1
|
||||
//#define RS_RELEASE_VERSION 1
|
||||
|
||||
/** Constructor */
|
||||
MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
@ -128,15 +128,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
|
||||
mSMPlayer = NULL;
|
||||
|
||||
ui.toolBarservice->hide();
|
||||
ui.toolBarservice->hide();
|
||||
|
||||
// Setting icons
|
||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
|
||||
/*if(!_settings->value(QString::fromUtf8("StartMinimized"), false).toBool()) {
|
||||
show();
|
||||
}*/
|
||||
|
||||
/* Create all the dialogs of which we only want one instance */
|
||||
_bandwidthGraph = new BandwidthGraph();
|
||||
messengerWindow = new MessengerWindow();
|
||||
@ -155,7 +151,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
connect(ui.actionSMPlayer, SIGNAL(triggered()), this, SLOT( showsmplayer()) );
|
||||
connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT( showabout()) );
|
||||
connect(ui.actionColor, SIGNAL(triggered()), this, SLOT( setStyle()) );
|
||||
connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT( showSettings()) );
|
||||
//connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT( showSettings()) );
|
||||
|
||||
|
||||
|
||||
@ -171,8 +167,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
/* Create the Main pages and actions */
|
||||
QActionGroup *grp = new QActionGroup(this);
|
||||
|
||||
ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||
//ui.stackPages->add(pluginsPage = new PluginsPage(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_PLUGINS), tr("Plugins"), grp));
|
||||
|
||||
NewsFeed *newsFeed = NULL;
|
||||
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "StatisticDialog.h"
|
||||
#include "MessengerWindow.h"
|
||||
#include "ApplicationWindow.h"
|
||||
#include "PluginsPage.h"
|
||||
//#include "PluginsPage.h"
|
||||
|
||||
#include "Preferences/PreferencesWindow.h"
|
||||
#include "Settings/gsettingswin.h"
|
||||
@ -77,8 +77,8 @@ public:
|
||||
Messages, /** Messages page. */
|
||||
Links, /** Links page. */
|
||||
Channels, /** Channels page. */
|
||||
Forums , /** Forums page. */
|
||||
Plugins
|
||||
Forums /** Forums page. */
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -93,19 +93,19 @@ public:
|
||||
* Notify Class...
|
||||
*/
|
||||
|
||||
NetworkDialog *networkDialog;
|
||||
NetworkDialog *networkDialog;
|
||||
PeersDialog *peersDialog;
|
||||
SearchDialog *searchDialog;
|
||||
TransfersDialog *transfersDialog;
|
||||
ChatDialog *chatDialog;
|
||||
MessagesDialog *messagesDialog;
|
||||
ChannelsDialog *channelsDialog;
|
||||
ChannelsDialog *channelsDialog;
|
||||
SharedFilesDialog *sharedfilesDialog;
|
||||
//GroupsDialog *groupsDialog;
|
||||
//StatisticDialog *statisticDialog;
|
||||
MessengerWindow *messengerWindow;
|
||||
ApplicationWindow *applicationWindow;
|
||||
PluginsPage* pluginsPage ;
|
||||
//PluginsPage* pluginsPage ;
|
||||
|
||||
SMPlayer * mSMPlayer;
|
||||
|
||||
@ -134,7 +134,6 @@ private slots:
|
||||
void addFriend();
|
||||
void inviteFriend();
|
||||
void addSharedDirectory();
|
||||
//void showPreferencesWindow();
|
||||
void showMessengerWindow();
|
||||
void showApplWindow();
|
||||
void showsmplayer();
|
||||
@ -159,8 +158,6 @@ private slots:
|
||||
/** Called when user attempts to quit via quit button*/
|
||||
void doQuit();
|
||||
|
||||
//void toggleViewAction ();
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
@ -212,11 +209,11 @@ private:
|
||||
|
||||
QLabel *statusRates;
|
||||
PeerStatus *peerstatus;
|
||||
|
||||
|
||||
QLabel *_hashing_info_label ;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MainWindow ui;
|
||||
|
||||
QLabel *_hashing_info_label ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,116 +0,0 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008, defnax
|
||||
*
|
||||
* 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 "ShareFilesDialog.h"
|
||||
|
||||
#include <QLocale>
|
||||
//
|
||||
ShareFilesDialog::ShareFilesDialog( QWidget * parent, Qt::WFlags f)
|
||||
: QDialog(parent, f)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
connect(shareOk,SIGNAL(clicked()), this, SLOT(FilenameShared()));
|
||||
connect(addfile_Btn,SIGNAL(clicked()), this, SLOT(addfileBrowse()));
|
||||
connect(DownloadList,SIGNAL(currentRowChanged(int)), this, SLOT(currIndex(int)));
|
||||
connect(remfile_Btn,SIGNAL(clicked()), this, SLOT(remove_File()));
|
||||
connect(DownloadList,SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(filenametoShare(QListWidgetItem *)));
|
||||
}
|
||||
|
||||
void ShareFilesDialog::filenametoShare(QListWidgetItem *atname)
|
||||
{
|
||||
filnameList = atname->text();
|
||||
}
|
||||
|
||||
void ShareFilesDialog::FilenameShared()
|
||||
{
|
||||
QDir dir;
|
||||
QString finm = dir.currentPath();
|
||||
QString cpypathto =dir.currentPath();
|
||||
|
||||
finm.append("/DownLoad/");
|
||||
finm.append(filnameList);
|
||||
cpypathto.append("/SharedFolder/");
|
||||
cpypathto.append(filnameList);
|
||||
|
||||
QFile share;
|
||||
share.copy(finm,cpypathto);
|
||||
messageBoxOk("Added!");
|
||||
}
|
||||
void ShareFilesDialog::addfileBrowse()
|
||||
{
|
||||
QDir dir;
|
||||
int ind;
|
||||
QString pathseted =dir.currentPath();
|
||||
|
||||
pathseted.append("/DownLoad");
|
||||
|
||||
QString fileshare = QFileDialog::getOpenFileName(this, tr("Open File..."),pathseted, tr("All Files (*)"));
|
||||
QString slash="/";
|
||||
|
||||
ind=fileshare.lastIndexOf("/");
|
||||
filnameShared =fileshare.mid(ind+1,((fileshare.size())-ind));
|
||||
DownloadList->addItem(filnameShared);
|
||||
|
||||
}
|
||||
|
||||
void ShareFilesDialog::currIndex(int row)
|
||||
{
|
||||
|
||||
currrow=row;
|
||||
|
||||
}
|
||||
|
||||
void ShareFilesDialog::remove_File()
|
||||
{
|
||||
|
||||
QDir dir;
|
||||
QFile file;
|
||||
int ind;
|
||||
QString pathseted =dir.currentPath();
|
||||
QString path=dir.currentPath();
|
||||
path.append("/SharedFolder");
|
||||
QString fileshare = QFileDialog::getOpenFileName(this, tr("Open File..."),path, tr("All Files (*)"));
|
||||
ind=fileshare.lastIndexOf("/");
|
||||
filnameShared =fileshare.mid(ind+1,((fileshare.size())-ind));
|
||||
|
||||
pathseted.append("/SharedFolder/");
|
||||
pathseted.append(filnameShared);
|
||||
QString queryWrn;
|
||||
queryWrn.clear();
|
||||
queryWrn.append("Do You Want to Delete ? ");
|
||||
queryWrn.append(pathseted);
|
||||
|
||||
if ((QMessageBox::question(this, tr("Warning!"),queryWrn,QMessageBox::Ok|QMessageBox::No, QMessageBox::Ok))== QMessageBox::Ok)
|
||||
{
|
||||
file.remove(pathseted);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
bool ShareFilesDialog::messageBoxOk(QString msg)
|
||||
{
|
||||
QMessageBox mb("Share Manager MessageBox",msg,QMessageBox::Information,QMessageBox::Ok,0,0);
|
||||
mb.setButtonText( QMessageBox::Ok, "OK" );
|
||||
mb.exec();
|
||||
return true;
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008, defnax
|
||||
*
|
||||
* 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 SHAREDFILE_DIALOGIMPL_H
|
||||
#define SHAREDFILE_DIALOGIMPL_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ui_ShareFilesDialog.h"
|
||||
//
|
||||
class ShareFilesDialog: public QDialog, public Ui::ShareFilesDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ShareFilesDialog( QWidget * parent , Qt::WFlags f );
|
||||
int currrow;
|
||||
bool messageBoxOk(QString);
|
||||
QString filnameList;
|
||||
QString filnameShared;
|
||||
|
||||
private slots:
|
||||
|
||||
void FilenameShared();
|
||||
void addfileBrowse();
|
||||
void remove_File();
|
||||
void currIndex(int);
|
||||
void filenametoShare(QListWidgetItem *);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,90 +0,0 @@
|
||||
<ui version="4.0" >
|
||||
<class>ShareFilesDialog</class>
|
||||
<widget class="QDialog" name="ShareFilesDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>557</width>
|
||||
<height>315</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Shared Folder Manager</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<string>Shared Folder Manager:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" >
|
||||
<item row="1" column="0" >
|
||||
<widget class="QPushButton" name="addfile_Btn" >
|
||||
<property name="text" >
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="remfile_Btn" >
|
||||
<property name="text" >
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<spacer name="horizontalSpacer" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QPushButton" name="shareOk" >
|
||||
<property name="text" >
|
||||
<string>Ok</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4" >
|
||||
<widget class="QPushButton" name="cancel_pushButton" >
|
||||
<property name="text" >
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5" >
|
||||
<widget class="QListWidget" name="DownloadList" />
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>cancel_pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ShareFilesDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>499</x>
|
||||
<y>283</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>278</x>
|
||||
<y>157</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user