~ubuntu-branches/ubuntu/raring/oggconvert/raring

« back to all changes in this revision

Viewing changes to OggConvert/ocv_main.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-11-06 21:33:20 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081106213320-thywgj4kswqg1p1w
Tags: 0.3.2-1ubuntu1
* Merge from Debian experimental, remaining Ubuntu changes:
  - Suggest gstreamer multiverse plugins.
* debian/patches/default_location:
  - Ubuntu provides a Videos directory in $HOME folders, place default
    "Save Folder" location there (LP: #209592).

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from ocv_in_progress import ProgressWindow
36
36
from ocv_transcoder import Transcoder 
37
37
from ocv_media_checker import MediaChecker
38
 
from ocv_util import confirm_overwrite, dirac_warning, about_dialogue
 
38
from ocv_util import confirm_overwrite, about_dialogue
39
39
import ocv_constants
40
40
from ocv_info import app_name, gladepath, localepath, pixmappath
41
41
 
131
131
        self._outfile_folder = self._save_folder_button.get_filename()
132
132
        self._outfile_name = self._outfile_entry.get_text()
133
133
        self._outfile = os.path.join(self._outfile_folder, self._outfile_name)
 
134
        # Should use urlparse lib for this
 
135
        output_uri = "file://" + urllib.unquote(self._outfile)
134
136
 
135
137
        # Check destination is writable
136
138
        if not os.access(self._outfile_folder, os.W_OK):
157
159
            else: 
158
160
                if not confirm_overwrite(self._outfile, self._window):
159
161
                    return
160
 
              
161
 
        
162
 
        # If Dirac is selected, flash up a warning to show it's experimental
 
162
 
 
163
        # Get video and file formats choosen.
163
164
        format = ocv_constants.FORMATS[int(self._format_combobox.get_active())]
164
 
        if format == "SCHRO":
165
 
            if not dirac_warning(self._window):
166
 
                return
167
 
 
168
 
        # Get file format choosen.
169
165
        container = ocv_constants.CONTAINER_FORMATS[int(
170
166
            self._container_combobox.get_active())]
171
167
 
174
170
        vquality = self._video_quality_slider.get_value()
175
171
        aquality = self._audio_quality_slider.get_value()
176
172
        tc = Transcoder(
177
 
            self._input_uri, self._outfile, format, vquality, aquality,
 
173
            self._input_uri, output_uri, format, vquality, aquality,
178
174
            container)
179
175
        pr = ProgressWindow(tc, self._input_uri, self._outfile)
180
176
        self._window.hide()
194
190
        if not self._input_uri == None:
195
191
            # gtk.FileChooser.get_uri returns an escaped string, which is not
196
192
            # what we want, so this hack uses urllib to change it back.
197
 
            self._input_uri = urllib.url2pathname(self._input_uri)
 
193
            self._input_uri = urllib.unquote(self._input_uri)
198
194
            gobject.idle_add(self._check_media,self._input_uri)
199
195
            
200
196
        folder = filechooser.get_current_folder()