~ubuntu-branches/debian/jessie/smplayer/jessie

« back to all changes in this revision

Viewing changes to src/minigui.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)
  • Revision ID: package-import@ubuntu.com-20120414120157-mndwobcslgisomso
Tags: 0.8.0-1
[ 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:
23
23
#include "mplayerwindow.h"
24
24
#include "global.h"
25
25
#include "helper.h"
26
 
#include "toolbareditor.h"
27
26
#include "desktopinfo.h"
28
 
 
29
 
#include <QToolBar>
 
27
#include "editabletoolbar.h"
30
28
#include <QStatusBar>
 
29
#include <QMenu>
31
30
 
32
31
using namespace Global;
33
32
 
34
 
MiniGui::MiniGui( bool use_server, QWidget * parent, Qt::WindowFlags flags )
35
 
        : BaseGuiPlus( use_server, parent, flags )
 
33
MiniGui::MiniGui( QWidget * parent, Qt::WindowFlags flags )
 
34
        : BaseGuiPlus( parent, flags )
36
35
{
37
36
        createActions();
38
37
        createControlWidget();
39
38
        createFloatingControl();
40
39
 
 
40
#if USE_CONFIGURABLE_TOOLBARS
 
41
        connect( editControlAct, SIGNAL(triggered()),
 
42
             controlwidget, SLOT(edit()) );
 
43
        floating_control->toolbar()->takeAvailableActionsFrom(this);
 
44
        connect( editFloatingControlAct, SIGNAL(triggered()),
 
45
             floating_control->toolbar(), SLOT(edit()) );
 
46
#endif
 
47
 
41
48
        connect( this, SIGNAL(cursorNearBottom(QPoint)),
42
49
             this, SLOT(showFloatingControl(QPoint)) );
43
50
 
59
66
        saveConfig();
60
67
}
61
68
 
 
69
#if USE_CONFIGURABLE_TOOLBARS
 
70
QMenu * MiniGui::createPopupMenu() {
 
71
        QMenu * m = new QMenu(this);
 
72
        m->addAction(editControlAct);
 
73
        m->addAction(editFloatingControlAct);
 
74
        return m;
 
75
}
 
76
#endif
 
77
 
62
78
void MiniGui::createActions() {
63
79
        timeslider_action = createTimeSliderAction(this);
64
80
        timeslider_action->disable();
73
89
 
74
90
        connect( this, SIGNAL(timeChanged(QString)),
75
91
             time_label_action, SLOT(setText(QString)) );
 
92
 
 
93
#if USE_CONFIGURABLE_TOOLBARS
 
94
        editControlAct = new MyAction( this, "edit_control_minigui" );
 
95
        editFloatingControlAct = new MyAction( this, "edit_floating_control_minigui" );
 
96
#endif
76
97
}
77
98
 
78
99
 
79
100
void MiniGui::createControlWidget() {
80
 
        controlwidget = new QToolBar( this );
 
101
        controlwidget = new EditableToolbar( this );
81
102
        controlwidget->setObjectName("controlwidget");
82
103
        controlwidget->setMovable(true);
83
104
        controlwidget->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
84
105
        addToolBar(Qt::BottomToolBarArea, controlwidget);
85
106
 
86
 
#if !USE_CONFIGURABLE_TOOLBARS
 
107
#if USE_CONFIGURABLE_TOOLBARS
 
108
        QStringList controlwidget_actions;
 
109
        controlwidget_actions << "play_or_pause" << "stop" << "separator" << "timeslider_action" << "separator"
 
110
                          << "fullscreen" << "mute" << "volumeslider_action";
 
111
        controlwidget->setDefaultActions(controlwidget_actions);
 
112
#else
87
113
        controlwidget->addAction(playOrPauseAct);
88
114
        controlwidget->addAction(stopAct);
89
115
        controlwidget->addSeparator();
91
117
        controlwidget->addSeparator();
92
118
        controlwidget->addAction(fullscreenAct);
93
119
        controlwidget->addAction(muteAct);
94
 
 
95
 
#if USE_VOLUME_BAR
 
120
        #if USE_VOLUME_BAR
96
121
        controlwidget->addAction(volumeslider_action);
97
 
#endif
98
 
 
 
122
        #endif
99
123
#endif // USE_CONFIGURABLE_TOOLBARS
100
124
}
101
125
 
103
127
        // Floating control
104
128
        floating_control = new FloatingWidget(this);
105
129
 
106
 
#if !USE_CONFIGURABLE_TOOLBARS
 
130
#if USE_CONFIGURABLE_TOOLBARS
 
131
        QStringList floatingcontrol_actions;
 
132
        floatingcontrol_actions << "play_or_pause" << "stop" << "separator" << "timeslider_action" << "separator"
 
133
                            << "fullscreen" << "mute";
 
134
        #if USE_VOLUME_BAR
 
135
        floatingcontrol_actions << "volumeslider_action";
 
136
        #endif
 
137
        floatingcontrol_actions << "separator" << "timelabel_action";
 
138
        floating_control->toolbar()->setDefaultActions(floatingcontrol_actions);
 
139
#else
107
140
        floating_control->toolbar()->addAction(playOrPauseAct);
108
141
        floating_control->toolbar()->addAction(stopAct);
109
142
        floating_control->toolbar()->addSeparator();
111
144
        floating_control->toolbar()->addSeparator();
112
145
        floating_control->toolbar()->addAction(fullscreenAct);
113
146
        floating_control->toolbar()->addAction(muteAct);
114
 
#if USE_VOLUME_BAR
 
147
        #if USE_VOLUME_BAR
115
148
        floating_control->toolbar()->addAction(volumeslider_action);
116
 
#endif
117
 
 
 
149
        #endif
118
150
        floating_control->adjustSize();
119
151
#endif // USE_CONFIGURABLE_TOOLBARS
120
152
}
123
155
        BaseGuiPlus::retranslateStrings();
124
156
 
125
157
        controlwidget->setWindowTitle( tr("Control bar") );
 
158
 
 
159
#if USE_CONFIGURABLE_TOOLBARS
 
160
        editControlAct->change( tr("Edit &control bar") );
 
161
        editFloatingControlAct->change( tr("Edit &floating control") );
 
162
#endif
126
163
}
127
164
 
128
165
#if AUTODISABLE_ACTIONS
215
252
 
216
253
#if USE_CONFIGURABLE_TOOLBARS
217
254
        set->beginGroup( "actions" );
218
 
        set->setValue("controlwidget", ToolbarEditor::save(controlwidget) );
219
 
        set->setValue("floating_control", ToolbarEditor::save(floating_control->toolbar()) );
 
255
        set->setValue("controlwidget", controlwidget->actionsToStringList() );
 
256
        set->setValue("floating_control", floating_control->toolbar()->actionsToStringList() );
220
257
        set->endGroup();
221
258
#endif
222
259
 
246
283
        }
247
284
 
248
285
#if USE_CONFIGURABLE_TOOLBARS
249
 
        QList<QAction *> actions_list = findChildren<QAction *>();
250
 
        QStringList controlwidget_actions;
251
 
        controlwidget_actions << "play_or_pause" << "stop" << "separator" << "timeslider_action" << "separator"
252
 
                          << "fullscreen" << "mute" << "volumeslider_action";
253
 
 
254
 
        QStringList floatingcontrol_actions;
255
 
        floatingcontrol_actions << "play_or_pause" << "stop" << "separator" << "timeslider_action" << "separator"
256
 
                            << "fullscreen" << "mute";
257
 
#if USE_VOLUME_BAR
258
 
        floatingcontrol_actions << "volumeslider_action";
259
 
#endif
260
 
 
261
 
        floatingcontrol_actions << "separator" << "timelabel_action";
262
 
 
263
286
        set->beginGroup( "actions" );
264
 
        ToolbarEditor::load(controlwidget, set->value("controlwidget", controlwidget_actions).toStringList(), actions_list );
265
 
        ToolbarEditor::load(floating_control->toolbar(), set->value("floating_control", floatingcontrol_actions).toStringList(), actions_list );
 
287
        controlwidget->setActionsFromStringList( set->value("controlwidget", controlwidget->defaultActions()).toStringList() );
 
288
        floating_control->toolbar()->setActionsFromStringList( set->value("floating_control", floating_control->toolbar()->defaultActions()).toStringList() );
266
289
        floating_control->adjustSize();
267
290
        set->endGroup();
268
291
#endif