mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
[Facebook] New method, grabProfilePixmap
Just some code organization Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5778dceb52
commit
a2734e6aaf
2 changed files with 22 additions and 13 deletions
|
@ -171,6 +171,25 @@ void FacebookManager::setDesiredAlbumName(const QString& a)
|
||||||
albumName = a;
|
albumName = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap FacebookManager::grabProfilePixmap()
|
||||||
|
{
|
||||||
|
ProfileWidget2 *profile = MainWindow::instance()->graphics();
|
||||||
|
|
||||||
|
QSize size = fbInfo.profileSize == FacebookInfo::SMALL ? QSize(800,600) :
|
||||||
|
fbInfo.profileSize == FacebookInfo::MEDIUM ? QSize(1024,760) :
|
||||||
|
fbInfo.profileSize == FacebookInfo::BIG ? QSize(1280,1024) : QSize();
|
||||||
|
|
||||||
|
auto currSize = profile->size();
|
||||||
|
profile->resize(size);
|
||||||
|
profile->setToolTipVisibile(false);
|
||||||
|
QPixmap pix = profile->grab();
|
||||||
|
profile->setToolTipVisibile(true);
|
||||||
|
profile->resize(currSize);
|
||||||
|
|
||||||
|
return pix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* to be changed to export the currently selected dive as shown on the profile.
|
/* to be changed to export the currently selected dive as shown on the profile.
|
||||||
* Much much easier, and its also good to people do not select all the dives
|
* Much much easier, and its also good to people do not select all the dives
|
||||||
* and send erroniously *all* of them to facebook. */
|
* and send erroniously *all* of them to facebook. */
|
||||||
|
@ -183,19 +202,7 @@ void FacebookManager::sendDive()
|
||||||
setDesiredAlbumName(dialog.album());
|
setDesiredAlbumName(dialog.album());
|
||||||
requestAlbumId();
|
requestAlbumId();
|
||||||
|
|
||||||
ProfileWidget2 *profile = MainWindow::instance()->graphics();
|
QPixmap pix = grabProfilePixmap();
|
||||||
|
|
||||||
QSize size = dialog.profileSize() == FacebookInfo::SMALL ? QSize(800,600) :
|
|
||||||
dialog.profileSize() == FacebookInfo::MEDIUM ? QSize(1024,760) :
|
|
||||||
dialog.profileSize() == FacebookInfo::BIG ? QSize(1280,1024) : QSize();
|
|
||||||
|
|
||||||
auto currSize = profile->size();
|
|
||||||
profile->resize(size);
|
|
||||||
profile->setToolTipVisibile(false);
|
|
||||||
QPixmap pix = profile->grab();
|
|
||||||
profile->setToolTipVisibile(true);
|
|
||||||
profile->resize(currSize);
|
|
||||||
|
|
||||||
QByteArray bytes;
|
QByteArray bytes;
|
||||||
QBuffer buffer(&bytes);
|
QBuffer buffer(&bytes);
|
||||||
buffer.open(QIODevice::WriteOnly);
|
buffer.open(QIODevice::WriteOnly);
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
QUrl connectUrl();
|
QUrl connectUrl();
|
||||||
QUrl albumListUrl();
|
QUrl albumListUrl();
|
||||||
bool loggedIn();
|
bool loggedIn();
|
||||||
|
QPixmap grabProfilePixmap();
|
||||||
signals:
|
signals:
|
||||||
void justLoggedIn(bool triggererd);
|
void justLoggedIn(bool triggererd);
|
||||||
void justLoggedOut(bool triggered);
|
void justLoggedOut(bool triggered);
|
||||||
|
@ -53,6 +54,7 @@ public slots:
|
||||||
private:
|
private:
|
||||||
explicit FacebookManager(QObject *parent = 0);
|
explicit FacebookManager(QObject *parent = 0);
|
||||||
QString albumName;
|
QString albumName;
|
||||||
|
FacebookInfo fbInfo;
|
||||||
QNetworkAccessManager *manager;
|
QNetworkAccessManager *manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue