mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
Fixed spacing between the stacked toaster, when the taskbar is at the bottom of the screen.
Removed not used toasters: ForumsToaster and GroupChatToaster. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2a69abe570
commit
249995ab89
@ -52,6 +52,10 @@
|
|||||||
* #define NOTIFY_DEBUG
|
* #define NOTIFY_DEBUG
|
||||||
****/
|
****/
|
||||||
|
|
||||||
|
#define TOASTER_MARGIN_X 10 // 10 pixels of x margin
|
||||||
|
#define TOASTER_MARGIN_Y 10 // 10 pixels of y margin
|
||||||
|
|
||||||
|
|
||||||
class Toaster
|
class Toaster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -584,30 +588,23 @@ void NotifyQt::startWaitingToasters()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (toaster) {
|
if (toaster) {
|
||||||
/* 10 pixels of x margin */
|
|
||||||
static const int MARGIN_X = 10;
|
|
||||||
/* 10 pixels of y margin */
|
|
||||||
static const int MARGIN_Y = 10;
|
|
||||||
|
|
||||||
// QMutexLocker lock(&runningToasterMutex);
|
// QMutexLocker lock(&runningToasterMutex);
|
||||||
|
|
||||||
/* Calculate positions */
|
/* Calculate positions */
|
||||||
QSize size = toaster->widget->size();
|
QSize size = toaster->widget->size();
|
||||||
|
|
||||||
QDesktopWidget *desktop = QApplication::desktop();
|
QDesktopWidget *desktop = QApplication::desktop();
|
||||||
QRect screenGeometry = desktop->screenGeometry(desktop->primaryScreen());
|
|
||||||
QRect desktopGeometry = desktop->availableGeometry(desktop->primaryScreen());
|
QRect desktopGeometry = desktop->availableGeometry(desktop->primaryScreen());
|
||||||
|
|
||||||
/* From bottom */
|
/* From bottom */
|
||||||
toaster->startPos = QPoint(screenGeometry.right() - size.width() - MARGIN_X, screenGeometry.bottom());
|
toaster->startPos = QPoint(desktopGeometry.right() - size.width() - TOASTER_MARGIN_X, desktopGeometry.bottom());
|
||||||
toaster->endPos = QPoint(toaster->startPos.x(), desktopGeometry.bottom() - size.height() - MARGIN_Y);
|
toaster->endPos = QPoint(toaster->startPos.x(), desktopGeometry.bottom() - size.height() - TOASTER_MARGIN_Y);
|
||||||
/* From top */
|
/* From top */
|
||||||
// toaster->startPos = QPoint(screenGeometry.right() - size.width() - MARGIN_X, screenGeometry.top() - size.height());
|
// toaster->startPos = QPoint(desktopGeometry.right() - size.width() - TOASTER_MARGIN_X, desktopGeometry.top() - size.height());
|
||||||
// toaster->endPos = QPoint(toaster->startPos.x(), desktopGeometry.top() + MARGIN_Y);
|
// toaster->endPos = QPoint(toaster->startPos.x(), desktopGeometry.top() + TOASTER_MARGIN_Y);
|
||||||
|
|
||||||
/* Initialize widget */
|
/* Initialize widget */
|
||||||
toaster->widget->move(toaster->startPos);
|
toaster->widget->move(toaster->startPos);
|
||||||
toaster->widget->show();
|
|
||||||
|
|
||||||
/* Initialize toaster */
|
/* Initialize toaster */
|
||||||
toaster->elapsedTimeToShow = 0;
|
toaster->elapsedTimeToShow = 0;
|
||||||
@ -627,6 +624,9 @@ void NotifyQt::runningTick()
|
|||||||
{
|
{
|
||||||
// QMutexLocker lock(&runningToasterMutex);
|
// QMutexLocker lock(&runningToasterMutex);
|
||||||
|
|
||||||
|
QDesktopWidget *desktop = QApplication::desktop();
|
||||||
|
QRect desktopGeometry = desktop->availableGeometry(desktop->primaryScreen());
|
||||||
|
|
||||||
int interval = runningToasterTimer->interval();
|
int interval = runningToasterTimer->interval();
|
||||||
QPoint diff;
|
QPoint diff;
|
||||||
|
|
||||||
@ -634,33 +634,42 @@ void NotifyQt::runningTick()
|
|||||||
while (it != runningToasterList.end()) {
|
while (it != runningToasterList.end()) {
|
||||||
Toaster *toaster = *it;
|
Toaster *toaster = *it;
|
||||||
|
|
||||||
bool visible = toaster->widget->isVisible();
|
bool visible = true;
|
||||||
|
if (toaster->elapsedTimeToShow) {
|
||||||
|
/* Toaster is started, check for visible */
|
||||||
|
visible = toaster->widget->isVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
QPoint newPos;
|
||||||
|
enum { NOTHING, SHOW, HIDE } operation = NOTHING;
|
||||||
|
|
||||||
if (visible && toaster->elapsedTimeToShow <= toaster->timeToShow) {
|
if (visible && toaster->elapsedTimeToShow <= toaster->timeToShow) {
|
||||||
/* Toaster is showing */
|
/* Toaster is showing */
|
||||||
|
if (toaster->elapsedTimeToShow == 0) {
|
||||||
|
/* Toaster is not visible, show it now */
|
||||||
|
operation = SHOW;
|
||||||
|
}
|
||||||
|
|
||||||
toaster->elapsedTimeToShow += interval;
|
toaster->elapsedTimeToShow += interval;
|
||||||
|
|
||||||
QPoint newPos(toaster->startPos.x() - (toaster->startPos.x() - toaster->endPos.x()) * toaster->elapsedTimeToShow / toaster->timeToShow,
|
newPos = QPoint(toaster->startPos.x() - (toaster->startPos.x() - toaster->endPos.x()) * toaster->elapsedTimeToShow / toaster->timeToShow,
|
||||||
toaster->startPos.y() - (toaster->startPos.y() - toaster->endPos.y()) * toaster->elapsedTimeToShow / toaster->timeToShow);
|
toaster->startPos.y() - (toaster->startPos.y() - toaster->endPos.y()) * toaster->elapsedTimeToShow / toaster->timeToShow);
|
||||||
toaster->widget->move(newPos + diff);
|
|
||||||
|
|
||||||
diff += newPos - toaster->startPos;
|
|
||||||
} else if (visible && toaster->elapsedTimeToLive <= toaster->timeToLive) {
|
} else if (visible && toaster->elapsedTimeToLive <= toaster->timeToLive) {
|
||||||
/* Toaster is living */
|
/* Toaster is living */
|
||||||
toaster->elapsedTimeToLive += interval;
|
toaster->elapsedTimeToLive += interval;
|
||||||
|
|
||||||
toaster->widget->move(toaster->endPos + diff);
|
newPos = toaster->endPos;
|
||||||
|
|
||||||
diff += toaster->endPos - toaster->startPos;
|
|
||||||
} else if (visible && toaster->elapsedTimeToHide <= toaster->timeToHide) {
|
} else if (visible && toaster->elapsedTimeToHide <= toaster->timeToHide) {
|
||||||
/* Toaster is hiding */
|
/* Toaster is hiding */
|
||||||
toaster->elapsedTimeToHide += interval;
|
toaster->elapsedTimeToHide += interval;
|
||||||
|
|
||||||
QPoint newPos(toaster->startPos.x() - (toaster->startPos.x() - toaster->endPos.x()) * (toaster->timeToHide - toaster->elapsedTimeToHide) / toaster->timeToHide,
|
if (toaster->elapsedTimeToHide == toaster->timeToHide) {
|
||||||
toaster->startPos.y() - (toaster->startPos.y() - toaster->endPos.y()) * (toaster->timeToHide - toaster->elapsedTimeToHide) / toaster->timeToHide);
|
/* Toaster is back at the start position, hide it */
|
||||||
toaster->widget->move(newPos + diff);
|
operation = HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
diff += newPos - toaster->startPos;
|
newPos = QPoint(toaster->startPos.x() - (toaster->startPos.x() - toaster->endPos.x()) * (toaster->timeToHide - toaster->elapsedTimeToHide) / toaster->timeToHide,
|
||||||
|
toaster->startPos.y() - (toaster->startPos.y() - toaster->endPos.y()) * (toaster->timeToHide - toaster->elapsedTimeToHide) / toaster->timeToHide);
|
||||||
} else {
|
} else {
|
||||||
/* Toaster is hidden, delete it */
|
/* Toaster is hidden, delete it */
|
||||||
it = runningToasterList.erase(it);
|
it = runningToasterList.erase(it);
|
||||||
@ -669,6 +678,23 @@ void NotifyQt::runningTick()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toaster->widget->move(newPos + diff);
|
||||||
|
diff += newPos - toaster->startPos;
|
||||||
|
|
||||||
|
/* This is only correct when moving the toaster from bottom */
|
||||||
|
toaster->widget->setMask(QRegion(0, 0, toaster->widget->width(), qAbs(toaster->startPos.y() - newPos.y())));
|
||||||
|
|
||||||
|
switch (operation) {
|
||||||
|
case NOTHING:
|
||||||
|
break;
|
||||||
|
case SHOW:
|
||||||
|
toaster->widget->show();
|
||||||
|
break;
|
||||||
|
case HIDE:
|
||||||
|
toaster->widget->hide();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* RetroShare
|
|
||||||
* Copyright (C) 2006,2007 crypton
|
|
||||||
*
|
|
||||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ForumsToaster.h"
|
|
||||||
|
|
||||||
#include "ui_ForumsToaster.h"
|
|
||||||
|
|
||||||
#include "QtToaster.h"
|
|
||||||
|
|
||||||
#include <QtGui/QtGui>
|
|
||||||
|
|
||||||
ForumsToaster::ForumsToaster()
|
|
||||||
: QObject(NULL) {
|
|
||||||
|
|
||||||
_ForumsToasterWidget = new QWidget(NULL);
|
|
||||||
|
|
||||||
_ui = new Ui::ForumsToaster();
|
|
||||||
_ui->setupUi(_ForumsToasterWidget);
|
|
||||||
|
|
||||||
connect(_ui->messageButton, SIGNAL(clicked()), SLOT(chatButtonSlot()));
|
|
||||||
|
|
||||||
connect(_ui->closeButton, SIGNAL(clicked()), SLOT(close()));
|
|
||||||
|
|
||||||
_toaster = new QtToaster(this, _ForumsToasterWidget, _ui->windowFrame);
|
|
||||||
_toaster->setTimeOnTop(5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
ForumsToaster::~ForumsToaster() {
|
|
||||||
delete _ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsToaster::setMessage(const QString & message) {
|
|
||||||
_ui->messageLabel->setText(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsToaster::setPixmap(const QPixmap & pixmap) {
|
|
||||||
_ui->pixmaplabel->setPixmap(pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsToaster::show() {
|
|
||||||
_toaster->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsToaster::close() {
|
|
||||||
_toaster->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ForumsToaster::chatButtonSlot() {
|
|
||||||
chatButtonClicked();
|
|
||||||
close();
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* RetroShare
|
|
||||||
* Copyright (C) 2006 crypton
|
|
||||||
*
|
|
||||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FORUMSTOASTER_H
|
|
||||||
#define FORUMSTOASTER_H
|
|
||||||
|
|
||||||
#include "IQtToaster.h"
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
|
|
||||||
class QtToaster;
|
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
class QString;
|
|
||||||
class QPixmap;
|
|
||||||
namespace Ui { class ForumsToaster; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows a toaster when friend is Forums .
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class ForumsToaster : public QObject, public IQtToaster {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
|
|
||||||
ForumsToaster();
|
|
||||||
|
|
||||||
~ForumsToaster();
|
|
||||||
|
|
||||||
void setMessage(const QString & message);
|
|
||||||
|
|
||||||
void setPixmap(const QPixmap & pixmap);
|
|
||||||
|
|
||||||
void show();
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
|
|
||||||
void chatButtonClicked();
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
|
|
||||||
void chatButtonSlot();
|
|
||||||
|
|
||||||
void close();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Ui::ForumsToaster * _ui;
|
|
||||||
|
|
||||||
QWidget * _ForumsToasterWidget;
|
|
||||||
|
|
||||||
QtToaster * _toaster;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //FORUMSTOASTER_H
|
|
@ -1,274 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>GroupChatToaster</class>
|
|
||||||
<widget class="QWidget" name="GroupChatToaster" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>388</width>
|
|
||||||
<height>168</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QFrame" name="windowFrame" >
|
|
||||||
<property name="frameShape" >
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow" >
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<widget class="QPushButton" name="closeButton" >
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>18</width>
|
|
||||||
<height>18</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>18</width>
|
|
||||||
<height>18</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon" >
|
|
||||||
<iconset resource="../images.qrc" >:/images/close-down.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize" >
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>22</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item rowspan="3" row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="pixmaplabel" >
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>74</width>
|
|
||||||
<height>74</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>74</width>
|
|
||||||
<height>74</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet" >
|
|
||||||
<string>border-image: url(:/images/avatar_background.png);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="pixmap" >
|
|
||||||
<pixmap resource="../images.qrc" >:/images/konversation128.png</pixmap>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>121</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<widget class="QPushButton" name="messageButton" >
|
|
||||||
<property name="font" >
|
|
||||||
<font/>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet" >
|
|
||||||
<string>color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
|
||||||
stop: 0 #49881F, stop: 1 #49881F );</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>New Forum Message</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>121</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>81</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QLabel" name="messageLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>131</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>384</width>
|
|
||||||
<height>61</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>messageButton</tabstop>
|
|
||||||
<tabstop>closeButton</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources>
|
|
||||||
<include location="../images.qrc" />
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* RetroShare
|
|
||||||
* Copyright (C) 2006,2007 crypton
|
|
||||||
*
|
|
||||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "GroupChatToaster.h"
|
|
||||||
|
|
||||||
#include "ui_GroupChatToaster.h"
|
|
||||||
|
|
||||||
#include "QtToaster.h"
|
|
||||||
|
|
||||||
#include <QtGui/QtGui>
|
|
||||||
|
|
||||||
GroupChatToaster::GroupChatToaster()
|
|
||||||
: QObject(NULL) {
|
|
||||||
|
|
||||||
_GroupChatToasterWidget = new QWidget(NULL);
|
|
||||||
|
|
||||||
_ui = new Ui::GroupChatToaster();
|
|
||||||
_ui->setupUi(_GroupChatToasterWidget);
|
|
||||||
|
|
||||||
connect(_ui->messageButton, SIGNAL(clicked()), SLOT(chatButtonSlot()));
|
|
||||||
|
|
||||||
connect(_ui->closeButton, SIGNAL(clicked()), SLOT(close()));
|
|
||||||
|
|
||||||
_toaster = new QtToaster(this, _GroupChatToasterWidget, _ui->windowFrame);
|
|
||||||
_toaster->setTimeOnTop(5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupChatToaster::~GroupChatToaster() {
|
|
||||||
delete _ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupChatToaster::setMessage(const QString & message) {
|
|
||||||
_ui->messageLabel->setText(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupChatToaster::setPixmap(const QPixmap & pixmap) {
|
|
||||||
_ui->pixmaplabel->setPixmap(pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupChatToaster::show() {
|
|
||||||
_toaster->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupChatToaster::close() {
|
|
||||||
_toaster->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupChatToaster::chatButtonSlot() {
|
|
||||||
chatButtonClicked();
|
|
||||||
close();
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* RetroShare
|
|
||||||
* Copyright (C) 2006 crypton
|
|
||||||
*
|
|
||||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GROUPCHATTOASTER_H
|
|
||||||
#define GROUPCHATTOASTER_H
|
|
||||||
|
|
||||||
#include "IQtToaster.h"
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
|
|
||||||
class QtToaster;
|
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
class QString;
|
|
||||||
class QPixmap;
|
|
||||||
namespace Ui { class GroupChatToaster; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows a toaster when friend is GroupChat .
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class GroupChatToaster : public QObject, public IQtToaster {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
|
|
||||||
GroupChatToaster();
|
|
||||||
|
|
||||||
~GroupChatToaster();
|
|
||||||
|
|
||||||
void setMessage(const QString & message);
|
|
||||||
|
|
||||||
void setPixmap(const QPixmap & pixmap);
|
|
||||||
|
|
||||||
void show();
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
|
|
||||||
void chatButtonClicked();
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
|
||||||
|
|
||||||
void chatButtonSlot();
|
|
||||||
|
|
||||||
void close();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Ui::GroupChatToaster * _ui;
|
|
||||||
|
|
||||||
QWidget * _GroupChatToasterWidget;
|
|
||||||
|
|
||||||
QtToaster * _toaster;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //GROUPCHATTOASTER_H
|
|
@ -1,268 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>GroupChatToaster</class>
|
|
||||||
<widget class="QWidget" name="GroupChatToaster" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>388</width>
|
|
||||||
<height>168</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QFrame" name="windowFrame" >
|
|
||||||
<property name="frameShape" >
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow" >
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<widget class="QPushButton" name="closeButton" >
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>18</width>
|
|
||||||
<height>18</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>18</width>
|
|
||||||
<height>18</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon" >
|
|
||||||
<iconset resource="../images.qrc" >:/images/close-down.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="flat" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>22</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="leftMargin" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin" >
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalSpacing" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item rowspan="3" row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="pixmaplabel" >
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>74</width>
|
|
||||||
<height>74</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize" >
|
|
||||||
<size>
|
|
||||||
<width>74</width>
|
|
||||||
<height>74</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet" >
|
|
||||||
<string>border-image: url(:/images/avatar_background.png);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="pixmap" >
|
|
||||||
<pixmap resource="../images.qrc" >:/images/user/agt_forum128.png</pixmap>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment" >
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>121</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<widget class="QPushButton" name="messageButton" >
|
|
||||||
<property name="font" >
|
|
||||||
<font/>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet" >
|
|
||||||
<string>color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
|
||||||
stop: 0 #49881F, stop: 1 #49881F );</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>New GroupChat Message</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>121</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="topMargin" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>81</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" >
|
|
||||||
<widget class="QLabel" name="messageLabel" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>131</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" >
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>384</width>
|
|
||||||
<height>61</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>messageButton</tabstop>
|
|
||||||
<tabstop>closeButton</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources>
|
|
||||||
<include location="../images.qrc" />
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -1,22 +0,0 @@
|
|||||||
/****************************************************************
|
|
||||||
* RetroShare is distributed under the following license:
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006,2007 crypton
|
|
||||||
*
|
|
||||||
* 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 <util/RetroStyleLabel.h>
|
|
Loading…
Reference in New Issue
Block a user