mainwindow.cpp
changeset 569 df32d920b04e
parent 537 16d3598f611f
child 571 bc9083a4a7fb
     1.1 --- a/mainwindow.cpp	Wed Jul 04 11:05:15 2007 +0000
     1.2 +++ b/mainwindow.cpp	Mon Jul 30 09:47:07 2007 +0000
     1.3 @@ -1332,55 +1332,116 @@
     1.4  	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
     1.5  	standardFlagsDefault->addFlag (fo);	
     1.6  
     1.7 +
     1.8  	fo->load(flagsPath+"flag-present.png");
     1.9 -	fo->setName("present");
    1.10 -	a=new QAction (fo->getPixmap(),fo->getName(),this);
    1.11 +	setupFlag (fo,tb,"present",tr("Surprise!","Standardflag"));
    1.12 +
    1.13 +	fo->load(flagsPath+"flag-flash.png");
    1.14 +	setupFlag (fo,tb,"flash",tr("Dangerous","Standardflag"));
    1.15 +	
    1.16 +	// Original: xsldbg_output.png
    1.17 +	fo->load(flagsPath+"flag-info.png");
    1.18 +	setupFlag (fo,tb,"info",tr("Info","Standardflag"));
    1.19 +
    1.20 +	// Original khelpcenter.png
    1.21 +	fo->load(flagsPath+"flag-lifebelt.png");
    1.22 +	setupFlag (fo,tb,"lifebelt",tr("This will help","Standardflag"));
    1.23 +
    1.24 +	// Freemind flags
    1.25 +
    1.26 +	fo->load(flagsPath+"freemind/warning.png");
    1.27 +	setupFlag (fo,tb,"freemind-warning",tr("Important","Freemind-Flag"));
    1.28 +
    1.29 +	for (int i=1; i<8; i++)
    1.30 +	{
    1.31 +		fo->load(flagsPath+QString("freemind/priority-%1.png").arg(i));
    1.32 +		setupFlag (fo,tb,QString("freemind-priority-%1").arg(i),tr("Priority","Freemind-Flag"));
    1.33 +	}
    1.34 +
    1.35 +	fo->load(flagsPath+"freemind/back.png");
    1.36 +	setupFlag (fo,tb,"freemind-back",tr("Back","Freemind-Flag"));
    1.37 +
    1.38 +	fo->load(flagsPath+"freemind/forward.png");
    1.39 +	setupFlag (fo,tb,"freemind-forward",tr("Forward","Freemind-Flag"));
    1.40 +
    1.41 +
    1.42 +	fo->load(flagsPath+"freemind/attach.png");
    1.43 +	setupFlag (fo,tb,"freemind-attach",tr("Look here","Freemind-Flag"));
    1.44 +
    1.45 +
    1.46 +	fo->load(flagsPath+"freemind/clanbomber.png");
    1.47 +	setupFlag (fo,tb,"freemind-clanbomber",tr("Dangerous","Freemind-Flag"));
    1.48 +
    1.49 +
    1.50 +	fo->load(flagsPath+"freemind/desktopnew.png");
    1.51 +	setupFlag (fo,tb,"freemind-desktopnew",tr("Don't forget","Freemind-Flag"));
    1.52 +
    1.53 +
    1.54 +	fo->load(flagsPath+"freemind/flag.png");
    1.55 +	setupFlag (fo,tb,"freemind-flag",tr("Flag","Freemind-Flag"));
    1.56 +
    1.57 +
    1.58 +	fo->load(flagsPath+"freemind/gohome.png");
    1.59 +	setupFlag (fo,tb,"freemind-gohome",tr("Home","Freemind-Flag"));
    1.60 +
    1.61 +
    1.62 +	fo->load(flagsPath+"freemind/kaddressbook.png");
    1.63 +	setupFlag (fo,tb,"freemind-kaddressbook",tr("Telephone","Freemind-Flag"));
    1.64 +
    1.65 +
    1.66 +	fo->load(flagsPath+"freemind/knotify.png");
    1.67 +	setupFlag (fo,tb,"freemind-knotify",tr("Music","Freemind-Flag"));
    1.68 +
    1.69 +
    1.70 +	fo->load(flagsPath+"freemind/korn.png");
    1.71 +	setupFlag (fo,tb,"freemind-korn",tr("Mailbox","Freemind-Flag"));
    1.72 +
    1.73 +
    1.74 +	fo->load(flagsPath+"freemind/mail.png");
    1.75 +	setupFlag (fo,tb,"freemind-mail",tr("Maix","Freemind-Flag"));
    1.76 +
    1.77 +	fo->load(flagsPath+"freemind/password.png");
    1.78 +	setupFlag (fo,tb,"freemind-password",tr("Password","Freemind-Flag"));
    1.79 +
    1.80 +	fo->load(flagsPath+"freemind/pencil.png");
    1.81 +	setupFlag (fo,tb,"freemind-pencil",tr("To be improved","Freemind-Flag"));
    1.82 +
    1.83 +	fo->load(flagsPath+"freemind/stop.png");
    1.84 +	setupFlag (fo,tb,"freemind-stop",tr("Stop","Freemind-Flag"));
    1.85 +
    1.86 +	fo->load(flagsPath+"freemind/wizard.png");
    1.87 +	setupFlag (fo,tb,"freemind-wizard",tr("Magic","Freemind-Flag"));
    1.88 +
    1.89 +	fo->load(flagsPath+"freemind/xmag.png");
    1.90 +	setupFlag (fo,tb,"freemind-xmag",tr("To be discussed","Freemind-Flag"));
    1.91 +
    1.92 +	fo->load(flagsPath+"freemind/bell.png");
    1.93 +	setupFlag (fo,tb,"freemind-bell",tr("Reminder","Freemind-Flag"));
    1.94 +
    1.95 +	fo->load(flagsPath+"freemind/bookmark.png");
    1.96 +	setupFlag (fo,tb,"freemind-bookmark",tr("Excellent","Freemind-Flag"));
    1.97 +
    1.98 +	fo->load(flagsPath+"freemind/penguin.png");
    1.99 +	setupFlag (fo,tb,"freemind-penguin",tr("Linux","Freemind-Flag"));
   1.100 +
   1.101 +	fo->load(flagsPath+"freemind/licq.png");
   1.102 +	setupFlag (fo,tb,"freemind-licq",tr("Sweet","Freemind-Flag"));
   1.103 +
   1.104 +	delete (fo);
   1.105 +}
   1.106 +
   1.107 +void Main::setupFlag (FlagObj *fo, QToolBar *tb, const QString &name, const QString &tooltip)
   1.108 +{
   1.109 +	fo->setName(name);
   1.110 +	QAction *a=new QAction (fo->getPixmap(),fo->getName(),this);
   1.111  	tb->addAction (a);
   1.112  	fo->setAction (a);
   1.113  	a->setCheckable(true);
   1.114  	a->setObjectName(fo->getName());
   1.115 -	a->setToolTip(tr("Surprise!","Standardflag"));
   1.116 +	a->setToolTip(tooltip);
   1.117  	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
   1.118  	standardFlagsDefault->addFlag (fo);	
   1.119 -
   1.120 -	fo->load(flagsPath+"flag-flash.png");
   1.121 -	fo->setName("flash");
   1.122 -	a=new QAction (fo->getPixmap(),fo->getName(),this);
   1.123 -	tb->addAction (a);
   1.124 -	fo->setAction (a);
   1.125 -	a->setCheckable(true);
   1.126 -	a->setObjectName(fo->getName());
   1.127 -	a->setToolTip(tr("Dangerous","Standardflag"));
   1.128 -	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
   1.129 -	standardFlagsDefault->addFlag (fo);	
   1.130 -	
   1.131 -	fo->load(flagsPath+"flag-info.png");
   1.132 -	// Original: xsldbg_output.png
   1.133 -	fo->setName("info");
   1.134 -	a=new QAction (fo->getPixmap(),fo->getName(),this);
   1.135 -	tb->addAction (a);
   1.136 -	fo->setAction (a);
   1.137 -	a->setCheckable(true);
   1.138 -	a->setObjectName(fo->getName());
   1.139 -	a->setToolTip(tr("Info","Standardflag"));
   1.140 -	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
   1.141 -	standardFlagsDefault->addFlag (fo);	
   1.142 -
   1.143 -	fo->load(flagsPath+"flag-lifebelt.png");
   1.144 -	// Original khelpcenter.png
   1.145 -	fo->setName("lifebelt");
   1.146 -	a=new QAction (fo->getPixmap(),fo->getName(),this);
   1.147 -	tb->addAction (a);
   1.148 -	fo->setAction (a);
   1.149 -	a->setCheckable(true);
   1.150 -	a->setObjectName(fo->getName());
   1.151 -	a->setToolTip(tr("This will help","Standardflag"));
   1.152 -	connect (a, SIGNAL( triggered() ), this, SLOT( standardFlagChanged() ) );
   1.153 -	standardFlagsDefault->addFlag (fo);	
   1.154 -
   1.155 -	delete (fo);
   1.156  }
   1.157 -
   1.158  // Network Actions
   1.159  void Main::setupNetworkActions()
   1.160  {
   1.161 @@ -3649,13 +3710,13 @@
   1.162  void Main::testFunction1()
   1.163  {
   1.164  	if (!currentMapEditor()) return;
   1.165 -	currentMapEditor()->newServer();
   1.166 +	currentMapEditor()->testFunction1();
   1.167  }
   1.168  
   1.169  void Main::testFunction2()
   1.170  {
   1.171  	if (!currentMapEditor()) return;
   1.172 -	currentMapEditor()->connectToServer();
   1.173 +	currentMapEditor()->testFunction2();
   1.174  }
   1.175  
   1.176  void Main::testCommand()