Changeset 417

Show
Ignore:
Timestamp:
09/04/06 11:47:08 (2 years ago)
Author:
nicfit
Message:

#199 finished and po updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/po/POTFILES.in

    r397 r417  
    99src/config.py 
    1010src/control.py 
     11src/dialogs.py 
    1112src/main.py 
    1213src/main_window.py 
  • trunk/po/es.po

    r411 r417  
    88"Project-Id-Version: 0.1.1\n" 
    99"Report-Msgid-Bugs-To: \n" 
    10 "POT-Creation-Date: 2006-08-30 20:18-0600\n" 
     10"POT-Creation-Date: 2006-09-03 19:57-0600\n" 
    1111"PO-Revision-Date: 2006-04-15 17:38-0600\n" 
    1212"Last-Translator: Travis Shirk <travis@pobox.com>\n" 
     
    241241msgstr "" 
    242242 
    243 #: ../src/main.py:165 
     243#: ../src/main.py:168 
    244244#, fuzzy, python-format 
    245245msgid "Migrating config version %s to %s" 
    246246msgstr "Aumento de la versión %s de los config a %s" 
    247247 
    248 #: ../src/main.py:184 
    249 msgid "Run with a specific profile other than the default.
    250 msgstr "" 
    251  
    252 #: ../src/main.py:188 
     248#: ../src/main.py:187 
     249msgid "Run with a specific profile other than the default. If profile NAME is
     250msgstr "" 
     251 
     252#: ../src/main.py:191 
    253253#, fuzzy 
    254254msgid "" 
     
    260260 
    261261#. Developer options 
    262 #: ../src/main.py:194 
     262#: ../src/main.py:197 
    263263msgid "Advanced Options" 
    264264msgstr "" 
    265265 
    266 #: ../src/main.py:197 
     266#: ../src/main.py:200 
    267267msgid "Break in python debugger on unhandled exceptions." 
    268268msgstr "" 
    269269 
    270 #: ../src/main.py:201 
     270#: ../src/main.py:204 
    271271msgid "Run using python profiler." 
    272272msgstr "" 
    273273 
    274 #: ../src/main.py:204 
    275 msgid "Gstreamer command line options." 
    276 msgstr "" 
    277  
    278 #: ../src/main_window.py:119 
     274#: ../src/main.py:207 
     275msgid "Display Gstreamer command line options." 
     276msgstr "" 
     277 
     278#: ../src/main_window.py:117 
    279279#, python-format 
    280280msgid "Error loading playlist '%s'" 
    281281msgstr "Playlist '%s' del cargamento del error" 
    282282 
    283 #: ../src/main_window.py:280 
     283#: ../src/main_window.py:278 
    284284msgid "<b>Are you sure you want to quit?</b>" 
    285285msgstr "" 
  • trunk/po/mesk.pot

    r411 r417  
    99"Project-Id-Version: PACKAGE VERSION\n" 
    1010"Report-Msgid-Bugs-To: \n" 
    11 "POT-Creation-Date: 2006-08-30 20:18-0600\n" 
     11"POT-Creation-Date: 2006-09-03 19:57-0600\n" 
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    236236msgstr "" 
    237237 
    238 #: ../src/main.py:165 
     238#: ../src/main.py:168 
    239239#, python-format 
    240240msgid "Migrating config version %s to %s" 
    241241msgstr "" 
    242242 
    243 #: ../src/main.py:184 
    244 msgid "Run with a specific profile other than the default.
    245 msgstr "" 
    246  
    247 #: ../src/main.py:188 
     243#: ../src/main.py:187 
     244msgid "Run with a specific profile other than the default. If profile NAME is
     245msgstr "" 
     246 
     247#: ../src/main.py:191 
    248248msgid "" 
    249249"Select the amount of terminal logging.  May be CRITICAL, ERROR, WARNING, " 
     
    252252 
    253253#. Developer options 
    254 #: ../src/main.py:194 
     254#: ../src/main.py:197 
    255255msgid "Advanced Options" 
    256256msgstr "" 
    257257 
    258 #: ../src/main.py:197 
     258#: ../src/main.py:200 
    259259msgid "Break in python debugger on unhandled exceptions." 
    260260msgstr "" 
    261261 
    262 #: ../src/main.py:201 
     262#: ../src/main.py:204 
    263263msgid "Run using python profiler." 
    264264msgstr "" 
    265265 
    266 #: ../src/main.py:204 
    267 msgid "Gstreamer command line options." 
    268 msgstr "" 
    269  
    270 #: ../src/main_window.py:119 
     266#: ../src/main.py:207 
     267msgid "Display Gstreamer command line options." 
     268msgstr "" 
     269 
     270#: ../src/main_window.py:117 
    271271#, python-format 
    272272msgid "Error loading playlist '%s'" 
    273273msgstr "" 
    274274 
    275 #: ../src/main_window.py:280 
     275#: ../src/main_window.py:278 
    276276msgid "<b>Are you sure you want to quit?</b>" 
    277277msgstr "" 
  • trunk/src/dialogs.py

    r416 r417  
    1919################################################################################ 
    2020import gtk 
     21import mesk 
     22from mesk.common.i18n import _ 
    2123 
    2224class MessageDialog(gtk.MessageDialog): 
     
    3739                                   type = gtk.MESSAGE_ERROR, 
    3840                                   buttons = gtk.BUTTONS_OK) 
     41 
     42class ConfirmationDialog(gtk.MessageDialog): 
     43    def __init__(self, parent, modal = True, type=gtk.MESSAGE_QUESTION): 
     44        gtk.MessageDialog.__init__(self, parent=parent, flags=0, type=type) 
     45        self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) 
     46        self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) 
     47 
     48    def confirm(self): 
     49        resp = self.run() 
     50        self.destroy() 
     51        return (resp == gtk.RESPONSE_OK) 
     52 
     53class ConfirmationWithDisableOptionDialog(ConfirmationDialog): 
     54    def __init__(self, parent, modal=True, type=gtk.MESSAGE_QUESTION): 
     55        ConfirmationDialog.__init__(self, parent=parent, modal=modal, type=type) 
     56        self.checkbutton = gtk.CheckButton(_('Do not ask me again.')) 
     57        self.vbox.pack_start(self.checkbutton, expand=False, fill=False) 
     58        self.checkbutton.show() 
     59 
     60    def confirm(self): 
     61        confirmed = ConfirmationDialog.confirm(self) 
     62        return (confirmed, self.checkbutton.get_active()) 
     63 
  • trunk/src/main_window.py

    r412 r417  
    3737from preference_window import PreferenceWindow 
    3838from multi_media_keys import MultiMediaKeys 
     39from dialogs import ErrorDialog, ConfirmationWithDisableOptionDialog 
    3940 
    4041class MainWindow(mesk.window.Window): 
     
    8990            self.add_notebook_control(self._empty_control) 
    9091            self._empty_control.widget.show() 
     92            self._notebook.set_show_tabs(False) 
    9193        elif not self._active_control: 
    9294            self.set_active_control(self._controls[0]) 
     
    114116            mesk.log.info('Loading playlist \'%s\'...' % name) 
    115117            pl_ctrl = PlaylistControl(name) 
    116         except mesk.playlist.PlaylistException, ex: 
    117             msg = _("Error loading playlist '%s'") % name 
    118             d = gtk.MessageDialog(None, gtk.DIALOG_MODAL, 
    119                                   type = gtk.MESSAGE_ERROR, 
    120                                   buttons = gtk.BUTTONS_OK, 
    121                                   message_format = msg) 
     118        except Exception, ex: 
     119            msg = "<b>%s</b>" % (_("Error loading playlist '%s'") % name) 
     120            d = ErrorDialog(self.window) 
     121            d.set_markup(msg) 
    122122            d.format_secondary_text(str(ex)) 
    123123            d.run() 
     
    228228        # Add special widget for whenever there are none 
    229229        if self._notebook.get_n_pages() == 0: 
     230            self._notebook.set_show_tabs(False) 
    230231            self.add_notebook_control(self._empty_control) 
    231232        elif self._notebook.get_n_pages() == 1: 
     233            self._notebook.set_show_tabs(True) 
    232234            self._notebook.set_show_border(False) 
    233235            # DnD clean up 
     
    270272        self.window.show() 
    271273 
    272     def quit(self): 
    273         # Confirm the quit 
    274         d = gtk.MessageDialog(None, gtk.DIALOG_MODAL, 
    275                               type = gtk.MESSAGE_QUESTION) 
    276         d.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) 
    277         d.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) 
    278         d.set_markup(_('<b>Are you sure you want to quit?</b>')) 
    279         d.set_transient_for(self.window) 
    280         resp = d.run() 
    281         d.destroy() 
    282         if resp != gtk.RESPONSE_OK: 
    283             return 
    284  
     274    def quit(self, prompt=mesk.config.getboolean(mesk.CONFIG_MAIN, 
     275                                                 'confirm_quit')): 
     276        if prompt: 
     277            # Confirm the quit 
     278            d = ConfirmationWithDisableOptionDialog(self.window) 
     279            d.set_markup('<b>%s</b>' % _('Are you sure you want to quit?')) 
     280            (confirmed, disable_prompt) = d.confirm() 
     281            if not confirmed: 
     282                return False 
     283            mesk.config.set(mesk.CONFIG_MAIN, 'confirm_quit', 
     284                            str(not disable_prompt)) 
     285             
    285286        self._save_window_attrs() 
    286287        self.window.hide() 
     
    313314            pass 
    314315 
     316        return True 
     317 
    315318    def _save_window_attrs(self): 
    316319        (width, height) = self.window.get_size() 
     
    342345            return True 
    343346        else: 
    344             self.quit() 
    345             return False 
     347            if not self.quit(): 
     348                return True 
     349            else: 
     350                # Return yes, you may delete me 
     351                return False 
    346352 
    347353    def set_compact_mode(self, state): 
  • trunk/src/mesk/__init__.py

    r409 r417  
    5454    'version': [str, APP_VERSION, _('Application version')], 
    5555    'playlist_dir': [str, DEFAULT_PLAYLISTS_DIR, 
    56                      _('The directory containing playlists')], 
     56                     _('The directory containing playlists.')], 
    5757    'active_playlist': [str, '',  
    58                   _('The foreground playlist that has audio control')], 
     58                  _('The foreground playlist that has audio control.')], 
    5959    'playlists': [str, DEFAULT_PLAYLIST_NAME,  
    60                   _('A list of playlists to open on startup')], 
     60                  _('A list of playlists to open on startup.')], 
    6161    'log_level': [str, 'INFO',  
    6262                  _('Logging level. May be CRITICAL, ERROR, WARNING, INFO, ' 
    6363                    'VERBOSE, or DEBUG')], 
     64    'confirm_quit': [bool, True, 
     65                     _('Show confirmation dialog before quitting the ' 
     66                       'application.')], 
    6467    'plugins_dir': [str, DEFAULT_PLUGINS_DIR, 
    6568                    _('The directory containing user installed plugins')], 
     
    7376                             _('If True, the main window is hidded instead of ' 
    7477                               'closed when the window close button is ' 
    75                                'clicked')], 
    76     'main_window_width': [int, 435, _('Main window width')], 
    77     'main_window_height': [int, 560, _('Main window height')], 
    78     'main_window_pos_x': [int, -1, _('Main window x origin')], 
    79     'main_window_pos_y': [int, -1, _('Main window y origin')], 
     78                               'clicked.')], 
     79    'main_window_width': [int, 435, _('Main window width.')], 
     80    'main_window_height': [int, 560, _('Main window height.')], 
     81    'main_window_pos_x': [int, -1, _('Main window x origin.')], 
     82    'main_window_pos_y': [int, -1, _('Main window y origin.')], 
    8083    'compact_main_window_pos_x': [int, -1,  
    81                                   _('Main window x origin in compact mode')], 
     84                                  _('Main window x origin in compact mode.')], 
    8285    'compact_main_window_pos_y': [int, -1,  
    83                                   _('Main window y origin in compact mode')], 
     86                                  _('Main window y origin in compact mode.')], 
    8487    'show_tab_close_button': [bool, False,  
    85                               _('Display a close button on each tab')], 
     88                              _('Display a close button on each tab.')], 
    8689    'show_tip_window_on_startup': [bool, True, 
    8790                                   _('Show tips window each time Mesk is ' 
  • trunk/src/playlist_control.py

    r416 r417  
    3030from mesk.audio import UnsupportedFormat 
    3131from mesk.audio.source import UnsupportedScheme 
     32 
     33from dialogs import ConfirmationDialog 
    3234 
    3335# Data model.  These do not have to correspond to the column order, nor 
     
    463465    def _on_delete_menuitem_activate(self, menuitem): 
    464466        # Confirm 
    465         d = gtk.MessageDialog(None, gtk.DIALOG_MODAL, 
    466                               type = gtk.MESSAGE_WARNING) 
    467         d.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) 
    468         d.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) 
     467        d = ConfirmationDialog(None, type=gtk.MESSAGE_WARNING) 
    469468        d.set_markup(_('Are you sure you want to delete playlist \'%s\'?') % \ 
    470469                     self._pl_config.name) 
    471470        d.format_secondary_text(_('All playlist data will be lost.')) 
    472  
    473         resp = d.run() 
    474         d.destroy() 
    475         if resp != gtk.RESPONSE_OK: 
     471        if not d.confirm(): 
    476472            return 
    477473         
  • trunk/src/preference_window.py

    r386 r417  
    2323_ = mesk.common.i18n._ 
    2424from mesk.plugin import PluginMgr 
     25import mesk.window 
    2526 
    26 import mesk.window 
     27from dialogs import ErrorDialog 
    2728 
    2829class PreferenceWindow(mesk.window.Window): 
     
    136137            model[path][0] = new_state 
    137138        except Exception, ex: 
    138             d = gtk.MessageDialog(None, gtk.DIALOG_MODAL, 
    139                                   type=gtk.MESSAGE_ERROR, 
    140                                   buttons=gtk.BUTTONS_OK) 
     139            d = ErrorDialog(self.window) 
    141140            d.set_markup('<b>%s</b>' % state_str) 
    142141            d.format_secondary_text(str(ex))