* src/frontends/qt4/QListings.cpp:

- add Apply button
* src/frontends/qt4/ui/ListingsUi.ui:
	- add Apply button
	- add accelerators

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18409 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2007-05-18 18:35:28 +00:00
parent 51b657c6cc
commit 4d5c28c305
2 changed files with 80 additions and 63 deletions

View File

@ -4,7 +4,7 @@
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
* \author Bo Peng * \author Bo Peng
* \author Jürgen Spitzmüller * \author Jürgen Spitzmüller
* *
* Full author contact details are available in file CREDITS. * Full author contact details are available in file CREDITS.
*/ */
@ -63,6 +63,7 @@ QListingsDialog::QListingsDialog(QListings * form)
setupUi(this); setupUi(this);
connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()), form_, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
connect(languageCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor())); connect(languageCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
@ -161,7 +162,8 @@ void QListingsDialog::validate_listings_params()
InsetListingsParams par(construct_params()); InsetListingsParams par(construct_params());
if (!isOK) { if (!isOK) {
isOK = true; isOK = true;
listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters."); listingsTB->setPlainText(
"Input listings parameters on the right. Enter ? for a list of parameters.");
okPB->setEnabled(true); okPB->setEnabled(true);
} }
} catch (invalidParam & e) { } catch (invalidParam & e) {
@ -209,14 +211,15 @@ void QListings::build_dialog()
dialog_.reset(new QListingsDialog(this)); dialog_.reset(new QListingsDialog(this));
bcview().setOK(dialog_->okPB); bcview().setOK(dialog_->okPB);
bcview().setApply(dialog_->applyPB);
bcview().setCancel(dialog_->closePB); bcview().setCancel(dialog_->closePB);
dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters."); dialog_->listingsTB->setPlainText(
"Input listings parameters on the right. Enter ? for a list of parameters.");
update_contents(); update_contents();
} }
/// not used right now.
void QListings::apply() void QListings::apply()
{ {
InsetListingsParams & params = controller().params(); InsetListingsParams & params = controller().params();

View File

@ -18,21 +18,74 @@
<property name="sizeGripEnabled" > <property name="sizeGripEnabled" >
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>291</width>
<height>27</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okPB" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyPB" >
<property name="text" >
<string>&amp;Apply</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" >
<widget class="QTabWidget" name="listingsTW" > <widget class="QTabWidget" name="listingsTW" >
<property name="currentIndex" > <property name="currentIndex" >
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab" > <widget class="QWidget" name="tab" >
<attribute name="title" > <attribute name="title" >
<string>Main Settings</string> <string>&amp;Main Settings</string>
</attribute> </attribute>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >
@ -85,14 +138,14 @@
<item row="1" column="0" colspan="2" > <item row="1" column="0" colspan="2" >
<widget class="QCheckBox" name="floatCB" > <widget class="QCheckBox" name="floatCB" >
<property name="text" > <property name="text" >
<string>Float</string> <string>&amp;Float</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2" > <item row="0" column="0" colspan="2" >
<widget class="QCheckBox" name="inlineCB" > <widget class="QCheckBox" name="inlineCB" >
<property name="text" > <property name="text" >
<string>Inline listing</string> <string>&amp;Inline listing</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -142,7 +195,10 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="label" > <widget class="QLabel" name="label" >
<property name="text" > <property name="text" >
<string>Side: </string> <string>&amp;Side: </string>
</property>
<property name="buddy" >
<cstring>numberSideCO</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -165,7 +221,7 @@
<string>File name of image</string> <string>File name of image</string>
</property> </property>
<property name="text" > <property name="text" >
<string>Step:</string> <string>S&amp;tep:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -178,7 +234,7 @@
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="numberfontsizeL" > <widget class="QLabel" name="numberfontsizeL" >
<property name="text" > <property name="text" >
<string>Font size:</string> <string>Font si&amp;ze:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -233,7 +289,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="numberfontsizeL_3" > <widget class="QLabel" name="numberfontsizeL_3" >
<property name="text" > <property name="text" >
<string>First line:</string> <string>Fi&amp;rst line:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -272,7 +328,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="numberfontsizeL_2" > <widget class="QLabel" name="numberfontsizeL_2" >
<property name="text" > <property name="text" >
<string>Last line:</string> <string>&amp;Last line:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -318,7 +374,7 @@
<string>Insert a special symbol for a space</string> <string>Insert a special symbol for a space</string>
</property> </property>
<property name="text" > <property name="text" >
<string>&amp;Space as Symbol</string> <string>S&amp;pace as Symbol</string>
</property> </property>
<property name="shortcut" > <property name="shortcut" >
<number>276824147</number> <number>276824147</number>
@ -344,7 +400,7 @@
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="fontstyle_label_3" > <widget class="QLabel" name="fontstyle_label_3" >
<property name="text" > <property name="text" >
<string>Font style:</string> <string>Font st&amp;yle:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -381,7 +437,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="fontsize_label_3" > <widget class="QLabel" name="fontsize_label_3" >
<property name="text" > <property name="text" >
<string>Font size:</string> <string>F&amp;ont size:</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -424,7 +480,7 @@
</widget> </widget>
<widget class="QWidget" name="tab_2" > <widget class="QWidget" name="tab_2" >
<attribute name="title" > <attribute name="title" >
<string>Advanced</string> <string>Ad&amp;vanced</string>
</attribute> </attribute>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
@ -444,7 +500,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title" > <property name="title" >
<string>More Parameters</string> <string>More &amp;Parameters</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >
@ -494,53 +550,11 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>101</width>
<height>27</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okPB" >
<property name="text" >
<string>OK</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>okPB</tabstop> <tabstop>okPB</tabstop>
<tabstop>applyPB</tabstop>
<tabstop>closePB</tabstop> <tabstop>closePB</tabstop>
<tabstop>listingsTW</tabstop> <tabstop>listingsTW</tabstop>
<tabstop>inlineCB</tabstop> <tabstop>inlineCB</tabstop>
@ -557,8 +571,8 @@
<tabstop>breaklinesCB</tabstop> <tabstop>breaklinesCB</tabstop>
<tabstop>spaceCB</tabstop> <tabstop>spaceCB</tabstop>
<tabstop>extendedcharsCB</tabstop> <tabstop>extendedcharsCB</tabstop>
<tabstop>listingsTB</tabstop>
<tabstop>listingsED</tabstop> <tabstop>listingsED</tabstop>
<tabstop>listingsTB</tabstop>
</tabstops> </tabstops>
<includes> <includes>
<include location="local" >qt_helpers.h</include> <include location="local" >qt_helpers.h</include>