Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2004, 12:05:29 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: Now in non-gtk-mode, the Gui will ask questions for what Option to change… it is kind of sexy, but you can not change the Option yet. but this will follow.
I am now going into holydays till 1.1.2005: I hope you all have a good 'rutsch' into the new year.
cheers bensch

PS: I do not believe that anyone reads this, but anyways it was fun writing it :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui.cc

    r3303 r3305  
    5858OrxonoxGui::OrxonoxGui (int argc, char *argv[])
    5959{
    60 #ifdef HAVE_GTK2
    61   initGTK(argc, argv);
    62 #endif /* HAVE_GTK2 */
     60  initGUI(argc, argv);
    6361
    6462  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
     
    121119    OrxonoxGuiExec::startOrxonox(NULL, exec);
    122120  else
     121    {
    123122#ifdef HAVE_GTK2
    124     {
    125       mainloopGTK();
     123      mainloopGUI();
     124#else /* HAVE_GTK2 */
     125      char boolAns = 'y';
     126      char ans[10];
     127      while(true)
     128        {
     129          PRINT(0)(" Listing all the Orxonox Options: \n");
     130          PRINT(0)("  #############################\n");
     131          Window::mainWindow->walkThrough(Widget::listOptionsAndGroups, 1);
     132         
     133          PRINT(0)("\nDo you want change any of the above values now? [Yn] ");
     134          cin >>boolAns ;
     135          if (boolAns =='n' || boolAns=='N')
     136            break;
     137
     138          PRINT(0)("\n Listing all groups\n");
     139          PRINT(0)("  #################\n");
     140          int groupCount = 0;
     141          Window::mainWindow->walkThrough(Widget::listGroups, &groupCount, 1);
     142         
     143          PRINT(0)("\nIn which Group? [1-%d] ", groupCount);
     144          Packer* group;
     145          while(true)
     146            {
     147              cin >> ans;
     148              int ansIp = atoi(ans);
     149              if (ansIp <= groupCount)
     150                {
     151                  group = static_cast<Packer*>(Window::mainWindow->findGroupByNumber(&ansIp, 1));
     152                break;
     153                }
     154              else
     155                PRINT(0)("\nChoose a smaler Number please: [1-%d] ", groupCount);
     156            }
     157          PRINT(0)("\n\nGroup: [%s]\n\n", group->groupName);
     158          int optionCount = 0;
     159          group->walkThrough(Widget::listOptions, &optionCount, 0);
     160          PRINT(0)("\nWhich Option? [1-%d] ", optionCount);
     161          Option* option;
     162          while(true)
     163            {
     164              cin >> ans;
     165              int ansIp = atoi(ans);
     166              if (ansIp <= groupCount)
     167                {
     168                  option = static_cast<Option*>(group->findOptionByNumber(&ansIp, 0));
     169                break;
     170                }
     171              else
     172                PRINT(0)("\nChoose a smaler Number please: [1-%d] ", optionCount);
     173            }
     174          PRINT(0)("\n\n:: %s ::\n", option->title);
     175
     176          // here follows the rest.... this will be nasty.
     177          //! \todo move this into the gui-gtk-file
     178          //! \todo finish it.
     179        }
    126180    }
    127 #else /* HAVE_GTK2 */
    128   {
    129     PRINT(0)(" Listing all the Orxonox Options: \n");
    130     PRINT(0)("  #############################\n");
    131     orxonoxGUI->walkThrough(orxonoxGUI->listOptions, 0);
    132    
    133     PRINT(0)("\nDo you want me to save the the above values now? [Yn] ");
    134     char c = getchar();
    135     if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave())
    136       exec->writeToFile (Window::mainWindow);
    137     OrxonoxGuiExec::startOrxonox(NULL, exec);
    138   }
    139181
    140182#endif /* HAVE_GTK2 */
Note: See TracChangeset for help on using the changeset viewer.