From 902c475b9da645ffe137fde1837a792e47b7ca79 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 7 Jul 2009 11:23:25 +0000 Subject: [PATCH] added the hashingstatus sources not enabled yet, for replacement which is written in MainWindow. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1329 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/statusbar/hashingstatus.cpp | 78 +++++++++++++++++++ .../src/gui/statusbar/hashingstatus.h | 46 +++++++++++ 2 files changed, 124 insertions(+) create mode 100644 retroshare-gui/src/gui/statusbar/hashingstatus.cpp create mode 100644 retroshare-gui/src/gui/statusbar/hashingstatus.h diff --git a/retroshare-gui/src/gui/statusbar/hashingstatus.cpp b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp new file mode 100644 index 000000000..c2e77b1f7 --- /dev/null +++ b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp @@ -0,0 +1,78 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2008 RetroShare Team + * + * 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 "hashingstatus.h" + +#include +#include + +#include +#include +#include +#include +#include + +#include "rsiface/rsiface.h" +#include "rsiface/rspeers.h" +#include "rsiface/notifyqt.h" + +#include +#include + +HashingStatus::HashingStatus(QWidget *parent) + : QWidget(parent) +{ + QHBoxLayout *hbox = new QHBoxLayout(); + hbox->setMargin(0); + hbox->setSpacing(6); + + //iconLabel = new QLabel( this ); + //iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/identitygray16.png")); + // iconLabel doesn't change over time, so we didn't need a minimum size + //hbox->addWidget(iconLabel); + + statusHashing = new QLabel( tr(""), this ); + //statusHashing->setMinimumSize( statusHashing->frameSize().width() + 0, 0 ); + hbox->addWidget(statusHashing); + + QSpacerItem *horizontalSpacer = new QSpacerItem(1000, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); + hbox->addItem(horizontalSpacer); + + setLayout( hbox ); + +} + +HashingStatus::~HashingStatus() +{ +} + +void HashingStatus::updateHashingInfo(const QString& s) +{ + if(s == "") + statusHashing->hide() ; + else + { + statusHashing->setText("Hashing file " + s) ; + statusHashing->show() ; + } +} + + + diff --git a/retroshare-gui/src/gui/statusbar/hashingstatus.h b/retroshare-gui/src/gui/statusbar/hashingstatus.h new file mode 100644 index 000000000..00aace1eb --- /dev/null +++ b/retroshare-gui/src/gui/statusbar/hashingstatus.h @@ -0,0 +1,46 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2008 RetroShare Team + * + * 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 HASHINGSTATUS_H +#define HASHINGSTATUS_H +#include "gui/MainWindow.h" + + +#include + + +class HashingStatus : public QWidget +{ +Q_OBJECT +public: + HashingStatus(QWidget *parent = 0); + + ~HashingStatus(); + +public slots: + void updateHashingInfo(const QString&) ; + + +private: + class QLabel *iconLabel, *statusHashing; + +}; + +#endif