mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
added the clear button
This commit is contained in:
@ -53,7 +53,6 @@ JPushButton::release()
|
|||||||
void
|
void
|
||||||
JPushButton::press()
|
JPushButton::press()
|
||||||
{
|
{
|
||||||
_debug("Pressed.\n");
|
|
||||||
mIsPressed = true;
|
mIsPressed = true;
|
||||||
resize(mImages[1].size());
|
resize(mImages[1].size());
|
||||||
setPixmap(mImages[1]);
|
setPixmap(mImages[1]);
|
||||||
|
@ -62,12 +62,18 @@ PhoneLine::unselect()
|
|||||||
emit backgrounded();
|
emit backgrounded();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mBuffer.clear();
|
clear();
|
||||||
emit unselected();
|
emit unselected();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PhoneLine::clear()
|
||||||
|
{
|
||||||
|
mBuffer.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PhoneLine::sendKey(Qt::Key c)
|
PhoneLine::sendKey(Qt::Key c)
|
||||||
{
|
{
|
||||||
|
@ -52,6 +52,11 @@ public:
|
|||||||
void sendKey(Qt::Key c);
|
void sendKey(Qt::Key c);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
/**
|
||||||
|
* Clears the buffer of the line.
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The user selected this line.
|
* The user selected this line.
|
||||||
*/
|
*/
|
||||||
|
@ -183,3 +183,17 @@ PhoneLineManagerImpl::hangup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PhoneLineManagerImpl::clear()
|
||||||
|
{
|
||||||
|
mCurrentLineMutex.lock();
|
||||||
|
PhoneLine *selectedLine = mCurrentLine;
|
||||||
|
PhoneLineLocker guard(selectedLine);
|
||||||
|
mCurrentLine = NULL;
|
||||||
|
mCurrentLineMutex.unlock();
|
||||||
|
|
||||||
|
if(selectedLine) {
|
||||||
|
selectedLine->clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,12 @@ public slots:
|
|||||||
* is invalid, it just do nothing.
|
* is invalid, it just do nothing.
|
||||||
*/
|
*/
|
||||||
void selectLine(unsigned int line);
|
void selectLine(unsigned int line);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function will clear the buffer of the active
|
||||||
|
* line. If there's no active line, it will do nothing.
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
|
||||||
PhoneLine *selectNextAvailableLine();
|
PhoneLine *selectNextAvailableLine();
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ SFLPhoneApp::initConnections(SFLPhoneWindow *w)
|
|||||||
&PhoneLineManager::instance(), SLOT(hangup()));
|
&PhoneLineManager::instance(), SLOT(hangup()));
|
||||||
QObject::connect(w->mHold, SIGNAL(clicked()),
|
QObject::connect(w->mHold, SIGNAL(clicked()),
|
||||||
&PhoneLineManager::instance(), SLOT(hold()));
|
&PhoneLineManager::instance(), SLOT(hold()));
|
||||||
|
QObject::connect(w->mClear, SIGNAL(clicked()),
|
||||||
|
&PhoneLineManager::instance(), SLOT(clear()));
|
||||||
QObject::connect(w, SIGNAL(keyPressed(Qt::Key)),
|
QObject::connect(w, SIGNAL(keyPressed(Qt::Key)),
|
||||||
&PhoneLineManager::instance(), SLOT(sendKey(Qt::Key)));
|
&PhoneLineManager::instance(), SLOT(sendKey(Qt::Key)));
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,11 @@ SFLPhoneWindow::SFLPhoneWindow()
|
|||||||
QPixmap(":/sflphone/images/ok_on"),
|
QPixmap(":/sflphone/images/ok_on"),
|
||||||
this);
|
this);
|
||||||
mOk->move(225,182);
|
mOk->move(225,182);
|
||||||
|
|
||||||
|
mClear = new JPushButton(QPixmap(":/sflphone/images/clear_off"),
|
||||||
|
QPixmap(":/sflphone/images/clear_on"),
|
||||||
|
this);
|
||||||
|
mClear->move(225,130);
|
||||||
|
|
||||||
// QLabel *os = new QLabel(this);
|
// QLabel *os = new QLabel(this);
|
||||||
// QPixmap overscreen(":/images/overscreen.png");
|
// QPixmap overscreen(":/images/overscreen.png");
|
||||||
|
@ -34,4 +34,5 @@ private:
|
|||||||
JPushButton *mHangup;
|
JPushButton *mHangup;
|
||||||
JPushButton *mHold;
|
JPushButton *mHold;
|
||||||
JPushButton *mOk;
|
JPushButton *mOk;
|
||||||
|
JPushButton *mClear;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/sflphone" >
|
<qresource prefix="/sflphone" >
|
||||||
<file>images/audio.png</file>
|
<file>images/audio.png</file>
|
||||||
|
<file>images/clear_off.png</file>
|
||||||
|
<file>images/clear_on.png</file>
|
||||||
<file>images/close_off.png</file>
|
<file>images/close_off.png</file>
|
||||||
<file>images/close_on.png</file>
|
<file>images/close_on.png</file>
|
||||||
<file>images/directory_on.png</file>
|
<file>images/directory_on.png</file>
|
||||||
|
Reference in New Issue
Block a user