diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 42ff71d69..d70b922a9 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -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 \ diff --git a/retroshare-gui/src/gui/ApplicationWindow.cpp b/retroshare-gui/src/gui/ApplicationWindow.cpp index 0297cffc2..519e063e6 100644 --- a/retroshare-gui/src/gui/ApplicationWindow.cpp +++ b/retroshare-gui/src/gui/ApplicationWindow.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(); } diff --git a/retroshare-gui/src/gui/ApplicationWindow.h b/retroshare-gui/src/gui/ApplicationWindow.h index e6782331a..a167a2de0 100644 --- a/retroshare-gui/src/gui/ApplicationWindow.h +++ b/retroshare-gui/src/gui/ApplicationWindow.h @@ -27,6 +27,8 @@ #include #include "ExampleDialog.h" +#include "PluginsPage.h" + #include "Settings/gsettingswin.h" #include "ui_ApplicationWindow.h" diff --git a/retroshare-gui/src/gui/LibraryDialog.cpp b/retroshare-gui/src/gui/LibraryDialog.cpp index 882297d70..0c299f8fa 100644 --- a/retroshare-gui/src/gui/LibraryDialog.cpp +++ b/retroshare-gui/src/gui/LibraryDialog.cpp @@ -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() diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index c9a78027a..3c2fad832 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -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), diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index 78324abb8..8039dbaf6 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -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 diff --git a/retroshare-gui/src/gui/ShareFilesDialog.cpp b/retroshare-gui/src/gui/ShareFilesDialog.cpp deleted file mode 100644 index f7e52f37c..000000000 --- a/retroshare-gui/src/gui/ShareFilesDialog.cpp +++ /dev/null @@ -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 -// -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; - } \ No newline at end of file diff --git a/retroshare-gui/src/gui/ShareFilesDialog.h b/retroshare-gui/src/gui/ShareFilesDialog.h deleted file mode 100644 index 5bbcfad23..000000000 --- a/retroshare-gui/src/gui/ShareFilesDialog.h +++ /dev/null @@ -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 -#include -#include - -#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 - - - - - diff --git a/retroshare-gui/src/gui/ShareFilesDialog.ui b/retroshare-gui/src/gui/ShareFilesDialog.ui deleted file mode 100644 index d48bbb33c..000000000 --- a/retroshare-gui/src/gui/ShareFilesDialog.ui +++ /dev/null @@ -1,90 +0,0 @@ - - ShareFilesDialog - - - - 0 - 0 - 557 - 315 - - - - Shared Folder Manager - - - - - - Shared Folder Manager: - - - - - - Add - - - - - - - Remove - - - - - - - Qt::Horizontal - - - - 170 - 20 - - - - - - - - Ok - - - - - - - Cancel - - - - - - - - - - - - - - - cancel_pushButton - clicked() - ShareFilesDialog - reject() - - - 499 - 283 - - - 278 - 157 - - - - -