Mercurial > hg > octave-terminal
changeset 14308:3b6177bd63b0 gui
Removed chat and chat settings, instead made a separate menu entry in the community menu.
* MainWindow: Added menu entry.
* SettingsDialog: Removed tab for chat settings.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Wed, 01 Feb 2012 19:28:51 +0100 |
parents | be3e1a14a6de |
children | df86157a4912 |
files | gui/src/MainWindow.cpp gui/src/MainWindow.h gui/src/SettingsDialog.cpp gui/src/SettingsDialog.ui |
diffstat | 4 files changed, 80 insertions(+), 221 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -119,6 +119,23 @@ } void +MainWindow::openChat () +{ + if (!m_ircWidget) + { + m_ircWidget = new QIRCWidget (); + m_ircWidget->setWindowTitle ("Chat"); + m_ircWidget->connectToServer ("irc.freenode.net", "Octave-GUI-User", "#octave"); + } + + if (!m_ircWidget->isVisible ()) + { + m_ircWidget->setVisible (true); + m_ircWidget->raise (); + } +} + +void MainWindow::handleSaveWorkspaceRequest () { QString selectedFile = @@ -153,23 +170,6 @@ } void -MainWindow::handleUnreadMessages (bool yes) -{ - if (yes) - { - m_ircWidgetSubWindow - ->setWindowIcon - (ResourceManager::instance ()->icon (ResourceManager::ChatNewMessage)); - } - else - { - m_ircWidgetSubWindow - ->setWindowIcon - (ResourceManager::instance ()->icon (ResourceManager::Chat)); - } -} - -void MainWindow::alignMdiWindows () { m_centralMdiArea->tileSubWindows (); @@ -270,6 +270,8 @@ m_closeApplication = false; // flag for editor files when closed setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Octave)); + m_ircWidget = 0; + // Initialize MDI area. m_centralMdiArea = new QMdiArea (this); m_centralMdiArea->setObjectName ("CentralMdiArea"); @@ -312,26 +314,6 @@ m_terminalViewSubWindow->setStatusTip (tr ("Enter your commands into the Octave terminal.")); m_terminalViewSubWindow->setMinimumSize (300, 300); - // Chat subwindow. - // Deactivated in the development process. - /* - m_ircWidget = new QIRCWidget (this); - m_ircWidgetSubWindow = new NonClosableMdiSubWindow (this); - m_ircWidgetSubWindow->setWidget(m_ircWidget); - m_centralMdiArea->addSubWindow (m_ircWidgetSubWindow, Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint); - - m_ircWidgetSubWindow->setObjectName ("ChatWidgetSubWindow"); - m_ircWidgetSubWindow->setWindowTitle (tr ("Chat")); - m_ircWidgetSubWindow - ->setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Chat)); - m_ircWidgetSubWindow->setStatusTip(tr ("Instantly chat with other Octave users for help.")); - m_ircWidgetSubWindow->setFocusProxy (m_ircWidget); - m_ircWidgetSubWindow->setMinimumSize (300, 300); - //connect (m_ircWidget, SIGNAL (unreadMessages (bool)), this, SLOT (handleUnreadMessages (bool))); - - m_ircWidget->connectToServer("irc.freenode.net", "Octave-GUI-User", "#octave"); - */ - m_lexer = NULL; // initialise the empty lexer for the edtiors QMenu *controlMenu = menuBar ()->addMenu (tr ("Octave")); @@ -362,6 +344,8 @@ QAction *clearWorkspaceAction = workspaceMenu->addAction (tr ("Clear")); QMenu *communityMenu = menuBar ()->addMenu (tr ("Community")); + QAction *openChatAction = communityMenu->addAction (tr ("Chat")); + communityMenu->addSeparator(); QAction *reportBugAction = communityMenu->addAction (tr ("Report Bug")); QAction *agoraAction = communityMenu->addAction (tr ("Agora")); QAction *octaveForgeAction = communityMenu->addAction (tr ("Octave Forge")); @@ -373,6 +357,7 @@ connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ())); connect (alignWindowsAction, SIGNAL (triggered ()), this, SLOT (alignMdiWindows ())); connect (openEditorAction, SIGNAL (triggered ()), this, SLOT (openEditor ())); + connect (openChatAction, SIGNAL (triggered ()), this, SLOT (openChat ())); connect (reportBugAction, SIGNAL (triggered ()), this, SLOT (openBugTrackerPage ())); connect (agoraAction, SIGNAL (triggered ()), this, SLOT (openAgoraPage ())); connect (octaveForgeAction, SIGNAL (triggered ()), this, SLOT (openOctaveForgePage ()));
--- a/gui/src/MainWindow.h +++ b/gui/src/MainWindow.h @@ -87,11 +87,11 @@ void handleOpenFileRequest (QString fileName); void reportStatusMessage (QString statusMessage); void openWebPage (QString url); + void openChat (); void handleSaveWorkspaceRequest (); void handleLoadWorkspaceRequest (); void handleClearWorkspaceRequest (); void handleCommandDoubleClicked (QString command); - void handleUnreadMessages (bool yes); void alignMdiWindows (); void openEditor (); void openEditorFile (QString fileName); @@ -119,7 +119,6 @@ NonClosableMdiSubWindow *m_terminalViewSubWindow; NonClosableMdiSubWindow *m_documentationWidgetSubWindow; - NonClosableMdiSubWindow *m_ircWidgetSubWindow; // Dock widgets. WorkspaceView *m_workspaceView;
--- a/gui/src/SettingsDialog.cpp +++ b/gui/src/SettingsDialog.cpp @@ -26,11 +26,6 @@ ui->setupUi (this); QSettings *settings = ResourceManager::instance ()->settings (); - ui->connectOnStartup->setChecked (settings->value ("connectOnStartup").toBool ()); - ui->showMessageOfTheDay->setChecked (settings->value ("showMessageOfTheDay").toBool ()); - ui->showTopic->setChecked (settings->value ("showTopic").toBool ()); - ui->autoIdentification->setChecked (settings->value ("autoIdentification").toBool ()); - ui->nickServPassword->setText (settings->value ("nickServPassword").toString ()); ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor").toBool ()); ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () ); @@ -91,11 +86,6 @@ SettingsDialog::~SettingsDialog () { QSettings *settings = ResourceManager::instance ()->settings (); - settings->setValue ("connectOnStartup", ui->connectOnStartup->isChecked ()); - settings->setValue ("showMessageOfTheDay", ui->showMessageOfTheDay->isChecked ()); - settings->setValue ("showTopic", ui->showTopic->isChecked ()); - settings->setValue ("autoIdentification", ui->autoIdentification->isChecked ()); - settings->setValue ("nickServPassword", ui->nickServPassword->text ()); settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); settings->setValue ("customFileEditor", ui->customFileEditor->text ()); settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ());
--- a/gui/src/SettingsDialog.ui +++ b/gui/src/SettingsDialog.ui @@ -415,105 +415,6 @@ </item> </layout> </widget> - <widget class="QWidget" name="chatTab"> - <attribute name="title"> - <string>Chat</string> - </attribute> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QCheckBox" name="connectOnStartup"> - <property name="text"> - <string>Connect to #octave on startup</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="showMessageOfTheDay"> - <property name="text"> - <string>Show message of the day</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="showTopic"> - <property name="text"> - <string>Show topic</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="autoIdentification"> - <property name="text"> - <string>Automatically identify on NickServ</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <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="QLabel" name="label"> - <property name="text"> - <string>Password:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="nickServPassword"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item row="1" column="0"> - <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> </item> </layout> @@ -521,34 +422,50 @@ <resources/> <connections> <connection> - <sender>useCustomFileEditor</sender> + <sender>useProxyServer</sender> <signal>toggled(bool)</signal> - <receiver>customFileEditor</receiver> + <receiver>label_4</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>111</x> - <y>62</y> + <x>249</x> + <y>59</y> </hint> <hint type="destinationlabel"> - <x>343</x> - <y>63</y> + <x>69</x> + <y>122</y> </hint> </hints> </connection> <connection> - <sender>autoIdentification</sender> + <sender>useProxyServer</sender> <signal>toggled(bool)</signal> - <receiver>nickServPassword</receiver> + <receiver>label_3</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>261</x> - <y>139</y> + <x>249</x> + <y>59</y> </hint> <hint type="destinationlabel"> - <x>384</x> - <y>229</y> + <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> @@ -601,9 +518,25 @@ </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_3</receiver> + <receiver>label_7</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> @@ -611,40 +544,40 @@ <y>59</y> </hint> <hint type="destinationlabel"> - <x>59</x> - <y>91</y> + <x>67</x> + <y>212</y> </hint> </hints> </connection> <connection> - <sender>useProxyServer</sender> + <sender>editor_showLineNumbers</sender> <signal>toggled(bool)</signal> - <receiver>label_4</receiver> + <receiver>editor_showLineNumbers</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> <x>249</x> - <y>59</y> + <y>87</y> </hint> <hint type="destinationlabel"> - <x>69</x> - <y>122</y> + <x>249</x> + <y>87</y> </hint> </hints> </connection> <connection> - <sender>useProxyServer</sender> + <sender>editor_highlightCurrentLine</sender> <signal>toggled(bool)</signal> - <receiver>label_5</receiver> + <receiver>editor_highlightCurrentLine</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> <x>249</x> - <y>59</y> + <y>112</y> </hint> <hint type="destinationlabel"> - <x>44</x> - <y>152</y> + <x>249</x> + <y>112</y> </hint> </hints> </connection> @@ -697,54 +630,6 @@ </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>editor_showLineNumbers</sender> - <signal>toggled(bool)</signal> - <receiver>editor_showLineNumbers</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>249</x> - <y>87</y> - </hint> - <hint type="destinationlabel"> - <x>249</x> - <y>87</y> - </hint> - </hints> - </connection> - <connection> - <sender>editor_highlightCurrentLine</sender> - <signal>toggled(bool)</signal> - <receiver>editor_highlightCurrentLine</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>249</x> - <y>112</y> - </hint> - <hint type="destinationlabel"> - <x>249</x> - <y>112</y> - </hint> - </hints> - </connection> - <connection> <sender>editor_codeCompletion</sender> <signal>toggled(bool)</signal> <receiver>editor_codeCompletion</receiver>