Rabbit Remote Control 0.1.0-bate10
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
COperateSftpServer Class Reference
Inheritance diagram for COperateSftpServer:
Inheritance graph
[legend]
Collaboration diagram for COperateSftpServer:
Collaboration graph
[legend]

Public Member Functions

 COperateSftpServer (CPlugin *plugin)
 
virtual CParameterSftpServerGetParameter () const
 Get parameter.
 
virtual const QString Name () override
 Name.
 
virtual const QString Description () override
 Description.
 
virtual const qint16 Version () const override
 
- Public Member Functions inherited from COperateServer
 COperateServer (CPlugin *plugin)
 
virtual QWidget * GetViewer () override
 Get Viewer.
 
virtual int Start () override
 Start.
 
virtual int Stop () override
 Stop.
 
- Public Member Functions inherited from COperate
 COperate (CPlugin *plugin)
 
virtual int OpenDialogSettings (QWidget *parent=nullptr)
 Open settings dialog.
 
virtual QMenu * GetMenu (QWidget *parent=nullptr)
 Get menu.
 
virtual const QString Id ()
 
virtual const QString Protocol () const
 
virtual const QIcon Icon () const
 
virtual const QString GetTypeName () const
 
virtual QString GetSettingsFile ()
 
virtual int SetSettingsFile (const QString &szFile)
 
virtual CStatsGetStats ()
 Get statistics.
 
virtual CSecurityLevel::Levels GetSecurityLevel () const
 Get Security Level.
 

Protected Member Functions

virtual int SetPluginParameters (CParameterPlugin *pPara) override
 Apply the parameters of the plug-in.
 
virtual Q_INVOKABLE CBackendInstanceBackend ()
 New CBackend.
 
virtual int Initial () override
 Initial parameters and resource.
 
virtual int Clean () override
 Clean parameters and resource.
 
virtual int Load (QSettings &set) override
 Load parameters.
 
virtual int Save (QSettings &set) override
 Save parameters.
 
- Protected Member Functions inherited from COperate
Q_INVOKABLE CPluginGetPlugin () const
 Get plugin.
 
virtual Q_INVOKABLE int Load (QString szFile=QString())
 Load parameters from file.
 
virtual Q_INVOKABLE int Save (QString szFile=QString())
 Save parameters to file.
 

Private Member Functions

virtual QDialog * OnOpenDialogSettings (QWidget *parent) override
 Open settgins dialog.
 

Private Attributes

CParameterSftpServerm_pPara
 

Additional Inherited Members

- Signals inherited from COperate
void sigViewerFocusIn (QWidget *pView)
 The view is focus.
 
void sigFullScreen (bool bFullScreen)
 Full screen.
 
void sigUpdateName (const QString &szName)
 
void sigUpdateParameters (COperate *pOperate)
 Update parameters, notify application to save or show parameters.
 
void sigError (const int nError, const QString &szError)
 Triggered when an error is generated.
 
void sigInformation (const QString &szInfo)
 Show information in main windows.
 
void sigShowMessageBox (const QString &title, const QString &message, const QMessageBox::Icon &icon=QMessageBox::Information)
 Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread without blocking the background thread.
 
void sigClipBoardChanged ()
 
void sigSecurityLevel ()
 Triggered when the security level changes.
 
void sigRunning ()
 Start success signal.
 
void sigStop ()
 Notify the user to stop.
 
void sigFinished ()
 Successful disconnection signal.
 
- Protected Slots inherited from COperate
void slotUpdateName ()
 
void slotSetSecurityLevel (CSecurityLevel::Levels level)
 
- Static Protected Member Functions inherited from COperate
static QObject * createObject (const QString &className, QObject *parent=NULL)
 Create Object.
 
- Protected Attributes inherited from COperate
QMenu m_Menu
 
QAction * m_pActionSettings
 

Detailed Description

Definition at line 9 of file OperateSftpServer.h.

Constructor & Destructor Documentation

◆ ~COperateSftpServer()

COperateSftpServer::~COperateSftpServer ( )
virtual

Definition at line 18 of file OperateSftpServer.cpp.

Member Function Documentation

◆ Clean()

int COperateSftpServer::Clean ( )
overrideprotectedvirtual

Clean parameters and resource.

See also
CManager::DeleteOperate

Reimplemented from COperateServer.

Definition at line 144 of file OperateSftpServer.cpp.

◆ Description()

const QString COperateSftpServer::Description ( )
overridevirtual

Description.

{
QString szDescription;
if(!Name().isEmpty())
szDescription = tr("Name: ") + Name() + "\n";
if(!GetTypeName().isEmpty())
szDescription += tr("Type: ") + GetTypeName() + "\n";
if(!Protocol().isEmpty()) {
szDescription += tr("Protocol: ") + Protocol();
#ifdef DEBUG
if(!GetPlugin()->DisplayName().isEmpty())
szDescription += " - " + GetPlugin()->DisplayName();
#endif
szDescription += "\n";
}
if(!ServerName().isEmpty())
szDescription += tr("Server name: ") + ServerName() + "\n";
if(GetParameter()) {
if(!GetParameter()->m_Net.GetHost().isEmpty())
szDescription += tr("Server address: ") + GetParameter()->m_Net.GetHost() + ":"
+ QString::number(GetParameter()->m_Net.GetPort()) + "\n";
QString szProxy(tr("Proxy") + " ");
auto &proxy = GetParameter()->m_Proxy;
switch(proxy.GetUsedType()) {
case CParameterProxy::TYPE::SSHTunnel:
{
auto &sshNet = proxy.m_SSH.m_Net;
szProxy += "(" + tr("SSH tunnel") + "): " + sshNet.GetHost() + ":"
+ QString::number(sshNet.GetPort());
break;
}
case CParameterProxy::TYPE::SockesV5:
{
auto &sockesV5 = proxy.m_SockesV5;
szProxy += "(" + tr("Sockes v5") + "): " + sockesV5.GetHost() + ":"
+ QString::number(sockesV5.GetPort());
break;
}
default:
szProxy.clear();
break;
}
if(!szProxy.isEmpty())
szDescription += szProxy + "\n";
}
if(!(GetSecurityLevel() & CSecurityLevel::Level::No)) {
szDescription += tr("Security level: ");
if(!sl.GetUnicodeIcon().isEmpty())
szDescription += sl.GetUnicodeIcon() + " ";
szDescription += sl.GetString() + "\n";
}
if(!GetPlugin()->Description().isEmpty())
szDescription += tr("Description: ") + GetPlugin()->Description();
return szDescription;
}
virtual const QString Description() override
[The name of the desktop operate]
virtual const QString Name() override
Name.
virtual CParameterSftpServer * GetParameter() const
Get parameter.
virtual const QString Description() override
Description.
virtual CSecurityLevel::Levels GetSecurityLevel() const
Get Security Level.
Definition Operate.cpp:129
Q_INVOKABLE CPlugin * GetPlugin() const
Get plugin.
Definition Operate.cpp:221
virtual const QString DisplayName() const
The plugin display name.
Definition Plugin.cpp:76
virtual const QString Description() const =0
Plugin description.
Security level.
Definition Stats.h:97
See also
COperateDesktop::Description()

Reimplemented from COperate.

Definition at line 59 of file OperateSftpServer.cpp.

◆ GetParameter()

CParameterSftpServer * COperateSftpServer::GetParameter ( ) const
virtual

Get parameter.

Definition at line 30 of file OperateSftpServer.cpp.

◆ Initial()

int COperateSftpServer::Initial ( )
overrideprotectedvirtual

Initial parameters and resource.

Note
Call before Load()
See also
CManager::CreateOperate Load

Reimplemented from COperateServer.

Definition at line 133 of file OperateSftpServer.cpp.

◆ InstanceBackend()

CBackend * COperateSftpServer::InstanceBackend ( )
protectedvirtual

New CBackend.

the ownership is caller. if don't use, the caller must delete it.

Implements COperateServer.

Definition at line 96 of file OperateSftpServer.cpp.

◆ Load()

int COperateSftpServer::Load ( QSettings &  set)
overrideprotectedvirtual

Load parameters.

Implements COperate.

Definition at line 117 of file OperateSftpServer.cpp.

◆ Name()

const QString COperateSftpServer::Name ( )
overridevirtual

Name.

const QString COperateDesktop::Name()
{
QString szName;
// Show the name of parameter
if(GetParameter() && !(GetParameter()->GetName().isEmpty()))
szName += GetParameter()->GetName();
else {
// Show the prefix of protocol
if(GetParameter() && GetParameter()->GetPluginParameters()
&& (GetParameter()->GetPluginParameters()->GetNameStyles()
& CParameterPlugin::NameStyle::Protocol)
&& !Protocol().isEmpty())
szName = Protocol() + ": ";
// Show the server name
szName += ServerName();
}
if(szName.isEmpty())
szName = GetPlugin()->Name();
// Show the prefix of security level
QString szSecurityLevel;
if((GetParameter()->GetPluginParameters()->GetNameStyles()
& CParameterPlugin::NameStyle::SecurityLevel)
&& !(GetSecurityLevel() & CSecurityLevel::Level::No)
&& !sl.GetUnicodeIcon().isEmpty())
szSecurityLevel = sl.GetUnicodeIcon().left(2);
return szSecurityLevel + szName;
}
virtual const QString Name() override
[The name of the desktop operate]
virtual const QString Name() const =0
This name must be the same as the project name (${PROJECT_NAME}). The translation file (${PROJECT_NAM...
See also
COperateDesktop::Name()

Reimplemented from COperate.

Definition at line 35 of file OperateSftpServer.cpp.

◆ OnOpenDialogSettings()

QDialog * COperateSftpServer::OnOpenDialogSettings ( QWidget *  parent)
overrideprivatevirtual

Open settgins dialog.

Parameters
parentthe parent windows of the dialog of return
Returns
QDialog*: then QDialog must be allocated in heap memory, the ownership is caller.
See also
OpenDialogSettings

Implements COperate.

Definition at line 112 of file OperateSftpServer.cpp.

◆ Save()

int COperateSftpServer::Save ( QSettings &  set)
overrideprotectedvirtual

Save parameters.

Implements COperate.

Definition at line 125 of file OperateSftpServer.cpp.

◆ SetPluginParameters()

int COperateSftpServer::SetPluginParameters ( CParameterPlugin pPara)
overrideprotectedvirtual

Apply the parameters of the plug-in.

Note
Call CParameterOperate::SetPluginParameters to set the global parameters for the operation parameters, and connect the signals related to the global parameters.
{
if(GetParameter()) {
GetParameter()->SetPluginParameters(pPara);
if(pPara) {
bool check = connect(pPara, SIGNAL(sigNameStylesChanged()),
this, SLOT(slotUpdateName()));
Q_ASSERT(check);
}
LoadAdaptWindows();
return 0;
} else {
QString szMsg = "There is not parameters! "
"please first create parameters, "
"then call SetParameter() in the ";
szMsg += metaObject()->className() + QString("::")
+ metaObject()->className();
szMsg += QString("() or ") + metaObject()->className()
+ QString("::") + "Initial()";
szMsg += " to set the parameters pointer. "
"Default set CParameterClient for the parameters of operate "
"(CParameterOperate or its derived classes) "
"See CManager::CreateOperate. "
"If you are sure the parameter of operate "
"does not need CParameterClient. "
"Please overload the SetPluginParameters() in the ";
szMsg += QString(metaObject()->className()) + " . don't set it";
qCritical(log) << szMsg.toStdString().c_str();
Q_ASSERT(false);
}
return -1;
}
virtual int SetPluginParameters(CParameterPlugin *pPara) override
Set Global Parameters.
Global parameters of plugins.
See also
CManager::CreateOperate CParameterPlugin

Implements COperate.

Definition at line 101 of file OperateSftpServer.cpp.

◆ Version()

const qint16 COperateSftpServer::Version ( ) const
overridevirtual

Implements COperate.

Definition at line 91 of file OperateSftpServer.cpp.

Member Data Documentation

◆ m_pPara

CParameterSftpServer* COperateSftpServer::m_pPara
private

Definition at line 39 of file OperateSftpServer.h.


The documentation for this class was generated from the following files: