Пример #1
0
        static void gtml_import_full(object obj, EventArgs args)
        {
            Gtk.Dialog dialog = new Gtk.Dialog("Full Import", window, dflags);
            Gtk.Grid   dgrid  = new Gtk.Grid();
            Gtk.FileChooserButton[] import =
            {
                new Gtk.FileChooserButton("Full",    fcact),
                new Gtk.FileChooserButton("Partial", fcact),
                new Gtk.FileChooserButton("Link",    fcact),
                null
            };
            Gtk.Button[] importb =
            {
                new Gtk.Button("Full"),
                new Gtk.Button("Partial"),
                new Gtk.Button("Link"),
                null
            };

            //importb[0].TooltipText ("Moves all the application\'s information from its current location.");
            //importb[1].TooltipText ("Copies all the application\'s information from its current location.");
            //importb[2].TooltipText ("Links the application to the program.");

            dgrid.ColumnHomogeneous = true;

            dgrid.Attach(importb[0], 0, 0, 1, 1);
            dgrid.Attach(importb[1], 1, 0, 1, 1);
            dgrid.Attach(importb[2], 2, 0, 1, 1);
            dgrid.Attach(import[0], 0, 1, 1, 1);
            dgrid.Attach(import[1], 1, 1, 1, 1);
            dgrid.Attach(import[2], 2, 1, 1, 1);

            Gtk.Box dbox = dialog.ContentArea;
            dbox.PackStart(dgrid, true, true, 0);

            dialog.ShowAll();
            import[0].Hide();
            import[1].Hide();
            import[2].Hide();

            /*
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_show,timport);
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_hide,pimport);
             * g_signal_connect_swapped (tbutton,"clicked",(GCallback)gtk_widget_hide,limport);
             *
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_hide,timport);
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_show,pimport);
             * g_signal_connect_swapped (pbutton,"clicked",(GCallback)gtk_widget_hide,limport);
             *
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_hide,timport);
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_hide,pimport);
             * g_signal_connect_swapped (lbutton,"clicked",(GCallback)gtk_widget_show,limport);
             *
             * g_signal_connect (timport,"file-set",(GCallback)start_import,dialog);
             * g_signal_connect (pimport,"file-set",(GCallback)start_import,dialog);
             * g_signal_connect (limport,"file-set",(GCallback)start_import,dialog);
             *
             */
        }
Пример #2
0
        static void create_stacks(string name, string location)
        {
            Gtk.Grid    sgrid    = new Gtk.Grid();
            Gtk.Entry[] password =
            {
                new Gtk.Entry("Password"),
                new Gtk.Entry("New Password"),
                null
            };
            Gtk.Label          slabel  = new Gtk.Label(name);
            Gtk.ToggleButton[] switchs =
            {
                new Gtk.ToggleButton("Secure"),
                new Gtk.ToggleButton("Launch"),
                null
            };

            sgrid.ColumnHomogeneous = true;
            switchs[1].Active       = true;

            password[1].Sensitive  = false;
            password[0].Visibility = false;
            password[1].Visibility = false;

            //password[0].Activated += new EventHandler ();
            //password[1].Activated += new EventHandler ();
            //switchs[0].Activated += new EventHandler (zero_tog);
            //switchs[1].Activated += new EventHandler (zero_tog);

            sgrid.Attach(switchs[0], 1, 2, 1, 1);
            sgrid.Attach(switchs[1], 0, 2, 1, 1);
            sgrid.Attach(password[0], 0, 3, 1, 1);
            sgrid.Attach(password[1], 1, 3, 1, 1);

            /*
             * g_signal_connect (password[0],"activate",(GCallback)check_pass,password[1]);
             * g_signal_connect_swapped (password[1],"activate",(GCallback)check_pass,password[0]);
             * g_signal_connect (switchs[0],"toggled",(GCallback)zero_tog,switchs[1]);
             * g_signal_connect (switchs[1],"toggled",(GCallback)zero_tog,switchs[0]);
             * g_signal_connect_swapped (switchs[0],"toggled",(GCallback)zero_act,password[1]);
             * g_signal_connect_swapped (switchs[1],"toggled",(GCallback)one_act,password[1]);
             */
            sgrid.ShowAll();
            one_act(password[1], switchs[1]);
            stack.AppendPage(sgrid, slabel);
            stack.SetMenuLabelText(sgrid, name);
        }
Пример #3
0
        static void gtml_activate()
        {
            icons = new Gtk.IconFactory();
            icons.AddDefault();

            window              = new Gtk.Window(PN);
            window.DeleteEvent += new DeleteEventHandler(Window_Delete);
            window.SetDefaultSize(800, 120);
            window.Decorated = true;

            grid = new Gtk.Grid();
            grid.ColumnHomogeneous = true;

            Gtk.Image icon = new Gtk.Image();
            icon.IconName          = ("list-add-symbolic");
            import_button          = new Gtk.Button(icon);
            import_button.Clicked += new EventHandler(gtml_import_full);
            Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1);
            naw.PackStart(import_button, true, true, 1);
            naw.ShowAll();

            stack             = new Gtk.Notebook();
            stack.EnablePopup = true;
            stack.GroupName   = "Mozilla Programs";
            stack.Scrollable  = true;

            stack.SetActionWidget(naw, Gtk.PackType.End);

            stack.Hexpand = true;
            stack.Vexpand = true;

            grid.Attach(stack, 1, 1, 1, 1);
            gtml_reload();

            window.Add(grid);

            window.ShowAll();
        }
Пример #4
0
        void ReloadObjectBoxes()
        {
            objectBoxDict.Clear();
            objectBoxContainer.Foreach((c) => c.Dispose());

            Gtk.Grid grid = new Gtk.Grid();
            grid.ColumnSpacing = 6;
            grid.RowSpacing    = 6;

            int left = 0, top = 0;

            foreach (ObjectGroup group in topObjectGroup.GetAllGroups())
            {
                var objectBox = new ObjectBox(group);

                Gtk.Box box = new Gtk.HBox();

                objectBox.AddTileSelectedHandler(delegate(object sender, int index) {
                    if (!disableBoxCallback)
                    {
                        SelectObject(objectBox.ObjectGroup, index);
                    }
                });

                objectBox.Halign = Gtk.Align.Center;
                objectBoxDict.Add(group, objectBox);

                Gtk.Frame frame = new Gtk.Frame();
                frame.Label  = GetGroupName(group);
                frame.Halign = Gtk.Align.Center;
                frame.Add(objectBox);

                if (group.GetGroupType() == ObjectGroupType.Shared)
                {
                    box.Add(frame);
                    Gtk.Button button = new Button(new Gtk.Image(Stock.Remove, IconSize.Button));
                    button.Halign = Gtk.Align.Center;
                    button.Valign = Gtk.Align.Center;

                    button.Clicked += (sender, args) => {
                        if (selectedObjectGroup == group)
                        {
                            selectedObjectGroup = null;
                            activeObject        = null;
                            selectedIndex       = -1;
                        }
                        topObjectGroup.RemoveGroup(group);
                        ReloadObjectBoxes();
                    };

                    box.Add(button);
                }
                else
                {
                    box.Add(frame);
                }
                grid.Attach(box, left, top, 1, 1);
                left++;
                if (left == 2)
                {
                    left = 0;
                    top++;
                }
            }

            objectBoxContainer.Add(grid);
            SelectObject(TopObjectGroup, -1);
            this.ShowAll();
        }
Пример #5
0
 private void InitializeGtkObjects(Gtk.Builder b) {
   m_adjustmentAudioPaddingAfter = (Gtk.Adjustment) b.GetObject("adjustment_audio_padding_after");
   m_adjustmentAudioPaddingBefore = (Gtk.Adjustment) b.GetObject("adjustment_audio_padding_before");
   m_adjustmentMaxImageHeight = (Gtk.Adjustment) b.GetObject("adjustment_max_image_height");
   m_adjustmentMaxImageWidth = (Gtk.Adjustment) b.GetObject("adjustment_max_image_width");
   m_episodeAdjustment = (Gtk.Adjustment) b.GetObject("episode_adjustment");
   m_image1 = (Gtk.Image) b.GetObject("image1");
   m_liststoreImageRescaleOptions = (Gtk.ListStore) b.GetObject("liststore_image_rescale_options");
   m_liststoreLanguages = (Gtk.ListStore) b.GetObject("liststore_languages");
   m_liststoreLines = (Gtk.ListStore) b.GetObject("liststore_lines");
   m_previewWindow = (Gtk.Window) b.GetObject("preview_window");
   m_box5 = (Gtk.Box) b.GetObject("box5");
   m_toolbarPreview = (Gtk.Toolbar) b.GetObject("toolbar_preview");
   m_toolbuttonGo = (Gtk.ToolButton) b.GetObject("toolbutton_go");
   m_toolbuttonRefresh = (Gtk.ToolButton) b.GetObject("toolbutton_refresh");
   m_toolbuttonSeparator1 = (Gtk.SeparatorToolItem) b.GetObject("toolbutton_separator1");
   m_toolbuttonSelectAll = (Gtk.ToolButton) b.GetObject("toolbutton_select_all");
   m_toolbuttonSelectNone = (Gtk.ToolButton) b.GetObject("toolbutton_select_none");
   m_toolbuttonInvert = (Gtk.ToolButton) b.GetObject("toolbutton_invert");
   m_toolbuttonSeparator2 = (Gtk.SeparatorToolItem) b.GetObject("toolbutton_separator2");
   m_toolbuttonToggleActivation = (Gtk.ToolButton) b.GetObject("toolbutton_toggle_activation");
   m_toolbuttonMerge = (Gtk.ToolButton) b.GetObject("toolbutton_merge");
   m_scrolledwindow1 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow1");
   m_treeviewLines = (Gtk.TreeView) b.GetObject("treeview_lines");
   m_treeviewSelectionLines = (Gtk.TreeSelection) b.GetObject("treeview-selection_lines");
   m_treeviewcolumnTargetLanguage = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_target_language");
   m_cellrenderertextTargetLanguage = (Gtk.CellRendererText) b.GetObject("cellrenderertext_target_language");
   m_treeviewcolumnNativeLanguage = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_native_language");
   m_cellrenderertextNativeLanguage = (Gtk.CellRendererText) b.GetObject("cellrenderertext_native_language");
   m_treeviewcolumnActors = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_actors");
   m_cellrenderertextActors = (Gtk.CellRendererText) b.GetObject("cellrenderertext_actors");
   m_treeviewcolumnStart = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_start");
   m_cellrendertextStart = (Gtk.CellRendererText) b.GetObject("cellrendertext_start");
   m_cellrendertextDuration = (Gtk.CellRendererText) b.GetObject("cellrendertext_duration");
   m_frame10 = (Gtk.Frame) b.GetObject("frame10");
   m_alignment10 = (Gtk.Alignment) b.GetObject("alignment10");
   m_grid4 = (Gtk.Grid) b.GetObject("grid4");
   m_buttonReplaceInSub2 = (Gtk.Button) b.GetObject("button_replace_in_sub2");
   m_buttonSelectLinesBySearch = (Gtk.Button) b.GetObject("button_select_lines_by_search");
   m_buttonReplaceInSub1 = (Gtk.Button) b.GetObject("button_replace_in_sub1");
   m_entryLinesSearch = (Gtk.Entry) b.GetObject("entry_lines_search");
   m_entryReplaceRegexTo = (Gtk.Entry) b.GetObject("entry_replace_regex_to");
   m_entryReplaceRegexFrom = (Gtk.Entry) b.GetObject("entry_replace_regex_from");
   m_label5 = (Gtk.Label) b.GetObject("label5");
   m_label17 = (Gtk.Label) b.GetObject("label17");
   m_labelNumCardsSelected = (Gtk.Label) b.GetObject("label_num_cards_selected");
   m_frame11 = (Gtk.Frame) b.GetObject("frame11");
   m_alignment11 = (Gtk.Alignment) b.GetObject("alignment11");
   m_box7 = (Gtk.Box) b.GetObject("box7");
   m_frame12 = (Gtk.Frame) b.GetObject("frame12");
   m_box11 = (Gtk.Box) b.GetObject("box11");
   m_eventboxImagePreview = (Gtk.EventBox) b.GetObject("eventbox_image_preview");
   m_imagePreview = (Gtk.Image) b.GetObject("image_preview");
   m_buttonPlayContent = (Gtk.Button) b.GetObject("button_play_content");
   m_label23 = (Gtk.Label) b.GetObject("label23");
   m_frame13 = (Gtk.Frame) b.GetObject("frame13");
   m_box12 = (Gtk.Box) b.GetObject("box12");
   m_scrolledwindow2 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow2");
   m_textviewTargetLanguage = (Gtk.TextView) b.GetObject("textview_target_language");
   m_scrolledwindow3 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow3");
   m_textviewNativeLanguage = (Gtk.TextView) b.GetObject("textview_native_language");
   m_label24 = (Gtk.Label) b.GetObject("label24");
   m_label22 = (Gtk.Label) b.GetObject("label22");
   m_liststoreSubEncoding = (Gtk.ListStore) b.GetObject("liststore_sub_encoding");
   m_liststoreSubStreams = (Gtk.ListStore) b.GetObject("liststore_sub_streams");
   m_subtitleOptionsWindow = (Gtk.Window) b.GetObject("subtitle_options_window");
   m_box13 = (Gtk.Box) b.GetObject("box13");
   m_frame14 = (Gtk.Frame) b.GetObject("frame14");
   m_comboboxSubEncoding = (Gtk.ComboBox) b.GetObject("combobox_sub_encoding");
   m_cellrenderertextSubEncoding = (Gtk.CellRendererText) b.GetObject("cellrenderertext_sub_encoding");
   m_label3 = (Gtk.Label) b.GetObject("label3");
   m_frame15 = (Gtk.Frame) b.GetObject("frame15");
   m_comboboxSubStream = (Gtk.ComboBox) b.GetObject("combobox_sub_stream");
   m_cellrendertextSubStreams = (Gtk.CellRendererText) b.GetObject("cellrendertext_sub_streams");
   m_label4 = (Gtk.Label) b.GetObject("label4");
   m_buttonSubOptionsApply = (Gtk.Button) b.GetObject("button_sub_options_apply");
   m_numericalAdjustmentSub1 = (Gtk.Adjustment) b.GetObject("numerical_adjustment_sub1");
   m_numericalAdjustmentSub2 = (Gtk.Adjustment) b.GetObject("numerical_adjustment_sub2");
   m_mainWindow = (Gtk.Window) b.GetObject("main_window");
   m_box1 = (Gtk.Box) b.GetObject("box1");
   m_menubar1 = (Gtk.MenuBar) b.GetObject("menubar1");
   m_menuitem1 = (Gtk.MenuItem) b.GetObject("menuitem1");
   m_menu1 = (Gtk.Menu) b.GetObject("menu1");
   m_imagemenuitemNew = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_new");
   m_imagemenuitemOpen = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_open");
   m_imagemenuitemSave = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_save");
   m_imagemenuitemSaveAs = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_save_as");
   m_separatormenuitem1 = (Gtk.SeparatorMenuItem) b.GetObject("separatormenuitem1");
   m_imagemenuitemClose = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_close");
   m_menuitem3 = (Gtk.MenuItem) b.GetObject("menuitem3");
   m_menu3 = (Gtk.Menu) b.GetObject("menu3");
   m_imagemenuitem10 = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem10");
   m_infobar1 = (Gtk.InfoBar) b.GetObject("infobar1");
   m_infobarActionArea = (Gtk.ButtonBox) b.GetObject("infobar-action_area");
   m_infobarContentArea = (Gtk.Box) b.GetObject("infobar-content_area");
   m_labelInInfobar = (Gtk.Label) b.GetObject("label_in_infobar");
   m_box2 = (Gtk.Box) b.GetObject("box2");
   m_frame1 = (Gtk.Frame) b.GetObject("frame1");
   m_alignment1 = (Gtk.Alignment) b.GetObject("alignment1");
   m_grid1 = (Gtk.Grid) b.GetObject("grid1");
   m_entryTargetLanguage = (Gtk.Entry) b.GetObject("entry_target_language");
   m_entryOutputDirectory = (Gtk.Entry) b.GetObject("entry_output_directory");
   m_entryNativeLanguage = (Gtk.Entry) b.GetObject("entry_native_language");
   m_entryVideoFile = (Gtk.Entry) b.GetObject("entry_video_file");
   m_buttonTargetLanguageChoose = (Gtk.Button) b.GetObject("button_target_language_choose");
   m_buttonDirectoryChoose = (Gtk.Button) b.GetObject("button_directory_choose");
   m_buttonNativeLanguageChoose = (Gtk.Button) b.GetObject("button_native_language_choose");
   m_buttonVideoFileChoose = (Gtk.Button) b.GetObject("button_video_file_choose");
   m_buttonTargetLanguageOptions = (Gtk.Button) b.GetObject("button_target_language_options");
   m_buttonNativeLanguageOptions = (Gtk.Button) b.GetObject("button_native_language_options");
   m_buttonVideoOptions = (Gtk.Button) b.GetObject("button_video_options");
   m_buttonAudioChoose = (Gtk.Button) b.GetObject("button_audio_choose");
   m_entryAudioFile = (Gtk.Entry) b.GetObject("entry_audio_file");
   m_label1 = (Gtk.Label) b.GetObject("label1");
   m_frame2 = (Gtk.Frame) b.GetObject("frame2");
   m_alignment2 = (Gtk.Alignment) b.GetObject("alignment2");
   m_grid5 = (Gtk.Grid) b.GetObject("grid5");
   m_expanderSubtitleOptions = (Gtk.Expander) b.GetObject("expander_subtitle_options");
   m_box9 = (Gtk.Box) b.GetObject("box9");
   m_frame4 = (Gtk.Frame) b.GetObject("frame4");
   m_alignment4 = (Gtk.Alignment) b.GetObject("alignment4");
   m_grid2 = (Gtk.Grid) b.GetObject("grid2");
   m_label8 = (Gtk.Label) b.GetObject("label8");
   m_label9 = (Gtk.Label) b.GetObject("label9");
   m_comboboxtextCorrectTimingsModeSub1 = (Gtk.ComboBoxText) b.GetObject("comboboxtext_correct_timings_mode_sub1");
   m_spinbuttonSub1TimeShift = (Gtk.SpinButton) b.GetObject("spinbutton_sub1_time_shift");
   m_label6 = (Gtk.Label) b.GetObject("label6");
   m_frame5 = (Gtk.Frame) b.GetObject("frame5");
   m_alignment5 = (Gtk.Alignment) b.GetObject("alignment5");
   m_grid3 = (Gtk.Grid) b.GetObject("grid3");
   m_label7 = (Gtk.Label) b.GetObject("label7");
   m_label10 = (Gtk.Label) b.GetObject("label10");
   m_comboboxtextCorrectTimingsModeSub2 = (Gtk.ComboBoxText) b.GetObject("comboboxtext_correct_timings_mode_sub2");
   m_spinbuttonSub2TimeShift = (Gtk.SpinButton) b.GetObject("spinbutton_sub2_time_shift");
   m_label12 = (Gtk.Label) b.GetObject("label12");
   m_frame3 = (Gtk.Frame) b.GetObject("frame3");
   m_alignment3 = (Gtk.Alignment) b.GetObject("alignment3");
   m_box3 = (Gtk.Box) b.GetObject("box3");
   m_checkbuttonUseSub1Timings = (Gtk.CheckButton) b.GetObject("checkbutton_use_sub1_timings");
   m_checkbuttonUseSub2Timings = (Gtk.CheckButton) b.GetObject("checkbutton_use_sub2_timings");
   m_label11 = (Gtk.Label) b.GetObject("label11");
   m_label20 = (Gtk.Label) b.GetObject("label20");
   m_expanderAudioOptions = (Gtk.Expander) b.GetObject("expander_audio_options");
   m_box15 = (Gtk.Box) b.GetObject("box15");
   m_frame17 = (Gtk.Frame) b.GetObject("frame17");
   m_alignment14 = (Gtk.Alignment) b.GetObject("alignment14");
   m_box16 = (Gtk.Box) b.GetObject("box16");
   m_checkbuttonNormalizeAudio = (Gtk.CheckButton) b.GetObject("checkbutton_normalize_audio");
   m_checkbuttonDeactivateAudioClips = (Gtk.CheckButton) b.GetObject("checkbutton_deactivate_audio_clips");
   m_label26 = (Gtk.Label) b.GetObject("label26");
   m_frame16 = (Gtk.Frame) b.GetObject("frame16");
   m_alignment13 = (Gtk.Alignment) b.GetObject("alignment13");
   m_grid6 = (Gtk.Grid) b.GetObject("grid6");
   m_label28 = (Gtk.Label) b.GetObject("label28");
   m_label29 = (Gtk.Label) b.GetObject("label29");
   m_spinbuttonAudioPaddingBefore = (Gtk.SpinButton) b.GetObject("spinbutton_audio_padding_before");
   m_spinbuttonAudioPaddingAfter = (Gtk.SpinButton) b.GetObject("spinbutton_audio_padding_after");
   m_label27 = (Gtk.Label) b.GetObject("label27");
   m_label53 = (Gtk.Label) b.GetObject("label53");
   m_expanderImageOptions = (Gtk.Expander) b.GetObject("expander_image_options");
   m_box17 = (Gtk.Box) b.GetObject("box17");
   m_frame19 = (Gtk.Frame) b.GetObject("frame19");
   m_alignment16 = (Gtk.Alignment) b.GetObject("alignment16");
   m_spinbuttonMaxImageWidth = (Gtk.SpinButton) b.GetObject("spinbutton_max_image_width");
   m_spinbuttonMaxImageHeight = (Gtk.SpinButton) b.GetObject("spinbutton_max_image_height");
   m_comboboxtextRescaleMode = (Gtk.ComboBox) b.GetObject("comboboxtext_rescale_mode");
   m_label13 = (Gtk.Label) b.GetObject("label13");
   m_label2 = (Gtk.Label) b.GetObject("label2");
   m_frame7 = (Gtk.Frame) b.GetObject("frame7");
   m_alignment7 = (Gtk.Alignment) b.GetObject("alignment7");
   m_label16 = (Gtk.Label) b.GetObject("label16");
   m_spinbuttonEpisodeNumber = (Gtk.SpinButton) b.GetObject("spinbutton_episode_number");
   m_entryDeckName = (Gtk.Entry) b.GetObject("entry_deck_name");
   m_label15 = (Gtk.Label) b.GetObject("label15");
   m_buttonPreview = (Gtk.Button) b.GetObject("button_preview");
   m_label18 = (Gtk.Label) b.GetObject("label18");
   m_label19 = (Gtk.Label) b.GetObject("label19");
   m_comboboxTargetLanguage = (Gtk.ComboBox) b.GetObject("combobox_target_language");
   m_label14 = (Gtk.Label) b.GetObject("label14");
   m_windowProgressInfo = (Gtk.Window) b.GetObject("window_progress_info");
   m_alignment12 = (Gtk.Alignment) b.GetObject("alignment12");
   m_box14 = (Gtk.Box) b.GetObject("box14");
   m_progressbarProgressInfo = (Gtk.ProgressBar) b.GetObject("progressbar_progress_info");
   m_buttonCancelOperation = (Gtk.Button) b.GetObject("button_cancel_operation");
 }