git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37756 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2010-07-26 12:39:18 +00:00
parent ed47eeec78
commit 004b2edb11
3 changed files with 22 additions and 21 deletions

View File

@ -18,7 +18,7 @@
#define B_TRANSLATE_CONTEXT "Terminal arguments parsing" #define B_TRANSLATE_CONTEXT "Terminal arguments parsing"
Arguments::Arguments(int defaultArgsNum, const char * const *defaultArgs) Arguments::Arguments(int defaultArgsNum, const char* const* defaultArgs)
: fUsageRequested(false), : fUsageRequested(false),
fBounds(50, 50, 630, 435), fBounds(50, 50, 630, 435),
fStandardShell(true), fStandardShell(true),
@ -36,12 +36,13 @@ Arguments::~Arguments()
_SetShellArguments(0, NULL); _SetShellArguments(0, NULL);
} }
void void
Arguments::Parse(int argc, const char *const *argv) Arguments::Parse(int argc, const char* const* argv)
{ {
int argi = 1; int argi = 1;
while (argi < argc) { while (argi < argc) {
const char *arg = argv[argi++]; const char* arg = argv[argi++];
if (*arg == '-') { if (*arg == '-') {
if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) {
@ -98,7 +99,7 @@ Arguments::Parse(int argc, const char *const *argv)
void void
Arguments::GetShellArguments(int &argc, const char *const *&argv) const Arguments::GetShellArguments(int& argc, const char* const*& argv) const
{ {
argc = fShellArgumentCount; argc = fShellArgumentCount;
argv = fShellArguments; argv = fShellArguments;
@ -106,7 +107,7 @@ Arguments::GetShellArguments(int &argc, const char *const *&argv) const
void void
Arguments::_SetShellArguments(int argc, const char *const *argv) Arguments::_SetShellArguments(int argc, const char* const* argv)
{ {
// delete old arguments // delete old arguments
for (int32 i = 0; i < fShellArgumentCount; i++) for (int32 i = 0; i < fShellArgumentCount; i++)

View File

@ -10,28 +10,28 @@
class Arguments { class Arguments {
public: public:
Arguments(int defaultArgcNum, const char *const *defaultArgv); Arguments(int defaultArgcNum, const char* const* defaultArgv);
~Arguments(); ~Arguments();
void Parse(int argc, const char *const *argv); void Parse(int argc, const char* const* argv);
BRect Bounds() const { return fBounds; } BRect Bounds() const { return fBounds; }
const char *Title() const { return fTitle; } const char* Title() const { return fTitle; }
bool StandardShell() const { return fStandardShell; } bool StandardShell() const { return fStandardShell; }
bool FullScreen() const { return fFullScreen; } bool FullScreen() const { return fFullScreen; }
bool UsageRequested() const { return fUsageRequested; } bool UsageRequested() const { return fUsageRequested; }
void GetShellArguments(int &argc, const char *const *&argv) const; void GetShellArguments(int& argc, const char* const*& argv) const;
private: private:
void _SetShellArguments(int argc, const char *const *argv); void _SetShellArguments(int argc, const char* const* argv);
bool fUsageRequested; bool fUsageRequested;
BRect fBounds; BRect fBounds;
bool fStandardShell; bool fStandardShell;
bool fFullScreen; bool fFullScreen;
int fShellArgumentCount; int fShellArgumentCount;
const char **fShellArguments; const char** fShellArguments;
const char *fTitle; const char* fTitle;
}; };

View File

@ -26,7 +26,7 @@
#undef B_TRANSLATE_CONTEXT #undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Terminal PrefWindow" #define B_TRANSLATE_CONTEXT "Terminal PrefWindow"
PrefWindow::PrefWindow(const BMessenger &messenger) PrefWindow::PrefWindow(const BMessenger& messenger)
: BWindow(BRect(0, 0, 375, 185), B_TRANSLATE("Terminal settings"), : BWindow(BRect(0, 0, 375, 185), B_TRANSLATE("Terminal settings"),
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS), B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS),
@ -84,7 +84,7 @@ PrefWindow::QuitRequested()
if (!fDirty) if (!fDirty)
return true; return true;
BAlert *alert = new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Save changes to this settings panel?"), B_TRANSLATE("Save changes to this settings panel?"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Don't save"), B_TRANSLATE("Save"), B_TRANSLATE("Cancel"), B_TRANSLATE("Don't save"), B_TRANSLATE("Save"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
@ -122,7 +122,7 @@ void
PrefWindow::_SaveRequested(BMessage *msg) PrefWindow::_SaveRequested(BMessage *msg)
{ {
entry_ref dirref; entry_ref dirref;
const char *filename; const char* filename;
msg->FindRef("directory", &dirref); msg->FindRef("directory", &dirref);
msg->FindString("name", &filename); msg->FindString("name", &filename);
@ -160,7 +160,7 @@ PrefWindow::_Revert()
void void
PrefWindow::MessageReceived(BMessage *msg) PrefWindow::MessageReceived(BMessage* msg)
{ {
switch (msg->what) { switch (msg->what) {
case MSG_SAVE_PRESSED: case MSG_SAVE_PRESSED: