diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index d71e16f5b..2b42868e7 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -111,8 +111,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) /* Invoke the Qt Designer generated QObject setup routine */ ui.setupUi(this); - updateToolBaricons(); - /* Create RshareSettings object */ _settings = new RshareSettings(); @@ -183,7 +181,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages), - createPageAction(QIcon(MessageIcon), tr("Messages"), grp)); + messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); #ifndef RS_RELEASE_VERSION ChannelFeed *channelFeed = NULL; @@ -332,59 +330,59 @@ void MainWindow::displaySystrayMsg(const QString& title,const QString& msg) void MainWindow::updateStatus() { - if (ratesstatus) - ratesstatus->getRatesStatus(); + if (ratesstatus) + ratesstatus->getRatesStatus(); - if (peerstatus) - peerstatus->getPeerStatus(); + if (peerstatus) + peerstatus->getPeerStatus(); - if (natstatus) - natstatus->getNATStatus(); + if (natstatus) + natstatus->getNATStatus(); - std::list ids; - rsPeers->getOnlineList(ids); - int online = ids.size(); - - std::list msgList; - std::list::const_iterator it; + std::list ids; + rsPeers->getOnlineList(ids); + int online = ids.size(); - rsMsgs -> getMessageSummaries(msgList); - - for(it = msgList.begin(); it != msgList.end(); it++) - { - - if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW)) - { - trayIcon->setIcon(QIcon(":/images/newmsg.png")); - trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You has a new message")); - } - else if (online == 0) - { - trayIcon->setIcon(QIcon(IMAGE_NOONLINE)); - trayIcon->setToolTip(tr("RetroShare")); - } - else if (online < 2) - { - trayIcon->setIcon(QIcon(IMAGE_ONEONLINE)); - trayIcon->setToolTip(tr("RetroShare")); - } - else if (online < 3) - { - trayIcon->setIcon(QIcon(IMAGE_TWOONLINE)); - trayIcon->setToolTip(tr("RetroShare")); - } - else - { - trayIcon->setIcon(QIcon(IMAGE_RETROSHARE)); - trayIcon->setToolTip(tr("RetroShare")); - } - - - } + std::list msgList; + std::list::const_iterator it; + rsMsgs -> getMessageSummaries(msgList); + bool new_msg = false ; + for(it = msgList.begin(); it != msgList.end(); it++) + if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW)) + new_msg = true ; + if(new_msg) + messageAction->setIcon(QIcon(QPixmap(":/images/messages_new.png"))) ; + else + messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ; + if(new_msg) + { + trayIcon->setIcon(QIcon(":/images/newmsg.png")); + trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You has a new message")); + } + else if (online == 0) + { + trayIcon->setIcon(QIcon(IMAGE_NOONLINE)); + trayIcon->setToolTip(tr("RetroShare")); + } + else if (online < 2) + { + trayIcon->setIcon(QIcon(IMAGE_ONEONLINE)); + trayIcon->setToolTip(tr("RetroShare")); + } + else if (online < 3) + { + trayIcon->setIcon(QIcon(IMAGE_TWOONLINE)); + trayIcon->setToolTip(tr("RetroShare")); + } + else + { + trayIcon->setIcon(QIcon(IMAGE_RETROSHARE)); + trayIcon->setToolTip(tr("RetroShare")); + } } void MainWindow::updateHashingInfo(const QString& s) @@ -672,25 +670,4 @@ void MainWindow::setStyle() } -void MainWindow::updateToolBaricons() -{ - std::list msgList; - std::list::const_iterator it; - rsMsgs -> getMessageSummaries(msgList); - - for(it = msgList.begin(); it != msgList.end(); it++) - { - - if (it -> msgflags & RS_MSG_NEW) - { - MessageIcon.addPixmap(QPixmap(":/images/messages_new.png"), QIcon::Normal, QIcon::On ); - } - else - { - MessageIcon.addPixmap(QPixmap(":/images/evolution.png"), QIcon::Normal, QIcon::On ); - } - - } - -} diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index 92288e289..7aec64fb4 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -105,8 +105,6 @@ public slots: void updateHashingInfo(const QString&) ; void displayErrorMessage(int,int,const QString&) ; - void updateToolBaricons(); - protected: void closeEvent(QCloseEvent *); @@ -190,7 +188,7 @@ private: QLabel *_hashing_info_label ; - QIcon MessageIcon; + QAction *messageAction ; /** Qt Designer generated object */ Ui::MainWindow ui; diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 90e89a6c2..7bbee1339 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -1021,7 +1021,8 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder) std::list::iterator it; getFileInfoFromIndexList(qmil, files_info); - for (it = files_info.begin(); it != files_info.end(); it++) { + for (it = files_info.begin(); it != files_info.end(); it++) + { if ((*it).type & DIR_TYPE_PERSON) continue; std::string fullpath, name; @@ -1035,25 +1036,19 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder) name = fullpath; } - if (!openFolder) { - if ((*it).type & DIR_TYPE_FILE) { - QDesktopServices::openUrl(QUrl::fromLocalFile(name.c_str())); - } - } else { - if (dirs_to_open.end() == std::find(dirs_to_open.begin(), dirs_to_open.end(), fullpath)) { - dirs_to_open.push_back(fullpath); - } - } + std::cerr << "Opennign this file: " << name << std::endl ; + + QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8(name.c_str(),name.length()))); } - if (openFolder) { - std::list::iterator dit; - for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++) - { - std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ; - QDesktopServices::openUrl(QUrl::fromLocalFile((*dit).c_str())); - } - } +// if (openFolder) { +// std::list::iterator dit; +// for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++) +// { +// std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ; +// QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8((*dit).c_str()))); +// } +// } #ifdef RDM_DEBUG std::cerr << "::::::::::::Done RemoteDirModel::openSelected()" << std::endl; diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index 0d83ada99..ebc8d80fe 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -613,7 +613,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) QMenu contextMnu2( this ); // - QAction* menuAction = fileAssotiationAction(currentFile) ; +// QAction* menuAction = fileAssotiationAction(currentFile) ; //new QAction(QIcon(IMAGE_PLAY), currentFile, this); //tr( "111Play File(s)" ), this ); // connect( openfolderAct , SIGNAL( triggered() ), this, @@ -684,7 +684,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) contextMnu2.addAction( openfolderAct); else { - contextMnu2.addAction( menuAction ); +// contextMnu2.addAction( menuAction ); contextMnu2.addAction( openfileAct); }