Fixes for toolbar editor.

This commit is contained in:
Martin Rotter 2014-09-19 08:31:25 +02:00
parent 06848eea13
commit b95ca5c259
5 changed files with 112 additions and 78 deletions

View File

@ -3,6 +3,7 @@
Fixed:
<ul>
<li>List of actions in toolbar editor now do not allow copying of items.</li>
<li>Keyboard search for message list should now work with Qt 4.</li>
<li>Overall code cleanups and refactoring primarily in area of feed/message models and recycle bin functionality.</li>
<li>Fixed bug #66, #67, #69, #64.</li>

View File

@ -45,6 +45,7 @@
#include <QNetworkProxy>
#include <QColorDialog>
#include <QFileDialog>
#include <QKeyEvent>
FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormSettings) {
@ -54,6 +55,11 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
setWindowIcon(qApp->icons()->fromTheme("application-settings"));
m_ui->m_editorMessagesToolbar->activeItemsWidget()->viewport()->installEventFilter(this);
m_ui->m_editorFeedsToolbar->activeItemsWidget()->viewport()->installEventFilter(this);
m_ui->m_editorMessagesToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
m_ui->m_editorFeedsToolbar->availableItemsWidget()->viewport()->installEventFilter(this);
#if !defined(Q_OS_WIN)
MessageBox::iconify(m_ui->m_buttonBox);
#endif
@ -784,3 +790,18 @@ void FormSettings::saveInterface() {
qApp->mainForm()->tabWidget()->checkTabBarVisibility();
qApp->mainForm()->tabWidget()->feedMessageViewer()->refreshVisualProperties();
}
bool FormSettings::eventFilter(QObject *obj, QEvent *e) {
Q_UNUSED(obj)
if (e->type() == QEvent::Drop) {
QDropEvent *drop_event = static_cast<QDropEvent*>(e);
if (drop_event->keyboardModifiers() != Qt::NoModifier) {
drop_event->setDropAction(Qt::MoveAction);
}
}
return false;
}

View File

@ -49,6 +49,8 @@ class FormSettings : public QDialog {
// Does check of controls before dialog can be submitted.
bool doSaveCheck();
bool eventFilter(QObject *obj, QEvent *e);
protected slots:
// Displays "restart" dialog if some critical settings changed.
void promptForRestart();
@ -97,4 +99,6 @@ class FormSettings : public QDialog {
QStringList m_changedDataTexts;
};
#endif // FORMSETTINGS_H

View File

@ -14,10 +14,86 @@
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="m_listSettings">
<property name="minimumSize">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>220</width>
<height>16777215</height>
</size>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="movement">
<enum>QListView::Static</enum>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
<property name="currentRow">
<number>-1</number>
</property>
<item>
<property name="text">
<string extracomment="General settings section.">General</string>
</property>
</item>
<item>
<property name="text">
<string>Data storage</string>
</property>
</item>
<item>
<property name="text">
<string>Keyboard shortcuts</string>
</property>
</item>
<item>
<property name="text">
<string>User interface</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Language settings section.">Language</string>
</property>
</item>
<item>
<property name="text">
<string>Web browser &amp; proxy</string>
</property>
</item>
<item>
<property name="text">
<string>Feeds &amp; messages</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QDialogButtonBox" name="m_buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QStackedWidget" name="m_stackedSettings">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="m_pageGeneral">
<layout class="QFormLayout" name="formLayout_5">
@ -353,7 +429,7 @@ Authors of this application are NOT responsible for lost data.</string>
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="m_tabIconSkin">
<attribute name="title">
@ -1201,82 +1277,6 @@ Authors of this application are NOT responsible for lost data.</string>
</widget>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QDialogButtonBox" name="m_buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QListWidget" name="m_listSettings">
<property name="minimumSize">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>220</width>
<height>16777215</height>
</size>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="movement">
<enum>QListView::Static</enum>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
<property name="currentRow">
<number>-1</number>
</property>
<item>
<property name="text">
<string extracomment="General settings section.">General</string>
</property>
</item>
<item>
<property name="text">
<string>Data storage</string>
</property>
</item>
<item>
<property name="text">
<string>Keyboard shortcuts</string>
</property>
</item>
<item>
<property name="text">
<string>User interface</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Language settings section.">Language</string>
</property>
</item>
<item>
<property name="text">
<string>Web browser &amp; proxy</string>
</property>
</item>
<item>
<property name="text">
<string>Feeds &amp; messages</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View File

@ -41,6 +41,14 @@ class ToolBarEditor : public QWidget {
void loadFromToolBar(BaseToolBar *tool_bar);
void saveToolBar();
inline QListWidget *activeItemsWidget() {
return m_ui->m_listActivatedActions;
}
inline QListWidget *availableItemsWidget() {
return m_ui->m_listAvailableActions;
}
private slots:
// Insert common controls.
void insertSpacer();