~ubuntu-branches/ubuntu/precise/smplayer/precise

« back to all changes in this revision

Viewing changes to src/prefinput.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-11-04 12:45:38 UTC
  • mfrom: (1.1.10 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091104124538-hm6jc89qrg3l2sm8
Tags: 0.6.8-1
* New upstream release. (Closes: #543156)
* Added /usr/share/pixmaps to debian/menu. (Closes: #526353)
* debian/control: Bumped Standards-Version to 3.8.3.
* debian/rules:
  - Removed VERSION variables, not relevant anymore.
  - Removed dh_desktop.
* Removed 01_gl_translation.patch, fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "prefinput.h"
21
21
#include "images.h"
22
 
#include "preferences.h"
23
22
#include "config.h"
24
23
#include "guiconfig.h"
25
24
 
83
82
        left_click_combo->addItem( tr("Show video equalizer"), "video_equalizer" );
84
83
        left_click_combo->addItem( tr("Show audio equalizer"), "audio_equalizer" );
85
84
        left_click_combo->addItem( tr("Show context menu"), "show_context_menu" );
 
85
        left_click_combo->addItem( tr("Change function of wheel"), "next_wheel_function" );
86
86
#if DVDNAV_SUPPORT
87
87
        left_click_combo->addItem( tr("Activate option under mouse in DVD menus"), "dvdnav_mouse" );
88
88
        left_click_combo->addItem( tr("Return to main DVD menu"), "dvdnav_menu" );
146
146
        wheel_function_combo->addItem( tr("Change speed"), Preferences::ChangeSpeed );
147
147
        wheel_function_combo->setCurrentIndex(wheel_function);
148
148
 
 
149
        wheel_function_seek->setText( tr("Media &seeking") );
 
150
        wheel_function_zoom->setText( tr("&Zoom video") );
 
151
        wheel_function_volume->setText( tr("&Volume control") );
 
152
        wheel_function_speed->setText( tr("&Change speed") );
 
153
 
149
154
#if !USE_SHORTCUTGETTER
150
155
        actioneditor_desc->setText( 
151
156
                tr("Here you can change any key shortcut. To do it double click or "
165
170
        setXButton1ClickFunction( pref->mouse_xbutton1_click_function );
166
171
        setXButton2ClickFunction( pref->mouse_xbutton2_click_function );
167
172
        setWheelFunction( pref->wheel_function );
 
173
        setWheelFunctionCycle(pref->wheel_function_cycle);
168
174
}
169
175
 
170
176
void PrefInput::getData(Preferences * pref) {
177
183
        pref->mouse_xbutton1_click_function = xButton1ClickFunction();
178
184
        pref->mouse_xbutton2_click_function = xButton2ClickFunction();
179
185
        pref->wheel_function = wheelFunction();
 
186
        pref->wheel_function_cycle = wheelFunctionCycle();
180
187
}
181
188
 
182
189
/*
256
263
        return wheel_function_combo->itemData(wheel_function_combo->currentIndex()).toInt();
257
264
}
258
265
 
 
266
void PrefInput::setWheelFunctionCycle(QFlags<Preferences::WheelFunctions> flags){
 
267
        wheel_function_seek->setChecked(flags.testFlag(Preferences::Seeking));
 
268
        wheel_function_volume->setChecked(flags.testFlag(Preferences::Volume));
 
269
        wheel_function_zoom->setChecked(flags.testFlag(Preferences::Zoom));
 
270
        wheel_function_speed->setChecked(flags.testFlag(Preferences::ChangeSpeed));
 
271
}
 
272
 
 
273
QFlags<Preferences::WheelFunctions> PrefInput::wheelFunctionCycle(){
 
274
        QFlags<Preferences::WheelFunctions> seekflags (QFlag ((int) Preferences::Seeking)) ;
 
275
        QFlags<Preferences::WheelFunctions> volumeflags (QFlag ((int) Preferences::Volume)) ;
 
276
        QFlags<Preferences::WheelFunctions> zoomflags (QFlag ((int) Preferences::Zoom)) ;
 
277
        QFlags<Preferences::WheelFunctions> speedflags (QFlag ((int) Preferences::ChangeSpeed)) ;
 
278
        QFlags<Preferences::WheelFunctions> out (QFlag (0));
 
279
        if(wheel_function_seek->isChecked()){
 
280
                out = out | seekflags;
 
281
        }
 
282
        if(wheel_function_volume->isChecked()){
 
283
                out = out | volumeflags;
 
284
        }
 
285
        if(wheel_function_zoom->isChecked()){
 
286
                out = out | zoomflags;
 
287
        }
 
288
        if(wheel_function_speed->isChecked()){
 
289
                out = out | speedflags;
 
290
        }
 
291
        return out;
 
292
}
 
293
 
259
294
void PrefInput::createHelp() {
260
295
        clearHelp();
261
296
 
291
326
 
292
327
        setWhatsThis(wheel_function_combo, tr("Wheel function"),
293
328
                tr("Select the action for the mouse wheel.") );
 
329
 
 
330
        addSectionTitle(tr("Mouse wheel functions"));
 
331
 
 
332
        setWhatsThis(wheel_function_seek, tr("Media seeking"),
 
333
                tr("Check it to enable seeking as one function.") );
 
334
 
 
335
        setWhatsThis(wheel_function_volume, tr("Volume control"),
 
336
                tr("Check it to enable changing volume as one function.") );
 
337
 
 
338
        setWhatsThis(wheel_function_zoom, tr("Zoom video"),
 
339
                tr("Check it to enable zooming as one function.") );
 
340
 
 
341
        setWhatsThis(wheel_function_speed, tr("Change speed"),
 
342
                tr("Check it to enable changing speed as one function.") );
 
343
 
294
344
}
295
345
 
296
346
#include "moc_prefinput.cpp"