summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-09-29 06:51:18 (GMT)
committerSwift Review <review@swift.im>2014-10-01 09:55:13 (GMT)
commit494ee542b0b7cb9a2eb9997865b9ba89a16715bc (patch)
tree83d3d90d531e8d6c9aac2cf63d6dcfe7ca3de292 /Swift
parent19729be77c227a93aad29875d091a8d9010e2769 (diff)
downloadswift-contrib-494ee542b0b7cb9a2eb9997865b9ba89a16715bc.zip
swift-contrib-494ee542b0b7cb9a2eb9997865b9ba89a16715bc.tar.bz2
Fix resizability behavior of 'Edit Bookmark'-Dialog.
The dialog is now only resizable in width and the line edit fields resize with the dialog size without leaving awkward whitespace. Test-Information: Checked via running Swift and testing that the fields resize in width and the dialog is fixed in height. Change-Id: Idd7417720438f20fa051a823df40d89545db9078
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtBookmarkDetailWindow.cpp1
-rw-r--r--Swift/QtUI/QtBookmarkDetailWindow.ui189
2 files changed, 100 insertions, 90 deletions
diff --git a/Swift/QtUI/QtBookmarkDetailWindow.cpp b/Swift/QtUI/QtBookmarkDetailWindow.cpp
index 3e501f2..1e84067 100644
--- a/Swift/QtUI/QtBookmarkDetailWindow.cpp
+++ b/Swift/QtUI/QtBookmarkDetailWindow.cpp
@@ -1,52 +1,53 @@
/*
* Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "QtBookmarkDetailWindow.h"
#include "QtSwiftUtil.h"
#include <QMessageBox>
namespace Swift {
QtBookmarkDetailWindow::QtBookmarkDetailWindow(QWidget* parent) : QDialog(parent) {
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
//connect(buttons_, SIGNAL(accepted()), SLOT(accept()));
//connect(buttons_, SIGNAL(rejected()), SLOT(reject()));
+ setFixedHeight(sizeHint().height());
}
void QtBookmarkDetailWindow::accept() {
if (commit()) {
QDialog::accept();
}
}
boost::optional<MUCBookmark> QtBookmarkDetailWindow::createBookmarkFromForm() {
//check room
//check bookmarkName
JID room(Q2PSTRING(room_->text()));
if (!room.isValid() || room.getNode().empty() || !room.getResource().empty()) {
QMessageBox::warning(this, tr("Bookmark not valid"), tr("You must specify a valid room address (e.g. someroom@rooms.example.com)."));
return boost::optional<MUCBookmark>();
}
std::string name(Q2PSTRING(name_->text()));
if (name.empty()) {
name = room.toString();
}
MUCBookmark bookmark(room, name);
std::string nick(Q2PSTRING(nick_->text()));
std::string password(Q2PSTRING(password_->text()));
bookmark.setAutojoin(autojoin_->isChecked());
if (!nick.empty()) {
bookmark.setNick(nick);
}
if (!password.empty()) {
bookmark.setPassword(password);
}
return bookmark;
}
void QtBookmarkDetailWindow::createFormFromBookmark(const MUCBookmark& bookmark) {
diff --git a/Swift/QtUI/QtBookmarkDetailWindow.ui b/Swift/QtUI/QtBookmarkDetailWindow.ui
index 4a37b2f..be55686 100644
--- a/Swift/QtUI/QtBookmarkDetailWindow.ui
+++ b/Swift/QtUI/QtBookmarkDetailWindow.ui
@@ -1,148 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QtBookmarkDetailWindow</class>
<widget class="QDialog" name="QtBookmarkDetailWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>396</width>
- <height>282</height>
+ <width>382</width>
+ <height>207</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Edit Bookmark Details</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
- <widget class="QWidget" name="layoutWidget">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>371</width>
- <height>241</height>
- </rect>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="leftMargin">
+ <number>12</number>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Bookmark Name:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="name_"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Room Address:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="room_"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Your Nickname:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="nick_"/>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Room password:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLineEdit" name="password_"/>
- </item>
- <item row="4" column="0">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <widget class="QCheckBox" name="autojoin_">
- <property name="text">
- <string>Enter automatically</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttons_">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
+ <property name="topMargin">
+ <number>12</number>
+ </property>
+ <property name="rightMargin">
+ <number>12</number>
+ </property>
+ <property name="bottomMargin">
+ <number>12</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Bookmark Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="name_"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Room Address:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="room_"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Your Nickname:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="nick_"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Room password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="password_"/>
+ </item>
+ <item row="4" column="0">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="autojoin_">
+ <property name="text">
+ <string>Enter automatically</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttons_">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttons_</sender>
<signal>accepted()</signal>
<receiver>QtBookmarkDetailWindow</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttons_</sender>
<signal>rejected()</signal>
<receiver>QtBookmarkDetailWindow</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>