*Fixed settingdialog to disable server tab when server is running.
return (*this);
}
bool tcpClient::check_byte_written_and_wait_written(){
- if(want_disconnect) return false;
+ if(this->want_disconnect) return false;
if(!this->waitForBytesWritten(this->timeout_time)){
this->setErrorString(tr("The data couldn't be written."));
emit this->error(QAbstractSocket::UnknownSocketError);
}
bool tcpClient::check_connection_and_wait_connected(){
- if(want_disconnect) return false;
+ if(this->want_disconnect) return false;
if(this->state()!=QAbstractSocket::ConnectingState||this->state()!=QAbstractSocket::ConnectedState){
this->setErrorString(tr("This socket haven't connected to somewhere yet."));
emit this->error(QAbstractSocket::SocketAccessError);
return true;
}
bool tcpClient::check_and_wait_byte_available(){
+ if(this->want_disconnect) return false;
if(!this->waitForReadyRead(this->timeout_time)){
this->setErrorString(tr("The data couldn't be read."));
emit this->error(QAbstractSocket::UnknownSocketError);
#include<QtNetwork>
#define default_port 10630
+
#define default_memberlist qApp->applicationDirPath().append("/memberlist.jsm")
#define default_setting qApp->applicationDirPath().append("/setting.jst")
#define default_status_interval 3000
+#define default_buffer_size 1024
typedef QPair<QHostAddress,quint16> AddressAndPort;
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
- <variable>RunConfiguration0-BaseEnvironmentBase</variable>
- <value type="int">2</value>
- </data>
- <data>
- <variable>RunConfiguration0-CommandLineArguments</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-ProFile</variable>
- <value type="QString">jasmine.pro</value>
- </data>
- <data>
- <variable>RunConfiguration0-RunConfiguration.name</variable>
- <value type="QString">jasmine</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseDyldImageSuffix</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseTerminal</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserEnvironmentChanges</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetName</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserWorkingDirectory</variable>
- <value type="QString"></value>
- </data>
- <data>
- <variable>RunConfiguration0-type</variable>
- <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- </data>
- <data>
- <variable>activeRunConfiguration</variable>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
- <variable>activebuildconfiguration</variable>
- <value type="QString">Release</value>
- </data>
- <data>
- <variable>buildConfiguration-Release</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <value key="QtVersionId" type="int">2</value>
- <value key="ToolChain" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">0</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wgDBvzCe3u,guid=4c56e712291a8f6fcf95c62a0000002e</value>
- <value type="QString">DESKTOP_SESSION=default</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
- <value type="QString">GPG_AGENT_INFO=/tmp/gpg-MCQppK/S.gpg-agent:1871:1</value>
- <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
- <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
- <value type="QString">GTK_IM_MODULE=uim</value>
- <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
- <value type="QString">G_BROKEN_FILENAMES=1</value>
- <value type="QString">HISTCONTROL=erasedups</value>
- <value type="QString">HISTSIZE=1000</value>
- <value type="QString">HOME=/home/hyamamoto</value>
- <value type="QString">INPUTRC=/etc/inputrc</value>
- <value type="QString">KDE_FULL_SESSION=true</value>
- <value type="QString">KDE_MULTIHEAD=false</value>
- <value type="QString">KDE_SESSION_UID=500</value>
- <value type="QString">KDE_SESSION_VERSION=4</value>
- <value type="QString">LANG=en_US.UTF-8</value>
- <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
- <value type="QString">LESS=-R</value>
- <value type="QString">LOGNAME=hyamamoto</value>
- <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
- <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
- <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
- <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
- <value type="QString">PS3=> </value>
- <value type="QString">PS4=+ </value>
- <value type="QString">PWD=/home/hyamamoto/Documents</value>
- <value type="QString">QTDIR=/usr/share/qt</value>
- <value type="QString">QT_IM_MODULE=uim</value>
- <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
- <value type="QString">QT_XFT=true</value>
- <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1912,unix/localhost:/tmp/.ICE-unix/1912</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=1</value>
- <value type="QString">SSH_AGENT_PID=1874</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-SeeMhG1873/agent.1873</value>
- <value type="QString">USER=hyamamoto</value>
- <value type="QString">WINDOWPATH=7</value>
- <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
- <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
- <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
- <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
- <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
- <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
- <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1283300523.896579-1238674667</value>
- <value type="QString">XDM_MANAGED=method=classic</value>
- <value type="QString">XMODIFIERS=@im=uim</value>
- </valuelist>
- <valuelist key="abstractProcess.arguments" type="QVariantList">
- <value type="QString">/home/hyamamoto/Documents/Workspace/jasmine/jasmine.pro</value>
- <value type="QString">-spec</value>
- <value type="QString">linux-g++-64</value>
- <value type="QString">-r</value>
- </valuelist>
- <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
- <value key="abstractProcess.enabled" type="bool">false</value>
- <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep1</variable>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wgDBvzCe3u,guid=4c56e712291a8f6fcf95c62a0000002e</value>
- <value type="QString">DESKTOP_SESSION=default</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
- <value type="QString">GPG_AGENT_INFO=/tmp/gpg-MCQppK/S.gpg-agent:1871:1</value>
- <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
- <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
- <value type="QString">GTK_IM_MODULE=uim</value>
- <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
- <value type="QString">G_BROKEN_FILENAMES=1</value>
- <value type="QString">HISTCONTROL=erasedups</value>
- <value type="QString">HISTSIZE=1000</value>
- <value type="QString">HOME=/home/hyamamoto</value>
- <value type="QString">INPUTRC=/etc/inputrc</value>
- <value type="QString">KDE_FULL_SESSION=true</value>
- <value type="QString">KDE_MULTIHEAD=false</value>
- <value type="QString">KDE_SESSION_UID=500</value>
- <value type="QString">KDE_SESSION_VERSION=4</value>
- <value type="QString">LANG=en_US.UTF-8</value>
- <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
- <value type="QString">LESS=-R</value>
- <value type="QString">LOGNAME=hyamamoto</value>
- <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
- <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
- <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
- <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
- <value type="QString">PS3=> </value>
- <value type="QString">PS4=+ </value>
- <value type="QString">PWD=/home/hyamamoto/Documents</value>
- <value type="QString">QTDIR=/usr/share/qt</value>
- <value type="QString">QT_IM_MODULE=uim</value>
- <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
- <value type="QString">QT_XFT=true</value>
- <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1912,unix/localhost:/tmp/.ICE-unix/1912</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=1</value>
- <value type="QString">SSH_AGENT_PID=1874</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-SeeMhG1873/agent.1873</value>
- <value type="QString">USER=hyamamoto</value>
- <value type="QString">WINDOWPATH=7</value>
- <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
- <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
- <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
- <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
- <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
- <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
- <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1283300523.896579-1238674667</value>
- <value type="QString">XDM_MANAGED=method=classic</value>
- <value type="QString">XMODIFIERS=@im=uim</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
- <valuelist key="abstractProcess.arguments" type="QVariantList">
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled" type="bool">true</value>
- <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
+ <value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
- <variable>buildconfiguration-Release-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-j0qHTciaiV,guid=79c313af903c5a3357a12e9a0000001e</value>
- <value type="QString">DESKTOP_SESSION=default</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
- <value type="QString">GPG_AGENT_INFO=/tmp/gpg-WoUHSX/S.gpg-agent:1860:1</value>
- <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
- <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
- <value type="QString">GTK_IM_MODULE=uim</value>
- <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
- <value type="QString">G_BROKEN_FILENAMES=1</value>
- <value type="QString">HISTCONTROL=erasedups</value>
- <value type="QString">HISTSIZE=1000</value>
- <value type="QString">HOME=/home/hyamamoto</value>
- <value type="QString">INPUTRC=/etc/inputrc</value>
- <value type="QString">KDE_FULL_SESSION=true</value>
- <value type="QString">KDE_MULTIHEAD=false</value>
- <value type="QString">KDE_SESSION_UID=500</value>
- <value type="QString">KDE_SESSION_VERSION=4</value>
- <value type="QString">LANG=en_US.UTF-8</value>
- <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
- <value type="QString">LESS=-R</value>
- <value type="QString">LOGNAME=hyamamoto</value>
- <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
- <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
- <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
- <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
- <value type="QString">PS3=> </value>
- <value type="QString">PS4=+ </value>
- <value type="QString">PWD=/home/hyamamoto/Documents</value>
- <value type="QString">QTDIR=/usr/share/qt</value>
- <value type="QString">QT_IM_MODULE=uim</value>
- <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
- <value type="QString">QT_XFT=true</value>
- <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1904,unix/localhost:/tmp/.ICE-unix/1904</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=1</value>
- <value type="QString">SSH_AGENT_PID=1865</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-MOqihy1862/agent.1862</value>
- <value type="QString">USER=hyamamoto</value>
- <value type="QString">WINDOWPATH=7</value>
- <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
- <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
- <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
- <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
- <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
- <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
- <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1282952255.881690-2042795028</value>
- <value type="QString">XDM_MANAGED=method=classic</value>
- <value type="QString">XMODIFIERS=@im=uim</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
- <valuelist key="abstractProcess.arguments" type="QVariantList">
- <value type="QString">clean</value>
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled" type="bool">true</value>
- <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- </valuemap>
- </data>
- <data>
- <variable>buildconfigurations</variable>
- <valuelist type="QVariantList">
- <value type="QString">Release</value>
- </valuelist>
- </data>
- <data>
- <variable>buildstep0</variable>
+ <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="mkspec" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">1</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">jasmine</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">jasmine.pro</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
</data>
<data>
- <variable>buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildsteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.qmake</value>
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="clean" type="bool">true</value>
- </valuemap>
- </data>
- <data>
- <variable>cleansteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>defaultFileEncoding</variable>
- <value type="QByteArray">System</value>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="int">1</value>
</data>
<data>
- <variable>project</variable>
- <valuemap type="QVariantMap"/>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">4</value>
</data>
</qtcreator>
--- /dev/null
+<!DOCTYPE QtCreatorProject>
+<qtcreator>
+ <data>
+ <variable>RunConfiguration0-BaseEnvironmentBase</variable>
+ <value type="int">2</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-CommandLineArguments</variable>
+ <valuelist type="QVariantList"/>
+ </data>
+ <data>
+ <variable>RunConfiguration0-ProFile</variable>
+ <value type="QString">jasmine.pro</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-RunConfiguration.name</variable>
+ <value type="QString">jasmine</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UseDyldImageSuffix</variable>
+ <value type="bool">false</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UseTerminal</variable>
+ <value type="bool">false</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UserEnvironmentChanges</variable>
+ <valuelist type="QVariantList"/>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UserSetName</variable>
+ <value type="bool">false</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
+ <value type="bool">false</value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-UserWorkingDirectory</variable>
+ <value type="QString"></value>
+ </data>
+ <data>
+ <variable>RunConfiguration0-type</variable>
+ <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ </data>
+ <data>
+ <variable>activeRunConfiguration</variable>
+ <value type="int">0</value>
+ </data>
+ <data>
+ <variable>activebuildconfiguration</variable>
+ <value type="QString">Release</value>
+ </data>
+ <data>
+ <variable>buildConfiguration-Release</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
+ <value key="QtVersionId" type="int">2</value>
+ <value key="ToolChain" type="int">0</value>
+ <value key="addQDumper" type=""></value>
+ <value key="buildConfiguration" type="int">0</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildconfiguration-Release-buildstep0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment" type="QVariantList">
+ <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wgDBvzCe3u,guid=4c56e712291a8f6fcf95c62a0000002e</value>
+ <value type="QString">DESKTOP_SESSION=default</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
+ <value type="QString">GPG_AGENT_INFO=/tmp/gpg-MCQppK/S.gpg-agent:1871:1</value>
+ <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
+ <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
+ <value type="QString">GTK_IM_MODULE=uim</value>
+ <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
+ <value type="QString">G_BROKEN_FILENAMES=1</value>
+ <value type="QString">HISTCONTROL=erasedups</value>
+ <value type="QString">HISTSIZE=1000</value>
+ <value type="QString">HOME=/home/hyamamoto</value>
+ <value type="QString">INPUTRC=/etc/inputrc</value>
+ <value type="QString">KDE_FULL_SESSION=true</value>
+ <value type="QString">KDE_MULTIHEAD=false</value>
+ <value type="QString">KDE_SESSION_UID=500</value>
+ <value type="QString">KDE_SESSION_VERSION=4</value>
+ <value type="QString">LANG=en_US.UTF-8</value>
+ <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
+ <value type="QString">LESS=-R</value>
+ <value type="QString">LOGNAME=hyamamoto</value>
+ <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
+ <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
+ <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
+ <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
+ <value type="QString">PS3=> </value>
+ <value type="QString">PS4=+ </value>
+ <value type="QString">PWD=/home/hyamamoto/Documents</value>
+ <value type="QString">QTDIR=/usr/share/qt</value>
+ <value type="QString">QT_IM_MODULE=uim</value>
+ <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
+ <value type="QString">QT_XFT=true</value>
+ <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1912,unix/localhost:/tmp/.ICE-unix/1912</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=1</value>
+ <value type="QString">SSH_AGENT_PID=1874</value>
+ <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-SeeMhG1873/agent.1873</value>
+ <value type="QString">USER=hyamamoto</value>
+ <value type="QString">WINDOWPATH=7</value>
+ <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
+ <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
+ <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
+ <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
+ <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
+ <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
+ <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1283300523.896579-1238674667</value>
+ <value type="QString">XDM_MANAGED=method=classic</value>
+ <value type="QString">XMODIFIERS=@im=uim</value>
+ </valuelist>
+ <valuelist key="abstractProcess.arguments" type="QVariantList">
+ <value type="QString">/home/hyamamoto/Documents/Workspace/jasmine/jasmine.pro</value>
+ <value type="QString">-spec</value>
+ <value type="QString">linux-g++-64</value>
+ <value type="QString">-r</value>
+ </valuelist>
+ <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
+ <value key="abstractProcess.enabled" type="bool">false</value>
+ <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildconfiguration-Release-buildstep1</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment" type="QVariantList">
+ <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wgDBvzCe3u,guid=4c56e712291a8f6fcf95c62a0000002e</value>
+ <value type="QString">DESKTOP_SESSION=default</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
+ <value type="QString">GPG_AGENT_INFO=/tmp/gpg-MCQppK/S.gpg-agent:1871:1</value>
+ <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
+ <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
+ <value type="QString">GTK_IM_MODULE=uim</value>
+ <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
+ <value type="QString">G_BROKEN_FILENAMES=1</value>
+ <value type="QString">HISTCONTROL=erasedups</value>
+ <value type="QString">HISTSIZE=1000</value>
+ <value type="QString">HOME=/home/hyamamoto</value>
+ <value type="QString">INPUTRC=/etc/inputrc</value>
+ <value type="QString">KDE_FULL_SESSION=true</value>
+ <value type="QString">KDE_MULTIHEAD=false</value>
+ <value type="QString">KDE_SESSION_UID=500</value>
+ <value type="QString">KDE_SESSION_VERSION=4</value>
+ <value type="QString">LANG=en_US.UTF-8</value>
+ <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
+ <value type="QString">LESS=-R</value>
+ <value type="QString">LOGNAME=hyamamoto</value>
+ <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
+ <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
+ <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
+ <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
+ <value type="QString">PS3=> </value>
+ <value type="QString">PS4=+ </value>
+ <value type="QString">PWD=/home/hyamamoto/Documents</value>
+ <value type="QString">QTDIR=/usr/share/qt</value>
+ <value type="QString">QT_IM_MODULE=uim</value>
+ <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
+ <value type="QString">QT_XFT=true</value>
+ <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1912,unix/localhost:/tmp/.ICE-unix/1912</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=1</value>
+ <value type="QString">SSH_AGENT_PID=1874</value>
+ <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-SeeMhG1873/agent.1873</value>
+ <value type="QString">USER=hyamamoto</value>
+ <value type="QString">WINDOWPATH=7</value>
+ <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
+ <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
+ <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
+ <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
+ <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
+ <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
+ <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1283300523.896579-1238674667</value>
+ <value type="QString">XDM_MANAGED=method=classic</value>
+ <value type="QString">XMODIFIERS=@im=uim</value>
+ </valuelist>
+ <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
+ <valuelist key="abstractProcess.arguments" type="QVariantList">
+ <value type="QString">-w</value>
+ </valuelist>
+ <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
+ <value key="abstractProcess.enabled" type="bool">true</value>
+ <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildconfiguration-Release-cleanstep0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment" type="QVariantList">
+ <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-j0qHTciaiV,guid=79c313af903c5a3357a12e9a0000001e</value>
+ <value type="QString">DESKTOP_SESSION=default</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
+ <value type="QString">GPG_AGENT_INFO=/tmp/gpg-WoUHSX/S.gpg-agent:1860:1</value>
+ <value type="QString">GS_LIB=/home/hyamamoto/.fonts</value>
+ <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/hyamamoto/.gtkrc-2.0:/home/hyamamoto/.gtkrc-2.0-kde4:/home/hyamamoto/.kde4/share/config/gtkrc-2.0</value>
+ <value type="QString">GTK_IM_MODULE=uim</value>
+ <value type="QString">GTK_RC_FILES=/etc/gtk/gtkrc:/home/hyamamoto/.gtkrc::/home/hyamamoto/.kde4/share/config/gtkrc</value>
+ <value type="QString">G_BROKEN_FILENAMES=1</value>
+ <value type="QString">HISTCONTROL=erasedups</value>
+ <value type="QString">HISTSIZE=1000</value>
+ <value type="QString">HOME=/home/hyamamoto</value>
+ <value type="QString">INPUTRC=/etc/inputrc</value>
+ <value type="QString">KDE_FULL_SESSION=true</value>
+ <value type="QString">KDE_MULTIHEAD=false</value>
+ <value type="QString">KDE_SESSION_UID=500</value>
+ <value type="QString">KDE_SESSION_VERSION=4</value>
+ <value type="QString">LANG=en_US.UTF-8</value>
+ <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
+ <value type="QString">LESS=-R</value>
+ <value type="QString">LOGNAME=hyamamoto</value>
+ <value type="QString">MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins</value>
+ <value type="QString">OOO_FORCE_DESKTOP=gnome</value>
+ <value type="QString">PATH=/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/lib/perl5/core_perl/bin:/opt/qt/bin</value>
+ <value type="QString">PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/qt/lib/pkgconfig</value>
+ <value type="QString">PS3=> </value>
+ <value type="QString">PS4=+ </value>
+ <value type="QString">PWD=/home/hyamamoto/Documents</value>
+ <value type="QString">QTDIR=/usr/share/qt</value>
+ <value type="QString">QT_IM_MODULE=uim</value>
+ <value type="QString">QT_PLUGIN_PATH=/home/hyamamoto/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/</value>
+ <value type="QString">QT_XFT=true</value>
+ <value type="QString">SESSION_MANAGER=local/localhost:@/tmp/.ICE-unix/1904,unix/localhost:/tmp/.ICE-unix/1904</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=1</value>
+ <value type="QString">SSH_AGENT_PID=1865</value>
+ <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-MOqihy1862/agent.1862</value>
+ <value type="QString">USER=hyamamoto</value>
+ <value type="QString">WINDOWPATH=7</value>
+ <value type="QString">XCURSOR_THEME=Oxygen_Black</value>
+ <value type="QString">XDG_CACHE_HOME=/home/hyamamoto/.cache</value>
+ <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
+ <value type="QString">XDG_CONFIG_HOME=/home/hyamamoto/.config</value>
+ <value type="QString">XDG_DATA_DIRS=/usr/share:/usr/local/share</value>
+ <value type="QString">XDG_DATA_HOME=/home/hyamamoto/.local/share</value>
+ <value type="QString">XDG_SESSION_COOKIE=1bbef3181df319a5eeb3839a00000393-1282952255.881690-2042795028</value>
+ <value type="QString">XDM_MANAGED=method=classic</value>
+ <value type="QString">XMODIFIERS=@im=uim</value>
+ </valuelist>
+ <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
+ <valuelist key="abstractProcess.arguments" type="QVariantList">
+ <value type="QString">clean</value>
+ <value type="QString">-w</value>
+ </valuelist>
+ <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
+ <value key="abstractProcess.enabled" type="bool">true</value>
+ <value key="abstractProcess.workingDirectory" type="QString">/home/hyamamoto/Documents/Workspace/jasmine</value>
+ <value key="cleanConfig" type="bool">true</value>
+ <valuelist key="makeargs" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildconfigurations</variable>
+ <valuelist type="QVariantList">
+ <value type="QString">Release</value>
+ </valuelist>
+ </data>
+ <data>
+ <variable>buildstep0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
+ <value key="mkspec" type="QString"></value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildstep1</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>buildsteps</variable>
+ <valuelist type="QVariantList">
+ <value type="QString">trolltech.qt4projectmanager.qmake</value>
+ <value type="QString">trolltech.qt4projectmanager.make</value>
+ </valuelist>
+ </data>
+ <data>
+ <variable>cleanstep0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
+ <value key="clean" type="bool">true</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>cleansteps</variable>
+ <valuelist type="QVariantList">
+ <value type="QString">trolltech.qt4projectmanager.make</value>
+ </valuelist>
+ </data>
+ <data>
+ <variable>defaultFileEncoding</variable>
+ <value type="QByteArray">System</value>
+ </data>
+ <data>
+ <variable>project</variable>
+ <valuemap type="QVariantMap"/>
+ </data>
+</qtcreator>
#include <QPair>
using namespace structures;
+using namespace network;
mainWindow::mainWindow(){
setupUi(this);
- //I'll reimpletemt the format of this memberlist file...
- connect(this->sendFileButton,SIGNAL(clicked()),SLOT(on_sendFileAction_triggered()));
- memberFilters<<tr("Jasmine memberlist file(%1)").arg("*.jsm")<<tr("All file(%1)").arg("*");
- logFilters<<tr("Text file(%1)").arg("*.txt")<<tr("All file(%1)").arg("*");
- this->settingdialog=new SettingDialog(this);
- this->memberList=new MemberList(this);
+
+ this->settingdialog = new SettingDialog(this);
+ this->memberList = new MemberList(this);
+ this->sendTextEditor = new RtfEditor(this);
+
this->memberListPanel->addWidget(memberList);
- this->sendTextEditor=new RtfEditor(this);
this->sendPanel->insertWidget(0,this->sendTextEditor,this->receivePanel->stretch(0));
this->sendTextEditor->setFocus();
+
QWidget::setTabOrder(this->sendTextEditor,this->sendButton);
QWidget::setTabOrder(this->sendButton,this->sendFileButton);
QWidget::setTabOrder(this->sendFileButton,this->addButton);
QWidget::setTabOrder(this->removeButton,this->editButton);
QWidget::setTabOrder(this->editButton,this->receiveText);
- //These behaviors are not implemented.
+ //I'll reimpletemt the format of this memberlist file...
+ connect(this->sendFileButton,SIGNAL(clicked()),SLOT(on_sendFileAction_triggered()));
+ memberFilters<<tr("Jasmine memberlist file(%1)").arg("*.jsm")<<tr("All file(%1)").arg("*");
+ logFilters<<tr("Text file(%1)").arg("*.txt")<<tr("All file(%1)").arg("*");
+
+ /*//These behaviors are not implemented.
this->sendButton->setEnabled(false);
this->sendFileButton->setEnabled(false);
this->sendFileAction->setEnabled(false);
- this->runServerAction->setEnabled(false);
+ this->runServerAction->setEnabled(false);*/
+
+ this->mainServer=new tcpServer(default_buffer_size,this);
connect(this->receiveText,SIGNAL(anchorClicked(const QUrl &)),SLOT(linkClicked(const QUrl &)));
connect(this->receiveText,SIGNAL(highlighted(const QUrl &)),SLOT(selectedLink(const QUrl &)));
}
void mainWindow::showEvent(QShowEvent *event){
if(rev==0)
- this->status->showMessage("Don't forget almost all features are not implemented!");
+ this->status->showMessage("<font color=\"#ff0000\">Don't forget almost all features are not implemented!</font>",default_status_interval);
event->accept();
}
int mainWindow::isInMember(const AddressAndPort &peer){
}
void mainWindow::on_runServerAction_triggered(bool checked){
- //TODO:TcpServer
- Q_UNUSED(checked)
+ if(checked){
+ if(this->mainServer->isListening()) this->mainServer->close();
+ if(this->mainServer->listen(this->setting.bindingAddr(),this->setting.port())){
+ this->status->showMessage(server_running.arg(this->mainServer->serverAddress().toString()).arg(this->mainServer->serverPort()),default_status_interval);
+ this->serverSettingAction->setEnabled(false);
+ }
+ else this->mainServer->close();
+ }else{
+ if(!this->mainServer->isListening()) return;
+ this->mainServer->close();
+ this->status->showMessage(server_stopped,default_status_interval);
+ this->serverSettingAction->setEnabled(true);
+ }
}
void mainWindow::settingDialog_accepted(){
- if(!this->settingdialog->IPAddress().isNull())
- this->setting.setIPAddr(this->settingdialog->IPAddress());
- else
- QMessageBox::warning(this,invalid_IP_title,invalid_IP_body);
- this->setting.setPort(this->settingdialog->port());
+ if(!this->mainServer->isListening()){
+ if(!this->settingdialog->IPAddress().isNull())
+ this->setting.setIPAddr(this->settingdialog->IPAddress());
+ else
+ QMessageBox::warning(this,invalid_IP_title,invalid_IP_body);
+ this->setting.setPort(this->settingdialog->port());
+ }
this->setting.setName(this->settingdialog->nickName());
this->setting.setNoloadMemberList(this->settingdialog->noloadMemberlist());
}
void mainWindow::configAndShowSettingDialog(const SettingDialog::tab tab){
+ this->settingdialog->setTabEnabled(SettingDialog::server,!this->mainServer->isListening());
this->settingdialog->setAddressAndPort(AddressAndPort(this->setting.bindingAddr(),this->setting.port()));
this->settingdialog->setNickName(this->setting.name());
this->settingdialog->setNoloadMemberlist(this->setting.noloadMemberList());
}
void mainWindow::openMember(const QString &file){
/*
- It is doubtful that QFileDialog has a bug:
- If you select file by double clicking, fileSelected signal is emitted twice.
+ Does QFileDialog have a bug??
+ If you select file by double clicking, fileSelected signal will be emitted twice.
*/
if(this->sender()!=NULL&&this->sender()==this->beforesender) return;
this->beforesender=this->sender();
#include "rtfeditor.h"
#include "../settings.h"
#include "../validator/ipaddressvalidator.h"
+#include "../server/tcpserver.h"
using namespace structures;
+using namespace network;
class mainWindow:public QMainWindow,private Ui::MainWindow{
Q_OBJECT
void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *);
private:
- QObject *beforesender;
- MemberList *memberList;
- RtfEditor *sendTextEditor;
+ QObject *beforesender;
+ QStringList memberFilters,logFilters;
+
+ MemberList *memberList;
+ RtfEditor *sendTextEditor;
+ tcpServer *mainServer;
+ SettingDialog *settingdialog;
+ settings setting;
+
int isInMember(const AddressAndPort &);
void configAndShowSettingDialog(const SettingDialog::tab);
- SettingDialog *settingdialog;
- QStringList memberFilters,logFilters;
- settings setting;
public:
settings app_setting() const;
};
loadingSettingSucceeded_title(QObject::tr("Loading succeeded")),
loadingSettingSucceeded_body(QObject::tr("Loading settings: %1 has been succeeded.")),
- invalid_link(QObject::tr("Input link is not valid: %1"));
+ invalid_link(QObject::tr("Input link is not valid: %1")),
+ server_running(QObject::tr("Server is running now. (%1:%2)")),
+ server_stopped(QObject::tr("Server has been stopped."));
void SettingDialog::setNickName(const QString &name){this->nickName_control->setText(name);}
void SettingDialog::setIPAddress(const QHostAddress &address){this->address->setText(address.toString());}
void SettingDialog::setNoloadMemberlist(const bool yesno){this->no_load_memberlist->setChecked(yesno);}
-void SettingDialog::setTab(tab t){
- switch(t){
+void SettingDialog::setTab(const tab id){
+ switch(id){
case SettingDialog::server:
server:
this->settingTab->setCurrentIndex(0);
goto server;
}
}
+void SettingDialog::setTabEnabled(const tab id,bool enable){
+ switch(id){
+ case SettingDialog::server:
+ server:
+ this->settingTab->setTabEnabled(0,enable);
+ break;
+ case SettingDialog::client:
+ this->settingTab->setTabEnabled(1,enable);
+ break;
+ case SettingDialog::misc:
+ this->settingTab->setTabEnabled(2,enable);
+ break;
+ default:
+ goto server;
+ }
+}
void SettingDialog::setAddressAndPort(AddressAndPort pair){
this->setIPAddress(pair.first);
Q_OBJECT
public:
enum tab{server,client,misc};
- void setTab(tab t);
SettingDialog(QWidget *parent=NULL);
QHostAddress IPAddress()const;
quint16 port()const;
void setIPAddress(const QHostAddress &address);
void setNickName(const QString &);
void setNoloadMemberlist(const bool);
+ void setTab(const tab id);
+ void setTabEnabled(const tab id,bool enable);
};