Changeset 920 for trunk

Show
Ignore:
Timestamp:
04/06/08 21:09:32 (5 months ago)
Author:
nicfit
Message:

Export options inside a gtk.Expander

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/data/glade/playlist.glade

    r919 r920  
    398398  </widget> 
    399399  <widget class="GtkDialog" id="playlist_export_dialog"> 
    400     <property name="title" translatable="yes">Export</property> 
     400    <property name="title" translatable="yes">Export Playlist</property> 
    401401    <property name="window_position">GTK_WIN_POS_MOUSE</property> 
    402402    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> 
     
    430430                    <property name="column_spacing">5</property> 
    431431                    <property name="row_spacing">5</property> 
     432                    <child> 
     433                      <widget class="GtkLabel" id="label26"> 
     434                        <property name="visible">True</property> 
     435                        <property name="xalign">0</property> 
     436                        <property name="label" translatable="yes">Name:</property> 
     437                      </widget> 
     438                      <packing> 
     439                        <property name="x_options">GTK_FILL</property> 
     440                        <property name="y_options"></property> 
     441                      </packing> 
     442                    </child> 
     443                    <child> 
     444                      <widget class="GtkLabel" id="label27"> 
     445                        <property name="visible">True</property> 
     446                        <property name="xalign">0</property> 
     447                        <property name="label" translatable="yes">Location:</property> 
     448                      </widget> 
     449                      <packing> 
     450                        <property name="top_attach">1</property> 
     451                        <property name="bottom_attach">2</property> 
     452                        <property name="x_options">GTK_FILL</property> 
     453                        <property name="y_options"></property> 
     454                      </packing> 
     455                    </child> 
     456                    <child> 
     457                      <widget class="GtkFileChooserButton" id="export_dirchooser_button"> 
     458                        <property name="visible">True</property> 
     459                        <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property> 
     460                        <property name="title" translatable="yes">Select A Folder</property> 
     461                      </widget> 
     462                      <packing> 
     463                        <property name="left_attach">1</property> 
     464                        <property name="right_attach">2</property> 
     465                        <property name="top_attach">1</property> 
     466                        <property name="bottom_attach">2</property> 
     467                        <property name="x_options">GTK_FILL</property> 
     468                        <property name="y_options">GTK_FILL</property> 
     469                      </packing> 
     470                    </child> 
    432471                    <child> 
    433472                      <widget class="GtkHBox" id="hbox15"> 
     
    460499                      </packing> 
    461500                    </child> 
    462                     <child> 
    463                       <widget class="GtkFileChooserButton" id="export_dirchooser_button"> 
    464                         <property name="visible">True</property> 
    465                         <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property> 
    466                         <property name="title" translatable="yes">Select A Folder</property> 
    467                       </widget> 
    468                       <packing> 
    469                         <property name="left_attach">1</property> 
    470                         <property name="right_attach">2</property> 
    471                         <property name="top_attach">1</property> 
    472                         <property name="bottom_attach">2</property> 
    473                         <property name="x_options">GTK_FILL</property> 
    474                         <property name="y_options">GTK_FILL</property> 
    475                       </packing> 
    476                     </child> 
    477                     <child> 
    478                       <widget class="GtkLabel" id="label27"> 
    479                         <property name="visible">True</property> 
    480                         <property name="xalign">0</property> 
    481                         <property name="label" translatable="yes">Location:</property> 
    482                       </widget> 
    483                       <packing> 
    484                         <property name="top_attach">1</property> 
    485                         <property name="bottom_attach">2</property> 
    486                         <property name="x_options">GTK_FILL</property> 
    487                         <property name="y_options"></property> 
    488                       </packing> 
    489                     </child> 
    490                     <child> 
    491                       <widget class="GtkLabel" id="label26"> 
    492                         <property name="visible">True</property> 
    493                         <property name="xalign">0</property> 
    494                         <property name="label" translatable="yes">Name:</property> 
    495                       </widget> 
    496                       <packing> 
    497                         <property name="x_options">GTK_FILL</property> 
    498                         <property name="y_options"></property> 
    499                       </packing> 
    500                     </child> 
    501501                  </widget> 
    502502                  <packing> 
     
    559559        </child> 
    560560        <child> 
    561           <widget class="GtkAlignment" id="alignment2"> 
    562             <property name="visible">True</property> 
     561          <widget class="GtkExpander" id="options_expander"> 
     562            <property name="visible">True</property> 
     563            <property name="can_focus">True</property> 
    563564            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 
    564             <property name="bottom_padding">2</property> 
    565             <property name="left_padding">2</property> 
    566             <property name="right_padding">2</property> 
     565            <signal name="activate" handler="_on_options_expander_activate"/> 
    567566            <child> 
    568567              <widget class="GtkVBox" id="export_options_vbox"> 
     
    573572                </child> 
    574573              </widget> 
     574            </child> 
     575            <child> 
     576              <widget class="GtkLabel" id="label3"> 
     577                <property name="visible">True</property> 
     578                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 
     579                <property name="label" translatable="yes">Options</property> 
     580              </widget> 
     581              <packing> 
     582                <property name="type">label_item</property> 
     583              </packing> 
    575584            </child> 
    576585          </widget> 
  • trunk/src/playlist_export.py

    r919 r920  
    9595        self._progress_bar.set_fraction(0.0) 
    9696 
     97        # Used to shrink window when options are unexpanded 
     98        self._initial_size = None 
     99 
    97100    def _on_dialog_delete_event(self, dialog, event): 
    98101        self.dialog.destroy() 
     102 
     103    ## Shrink window when option expander is closed. 
     104    def _on_options_expander_activate(self, expander): 
     105        if self._initial_size is None: 
     106            self._initial_size = self.dialog.get_size() 
     107 
     108        if expander.get_expanded(): 
     109            self.dialog.set_size_request(*self._initial_size) 
     110            self.dialog.resize(*self._initial_size) 
     111        else: 
     112            self.dialog.set_size_request(-1, -1) 
    99113 
    100114    def _on_export_name_entry_changed(self, entry):