]> git.lyx.org Git - features.git/commitdiff
Fix unreported bug related to 3246 by Richard Heck:
authorAbdelrazak Younes <younes@lyx.org>
Wed, 28 Mar 2007 16:58:08 +0000 (16:58 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 28 Mar 2007 16:58:08 +0000 (16:58 +0000)
"View" button in TeX information dialog not enabled when file is selected with the keyboard. Problem was that SIGNAL itemSelectionChanged was not connected to anything. Also made some minor stylistic changes to the code.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17614 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QTexinfo.C
src/frontends/qt4/QTexinfoDialog.C
src/frontends/qt4/ui/QTexinfoUi.ui

index 7f91fa57eb18b05bb170a22604912b35d0d19f4d..bae5eec750e696043e01db076e521467c93e7c3b 100644 (file)
@@ -48,15 +48,15 @@ void QTexinfo::build_dialog()
 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
 {
        ContentsType & data = texdata_[whichStyle];
-       bool const withFullPath = dialog_->path->isChecked();
+       bool const withFullPath = dialog_->pathCB->isChecked();
 
        getTexFileList(whichStyle, data, withFullPath);
 
-       dialog_->fileList->clear();
+       dialog_->fileListLW->clear();
        ContentsType::const_iterator it  = data.begin();
        ContentsType::const_iterator end = data.end();
        for (; it != end; ++it)
-               dialog_->fileList->addItem(toqstr(*it));
+               dialog_->fileListLW->addItem(toqstr(*it));
 
        activeStyle = whichStyle;
 }
index 761931ca0992f0a2b8b9fa0ad5fdc4dd3ff6e795..bfcb09c5df0cf54c955abaa2292b9d085276d1d4 100644 (file)
@@ -34,12 +34,13 @@ QTexinfoDialog::QTexinfoDialog(QTexinfo * form)
                form, SLOT(slotClose()));
 
     connect( viewPB, SIGNAL( clicked() ), this, SLOT( viewClicked() ) );
-    connect( whatStyle, SIGNAL( activated(const QString&) ), this, SLOT( enableViewPB() ) );
-    connect( whatStyle, SIGNAL( activated(int) ), this, SLOT( update() ) );
-    connect( path, SIGNAL( stateChanged(int) ), this, SLOT( update() ) );
+    connect( whatStyleCO, SIGNAL( activated(const QString&) ), this, SLOT( enableViewPB() ) );
+    connect( whatStyleCO, SIGNAL( activated(int) ), this, SLOT( update() ) );
+    connect( pathCB, SIGNAL( stateChanged(int) ), this, SLOT( update() ) );
     connect( rescanPB, SIGNAL( clicked() ), this, SLOT( enableViewPB() ) );
     connect( rescanPB, SIGNAL( clicked() ), this, SLOT( rescanClicked() ) );
-    connect( fileList, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( enableViewPB() ) );
+    connect( fileListLW, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( enableViewPB() ) );
+    connect( fileListLW, SIGNAL( itemSelectionChanged() ), this, SLOT( enableViewPB() ) );
 }
 
 
@@ -67,10 +68,10 @@ void QTexinfoDialog::rescanClicked()
 
 void QTexinfoDialog::viewClicked()
 {
-       vector<string>::size_type const fitem = fileList->currentRow();
+       vector<string>::size_type const fitem = fileListLW->currentRow();
        vector<string> const & data = form_->texdata_[form_->activeStyle];
        string file = data[fitem];
-       if (!path->isChecked())
+       if (!pathCB->isChecked())
                file = getTexFileFromList(data[fitem],
                        form_->controller().getFileType(form_->activeStyle));
        form_->controller().viewFile(file);
@@ -79,7 +80,7 @@ void QTexinfoDialog::viewClicked()
 
 void QTexinfoDialog::update()
 {
-       switch (whatStyle->currentIndex()) {
+       switch (whatStyleCO->currentIndex()) {
        case 0:
                form_->updateStyles(ControlTexinfo::cls);
                break;
@@ -99,7 +100,7 @@ void QTexinfoDialog::update()
 
 void QTexinfoDialog::enableViewPB()
 {
-       viewPB->setEnabled(fileList->currentRow() > -1);
+       viewPB->setEnabled(fileListLW->currentRow() > -1);
 }
 
 } // namespace frontend
index da157c32dae69579c3f3be33890a70e88926703d..27bab2c7db4948b40186ff680491db317eefb51d 100644 (file)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>QTexinfoUi</class>
  <widget class="QDialog" name="QTexinfoUi" >
   <property name="geometry" >
@@ -26,7 +23,7 @@
     <number>6</number>
    </property>
    <item row="1" column="0" >
-    <widget class="QListWidget" name="fileList" />
+    <widget class="QListWidget" name="fileListLW" />
    </item>
    <item row="3" column="0" >
     <layout class="QHBoxLayout" >
       <number>6</number>
      </property>
      <item>
-      <widget class="QComboBox" name="whatStyle" >
+      <widget class="QComboBox" name="whatStyleCO" >
        <property name="toolTip" >
         <string>Selected classes or styles</string>
        </property>
       </spacer>
      </item>
      <item>
-      <widget class="QCheckBox" name="path" >
+      <widget class="QCheckBox" name="pathCB" >
        <property name="toolTip" >
         <string>Toggles view of the file list</string>
        </property>
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
- <includes>
-  <include location="local" >qt_helpers.h</include>
- </includes>
  <tabstops>
-  <tabstop>whatStyle</tabstop>
-  <tabstop>path</tabstop>
-  <tabstop>fileList</tabstop>
+  <tabstop>whatStyleCO</tabstop>
+  <tabstop>pathCB</tabstop>
+  <tabstop>fileListLW</tabstop>
   <tabstop>rescanPB</tabstop>
   <tabstop>viewPB</tabstop>
   <tabstop>closePB</tabstop>
  </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
  <resources/>
  <connections/>
 </ui>