Ejemplo n.º 1
0
 private void okbtn_Click(object sender, EventArgs e)
 {
     //TO!DO
     Language.ReloadLangs();                  //2015.07.05. - Lényegében csak az ablakokat frissíti
     PackManager.Save <Theme>(SelectedTheme); //2015.07.03.
     this.Close();                            //2015.05.24.
 }
Ejemplo n.º 2
0
        public static void Load()
        {
            BeforeLogin.SetText("Starting...");
            Thread.CurrentThread.Name = "Main Thread";

            BeforeLogin.SetText("Loading program settings...");
            Storage.Load(false); //Töltse be a nyelvet, legutóbb használt E-mail-t...

            BeforeLogin.SetText("Checking available ports...");
            SetPort();

            BeforeLogin.SetText("Loading packs...");
            PackManager.LoadAll();             //2015.05.16.

            MainThread = Thread.CurrentThread; //2015.05.23.
            MainF      = new MainForm();       //2015.05.23.

            BeforeLogin.SetText(Language.Translate(Language.StringID.BeforeLogin_CheckForUpdates));
            //2014.04.25.
            string response = Networking.SendRequest(Networking.RequestType.CheckForUpdates,
                                                     Assembly.GetExecutingAssembly().GetName().Version.ToString().Replace(".", ""),
                                                     0, false);

            if (response == "outofdate")
            {
                var res = MessageBox.Show(Language.Translate(Language.StringID.OutOfDate), Language.Translate(Language.StringID.OutOfDate_Caption), MessageBoxButtons.YesNo);
                if (res == DialogResult.Yes)
                {                                                                                              //2014.12.13.
                    Process.Start("Updater.exe", "\"" + Language.Translate(Language.StringID.Updater) + "\""); //2015.06.14.
                    Program.Exit();
                }
            }
            else if (response != "fine")
            {
                new ErrorHandler(ErrorType.ServerError, new Exception(response)); //2015.06.04.
            }
            BeforeLogin.SetText(Language.Translate(Language.StringID.BeforeLogin_LoginForm));
            var LoginDialog = new LoginForm(); //2015.05.23.

            BeforeLogin.Destroy();
            LoginDialog.ShowDialog();
            //Nézzük, sikerült-e
            if (CurrentUser.UserID == 0)
            {
                return; //2014.09.06.
            }
            // Start the thread
            MainForm.PartnerListUpdateThread.Start(); //Áthelyezve: 2015.06.30.

            Storage.Load(true);                       //2014.08.07.
        }
Ejemplo n.º 3
0
 private void removebtn_Click(object sender, EventArgs e)
 {
     if (SelectedTextFormat == -1 || SelectedEmoticon > TextFormat.TextFormats[SelectedTextFormat].Emoticons.Count)
     {
         return;
     }
     if (MessageBox.Show(Language.Translate(Language.StringID.AreYouSure), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         TextFormat.TextFormats[SelectedTextFormat].Emoticons.RemoveAt(SelectedEmoticon);
         flowLayoutPanel1.Controls.RemoveAt(SelectedEmoticon);
         if (TextFormat.TextFormats[SelectedTextFormat].Emoticons.Count == 0)
         {
             PackManager.Remove <TextFormat>(TextFormat.TextFormats[SelectedTextFormat]); //2015.06.14.
             TextFormat.TextFormats.RemoveAt(SelectedTextFormat);                         //2015.06.14.
         }
     }
 }
Ejemplo n.º 4
0
        private void SaveEmoticonIfChanged()
        {
            bool save = false;

            if (pictureBox1.Image == null || textBox1.Text == "")
            {
                return;
            }
            if (SelectedEmoticon >= flowLayoutPanel1.Controls.Count)
            {
                flowLayoutPanel1.Controls.Add(new PictureBox {
                    Tag = flowLayoutPanel1.Controls.Count, Image = pictureBox1.Image.Clone() as Image, Size = pictureBox1.Image.Size
                });
                flowLayoutPanel1.Controls[flowLayoutPanel1.Controls.Count - 1].Click += Emoticons_Click;
                if (SelectedTextFormat == -1)
                {
                    TextFormat.TextFormats.Add(PackManager.Add <TextFormat>(domainUpDown1.Text + ".npack"));
                    selectedtextformat = TextFormat.TextFormats.Count - 1;
                    save = true;
                }
                var emoticon = new Emoticon(textBox1.Text);
                emoticon.Image = new Bitmap(pictureBox1.Image); //2015.07.05.
                TextFormat.TextFormats[SelectedTextFormat].Emoticons.Add(emoticon);
            }
            else if (textBox1.Text != initialtext || imagechanged)
            {
                TextFormat.TextFormats[SelectedTextFormat].Emoticons[SelectedEmoticon].Value = textBox1.Text;
                TextFormat.TextFormats[SelectedTextFormat].Emoticons[SelectedEmoticon].Image.Dispose();                       //2015.07.05.
                TextFormat.TextFormats[SelectedTextFormat].Emoticons[SelectedEmoticon].Image = new Bitmap(pictureBox1.Image); //2015.07.05.
                initialtext  = textBox1.Text;
                imagechanged = false;
                (flowLayoutPanel1.Controls[SelectedEmoticon] as PictureBox).Image = pictureBox1.Image;
                save = true;
            }

            if (save)
            {
                PackManager.Save <TextFormat>(TextFormat.TextFormats[SelectedTextFormat]);
            }
        }