diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index a1ada179b..ae919361e 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -5,6 +5,15 @@ CONFIG += staticlib testnetwork bitdht CONFIG -= qt TARGET = retroshare +# Beware: All data of the stripped services are lost +#CONFIG += minimal + +minimal { + CONFIG -= use_blogs bitdht + + DEFINES += MINIMAL_LIBRS +} + profiling { QMAKE_CXXFLAGS -= -fomit-frame-pointer QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer @@ -488,3 +497,25 @@ SOURCES += util/folderiterator.cc \ util/rsversion.cc \ util/rswin.cc \ util/rsrandom.cc + +minimal { + SOURCES -= rsserver/p3msgs.cc \ + rsserver/p3rank.cc \ + rsserver/p3status.cc \ + rsserver/p3photo.cc + + SOURCES -= serialiser/rsforumitems.cc \ + serialiser/rsstatusitems.cc \ + serialiser/rsrankitems.cc \ + serialiser/rschannelitems.cc \ + serialiser/rsgameitems.cc \ + serialiser/rsphotoitems.cc + + SOURCES -= services/p3forums.cc \ + services/p3msgservice.cc \ + services/p3statusservice.cc \ + services/p3ranking.cc \ + services/p3channels.cc \ + services/p3gamelauncher.cc \ + services/p3photoservice.cc +} diff --git a/libretroshare/src/rsserver/p3face-config.cc b/libretroshare/src/rsserver/p3face-config.cc index b4ef8d45c..c4b48c9c9 100644 --- a/libretroshare/src/rsserver/p3face-config.cc +++ b/libretroshare/src/rsserver/p3face-config.cc @@ -169,7 +169,9 @@ void RsServer::ConfigFinalSave() void RsServer::rsGlobalShutDown() { // TODO: cache should also clean up old files +#ifndef MINIMAL_LIBRS mChannels->cleanUpOldFiles(); +#endif // MINIMAL_LIBRS ConfigFinalSave(); // save configuration before exit mConnMgr->shutdown(); /* Handles UPnP */ diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 511660e83..7b6ac0ab1 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -41,7 +41,24 @@ RsServer::RsServer(RsIface &i, NotifyBase &callback) :RsControl(i, callback) { - return; + ftserver = NULL; + + mConnMgr = NULL; + + pqih = NULL; + + /* services */ + ad = NULL; + msgSrv = NULL; + chatSrv = NULL; + mStatusSrv = NULL; + mChannels = NULL; + /* caches (that need ticking) */ + mRanking = NULL; + + /* Config */ + mConfigMgr = NULL; + mGeneralConfig = NULL; } RsServer::~RsServer() @@ -211,8 +228,10 @@ void RsServer::run() /* Tick slow services */ +#ifndef MINIMAL_LIBRS if (mRanking) mRanking->tick(); +#endif // MINIMAL_LIBRS #if 0 std::string opt; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index bb2b8c4f2..3d4ea99ab 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2184,9 +2184,11 @@ int RsServer::StartupRetroShare() /* create Services */ ad = new p3disc(mConnMgr, pqih); +#ifndef MINIMAL_LIBRS msgSrv = new p3MsgService(mConnMgr); chatSrv = new p3ChatService(mConnMgr); mStatusSrv = new p3StatusService(mConnMgr); +#endif // MINIMAL_LIBRS #ifndef PQI_DISABLE_TUNNEL p3tunnel *tn = new p3tunnel(mConnMgr, pqih); @@ -2200,9 +2202,11 @@ int RsServer::StartupRetroShare() ftserver->connectToTurtleRouter(tr) ; pqih -> addService(ad); +#ifndef MINIMAL_LIBRS pqih -> addService(msgSrv); pqih -> addService(chatSrv); pqih ->addService(mStatusSrv); +#endif // MINIMAL_LIBRS /* create Cache Services */ std::string config_dir = RsInitConfig::configDir; @@ -2213,7 +2217,7 @@ int RsServer::StartupRetroShare() std::string forumdir = config_dir + "/forums"; - //mRanking = NULL; +#ifndef MINIMAL_LIBRS mRanking = new p3Ranking(mConnMgr, RS_SERVICE_TYPE_RANK, /* declaration of cache enable service rank */ mCacheStrapper, mCacheTransfer, localcachedir, remotecachedir, 3600 * 24 * 30 * 6); // 6 Months @@ -2259,6 +2263,7 @@ int RsServer::StartupRetroShare() CachePair cp2(photoService, photoService, CacheId(RS_SERVICE_TYPE_PHOTO, 0)); mCacheStrapper -> addCachePair(cp2); #endif +#endif // MINIMAL_LIBRS /**************************************************************************/ @@ -2273,8 +2278,10 @@ int RsServer::StartupRetroShare() mConnMgr->addMonitor(pqih); mConnMgr->addMonitor(mCacheStrapper); mConnMgr->addMonitor(ad); +#ifndef MINIMAL_LIBRS mConnMgr->addMonitor(msgSrv); mConnMgr->addMonitor(mStatusSrv); +#endif // MINIMAL_LIBRS /* must also add the controller as a Monitor... * a little hack to get it to work. @@ -2292,18 +2299,20 @@ int RsServer::StartupRetroShare() //mConfigMgr->addConfiguration("sslcerts.cfg", AuthSSL::getAuthSSL()); mConfigMgr->addConfiguration("peers.cfg", mConnMgr); mConfigMgr->addConfiguration("general.cfg", mGeneralConfig); + mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper); +#ifndef MINIMAL_LIBRS mConfigMgr->addConfiguration("msgs.cfg", msgSrv); mConfigMgr->addConfiguration("chat.cfg", chatSrv); - mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper); #ifdef RS_USE_BLOGS mConfigMgr->addConfiguration("blogs.cfg", mBlogs); #endif mConfigMgr->addConfiguration("ranklink.cfg", mRanking); mConfigMgr->addConfiguration("forums.cfg", mForums); mConfigMgr->addConfiguration("channels.cfg", mChannels); + mConfigMgr->addConfiguration("p3Status.cfg", mStatusSrv); +#endif // MINIMAL_LIBRS mConfigMgr->addConfiguration("turtle.cfg", tr); mConfigMgr->addConfiguration("p3disc.cfg", ad); - mConfigMgr->addConfiguration("p3Status.cfg", mStatusSrv); ftserver->addConfiguration(mConfigMgr); @@ -2432,9 +2441,10 @@ int RsServer::StartupRetroShare() /* Setup GUI Interfaces. */ rsPeers = new p3Peers(mConnMgr); - rsMsgs = new p3Msgs(msgSrv, chatSrv); rsDisc = new p3Discovery(ad); +#ifndef MINIMAL_LIBRS + rsMsgs = new p3Msgs(msgSrv, chatSrv); rsForums = mForums; rsChannels = mChannels; rsRanks = new p3Rank(mRanking); @@ -2450,13 +2460,16 @@ int RsServer::StartupRetroShare() rsGameLauncher = NULL; rsPhoto = NULL; #endif +#endif // MINIMAL_LIBRS +#ifndef MINIMAL_LIBRS /* put a welcome message in! */ if (RsInitConfig::firsttime_run) { msgSrv->loadWelcomeMsg(); } +#endif // MINIMAL_LIBRS // load up the help page std::string helppage = RsInitConfig::basedir + RsInitConfig::dirSeperator; diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 341f6badc..e79cf5190 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -4,6 +4,8 @@ QT += network xml script opengl TEMPLATE = app TARGET = RetroShare +#CONFIG += minimal + #DEFINES += RS_RELEASE_VERSION RCC_DIR = temp/qrc UI_DIR = temp/ui @@ -14,6 +16,11 @@ debug { QMAKE_CFLAGS += -g } +minimal { + CONFIG -= blogs bitdht + + DEFINES += MINIMAL_RSGUI +} ################################# Linux ########################################## # Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib @@ -615,7 +622,60 @@ HEADERS += idle/idle.h SOURCES += idle/idle.cpp \ idle/idle_platform.cpp - } +minimal { + SOURCES = main.cpp \ + rshare.cpp \ + gui/notifyqt.cpp \ + gui/MessengerWindow.cpp \ + gui/StartDialog.cpp \ + gui/GenCertDialog.cpp \ + gui/connect/ConfCertDialog.cpp \ + gui/InfoDialog.cpp \ + gui/help/browser/helpbrowser.cpp \ + gui/help/browser/helptextbrowser.cpp \ + gui/settings/rsettings.cpp \ + gui/settings/rsharesettings.cpp \ + gui/common/rwindow.cpp \ + gui/LogoBar.cpp \ + gui/RsAutoUpdatePage.cpp \ + gui/common/vmessagebox.cpp \ + gui/common/html.cpp \ + util/RetroStyleLabel.cpp \ + util/log.cpp \ + util/win32.cpp \ + util/Widget.cpp \ + util/stringutil.cpp \ + lang/languagesupport.cpp + FORMS = gui/MessengerWindow.ui \ + gui/StartDialog.ui \ + gui/GenCertDialog.ui \ + gui/connect/ConfCertDialog.ui \ + gui/InfoDialog.ui \ + gui/help/browser/helpbrowser.ui + + HEADERS = rshare.h \ + gui/notifyqt.h \ + gui/MessengerWindow.h \ + gui/StartDialog.h \ + gui/GenCertDialog.h \ + gui/connect/ConfCertDialog.h \ + gui/InfoDialog.h \ + gui/help/browser/helpbrowser.h \ + gui/help/browser/helptextbrowser.h \ + gui/settings/rsettings.h \ + gui/settings/rsharesettings.h \ + gui/common/rwindow.h \ + gui/LogoBar.h \ + gui/RsAutoUpdatePage.h \ + gui/common/vmessagebox.h \ + gui/common/html.h \ + util/RetroStyleLabel.h \ + util/log.h \ + util/win32.h \ + util/Widget.h \ + util/stringutil.h \ + lang/languagesupport.h +} diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index 8497c1320..59139d21e 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -34,22 +34,24 @@ #include "rshare.h" #include "MessengerWindow.h" -#include "MainWindow.h" #include "RsAutoUpdatePage.h" +#ifndef MINIMAL_RSGUI +#include "MainWindow.h" #include "chat/PopupChatDialog.h" #include "msgs/MessageComposer.h" +#include "ShareManager.h" +#include "gui/notifyqt.h" +#include "gui/connect/ConnectFriendWizard.h" +#endif // MINIMAL_RSGUI +#include "PeersDialog.h" #include "connect/ConfCertDialog.h" #include "util/PixmapMerging.h" #include "LogoBar.h" #include "util/Widget.h" #include "settings/rsharesettings.h" -#include "gui/connect/ConnectFriendWizard.h" #include "RetroShareLink.h" -#include "PeersDialog.h" -#include "ShareManager.h" -#include "gui/notifyqt.h" #include #include @@ -156,13 +158,18 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) ui.setupUi(this); setAttribute ( Qt::WA_DeleteOnClose, true ); +#ifdef MINIMAL_RSGUI + setAttribute (Qt::WA_QuitOnClose, true); +#endif // MINIMAL_RSGUI connect( ui.messengertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messengertreeWidgetCostumPopupMenu( QPoint ) ) ); +#ifndef MINIMAL_RSGUI connect( ui.messengertreeWidget, SIGNAL(itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend(QTreeWidgetItem *))); connect( ui.avatarButton, SIGNAL(clicked()), SLOT(getAvatar())); connect( ui.shareButton, SIGNAL(clicked()), SLOT(openShareManager())); connect( ui.addIMAccountButton, SIGNAL(clicked( bool ) ), this , SLOT( addFriend() ) ); +#endif // MINIMAL_RSGUI connect( ui.actionHide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers())); connect( ui.actionSort_by_State, SIGNAL(triggered()), this, SLOT(insertPeers())); connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); @@ -170,9 +177,11 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage())); connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); +#ifndef MINIMAL_RSGUI connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateMessengerDisplay())); connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateAvatar())); connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage())); +#endif // MINIMAL_RSGUI timer = new QTimer(this); timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateMessengerDisplay())); @@ -216,15 +225,19 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) ui.statusButton->setText(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location)); } +#ifndef MINIMAL_RSGUI MainWindow *pMainWindow = MainWindow::getInstance(); if (pMainWindow) { QMenu *pStatusMenu = new QMenu(); pMainWindow->initializeStatusObject(pStatusMenu, true); ui.statusButton->setMenu(pStatusMenu); } - insertPeers(); + updateAvatar(); loadmystatusmessage(); +#endif // MINIMAL_RSGUI + + insertPeers(); ui.clearButton->hide(); @@ -240,10 +253,12 @@ MessengerWindow::~MessengerWindow () // save settings processSettings(false); +#ifndef MINIMAL_RSGUI MainWindow *pMainWindow = MainWindow::getInstance(); if (pMainWindow) { pMainWindow->removeStatusObject(ui.statusButton); } +#endif // MINIMAL_RSGUI _instance = NULL; } @@ -300,6 +315,7 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) QAction* collapseAll = new QAction(tr( "Collapse all" ), &contextMnu ); connect( collapseAll , SIGNAL( triggered() ), ui.messengertreeWidget, SLOT(collapseAll()) ); +#ifndef MINIMAL_RSGUI QAction* chatAct = new QAction(QIcon(IMAGE_CHAT), tr( "Chat" ), &contextMnu ); if (c) { connect( chatAct , SIGNAL( triggered() ), this, SLOT( chatfriendproxy() ) ); @@ -313,6 +329,7 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) } else { sendMessageAct->setDisabled(true); } +#endif // MINIMAL_RSGUI QAction* connectfriendAct = new QAction(QIcon(IMAGE_CONNECT), tr( "Connect To Friend" ), &contextMnu ); if (c) { @@ -321,6 +338,7 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) connectfriendAct->setDisabled(true); } +#ifndef MINIMAL_RSGUI QAction* configurefriendAct = new QAction(QIcon(IMAGE_PEERINFO), tr( "Peer Details" ), &contextMnu ); if (c) { connect( configurefriendAct , SIGNAL( triggered() ), this, SLOT( configurefriend() ) ); @@ -362,6 +380,7 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) } else { removefriendAct->setDisabled(true); } +#endif // MINIMAL_RSGUI QWidget *widget = new QWidget(); widget->setStyleSheet( ".QWidget{background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #FEFEFE, stop:1 #E8E8E8); border: 1px solid #CCCCCC;}"); @@ -393,14 +412,18 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point ) widgetAction->setDefaultWidget(widget); contextMnu.addAction( widgetAction); +#ifndef MINIMAL_RSGUI contextMnu.addAction( chatAct); contextMnu.addAction( sendMessageAct); contextMnu.addAction( configurefriendAct); //contextMnu.addAction( profileviewAct); contextMnu.addAction( recommendfriendAct); +#endif // MINIMAL_RSGUI contextMnu.addAction( connectfriendAct); +#ifndef MINIMAL_RSGUI contextMnu.addAction(pastePersonAct); contextMnu.addAction( removefriendAct); +#endif // MINIMAL_RSGUI //contextMnu.addAction( exportfriendAct); contextMnu.addSeparator(); contextMnu.addAction( expandAll); @@ -423,7 +446,9 @@ void MessengerWindow::insertPeers() std::list gpgFriends; std::list::iterator it; std::list statusInfo; +#ifndef MINIMAL_RSGUI rsStatus->getStatusList(statusInfo); +#endif // MINIMAL_RSGUI // if(isIdle) // QMessageBox::StandardButton sb = QMessageBox::warning ( NULL, tr("Idle"), @@ -555,9 +580,11 @@ void MessengerWindow::insertPeers() sslItem -> setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(sslDetail.id)); QString sCustomString; +#ifndef MINIMAL_RSGUI if (sslDetail.state & RS_PEER_STATE_CONNECTED) { sCustomString = QString::fromStdString(rsMsgs->getCustomStateString(sslDetail.id)); } +#endif // MINIMAL_RSGUI if (sCustomString.isEmpty()) { sslItem -> setText( COLUMN_NAME, tr("location : ") + QString::fromStdString(sslDetail.location) + " " + QString::fromStdString(sslDetail.autoconnect)); sslItem -> setToolTip( COLUMN_NAME, tr("location : ") + QString::fromStdString(sslDetail.location)); @@ -576,6 +603,21 @@ void MessengerWindow::insertPeers() sslItem->setHidden(false); gpg_connected = true; +#ifdef MINIMAL_RSGUI +// to show the gpg as online, remove it with MINIMAL_RSGUI + QFont font1; + font1.setBold(true); + + gpg_item->setIcon(COLUMN_NAME,(QIcon(IMAGE_ONLINE))); + gpg_item->setToolTip(COLUMN_NAME, tr("Peer Online")); + gpg_item->setData(COLUMN_NAME, ROLE_SORT, BuildStateSortString(bSortState, gpg_item->text(COLUMN_NAME), PEER_STATE_ONLINE)); + + for(i = 0; i < COLUMN_COUNT; i++) { + gpg_item->setTextColor(i,(Qt::darkBlue)); + gpg_item->setFont(i,font1); + } +#endif // MINIMAL_RSGUI + /* change color and icon */ sslItem -> setIcon(COLUMN_NAME,(QIcon(":/images/connect_established.png"))); QFont font; @@ -625,6 +667,7 @@ void MessengerWindow::insertPeers() gpg_item->setHidden(false); //gpg_item -> setText(COLUMN_STATE, tr("Online")); // set to online regardless on update +#ifndef MINIMAL_RSGUI std::list::iterator it = statusInfo.begin(); for(; it != statusInfo.end() ; it++){ @@ -708,6 +751,7 @@ void MessengerWindow::insertPeers() } } } +#endif // MINIMAL_RSGUI } else if (gpg_online) { gpg_item->setHidden(ui.actionHide_Offline_Friends->isChecked()); gpg_item -> setIcon(COLUMN_NAME,(QIcon(IMAGE_AVAIBLE))); @@ -765,6 +809,7 @@ std::string getPeersRsCertId(QTreeWidgetItem *i) return id; } +#ifndef MINIMAL_RSGUI /** Add a Friend ShortCut */ void MessengerWindow::addFriend() { @@ -822,6 +867,7 @@ void MessengerWindow::chatfriend(QTreeWidgetItem *pPeer) std::string id = pPeer->data(COLUMN_DATA, ROLE_ID).toString().toStdString(); PopupChatDialog::chatFriend(id); } +#endif // MINIMAL_RSGUI QTreeWidgetItem *MessengerWindow::getCurrentPeer() { @@ -864,7 +910,7 @@ QTreeWidgetItem *MessengerWindow::getCurrentPeer() * All of these rely on the finding of the current Id. */ - +#ifndef MINIMAL_RSGUI void MessengerWindow::removefriend() { QTreeWidgetItem *c = getCurrentPeer(); @@ -885,6 +931,7 @@ void MessengerWindow::removefriend() emit friendsUpdated() ; } } +#endif // MINIMAL_RSGUI void MessengerWindow::connectfriend() { @@ -919,6 +966,7 @@ void MessengerWindow::connectfriend() } } +#ifndef MINIMAL_RSGUI /* GUI stuff -> don't do anything directly with Control */ void MessengerWindow::configurefriend() { @@ -941,6 +989,7 @@ void MessengerWindow::pastePerson() { RSLinkClipboard::process(RetroShareLink::TYPE_PERSON, RSLINK_PROCESS_NOTIFY_ERROR); } +#endif // MINIMAL_RSGUI //============================================================================ @@ -963,6 +1012,11 @@ void MessengerWindow::closeEvent (QCloseEvent * event) } +LogoBar & MessengerWindow::getLogoBar() const { + return *_rsLogoBarmessenger; +} + +#ifndef MINIMAL_RSGUI /** Shows Share Manager */ void MessengerWindow::openShareManager() { @@ -980,11 +1034,7 @@ void MessengerWindow::sendMessage() MessageComposer::msgFriend(id); } -LogoBar & MessengerWindow::getLogoBar() const { - return *_rsLogoBarmessenger; -} - -void MessengerWindow::changeAvatarClicked() +void MessengerWindow::changeAvatarClicked() { updateAvatar(); } @@ -1043,6 +1093,7 @@ void MessengerWindow::savestatusmessage() { rsMsgs->setCustomStateString(ui.messagelineEdit->text().toStdString()); } +#endif // MINIMAL_RSGUI void MessengerWindow::on_actionSort_Peers_Descending_Order_activated() { diff --git a/retroshare-gui/src/gui/MessengerWindow.h b/retroshare-gui/src/gui/MessengerWindow.h index f093d15a9..b281dcf50 100644 --- a/retroshare-gui/src/gui/MessengerWindow.h +++ b/retroshare-gui/src/gui/MessengerWindow.h @@ -43,8 +43,10 @@ class MessengerWindow : public RWindow public slots: void updateMessengerDisplay() ; +#ifndef MINIMAL_RSGUI void updateAvatar(); void loadmystatusmessage(); +#endif // MINIMAL_RSGUI LogoBar & getLogoBar() const; @@ -60,19 +62,22 @@ private slots: /** Create the context popup menu and it's submenus */ void messengertreeWidgetCostumPopupMenu( QPoint point ); +#ifndef MINIMAL_RSGUI /** Add a new friend */ void addFriend(); /** Export friend */ void exportfriend(); /** Remove friend */ void removefriend(); +#endif // MINIMAL_RSGUI + /** start to connect to a friend **/ + void connectfriend(); +#ifndef MINIMAL_RSGUI /** start a chat with a friend **/ void chatfriend(QTreeWidgetItem *pPeer); void chatfriendproxy(); /** start Messages Composer **/ void sendMessage(); - /** start to connect to a friend **/ - void connectfriend(); /** show peers details for each friend **/ void configurefriend(); @@ -88,24 +93,25 @@ private slots: void changeAvatarClicked(); void savestatusmessage(); +#endif // MINIMAL_RSGUI void on_actionSort_Peers_Descending_Order_activated(); void on_actionSort_Peers_Ascending_Order_activated(); void on_actionRoot_is_decorated_activated(); - void displayMenu(); - void filterRegExpChanged(); void clearFilter(); signals: void friendsUpdated() ; - + private: static MessengerWindow *_instance; void processSettings(bool bLoad); + void displayMenu(); + /* Worker Functions */ /* (1) Update Display */ QTimer *timer; @@ -128,4 +134,3 @@ private: }; #endif - diff --git a/retroshare-gui/src/gui/PeersDialog.h b/retroshare-gui/src/gui/PeersDialog.h index 0fac86e90..f8ff29580 100644 --- a/retroshare-gui/src/gui/PeersDialog.h +++ b/retroshare-gui/src/gui/PeersDialog.h @@ -26,7 +26,6 @@ #include "RsAutoUpdatePage.h" #include "mainpage.h" -#include "ui_PeersDialog.h" #include "im_history/IMHistoryKeeper.h" @@ -41,6 +40,9 @@ #define BuildStateSortString(bEnabled,sName,nState) bEnabled ? (QString ("%1").arg(nState) + " " + sName) : sName +#ifndef MINIMAL_RSGUI +#include "ui_PeersDialog.h" + class QFont; class QAction; class QTextEdit; @@ -203,5 +205,6 @@ private: Ui::PeersDialog ui; }; +#endif // MINIMAL_RSGUI #endif diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index 0c9878bd1..a22da9173 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -11,10 +11,12 @@ #include "gui/RsAutoUpdatePage.h" +#ifndef MINIMAL_RSGUI #include "gui/toaster/OnlineToaster.h" #include "gui/toaster/MessageToaster.h" #include "gui/toaster/ChatToaster.h" #include "gui/toaster/CallToaster.h" +#endif // MINIMAL_RSGUI #include "gui/settings/rsharesettings.h" @@ -277,6 +279,7 @@ void NotifyQt::notifyListPreChange(int list, int type) void NotifyQt::UpdateGUI() { +#ifndef MINIMAL_RSGUI /* hack to force updates until we've fixed that part */ static time_t lastTs = 0; @@ -388,6 +391,7 @@ void NotifyQt::UpdateGUI() } } } +#endif // MINIMAL_RSGUI } //void NotifyQt::displaySearch() diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 7fd9005ec..4dbf7fa8e 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -22,15 +22,17 @@ #include #include #include +#ifndef MINIMAL_RSGUI #include "gui/MainWindow.h" #include "gui/PeersDialog.h" #include "gui/SearchDialog.h" #include "gui/TransfersDialog.h" #include "gui/MessagesDialog.h" #include "gui/SharedFilesDialog.h" -#include "gui/chat/PopupChatDialog.h" -#include "gui/MessengerWindow.h" #include "gui/NetworkDialog.h" +#include "gui/chat/PopupChatDialog.h" +#endif // MINIMAL_RSGUI +#include "gui/MessengerWindow.h" #include "gui/StartDialog.h" #include "gui/GenCertDialog.h" #include "gui/settings/rsharesettings.h" @@ -159,6 +161,9 @@ int main(int argc, char *argv[]) /* recreate global settings object, now with correct path */ RshareSettings::Create (); +#ifdef MINIMAL_RSGUI + MessengerWindow::showYourself(); +#else MainWindow *w = MainWindow::Create (); // I'm using a signal to transfer the hashing info to the mainwindow, because Qt schedules signals properly to @@ -207,13 +212,18 @@ int main(int argc, char *argv[]) QTimer *timer = new QTimer(w); timer -> connect(timer, SIGNAL(timeout()), notify, SLOT(UpdateGUI())); timer->start(1000); +#endif // MINIMAL_RSGUI + + rshare.setQuitOnLastWindowClosed(true); /* dive into the endless loop */ int ti = rshare.exec(); +#ifndef MINIMAL_RSGUI delete w ; /* cleanup */ PopupChatDialog::cleanupChat(); +#endif // MINIMAL_RSGUI rsicontrol->rsGlobalShutDown();