Пример #1
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);
        }
Пример #2
0
 public void LoginLogout()
 {
     if (MainClass.User == null){
         LoginRegisterDialog ld = new LoginRegisterDialog(null);
         ld.Run();
         ld.Destroy();
     } else{
         MainClass.User = null;
     }
     SetLogin();
 }
Пример #3
0
        public bool Relogin()
        {
            bool respons = false;

            LoginRegisterDialog ld = new LoginRegisterDialog(null);
            int res = ld.Run();
            if (res == (int)Gtk.ResponseType.Ok)
                respons = true;
            ld.Destroy();

            return respons;
        }
Пример #4
0
        private void ShowLogin()
        {
            LoginRegisterDialog ld = new LoginRegisterDialog(this);
            int res = ld.Run();

            if (res == (int)Gtk.ResponseType.Cancel)
            {
                ld.Destroy();
                return;
            }
            ld.Destroy();
            return;
        }
Пример #5
0
        private void RunPublishTask(List <CombinePublish> list)
        {
            LoggingInfo log = new LoggingInfo();

            log.LoggWebThread(LoggingInfo.ActionId.IDEEnd, project.ProjectName);

            if ((!MainClass.Workspace.SignApp))
            {
                TaskList tlpublish = new TaskList();
                tlpublish.TasksList = new System.Collections.Generic.List <Moscrif.IDE.Task.ITask>();

                PublishTask pt = new PublishTask();
                pt.ParentWindow = this;
                pt.Initialize(list);

                tlpublish.TasksList.Add(pt);
                MainClass.MainWindow.RunTaskList(tlpublish, true);
            }
            else
            {
                if (MainClass.User == null)
                {
                    LoginRegisterDialog ld = new LoginRegisterDialog(this);
                    int res = ld.Run();

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

                TaskList tl = new TaskList();
                tl.TasksList = new System.Collections.Generic.List <Moscrif.IDE.Task.ITask>();
                SignPublishTask ct = new SignPublishTask();
                ct.Initialize(list);
                ct.ParentWindow = this;

                tl.TasksList.Add(ct);

                MainClass.MainWindow.RunTaskList(tl, false);
            }
        }
Пример #6
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;
        }
Пример #7
0
        void OnTest(object obj, EventArgs args)
        {
            LoginRegisterDialog ld = new LoginRegisterDialog(MainClass.MainWindow);
            if(ld.Run() == (int)ResponseType.Ok){

            }
            ld.Destroy();

            Console.WriteLine("MainClass.MainWindow.hpRight.Position SW 1 -:"+MainClass.MainWindow.hpRight.Position );
            //	throw new NotImplementedException();
            return;
            /*PublishDialogWizzard npw = new PublishDialogWizzard();
            int result = npw.Run();
            if (result == (int)ResponseType.Ok) {

            }
            npw.Destroy();*/
            /*PublishDialog pd = new PublishDialog();
            if(pd.Run() == (int)ResponseType.Ok){

            }
            pd.Destroy();
            */
        }
Пример #8
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{

        }
    }
Пример #9
0
        public static void Main(string[] args)
        {
            //foreach(string str in args)
            //	Logger.Log("arg ->{0}",str);

            Application.Init();
            Logger.Log(Languages.Translate("start_app"));

            ExceptionManager.UnhandledException += delegate(UnhandledExceptionArgs argsum)
            {
                StringBuilder sb = new StringBuilder();

                Exception ex = (Exception)argsum.ExceptionObject;

                sb.AppendLine(ex.Message);
                sb.AppendLine(ex.StackTrace);
                Logger.Error(ex.Message);
                Logger.Error(ex.StackTrace);
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);

                if (ex.InnerException != null) {
                    Logger.Error(ex.InnerException.Message);
                    Logger.Error(ex.InnerException.StackTrace);
                    Logger.Error(ex.InnerException.Source);
                    Console.WriteLine(ex.InnerException.Message);
                    Console.WriteLine(ex.InnerException.StackTrace);
                    Console.WriteLine(ex.InnerException.Source);
                    sb.AppendLine(ex.InnerException.Message);
                    sb.AppendLine(ex.InnerException.StackTrace);
                    sb.AppendLine(ex.InnerException.Source);
                }

                ErrorDialog ed= new ErrorDialog();
                ed.ErrorMessage = sb.ToString();
                ed.Run();
                ed.Destroy();

                argsum.ExitApplication = true;
            };

            Gdk.Global.InitCheck(ref args);
            if (Platform.IsWindows){
                string themePath = Paths.DefaultTheme;
                if (System.IO.File.Exists (themePath)){
                    Gtk.Rc.AddDefaultFile(themePath);
                    Gtk.Rc.Parse (themePath);
                }
            }

            mainWindow = new MainWindow(args);
            MainWindow.Show();

            if((MainClass.Settings.Account == null) || (String.IsNullOrEmpty(MainClass.Settings.Account.Token))){
                LoginRegisterDialog ld = new LoginRegisterDialog(null);
                ld.Run();
                ld.Destroy();
            } else {
                LoggingInfo log = new LoggingInfo();
                log.LoggWebThread(LoggingInfo.ActionId.IDEStart);
            }

            if (!String.IsNullOrEmpty(Paths.TempDir))
            {
                Application.Run();
            }
        }
Пример #10
0
 private void ShowLogin()
 {
     LoginRegisterDialog ld = new LoginRegisterDialog(this);
     int res = ld.Run();
     if (res == (int)Gtk.ResponseType.Cancel){
         ld.Destroy();
         return;
     }
     ld.Destroy();
     return;
 }
Пример #11
0
        private void RunPublishTask(List<CombinePublish> list)
        {
            LoggingInfo log = new LoggingInfo();
            log.LoggWebThread(LoggingInfo.ActionId.IDEEnd,project.ProjectName);

            if((!MainClass.Workspace.SignApp) ){

                TaskList tlpublish = new TaskList();
                tlpublish.TasksList = new System.Collections.Generic.List<Moscrif.IDE.Task.ITask>();

                PublishTask pt = new PublishTask();
                pt.ParentWindow = this;
                pt.Initialize(list);

                tlpublish.TasksList.Add(pt);
                MainClass.MainWindow.RunTaskList(tlpublish,true);

            } else {

                if(MainClass.User == null){

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

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

                TaskList tl = new TaskList();
                tl.TasksList = new System.Collections.Generic.List<Moscrif.IDE.Task.ITask>();
                SignPublishTask ct = new SignPublishTask();
                ct.Initialize(list);
                ct.ParentWindow = this;

                tl.TasksList.Add(ct );

                MainClass.MainWindow.RunTaskList(tl,false);
            }
        }
Пример #12
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);
        }