~ubuntu-branches/ubuntu/natty/smuxi/natty

« back to all changes in this revision

Viewing changes to src/Frontend-GNOME/Views/Assistants/Engine/EngineAssistant.cs

  • Committer: Bazaar Package Importer
  • Author(s): Mirco Bauer
  • Date: 2010-01-11 22:47:12 UTC
  • mfrom: (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20100111224712-zyrhyny5gbx4t3cv
Tags: upstream-0.7
ImportĀ upstreamĀ versionĀ 0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        private string                           f_EngineName;
40
40
        private EngineAssistantIntroWidget       f_IntroWidget;
41
41
        private EngineAssistantNameWidget        f_NameWidget;
 
42
        private int                              f_NamePage;
42
43
        private EngineAssistantConnectionWidget  f_ConnectionWidget;
43
44
        private EngineAssistantCredentialsWidget f_CredentialsWidget;
44
45
 
100
101
        {
101
102
            f_NameWidget = new EngineAssistantNameWidget();
102
103
 
103
 
            AppendPage(f_NameWidget);
 
104
            f_NamePage = AppendPage(f_NameWidget);
104
105
            SetPageTitle(f_NameWidget, _("Name"));
105
106
            SetPageType(f_NameWidget, Gtk.AssistantPageType.Content);
106
107
            Prepare += delegate(object sender, Gtk.PrepareArgs e) {
275
276
 
276
277
            string engine = f_NameWidget.EngineNameEntry.Text;
277
278
            if (f_EngineName == null) {
 
279
                // check if an engine wit that name exists already
278
280
                string[] engines = (string[]) f_Config["Engines/Engines"];
 
281
                foreach (string oldEngine in engines) {
 
282
                    if (engine == oldEngine) {
 
283
                        Gtk.MessageDialog md = new Gtk.MessageDialog(this,
 
284
                            Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
 
285
                            Gtk.ButtonsType.Close, _("An engine with this name already exists! Please specify a different one."));
 
286
                        md.Run();
 
287
                        md.Destroy();
 
288
 
 
289
                        // jump back to the name page
 
290
                        // HACK: assistant API is buggy here, the "Apply" button
 
291
                        // will trigger a next page signal, thus we have to jump
 
292
                        // to one page before the name page :(
 
293
                        CurrentPage = f_NamePage - 1;
 
294
                        return;
 
295
                    }
 
296
                }
279
297
 
280
298
                string[] newEngines;
281
299
                if (engines.Length == 0) {