mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 20:56:51 +00:00
Import/Export backend prep
This commit is contained in:
@ -22,8 +22,10 @@ import (
|
||||
"github.com/0xAX/notificator"
|
||||
"github.com/ProtonMail/proton-bridge/internal/bridge"
|
||||
"github.com/ProtonMail/proton-bridge/internal/frontend/cli"
|
||||
cliie "github.com/ProtonMail/proton-bridge/internal/frontend/cli-ie"
|
||||
"github.com/ProtonMail/proton-bridge/internal/frontend/qt"
|
||||
"github.com/ProtonMail/proton-bridge/internal/frontend/types"
|
||||
"github.com/ProtonMail/proton-bridge/internal/importexport"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/config"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/listener"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -86,3 +88,37 @@ func new(
|
||||
return qt.New(version, buildVersion, showWindowOnStart, panicHandler, config, preferences, eventListener, updates, bridge, noEncConfirmator)
|
||||
}
|
||||
}
|
||||
|
||||
// NewImportExport returns initialized frontend based on `frontendType`, which can be `cli` or `qt`.
|
||||
func NewImportExport(
|
||||
version,
|
||||
buildVersion,
|
||||
frontendType string,
|
||||
panicHandler types.PanicHandler,
|
||||
config *config.Config,
|
||||
eventListener listener.Listener,
|
||||
updates types.Updater,
|
||||
ie *importexport.ImportExport,
|
||||
) Frontend {
|
||||
ieWrap := types.NewImportExportWrap(ie)
|
||||
return newImportExport(version, buildVersion, frontendType, panicHandler, config, eventListener, updates, ieWrap)
|
||||
}
|
||||
|
||||
func newImportExport(
|
||||
version,
|
||||
buildVersion,
|
||||
frontendType string,
|
||||
panicHandler types.PanicHandler,
|
||||
config *config.Config,
|
||||
eventListener listener.Listener,
|
||||
updates types.Updater,
|
||||
ie types.ImportExporter,
|
||||
) Frontend {
|
||||
switch frontendType {
|
||||
case "cli":
|
||||
return cliie.New(panicHandler, config, eventListener, updates, ie)
|
||||
default:
|
||||
return cliie.New(panicHandler, config, eventListener, updates, ie)
|
||||
//return qt.New(panicHandler, config, eventListener, updates, ie)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user