Advertisement
orgads

QtC setup for Yuchen

May 30th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.35 KB | None | 0 0
  1.  
  2. #!/usr/bin/perl -w
  3.  
  4. use Config::Tiny;
  5.  
  6. sub readorcreate {
  7.   $Config->{$_[0]} || ($Config->{$_[0]} = {});
  8. }
  9.  
  10. sub configure {
  11.   my $appdata;
  12.   if $OSNAME eq 'MSWin32' {
  13.     $appdata = "$ENV{'APPDATA'}/Nokia";
  14.   } else {
  15.     $appdata = "$ENV{'HOME'}/.config/Nokia";
  16.   }
  17.   my $fname = "$appdata/QtCreator.ini";
  18.   $Config = Config::Tiny->read($fname) || Config::Tiny->new;
  19.  
  20.   my $debug = readorcreate('DebugMode');
  21.   $debug->{SwitchModeOnExit} = 'true';
  22.   $debug->{UseToolTips} = 'true';
  23.   $debug->{UseToolTipsInLocalsView} = 'true';
  24.  
  25.   my $keys = readorcreate('KeyBindings');
  26.   $keys->{size} = '12';
  27.   $keys->{'1\ID'} = 'Debugger.DebugWithoutDeploy';
  28.   $keys->{'1\Keysequence'} = 'Alt+F5';
  29.   $keys->{'2\ID'} = 'Git.DiffRepository';
  30.   $keys->{'2\Keysequence'} = 'Ctrl+Alt+Shift+D';
  31.   $keys->{'3\ID'} = 'Git.LogRepository';
  32.   $keys->{'3\Keysequence'} = 'Ctrl+Alt+Shift+L';
  33.   $keys->{'4\ID'} = 'Git.UndoRepository';
  34.   $keys->{'4\Keysequence'} = 'Ctrl+Alt+Shift+U';
  35.   $keys->{'5\ID'} = 'Git.LaunchGitK';
  36.   $keys->{'5\Keysequence'} = 'Ctrl+Alt+Shift+G';
  37.   $keys->{'6\ID'} = 'Git.BranchList';
  38.   $keys->{'6\Keysequence'} = 'Ctrl+Alt+Shift+B';
  39.   $keys->{'7\ID'} = 'Git.ShowCommit';
  40.   $keys->{'7\Keysequence'} = 'Ctrl+Alt+Shift+S';
  41.   $keys->{'8\ID'} = 'Git.AmendCommit';
  42.   $keys->{'8\Keysequence'} = 'Ctrl+Alt+Shift+A';
  43.   $keys->{'9\ID'} = 'TextEditor.DeleteLine';
  44.   $keys->{'9\Keysequence'} = 'Ctrl+D';
  45.   $keys->{'10\ID'} = 'TextEditor.GotoLineStart';
  46.   $keys->{'10\Keysequence'} = 'Alt+Shift+Return';
  47.   $keys->{'11\ID'} = 'TextEditor.GotoLineEnd';
  48.   $keys->{'11\Keysequence'} = 'Shift+Return';
  49.   $keys->{'12\ID'} = 'TextEditor.CompleteThis';
  50.   $keys->{'12\Keysequence'} = 'Shift+Space';
  51.  
  52.   $Config->{Git}->{TimeOut} = 90;
  53.   if $OSNAME eq 'linux' {
  54.     $Config->{TextEditor}->{FontSize} = 10;
  55.   } elsif $OSNAME eq 'MSWin32' {
  56.     $Config->{TextEditor}->{FontSize} = 11;
  57.     $Config->{TextEditor}->{FontFamily} = 'Consolas';
  58.   }
  59.  
  60.   my $textDisplay = readorcreate('textDisplaySettings');
  61.   $textDisplay->{ShowWrapColumn} = true;
  62.   $textDisplay->{WrapColumn} = 100;
  63.   $textDisplay->{HighlightCurrentLine2Key} = true;
  64.  
  65.   $Config->{Plugins}->{ForceEnabled} = 'Todo';
  66.   $Config->{Plugins}->{Ignored} = 'AnalyzerBase, Bazaar, CodePaster, CVS, FakeVim, Madde, Mercurial, Perforce, RemoteLinux, Subversion, Valgrind';
  67.  
  68.   $Config->write("$fname");
  69. }
  70.  
  71. configure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement