Ejemplo n.º 1
0
        private bool LogginAndVerification()
        {
            LoggUser vc = new LoggUser();

            if((MainClass.User == null)||(string.IsNullOrEmpty(MainClass.User.Token))){

                LoginRegisterDialog ld = new LoginRegisterDialog(this);
                int res = ld.Run();

                if (res == (int)Gtk.ResponseType.Cancel){
                    ld.Destroy();
                    return false;
                }
                ld.Destroy();
            }

            if(!vc.Ping(MainClass.User.Token)){
                MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("invalid_login_f1"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();

                LoginRegisterDialog ld = new LoginRegisterDialog(this);
                int res = ld.Run();
                if (res == (int)Gtk.ResponseType.Cancel){
                    ld.Destroy();
                    return false;
                }else if(res == (int)Gtk.ResponseType.Ok){
                    ld.Destroy();
                    return true;
                }
            }
            return true;
        }
Ejemplo n.º 2
0
    private void BannerThreadLoop()
    {
        if((MainClass.Settings.Account != null) && (!String.IsNullOrEmpty(MainClass.Settings.Account.Token))){
            LoggUser lu = new LoggUser();
            if(!lu.Ping(MainClass.Settings.Account.Token))
            {
                llcLogin.UnLogin();

                Gtk.Application.Invoke(delegate{
                    LoginRegisterDialog ld = new LoginRegisterDialog(null);
                    ld.Run();
                    ld.Destroy();
                });
            }
        }

        MainClass.LicencesSystem.LoadFromWeb();
        bannersSystem = MainClass.BannersSystem;

        bool play = true;
        bool isBussy = false;
        try {
            while (play) {
                if (!isBussy) {
                    isBussy = true;
                    Banner bnr = bannersSystem.NextBanner();
                    if((bnr != null) && (bnr.BannerPixbuf != null)){
                        Gtk.Application.Invoke(delegate{
                            bannerImage.ImageIcon = bnr.BannerPixbufResized200;
                            bannerImage.LinkUrl = bnr.Url;
                            /*bannerButton.ImageIcon = bnr.BannerPixbuf;
                            bannerButton.LinkUrl = bnr.Url;
                            bannerButton.ShowAll();*/
                            //while (Gtk.Application.EventsPending ())
                            //	Gtk.Application.RunIteration ();
                        });

                    } else {
                        //Console.WriteLine("Banner is NULL");
                    }
                    isBussy = false;
                }
                Thread.Sleep (15001);
            }
        }catch(ThreadAbortException tae){
            Thread.ResetAbort ();
            Logger.Error("ERROR - Cannot run banner thread.");
            Logger.Error(tae.Message);
            LoadDefaultBanner();
        }finally{

        }
    }
Ejemplo n.º 3
0
        private void Login()
        {
            if (String.IsNullOrEmpty(entrLogin.Text)){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("login_is_required"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            if (String.IsNullOrEmpty(entrPassword.Text)){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("password_is_required"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            MainClass.User = null;

            //CheckLogin();
            try{
                LoggUser log = new LoggUser();
                log.CheckLogin(entrLogin.Text,entrPassword.Text,LoginYesWrite,LoginNoWrite);
            }catch(Exception ex){
                ShowModalError(ex.Message);
                return;
            }
            if(exitTrue){
                if(LogginSucces!=null){
                    LogginSucces(this,null);
                }
                this.Respond(Gtk.ResponseType.Ok);
            }
        }
Ejemplo n.º 4
0
        private void Register()
        {
            if (String.IsNullOrEmpty(entrLoginR.Text)){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("login_is_required"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            if (String.IsNullOrEmpty(entrPasswordR1.Text)){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("password_is_required"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            if(entrPasswordR1.Text != entrPasswordR2.Text){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("password_dont_match"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }

            if(!CheckEmail(entrEmailR.Text)){
                MessageDialogs md =
                    new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("email_address_invalid"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            try{
                LoggUser log = new LoggUser();
                log.Register(entrEmailR.Text,entrLoginR.Text,entrPasswordR1.Text,LoginYesWrite,LoginNoWrite);
            }catch(Exception ex){
                ShowModalError(ex.Message);
                return;
            }
            this.Respond(Gtk.ResponseType.Ok);
        }
Ejemplo n.º 5
0
        protected virtual void OnButtonOkClicked(object sender, System.EventArgs e)
        {
            if (MainClass.Settings.ClearConsoleBeforRuning)
                MainClass.MainWindow.OutputConsole.Clear();

            if(MainClass.Workspace.SignApp){

                LoggUser vc = new LoggUser();

                if((MainClass.User == null)||(string.IsNullOrEmpty(MainClass.User.Token))){

                    LoginRegisterDialog ld = new LoginRegisterDialog(this);
                        int res = ld.Run();

                        if (res == (int)Gtk.ResponseType.Cancel){
                            ld.Destroy();
                            return;
                        }
                        ld.Destroy();
                        return;
                    }

                if(!vc.Ping(MainClass.User.Token)){
                    MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("invalid_login_f1"), "", Gtk.MessageType.Error,this);
                    md.ShowDialog();

                    LoginRegisterDialog ld = new LoginRegisterDialog(this);
                    int res = ld.Run();
                    if (res == (int)Gtk.ResponseType.Cancel){
                        ld.Destroy();
                        return;
                    }
                    ld.Destroy();
                    return;
                }
            }

            List<CombinePublish> list =project.ProjectUserSetting.CombinePublish.FindAll(x=>x.IsSelected==true);

            if(list==null || list.Count<1){
                MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("pleas_select_application"), "", Gtk.MessageType.Error,this);
                md.ShowDialog();
                return;
            }
            RunPublishTask(list);

            this.Respond(ResponseType.Ok);
        }