Commit 617f4f72 authored by Laurent Montel's avatar Laurent Montel 😁

Use new connect api + QStringLiteral

parent bc1cd3e6
......@@ -141,12 +141,12 @@ KLineal::KLineal( QWidget *parent )
"little square at the end of the line cursor." ) );
mBtnRotateLeft = new QToolButton( this );
mBtnRotateLeft->setIcon( QIcon::fromTheme( QLatin1String( "object-rotate-left" ) ) );
mBtnRotateLeft->setIcon( QIcon::fromTheme( QStringLiteral( "object-rotate-left" ) ) );
mBtnRotateLeft->setToolTip( i18n( "Turn Left" ) );
connect(mBtnRotateLeft, &QToolButton::clicked, this, &KLineal::turnLeft);
mBtnRotateRight = new QToolButton( this );
mBtnRotateRight->setIcon( QIcon::fromTheme( QLatin1String( "object-rotate-right" ) ) );
mBtnRotateRight->setIcon( QIcon::fromTheme( QStringLiteral( "object-rotate-right" ) ) );
mBtnRotateRight->setToolTip( i18n( "Turn Right" ) );
connect(mBtnRotateRight, &QToolButton::clicked, this, &KLineal::turnRight);
......@@ -154,51 +154,51 @@ KLineal::KLineal( QWidget *parent )
//BEGIN setup menu and actions
mActionCollection = new KActionCollection( this );
mActionCollection->setConfigGroup( QLatin1String( "Actions" ) );
mActionCollection->setConfigGroup( QStringLiteral( "Actions" ) );
mMenu = new QMenu( this );
mMenu->addSection( i18n( "KRuler" ) );
QMenu *oriMenu = new QMenu( i18n( "&Orientation"), this );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "kruler-north" ) ), i18nc( "Turn Kruler North", "&North" ),
this, SLOT(setNorth()), Qt::Key_N, QLatin1String( "turn_north" ) );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "kruler-east" ) ), i18nc( "Turn Kruler East", "&East" ),
this, SLOT(setEast()), Qt::Key_E, QLatin1String( "turn_east" ) );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "kruler-south" ) ), i18nc( "Turn Kruler South", "&South" ),
this, SLOT(setSouth()), Qt::Key_S, QLatin1String( "turn_south" ) );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "kruler-west" ) ), i18nc( "Turn Kruler West", "&West" ),
this, SLOT(setWest()), Qt::Key_W, QLatin1String( "turn_west" ) );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "object-rotate-right" ) ), i18n( "&Turn Right" ),
this, SLOT(turnRight()), Qt::Key_R, QLatin1String( "turn_right" ) );
addAction( oriMenu, QIcon::fromTheme( QLatin1String( "object-rotate-left" ) ), i18n( "Turn &Left" ),
this, SLOT(turnLeft()), Qt::Key_L, QLatin1String( "turn_left" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "kruler-north" ) ), i18nc( "Turn Kruler North", "&North" ),
this, SLOT(setNorth()), Qt::Key_N, QStringLiteral( "turn_north" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "kruler-east" ) ), i18nc( "Turn Kruler East", "&East" ),
this, SLOT(setEast()), Qt::Key_E, QStringLiteral( "turn_east" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "kruler-south" ) ), i18nc( "Turn Kruler South", "&South" ),
this, SLOT(setSouth()), Qt::Key_S, QStringLiteral( "turn_south" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "kruler-west" ) ), i18nc( "Turn Kruler West", "&West" ),
this, SLOT(setWest()), Qt::Key_W, QStringLiteral( "turn_west" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "object-rotate-right" ) ), i18n( "&Turn Right" ),
this, SLOT(turnRight()), Qt::Key_R, QStringLiteral( "turn_right" ) );
addAction( oriMenu, QIcon::fromTheme( QStringLiteral( "object-rotate-left" ) ), i18n( "Turn &Left" ),
this, SLOT(turnLeft()), Qt::Key_L, QStringLiteral( "turn_left" ) );
mMenu->addMenu( oriMenu );
mLenMenu = new QMenu( i18n( "&Length" ), this );
addAction( mLenMenu, QIcon(), i18nc( "Make Kruler Height Short", "&Short" ),
this, SLOT(setShortLength()), Qt::CTRL + Qt::Key_S, QLatin1String( "length_short" ) );
this, SLOT(setShortLength()), Qt::CTRL + Qt::Key_S, QStringLiteral( "length_short" ) );
addAction( mLenMenu, QIcon(), i18nc( "Make Kruler Height Medium", "&Medium" ),
this, SLOT(setMediumLength()), Qt::CTRL + Qt::Key_M, QLatin1String( "length_medium" ) );
this, SLOT(setMediumLength()), Qt::CTRL + Qt::Key_M, QStringLiteral( "length_medium" ) );
addAction( mLenMenu, QIcon(), i18nc( "Make Kruler Height Tall", "&Tall" ),
this, SLOT(setTallLength()), Qt::CTRL + Qt::Key_T, QLatin1String( "length_tall" ) );
this, SLOT(setTallLength()), Qt::CTRL + Qt::Key_T, QStringLiteral( "length_tall" ) );
addAction( mLenMenu, QIcon(), i18n("&Full Screen Width"),
this, SLOT(setFullLength()), Qt::CTRL + Qt::Key_F, QLatin1String( "length_full_length" ) );
this, SLOT(setFullLength()), Qt::CTRL + Qt::Key_F, QStringLiteral( "length_full_length" ) );
mLenMenu->addSeparator();
addAction( mLenMenu, QIcon(), i18n( "Length..." ),
this, SLOT(slotLength()), QKeySequence(), QLatin1String( "set_length" ) );
this, SLOT(slotLength()), QKeySequence(), QStringLiteral( "set_length" ) );
mMenu->addMenu( mLenMenu );
QMenu* scaleMenu = new QMenu( i18n( "&Scale" ), this );
mScaleDirectionAction = addAction( scaleMenu, QIcon(), i18n( "Right to Left" ),
this, SLOT(switchDirection()), Qt::Key_D, QLatin1String( "right_to_left" ) );
this, SLOT(switchDirection()), Qt::Key_D, QStringLiteral( "right_to_left" ) );
mCenterOriginAction = addAction( scaleMenu, QIcon(), i18n( "Center Origin" ),
this, SLOT(centerOrigin()), Qt::Key_C, QLatin1String( "center_origin" ) );
this, SLOT(centerOrigin()), Qt::Key_C, QStringLiteral( "center_origin" ) );
mCenterOriginAction->setEnabled( !mRelativeScale );
mOffsetAction = addAction( scaleMenu, QIcon(), i18n( "Offset..." ),
this, SLOT(slotOffset()), Qt::Key_O, QLatin1String( "set_offset" ) );
this, SLOT(slotOffset()), Qt::Key_O, QStringLiteral( "set_offset" ) );
mOffsetAction->setEnabled( !mRelativeScale );
scaleMenu->addSeparator();
QAction *relativeScaleAction = addAction( scaleMenu, QIcon(), i18n( "Percentage" ),
0, 0, QKeySequence(), QLatin1String( "toggle_percentage" ) );
0, 0, QKeySequence(), QStringLiteral( "toggle_percentage" ) );
relativeScaleAction->setCheckable( true );
relativeScaleAction->setChecked( mRelativeScale );
connect(relativeScaleAction, &QAction::toggled, this, &KLineal::switchRelativeScale);
......@@ -266,7 +266,7 @@ void KLineal::createSystemTray()
}
if ( !mTrayIcon ) {
mTrayIcon = new KRulerSystemTray( QLatin1String( "kruler" ), this, mActionCollection );
mTrayIcon = new KRulerSystemTray( QStringLiteral( "kruler" ), this, mActionCollection );
mTrayIcon->setCategory( KStatusNotifierItem::ApplicationStatus );
}
}
......@@ -622,13 +622,13 @@ void KLineal::slotKeyBindings()
void KLineal::slotPreferences()
{
KConfigDialog *dialog = new KConfigDialog( this, QLatin1String( "settings" ), RulerSettings::self() );
KConfigDialog *dialog = new KConfigDialog( this, QStringLiteral( "settings" ), RulerSettings::self() );
Ui::ConfigAppearance appearanceConfig;
QWidget *appearanceConfigWidget = new QWidget( dialog );
appearanceConfig.setupUi( appearanceConfigWidget );
appearanceConfig.kcfg_CloseButtonVisible->setEnabled( appearanceConfig.kcfg_TrayIcon->isChecked() );
dialog->addPage( appearanceConfigWidget, i18n( "Appearance" ), QLatin1String( "preferences-desktop-default-applications" ) );
dialog->addPage( appearanceConfigWidget, i18n( "Appearance" ), QStringLiteral( "preferences-desktop-default-applications" ) );
#ifdef KRULER_HAVE_X11
// Advanced page only contains "Native moving" setting, disable when not running on X11
......@@ -636,7 +636,7 @@ void KLineal::slotPreferences()
Ui::ConfigAdvanced advancedConfig;
QWidget *advancedConfigWidget = new QWidget( dialog );
advancedConfig.setupUi( advancedConfigWidget );
dialog->addPage( advancedConfigWidget, i18n( "Advanced" ), QLatin1String( "preferences-other" ) );
dialog->addPage( advancedConfigWidget, i18n( "Advanced" ), QStringLiteral( "preferences-other" ) );
}
#endif
......@@ -871,7 +871,7 @@ void KLineal::keyPressEvent( QKeyEvent *e )
}
move( pos() + dist );
KNotification::event( QString(), QLatin1String( "cursormove" ), QString() );
KNotification::event( QString(), QStringLiteral( "cursormove" ), QString() );
}
/**
......
......@@ -27,5 +27,5 @@ KRulerSystemTray::KRulerSystemTray( const QString& iconName, QWidget *parent, KA
setStatus(KStatusNotifierItem::Active);
setToolTip( iconName, i18n( "KDE Screen Ruler" ), QString() );
QMenu *cm = contextMenu();
cm->addAction( actions->action( QLatin1String( "preferences" ) ) );
cm->addAction( actions->action( QStringLiteral( "preferences" ) ) );
}
......@@ -26,19 +26,19 @@ int main(int argc, char *argv[])
{
QApplication a( argc, argv );
Kdelibs4ConfigMigrator migrate(QLatin1String("kruler"));
migrate.setConfigFiles(QStringList() << QLatin1String("krulerrc") << QLatin1String("kruler.notifyrc"));
migrate.setUiFiles(QStringList() << QLatin1String("krulerui.rc"));
Kdelibs4ConfigMigrator migrate(QStringLiteral("kruler"));
migrate.setConfigFiles(QStringList() << QStringLiteral("krulerrc") << QStringLiteral("kruler.notifyrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("krulerui.rc"));
migrate.migrate();
KAboutData aboutData( "kruler", i18n( "KDE Screen Ruler" ),
"5.0", // version string
KAboutData aboutData( QStringLiteral("kruler"), i18n( "KDE Screen Ruler" ),
QStringLiteral("5.0"), // version string
i18n( "A screen ruler for KDE" ),
KAboutLicense::GPL,
i18n( "(c) 2000 - 2008, Till Krech\n(c) 2009, Mathias Soeken" ) );
aboutData.addAuthor( i18n( "Mathias Soeken" ), i18n( "Maintainer" ), "msoeken@tzi.de" );
aboutData.addAuthor( i18n( "Till Krech" ), i18n( "Former Maintainer and Developer" ), "till@snafu.de" );
aboutData.addCredit( i18n( "Gunnstein Lye" ),i18n( "Initial port to KDE 2" ), "gl@ez.no" );
aboutData.addAuthor( i18n( "Mathias Soeken" ), i18n( "Maintainer" ), QStringLiteral("msoeken@tzi.de") );
aboutData.addAuthor( i18n( "Till Krech" ), i18n( "Former Maintainer and Developer" ), QStringLiteral("till@snafu.de") );
aboutData.addCredit( i18n( "Gunnstein Lye" ),i18n( "Initial port to KDE 2" ), QStringLiteral("gl@ez.no") );
KAboutData::setApplicationData(aboutData);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment