summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/plugins
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2017-09-29 14:33:20 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-29 12:57:34 -0700
commitf159802053a7dddb2f86db2781eb0071b13b5735 (patch)
treed5c93fff712970b897e57700c7c78cbf3ffab2fe /desktop-widgets/plugins
parent9b1a949a39afaa4e5d79aaf394f382bf3063f931 (diff)
downloadsubsurface-f159802053a7dddb2f86db2781eb0071b13b5735.tar.gz
[Facebook] Add hability to choose size of profile
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/plugins')
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.cpp16
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.h4
-rw-r--r--desktop-widgets/plugins/facebook/socialnetworksdialog.ui52
3 files changed, 58 insertions, 14 deletions
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
index 49ac72861..1e35623b8 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
@@ -194,8 +194,13 @@ void FacebookManager::sendDive()
ProfileWidget2 *profile = MainWindow::instance()->graphics();
+ QSize size = dialog.profileSize() == SocialNetworkDialog::SMALL ? QSize(800,600)
+ : dialog.profileSize() == SocialNetworkDialog::MEDIUM ? QSize(1024,760)
+ : dialog.profileSize() == SocialNetworkDialog::BIG ? QSize(1280,1024)
+ : QSize();
+
auto currSize = profile->size();
- profile->resize(1024,768);
+ profile->resize(size);
profile->setToolTipVisibile(false);
QPixmap pix = profile->grab();
profile->setToolTipVisibile(true);
@@ -320,6 +325,15 @@ SocialNetworkDialog::SocialNetworkDialog(QWidget *parent) :
connect(ui->album, &QLineEdit::editingFinished, this, &SocialNetworkDialog::albumChanged);
}
+SocialNetworkDialog::Size SocialNetworkDialog::profileSize() const
+{
+ QString currText = ui->profileSize->currentText();
+ return currText.startsWith(tr("Small")) ? SMALL :
+ currText.startsWith(tr("Medium")) ? MEDIUM :
+ /* currText.startsWith(tr("Big")) ? */ BIG;
+}
+
+
void SocialNetworkDialog::albumChanged()
{
QAbstractButton *button = ui->buttonBox->button(QDialogButtonBox::Ok);
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.h b/desktop-widgets/plugins/facebook/facebookconnectwidget.h
index da87c0ecf..70bc58e33 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.h
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.h
@@ -66,9 +66,13 @@ private:
class SocialNetworkDialog : public QDialog {
Q_OBJECT
public:
+ enum Size {SMALL, MEDIUM, BIG};
+
SocialNetworkDialog(QWidget *parent = 0);
QString text() const;
QString album() const;
+ Size profileSize() const;
+
public slots:
void selectionChanged();
void albumChanged();
diff --git a/desktop-widgets/plugins/facebook/socialnetworksdialog.ui b/desktop-widgets/plugins/facebook/socialnetworksdialog.ui
index 94e6ab81c..2e68a2a99 100644
--- a/desktop-widgets/plugins/facebook/socialnetworksdialog.ui
+++ b/desktop-widgets/plugins/facebook/socialnetworksdialog.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>528</width>
- <height>418</height>
+ <width>591</width>
+ <height>619</height>
</rect>
</property>
<property name="windowTitle">
@@ -15,10 +15,29 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QGridLayout" name="gridLayout" rowstretch="0,1,0,0,0,0,0,0,0,0,0">
+ <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
<property name="margin">
<number>1</number>
</property>
+ <item row="7" column="0">
+ <widget class="QComboBox" name="profileSize">
+ <item>
+ <property name="text">
+ <string>Small</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Medium</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Big</string>
+ </property>
+ </item>
+ </widget>
+ </item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
@@ -32,63 +51,63 @@
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Album</string>
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="5" column="0">
<widget class="QLineEdit" name="album">
<property name="toolTip">
<string>The profile picture will be posted in this album (required)</string>
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="8" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Include</string>
</property>
</widget>
</item>
- <item row="5" column="0">
+ <item row="9" column="0">
<widget class="QCheckBox" name="date">
<property name="text">
<string>Date and time</string>
</property>
</widget>
</item>
- <item row="6" column="0">
+ <item row="10" column="0">
<widget class="QCheckBox" name="duration">
<property name="text">
<string>Duration</string>
</property>
</widget>
</item>
- <item row="7" column="0">
+ <item row="11" column="0">
<widget class="QCheckBox" name="Location">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
- <item row="8" column="0">
+ <item row="12" column="0">
<widget class="QCheckBox" name="Divemaster">
<property name="text">
<string>Divemaster</string>
</property>
</widget>
</item>
- <item row="9" column="0">
+ <item row="13" column="0">
<widget class="QCheckBox" name="Buddy">
<property name="text">
<string>Buddy</string>
</property>
</widget>
</item>
- <item row="10" column="0">
+ <item row="14" column="0">
<widget class="QCheckBox" name="Notes">
<property name="text">
<string>Notes</string>
@@ -108,9 +127,16 @@
</property>
</widget>
</item>
- <item row="2" column="1" rowspan="9">
+ <item row="4" column="1" rowspan="11">
<widget class="QPlainTextEdit" name="text"/>
</item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Image Size</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>