view libgui/src/settings-dialog.ui @ 16620:818eef7b2618

allow terminal colors to be set from preferences dialog * QTerminalInterface.h (QTerminalInterface::setBackgroundColor, QTerminalInterface::setForeroundColor, QTerminalInterface::setSelectionColor, QTerminalInterface::setCursorColor): New functions. * QUnixTerminalImpl.h, QUnixTerminalImpl.cpp QUnixTerminalImpl::setBackgroundColor, QUnixTerminalImpl::setForeroundColor, QUnixTerminalImpl::setSelectionColor, QUnixTerminalImpl::setCursorColor): New functions. * QWinTerminalImpl.h, QWinTerminalImpl.cpp (QConsolePrivate::setCursorColor): New argument, useForegroundColor. (QConsolePrivate::m_selectionColor, QConsolePrivate::m_cursorColor): New member variablebs. (QConsolePrivate::selectionColor, QConsolePrivate::cursorColor, QConsolePrivate::setSelectionColor, QConsolePrivate::setCursorColor): Use member variables instead of Windows console color map. (QConsolePrivate::cursorColor): Return foreground color if stored color is invalid. (QConsolePrivate::setCursorColor): Store invalid color if useForegroundcolor. (QConsolePrivate::QConsolePrivate): Set default selection and cursor colors. * QTerminal.cc (QTerminal::notice_settings): Handle terminal color settings. * resource-manager.h, resource-manager.cc (resource_manager::terminal_color_names, resource_manager::terminal_default_colors, resource_manager::terminal_color_chars): New functions. * settings-dialog.h, settings-dialog.cc (settings_dialog::read_terminal_colors): New function. (settings_dialog::settings_dialog): Call read_terminal_colors. Read valud for using foreground color for cursor color. (settings_dialog::write_terminal_colors): New function. (settings_dialog::write_changed_settings): Call write_terminal_colors. Handle setting for using foreground color for cursor color. * settings-dialog.ui: Add color selection to terminal settings dialog.
author John W. Eaton <jwe@octave.org>
date Mon, 06 May 2013 06:00:44 -0400
parents a1f613e5066d
children cf939872811c
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>settings_dialog</class>
 <widget class="QDialog" name="settings_dialog">
  <property name="windowModality">
   <enum>Qt::ApplicationModal</enum>
  </property>
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>700</width>
    <height>480</height>
   </rect>
  </property>
  <property name="minimumSize">
   <size>
    <width>700</width>
    <height>480</height>
   </size>
  </property>
  <property name="maximumSize">
   <size>
    <width>700</width>
    <height>480</height>
   </size>
  </property>
  <property name="windowTitle">
   <string>Settings</string>
  </property>
  <layout class="QVBoxLayout" name="verticalLayout_2">
   <item>
    <widget class="QTabWidget" name="tabWidget">
     <property name="currentIndex">
      <number>3</number>
     </property>
     <widget class="QWidget" name="tab_4">
      <property name="enabled">
       <bool>true</bool>
      </property>
      <attribute name="title">
       <string>General</string>
      </attribute>
      <widget class="QWidget" name="verticalLayoutWidget">
       <property name="geometry">
        <rect>
         <x>9</x>
         <y>10</y>
         <width>651</width>
         <height>371</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_7">
        <item>
         <layout class="QGridLayout" name="gridLayout">
          <item row="3" column="0">
           <widget class="QLabel" name="label_9">
            <property name="text">
             <string>Icon set for dock widgets</string>
            </property>
           </widget>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="label_2">
            <property name="text">
             <string>Language (requires restart)</string>
            </property>
           </widget>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="label_8">
            <property name="text">
             <string>Icon size</string>
            </property>
           </widget>
          </item>
          <item row="2" column="2">
           <layout class="QHBoxLayout" name="horizontalLayout_6">
            <item>
             <widget class="QSpinBox" name="toolbar_icon_size">
              <property name="minimum">
               <number>16</number>
              </property>
              <property name="maximum">
               <number>32</number>
              </property>
              <property name="singleStep">
               <number>4</number>
              </property>
              <property name="value">
               <number>24</number>
              </property>
             </widget>
            </item>
            <item>
             <spacer name="horizontalSpacer_4">
              <property name="orientation">
               <enum>Qt::Horizontal</enum>
              </property>
              <property name="sizeHint" stdset="0">
               <size>
                <width>40</width>
                <height>20</height>
               </size>
              </property>
             </spacer>
            </item>
           </layout>
          </item>
          <item row="1" column="2">
           <layout class="QHBoxLayout" name="horizontalLayout_8">
            <item>
             <widget class="QComboBox" name="comboBox_language">
              <property name="insertPolicy">
               <enum>QComboBox::InsertAtBottom</enum>
              </property>
             </widget>
            </item>
            <item>
             <spacer name="horizontalSpacer_3">
              <property name="orientation">
               <enum>Qt::Horizontal</enum>
              </property>
              <property name="sizeHint" stdset="0">
               <size>
                <width>40</width>
                <height>20</height>
               </size>
              </property>
             </spacer>
            </item>
           </layout>
          </item>
          <item row="3" column="2">
           <layout class="QHBoxLayout" name="horizontalLayout_9">
            <item>
             <widget class="QRadioButton" name="general_icon_octave">
              <property name="text">
               <string>Octave logo only</string>
              </property>
              <property name="checked">
               <bool>true</bool>
              </property>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="general_icon_letter">
              <property name="text">
               <string>Letter icons</string>
              </property>
             </widget>
            </item>
            <item>
             <widget class="QRadioButton" name="general_icon_graphic">
              <property name="text">
               <string>Graphic  icons</string>
              </property>
             </widget>
            </item>
            <item>
             <spacer name="horizontalSpacer_6">
              <property name="orientation">
               <enum>Qt::Horizontal</enum>
              </property>
              <property name="sizeHint" stdset="0">
               <size>
                <width>40</width>
                <height>20</height>
               </size>
              </property>
             </spacer>
            </item>
           </layout>
          </item>
         </layout>
        </item>
        <item>
         <spacer name="verticalSpacer_4">
          <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>
     </widget>
     <widget class="QWidget" name="tab">
      <attribute name="title">
       <string>Editor</string>
      </attribute>
      <layout class="QVBoxLayout" name="verticalLayout_6">
       <item>
        <layout class="QVBoxLayout" name="verticalLayout_5">
         <item>
          <layout class="QHBoxLayout" name="horizontalLayout_4"/>
         </item>
         <item>
          <widget class="QCheckBox" name="editor_showLineNumbers">
           <property name="enabled">
            <bool>true</bool>
           </property>
           <property name="text">
            <string>Show line numbers</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QCheckBox" name="editor_highlightCurrentLine">
           <property name="enabled">
            <bool>true</bool>
           </property>
           <property name="text">
            <string>Highlight current line</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QCheckBox" name="editor_codeCompletion">
           <property name="enabled">
            <bool>true</bool>
           </property>
           <property name="text">
            <string>Code completion</string>
           </property>
           <property name="checked">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QCheckBox" name="editor_longWindowTitle">
           <property name="text">
            <string>Show complete path in window title</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QCheckBox" name="editor_restoreSession">
           <property name="text">
            <string>Restore tabs from previous session on startup</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <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="QCheckBox" name="useCustomFileEditor">
         <property name="enabled">
          <bool>true</bool>
         </property>
         <property name="text">
          <string>Use custom file editor</string>
         </property>
        </widget>
       </item>
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout">
         <item>
          <widget class="QLabel" name="customEditorLabel">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Command  line (%f=file, %l=line):</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLineEdit" name="customFileEditor">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>emacs</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
     <widget class="QWidget" name="tab_6">
      <attribute name="title">
       <string>Editor Styles</string>
      </attribute>
      <widget class="QTabWidget" name="tabs_editor_styles">
       <property name="geometry">
        <rect>
         <x>2</x>
         <y>9</y>
         <width>671</width>
         <height>381</height>
        </rect>
       </property>
      </widget>
     </widget>
     <widget class="QWidget" name="tab_5">
      <attribute name="title">
       <string>Terminal</string>
      </attribute>
      <widget class="QWidget" name="horizontalLayoutWidget">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>50</y>
         <width>631</width>
         <height>31</height>
        </rect>
       </property>
       <layout class="QHBoxLayout" name="horizontalLayout_3">
        <item>
         <widget class="QLabel" name="label">
          <property name="text">
           <string>Cursor type:</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QComboBox" name="terminal_cursorType"/>
        </item>
        <item>
         <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>
         <widget class="QCheckBox" name="terminal_cursorBlinking">
          <property name="text">
           <string>Cursor blinking</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QCheckBox" name="terminal_cursorUseForegroundColor">
          <property name="text">
           <string>Use Foreground Color</string>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="verticalLayoutWidget_2">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>90</y>
         <width>631</width>
         <height>164</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout">
        <item>
         <widget class="QGroupBox" name="terminal_colors_box">
          <property name="minimumSize">
           <size>
            <width>0</width>
            <height>162</height>
           </size>
          </property>
          <property name="title">
           <string>Terminal Colors</string>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="verticalLayoutWidget_3">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>260</y>
         <width>631</width>
         <height>121</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_8">
        <item>
         <spacer name="verticalSpacer_3">
          <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>
      <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>10</x>
         <y>10</y>
         <width>631</width>
         <height>30</height>
        </rect>
       </property>
       <layout class="QHBoxLayout" name="horizontalLayout_5">
        <item>
         <widget class="QLabel" name="label_11">
          <property name="text">
           <string>Font</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QFontComboBox" name="terminal_fontName">
          <property name="editable">
           <bool>false</bool>
          </property>
          <property name="fontFilters">
           <set>QFontComboBox::MonospacedFonts</set>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QLabel" name="label_12">
          <property name="text">
           <string>Font Size</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="QSpinBox" name="terminal_fontSize">
          <property name="minimum">
           <number>2</number>
          </property>
          <property name="maximum">
           <number>96</number>
          </property>
          <property name="value">
           <number>10</number>
          </property>
         </widget>
        </item>
        <item>
         <spacer name="horizontalSpacer_5">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>40</width>
            <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </widget>
     <widget class="QWidget" name="tab_2">
      <attribute name="title">
       <string>File Browser</string>
      </attribute>
      <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QCheckBox" name="showFileSize">
         <property name="text">
          <string>Show file size</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="showFileType">
         <property name="text">
          <string>Show file type</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="showLastModified">
         <property name="text">
          <string>Show date of last modification</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="showHiddenFiles">
         <property name="text">
          <string>Show hidden files</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="sync_octave_directory">
         <property name="text">
          <string>Synchronize octave directory with the file browser</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QCheckBox" name="useAlternatingRowColors">
         <property name="text">
          <string>Alternating row colors</string>
         </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>360</height>
          </size>
         </property>
        </spacer>
       </item>
      </layout>
     </widget>
     <widget class="QWidget" name="tab_workspace">
      <attribute name="title">
       <string>Workspace</string>
      </attribute>
      <widget class="QGroupBox" name="workspace_colors_box">
       <property name="geometry">
        <rect>
         <x>19</x>
         <y>19</y>
         <width>631</width>
         <height>81</height>
        </rect>
       </property>
       <property name="minimumSize">
        <size>
         <width>0</width>
         <height>81</height>
        </size>
       </property>
       <property name="title">
        <string>Storage Class Colors</string>
       </property>
      </widget>
     </widget>
     <widget class="QWidget" name="tab_3">
      <attribute name="title">
       <string>Network</string>
      </attribute>
      <layout class="QVBoxLayout" name="verticalLayout_4">
       <item>
        <widget class="QCheckBox" name="useProxyServer">
         <property name="text">
          <string>Use proxy server</string>
         </property>
        </widget>
       </item>
       <item>
        <layout class="QFormLayout" name="formLayout">
         <item row="0" column="0">
          <widget class="QLabel" name="label_3">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Proxy Type:</string>
           </property>
          </widget>
         </item>
         <item row="0" column="1">
          <widget class="QComboBox" name="proxyType">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <item>
            <property name="text">
             <string>HttpProxy</string>
            </property>
           </item>
           <item>
            <property name="text">
             <string>Socks5Proxy</string>
            </property>
           </item>
          </widget>
         </item>
         <item row="1" column="0">
          <widget class="QLabel" name="label_4">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Hostname:</string>
           </property>
          </widget>
         </item>
         <item row="1" column="1">
          <widget class="QLineEdit" name="proxyHostName">
           <property name="enabled">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="2" column="0">
          <widget class="QLabel" name="label_5">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Port:</string>
           </property>
          </widget>
         </item>
         <item row="2" column="1">
          <widget class="QLineEdit" name="proxyPort">
           <property name="enabled">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="3" column="0">
          <widget class="QLabel" name="label_6">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Username:</string>
           </property>
          </widget>
         </item>
         <item row="3" column="1">
          <widget class="QLineEdit" name="proxyUserName">
           <property name="enabled">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="4" column="0">
          <widget class="QLabel" name="label_7">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="text">
            <string>Password:</string>
           </property>
          </widget>
         </item>
         <item row="4" column="1">
          <widget class="QLineEdit" name="proxyPassword">
           <property name="enabled">
            <bool>false</bool>
           </property>
           <property name="echoMode">
            <enum>QLineEdit::Password</enum>
           </property>
          </widget>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
    </widget>
   </item>
   <item>
    <widget class="QDialogButtonBox" name="buttonBox">
     <property name="standardButtons">
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
     </property>
    </widget>
   </item>
  </layout>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>label_4</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>69</x>
     <y>122</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>label_3</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>59</x>
     <y>91</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>label_5</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>44</x>
     <y>152</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>proxyType</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>291</x>
     <y>91</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>proxyHostName</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>291</x>
     <y>124</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>proxyPort</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>364</x>
     <y>154</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useCustomFileEditor</sender>
   <signal>toggled(bool)</signal>
   <receiver>customFileEditor</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>111</x>
     <y>62</y>
    </hint>
    <hint type="destinationlabel">
     <x>343</x>
     <y>63</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>label_7</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>67</x>
     <y>212</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>proxyUserName</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>364</x>
     <y>184</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>proxyPassword</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>364</x>
     <y>214</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useProxyServer</sender>
   <signal>toggled(bool)</signal>
   <receiver>label_6</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>249</x>
     <y>59</y>
    </hint>
    <hint type="destinationlabel">
     <x>68</x>
     <y>182</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>buttonBox</sender>
   <signal>accepted()</signal>
   <receiver>settings_dialog</receiver>
   <slot>accept()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>299</x>
     <y>366</y>
    </hint>
    <hint type="destinationlabel">
     <x>299</x>
     <y>199</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>buttonBox</sender>
   <signal>rejected()</signal>
   <receiver>settings_dialog</receiver>
   <slot>reject()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>299</x>
     <y>366</y>
    </hint>
    <hint type="destinationlabel">
     <x>299</x>
     <y>199</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>useCustomFileEditor</sender>
   <signal>toggled(bool)</signal>
   <receiver>customEditorLabel</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>349</x>
     <y>383</y>
    </hint>
    <hint type="destinationlabel">
     <x>111</x>
     <y>413</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>