Skip to content

Commit

Permalink
v1.04
Browse files Browse the repository at this point in the history
  • Loading branch information
syncore committed Jun 13, 2018
1 parent e0a06d0 commit 229f3ea
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/binary"
"fmt"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
)

type LauncherStore struct {
Expand Down
11 changes: 3 additions & 8 deletions settingscore.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"strings"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
)

type QCCoreSettings struct {
Expand Down Expand Up @@ -70,10 +70,7 @@ func (s *QCCoreSettings) save(ls *LauncherStore) error {
}

func (s *QCCoreSettings) decode(data, key []byte) error {
buf := bytes.NewBuffer(data)
dec := gob.NewDecoder(buf)
err := dec.Decode(&s)
if err != nil {
if err := gob.NewDecoder(bytes.NewBuffer(data)).Decode(&s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error decoding QC core settings data", GetCaller()), "error", err)
return err
}
Expand All @@ -94,7 +91,6 @@ func (s *QCCoreSettings) decode(data, key []byte) error {

func (s *QCCoreSettings) encode() ([]byte, error) {
buf := new(bytes.Buffer)
enc := gob.NewEncoder(buf)
encUser, err := encrypt(s.Username, tmpKey)
if err != nil {
logger.Errorw(fmt.Sprintf("%s: error encrypting username credential", GetCaller()), "error", err)
Expand All @@ -107,8 +103,7 @@ func (s *QCCoreSettings) encode() ([]byte, error) {
}
s.Username = encUser
s.Password = encPass
err = enc.Encode(s)
if err != nil {
if err = gob.NewEncoder(buf).Encode(s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error encoding QC core settings data", GetCaller()), "error", err)
return nil, err
}
Expand Down
11 changes: 3 additions & 8 deletions settingsexperimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"errors"
"fmt"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
)

type QCExperimentalSettings struct {
Expand Down Expand Up @@ -58,10 +58,7 @@ func (s *QCExperimentalSettings) save(ls *LauncherStore) error {
}

func (s *QCExperimentalSettings) decode(data []byte) error {
buf := bytes.NewBuffer(data)
dec := gob.NewDecoder(buf)
err := dec.Decode(&s)
if err != nil {
if err := gob.NewDecoder(bytes.NewBuffer(data)).Decode(&s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error decoding QC experimental settings data", GetCaller()), "error", err)
return err
}
Expand All @@ -70,9 +67,7 @@ func (s *QCExperimentalSettings) decode(data []byte) error {

func (s *QCExperimentalSettings) encode() ([]byte, error) {
buf := new(bytes.Buffer)
enc := gob.NewEncoder(buf)
err := enc.Encode(s)
if err != nil {
if err := gob.NewEncoder(buf).Encode(s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error encoding QC experimental settings data", GetCaller()), "error", err)
return nil, err
}
Expand Down
11 changes: 3 additions & 8 deletions settingslauncher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"errors"
"fmt"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
)

type LauncherSettings struct {
Expand Down Expand Up @@ -75,10 +75,7 @@ func (s *LauncherSettings) save(ls *LauncherStore) error {
}

func (s *LauncherSettings) decode(data []byte) error {
buf := bytes.NewBuffer(data)
dec := gob.NewDecoder(buf)
err := dec.Decode(&s)
if err != nil {
if err := gob.NewDecoder(bytes.NewBuffer(data)).Decode(&s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error decoding launcher settings data", GetCaller()), "error", err)
return err
}
Expand All @@ -87,9 +84,7 @@ func (s *LauncherSettings) decode(data []byte) error {

func (s *LauncherSettings) encode() ([]byte, error) {
buf := new(bytes.Buffer)
enc := gob.NewEncoder(buf)
err := enc.Encode(s)
if err != nil {
if err := gob.NewEncoder(buf).Encode(s); err != nil {
logger.Errorw(fmt.Sprintf("%s: error encoding launcher settings data", GetCaller()), "error", err)
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion token.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/gob"
"fmt"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
)

type TokenAuth struct {
Expand Down
7 changes: 5 additions & 2 deletions uiwindowmain.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/lxn/walk"
wd "github.com/lxn/walk/declarative"
"github.com/lxn/win"
"github.com/skratchdot/open-golang/open"
)

const (
Expand Down Expand Up @@ -103,8 +104,10 @@ func newMainWindow(cfg *Configuration, opts *QCLMainWindowOptions) *QCLMainWindo
if button != walk.LeftButton {
return
}
ShowInfoMsg(fmt.Sprintf("QCLauncher %.2f", version),
fmt.Sprintf("%s\nhttp://github.com/syncore/qclauncher\nSupport Quake!", title), mainWindow.MainWindow)
if err := open.Start("https://github.com/syncore/qclauncher"); err != nil {
logger.Errorw(fmt.Sprintf("%s: error launching web browser to load QCLauncher homepage", GetCaller()), "error", err)
return
}
},
},
wd.Composite{
Expand Down
2 changes: 1 addition & 1 deletion updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/boltdb/bolt"
bolt "github.com/coreos/bbolt"
"github.com/lxn/walk"
"github.com/lxn/win"
"github.com/skratchdot/open-golang/open"
Expand Down

0 comments on commit 229f3ea

Please sign in to comment.