Beispiel #1
0
        Widget ConstructItemsUI()
        {
            Glade.XML gui = LoadInterface("items_vbox");
            if (gui == null)
            {
                return(null);
            }

            Gtk.VBox container = gui.GetWidget("items_vbox") as VBox;
            locked_check = gui.GetWidget("locked_check") as CheckButton;
            Gtk.TreeView items_list = gui.GetWidget("items_list") as TreeView;

            locked_check.Toggled += new EventHandler(AllLockedToggledCb);
            if (master != null)
            {
                master.NotifyLocked += new EventHandler(MasterLockedNotifyCb);
                // force update now
                MasterLockedNotifyCb(master, EventArgs.Empty);
            }

            // set models
            items_list.Model = itemsModel;

            // construct list views
            CellRendererToggle renderer = new CellRendererToggle();

            renderer.Toggled += new ToggledHandler(ShowToggledCb);
            TreeViewColumn column = new TreeViewColumn("Visible", renderer, "active", 1);

            items_list.AppendColumn(column);

            items_list.AppendColumn("Item", new CellRendererText(), "text", 0);

            return(container);
        }
        void Initialize(Window parent, String text)
        {
            var stream = Assembly
                         .GetExecutingAssembly()
                         .GetManifestResourceStream(AppController.Instance.Config.SourceDialog);

            var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);

            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog              = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));
            _thisDialog.Modal        = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition(WindowPosition.Center);


            textview1.Buffer.Text = text;
            btnContinue.Clicked  += (sender, e) => _thisDialog.HideAll();

            btnUpload.Clicked += OnUpload;

            miSave.Activated   += OnSave;
            miSaveAs.Activated += OnSaveAs;
            miQuit.Activated   += (object sender, EventArgs e) => _thisDialog.HideAll();
            miAbout.Activated  += (object sender, EventArgs e) => new AboutDialog(_thisDialog).ShowDialog();
        }
Beispiel #3
0
        void Initialize(Window parent, Exception ex)
        {
            var stream = Assembly
                         .GetExecutingAssembly()
                         .GetManifestResourceStream(AppController.Instance.Config.UnhandledExceptionDialog);

            var glade = new Glade.XML(stream, AppController.Instance.Config.UnhandledExceptionDialogName, null);

            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));

            //_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
            _thisDialog.Modal        = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition(WindowPosition.Center);


            textview1.Buffer.Text = ex.ToString();
        }
Beispiel #4
0
        public AccountDialog(Gtk.Window parent, GalleryAccount account, bool show_error)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_dialog", "f-spot");
            xml.Autoconnect (this);
            add_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_dialog");
            add_dialog.Modal = false;
            add_dialog.TransientFor = parent;
            add_dialog.DefaultResponse = Gtk.ResponseType.Ok;

            this.account = account;

            status_area.Visible = show_error;

            if (account != null) {
                gallery_entry.Text = account.Name;
                url_entry.Text = account.Url;
                password_entry.Text = account.Password;
                username_entry.Text = account.Username;
                add_button.Label = Gtk.Stock.Ok;
                add_dialog.Response += HandleEditResponse;
            }

            if (remove_button != null)
                remove_button.Visible = account != null;

            add_dialog.Show ();

            gallery_entry.Changed += HandleChanged;
            url_entry.Changed += HandleChanged;
            password_entry.Changed += HandleChanged;
            username_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Beispiel #5
0
        void Initialize(Window parent)
        {
            var stream = Assembly
                         .GetExecutingAssembly()
                         .GetManifestResourceStream("LadderLogic.Presentation.EnvironmentVariablesDialog.glade");

            var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);

            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));

            //_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
            //_thisDialog.Modal = true;
            //_thisDialog.TransientFor = parent;
            _thisDialog.SetPosition(WindowPosition.Center);

            var env = CController.Instance.GetEnvironmentVariables();

            if (env != null)
            {
                etBoard.Text = env.ArduinoBoard;
                etPort.Text  = env.ArduinoPort;
                etPath.Text  = env.ArduinoPath;
            }
        }
Beispiel #6
0
        #pragma warning restore 0169
        #pragma warning restore 0649

        public ViewTaskDialog(Window parent, bool isTaskInit)
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ViewTaskDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "ViewTaskDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog                = ((Dialog)(glade.GetWidget("ViewTaskDialog")));
            thisDialog.Modal          = true;
            thisDialog.TransientFor   = parent;
            thisDialog.WindowPosition = WindowPosition.CenterAlways;

            cbActor.Entry.IsEditable = false;
            cbActor.Changed         += new EventHandler(OnCbActorChanged);
            calStartTime.Date        = DateTime.Now.Date;
            calEndTime.Date          = DateTime.Now.Date;
            cbState.Entry.IsEditable = false;
            cbState.Changed         += new EventHandler(OnCbStateChanged);
            spbPriority.SetRange(0, 10000);
            spbPriority.SetIncrements(1, 10);

            IsInitTask = isTaskInit;
            tvDescription.KeyReleaseEvent += HandleKeyReleaseEvent;
            tvComment.KeyReleaseEvent     += CommentKeyReleaseEvent;
        }
 public override Widget ConfigurationWidget()
 {
     xml = new Glade.XML(null, "f-spot.glade", "color_editor_prefs", "f-spot");
     xml.Autoconnect(this);
     AttachInterface();
     return(xml.GetWidget("color_editor_prefs"));;
 }
Beispiel #8
0
        public void Run(FSpot.IBrowsableCollection photos)
        {
            if (null == photos)
            {
                throw new ArgumentNullException("photos");
            }

            this.photos = photos;

            Glade.XML glade_xml = new Glade.XML(
                null, "TabbloExport.glade", DialogName,
                "f-spot");
            glade_xml.Autoconnect(this);

            dialog = (Gtk.Dialog)glade_xml.GetWidget(DialogName);

            FSpot.Widgets.IconView icon_view =
                new FSpot.Widgets.IconView(photos);
            icon_view.DisplayDates = false;
            icon_view.DisplayTags  = false;

            username_entry.Changed += HandleAccountDataChanged;
            password_entry.Changed += HandleAccountDataChanged;
            ReadAccountData();
            HandleAccountDataChanged(null, null);

            dialog.Modal        = false;
            dialog.TransientFor = null;

            dialog.Response += HandleResponse;

            thumb_scrolled_window.Add(icon_view);
            icon_view.Show();
            dialog.Show();
        }
Beispiel #9
0
        public TransfersMenu(TreeView transfersList, IFileTransfer transfer)
        {
            Glade.XML glade = new Glade.XML(null, "FileFind.Meshwork.GtkClient.meshwork.glade", "TransfersMenu", null);
            glade.Autoconnect(this);
            this.menu = (Gtk.Menu) glade.GetWidget("TransfersMenu");

            this.transfersList = transfersList;
            this.transfer = transfer;

            if (transfer != null) {
                mnuCancelAndRemoveTransfer.Visible = true;
                mnuShowTransferDetails.Sensitive = true;
                mnuClearFinishedFailedTransfers.Sensitive = true;
                if (transfer.Status == FileTransferStatus.Paused) {
                    mnuPauseTransfer.Visible = false;
                    mnuResumeTransfer.Visible = true;
                    mnuResumeTransfer.Sensitive = true;
                    mnuCancelTransfer.Sensitive = true;
                } else if (transfer.Status == FileTransferStatus.Canceled || transfer.Status == FileTransferStatus.Completed) {
                    mnuPauseTransfer.Sensitive = false;
                    mnuResumeTransfer.Visible = false;
                    mnuCancelTransfer.Sensitive = false;
                }
            } else {
                mnuCancelAndRemoveTransfer.Visible = false;
                mnuShowTransferDetails.Sensitive = false;
                mnuPauseTransfer.Sensitive = false;
                mnuResumeTransfer.Visible = false;
                mnuCancelTransfer.Sensitive = false;
            }
        }
Beispiel #10
0
                #pragma warning restore 0649

        public LogoForm()
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ViewLogoForm.glade");

            Glade.XML glade = new Glade.XML(stream, "LogoMindow", null);
            stream.Close();
            glade.Autoconnect(this);
            thisWindow = ((Window)(glade.GetWidget("LogoMindow")));
            thisWindow.WindowPosition = WindowPosition.Center;
            thisWindow.SetDefaultSize(480, 460);
            thisWindow.KeyReleaseEvent += (o, args) =>
            {
                this.thisWindow.HideAll();
            };
            ReadMe();

            // Assigment
            dwLogo = new GanttDiagramm();
            //TODO: move readonly to strategy
            var ganttSource = ((IGanttSource)dwLogo);

            ganttSource.ReadOnly       = true;
            ganttSource.StaticSource   = GetLogoSource();
            ganttSource.DateNowVisible = false;

            var readme  = vbox1.Children [1];
            var readme1 = vbox1.Children [2];

            vbox1.Remove(readme1);
            vbox1.Add(dwLogo);
            vbox1.Add(readme);
            vbox1.Add(readme1);
            dwLogo.Show();
        }
                #pragma warning restore 0649

        public ExceptionViewDialog(Exception exception, Window parent)
        {
            //TODO: Looks like builder pattern needed here
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ExceptionViewDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "ExceptionViewDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog = ((Gtk.Dialog)(glade.GetWidget("ExceptionViewDialog")));
            thisDialog.TransientFor   = parent;
            thisDialog.Modal          = true;
            thisDialog.AllowGrow      = false;
            thisDialog.AllowShrink    = false;
            thisDialog.WindowPosition = WindowPosition.Center;

            ExceptionMessage = exception.Message;

            tvButtonDescription.Sensitive = false;
            if (!(exception is ManagementException))
            {
                ExceptionType                   = exception.GetType().FullName;
                ExceptionDescription            = exception.ToString();
                tvButtonDescription.Buffer.Text =
                    "Use ignore for continue, Quit for exit program.";
            }
            else
            {
                ExceptionType = string.Empty;
            }
        }
Beispiel #12
0
        void ToggleButtons(bool btnState)
        {
            newMenuToolButton           = (MenuToolButton)ui.GetWidget("newMenuToolButton");
            newMenuToolButton.Sensitive = btnState;

            propertiesToolButton           = (ToolButton)ui.GetWidget("propertiesToolButton");
            propertiesToolButton.Sensitive = btnState;

            deleteToolButton           = (ToolButton)ui.GetWidget("deleteToolButton");
            deleteToolButton.Sensitive = btnState;

            refreshToolButton           = (ToolButton)ui.GetWidget("refreshToolButton");
            refreshToolButton.Sensitive = btnState;

            propertiesToolButton.Show();
            refreshToolButton.Show();
        }
        public FacebookTagPopup(Dictionary <long, User> friends)
        {
            Friends = friends;

            Glade.XML xml = new Glade.XML(null, "FacebookExport.glade", "facebook_tag_popup", "f-spot");
            xml.Autoconnect(this);

            Popup = xml.GetWidget("facebook_tag_popup") as Gtk.Window;
            Popup.Show();
        }
 void Initialize(Window parent)
 {
     Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");
     Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
     stream.Close();
     glade.Autoconnect(this);
     thisDialog = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
     thisDialog.Modal = true;
     thisDialog.TransientFor = parent;
     thisDialog.SetPosition (WindowPosition.Center);
 }
Beispiel #15
0
        Widget ConstructLayoutsUI()
        {
            Glade.XML gui = LoadInterface("layouts_vbox");

            if (gui == null)
            {
                return(null);
            }

            Gtk.VBox     container    = gui.GetWidget("layouts_vbox") as VBox;
            Gtk.TreeView layouts_list = gui.GetWidget("layouts_list") as TreeView;
            layouts_list.Model = layoutsModel;
            CellRendererText renderer = new CellRendererText();

            renderer.Edited += new EditedHandler(CellEditedCb);
            TreeViewColumn column = new TreeViewColumn("Name", renderer, "text", 0, "editable", 1);

            layouts_list.AppendColumn(column);

            return(container);
        }
        void Initialize(Window parent)
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog              = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
            thisDialog.Modal        = true;
            thisDialog.TransientFor = parent;
            thisDialog.SetPosition(WindowPosition.Center);
        }
        private void Initialize(Window parent)
        {
            //TODO: Looks like builder pattern needed here. too many copipaste with glade init.
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("GMTAboutDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "GMTAboutDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog                = ((Gtk.Dialog)(glade.GetWidget("GMTAboutDialog")));
            thisDialog.Modal          = true;
            thisDialog.TransientFor   = parent;
            thisDialog.WindowPosition = WindowPosition.Center;
        }
Beispiel #18
0
                #pragma warning restore 0169
                #pragma warning restore 0649

        public MessageViewDialog(string type, string subject, string description, Window parent)
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("WarningView.glade");

            Glade.XML glade = new Glade.XML(stream, "dialog1", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog = ((Dialog)(glade.GetWidget("dialog1")));
            thisDialog.TransientFor = parent;
            thisDialog.Modal        = true;

            this.WarningType        = type;
            this.WarningSubject     = subject;
            this.WarningDescription = description;
        }
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            Glade.XML xml = new Glade.XML(null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
            xml.Autoconnect(this);
            add_album_dialog       = (Gtk.Dialog)xml.GetWidget("gallery_add_album_dialog");
            add_album_dialog.Modal = true;
            this.export            = export;
            this.gallery           = gallery;
            PopulateAlbums();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed        += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed       += HandleChanged;
            HandleChanged(null, null);
        }
        private bool DoGetDecision()
        {
            Glade.XML glade_xml = new Glade.XML(
                null, "TrustError.glade", DialogName,
                "f-spot");
            glade_xml.Autoconnect(this);

            dialog = (Gtk.Dialog)glade_xml.GetWidget(DialogName);

            url_label.Markup = String.Format(
                url_label.Text, String.Format(
                    "<b>{0}</b>",
                    request.RequestUri));

            Gtk.ResponseType response =
                (Gtk.ResponseType)dialog.Run();
            Log.DebugFormat("Decision dialog response: " + response);

            dialog.Destroy();

            decision = Decision.DontTrust;
            if (0 == response)
            {
                if (abort_radiobutton.Active)
                {
                    decision = Decision.DontTrust;
                }
                else if (once_radiobutton.Active)
                {
                    decision = Decision.TrustOnce;
                }
                else if (always_radiobutton.Active)
                {
                    decision = Decision.TrustAlways;
                }
                else
                {
                    Debug.Assert(false,
                                 "Unhandled decision");
                }
            }

            decision_event.Set();
            return(false);
        }
Beispiel #21
0
	public MainUi (EventHandlers handlers, out Glade.XML glade) {
		glade = new Glade.XML(null, gladeFilename, null, Base.ExecutionContext.TranslationDomain);

		window = glade.GetWidget("window") as Window;
		window.Icon = new Gdk.Pixbuf(null, iconFilename);
		window.SetDefaultSize(Base.Config.PrefsWindowWidth, Base.Config.PrefsWindowHeight);

		video = new Video();
		view = new SubtitleView();
		edit = new SubtitleEdit();
		menus = new Menus();
		status = new Status();

		glade.Autoconnect(handlers);
		Base.InitFinished += OnBaseInitFinished;

		window.Visible = true;
    }
Beispiel #22
0
        private void Initialize(Window parent)
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream("LadderLogic.Presentation.UpdateDialog.glade");

            var glade = new Glade.XML(stream, "dialog1", null);
            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget("dialog1")));
            _thisDialog.SetPosition(WindowPosition.Center);
        }
Beispiel #23
0
                #pragma warning restore 0649

        public ViewTaskAssign(Window parent)
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ViewTaskAssign.glade");

            Glade.XML glade = new Glade.XML(stream, "ViewTaskAssign", null);
            stream.Close();
            glade.Autoconnect(this);

            thisDialog              = ((Dialog)(glade.GetWidget("ViewTaskAssign")));
            thisDialog.Modal        = true;
            thisDialog.TransientFor = parent;
            thisDialog.SetDefaultSize(200, 450);
            thisDialog.WindowPosition = WindowPosition.Center;

            cbActor.Entry.IsEditable   = false;
            cbActor.Changed           += new EventHandler(OnCbActorChanged);
            tvComment.KeyReleaseEvent += CommentKeyReleaseEvent;
        }
Beispiel #24
0
        private void Initialize(Window parent, IGuiCore guiCore)
        {
            stateCore = new StateCore(guiCore, this);
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ViewStateDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "EditStatesDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog              = ((Dialog)(glade.GetWidget("EditStatesDialog")));
            thisDialog.Modal        = true;
            thisDialog.TransientFor = parent;
            thisDialog.SetDefaultSize(800, 600);
            thisDialog.WindowPosition = WindowPosition.CenterAlways;

            btnApply.Clicked += new EventHandler(OnApply);

            //btnSearch.Clicked += new EventHandler(OnStateSearch);
            btnCreateState.Clicked += new EventHandler(OnCreateState);
            btnEditState.Clicked   += new EventHandler(OnEditState);
            btnDeleteState.Clicked += new EventHandler(OnDeleteState);

            btnCreateConnection.Clicked += new EventHandler(OnCreateConnection);
            btnEditConnection.Clicked   += new EventHandler(OnEditConnection);
            btnDeleteConnection.Clicked += new EventHandler(OnDeleteConnection);

            TaskStateStore = new TreeStore(typeof(int), typeof(string), typeof(int));

            tvState.HeadersVisible = true;
            tvState.AppendColumn("ID", new CellRendererText(), "text", 1);
            tvState.AppendColumn("Name", new CellRendererText(), "text", 1);
            tvState.GetColumn(0).Visible = false;

            tvStateConnection.HeadersVisible = true;
            tvStateConnection.AppendColumn("ID", new CellRendererText(), "text", 1);
            tvStateConnection.AppendColumn("Name", new CellRendererText(), "text", 1);
            tvStateConnection.GetColumn(0).Visible = false;

            Source = stateCore.TaskManager.TaskStateSource;

            BindStateSearchDictionary();
            BindStates();

            //BindStateSearchCompletion();
        }
Beispiel #25
0
        void Initialize(Window parent)
        {
            var gladeRes = AppController.Instance.Config.AboutDialog;
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(gladeRes);

            var glade = new Glade.XML(stream, AppController.Instance.Config.AboutDialogName, null);
            if (stream != null)
            {
                stream.Close();
            }

            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.AboutDialogName)));
            _thisDialog.Modal = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition (WindowPosition.Center);
        }
Beispiel #26
0
        private void Initialize(Window parent)
        {
            var stream = Assembly
                         .GetExecutingAssembly()
                         .GetManifestResourceStream("LadderLogic.Presentation.UpdateDialog.glade");

            var glade = new Glade.XML(stream, "dialog1", null);

            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget("dialog1")));
            _thisDialog.SetPosition(WindowPosition.Center);
        }
                #pragma warning restore 0169
                #pragma warning restore 0649


        public ViewConnectionDialog(Window parent, DataSet taskStateSource)
        {
            Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ViewConnectionDialog.glade");

            Glade.XML glade = new Glade.XML(stream, "ViewConnectionDialog", null);
            stream.Close();
            glade.Autoconnect(this);
            thisDialog = ((Dialog)(glade.GetWidget("ViewConnectionDialog")));
            thisDialog.TransientFor   = parent;
            thisDialog.Modal          = true;
            thisDialog.WindowPosition = WindowPosition.Center;
            TaskStateSource           = taskStateSource;

            cbStateIn.Sensitive         = false;
            lbConnectionAction.Text     = "Create Connection";
            cbStateOut.Entry.IsEditable = false;
            cbStateIn.Changed          += new EventHandler(OnCbStateInChanged);
            cbStateOut.Changed         += new EventHandler(OnCbStateOutChanged);
        }
        public void Run(IBrowsableCollection selection)
        {
            Glade.XML xml = new Glade.XML(null, "GalleryExport.glade", "gallery_export_dialog", "f-spot");
            xml.Autoconnect(this);
            export_dialog = (Gtk.Dialog)xml.GetWidget("gallery_export_dialog");

            this.items = selection.Items;
            Array.Sort <IBrowsableItem> (this.items as Photo[], new Photo.CompareDateName());
            album_button.Sensitive = false;
            IconView view = new IconView(selection);

            view.DisplayDates = false;
            view.DisplayTags  = false;

            export_dialog.Modal        = false;
            export_dialog.TransientFor = null;

            thumb_scrolledwindow.Add(view);
            view.Show();
            export_dialog.Show();

            GalleryAccountManager manager = GalleryAccountManager.GetInstance();

            manager.AccountListChanged += PopulateGalleryOptionMenu;
            PopulateGalleryOptionMenu(manager, null);

            if (edit_button != null)
            {
                edit_button.Clicked += HandleEditGallery;
            }

            export_dialog.Response += HandleResponse;
            connect = true;
            HandleSizeActive(null, null);
            Connect();

            LoadPreference(SCALE_KEY);
            LoadPreference(SIZE_KEY);
            LoadPreference(BROWSER_KEY);
            LoadPreference(META_KEY);
            LoadPreference(ROTATE_KEY);
        }
Beispiel #29
0
        void Initialize(Window parent)
        {
            var gladeRes = AppController.Instance.Config.AboutDialog;
            var stream   = Assembly
                           .GetExecutingAssembly()
                           .GetManifestResourceStream(gladeRes);

            var glade = new Glade.XML(stream, AppController.Instance.Config.AboutDialogName, null);

            if (stream != null)
            {
                stream.Close();
            }

            glade.Autoconnect(this);
            _thisDialog              = ((Dialog)(glade.GetWidget(AppController.Instance.Config.AboutDialogName)));
            _thisDialog.Modal        = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition(WindowPosition.Center);
        }
    public GtkGladeCodeGenerator()
    {
        Gtk.Application.Init();

        Glade.XML glade = new Glade.XML(null, "gladecodegenerator.glade", "MainWindow", null);
        glade.Autoconnect(this);
        window = (Gtk.Window)glade.GetWidget("MainWindow");

        //mainEventBox.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(0xff,0xff,0xff));
        mainEventBox.ModifyBg(Gtk.StateType.Normal, mainEventBox.Style.White);

        widgetTreeStore =  new Gtk.TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(Widget));

        Gtk.TreeViewColumn completeColumn = new Gtk.TreeViewColumn();

        Gtk.CellRendererToggle toggleRenderer = new Gtk.CellRendererToggle();
        toggleRenderer.Toggled += new Gtk.ToggledHandler (on_toggleRenderer_Toggled);
        completeColumn.PackStart(toggleRenderer, false);
        completeColumn.SetCellDataFunc(toggleRenderer, new Gtk.TreeCellDataFunc(toggleRendererFunc));

        Gtk.CellRendererPixbuf imageRenderer = new Gtk.CellRendererPixbuf();
        completeColumn.PackStart(imageRenderer, false);
        completeColumn.AddAttribute(imageRenderer, "pixbuf", 0);
        completeColumn.AddAttribute(imageRenderer, "visible", 2);

        Gtk.CellRendererText textRenderer = new Gtk.CellRendererText();
        completeColumn.PackStart(textRenderer, false);
        completeColumn.AddAttribute(textRenderer, "text", 1);

        widgetTree.AppendColumn(completeColumn);

        widgetTree.Model = widgetTreeStore;

        widgetTreeStore.SetSortColumnId(2,Gtk.SortType.Ascending);

        languageComboBox.Active = 0;

        window.Show();

        Gtk.Application.Run();
    }
Beispiel #31
0
        public TransfersMenu(TreeView transfersList, IFileTransfer transfer)
        {
            Glade.XML glade = new Glade.XML(null, "Meshwork.Client.GtkClient.meshwork.glade", "TransfersMenu", null);
            glade.Autoconnect(this);
            this.menu = (Gtk.Menu)glade.GetWidget("TransfersMenu");

            this.transfersList = transfersList;
            this.transfer      = transfer;

            if (transfer != null)
            {
                mnuCancelAndRemoveTransfer.Visible        = true;
                mnuShowTransferDetails.Sensitive          = true;
                mnuClearFinishedFailedTransfers.Sensitive = true;
                if (transfer.Status == FileTransferStatus.Paused)
                {
                    mnuPauseTransfer.Visible    = false;
                    mnuResumeTransfer.Visible   = true;
                    mnuResumeTransfer.Sensitive = true;
                    mnuCancelTransfer.Sensitive = true;
                }
                else if (transfer.Status == FileTransferStatus.Canceled || transfer.Status == FileTransferStatus.Completed)
                {
                    mnuPauseTransfer.Sensitive  = false;
                    mnuResumeTransfer.Visible   = false;
                    mnuCancelTransfer.Sensitive = false;
                }
            }
            else
            {
                mnuCancelAndRemoveTransfer.Visible = false;
                mnuShowTransferDetails.Sensitive   = false;
                mnuPauseTransfer.Sensitive         = false;
                mnuResumeTransfer.Visible          = false;
                mnuCancelTransfer.Sensitive        = false;
            }
        }
		private bool DoGetDecision ()
		{
			Glade.XML glade_xml = new Glade.XML (
					null, "TrustError.glade", DialogName,
					"f-spot");
			glade_xml.Autoconnect (this);

			dialog = (Gtk.Dialog) glade_xml.GetWidget (DialogName);

			url_label.Markup = String.Format (
					url_label.Text, String.Format (
							"<b>{0}</b>",
							request.RequestUri));

			Gtk.ResponseType response =
					(Gtk.ResponseType) dialog.Run ();
			Log.DebugFormat ("Decision dialog response: " + response);

			dialog.Destroy ();

			decision = Decision.DontTrust;
			if (0 == response) {
				if (abort_radiobutton.Active) {
					decision = Decision.DontTrust;
				} else if (once_radiobutton.Active) {
					decision = Decision.TrustOnce;
				} else if (always_radiobutton.Active) {
					decision = Decision.TrustAlways;
				} else {
					Debug.Assert (false,
							"Unhandled decision");
				}
			}

			decision_event.Set ();
			return false;
		}
        public AccountDialog(Gtk.Window parent, GalleryAccount account, bool show_error)
        {
            Glade.XML xml = new Glade.XML(null, "GalleryExport.glade", "gallery_add_dialog", "f-spot");
            xml.Autoconnect(this);
            add_dialog                 = (Gtk.Dialog)xml.GetWidget("gallery_add_dialog");
            add_dialog.Modal           = false;
            add_dialog.TransientFor    = parent;
            add_dialog.DefaultResponse = Gtk.ResponseType.Ok;

            this.account = account;

            status_area.Visible = show_error;

            if (account != null)
            {
                gallery_entry.Text   = account.Name;
                url_entry.Text       = account.Url;
                password_entry.Text  = account.Password;
                username_entry.Text  = account.Username;
                add_button.Label     = Gtk.Stock.Ok;
                add_dialog.Response += HandleEditResponse;
            }

            if (remove_button != null)
            {
                remove_button.Visible = account != null;
            }

            add_dialog.Show();

            gallery_entry.Changed  += HandleChanged;
            url_entry.Changed      += HandleChanged;
            password_entry.Changed += HandleChanged;
            username_entry.Changed += HandleChanged;
            HandleChanged(null, null);
        }
        void Initialize(Window parent)
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream("LadderLogic.Presentation.EnvironmentVariablesDialog.glade");

            var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);
            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));

            //_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
            //_thisDialog.Modal = true;
            //_thisDialog.TransientFor = parent;
            _thisDialog.SetPosition (WindowPosition.Center);

            var env = CController.Instance.GetEnvironmentVariables ();

            if (env != null) {
                etBoard.Text = env.ArduinoBoard;
                etPort.Text = env.ArduinoPort;
                etPath.Text = env.ArduinoPath;
            }
        }
		public FacebookTagPopup (Dictionary<long, User> friends)
		{
			Friends = friends;

			Glade.XML xml = new Glade.XML (null, "FacebookExport.glade", "facebook_tag_popup", "f-spot");
			xml.Autoconnect (this);

			Popup = xml.GetWidget ("facebook_tag_popup") as Gtk.Window;
			Popup.Show ();
		}
Beispiel #36
0
        public static void Main(string[] args)
        {
            string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            if(folderPath != null && folderPath.Length > 0)
            {
                if(folderPath[folderPath.Length - 1] != Path.DirectorySeparatorChar)
                {
                    folderPath += Path.DirectorySeparatorChar;
                }

                settingsFile = new FileInfo(folderPath + ".tehthuconfig");
            }

            Assembly ass = Assembly.GetExecutingAssembly();

            //Useful for seeing the names of embedded resources....
            /*
            string[] resources = ass.GetManifestResourceNames();
            foreach(string ss in resources)
            {
                Console.WriteLine("Resource " + ss);
            }
            */

            StreamReader ms = new StreamReader(new MemoryStream(TehthuGUI.Properties.Resources.teh));
            string gladefile = ms.ReadToEnd();

            Application.Init ();
            xml = new Glade.XML(gladefile, gladefile.Length, "MW", null);
            if(xml == null)
            {
                Console.WriteLine("Failed to open Glade XML file!");
                return;
            }

            mainwindow = (Gtk.Window) xml.GetWidget("MW");
            if(mainwindow == null)
            {
                Console.WriteLine("Failed to create main window!");
                return;
            }
            else
            {
                object[] _button_options = {Gtk.Stock.Open, Gtk.ResponseType.Accept, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, null};
                FileChooserDialog fcd = new FileChooserDialog("Open A Dictionary", mainwindow, FileChooserAction.Open, _button_options);

                inputView = (Gtk.TextView) xml.GetWidget("InputView");
                outputView = (Gtk.TextView) xml.GetWidget("OutputView");
                debugView = (Gtk.TextView) xml.GetWidget("DebugView");

                mainwindow.DestroyEvent += delegate(object o, DestroyEventArgs dea) {
                    Application.Quit();
                };

                mainwindow.Destroyed += delegate(object sender, EventArgs e) {
                    Application.Quit();
                };

                Gtk.MenuItem quit = (Gtk.MenuItem) xml.GetWidget("Quit");
                quit.Activated += delegate(object sender, EventArgs e) {
                    Application.Quit();
                };

                Gtk.Notebook nb = (Gtk.Notebook) xml.GetWidget("Notebook");

                Gtk.RadioButton leftButton = (Gtk.RadioButton) xml.GetWidget("LeftButton");
                leftButton.Toggled += delegate(object sender, EventArgs e) {
                    leftToRight = true;

                    try
                    {
                        Gtk.Label inputTabLabel = (Gtk.Label)nb.GetTabLabel(nb.GetNthPage(0));
                        inputTabLabel.Text = "Input ("
                            + (leftToRight ? teh.getLeftLanguageName() : teh.getRightLanguageName())
                            + ")";

                        Gtk.Label outputTabLabel = (Gtk.Label)nb.GetTabLabel(nb.GetNthPage(1));
                        outputTabLabel.Text = "Output ("
                            + (leftToRight ? teh.getRightLanguageName() : teh.getLeftLanguageName())
                            + ")";
                    }
                    catch (Exception eee)
                    {
                        Console.WriteLine("boo");
                    }
                };

                Gtk.RadioButton rightButton = (Gtk.RadioButton) xml.GetWidget("RightButton");
                rightButton.Toggled += delegate(object sender, EventArgs e) {
                    leftToRight = false;

                    try {
                    Gtk.Label inputTabLabel = (Gtk.Label) nb.GetTabLabel(nb.GetNthPage(0));
                    inputTabLabel.Text = "Input ("
                        + (leftToRight ? teh.getLeftLanguageName() : teh.getRightLanguageName())
                        + ")";

                    Gtk.Label outputTabLabel = (Gtk.Label) nb.GetTabLabel(nb.GetNthPage(1));
                    outputTabLabel.Text = "Output ("
                        + (leftToRight ? teh.getRightLanguageName() : teh.getLeftLanguageName())
                        + ")";
                    }
                    catch (Exception eee)
                    {
                        Console.WriteLine("boo");
                    }
                };

                Gtk.Entry input = (Gtk.Entry) xml.GetWidget("Input");
                input.KeyReleaseEvent += delegate(object _o, KeyReleaseEventArgs _args) {
                    if(_args.Event.Key == Gdk.Key.Return && input.Text.Length > 0)
                    {
                        string translated = teh.translate(input.Text, leftToRight ? TranslateDirection.LeftToRight : TranslateDirection.RightToLeft);
                        inputView.Buffer.Text += input.Text + Environment.NewLine;
                        outputView.Buffer.Text += translated + Environment.NewLine;
                        input.Text = "";
                    }
                };

                Gtk.Button send = (Gtk.Button) xml.GetWidget("Send");
                send.Pressed += delegate(object sender, EventArgs e) {
                    string translated = teh.translate(input.Text, leftToRight ? TranslateDirection.LeftToRight : TranslateDirection.RightToLeft);
                    inputView.Buffer.Text += input.Text + Environment.NewLine;
                    outputView.Buffer.Text += translated + Environment.NewLine;
                    input.Text = "";
                };

                input.Sensitive = false;
                send.Sensitive = false;
                input.IsEditable = false;

                Gtk.MenuItem open = (Gtk.MenuItem) xml.GetWidget("Open");
                open.Activated += delegate(object sender, EventArgs e) {
                    int retval = fcd.Run();

                    fcd.Hide();

                    if((int) Gtk.ResponseType.Accept != retval)
                    {
                        return;
                    }

                    initialize(new FileInfo(fcd.Filename), input, send, nb, leftButton, rightButton);
                };

                //If the settings file already has the name of a dictionary, try to open it.
                //We just want to read the file at this point, not write it.
                if(settingsFile.Exists)
                {
                    TextReader tr = new StreamReader(settingsFile.OpenRead());
                    String settingsLine = tr.ReadLine();
                    tr.Close();
                    if(settingsLine != null)
                    {
                        FileInfo sett = new FileInfo(settingsLine);
                        if(sett.Exists)
                        {
                            initialize(sett, input, send, nb, leftButton, rightButton);
                        }
                    }
                }

                mainwindow.Show();
            }

            Application.Run ();
            if(monitor != null && monitor.IsAlive)
            {
                monitor.Join(500);
                monitor.Abort();
            }
        }
		public void Run (FSpot.IBrowsableCollection photos)
		{
			if (null == photos) {
				throw new ArgumentNullException ("photos");
			}

			this.photos = photos;

			Glade.XML glade_xml = new Glade.XML (
					null, "TabbloExport.glade", DialogName,
					"f-spot");
			glade_xml.Autoconnect (this);

			dialog = (Gtk.Dialog) glade_xml.GetWidget (DialogName);

			FSpot.Widgets.IconView icon_view =
					new FSpot.Widgets.IconView (photos);
			icon_view.DisplayDates = false;
			icon_view.DisplayTags = false;

			username_entry.Changed += HandleAccountDataChanged;
			password_entry.Changed += HandleAccountDataChanged;
			ReadAccountData ();
			HandleAccountDataChanged (null, null);

			dialog.Modal = false;
			dialog.TransientFor = null;

			dialog.Response += HandleResponse;

			thumb_scrolled_window.Add (icon_view);
			icon_view.Show ();
			dialog.Show ();
		}
Beispiel #38
0
        public SingleView(Uri [] uris)
        {
            string glade_name = "single_view";

            this.uri = uris [0];

            System.Console.WriteLine("uri = {0}", uri.ToString());

            xml = new Glade.XML(null, "f-spot.glade", glade_name, "f-spot");
            xml.Autoconnect(this);
            window = (Gtk.Window)xml.GetWidget(glade_name);

            LoadPreference(Preferences.VIEWER_WIDTH);
            LoadPreference(Preferences.VIEWER_MAXIMIZED);

            Gtk.Toolbar toolbar = new Gtk.Toolbar();
            toolbar_hbox.PackStart(toolbar);
            Widget rl_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-rotate-270", new System.EventHandler(HandleRotate270Command));

            SetTip(rl_button, Catalog.GetString("Rotate photo left"));
            Widget rr_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-rotate-90", new System.EventHandler(HandleRotate90Command));

            SetTip(rr_button, Catalog.GetString("Rotate photo right"));

            toolbar.AppendSpace();

            Widget fs_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-fullscreen", new System.EventHandler(HandleViewFullscreen));

            SetTip(fs_button, Catalog.GetString("View photos fullscreen"));
            Widget ss_button = GtkUtil.MakeToolbarButton(toolbar, "f-spot-slideshow", new System.EventHandler(HandleViewSlideshow));

            SetTip(ss_button, Catalog.GetString("View photos in a slideshow"));

            collection = new UriCollection(uris);

            TargetEntry [] dest_table = { new TargetEntry("text/uri-list", 0, 0),
                                          new TargetEntry("text/plain",    0, 1) };

            directory_view = new IconView(collection);
            directory_view.Selection.Changed += HandleSelectionChanged;
            directory_view.DragDataReceived  += HandleDragDataReceived;
            Gtk.Drag.DestSet(directory_view, DestDefaults.All, dest_table,
                             DragAction.Copy | DragAction.Move);
            directory_view.DisplayTags  = false;
            directory_view.DisplayDates = false;
            directory_scrolled.Add(directory_view);

            ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw(); };

            image_view = new PhotoImageView(collection);
            FSpot.Global.ModifyColors(image_view);
            FSpot.Global.ModifyColors(image_scrolled);
            image_view.ZoomChanged      += HandleZoomChanged;
            image_view.Item.Changed     += HandleItemChanged;
            image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
            image_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet(image_view, DestDefaults.All, dest_table,
                             DragAction.Copy | DragAction.Move);
            image_scrolled.Add(image_view);

            Window.ShowAll();

            zoom_scale.ValueChanged += HandleZoomScaleValueChanged;

            LoadPreference(Preferences.VIEWER_SHOW_TOOLBAR);
            LoadPreference(Preferences.VIEWER_INTERPOLATION);
            LoadPreference(Preferences.VIEWER_TRANSPARENCY);
            LoadPreference(Preferences.VIEWER_TRANS_COLOR);

            ShowSidebar = collection.Count > 1;

            near_image.SetFromStock("f-spot-stock_near", Gtk.IconSize.SmallToolbar);
            far_image.SetFromStock("f-spot-stock_far", Gtk.IconSize.SmallToolbar);

            slide_delay = new FSpot.Delay(new GLib.IdleHandler(SlideShow));

            LoadPreference(Preferences.VIEWER_SHOW_FILENAMES);

            Preferences.SettingChanged += OnPreferencesChanged;
            window.DeleteEvent         += HandleDeleteEvent;

            collection.Changed += HandleCollectionChanged;
            UpdateStatusLabel();

            if (collection.Count > 0)
            {
                directory_view.Selection.Add(0);
            }

            export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem().Submenu;
            export.Submenu.ShowAll();
            export.Activated += HandleExportActivated;
        }
        void Initialize(Window parent, Exception ex)
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(AppController.Instance.Config.UnhandledExceptionDialog);

            var glade = new Glade.XML(stream, AppController.Instance.Config.UnhandledExceptionDialogName, null);
            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));

            //_thisDialog = ((Dialog)(glade.GetWidget(AppController.Instance.Config.UnhandledExceptionDialogName)));
            _thisDialog.Modal = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition (WindowPosition.Center);

            textview1.Buffer.Text = ex.ToString ();
        }
		public override Widget ConfigurationWidget () {
			xml = new Glade.XML (null, "f-spot.glade", "color_editor_prefs", "f-spot");
			xml.Autoconnect (this);
			AttachInterface ();
			return xml.GetWidget ("color_editor_prefs");;
		}
Beispiel #41
0
        public SingleView(Uri [] uris)
        {
            string glade_name = "single_view";

            this.uri = uris [0];

            System.Console.WriteLine("uri = {0}", uri.ToString());

            xml = new Glade.XML(null, "f-spot.glade", glade_name, "f-spot");
            xml.Autoconnect(this);
            window = (Gtk.Window)xml.GetWidget(glade_name);

            LoadPreference(Preferences.VIEWER_WIDTH);
            LoadPreference(Preferences.VIEWER_MAXIMIZED);

            Gtk.Toolbar toolbar = new Gtk.Toolbar();
            toolbar_hbox.PackStart(toolbar);

            ToolButton rl_button = GtkUtil.ToolButtonFromTheme("object-rotate-left", Catalog.GetString("Rotate Left"), true);

            rl_button.Clicked += HandleRotate270Command;
            rl_button.SetTooltip(toolTips, Catalog.GetString("Rotate photo left"), null);
            toolbar.Insert(rl_button, -1);

            ToolButton rr_button = GtkUtil.ToolButtonFromTheme("object-rotate-right", Catalog.GetString("Rotate Right"), true);

            rr_button.Clicked += HandleRotate90Command;
            rr_button.SetTooltip(toolTips, Catalog.GetString("Rotate photo right"), null);
            toolbar.Insert(rr_button, -1);

            toolbar.Insert(new SeparatorToolItem(), -1);

            ToolButton fs_button = GtkUtil.ToolButtonFromTheme("view-fullscreen", Catalog.GetString("Fullscreen"), true);

            fs_button.Clicked += HandleViewFullscreen;
            fs_button.SetTooltip(toolTips, Catalog.GetString("View photos fullscreen"), null);
            toolbar.Insert(fs_button, -1);

            ToolButton ss_button = GtkUtil.ToolButtonFromTheme("media-playback-start", Catalog.GetString("Slideshow"), true);

            ss_button.Clicked += HandleViewSlideshow;
            ss_button.SetTooltip(toolTips, Catalog.GetString("View photos in a slideshow"), null);
            toolbar.Insert(ss_button, -1);

            collection = new UriCollection(uris);

            TargetEntry [] dest_table = { new TargetEntry("text/uri-list", 0, 0),
                                          new TargetEntry("text/plain",    0, 1) };

            directory_view = new FSpot.Widgets.IconView(collection);
            directory_view.Selection.Changed += HandleSelectionChanged;
            directory_view.DragDataReceived  += HandleDragDataReceived;
            Gtk.Drag.DestSet(directory_view, DestDefaults.All, dest_table,
                             DragAction.Copy | DragAction.Move);
            directory_view.DisplayTags    = false;
            directory_view.DisplayDates   = false;
            directory_view.DisplayRatings = false;

            directory_scrolled = new ScrolledWindow();
            directory_scrolled.Add(directory_view);

            sidebar = new Sidebar();

            info_vbox.Add(sidebar);
            sidebar.AppendPage(directory_scrolled, Catalog.GetString("Folder"), "gtk-directory");

            AddinManager.AddExtensionNodeHandler("/FSpot/Sidebar", OnSidebarExtensionChanged);

            sidebar.Context = ViewContext.Single;

            sidebar.CloseRequested += HandleHideSidePane;
            sidebar.Show();

            ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw(); };

            image_view = new PhotoImageView(collection);
            GtkUtil.ModifyColors(image_view);
            GtkUtil.ModifyColors(image_scrolled);
            image_view.ZoomChanged      += HandleZoomChanged;
            image_view.Item.Changed     += HandleItemChanged;
            image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
            image_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet(image_view, DestDefaults.All, dest_table,
                             DragAction.Copy | DragAction.Move);
            image_scrolled.Add(image_view);

            Window.ShowAll();

            zoom_scale.ValueChanged += HandleZoomScaleValueChanged;

            LoadPreference(Preferences.VIEWER_SHOW_TOOLBAR);
            LoadPreference(Preferences.VIEWER_INTERPOLATION);
            LoadPreference(Preferences.VIEWER_TRANSPARENCY);
            LoadPreference(Preferences.VIEWER_TRANS_COLOR);

            ShowSidebar = collection.Count > 1;

            LoadPreference(Preferences.VIEWER_SHOW_FILENAMES);

            Preferences.SettingChanged += OnPreferencesChanged;
            window.DeleteEvent         += HandleDeleteEvent;

            collection.Changed += HandleCollectionChanged;

            // wrap the methods to fit to the delegate
            image_view.Item.Changed += delegate(BrowsablePointer pointer, BrowsablePointerChangedArgs old) {
                IBrowsableItem [] item       = { pointer.Current };
                PhotoArray        item_array = new PhotoArray(item);
                sidebar.HandleSelectionChanged(item_array);
            };

            image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged;

            UpdateStatusLabel();

            if (collection.Count > 0)
            {
                directory_view.Selection.Add(0);
            }

            export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem(this).Submenu;
            export.Submenu.ShowAll();
            export.Activated += HandleExportActivated;
        }
Beispiel #42
0
        void Initialize(Window parent, String text)
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(AppController.Instance.Config.SourceDialog);

            var glade = new Glade.XML(stream, "UnhandledExceptionDialog", null);
            if (stream != null)
            {
                stream.Close();
            }

            //Glade.XML glade = Glade.XML.FromAssembly("UnhandledExceptionDialog.glade","UnhandledExceptionDialog", null);
            //stream.Close();
            glade.Autoconnect(this);
            _thisDialog = ((Dialog)(glade.GetWidget("UnhandledExceptionDialog")));
            _thisDialog.Modal = true;
            _thisDialog.TransientFor = parent;
            _thisDialog.SetPosition (WindowPosition.Center);

            textview1.Buffer.Text = text;
            btnContinue.Clicked += (sender, e) => _thisDialog.HideAll();

            btnUpload.Clicked += OnUpload;

            miSave.Activated += OnSave;
            miSaveAs.Activated += OnSaveAs;
            miQuit.Activated += (object sender, EventArgs e) => _thisDialog.HideAll();
            miAbout.Activated += (object sender, EventArgs e) => new AboutDialog (_thisDialog).ShowDialog();
        }
		public SingleView (Uri [] uris) 
		{
			string glade_name = "single_view";
			this.uri = uris [0];
			
			System.Console.WriteLine ("uri = {0}", uri.ToString ());

			xml = new Glade.XML (null, "f-spot.glade", glade_name, "f-spot");
			xml.Autoconnect (this);
			window = (Gtk.Window) xml.GetWidget (glade_name);
		
			LoadPreference (Preferences.VIEWER_WIDTH);
			LoadPreference (Preferences.VIEWER_MAXIMIZED);

			Gtk.Toolbar toolbar = new Gtk.Toolbar ();
			toolbar_hbox.PackStart (toolbar);
			Widget rl_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-270", new System.EventHandler (HandleRotate270Command));
			SetTip (rl_button, Catalog.GetString ("Rotate photo left"));
			Widget rr_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-rotate-90", new System.EventHandler (HandleRotate90Command));
			SetTip (rr_button, Catalog.GetString ("Rotate photo right"));

			toolbar.AppendSpace ();

			Widget fs_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-fullscreen", new System.EventHandler (HandleViewFullscreen));
			SetTip (fs_button, Catalog.GetString ("View photos fullscreen"));
			Widget ss_button = GtkUtil.MakeToolbarButton (toolbar, "f-spot-slideshow", new System.EventHandler (HandleViewSlideshow));
			SetTip (ss_button, Catalog.GetString ("View photos in a slideshow"));

			collection = new UriCollection (uris);

			TargetEntry [] dest_table = {   new TargetEntry ("text/uri-list", 0, 0),
							new TargetEntry ("text/plain", 0, 1)};
			
			directory_view = new IconView (collection);
			directory_view.Selection.Changed += HandleSelectionChanged;
			directory_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table, 
					DragAction.Copy | DragAction.Move); 
			directory_view.DisplayTags = false;
			directory_view.DisplayDates = false;
			directory_scrolled.Add (directory_view);

			ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };

			image_view = new PhotoImageView (collection);
			FSpot.Global.ModifyColors (image_view);
			FSpot.Global.ModifyColors (image_scrolled);
			image_view.ZoomChanged += HandleZoomChanged;
			image_view.Item.Changed += HandleItemChanged;
			image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
			image_view.DragDataReceived += HandleDragDataReceived;
			Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
					DragAction.Copy | DragAction.Move); 
			image_scrolled.Add (image_view);
			
			Window.ShowAll ();

			zoom_scale.ValueChanged += HandleZoomScaleValueChanged;
		
			LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
 			LoadPreference (Preferences.VIEWER_INTERPOLATION);
			LoadPreference (Preferences.VIEWER_TRANSPARENCY);
			LoadPreference (Preferences.VIEWER_TRANS_COLOR);

			ShowSidebar = collection.Count > 1;

			near_image.SetFromStock ("f-spot-stock_near", Gtk.IconSize.SmallToolbar);
			far_image.SetFromStock ("f-spot-stock_far", Gtk.IconSize.SmallToolbar);

			slide_delay = new FSpot.Delay (new GLib.IdleHandler (SlideShow));

			LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);

			Preferences.SettingChanged += OnPreferencesChanged;
			window.DeleteEvent += HandleDeleteEvent;
			
			collection.Changed += HandleCollectionChanged;
			UpdateStatusLabel ();
			
			if (collection.Count > 0)
				directory_view.Selection.Add (0);

			export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem ().Submenu;
			export.Submenu.ShowAll ();
			export.Activated += HandleExportActivated ;
		}
 private void helpAboutMenuItemActivated(object o, EventArgs e)
 {
     Glade.XML glade = new Glade.XML(null, "gladecodegenerator.glade", "AboutDialog", null);
     Gtk.Dialog dialog = (Gtk.Dialog)glade.GetWidget("AboutDialog");
     dialog.Show();
     dialog.Run();
     dialog.Destroy();
 }
Beispiel #45
0
        public SingleView(Uri [] uris)
        {
            string glade_name = "single_view";
            this.uri = uris [0];

            xml = new Glade.XML (null, "f-spot.glade", glade_name, "f-spot");
            xml.Autoconnect (this);
            window = (Gtk.Window) xml.GetWidget (glade_name);

            LoadPreference (Preferences.VIEWER_WIDTH);
            LoadPreference (Preferences.VIEWER_MAXIMIZED);

            Gtk.Toolbar toolbar = new Gtk.Toolbar ();
            toolbar_hbox.PackStart (toolbar);

            rl_button = GtkUtil.ToolButtonFromTheme ("object-rotate-left", Catalog.GetString ("Rotate Left"), true);
            rl_button.Clicked += HandleRotate270Command;
            rl_button.SetTooltip (toolTips, Catalog.GetString ("Rotate photo left"), null);
            toolbar.Insert (rl_button, -1);

            rr_button = GtkUtil.ToolButtonFromTheme ("object-rotate-right", Catalog.GetString ("Rotate Right"), true);
            rr_button.Clicked += HandleRotate90Command;
            rr_button.SetTooltip (toolTips, Catalog.GetString ("Rotate photo right"), null);
            toolbar.Insert (rr_button, -1);

            toolbar.Insert (new SeparatorToolItem (), -1);

            ToolButton fs_button = GtkUtil.ToolButtonFromTheme ("view-fullscreen", Catalog.GetString ("Fullscreen"), true);
            fs_button.Clicked += HandleViewFullscreen;
            fs_button.SetTooltip (toolTips, Catalog.GetString ("View photos fullscreen"), null);
            toolbar.Insert (fs_button, -1);

            ToolButton ss_button = GtkUtil.ToolButtonFromTheme ("media-playback-start", Catalog.GetString ("Slideshow"), true);
            ss_button.Clicked += HandleViewSlideshow;
            ss_button.SetTooltip (toolTips, Catalog.GetString ("View photos in a slideshow"), null);
            toolbar.Insert (ss_button, -1);

            collection = new UriCollection (uris);

            TargetEntry [] dest_table = {
                FSpot.DragDropTargets.UriListEntry,
                FSpot.DragDropTargets.PlainTextEntry
            };

            directory_view = new FSpot.Widgets.IconView (collection);
            directory_view.Selection.Changed += HandleSelectionChanged;
            directory_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet (directory_view, DestDefaults.All, dest_table,
                    DragAction.Copy | DragAction.Move);
            directory_view.DisplayTags = false;
            directory_view.DisplayDates = false;
            directory_view.DisplayRatings = false;

            directory_scrolled = new ScrolledWindow();
            directory_scrolled.Add (directory_view);

            sidebar = new Sidebar ();

            info_vbox.Add (sidebar);
            sidebar.AppendPage (directory_scrolled, Catalog.GetString ("Folder"), "gtk-directory");

            AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged);

            sidebar.Context = ViewContext.Single;

            sidebar.CloseRequested += HandleHideSidePane;
            sidebar.Show ();

            ThumbnailGenerator.Default.OnPixbufLoaded += delegate { directory_view.QueueDraw (); };

            image_view = new PhotoImageView (collection);
            GtkUtil.ModifyColors (image_view);
            GtkUtil.ModifyColors (image_scrolled);
            image_view.ZoomChanged += HandleZoomChanged;
            image_view.Item.Changed += HandleItemChanged;
            image_view.ButtonPressEvent += HandleImageViewButtonPressEvent;
            image_view.DragDataReceived += HandleDragDataReceived;
            Gtk.Drag.DestSet (image_view, DestDefaults.All, dest_table,
                    DragAction.Copy | DragAction.Move);
            image_scrolled.Add (image_view);

            Window.ShowAll ();

            zoom_scale.ValueChanged += HandleZoomScaleValueChanged;

            LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR);
             			LoadPreference (Preferences.VIEWER_INTERPOLATION);
            LoadPreference (Preferences.VIEWER_TRANSPARENCY);
            LoadPreference (Preferences.VIEWER_TRANS_COLOR);

            ShowSidebar = collection.Count > 1;

            LoadPreference (Preferences.VIEWER_SHOW_FILENAMES);

            Preferences.SettingChanged += OnPreferencesChanged;
            window.DeleteEvent += HandleDeleteEvent;

            collection.Changed += HandleCollectionChanged;

            // wrap the methods to fit to the delegate
            image_view.Item.Changed += delegate (object sender, BrowsablePointerChangedEventArgs old) {
                    BrowsablePointer pointer = sender as BrowsablePointer;
                    if (pointer == null)
                        return;
                    IBrowsableItem [] item = {pointer.Current};
                    PhotoArray item_array = new PhotoArray (item);
                    sidebar.HandleSelectionChanged (item_array);
            };

            image_view.Item.Collection.ItemsChanged += sidebar.HandleSelectionItemsChanged;

            UpdateStatusLabel ();

            if (collection.Count > 0)
                directory_view.Selection.Add (0);

            export.Submenu = (Mono.Addins.AddinManager.GetExtensionNode ("/FSpot/Menus/Exports") as FSpot.Extensions.SubmenuNode).GetMenuItem (this).Submenu;
            export.Submenu.ShowAll ();
            export.Activated += HandleExportActivated ;
        }
Beispiel #46
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
            xml.Autoconnect (this);
            add_album_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_album_dialog");
            add_album_dialog.Modal = true;
            this.export = export;
            this.gallery = gallery;
            PopulateAlbums ();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Beispiel #47
0
        public void Run(IBrowsableCollection selection)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_export_dialog", "f-spot");
            xml.Autoconnect (this);
            export_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_export_dialog");

            this.items = selection.Items;
            Array.Sort<IBrowsableItem> (this.items as Photo[], new Photo.CompareDateName());
            album_button.Sensitive = false;
            IconView view = new IconView (selection);
            view.DisplayDates = false;
            view.DisplayTags = false;

            export_dialog.Modal = false;
            export_dialog.TransientFor = null;

            thumb_scrolledwindow.Add (view);
            view.Show ();
            export_dialog.Show ();

            GalleryAccountManager manager = GalleryAccountManager.GetInstance ();
            manager.AccountListChanged += PopulateGalleryOptionMenu;
            PopulateGalleryOptionMenu (manager, null);

            if (edit_button != null)
                edit_button.Clicked += HandleEditGallery;

            export_dialog.Response += HandleResponse;
            connect = true;
            HandleSizeActive (null, null);
            Connect ();

            LoadPreference (SCALE_KEY);
            LoadPreference (SIZE_KEY);
            LoadPreference (BROWSER_KEY);
            LoadPreference (META_KEY);
            LoadPreference (ROTATE_KEY);
        }