Allow to add separator
Until now, all the menu entries were shown in a continuous list, one after another. This patch allows to add separators between entries.
This commit is contained in:
parent
8719778d22
commit
c222c4ab14
8 changed files with 616 additions and 214 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.1 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkListStore" id="disc_size_list">
|
||||
|
|
@ -52,6 +52,9 @@
|
|||
<signal name="drag-data-received" handler="on_wmain_window_drag_data_received" swapped="no"/>
|
||||
<signal name="drag-drop" handler="on_wmain_window_drag_drop" swapped="no"/>
|
||||
<signal name="drag-motion" handler="on_wmain_window_drag_motion" swapped="no"/>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="visible">True</property>
|
||||
|
|
@ -294,14 +297,43 @@
|
|||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="add_file">
|
||||
<property name="label">gtk-add</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_add_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Add file</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -311,14 +343,43 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="delete_file">
|
||||
<property name="label">gtk-remove</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_delete_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-remove</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Remove</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -328,14 +389,43 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="down_file">
|
||||
<property name="label">gtk-go-down</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_down_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-go-down</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Move down</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -345,14 +435,43 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="up_file">
|
||||
<property name="label">gtk-go-up</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_up_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-go-up</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Move up</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -362,14 +481,43 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="properties_file">
|
||||
<property name="label">gtk-properties</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_properties_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-properties</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Properties</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -382,7 +530,6 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="yalign">0.4699999988079071</property>
|
||||
<property name="image_position">top</property>
|
||||
<signal name="clicked" handler="on_preview_file_clicked" swapped="no"/>
|
||||
<child>
|
||||
|
|
@ -423,6 +570,51 @@
|
|||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="preview_file1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image_position">top</property>
|
||||
<signal name="clicked" handler="on_add_separator_clicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="box2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">insert-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Add separator</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -771,8 +963,5 @@
|
|||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,17 @@
|
|||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="title_horizontal">
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="title_vertical">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="menu">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="modal">True</property>
|
||||
|
|
@ -709,98 +720,125 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid3">
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label22">
|
||||
<object class="GtkAlignment">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Unselected titles:</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label22">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Unselected:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label23">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Shadows:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label24">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Selected:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label25">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Background:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unselected_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="shadow_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="selected_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="background_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label23">
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Shadows:</property>
|
||||
<property name="label" translatable="yes"><b>Titles</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label24">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Selected title:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label25">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Background color:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="unselected_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="shadow_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="selected_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="background_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -809,6 +847,131 @@
|
|||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Color:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Shadows:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="separator_color">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="separator_shadow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="separator_background">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_alpha">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label18">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Background:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Separators</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
@ -1168,15 +1331,10 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="title_horizontal">
|
||||
<property name="lower">-100</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="title_vertical">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
<object class="GtkSizeGroup" id="color_sizes">
|
||||
<widgets>
|
||||
<widget name="grid3"/>
|
||||
<widget name="grid4"/>
|
||||
</widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
|
||||
self.add_colorbutton("title_color", (0, 0, 0, 1), self.update_preview)
|
||||
self.add_colorbutton("title_shadow", (0, 0, 0, 0), self.update_preview)
|
||||
self.add_colorbutton("unselected_color",
|
||||
(1, 1, 1, 1), self.update_preview)
|
||||
self.add_colorbutton("unselected_color", (1, 1, 1, 1), self.update_preview)
|
||||
self.add_colorbutton("shadow_color", (0, 0, 0, 0), self.update_preview)
|
||||
self.add_colorbutton(
|
||||
"selected_color", (0, 1, 1, 1), self.update_preview)
|
||||
self.add_colorbutton("background_color",
|
||||
(0, 0, 0, 0.75), self.update_preview)
|
||||
self.add_colorbutton("selected_color", (0, 1, 1, 1), self.update_preview)
|
||||
self.add_colorbutton("background_color", (0, 0, 0, 0.75), self.update_preview)
|
||||
self.add_colorbutton("separator_color", (0, 0, 0, 1), self.update_preview)
|
||||
self.add_colorbutton("separator_shadow", (0, 0, 0, 0), self.update_preview)
|
||||
self.add_colorbutton("separator_background", (1, 1, 1, 0.75), self.update_preview)
|
||||
|
||||
self.add_text("title_text", None, self.update_preview)
|
||||
|
||||
|
|
@ -79,17 +79,13 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
self.audio_rate = 224
|
||||
|
||||
def on_help_clicked(self, b):
|
||||
|
||||
help_file = devedeng.help.help("menu.html")
|
||||
|
||||
def get_estimated_size(self):
|
||||
|
||||
estimated_size = ((self.video_rate + self.audio_rate)
|
||||
* self.sound_length) / 8
|
||||
estimated_size = ((self.video_rate + self.audio_rate) * self.sound_length) / 8
|
||||
return estimated_size
|
||||
|
||||
def update_music(self, b=None):
|
||||
|
||||
self.store_ui(self.builder)
|
||||
cv = devedeng.converter.converter.get_converter()
|
||||
film_analizer = (cv.get_film_analizer())()
|
||||
|
|
@ -104,25 +100,21 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
self.sound_length = film_analizer.original_length
|
||||
|
||||
def update_preview(self, b=None):
|
||||
|
||||
self.store_ui(self.builder)
|
||||
self.sf = None # force to repaint the menu
|
||||
self.wdrawing_area.queue_draw()
|
||||
|
||||
def on_default_background_clicked(self, b):
|
||||
|
||||
self.background_picture = self.default_background
|
||||
self.update_ui(self.builder)
|
||||
self.update_preview()
|
||||
|
||||
def on_no_sound_clicked(self, b):
|
||||
|
||||
self.background_music = self.default_sound
|
||||
self.sound_length = 30
|
||||
self.update_ui(self.builder)
|
||||
|
||||
def show_configuration(self, file_list):
|
||||
|
||||
self.builder = Gtk.Builder()
|
||||
self.builder.set_translation_domain(self.config.gettext_domain)
|
||||
self.file_list = file_list
|
||||
|
|
@ -177,17 +169,14 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
self.save_ui()
|
||||
|
||||
def on_accept_clicked(self, b):
|
||||
|
||||
self.store_ui(self.builder)
|
||||
self.wmenu.destroy()
|
||||
|
||||
def on_cancel_clicked(self, b):
|
||||
|
||||
self.restore_ui()
|
||||
self.wmenu.destroy()
|
||||
|
||||
def get_font_params(self, font_name):
|
||||
|
||||
font_elements = font_name.split(" ")
|
||||
|
||||
if (len(font_elements)) < 2:
|
||||
|
|
@ -257,12 +246,16 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
|
||||
if text is None:
|
||||
return
|
||||
|
||||
if text_type == "title":
|
||||
fgcolor = self.title_color
|
||||
bgcolor = self.title_shadow
|
||||
hard_borders = False
|
||||
font = self.title_font
|
||||
elif text_type == "menu_separator":
|
||||
fgcolor = self.separator_color
|
||||
bgcolor = self.separator_shadow
|
||||
hard_borders = False
|
||||
font = self.entry_font
|
||||
elif text_type == "menu_entry":
|
||||
fgcolor = self.unselected_color
|
||||
bgcolor = self.shadow_color
|
||||
|
|
@ -274,8 +267,7 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
hard_borders = True
|
||||
font = self.entry_font
|
||||
elif text_type == "menu_entry_activated":
|
||||
fgcolor = (1.0 - self.selected_color[0], 1.0 - self.selected_color[
|
||||
1], 1.0 - self.selected_color[2], self.selected_color[3])
|
||||
fgcolor = (1.0 - self.selected_color[0], 1.0 - self.selected_color[1], 1.0 - self.selected_color[2], self.selected_color[3])
|
||||
bgcolor = None
|
||||
hard_borders = True
|
||||
font = self.entry_font
|
||||
|
|
@ -330,15 +322,17 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
counter = 0
|
||||
for element in self.file_list:
|
||||
if element.show_in_menu:
|
||||
self.title_list.append((element, counter))
|
||||
counter += 1
|
||||
if element.element_type == "file_movie":
|
||||
self.title_list.append((element, counter))
|
||||
counter += 1
|
||||
else:
|
||||
self.title_list.append((element, None))
|
||||
|
||||
self.sf = None
|
||||
self.current_shown_page = 0
|
||||
self.wcurrent_page = None
|
||||
|
||||
def paint_menu(self, paint_background, paint_selected, paint_activated, page_number):
|
||||
|
||||
coordinates = []
|
||||
|
||||
if self.sf is None:
|
||||
|
|
@ -408,13 +402,13 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
height = (self.cached_menu_size + self.entry_vertical_margin) / 2.0
|
||||
|
||||
if (self.play_all_c):
|
||||
coordinates.append([xl, y - height, xr, y + height, "play_all"])
|
||||
coordinates.append([xl, y - height, xr, y + height, _("Play_all")])
|
||||
if self.playall_text == "":
|
||||
playalltext = "Play all"
|
||||
playalltext = _("Play all")
|
||||
else:
|
||||
playalltext = self.playall_text
|
||||
if paint_background:
|
||||
self.paint_base(xl, xr, y, 0)
|
||||
self.paint_base(xl, xr, y, 0, self.background_color)
|
||||
self.write_text(playalltext, "menu_entry", xl,
|
||||
xr, y, self.position_horizontal)
|
||||
if paint_selected:
|
||||
|
|
@ -426,25 +420,27 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
y += entry_height
|
||||
|
||||
for entry in self.title_list[page_number * entries_per_page:(page_number + 1) * entries_per_page]:
|
||||
coordinates.append([xl, y - height, xr, y + height, "entry"])
|
||||
text = entry[0].title_name
|
||||
if entry[0].element_type == "file_movie":
|
||||
text = entry[0].title_name
|
||||
is_movie = True
|
||||
coordinates.append([xl, y - height, xr, y + height, "entry"])
|
||||
else:
|
||||
text = entry[0].separator_name
|
||||
is_movie = False
|
||||
if paint_background:
|
||||
self.paint_base(xl, xr, y, 0)
|
||||
self.write_text(text, "menu_entry", xl, xr,
|
||||
y, self.position_horizontal)
|
||||
if paint_selected:
|
||||
self.write_text(text, "menu_entry_selected", xl,
|
||||
xr, y, self.position_horizontal)
|
||||
if paint_activated:
|
||||
self.write_text(text, "menu_entry_activated",
|
||||
xl, xr, y, self.position_horizontal)
|
||||
self.paint_base(xl, xr, y, 0, self.background_color if is_movie else self.separator_background)
|
||||
self.write_text(text, "menu_entry" if is_movie else "menu_separator", xl, xr, y, self.position_horizontal)
|
||||
if paint_selected and is_movie:
|
||||
self.write_text(text, "menu_entry_selected", xl, xr, y, self.position_horizontal)
|
||||
if paint_activated and is_movie:
|
||||
self.write_text(text, "menu_entry_activated", xl, xr, y, self.position_horizontal)
|
||||
y += entry_height
|
||||
|
||||
if paint_arrows:
|
||||
if page_number == 0:
|
||||
coordinates.append([xl, y - height, xr, y + height, "right"])
|
||||
if paint_background:
|
||||
self.paint_base(xl, xr, y, 0)
|
||||
self.paint_base(xl, xr, y, 0, self.background_color)
|
||||
self.paint_arrow(xl, xr, y, "menu_entry", False)
|
||||
if paint_selected:
|
||||
self.paint_arrow(xl, xr, y, "menu_entry_selected", False)
|
||||
|
|
@ -453,7 +449,7 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
elif page_number == (self.pages - 1):
|
||||
coordinates.append([xl, y - height, xr, y + height, "left"])
|
||||
if paint_background:
|
||||
self.paint_base(xl, xr, y, 0)
|
||||
self.paint_base(xl, xr, y, 0, self.background_color)
|
||||
self.paint_arrow(xl, xr, y, "menu_entry", True)
|
||||
if paint_selected:
|
||||
self.paint_arrow(xl, xr, y, "menu_entry_selected", True)
|
||||
|
|
@ -464,8 +460,8 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
coordinates.append([xl, y - height, med, y + height, "left"])
|
||||
coordinates.append([med, y - height, xr, y + height, "right"])
|
||||
if paint_background:
|
||||
self.paint_base(xl, xr, y, 1)
|
||||
self.paint_base(xl, xr, y, 2)
|
||||
self.paint_base(xl, xr, y, 1, self.background_color)
|
||||
self.paint_base(xl, xr, y, 2, self.background_color)
|
||||
self.paint_arrow(med, xr, y, "menu_entry", False)
|
||||
self.paint_arrow(xl, med, y, "menu_entry", True)
|
||||
if paint_selected:
|
||||
|
|
@ -476,7 +472,7 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
self.paint_arrow(xl, med, y, "menu_entry_activated", True)
|
||||
return coordinates
|
||||
|
||||
def paint_base(self, xl, xr, y, type_b):
|
||||
def paint_base(self, xl, xr, y, type_b, color):
|
||||
|
||||
height = self.cached_menu_size + self.entry_vertical_margin
|
||||
radius = (height) / 2.0
|
||||
|
|
@ -489,8 +485,7 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
|
|||
xl = (xl + xr) / 2.0
|
||||
xl += radius
|
||||
|
||||
self.cr.set_source_rgba(self.background_color[0], self.background_color[
|
||||
1], self.background_color[2], self.background_color[3])
|
||||
self.cr.set_source_rgba(color[0], color[1], color[2], color[3])
|
||||
self.cr.move_to(xl, y)
|
||||
self.cr.line_to(xr, y)
|
||||
self.cr.curve_to(xr + radius, y, xr + radius,
|
||||
|
|
|
|||
|
|
@ -56,8 +56,15 @@ class dvdauthor_converter(devedeng.executor.executor):
|
|||
self.progress_bar[1].set_text(data[0])
|
||||
return
|
||||
|
||||
def create_dvdauthor_xml(self, movie_folder, file_movies, menu_entries, start_with_menu, play_all_opt, menuWide):
|
||||
def create_dvdauthor_xml(self, movie_folder, file_movies_in, menu_entries, start_with_menu, play_all_opt, menuWide):
|
||||
|
||||
file_movies = []
|
||||
for element in file_movies_in:
|
||||
if element.element_type != "file_movie":
|
||||
continue
|
||||
file_movies.append(element)
|
||||
|
||||
print(file_movies)
|
||||
xmlpath = os.path.join(movie_folder, "xml_data")
|
||||
xml_file_path = os.path.join(xmlpath, "dvdauthor.xml")
|
||||
datapath = os.path.join(movie_folder, "dvd_tree")
|
||||
|
|
@ -243,16 +250,14 @@ class dvdauthor_converter(devedeng.executor.executor):
|
|||
xml_file.write('\t\t\t\t\tg0=1;\n')
|
||||
xml_file.write('\t\t\t\t\tjump vmgm menu;\n')
|
||||
else:
|
||||
xml_file.write(
|
||||
'\t\t\t\t\tg0=' + str(title_list[title_counter]) + ';\n')
|
||||
xml_file.write('\t\t\t\t\tg0={:};\n'.format(str(title_list[title_counter])))
|
||||
xml_file.write('\t\t\t\t\tjump vmgm menu;\n')
|
||||
title_counter += 1
|
||||
button_counter += 1
|
||||
xml_file.write('\t\t\t\t</button>\n')
|
||||
|
||||
if (menu_page["left"] is not None):
|
||||
xml_file.write('\t\t\t\t<button name="' +
|
||||
menu_page["left"] + '"> g1=')
|
||||
xml_file.write('\t\t\t\t<button name="' + menu_page["left"] + '"> g1=')
|
||||
xml_file.write(str(menu_number - 1))
|
||||
xml_file.write('; g2=1024; jump menu ')
|
||||
xml_file.write(str(menu_number))
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class file_movie(devedeng.interface_manager.interface_manager):
|
|||
|
||||
def __init__(self, file_name, list_files=None):
|
||||
|
||||
self.element_type = "file_movie"
|
||||
self.list_files = list_files
|
||||
|
||||
devedeng.interface_manager.interface_manager.__init__(self)
|
||||
|
|
@ -201,7 +202,7 @@ class file_movie(devedeng.interface_manager.interface_manager):
|
|||
self.aspect_ratio_final = None
|
||||
self.converted_filename = None
|
||||
|
||||
def set_title(self, new_title):
|
||||
def set_name(self, new_title):
|
||||
self.title_name = new_title
|
||||
self.emit('title_changed', self.title_name)
|
||||
|
||||
|
|
@ -428,20 +429,16 @@ class file_movie(devedeng.interface_manager.interface_manager):
|
|||
self.original_height * midle_aspect_ratio / self.aspect_ratio_final)
|
||||
|
||||
def set_type(self, obj=None, disc_type=None):
|
||||
|
||||
if (disc_type is not None):
|
||||
self.disc_type = disc_type
|
||||
|
||||
def delete_file(self):
|
||||
|
||||
def delete_element(self):
|
||||
return
|
||||
|
||||
def on_help_clicked(self, b):
|
||||
|
||||
devedeng.help.help("file.html")
|
||||
help_file = devedeng.help.help("file.html")
|
||||
|
||||
def properties(self):
|
||||
|
||||
if (self.wfile_properties is not None):
|
||||
self.wfile_properties.present()
|
||||
return
|
||||
|
|
@ -747,24 +744,20 @@ class file_movie(devedeng.interface_manager.interface_manager):
|
|||
disc_player.play_film(os.path.join(
|
||||
self.config.tmp_folder, "movie_preview.mpg"))
|
||||
|
||||
def store_file(self):
|
||||
|
||||
def store_element(self):
|
||||
data = self.serialize()
|
||||
if "files_to_set" in data:
|
||||
del data["files_to_set"]
|
||||
|
||||
data["element_type"] = "file_movie"
|
||||
return data
|
||||
|
||||
def restore_file(self, data):
|
||||
|
||||
def restore_element(self, data):
|
||||
self.unserialize(data)
|
||||
|
||||
def on_select_all_clicked(self, b):
|
||||
|
||||
sel = self.wtreeview_multiproperties.get_selection()
|
||||
sel.select_all()
|
||||
|
||||
def on_unselect_all_clicked(self, b):
|
||||
|
||||
sel = self.wtreeview_multiproperties.get_selection()
|
||||
sel.unselect_all()
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import devedeng.shutdown
|
|||
import devedeng.about
|
||||
import devedeng.opensave
|
||||
import devedeng.help
|
||||
import devedeng.separator
|
||||
|
||||
|
||||
class devede_project:
|
||||
|
|
@ -173,9 +174,7 @@ class devede_project:
|
|||
return ((None, -1, None, None))
|
||||
|
||||
def get_all_files(self):
|
||||
|
||||
retval = []
|
||||
|
||||
for row in self.wfiles.get_model():
|
||||
retval.append(row.model[row.iter][0])
|
||||
return retval
|
||||
|
|
@ -202,6 +201,8 @@ class devede_project:
|
|||
self.wproperties_file.set_sensitive(False)
|
||||
self.wpreview_file.set_sensitive(False)
|
||||
else:
|
||||
if element.element_type != "file_movie":
|
||||
self.wpreview_file.set_sensitive(False)
|
||||
nfiles = len(self.wfiles.get_model())
|
||||
if (nfiles < 1):
|
||||
self.wdelete_file.set_sensitive(False)
|
||||
|
|
@ -211,26 +212,24 @@ class devede_project:
|
|||
self.wdown_file.set_sensitive(False)
|
||||
|
||||
def on_cellrenderertext3_edited(self, widget, path, text):
|
||||
self.wliststore_files[path][0].set_title(text)
|
||||
element = self.wliststore_files[path][0]
|
||||
element.set_name(text)
|
||||
|
||||
def on_cellrenderertext4_toggled(self, widget, path):
|
||||
self.wliststore_files[path][0].set_show_in_menu(
|
||||
False if widget.get_active() else True)
|
||||
element = self.wliststore_files[path][0]
|
||||
element.set_show_in_menu(False if widget.get_active() else True)
|
||||
|
||||
def on_use_pal_toggled(self, b):
|
||||
|
||||
self.config.PAL = self.wuse_pal.get_active()
|
||||
self.set_interface_status(None)
|
||||
|
||||
def on_wmain_window_delete_event(self, b, e=None):
|
||||
|
||||
ask = devedeng.ask.ask_window()
|
||||
if (ask.run(_("Abort the current DVD and exit?"), _("Exit DeVeDe"))):
|
||||
Gtk.main_quit()
|
||||
return True
|
||||
|
||||
def title_changed(self, obj, new_title):
|
||||
|
||||
for item in self.wliststore_files:
|
||||
element = item.model[item.iter][0]
|
||||
if element == obj:
|
||||
|
|
@ -245,15 +244,12 @@ class devede_project:
|
|||
self.refresh_disc_usage()
|
||||
|
||||
def on_help_clicked(self, b):
|
||||
|
||||
help_file = devedeng.help.help("main.html")
|
||||
|
||||
def on_help_index_activate(self, b):
|
||||
|
||||
help_file = devedeng.help.help("index.html")
|
||||
|
||||
def on_add_file_clicked(self, b):
|
||||
|
||||
ask_files = devedeng.add_files.add_files()
|
||||
if (ask_files.run()):
|
||||
self.add_several_files(ask_files.files)
|
||||
|
|
@ -291,14 +287,17 @@ class devede_project:
|
|||
self.refresh_disc_usage()
|
||||
|
||||
def on_delete_file_clicked(self, b):
|
||||
|
||||
(element, position, model, treeiter) = self.get_current_file()
|
||||
if (element is None):
|
||||
return
|
||||
|
||||
ask_w = devedeng.ask.ask_window()
|
||||
if (ask_w.run(_("The file <b>%(X)s</b> <i>(%(Y)s)</i> will be removed.") % {"X": element.title_name, "Y": element.file_name}, _("Delete file"))):
|
||||
element.delete_file()
|
||||
if (element.element_type == "file_movie"):
|
||||
ask_w = devedeng.ask.ask_window()
|
||||
do_delete = ask_w.run(_("The file <b>%(X)s</b> <i>(%(Y)s)</i> will be removed.") % {"X": element.title_name, "Y": element.file_name}, _("Delete file"))
|
||||
else:
|
||||
do_delete = True
|
||||
if do_delete:
|
||||
element.delete_element()
|
||||
model.remove(treeiter)
|
||||
self.set_interface_status(None)
|
||||
self.refresh_disc_usage()
|
||||
|
|
@ -334,11 +333,12 @@ class devede_project:
|
|||
self.refresh_disc_usage()
|
||||
|
||||
def on_adjust_disc_usage_clicked(self, b):
|
||||
|
||||
total_resolution = 0
|
||||
fixed_size = 0
|
||||
to_adjust = []
|
||||
for f in self.get_all_files():
|
||||
if f.element_type != "file_movie":
|
||||
continue
|
||||
estimated_size, videorate_fixed_size, audio_rate, sub_rate, width, height, time_length = f.get_size_data()
|
||||
if videorate_fixed_size:
|
||||
fixed_size += estimated_size
|
||||
|
|
@ -408,10 +408,10 @@ class devede_project:
|
|||
self.refresh_disc_usage()
|
||||
|
||||
def refresh_disc_usage(self):
|
||||
|
||||
used = 0.0
|
||||
|
||||
for f in self.get_all_files():
|
||||
if f.element_type != "file_movie":
|
||||
continue
|
||||
estimated_size = f.get_estimated_size()
|
||||
used += float(estimated_size)
|
||||
|
||||
|
|
@ -434,7 +434,6 @@ class devede_project:
|
|||
self.wdisc_fill_level.set_show_text(True)
|
||||
|
||||
def on_menu_options_clicked(self, b):
|
||||
|
||||
self.menu.show_configuration(self.get_all_files())
|
||||
|
||||
def get_dvd_size(self):
|
||||
|
|
@ -480,18 +479,19 @@ class devede_project:
|
|||
return size, minvrate, maxvrate
|
||||
|
||||
def on_disc_size_changed(self, c):
|
||||
|
||||
self.refresh_disc_usage()
|
||||
|
||||
def on_create_disc_clicked(self, b):
|
||||
|
||||
if self.disc_type == "dvd":
|
||||
max_files = 62
|
||||
else:
|
||||
max_files = -1
|
||||
|
||||
file_movies = self.get_all_files()
|
||||
t = len(file_movies)
|
||||
t = 0
|
||||
for element in file_movies:
|
||||
if element.element_type == "file_movie":
|
||||
t += 1
|
||||
if (max_files != -1) and (t > max_files):
|
||||
devedeng.message.message_window(_("The limit for this format is %(l)d files, but your project has %(h)d.") % {"l": max_files, "h": t}, _("Too many files in the project"))
|
||||
return
|
||||
|
|
@ -553,6 +553,8 @@ class devede_project:
|
|||
else:
|
||||
extension = "mpg"
|
||||
for movie in file_movies:
|
||||
if movie.element_type != "file_movie":
|
||||
continue
|
||||
p = movie.do_conversion(os.path.join(
|
||||
movie_folder, "movie_{:d}.{:s}".format(counter, extension)))
|
||||
run_window.add_process(p)
|
||||
|
|
@ -593,7 +595,6 @@ class devede_project:
|
|||
run_window.run()
|
||||
|
||||
def disc_done(self, object, value):
|
||||
|
||||
if self.shutdown:
|
||||
Gtk.main_quit()
|
||||
devedeng.shutdown.shutdown()
|
||||
|
|
@ -617,26 +618,21 @@ class devede_project:
|
|||
self.wmain_window.show()
|
||||
|
||||
def disc_done2(self, object, value):
|
||||
|
||||
self.wmain_window.show()
|
||||
|
||||
def on_preview_file_clicked(self, b):
|
||||
|
||||
(element, position, model, treeiter) = self.get_current_file()
|
||||
if (element is None):
|
||||
return
|
||||
element.do_preview()
|
||||
|
||||
def on_settings_activate(self, b):
|
||||
|
||||
w = devedeng.settings.settings_window(self.wmain_window)
|
||||
|
||||
def on_about_activate(self, b):
|
||||
|
||||
w = devedeng.about.about_window()
|
||||
|
||||
def on_new_activate(self, b):
|
||||
|
||||
w = devedeng.ask.ask_window()
|
||||
if w.run(_("Close current project and start a fresh one?"), _("New project")):
|
||||
self.wliststore_files.clear()
|
||||
|
|
@ -664,7 +660,6 @@ class devede_project:
|
|||
self.on_save_as_activate(None)
|
||||
|
||||
def on_save_as_activate(self, b):
|
||||
|
||||
while True:
|
||||
w = devedeng.opensave.opensave_window(True)
|
||||
retval = w.run(self.project_file)
|
||||
|
|
@ -687,7 +682,6 @@ class devede_project:
|
|||
self.load_project(retval)
|
||||
|
||||
def save_current_project(self):
|
||||
|
||||
project = {}
|
||||
|
||||
project["PAL"] = self.wuse_pal.get_active()
|
||||
|
|
@ -695,9 +689,8 @@ class devede_project:
|
|||
project["disc_type"] = self.config.disc_type
|
||||
project["disc_size"] = self.wdisc_size.get_active()
|
||||
project["files"] = []
|
||||
f = self.get_all_files()
|
||||
for i in f:
|
||||
project["files"].append(i.store_file())
|
||||
for i in self.get_all_files():
|
||||
project["files"].append(i.store_element())
|
||||
if self.disc_type == "dvd":
|
||||
project["menu"] = self.menu.store_menu()
|
||||
|
||||
|
|
@ -708,7 +701,6 @@ class devede_project:
|
|||
recent_mgr.add_item(uri)
|
||||
|
||||
def load_project(self, project_file):
|
||||
|
||||
self.wliststore_files.clear()
|
||||
self.project_file = project_file
|
||||
with open(project_file, 'rb') as f:
|
||||
|
|
@ -725,15 +717,23 @@ class devede_project:
|
|||
self.menu.restore_menu(project["menu"])
|
||||
if "files" in project:
|
||||
error_list = []
|
||||
for efile in project["files"]:
|
||||
new_file = devedeng.file_movie.file_movie(efile["file_name"])
|
||||
if (new_file.error):
|
||||
error_list.append(os.path.basename(efile["file_name"]))
|
||||
else:
|
||||
new_file.restore_file(efile)
|
||||
for element in project["files"]:
|
||||
if element["element_type"] == "file_movie":
|
||||
new_file = devedeng.file_movie.file_movie(element["file_name"])
|
||||
if (new_file.error):
|
||||
error_list.append(os.path.basename(element["file_name"]))
|
||||
continue
|
||||
new_file.restore_element(element)
|
||||
new_file.connect('title_changed', self.title_changed)
|
||||
new_file.connect('in_menu_changed', self.in_menu_changed)
|
||||
self.wliststore_files.append([new_file, new_file.title_name, True, self.duration_to_string(
|
||||
new_file.get_duration()), new_file.show_in_menu])
|
||||
new_file.get_duration()), new_file.show_in_menu])
|
||||
else:
|
||||
new_separator = devedeng.separator.separator()
|
||||
new_separator.restore_element(element)
|
||||
new_separator.connect('name_changed', self.title_changed)
|
||||
new_separator.connect('in_menu_changed', self.in_menu_changed)
|
||||
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", True])
|
||||
if (len(error_list) != 0):
|
||||
devedeng.message.message_window(_("The following files in the project could not be added again:"), _("Error while adding files"), error_list)
|
||||
self.set_interface_status(None)
|
||||
|
|
@ -743,6 +743,18 @@ class devede_project:
|
|||
recent_mgr.add_item(uri)
|
||||
|
||||
def on_multiproperties_activate(self, b):
|
||||
|
||||
e = devedeng.file_movie.file_movie(None, self.get_all_files())
|
||||
file_list = []
|
||||
for f in self.get_all_files():
|
||||
if f.element_type != "file_movie":
|
||||
continue
|
||||
file_list.append(f)
|
||||
e = devedeng.file_movie.file_movie(None, file_list)
|
||||
e.properties()
|
||||
|
||||
def on_add_separator_clicked(self, b):
|
||||
new_separator = devedeng.separator.separator()
|
||||
new_separator.connect('name_changed', self.title_changed)
|
||||
new_separator.connect('in_menu_changed', self.in_menu_changed)
|
||||
self.wliststore_files.append([new_separator, new_separator.separator_name, True, "", True])
|
||||
self.set_interface_status(None)
|
||||
self.refresh_disc_usage()
|
||||
48
src/devedeng/separator.py
Normal file
48
src/devedeng/separator.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Copyright 2019 (C) Raster Software Vigo (Sergio Costas)
|
||||
#
|
||||
# This file is part of DeVeDe-NG
|
||||
#
|
||||
# DeVeDe-NG is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# DeVeDe-NG is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
from gi.repository import Gtk, GObject
|
||||
import os
|
||||
|
||||
import devedeng.configuration_data
|
||||
import devedeng.interface_manager
|
||||
|
||||
class separator(devedeng.interface_manager.interface_manager):
|
||||
|
||||
__gsignals__ = {'name_changed': (GObject.SIGNAL_RUN_FIRST, None, (str,)), 'in_menu_changed': (
|
||||
GObject.SIGNAL_RUN_FIRST, None, (bool,))}
|
||||
|
||||
def __init__(self):
|
||||
self.element_type = "separator"
|
||||
devedeng.interface_manager.interface_manager.__init__(self)
|
||||
self.add_toggle("show_in_menu", True)
|
||||
self.add_text("separator_name", _("Separator"))
|
||||
|
||||
def set_name(self, new_name):
|
||||
self.separator_name = new_name
|
||||
self.emit('name_changed', self.separator_name)
|
||||
|
||||
def delete_element(self):
|
||||
return
|
||||
|
||||
def store_element(self):
|
||||
data = self.serialize()
|
||||
data["element_type"] = "separator"
|
||||
return data
|
||||
|
||||
def restore_element(self, data):
|
||||
self.unserialize(data)
|
||||
|
|
@ -43,6 +43,8 @@ class vcdimager_converter(devedeng.executor.executor):
|
|||
else:
|
||||
self.command_var.append("svcd")
|
||||
for element in file_movies:
|
||||
if element.element_type != "file_movie":
|
||||
continue
|
||||
self.command_var.append(element.converted_filename)
|
||||
self.text = _("Creating CD image")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue