~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/prefinterface.cpp

  • Committer: Package Import Robot
  • Author(s): Maia Kozheva, Maia Kozheva, Alessio Treglia
  • Date: 2012-04-14 12:01:57 UTC
  • mfrom: (1.1.13)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: package-import@ubuntu.com-20120414120157-mndwobcslgisomso
[ Maia Kozheva ]
* New upstream release:
  - Changes since 0.7.1:
    + A toolbar editor has been added. Now it's possible to select the
      buttons and controls that want to appear in the toolbars.
    + New video filters: gradfun, blur and sharpen.
    + Now it's possible to change the GUI (default, mini, mpc) at runtime,
      no restart required.
    + sub files from opensubtitles should work again.
    + (Youtube) Recognize short urls (like this one:
      http://y2u.be/F5OcZBVPwOA)
    + Better support for chapters in video files.
    + Bug fix: remote m3u files work from the favorites menu or command line.
    + Internal changes in the single instance option (switch to 
      QtSingleApplication).
  - Fixes since 0.7.0:
    + SMPlayer took more than 10 seconds to show when running for the very
      first time.
    + The links to download subtitles from Opensubtitles were wrong.
    + SMPlayer crashed in the favorite editor when trying to select a file
      if the KDE open dialog was used.
  - Changes since 0.7.0:
    + By default the screenshots are saved in the user's pictures folder
      instead of the SMPlayer's config folder.
    + Now it's possible to change the opensubtitles server.
    + Youtube: seeking is slow with flv videos, so now flv videos have the
      lowest priority.
    + Youtube: now it's possible to search and download videos from youtube.
      This is provided by an external application (in linux you have to
      install an independent package: smtube).
* debian/copyright:
  - Rewrite according to DEP-5 specification.
* debian/control:
  - Depend on mplayer2 | mplayer. (Closes: #638279)
  - Update Standards-Version to 3.9.3.
* Remove debian/patches/handle_local_urls.diff, merged upstream.

[ Alessio Treglia ]
* Mention smplayer is also a front-end for MPlayer2.
* Fix small typo in the description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
                }
67
67
        }
68
68
 
 
69
#ifdef SINGLE_INSTANCE
69
70
        connect(single_instance_check, SIGNAL(toggled(bool)), 
70
71
            this, SLOT(changeInstanceImages()));
 
72
#else
 
73
        tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, false);
 
74
#endif
71
75
 
72
76
#ifdef Q_OS_WIN
73
77
        floating_bypass_wm_check->hide();
120
124
        resize_window_icon->setPixmap( Images::icon("resize_window") );
121
125
        /* volume_icon->setPixmap( Images::icon("speaker") ); */
122
126
 
 
127
#ifdef SINGLE_INSTANCE
123
128
        changeInstanceImages();
 
129
#endif
124
130
 
125
131
        // Seek widgets
126
132
        seek1->setLabel( tr("&Short jump") );
170
176
 
171
177
        setResizeMethod( pref->resize_method );
172
178
        setSaveSize( pref->save_window_size_on_exit );
 
179
#ifdef SINGLE_INSTANCE
173
180
        setUseSingleInstance(pref->use_single_instance);
174
 
        setServerPort(pref->connection_port);
175
 
        setUseAutoPort(pref->use_autoport);
 
181
#endif
176
182
        setRecentsMaxItems(pref->history_recents->maxItems());
177
183
 
178
184
        setSeeking1(pref->seeking1);
207
213
        requires_restart = false;
208
214
        language_changed = false;
209
215
        iconset_changed = false;
 
216
        gui_changed = false;
 
217
        style_changed = false;
210
218
        recents_changed = false;
211
 
        port_changed = false;
212
 
        style_changed = false;
213
219
 
214
220
        if (pref->language != language()) {
215
221
                pref->language = language();
222
228
                iconset_changed = true;
223
229
        }
224
230
 
 
231
        if (pref->gui != GUI()) {
 
232
                pref->gui = GUI();
 
233
                gui_changed = true;
 
234
        }
 
235
 
225
236
        pref->resize_method = resizeMethod();
226
237
        pref->save_window_size_on_exit = saveSize();
227
238
 
 
239
#ifdef SINGLE_INSTANCE
228
240
        pref->use_single_instance = useSingleInstance();
229
 
        if (pref->connection_port != serverPort()) {
230
 
                pref->connection_port = serverPort();
231
 
                port_changed = true;
232
 
        }
233
 
 
234
 
        if (pref->use_autoport != useAutoPort()) {
235
 
                pref->use_autoport = useAutoPort();
236
 
                port_changed = true;
237
 
        }
 
241
#endif
238
242
 
239
243
        if (pref->history_recents->maxItems() != recentsMaxItems()) {
240
244
                pref->history_recents->setMaxItems( recentsMaxItems() );
261
265
        }
262
266
#endif
263
267
 
264
 
        pref->gui = GUI();
265
 
 
266
268
        pref->floating_control_animated = floatingAnimated();
267
269
        pref->floating_control_width = floatingWidth();
268
270
        pref->floating_control_margin = floatingMargin();
347
349
        return gui_combo->itemData(gui_combo->currentIndex()).toString();
348
350
}
349
351
 
 
352
#ifdef SINGLE_INSTANCE
350
353
void PrefInterface::setUseSingleInstance(bool b) {
351
354
        single_instance_check->setChecked(b);
352
355
        //singleInstanceButtonToggled(b);
355
358
bool PrefInterface::useSingleInstance() {
356
359
        return single_instance_check->isChecked();
357
360
}
358
 
 
359
 
void PrefInterface::setServerPort(int port) {
360
 
        server_port_spin->setValue(port);
361
 
}
362
 
 
363
 
int PrefInterface::serverPort() {
364
 
        return server_port_spin->value();
365
 
}
366
 
 
367
 
void PrefInterface::setUseAutoPort(bool b) {
368
 
        automatic_port_button->setChecked(b);
369
 
        manual_port_button->setChecked(!b);
370
 
}
371
 
 
372
 
bool PrefInterface::useAutoPort() {
373
 
        return automatic_port_button->isChecked();
374
 
}
375
 
 
376
 
void PrefInterface::setSingleInstanceTabEnabled(bool b) {
377
 
        tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, b);
378
 
}
379
 
 
380
 
bool PrefInterface::singleInstanceTabEnabled() {
381
 
        return tabWidget->isTabEnabled(SINGLE_INSTANCE_TAB);
382
 
}
 
361
#endif
383
362
 
384
363
void PrefInterface::setRecentsMaxItems(int n) {
385
364
        recents_max_items_spin->setValue(n);
472
451
        }
473
452
}
474
453
 
 
454
#ifdef SINGLE_INSTANCE
475
455
void PrefInterface::changeInstanceImages() {
476
456
        if (single_instance_check->isChecked())
477
457
                instances_icon->setPixmap( Images::icon("instance1") );
478
458
        else
479
459
                instances_icon->setPixmap( Images::icon("instance2") );
480
460
}
 
461
#endif
481
462
 
482
463
void PrefInterface::setHideVideoOnAudioFiles(bool b) {
483
464
        hide_video_window_on_audio_check->setChecked(b);
604
585
           "can be a little bit slower. May not work with some video formats.") +"<br>"+
605
586
                tr("Note: this option only works with MPlayer2") );
606
587
 
 
588
#ifdef SINGLE_INSTANCE
607
589
        addSectionTitle(tr("Instances"));
608
590
 
609
591
        setWhatsThis(single_instance_check, 
610
592
        tr("Use only one running instance of SMPlayer"),
611
593
        tr("Check this option if you want to use an already running instance "
612
594
           "of SMPlayer when opening other files.") );
613
 
 
614
 
        setWhatsThis(automatic_port_button, tr("Automatic port"),
615
 
        tr("SMPlayer needs to listen to a port to receive commands from other "
616
 
           "instances. If you select this option, a port will be "
617
 
           "automatically chosen.") );
618
 
 
619
 
        setWhatsThis(server_port_spin, tr("Manual port"),
620
 
        tr("SMPlayer needs to listen to a port to receive commands from other "
621
 
           "instances. You can change the port in case the default one is "
622
 
           "used by another application.") );
623
 
 
624
 
        manual_port_button->setWhatsThis( server_port_spin->whatsThis() );
 
595
#endif
625
596
 
626
597
        addSectionTitle(tr("Floating control"));
627
598