fix/change buttons summoning file/folder chooser dialog
- changes the generic QPushButtons used to open a file/folder chooser dialog
for a new kind called RingButton.
- icons are always at the right most position of the button.
- removes some cssblob in stylesheet.
Change-Id: Ie1c3832f6496e0e7de4bb7d120e7081483ec8785
Tuleap: #482
diff --git a/RingWinClient.pro b/RingWinClient.pro
index 21c37ae..34a6fe0 100644
--- a/RingWinClient.pro
+++ b/RingWinClient.pro
@@ -65,7 +65,8 @@
smartlist.cpp \
ringcontactlineedit.cpp \
pixbufmanipulator.cpp \
- qualitydialog.cpp
+ qualitydialog.cpp \
+ ringbutton.cpp
HEADERS += mainwindow.h \
callwidget.h \
@@ -99,7 +100,8 @@
ringcontactlineedit.h \
pixbufmanipulator.h \
qualitydialog.h \
- ringthemeutils.h
+ ringthemeutils.h \
+ ringbutton.h
contains(DEFINES, URI_PROTOCOL) {
HEADERS += shmclient.h
@@ -119,7 +121,8 @@
contactmethodpicker.ui \
callutilsdialog.ui \
combar.ui \
- qualitydialog.ui
+ qualitydialog.ui \
+ ringbutton.ui
win32: LIBS += -lole32 -luuid -lshlwapi
diff --git a/accountdetails.cpp b/accountdetails.cpp
index 71a569e..9622dde 100644
--- a/accountdetails.cpp
+++ b/accountdetails.cpp
@@ -40,9 +40,9 @@
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- connect(ui->lrcfg_tlsCaListCertificate, SIGNAL(clicked(bool)), this, SLOT(onCertButtonClicked()));
- connect(ui->lrcfg_tlsCertificate, SIGNAL(clicked(bool)), this, SLOT(onCertButtonClicked()));
- connect(ui->lrcfg_tlsPrivateKeyCertificate, SIGNAL(clicked(bool)), this, SLOT(onCertButtonClicked()));
+ connect(ui->lrcfg_tlsCaListCertificate, &RingButton::clicked, this, &AccountDetails::onCertButtonClicked);
+ connect(ui->lrcfg_tlsCertificate, &RingButton::clicked, this, &AccountDetails::onCertButtonClicked);
+ connect(ui->lrcfg_tlsPrivateKeyCertificate, &RingButton::clicked, this, &AccountDetails::onCertButtonClicked);
connect(&RingtoneModel::instance(),
&RingtoneModel::dataChanged,
diff --git a/accountdetails.ui b/accountdetails.ui
index e94ea8f..40c7640 100644
--- a/accountdetails.ui
+++ b/accountdetails.ui
@@ -92,7 +92,7 @@
<x>0</x>
<y>0</y>
<width>843</width>
- <height>859</height>
+ <height>866</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
@@ -1135,9 +1135,9 @@
<property name="geometry">
<rect>
<x>0</x>
- <y>0</y>
- <width>812</width>
- <height>981</height>
+ <y>-53</y>
+ <width>811</width>
+ <height>919</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
@@ -1993,8 +1993,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>830</width>
- <height>913</height>
+ <width>829</width>
+ <height>915</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
@@ -2126,7 +2126,7 @@
</widget>
</item>
<item row="0" column="1">
- <widget class="QPushButton" name="lrcfg_tlsCaListCertificate">
+ <widget class="RingButton" name="lrcfg_tlsCaListCertificate">
<property name="minimumSize">
<size>
<width>500</width>
@@ -2142,16 +2142,9 @@
<property name="focusPolicy">
<enum>Qt::WheelFocus</enum>
</property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
<property name="text">
<string/>
</property>
- <property name="icon">
- <iconset resource="ressources.qrc">
- <normaloff>:/images/icons/ic_folder_black_18dp_2x.png</normaloff>:/images/icons/ic_folder_black_18dp_2x.png</iconset>
- </property>
</widget>
</item>
<item row="1" column="0">
@@ -2170,7 +2163,7 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QPushButton" name="lrcfg_tlsCertificate">
+ <widget class="RingButton" name="lrcfg_tlsCertificate">
<property name="minimumSize">
<size>
<width>500</width>
@@ -2183,16 +2176,9 @@
<height>30</height>
</size>
</property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
<property name="text">
<string/>
</property>
- <property name="icon">
- <iconset resource="ressources.qrc">
- <normaloff>:/images/icons/ic_folder_black_18dp_2x.png</normaloff>:/images/icons/ic_folder_black_18dp_2x.png</iconset>
- </property>
</widget>
</item>
<item row="2" column="0">
@@ -2210,33 +2196,7 @@
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QPushButton" name="lrcfg_tlsPrivateKeyCertificate">
- <property name="minimumSize">
- <size>
- <width>500</width>
- <height>30</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>500</width>
- <height>30</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset resource="ressources.qrc">
- <normaloff>:/images/icons/ic_folder_black_18dp_2x.png</normaloff>:/images/icons/ic_folder_black_18dp_2x.png</iconset>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_23">
<property name="font">
<font>
@@ -2251,7 +2211,7 @@
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QLineEdit" name="lrcfg_tlsPassword">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@@ -2276,6 +2236,25 @@
</property>
</widget>
</item>
+ <item row="2" column="1">
+ <widget class="RingButton" name="lrcfg_tlsPrivateKeyCertificate">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>500</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -2411,6 +2390,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>RingButton</class>
+ <extends>QPushButton</extends>
+ <header>ringbutton.h</header>
+ </customwidget>
+ </customwidgets>
<resources>
<include location="ressources.qrc"/>
</resources>
diff --git a/configurationwidget.ui b/configurationwidget.ui
index 7c460da..7f31484 100644
--- a/configurationwidget.ui
+++ b/configurationwidget.ui
@@ -200,7 +200,7 @@
<bool>true</bool>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="generalPage">
<layout class="QHBoxLayout" name="verticalLayout_2">
@@ -463,29 +463,16 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="recordPath">
+ <widget class="RingButton" name="recordPath">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
<property name="text">
<string/>
</property>
- <property name="icon">
- <iconset resource="ressources.qrc">
- <normaloff>:/images/icons/ic_folder_black_18dp_2x.png</normaloff>:/images/icons/ic_folder_black_18dp_2x.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>18</width>
- <height>18</height>
- </size>
- </property>
</widget>
</item>
<item>
@@ -1108,6 +1095,11 @@
<header>videowidget.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>RingButton</class>
+ <extends>QPushButton</extends>
+ <header>ringbutton.h</header>
+ </customwidget>
</customwidgets>
<resources>
<include location="ressources.qrc"/>
diff --git a/ringbutton.cpp b/ringbutton.cpp
new file mode 100644
index 0000000..a4e4fcb
--- /dev/null
+++ b/ringbutton.cpp
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2016 by Savoir-faire Linux *
+ * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
+ * *
+ * 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 3 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, see <http://www.gnu.org/licenses/>. *
+ **************************************************************************/
+
+#include "ui_ringbutton.h"
+
+#include "ringbutton.h"
+
+RingButton::RingButton(QWidget* parent) :
+ QWidget(parent),
+ ui(new Ui::RingButton)
+{
+ ui->setupUi(this);
+}
+
+RingButton::~RingButton()
+{
+ disconnect(this);
+ delete ui;
+}
+
+void
+RingButton::setText(const QString& text)
+{
+ ui->button->setText(text);
+ ui->button->resize(ui->button->sizeHint().width(),
+ ui->button->sizeHint().height());
+}
+
+void
+RingButton::mousePressEvent(QMouseEvent* event)
+{
+ Q_UNUSED(event)
+ emit clicked();
+}
diff --git a/ringbutton.h b/ringbutton.h
new file mode 100644
index 0000000..4ee0db9
--- /dev/null
+++ b/ringbutton.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2016 by Savoir-faire Linux *
+ * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
+ * *
+ * 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 3 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, see <http://www.gnu.org/licenses/>. *
+ **************************************************************************/
+
+#pragma once
+
+#include <QWidget>
+
+namespace Ui {
+class RingButton;
+}
+
+class RingButton : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit RingButton(QWidget* parent = 0);
+ ~RingButton();
+ void setText(const QString& text);
+
+protected:
+ void mousePressEvent(QMouseEvent* event);
+
+private:
+ Ui::RingButton* ui;
+
+signals:
+ void clicked() const;
+};
diff --git a/ringbutton.ui b/ringbutton.ui
new file mode 100644
index 0000000..9274398
--- /dev/null
+++ b/ringbutton.ui
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RingButton</class>
+ <widget class="QWidget" name="RingButton">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>433</width>
+ <height>41</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>41</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <property name="autoFillBackground">
+ <bool>true</bool>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <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>
+ <item>
+ <widget class="QLabel" name="button">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">text-align:left;
+font: 11pt "Sans Serif";
+padding: 2px;
+color: rgb(77, 77, 77);
+border-radius: 0px;
+border-style: solid;
+border-width: 2px;
+border-color: rgb(77, 77, 77);
+border-top: transparent;
+border-left: transparent;
+border-right: transparent;</string>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" name="widget" native="true">
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border-radius: 0px;
+border-style: solid;
+border-width: 2px;
+border-color: rgb(77, 77, 77);
+border-top: transparent;
+border-left: transparent;
+border-right: transparent;</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <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>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="icon">
+ <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="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border-radius: 0px;
+border: transparent;</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="ressources.qrc">:/images/icons/ic_folder_black_18dp_2x.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="ressources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/stylesheet.css b/stylesheet.css
index b49b41e..fc3e707 100644
--- a/stylesheet.css
+++ b/stylesheet.css
@@ -421,20 +421,6 @@
border-color:#4dc6d6;
}
-QPushButton#recordPath, QPushButton#lrcfg_tlsCaListCertificate, QPushButton#lrcfg_tlsCertificate,
-QPushButton#lrcfg_tlsPrivateKeyCertificate, QPushButton#tlsProtocoCombo, QPushButton#keyExchangeModelCombo{
- color: rgb(77, 77, 77);
- border-radius: 0px;
- border-style: solid;
- border-width: 2px;
- border-color: #414141;
- border-top: transparent;
- border-left: transparent;
- border-right: transparent;
- font: 11pt "Sans Serif";
- padding: 2px;
-}
-
QSpinBox#historyDaySettingsSpinBox, QSpinBox#lrcfg_tlsNegotiationTimeoutSec, QSpinBox#lrcfg_registrationExpire,
QSpinBox#lrcfg_localPort, QSpinBox#lrcfg_publishedPort, QSpinBox#lrcfg_audioPortMin, QSpinBox#lrcfg_audioPortMax,
QSpinBox#lrcfg_videoPortMin, QSpinBox#lrcfg_videoPortMax, QSpinBox#intervalUpdateCheckSpinBox{