Merge branch 'master' into sam460ex

This commit is contained in:
François Revol 2013-03-09 03:50:12 +01:00
commit f106fe34d2
146 changed files with 8432 additions and 1291 deletions

View File

@ -131,14 +131,12 @@ if $(HAIKU_USE_GCC_PIPE) = 1 {
# results in some broken code.
# TODO: remove the -fno-strict-aliasing option when all code has been
# analyzed/fixed with regard to aliasing.
# TODO: retest/remove the -fno-tree-vrp option as soon as we have updated our
# gcc4 compiler.
if $(HAIKU_GCC_VERSION[1]) >= 3 {
HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing ;
}
if $(HOST_GCC_VERSION[1]) >= 3 {
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing ;
}
# override gcc 2.95.3's header directory -- strictly necessary only when using

View File

@ -18,7 +18,7 @@ SYSTEM_BIN = [ FFilterByBuildFeatures
hd head hey hostname
id ident ifconfig <bin>install installsound iroster isvolume
ideinfo@ide idestatus@ide
join kernel_debugger keymap kill
join kernel_debugger keymap keystore kill
less lessecho lesskey link linkcatkeys listarea listattr listimage listdev
listport listres listsem listusb ln locale locate logger login logname ls
lsindex
@ -84,7 +84,7 @@ PRIVATE_SYSTEM_LIBS = [ FFilterByBuildFeatures
libilmimf.so
] ;
SYSTEM_SERVERS = [ FFilterByBuildFeatures
app_server cddb_daemon debug_server input_server mail_daemon
app_server cddb_daemon debug_server input_server keystore_server mail_daemon
media_addon_server media_server midi_server mount_server net_server
notification_server power_daemon print_server print_addon_server registrar
syslog_daemon

Binary file not shown.

View File

@ -1,2 +1,2 @@
1 finnish x-vnd.Haiku-IntelDiskAddOn 4191422532
Active partition BFS_Creation_Parameter Aktivoi osio
1 finnish x-vnd.Haiku-IntelDiskAddOn 946918966
Active partition PrimaryPartitionEditor Aktivoi osio

View File

@ -0,0 +1,2 @@
1 finnish x-vnd.Haiku-NTFSDiskAddOn 25755486
Name: NTFS_Initialize_Parameter Nimi:

View File

@ -0,0 +1,34 @@
1 finnish x-vnd.Haiku-hmulti_audio.media_addon 451057402
Master MultiAudio Alkuperäisversio
SPDIF MultiAudio SPDIF
Gain MultiAudio Vahvistus
Output 3D center MultiAudio Tulosta 3D-keskus
Extended Setup MultiAudio Laajennettu asetus
CD MultiAudio CD
Tone control MultiAudio Äänensävyn säätö
Phone MultiAudio Puhelin
Aux MultiAudio Aux
Output bass MultiAudio Basso-ulostulo
Headphones MultiAudio Kuulokkeet
Beep MultiAudio Piip
Output mono mix MultiAudio Monomiksaus-ulostulo
Output stereo mix MultiAudio Stereomiksaus-ulostulo
Input MultiAudio Tulo
Output treble MultiAudio Diskantti-ulostulo
Mono mix MultiAudio Monomiksaus
General MultiAudio Yleisasetukset
Input & Output MultiAudio Tulot ja lähdöt
Enhanced Setup MultiAudio Laajennetut asetukset
Stereo mix MultiAudio Stereomiksaus
Output 3D depth MultiAudio Tulosta 3D-syvyys
Volume MultiAudio Äänenvoimakkuus
Output MultiAudio Lähtö
Video MultiAudio Video
Line MultiAudio Linja
Mic MultiAudio Mikrofoni
frequency: MultiAudio taajuus:
Enable MultiAudio Käytössä
Mute MultiAudio Vaimennettu
Wave MultiAudio Aalto
Setup MultiAudio Asetukset
Level MultiAudio Taso

View File

@ -1,4 +1,4 @@
1 german x-vnd.Haiku-DriveSetup 3977871021
1 german x-vnd.Haiku-DriveSetup 3775412465
DriveSetup System name Datenträgerverwaltung
Cancel AbstractParametersPanel Abbrechen
Delete MainWindow Löschen
@ -63,6 +63,7 @@ Continue MainWindow Weiter
Cannot delete the selected partition. MainWindow Gewählte Partition konnte nicht gelöscht werden.
Mount all MainWindow Alle einhängen
End: %s Support Ende: %s
The panel could not return successfully. MainWindow Das Fenster meldete sich nicht mehr zurück.
Cancel MainWindow Abbrechen
Delete partition MainWindow Partition löschen
Are you sure you want to change parameters of the selected partition?\n\nThe partition may no longer be recognized by other operating systems anymore! MainWindow Sollen die Parameter der ausgewählten Partition wirklich geändert werden?\n\nAndere Betriebssysteme können die Partition unter Umständen nicht mehr erkennen!

View File

@ -1,11 +1,14 @@
1 finnish x-vnd.Haiku-DriveSetup 644135944
1 finnish x-vnd.Haiku-DriveSetup 3775412465
DriveSetup System name Levyasema-asetukset
Cancel AbstractParametersPanel Peru
Delete MainWindow Poista
Are you sure you want to write the changes back to disk now?\n\nAll data on the selected partition will be irretrievably lost if you do so! MainWindow Oletko varma, että haluat nyt kirjoittaa muutokset takaisin levylle?\n\nKaikki valitun osion tiedot katoavat palauttamattomasti, jos teet niin!
Rescan MainWindow Etsi uudelleen
OK MainWindow Valmis
Could not aquire partitioning information. MainWindow Ei voitu hakea osiointitietoja.
There's no space on the partition where a child partition could be created. MainWindow Osiolla ei ole mitään tilaa, johon olisi voitu luoda tytärosio.
Initialize InitializeParametersPanel Alusta
OK AbstractParametersPanel Valmis
<empty> PartitionList <tyhjä>
Unable to find the selected partition by ID. MainWindow Valitun osion löytäminen tunnisteen perusteella epäonnistui.
Select a partition from the list below. DiskView Valitse osio alapuolella olevasta luettelosta.
@ -15,6 +18,7 @@ The selected disk is read-only. MainWindow Valittu levy on kirjoitussuojattu.
Are you sure you want to format the partition \"%s\"? You will be asked again before changes are written to the disk. MainWindow Oletko varma, että haluat alustaa osion \"%s\"? Samaa kysytään uudelleen ennen muutosten kirjoittamista levylle.
Could not mount partition %s. MainWindow Osion %s liittäminen epäonnistui.
The partition %s has been successfully formatted.\n MainWindow Osion %s alustus onnistui.\n
Change parameters MainWindow Vaihda parametreja
The partition %s is already unmounted. MainWindow Osio %s on jo liitetty.
Failed to delete the partition. No changes have been written to disk. MainWindow Osion poistaminen epäonnistui. Mitään muutoksia ei ole kirjoitettu levylle.
Could not delete the selected partition. MainWindow Valitun osion poistaminen epäonnistui.
@ -33,38 +37,53 @@ Write changes MainWindow Kirjoita muutokset
There was an error preparing the disk for modifications. MainWindow Tapahtui virhe valmisteltaessa levyä muutoksia varten.
The partition %s is already mounted. MainWindow Osio %s on jo liitetty.
Are you sure you want to format the partition? You will be asked again before changes are written to the disk. MainWindow Oletko varma, että haluat alustaa osion? Samaa kysytään uudelleen ennen muutosten kirjoittamista levylle.
Partition name: ChangeParametersPanel Osionimi:
Change ChangeParametersPanel Vaihda
Are you sure you want to write the changes back to disk now?\n\nAll data on the disk %s will be irretrievably lost if you do so! MainWindow Oletko varma, että haluat nyt kirjoittaa muutokset takaisin levylle?\n\nKaikki levyn %s tiedot katoavat palauttamattomasti, jos teet niin!
Are you sure you want to delete the selected partition?\n\nAll data on the partition will be irretrievably lost if you do so! MainWindow Oletko varma, että haluat poistaa valitun osion?\n\nKaikki osion tiedot katoavat palauttamattomasti, jos teet niin!
Create… MainWindow Luo…
Disk system \"%s\"\" not found! MainWindow Levyjärjestelmää ”%s” ei löytynyt!
The disk has been successfully initialized.\n MainWindow Levyn alustus onnistui.\n
Could not unmount partition %s. MainWindow Osion %s irrottaminen epäonnistui.
Failed to change the parameters of the partition. No changes have been written to disk. MainWindow Osion parametrien vaihtaminen epäonnistui. Levylle ei ole kirjoitettu mitään muutoksia.
Failed to format the partition %s!\n MainWindow Osion %s alustus epäonnistui!\n
Mount MainWindow Liitä
Partition type PartitionList Osiotyyppi
Are you sure you want to format a raw disk? (most people initialize the disk with a partitioning system first) You will be asked again before changes are written to the disk. MainWindow Oletko varma, että haluat alustaa raakalevyn? (useimmat ihmiset alustavat levyn ensin osiointijärjestelmällä) Samaa kysytään uudelleen ennen kuin muutokset kirjoitetaan levylle.
The panel experienced a problem! MainWindow Paneelissa oli pulmia!
Change parameters… MainWindow Vaihda parametreja...
Device PartitionList Laite
Disk MainWindow Levy
Are you sure you want to initialize the selected disk? All data will be lost. You will be asked again before changes are written to the disk.\n MainWindow Oletko varma, etä haluat alustaa valitun levyn? Kaikki olemassaolevat tiedot katoavat. Samaa kysytään uudelleen ennen kuin muutokset kirjoitetaan levylle.\n
Partition size CreateParametersPanel Osiokoko
Device DiskView Laite
Active PartitionList Aktiivinen
Volume name PartitionList Taltionimi
Continue MainWindow Jatka
Cannot delete the selected partition. MainWindow Valitun osion poistaminen epäonnistui.
Mount all MainWindow Liitä kaikki
End: %s Support Loppu: %s
The panel could not return successfully. MainWindow Paluu paneelista epäonnistui.
Cancel MainWindow Peru
Delete partition MainWindow Poista osio
Are you sure you want to change parameters of the selected partition?\n\nThe partition may no longer be recognized by other operating systems anymore! MainWindow Oletko varma, että haluat vaihtaa valitun osion parametreja?\n\nMuut käyttöjärjestelmät eivät ehkä enää tunnista osiota!
Eject MainWindow Poista asemasta
Partition MainWindow Osio
Validation of the given parameters failed. MainWindow Annettujen parametrien todentaminen epäonnistui.
Create CreateParametersPanel Luo
File system PartitionList Tiedostojärjestelmä
Validation of the given creation parameters failed. MainWindow Annettujen luontiparametrien todentaminen epäonnistui.
Partition type: ChangeParametersPanel Osiotyyppi:
Size PartitionList Koko
Wipe (not implemented) MainWindow Alustus (ei ole toteutettu)
Validation of the given initialization parameters failed. MainWindow Annettujen alustusparametrien todentaminen epäonnistui.
The selected partition does not contain a partitioning system. MainWindow Valittu osio ei sisällä osiointijärjestelmää.
Offset: %s Support Siirrososoite: %s
Are you sure you want to write the changes back to disk now?\n\nAll data on the partition %s will be irretrievably lost if you do so! MainWindow Oletko varma, että haluat nyt kirjoittaa muutokset takaisin levylle?\n\nKaikki osion %s tiedot kadotetaan palauttamattomasti, jos teet niin!
The partition %s is currently mounted. MainWindow Osio %s on nykyisin liitetty.
Surface test (not implemented) MainWindow Pintatesti (ei toteutettu)
Format MainWindow Alusta
Could not change the parameters of the selected partition. MainWindow Valitun osion parametrien vaihtaminen epäonnistui.
Parameters PartitionList Parametrit
Creation of the partition has failed. MainWindow Osion luominen epäonnistui.
The currently selected partition is not empty. MainWindow Nykyinen valittu osio ei ole tyhjä.

View File

@ -1,11 +1,14 @@
1 french x-vnd.Haiku-DriveSetup 659039073
1 french x-vnd.Haiku-DriveSetup 1767229522
DriveSetup System name Gestionnaire de disque
Cancel AbstractParametersPanel Annuler
Delete MainWindow Supprimer
Are you sure you want to write the changes back to disk now?\n\nAll data on the selected partition will be irretrievably lost if you do so! MainWindow Êtes-vous sûr de vouloir écrire les changements sur le disque ?\n\nToutes les données de la partition sélectionnée seront effacées si vous le faites !
Rescan MainWindow Analyser
OK MainWindow OK
Could not aquire partitioning information. MainWindow Impossible de récupérer les informations sur les partitions.
There's no space on the partition where a child partition could be created. MainWindow Il n'y a pas de place dans cette partition pour créer une partition fille.
Initialize InitializeParametersPanel Initialiser
OK AbstractParametersPanel OK
<empty> PartitionList <vide>
Unable to find the selected partition by ID. MainWindow Impossible de trouver la partition sélectionnée par son ID.
Select a partition from the list below. DiskView Sélectionnez une partition dans la liste ci-dessous.

View File

@ -1,5 +1,6 @@
1 finnish x-vnd.Haiku-FirstBootPrompt 988630706
1 finnish x-vnd.Haiku-FirstBootPrompt 2649051796
Custom BootPromptWindow Oma
Boot to Desktop BootPromptWindow Alkukäynnistä työpöydälle
Thank you for trying out Haiku! We hope you'll like it!\n\nYou can select your preferred language and keyboard layout from the list on the left which will then be used instantly. You can easily change both settings from the Desktop later on on the fly.\n\nDo you wish to run the Installer or continue booting to the Desktop?\n BootPromptWindow For other languages, a note could be added: \"Note: Localization of Haiku applications and other components is an on-going effort. You will frequently encounter untranslated strings, but if you like, you can join in the work at <www.haiku-os.org>.\" Kiitoksia siitä, että kokeilet Haikua! Toivomme, että pidät siitä!\n\nVoit valita ensisijaisen kielen ja näppäimistöasetuksen vasemmalla näkyvästä luettelosta. Asetukset otetaan käyttöön välittömästi. Voit helposti vaihtaa molempia asetuksia myöhemmin työpöydältäsi.\n\nHaluatko suorittaa asennusohjelman tai jatkaa alkulautausta työpöydälle?\n Huomaa: Ponnistelemme edelleen Haiku-sovellusten ja muiden komponenttien kotoistamiseksi. Kohtaat usein suomentamattomia merkkijonoja, mutta jos haluat, voit liittyä työhön osoitteessa <www.haiku-os.org>.
Language BootPromptWindow Kieli
Welcome to Haiku! BootPromptWindow Tervetuloa Haikuun!

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-FontDemo 1300625863
1 finnish x-vnd.Haiku-FontDemo 3522850500
Outline: ControlView Ääriviiva:
Size: 50 ControlView Koko: 50
Stop cycling ControlView Lopeta kierros
@ -14,6 +14,7 @@ Rotation: 0 ControlView Kierto: 0
Drawing mode: ControlView Piirrostila:
Haiku, Inc. ControlView Haiku, Inc.
Controls FontDemo Ohjaimet
FontDemo System name FontDemo
Outline: %d ControlView Ääriviiva: %d
Text: ControlView Teksti:
Antialiased text ControlView Peitenimetön teksti

View File

@ -1,4 +1,4 @@
1 german x-vnd.Haiku-LaunchBox 3016105370
1 german x-vnd.Haiku-LaunchBox 3692177981
New LaunchBox Neu
Set description… LaunchBox Beschreibung ändern…
Vertical layout LaunchBox Vertikale Anordnung
@ -6,6 +6,7 @@ OK LaunchBox OK
Pad 1 LaunchBox Block 1
last chance LaunchBox letzte Chance
Quit LaunchBox Beenden
Open containing folder LaunchBox Speicherort öffnen
Clear button LaunchBox Feld leeren
LaunchBox System name LaunchBox
Ignore double-click LaunchBox Doppelklick ignorieren

View File

@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-LaunchBox 3016105370
1 hungarian x-vnd.Haiku-LaunchBox 3692177981
New LaunchBox Új
Set description… LaunchBox Leírás…
Vertical layout LaunchBox Függőleges elrendezés
@ -6,6 +6,7 @@ OK LaunchBox Rendben
Pad 1 LaunchBox 1. tálca
last chance LaunchBox utolsó esély
Quit LaunchBox Kilépés
Open containing folder LaunchBox Tartalmazó mappa megnyitása
Clear button LaunchBox Gomb kiürítése
LaunchBox System name Indítósáv
Ignore double-click LaunchBox Dupla kattintás figyelmen kívül hagyása

View File

@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-LaunchBox 3016105370
1 japanese x-vnd.Haiku-LaunchBox 3692177981
New LaunchBox 新規作成
Set description… LaunchBox 説明の作成…
Vertical layout LaunchBox 垂直配置
@ -6,6 +6,7 @@ OK LaunchBox OK
Pad 1 LaunchBox パッド 1
last chance LaunchBox 最後のチャンス
Quit LaunchBox 終了
Open containing folder LaunchBox フォルダーを開く
Clear button LaunchBox ボタンを消去
LaunchBox System name ランチャー
Ignore double-click LaunchBox ダブルクリックを無視する

View File

@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-LaunchBox 3016105370
1 swedish x-vnd.Haiku-LaunchBox 3692177981
New LaunchBox Ny
Set description… LaunchBox Ange beskrivning...
Vertical layout LaunchBox Vertikal utformning
@ -6,6 +6,7 @@ OK LaunchBox OK
Pad 1 LaunchBox Block 1
last chance LaunchBox sista chansen
Quit LaunchBox Avsluta
Open containing folder LaunchBox Öppna innehållande mapp
Clear button LaunchBox Rensa knapp
LaunchBox System name StartBlock
Ignore double-click LaunchBox Ignorera dubbelklick

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-Terminal 766764238
1 finnish x-vnd.Haiku-Terminal 2645209895
Not found. Terminal TermWindow Ei löytynyt.
Switch Terminals Terminal TermWindow Vaihda pääteikkunoita
Change directory Terminal TermView Vaihda hakemistoa
@ -21,6 +21,7 @@ Font: Terminal AppearancePrefView Kirjasintyyppi:
Copy here Terminal TermView Kopioi tänne
Really close? Terminal TermWindow Suljetaanko todella?
Copy Terminal TermWindow Kopioi
Terminal Terminal TermWindow The title for the main window menubar entry related to terminal sessions Pääteikkuna
Color scheme: Terminal AppearancePrefView Väriteema:
Window title: Terminal TermWindow Ikkunaotsikko:
Unrecognized option \"%s\"\n Terminal arguments parsing Tunnistamaton valitsin ”%s”\n
@ -61,6 +62,7 @@ Text not found. Terminal TermWindow Tekstiä ei löydy.
Find… Terminal TermWindow Etsi...
The process \"%1\" is still running.\nIf you close the Terminal, the process will be killed. Terminal TermWindow Prosessia ”%1” suoritetaan yhä.\nJos suljet Pääteikkunan, prosessi tapetaan.
Move here Terminal TermView Siirrä tänne
\t%d\t-\tThe current working directory of the active process in the\n\t\t\tcurrent tab. Optionally the maximum number of path components\n\t\t\tcan be specified. E.g. '%2d' for at most two components.\n\t%T\t-\tThe Terminal application name for the current locale.\n\t%i\t-\tThe index of the window.\n\t%p\t-\tThe name of the active process in the current tab.\n\t%t\t-\tThe title of the current tab.\n\t%%\t-\tThe character '%'. Terminal ToolTips \t%d\t-\tAktiivin prosessin nykyinen työhakemisto on nykyisessä\n\t\t\tvälilehdessä. Valinnaisesti voidaan määritellä polkukomponenttien\n\t\t\tenimmäismäärä. Esim.: '%2d' vähintään kahdelle komponentille.\n\t%T\t-\tPääteikkunan nimi nykyisillä paikallisasetuksilla.\n\t%i\t-\tIkkunaindeksi.\n\t%p\t-\tAktiivin prosessin nimi nykyisessä välilehdessä.\n\t%t\t-\tThe title of the current tab.\n\t%%\t-\tMerkki '%'.
Retro Terminal colors scheme Retro
Error! Terminal getString Virhe!
New tab Terminal TermWindow Uusi välilehti

View File

@ -1,4 +1,4 @@
1 polish x-vnd.Haiku-Terminal 3435701556
1 polish x-vnd.Haiku-Terminal 2997644674
Not found. Terminal TermWindow Nie znaleziono.
Switch Terminals Terminal TermWindow Przełącz Terminal
Change directory Terminal TermView Zmień folder
@ -21,6 +21,7 @@ Font: Terminal AppearancePrefView Czcionka:
Copy here Terminal TermView Kopiuj tutaj
Really close? Terminal TermWindow Na pewno zamknąć?
Copy Terminal TermWindow Kopiuj
Terminal Terminal TermWindow The title for the main window menubar entry related to terminal sessions Terminal
Color scheme: Terminal AppearancePrefView Schemat kolorów:
Window title: Terminal TermWindow Tytuł okna:
Unrecognized option \"%s\"\n Terminal arguments parsing Nieznana opcja \"%s\"\n

View File

@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-Terminal 328707356
1 swedish x-vnd.Haiku-Terminal 2645209895
Not found. Terminal TermWindow Hittades ej.
Switch Terminals Terminal TermWindow Växla terminal
Change directory Terminal TermView Byt katalog
@ -62,6 +62,7 @@ Text not found. Terminal TermWindow Text hittades inte.
Find… Terminal TermWindow Sök...
The process \"%1\" is still running.\nIf you close the Terminal, the process will be killed. Terminal TermWindow Processen \"%1\" körs fortfarande.\nOm du stänger Terminalen kommer processen att termineras.
Move here Terminal TermView Flytta hit
\t%d\t-\tThe current working directory of the active process in the\n\t\t\tcurrent tab. Optionally the maximum number of path components\n\t\t\tcan be specified. E.g. '%2d' for at most two components.\n\t%T\t-\tThe Terminal application name for the current locale.\n\t%i\t-\tThe index of the window.\n\t%p\t-\tThe name of the active process in the current tab.\n\t%t\t-\tThe title of the current tab.\n\t%%\t-\tThe character '%'. Terminal ToolTips \t%d\t-\t Arbetskatalogen till den aktiva processen på den valda tabben\n\t\t\t eller de maximala antal sökvägs komponenter kan bli specificerade.\n\t\t\t E.g. '%2d' för att ange två komponenter.\n\t%T\t-\tTerminal applikationsnamnet för denna översättning.\n\t%i\t-\t Indexet för detta fönster.\n\t%p\t-\tNamnet på den aktiva processen io den valda tabben.\n\t%t\t-\tNamnet på den valda tabben.\n\t%%\t-\t Tecknet '%'.
Retro Terminal colors scheme Retro
Error! Terminal getString Fel!
New tab Terminal TermWindow Ny flik

View File

@ -1,4 +1,4 @@
1 german x-vnd.Haiku-WebPositive 233049275
1 german x-vnd.Haiku-WebPositive 3577331897
Show home button Settings Window Home-Symbol anzeigen
Username: Authentication Panel Benutzername:
Copy URL to clipboard Download Window Adresse kopieren
@ -16,6 +16,7 @@ Start page: Settings Window Startseite:
History WebPositive Window Verlauf
Error opening downloads folder Download Window Fehler beim Öffnen des Download-Ordners
Paste WebPositive Window Einfügen
Proxy username: Settings Window Proxy-Nutzername:
Settings Settings Window Einstellungen
%seconds seconds left Download Window Noch %seconds Sekunden
Confirmation WebPositive Window Bestätigung
@ -41,6 +42,7 @@ Quit WebPositive Window Beenden
Full screen WebPositive Window Vollbild
Open download error Download Window Fehler beim Öffnen
Standard font: Settings Window Standardschrift:
Find previous occurrence of search terms WebPositive Window find bar previous button tooltip Vorheriger Treffer
Restart Download Window Neustart
Proxy server Settings Window Proxy-Server
Open containing folder Download Window Speicherort öffnen
@ -58,6 +60,7 @@ Cut WebPositive Window Ausschneiden
Bookmark this page WebPositive Window Lesezeichen für diese Seite anlegen
There was an error trying to show the Bookmarks folder.\n\nError: %error WebPositive Window Don't translate variable %error Der Lesezeichen-Ordner kann nicht angezeigt werden.\n\nFehler: %error
Open downloads folder Download Window Download-Ordner öffnen
Proxy password: Settings Window Proxy-Passwort:
Number of days to keep links in History menu: Settings Window Anzahl der Tage im Verlauf-Menü:
Hide Download Window Ausblenden
Reset size WebPositive Window Größe zurücksetzen
@ -67,6 +70,7 @@ There was an error retrieving the bookmark folder.\n\nError: %error WebPositive
Over 1 day left Download Window Noch über einen Tag
Downloads WebPositive Window Downloads
Requesting %url WebPositive Window %url wird angefordert
Find next occurrence of search terms WebPositive Window find bar next button tooltip Nächster Treffer
Apply Settings Window Anwenden
Bookmark info WebPositive Window Lesezeichen Info
Size: Font Selection view Größe:
@ -80,6 +84,7 @@ Open blank page Settings Window Leere Seite öffnen
New tabs: Settings Window Neue Reiter:
Cancel WebPositive Window Abbrechen
Open all WebPositive Window Alle öffnen
Proxy server requires authentication Settings Window Der Proxy-Server verlangt eine Authentifizierung
Clear URL Bar Leeren
Cut URL Bar Ausschneiden
Clear WebPositive Window Leeren

View File

@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-WebPositive 233049275
1 hungarian x-vnd.Haiku-WebPositive 3577331897
Show home button Settings Window Kezdőlap-gomb megjelenítése
Username: Authentication Panel Felhasználónév:
Copy URL to clipboard Download Window Cím másolása a vágólapra
@ -16,6 +16,7 @@ Start page: Settings Window Kezdőlap:
History WebPositive Window Előzmény
Error opening downloads folder Download Window Hiba történt a letöltések mappa megnyitásakor
Paste WebPositive Window Beillesztés
Proxy username: Settings Window Felhasználónév a proxyhoz:
Settings Settings Window Beállítások
%seconds seconds left Download Window %seconds másodperc van hátra
Confirmation WebPositive Window Megerősítés
@ -41,6 +42,7 @@ Quit WebPositive Window Kilépés
Full screen WebPositive Window Teljes képernyő
Open download error Download Window A letöltés nem nyitható meg
Standard font: Settings Window Normál betűtípus:
Find previous occurrence of search terms WebPositive Window find bar previous button tooltip Előző találat
Restart Download Window Újraindítás
Proxy server Settings Window Proxy
Open containing folder Download Window Tartalmazó mappa megnyitása
@ -58,6 +60,7 @@ Cut WebPositive Window Kivágás
Bookmark this page WebPositive Window Könyvjelző az oldalhoz
There was an error trying to show the Bookmarks folder.\n\nError: %error WebPositive Window Don't translate variable %error Hiba történt a Könyvjelzők mappa megjelenítésekor.\n\nHiba: %error
Open downloads folder Download Window A letöltési mappa megnyitása
Proxy password: Settings Window Jelszó a proxyhoz:
Number of days to keep links in History menu: Settings Window Előzmények megtartásának ideje (nap):
Hide Download Window Elrejtés
Reset size WebPositive Window Méret visszaállítása
@ -67,6 +70,7 @@ There was an error retrieving the bookmark folder.\n\nError: %error WebPositive
Over 1 day left Download Window Több, mint 1 nap van hátra
Downloads WebPositive Window Letöltések
Requesting %url WebPositive Window %url megnyitása
Find next occurrence of search terms WebPositive Window find bar next button tooltip Következő találat
Apply Settings Window Alkalmaz
Bookmark info WebPositive Window Könyvjelző információi
Size: Font Selection view Méret:
@ -80,6 +84,7 @@ Open blank page Settings Window Üres oldal megnyitása
New tabs: Settings Window Új fülek:
Cancel WebPositive Window Mégse
Open all WebPositive Window Az összes megnyitása
Proxy server requires authentication Settings Window A proxy hitelesítést kér
Clear URL Bar Törlés
Cut URL Bar Kivágás
Clear WebPositive Window Törlés

View File

@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-WebPositive 233049275
1 japanese x-vnd.Haiku-WebPositive 3577331897
Show home button Settings Window ホームボタンを表示する
Username: Authentication Panel ユーザー名:
Copy URL to clipboard Download Window URL をクリップボードにコピー
@ -16,6 +16,7 @@ Start page: Settings Window スタートページ:
History WebPositive Window 履歴
Error opening downloads folder Download Window ダウンロードフォルダーを開く際にエラーが発生しました
Paste WebPositive Window 貼り付け
Proxy username: Settings Window ユーザー名:
Settings Settings Window 設定
%seconds seconds left Download Window 残り %seconds 秒
Confirmation WebPositive Window 確認
@ -41,6 +42,7 @@ Quit WebPositive Window 終了
Full screen WebPositive Window 全画面表示
Open download error Download Window ダウンロードを開く際にエラー
Standard font: Settings Window 標準フォント:
Find previous occurrence of search terms WebPositive Window find bar previous button tooltip 文字列を前方へ検索
Restart Download Window 再開
Proxy server Settings Window プロキシサーバー
Open containing folder Download Window ファイルのフォルダーを開く
@ -48,38 +50,41 @@ New window WebPositive Window 新規ウィンドウ
Open Download Window 開く
Reload WebPositive Window 再読み込み
Downloads Download Window ダウンロード
Sans serif font: Settings Window サンセリフフォント
Sans serif font: Settings Window サンセリフフォント:
Over %days days left Download Window 残り %days 日以上
Forward WebPositive Window 進む
of Download Window ...as in '12kB of 256kB' /
Revert Settings Window 元に戻す
Fixed font: Settings Window 固定幅フォント
Fixed font: Settings Window 固定幅フォント:
Cut WebPositive Window 切り取り
Bookmark this page WebPositive Window このページをブックマーク
There was an error trying to show the Bookmarks folder.\n\nError: %error WebPositive Window Don't translate variable %error ブックマークフォルダーを表示しようとした時にエラーが発生しました。\n\nエラー: %error
Open downloads folder Download Window ダウンロードフォルダーを開く
Number of days to keep links in History menu: Settings Window 履歴メニューにリンクを残す日数:
Proxy password: Settings Window パスワード:
Number of days to keep links in History menu: Settings Window 履歴メニューにリンクを残す日数:
Hide Download Window 隠す
Reset size WebPositive Window サイズをリセット
Find: WebPositive Window 検索
Find: WebPositive Window 検索:
Increase size WebPositive Window サイズを大きく
There was an error retrieving the bookmark folder.\n\nError: %error WebPositive Window Don't translate the variable %error ブックマークフォルダーの取得時にエラーが発生しました。\n\nエラー %error
There was an error retrieving the bookmark folder.\n\nError: %error WebPositive Window Don't translate the variable %error ブックマークフォルダーの取得時にエラーが発生しました。\n\nエラー: %error
Over 1 day left Download Window 残り 1 日以上
Downloads WebPositive Window ダウンロード
Requesting %url WebPositive Window 要求中 %url
Find next occurrence of search terms WebPositive Window find bar next button tooltip 文字列を後方へ検索
Apply Settings Window 適用
Bookmark info WebPositive Window ブックマーク情報
Size: Font Selection view サイズ
Size: Font Selection view サイズ:
Show tabs if only one page is open Settings Window ページが一つだけ開いている場合もタブを表示する。
About WebPositive Window WebPositive について
Finish: Download Window Finishing time 完了
Finish: Download Window Finishing time 完了:
Fonts Settings Window フォント
OK Download Window OK
Page source error WebPositive Window ページソースのエラー
Open blank page Settings Window 空白のページを開く
New tabs: Settings Window 新しいタブ
New tabs: Settings Window 新しいタブ:
Cancel WebPositive Window 中止
Open all WebPositive Window すべて開く
Proxy server requires authentication Settings Window プロキシサーバーは認証を必要
Clear URL Bar クリア
Cut URL Bar 切り取り
Clear WebPositive Window クリア
@ -87,8 +92,8 @@ Remove Download Window 削除
Find WebPositive Window 検索
Find previous WebPositive Window 前を検索
Settings WebPositive Window 設定
Proxy server address: Settings Window プロキシサーバーのアドレス
Proxy server port: Settings Window プロキシサーバーポート
Proxy server address: Settings Window プロキシサーバーのアドレス:
Proxy server port: Settings Window プロキシサーバーポート:
Bookmarks WebPositive Window ブックマーク
%minutes minutes Download Window %minutes 分
Paste URL Bar 貼り付け
@ -100,7 +105,7 @@ Open start page Settings Window スタートページを開く
Continue downloads WebPositive ダウンロードを続ける
Cancel Download Window 中止
Open search page Settings Window 検索ページを開く
Password: Authentication Panel パスワード
Password: Authentication Panel パスワード:
Back WebPositive Window 戻る
New browser window Download Window 新規ブラウザウィンドウ
Today WebPositive Window 今日
@ -108,17 +113,17 @@ Today WebPositive Window 今日
Remember username and password for this site Authentication Panel このサイトのユーザー名とパスワードを記憶する
Earlier WebPositive Window 6 日以上前
Authentication required Authentication Panel 認証が必要です
Use proxy server to connect to the internet Settings Window インターネット接続にプロキシサーバーを使用する。
Use proxy server to connect to the internet Settings Window インターネット接続にプロキシサーバーを使用する。
There are still downloads in progress, do you really want to quit WebPositive now? WebPositive ダウンロードが進行中です。WebPositive を今終了してもよいですか?
Auto-hide interface in full screen mode Settings Window 全画面表示時に自動的にインターフェイスを隠す。
%url failed WebPositive Window Loading URL failed. Don't translate variable %url. %url 失敗。
New tab WebPositive Window 新規タブ
Downloads in progress WebPositive ダウンロードが進行中です
Style: Font Selection view スタイル
Style: Font Selection view スタイル:
General Settings Window 一般
View WebPositive Window 表示
Previous WebPositive Window 前へ
There was an error creating the bookmark file.\n\nError: %error WebPositive Window Don't translate variable %error ブックマークファイルの作成中にエラーが発生しました。\n\nエラー %error
There was an error creating the bookmark file.\n\nError: %error WebPositive Window Don't translate variable %error ブックマークファイルの作成中にエラーが発生しました。\n\nエラー: %error
Bookmark error WebPositive Window ブックマークエラー
Do you really want to clear the browsing history? WebPositive Window 本当にブラウズ履歴をクリアしますか?
Copy WebPositive Window コピー
@ -131,6 +136,6 @@ Copy URL Bar コピー
OK WebPositive Window OK
Manage bookmarks WebPositive Window ブックマークの管理
A bookmark for this page (%bookmarkName) already exists. WebPositive Window Don't translate variable %bookmarkName このページ (%bookmarkName) のブックマークはすでにあります。
New windows: Settings Window 新規ウィンドウ
New windows: Settings Window 新規ウィンドウ:
%url finished WebPositive Window Loading URL finished. Don't translate variable %url. %url 完了。
Remove finished Download Window Remove finished

View File

@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-WebPositive 233049275
1 swedish x-vnd.Haiku-WebPositive 3577331897
Show home button Settings Window Visa hem-knappen
Username: Authentication Panel Användarnamn:
Copy URL to clipboard Download Window Kopiera URL till urklipp
@ -16,6 +16,7 @@ Start page: Settings Window Start sida:
History WebPositive Window Historik
Error opening downloads folder Download Window Fel vid öppnande av nerladdnings foldern
Paste WebPositive Window Klistra in
Proxy username: Settings Window Proxyanvändarnamn:
Settings Settings Window Inställningar
%seconds seconds left Download Window %seconds secunder kvar
Confirmation WebPositive Window Bekräftelse
@ -41,6 +42,7 @@ Quit WebPositive Window Avsluta
Full screen WebPositive Window Helskärm
Open download error Download Window Öppna nerladdnings error
Standard font: Settings Window Standardtypsnitt:
Find previous occurrence of search terms WebPositive Window find bar previous button tooltip Sök föregående förekomst av söktermerna
Restart Download Window Starta om
Proxy server Settings Window Proxyserver
Open containing folder Download Window Öppna innehållande mapp
@ -58,6 +60,7 @@ Cut WebPositive Window Klipp ut
Bookmark this page WebPositive Window Spara sidan som bokmärke
There was an error trying to show the Bookmarks folder.\n\nError: %error WebPositive Window Don't translate variable %error Problem att visa Bokmärkes mappen.\n\nFel: %error
Open downloads folder Download Window Öppna nerladdningsmapp
Proxy password: Settings Window Proxylösenord:
Number of days to keep links in History menu: Settings Window Antal dagar att bevara länkar i Historia menyn:
Hide Download Window Dölj
Reset size WebPositive Window Återställ storlek
@ -67,6 +70,7 @@ There was an error retrieving the bookmark folder.\n\nError: %error WebPositive
Over 1 day left Download Window Över 1 dag kvar
Downloads WebPositive Window Nerladdningar
Requesting %url WebPositive Window Begär %url
Find next occurrence of search terms WebPositive Window find bar next button tooltip Sök nästa förekomst av söktermerna
Apply Settings Window Tillämpa
Bookmark info WebPositive Window Bokmärksinformation
Size: Font Selection view Storlek:
@ -80,6 +84,7 @@ Open blank page Settings Window Öppna blank sida
New tabs: Settings Window Ny flik
Cancel WebPositive Window Avbryt
Open all WebPositive Window Öppna alla
Proxy server requires authentication Settings Window Proxyservern kräver behörighetskontroll
Clear URL Bar Töm
Cut URL Bar Klipp ut
Clear WebPositive Window Töm

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-libtracker 3375521561
1 finnish x-vnd.Haiku-libtracker 4167158175
common B_COMMON_DIRECTORY yhteinen
OK WidgetAttributeText Valmis
Icon view VolumeWindow Kuvakenäkymä
@ -74,6 +74,7 @@ Arrange by ContainerWindow Järjestä:
Mount server error AutoMounterSettings Liittämispalvelinvirhe
Search FindPanel Haku
Preparing to empty Trash… StatusWindow Valmistaudutaan tyhjentämään roskakori...
You cannot put the selected item(s) into the trash. FSUtils Et voi laittaa valittuja kohteita roskakoriin.
Disks Model Levyt
Create link ContainerWindow Luo linkki
develop B_COMMON_DEVELOP_DIRECTORY kehitys

View File

@ -1,22 +1,27 @@
1 german x-vnd.Haiku-Network 365183238
1 german x-vnd.Haiku-Network 1341378870
Choose automatically EthernetSettingsView Automatisch auswählen
Gateway: EthernetSettingsView Gateway:
Netmask: EthernetSettingsView Netzmaske:
DHCP EthernetSettingsView DHCP
DNS #2: EthernetSettingsView DNS #2:
Apply EthernetSettingsView Anwenden
Netmask is invalid EthernetSettingsView Ungültige Netzmaske
OK EthernetSettingsView OK
DNS #1: EthernetSettingsView DNS #1:
IP address: EthernetSettingsView IP-Adresse:
Adapter: EthernetSettingsView Adapter:
Domain: EthernetSettingsView Domäne:
Gateway is invalid EthernetSettingsView Ungültiges Gateway
DNS #1 is invalid EthernetSettingsView Ungültiger DNS #1
Revert EthernetSettingsView Anfangswerte
<no wireless networks found> EthernetSettingsView <keine Funknetzwerke gefunden>
Network System name Netzwerk
Mode: EthernetSettingsView Modus:
IP address is invalid EthernetSettingsView Ungültige IP-Adresse
Network: EthernetSettingsView Netzwerk:
The net_server needs to run for the auto configuration! EthernetSettingsView Zur Auto-Konfiguration muss der net_server laufen!
Disabled EthernetSettingsView Deaktiviert
Auto-configuring failed: EthernetSettingsView Auto-Konfiguration fehlgeschlagen:
Static EthernetSettingsView Statisch
DNS #2 is invalid EthernetSettingsView Ungültiger DNS #2
<no adapter> EthernetSettingsView <kein Netzwerkgerät>

View File

@ -1,22 +1,27 @@
1 hungarian x-vnd.Haiku-Network 365183238
1 hungarian x-vnd.Haiku-Network 1341378870
Choose automatically EthernetSettingsView Automatikus választás
Gateway: EthernetSettingsView Átjáró:
Netmask: EthernetSettingsView Hálózati maszk:
DHCP EthernetSettingsView DHCP (automatikus)
DNS #2: EthernetSettingsView DNS #2:
Apply EthernetSettingsView Alkalmaz
Netmask is invalid EthernetSettingsView Az alhálózati maszk érvénytelen
OK EthernetSettingsView Rendben
DNS #1: EthernetSettingsView DNS #1:
IP address: EthernetSettingsView IP-cím:
Adapter: EthernetSettingsView Hálózati kártya:
Domain: EthernetSettingsView Tartomány:
Gateway is invalid EthernetSettingsView Az átjáró érvénytelen
DNS #1 is invalid EthernetSettingsView Az elsődleges DNS érvénytelen
Revert EthernetSettingsView Visszaállít
<no wireless networks found> EthernetSettingsView <nem található vezeték nélküli hálózat>
Network System name Hálózat
Mode: EthernetSettingsView Beállítás:
IP address is invalid EthernetSettingsView Az IP-cím érvénytelen
Network: EthernetSettingsView Hálózat:
The net_server needs to run for the auto configuration! EthernetSettingsView A net_servernek futnia kell az automatikus beállításokhoz!
Disabled EthernetSettingsView Letiltva
Auto-configuring failed: EthernetSettingsView Az automatikus beállítás nem sikerült:
Static EthernetSettingsView Állandó (kézi)
DNS #2 is invalid EthernetSettingsView A másodlagos DNS érvénytelen
<no adapter> EthernetSettingsView <nincs hálózati kártya>

View File

@ -1,22 +1,27 @@
1 japanese x-vnd.Haiku-Network 365183238
1 japanese x-vnd.Haiku-Network 1341378870
Choose automatically EthernetSettingsView 自動選択
Gateway: EthernetSettingsView ゲートウェイ:
Netmask: EthernetSettingsView サブネットマスク:
DHCP EthernetSettingsView 自動 (DHCP)
DNS #2: EthernetSettingsView セカンダリ DNS サーバー:
Apply EthernetSettingsView 適用
Netmask is invalid EthernetSettingsView ネットマスクが正しくありません
OK EthernetSettingsView Ok
DNS #1: EthernetSettingsView プライマリ DNS サーバー:
IP address: EthernetSettingsView IP アドレス:
Adapter: EthernetSettingsView ネットワークアダプター:
Domain: EthernetSettingsView ドメイン:
Gateway is invalid EthernetSettingsView ゲートウェイが正しくありません
DNS #1 is invalid EthernetSettingsView DNS #1 が正しくありません
Revert EthernetSettingsView 元に戻す
<no wireless networks found> EthernetSettingsView <ワイヤレスネットワークが見つかりません>
Network System name ネットワーク
Mode: EthernetSettingsView モード:
IP address is invalid EthernetSettingsView IP アドレスが正しくありません
Network: EthernetSettingsView ネットワーク:
The net_server needs to run for the auto configuration! EthernetSettingsView 自動設定するには net_server が起動している必要があります!
Disabled EthernetSettingsView 無効
Auto-configuring failed: EthernetSettingsView 自動設定に失敗しました:
Static EthernetSettingsView 固定 IP
DNS #2 is invalid EthernetSettingsView DNS #2 が正しくありません
<no adapter> EthernetSettingsView <アダプターがありません>

View File

@ -1,22 +1,27 @@
1 swedish x-vnd.Haiku-Network 365183238
1 swedish x-vnd.Haiku-Network 1341378870
Choose automatically EthernetSettingsView Välj automatiskt
Gateway: EthernetSettingsView Gateway:
Netmask: EthernetSettingsView Nätmask:
DHCP EthernetSettingsView DHCP
DNS #2: EthernetSettingsView Sekundär DNS:
Apply EthernetSettingsView Använd
Netmask is invalid EthernetSettingsView Nätmasken är felaktig
OK EthernetSettingsView Ok
DNS #1: EthernetSettingsView Primär DNS:
IP address: EthernetSettingsView IP-adress:
Adapter: EthernetSettingsView Nätverkskort:
Domain: EthernetSettingsView Domän:
Gateway is invalid EthernetSettingsView Gateway är ogiltig
DNS #1 is invalid EthernetSettingsView DNS #1 är ogiltig
Revert EthernetSettingsView Återställ
<no wireless networks found> EthernetSettingsView <inga trådlösa nätverk funna>
Network System name Nätverk
Mode: EthernetSettingsView Konfiguration:
IP address is invalid EthernetSettingsView IP-adressen är felaktig
Network: EthernetSettingsView Nätverk:
The net_server needs to run for the auto configuration! EthernetSettingsView Automatisk konfiguration kan inte ske utan att net_server körs!
Disabled EthernetSettingsView Inaktiverad
Auto-configuring failed: EthernetSettingsView Automatisk konfiguration misslyckades:
Static EthernetSettingsView Statisk
DNS #2 is invalid EthernetSettingsView DNS #2 är ogiltig
<no adapter> EthernetSettingsView <Ingen enhet>

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-Notifications 814394708
1 finnish x-vnd.Haiku-Notifications 2177286129
An error occurred saving the preferences.\nIt's possible you are running out of disk space. GeneralView Tapahtui virhe tallennettaessa asetuksia.\nOn mahdollista, että levytila on loppunut.
Notifications GeneralView Ilmoitukset
seconds of inactivity GeneralView joutilaisuussekunnit
@ -17,6 +17,7 @@ Cannot disable notifications because the server can't be reached. GeneralView I
Progress NotificationView Edistyminen
Last Received NotificationView Viimeksi vastaanotettu
General PrefletView Yleistä
Apply PrefletWin Käytä
Display PrefletView Näyttö
Can't enable notifications at startup time, you probably don't have write permission to the boot settings directory. GeneralView Ilmoitusten ottaminen käyttöön käynnistysaikana epäonnistui. Sinulla ei luultavasti ole kirjoitusoikeutta alkulatausasetushakemistoon.
Search: NotificationView Etsintä:

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-Shortcuts 3397621807
1 finnish x-vnd.Haiku-Shortcuts 341885426
Error, NULL state description?\n ShortcutsSpec Virhe, NULL-tilakuvaus?\n
MoveMouse ShortcutsSpec SiirräHiirtä
OK ShortcutsWindow Valmis
@ -20,6 +20,7 @@ Shortcuts was couldn't open your KeySet file! ShortcutsWindow Pikanäppäinaset
*Multi \"*MoveMouseTo 100% 0\" \"*MouseButton 1\" ShortcutsWindow *Moni ”*SiirräHiiriKohteeseen 100% 0” ”*Hiiripainike 1”
SendMessage ShortcutsSpec LähetäViesti
MoveMouseTo ShortcutsSpec SiirräHiiriKohteeseen
Option ShortcutsSpec Name for modifier on keyboard Valitsin
Save ShortcutsWindow Tallenna
*MouseButton 1 ShortcutsWindow *Hiiripainike 1
*MoveMouse +20 +0 ShortcutsWindow *SiirräHiiri +20 +0

View File

@ -1,4 +1,4 @@
1 finnish x-vnd.Haiku-Time 3544635877
1 finnish x-vnd.Haiku-Time 3259467657
GMT (UNIX compatible) Time Greenwichin aika (UNIX-yhteensopiva)
OK Time Valmis
Asia Time Aasia
@ -11,6 +11,7 @@ Preview time: Time Esikatseluaika:
Synchronize Time Synkronoi
Revert Time Palauta
Pacific Time Tyyni valtameri
Show day of week Time Näytä viikonpäivä
Add Time Lisää
Date and time Time Päivämäärä ja aika
about Time Ohjelmasta
@ -26,6 +27,7 @@ Time Time Aika
Indian Time Intia
Sending request failed Time Pyynnön lähettäminen epäonnistui
Arctic Time Pohjoinen napaseutu
Display time with seconds Time Näytä aika sekunteina
Time System name Aika-asetukset
America Time Amerikka
Reset Time Nollaa
@ -33,6 +35,8 @@ Synchronize at boot Time Synkronoi alkulatauksen yhteydessä
Time & Date, written by:\n\n\tAndrew Edward McCall\n\tMike Berg\n\tJulun\n\tPhilippe Saint-Pierre\n\nCopyright 2004-2012, Haiku. Time Time & Date, tekijät:\n\n\tAndrew Edward McCall\n\tMike Berg\n\tJulun\n\tPhilippe Saint-Pierre\n\nCopyright 2004-2012, Haiku.
Received invalid time Time Vastaanotettiin virheellinen aika
Antarctica Time Etelänapamanner
Show time zone Time Näytä aikavyöhyke
Show clock in Deskbar Time Näytä kello työpöytäpalkissa
The following error occured while synchronizing:r\n%s: %s Time Seuraava virhe tapahtui synkronoinnin aikana:r\n%s: %s
<Other> Time <Muut>
Current time: Time Nykyinen aika:

View File

@ -35,6 +35,9 @@
\var B_STOP_WATCHING
Flag for watch_node(). Unsubscribe from watching a node.
\attention \c B_STOP_WATCHING does not apply to volume watching, you must
call stop_watching() instead.
*/
@ -329,13 +332,13 @@
- \c B_WATCH_ALL
- \c B_WATCH_MOUNT
Note, that the latter two cases are not mutual exclusive, i.e. mount and
Note that the latter two cases are not mutual exclusive, i.e. mount and
node watching can be requested with a single call.
\param node node_ref referring to the node to be watched. May be \c NULL,
if only mount watching is requested.
\param flags Flags indicating the actions to be performed.
\param target Messenger referring to the target. Must be valid.
\param target BMessenger object referring to the \a target.
\return \c B_OK if everything went fine, an error code otherwise.
*/
@ -368,7 +371,7 @@
- \c B_WATCH_ALL
- \c B_WATCH_MOUNT
Note, that the latter two cases are not mutual exlusive, i.e. mount and
Note that the latter two cases are not mutual exclusive, i.e. mount and
node watching can be requested with a single call.
\param node node_ref referring to the node to be watched. May be \c NULL,
@ -387,20 +390,41 @@
\fn status_t stop_watching(BMessenger target)
\brief Unsubscribes \a target from node and mount monitoring.
\param target Messenger referring to the target. Must be valid.
You may still receive notification messages after calling stop_watching()
because while node monitoring is asynchronous and all changes are atomic,
message sending is not atomic so there is a lag time from when you
stop monitoring and when the message is received in your message receiving
thread. You can check the timestamp of the message to determine if
it was sent after stop_watching() was called.
\return \c B_OK if everything went fine, an error code otherwise.
\param target BMessenger object referring to the \a target.
\return A status code.
\retval B_OK Stopped sending notification messages to the \a target.
\retval B_BAD_VALUE \a target was invalid.
\retval B_ENTRY_NOT_FOUND Node not found.
*/
/*!
\fn status_t stop_watching(const BHandler *handler, const BLooper *looper)
\brief Unsubscribes \a target from node and mount monitoring.
\brief Unsubscribes \a handler or \a looper target from node and mount
monitoring.
\param handler The target handler. May be \c NULL, if \a looper is not
\c NULL. Then the preferred handler of the looper is targeted.
\param looper The target looper. May be \c NULL, if \a handler is not
\c NULL. Then the handler's looper is the target looper.
You may still receive notification messages after calling stop_watching()
because while node monitoring is asynchronous and all changes are atomic,
message sending is not atomic so there is a lag time from when you
stop monitoring and when the message is received in your message receiving
thread. You can check the timestamp of the message to determine if
it was sent after stop_watching() was called.
\return \c B_OK if everything went fine, an error code otherwise.
\param handler The target handler, may be \c NULL. If \a looper is not
\c NULL then the looper's preferred handler is targeted.
\param looper The target looper, may be \c NULL. If \a handler is not
\c NULL then the handler's looper is targeted.
\return A status code.
\retval B_OK Stopped sending notification messages to the target.
\retval B_BAD_VALUE Target from \a handler or \a looper was invalid.
\retval B_ENTRY_NOT_FOUND Node not found.
*/

View File

@ -0,0 +1,131 @@
/*
* Copyright 2002-2013 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Vincent Dominguez
* John Scipione, jscipione@gmail.com
* Ingo Weinhold, bonefish@users.sf.net
*
* Corresponds to:
* headers/os/storage/VolumeRoster.h hrev45306
* src/kits/storage/VolumeRoster.cpp hrev45306
*/
/*!
\file VolumeRoster.h
\ingroup storage
\ingroup libbe
\brief Provides the BVolumeRoster class.
*/
/*!
\class BVolumeRoster
\ingroup storage
\ingroup libbe
\brief Provides an interface for iterating through available volumes
and watching for mounting/unmounting.
This class wraps the next_dev() function for iterating through the
list of available volumes and watch_node()/stop_watching() for
watching volumes.
*/
/*!
\fn BVolumeRoster::BVolumeRoster()
\brief Creates a BVolumeRoster object. The object is ready to be used.
*/
/*!
\fn BVolumeRoster::~BVolumeRoster()
\brief Deletes the volume roster and frees all associated resources.
If a watch was activated (by StartWatching()), it is deactivated.
*/
/*!
\fn status_t BVolumeRoster::GetNextVolume(BVolume *volume)
\brief Fills out the passed in BVolume object with the next available
volume.
\param volume A pointer to a pre-allocated BVolume object to be
initialized to the next available volume.
\return A status code.
\retval B_OK Everything went fine.
\retval B_BAD_VALUE The last volume in the list was already returned.
*/
/*!
\fn void BVolumeRoster::Rewind()
\brief Rewinds the list of available volumes back to the first item.
The next call to GetNextVolume() will return the first available volume.
*/
/*!
\fn status_t BVolumeRoster::GetBootVolume(BVolume *volume)
\brief Fills out the passed in BVolume object with the boot volume.
Currently, this method looks for the volume that is mounted at "/boot".
The only way to fool the system into thinking that there is not a boot
volume is to rename "/boot" -- but, please refrain from doing this.
\param volume A pointer to a pre-allocated BVolume to be initialized to
refer to the boot volume.
\return A status code, \c B_OK if everything went fine or an error code
otherwise.
*/
/*!
\fn status_t BVolumeRoster::StartWatching(BMessenger messenger)
\brief Starts watching the available volumes for changes.
Notifications are sent to the specified target whenever a volume is
mounted or unmounted. The format of the notification messages is
described under watch_node(). Actually BVolumeRoster just provides a
more convenient interface for it.
If StartWatching() has been called before with another target and no
StopWatching() since, StopWatching() is called first, so that the former
target won't receive any notifications anymore.
When the object is destroyed all watching ends as well.
\param messenger The target which the notification messages are sent.
\return A status code.
\retval B_OK Everything went fine.
\retval B_BAD_VALUE The supplied BMessenger was invalid.
\retval B_NO_MEMORY There was insufficient memory to carry out this
operation.
\see watch_node()
*/
/*!
\fn void BVolumeRoster::StopWatching()
\brief Stops watching volumes initiated by StartWatching().
\see stop_watching()
*/
/*!
\fn BMessenger BVolumeRoster::Messenger() const
\brief Returns the messenger currently watching the volume list.
\return A messenger to the target currently watching the volume list, or
an invalid messenger if not watching.
*/

115
headers/os/app/Key.h Normal file
View File

@ -0,0 +1,115 @@
/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _KEY_H
#define _KEY_H
#include <DataIO.h>
#include <Message.h>
#include <ObjectList.h>
#include <String.h>
enum BKeyPurpose {
B_KEY_PURPOSE_ANY,
B_KEY_PURPOSE_GENERIC,
B_KEY_PURPOSE_KEYRING,
B_KEY_PURPOSE_WEB,
B_KEY_PURPOSE_NETWORK,
B_KEY_PURPOSE_VOLUME
};
enum BKeyType {
B_KEY_TYPE_ANY,
B_KEY_TYPE_GENERIC,
B_KEY_TYPE_PASSWORD,
B_KEY_TYPE_CERTIFICATE
};
class BKey {
public:
BKey();
BKey(BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL,
const uint8* data = NULL,
size_t length = 0);
BKey(BKey& other);
virtual ~BKey();
virtual BKeyType Type() const { return B_KEY_TYPE_GENERIC; };
void Unset();
status_t SetTo(BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL,
const uint8* data = NULL,
size_t length = 0);
void SetPurpose(BKeyPurpose purpose);
BKeyPurpose Purpose() const;
void SetIdentifier(const char* identifier);
const char* Identifier() const;
void SetSecondaryIdentifier(const char* identifier);
const char* SecondaryIdentifier() const;
status_t SetData(const uint8* data, size_t length);
size_t DataLength() const;
const uint8* Data() const;
status_t GetData(uint8* buffer, size_t bufferSize) const;
const char* Owner() const;
bigtime_t CreationTime() const;
virtual status_t Flatten(BMessage& message) const;
virtual status_t Unflatten(const BMessage& message);
BKey& operator=(const BKey& other);
bool operator==(const BKey& other) const;
bool operator!=(const BKey& other) const;
virtual void PrintToStream();
private:
friend class BKeyStore;
BKeyPurpose fPurpose;
BString fIdentifier;
BString fSecondaryIdentifier;
BString fOwner;
bigtime_t fCreationTime;
mutable BMallocIO fData;
};
class BPasswordKey : public BKey {
public:
BPasswordKey();
BPasswordKey(const char* password,
BKeyPurpose purpose, const char* identifier,
const char* secondaryIdentifier = NULL);
BPasswordKey(BPasswordKey& other);
virtual ~BPasswordKey();
virtual BKeyType Type() const { return B_KEY_TYPE_PASSWORD; };
status_t SetTo(const char* password,
BKeyPurpose purpose,
const char* identifier,
const char* secondaryIdentifier = NULL);
status_t SetPassword(const char* password);
const char* Password() const;
virtual void PrintToStream();
};
#endif // _KEY_H

103
headers/os/app/KeyStore.h Normal file
View File

@ -0,0 +1,103 @@
/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _KEY_STORE_H
#define _KEY_STORE_H
#include <Key.h>
class BKeyStore {
public:
BKeyStore();
virtual ~BKeyStore();
status_t GetKey(BKeyType type, const char* identifier,
BKey& key);
status_t GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key);
status_t GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier,
bool secondaryIdentifierOptional,
BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key);
status_t GetKey(const char* keyring,
BKeyType type, const char* identifier,
const char* secondaryIdentifier,
bool secondaryIdentifierOptional,
BKey& key);
status_t AddKey(const BKey& key);
status_t AddKey(const char* keyring, const BKey& key);
status_t RemoveKey(const BKey& key);
status_t RemoveKey(const char* keyring, const BKey& key);
status_t GetNextKey(uint32& cookie, BKey& key);
status_t GetNextKey(BKeyType type, BKeyPurpose purpose,
uint32& cookie, BKey& key);
status_t GetNextKey(const char* keyring,
uint32& cookie, BKey& key);
status_t GetNextKey(const char* keyring,
BKeyType type, BKeyPurpose purpose,
uint32& cookie, BKey& key);
// Keyrings
status_t AddKeyring(const char* keyring);
status_t RemoveKeyring(const char* keyring);
status_t GetNextKeyring(uint32& cookie,
BString& keyring);
status_t SetUnlockKey(const char* keyring,
const BKey& key);
status_t RemoveUnlockKey(const char* keyring);
// Master keyring
status_t SetMasterUnlockKey(const BKey& key);
status_t RemoveMasterUnlockKey();
status_t AddKeyringToMaster(const char* keyring);
status_t RemoveKeyringFromMaster(const char* keyring);
status_t GetNextMasterKeyring(uint32& cookie,
BString& keyring);
// Locking
bool IsKeyringUnlocked(const char* keyring);
status_t LockKeyring(const char* keyring);
status_t LockMasterKeyring();
// Applications
status_t GetNextApplication(uint32& cookie,
BString& signature) const;
status_t GetNextApplication(const char* keyring,
uint32& cookie, BString& signature) const;
status_t RemoveApplication(const char* signature);
status_t RemoveApplication(const char* keyring,
const char* signature);
// Service functions
status_t GeneratePassword(BPasswordKey& password,
size_t length, uint32 flags);
float PasswordStrength(const char* password);
private:
status_t _SendKeyMessage(BMessage& message,
BMessage* reply) const;
};
#endif // _KEY_STORE_H

View File

@ -122,6 +122,7 @@ public:
float MaxContentWidth() const;
BMenuItem* FindMarked();
int32 FindMarkedIndex();
BMenu* Supermenu() const;
BMenuItem* Superitem() const;

View File

@ -36,8 +36,16 @@ private:
private:
int32 fCookie;
// The iteration cookie for next_dev()
// Initialized to 0
BMessenger* fTarget;
// BMessenger referring to the target to
// which the watching notification
// messages are sent. The object is
// allocated and owned by the roster,
// or NULL if not watching.
uint32 _reserved[3];
// FBC
};

View File

@ -0,0 +1,48 @@
/*
* Copyright 2012, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz, mmlr@mlotz.ch
*/
#ifndef _KEY_STORE_DEFS_H
#define _KEY_STORE_DEFS_H
namespace BPrivate {
const char* kKeyStoreServerSignature
= "application/x-vnd.Haiku-keystore_server";
enum {
// Replies
KEY_STORE_SUCCESS = 'KRok',
KEY_STORE_ERROR = 'KRer',
KEY_STORE_RESULT = 'KRrs',
// KeyStore requests
KEY_STORE_GET_KEY = 'KgtK',
KEY_STORE_GET_NEXT_KEY = 'KgnK',
KEY_STORE_ADD_KEY = 'KadK',
KEY_STORE_REMOVE_KEY = 'KrmK',
KEY_STORE_ADD_KEYRING = 'KaKR',
KEY_STORE_REMOVE_KEYRING = 'KrKR',
KEY_STORE_GET_NEXT_KEYRING = 'KnKR',
KEY_STORE_SET_UNLOCK_KEY = 'KsuK',
KEY_STORE_REMOVE_UNLOCK_KEY = 'KruK',
KEY_STORE_ADD_KEYRING_TO_MASTER = 'KarM',
KEY_STORE_REMOVE_KEYRING_FROM_MASTER = 'KrrM',
KEY_STORE_GET_NEXT_MASTER_KEYRING = 'KnrM',
KEY_STORE_IS_KEYRING_UNLOCKED = 'KuKR',
KEY_STORE_LOCK_KEYRING = 'KlKR',
KEY_STORE_GET_NEXT_APPLICATION = 'KnKA',
KEY_STORE_REMOVE_APPLICATION = 'KrKA',
};
} // namespace BPrivate
#endif // _KEY_STORE_DEFS_H

View File

@ -133,6 +133,7 @@ public:
float Height() const;
bool IsExpanded() const;
bool IsSelected() const;
private:
// Blows up into the debugger if the validation fails.
@ -326,8 +327,9 @@ public:
// Does not delete row or children at this time.
// todo: Make delete row and children
void RemoveRow(BRow* row);
void UpdateRow(BRow* row);
bool SwapRows(int32 index1, int32 index2, BRow*
parentRow1 = NULL, BRow* parentRow2 = NULL);
void Clear();
// Appearance (DEPRECATED)

View File

@ -241,29 +241,6 @@ detect_crt_ranges(uint32 crtid)
}
static void
remove_dup_displays(uint32 displayIndex, uint32 id)
{
/* hack for both digital and analog interfaces active */
if ((displayIndex > 0) && gDisplay[displayIndex]->attached) {
if (gConnector[id-1]->encoder.type == VIDEO_ENCODER_TMDS) {
int gpioID1 = gConnector[id-1]->gpioID;
int gpioID2 = gConnector[id]->gpioID;
edid1_info* edid = &gDisplay[displayIndex-1]->edidData;
if ((gGPIOInfo[gpioID1]->hwPin == gGPIOInfo[gpioID2]->hwPin) &&
edid->display.input_type)
// give preference to digital display when both are present
// and other display indicates it is digital
TRACE("%s: skipping connector %" B_PRIu32
": giving preference to digital "
"connector %d\n", __func__, id, id-1);
gDisplay[displayIndex]->attached = 0;
}
}
}
status_t
detect_displays()
{
@ -332,45 +309,36 @@ detect_displays()
gDisplay[displayIndex]->attached
= connector_read_edid(id, &gDisplay[displayIndex]->edidData);
// Since DVI-I shows up as two connectors, and there is only one
// edid channel, we have to make *sure* the edid data received is
// valid for the connector.
// Found EDID data?
if (gDisplay[displayIndex]->attached) {
TRACE("%s: connector(%" B_PRIu32 "): found EDID data.\n",
__func__, id);
bool analogEncoder
= gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC
|| gConnector[id]->encoder.type == VIDEO_ENCODER_DAC;
if (gConnector[id]->type == VIDEO_CONNECTOR_DVII
|| gConnector[id]->type == VIDEO_CONNECTOR_HDMIB) {
// These connectors can share gpio pins for data
// communication between digital and analog encoders
// (DVI-I is most common)
edid1_info* edid = &gDisplay[displayIndex]->edidData;
edid1_info* edid = &gDisplay[displayIndex]->edidData;
if (!edid->display.input_type && analogEncoder) {
// If non-digital EDID + the encoder is analog...
TRACE("%s: connector(%" B_PRIu32 "): has non-digital EDID "
"and a analog encoder.\n", __func__, id);
gDisplay[displayIndex]->attached
= encoder_analog_load_detect(id);
remove_dup_displays(displayIndex, id);
} else if (edid->display.input_type && !analogEncoder) {
// If EDID is digital, we make an assumption here.
TRACE("%s: connector(%" B_PRIu32 "): has digital EDID "
"and is not a analog encoder.\n", __func__, id);
} else {
// This generally means the monitor is of poor design
// Since we *know* there is no load on the analog encoder
// we assume that it is a digital display.
// This can also occur when a display has both DVI and VGA
// inputs and the graphics board has a DVI-I connector
// (reported as both digital and analog connectors) and the
// analog connection is the one in use. In that case, we
// get here when checking the digital connector and want
// to disable that display in favor of the analog one.
TRACE("%s: connector(%" B_PRIu32 "): Warning: monitor has "
"false digital EDID flag + unloaded analog encoder!\n",
__func__, id);
gDisplay[displayIndex]->attached = false;
bool analogEncoder
= gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC
|| gConnector[id]->encoder.type == VIDEO_ENCODER_DAC;
bool digitalEncoder
= gConnector[id]->encoder.type == VIDEO_ENCODER_TMDS;
bool digitalEdid = edid->display.input_type ? true : false;
if (digitalEdid && analogEncoder) {
// Digital EDID + analog encoder? Lets try a load test
gDisplay[displayIndex]->attached
= encoder_analog_load_detect(id);
} else if (!digitalEdid && digitalEncoder) {
// non-digital EDID + digital encoder? Nope.
gDisplay[displayIndex]->attached = false;
}
// Else... everything aligns as it should and attached = 1
}
}
}

View File

@ -324,9 +324,6 @@ encoder_mode_set(uint8 crtcID)
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
// already handled by virue of setting DPMS_OFF before
// getting here
#if 0
if ((info.chipsetFlags & CHIP_APU) != 0
|| info.dceMajor >= 5) {
// Setup DIG encoder
@ -359,7 +356,6 @@ encoder_mode_set(uint8 crtcID)
transmitter_dig_setup(connectorIndex, pixelClock, 0, 0,
ATOM_TRANSMITTER_ACTION_ENABLE);
}
#endif
break;
case ENCODER_OBJECT_ID_INTERNAL_DDI:
case ENCODER_OBJECT_ID_INTERNAL_DVO1:

View File

@ -6,9 +6,14 @@ UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing Painter ] ;
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;
UsePrivateHeaders kernel ;
AddResources ClassicBe : resources.rdef ;
#TODO: See #8716, hrev44313 for ft2build.h: No such file or directory
#Includes [ FGristFiles BeDecorator.cpp ]
# : $(HAIKU_FREETYPE_HEADERS_DEPENDENCY) ;
Addon ClassicBe :
BeDecorator.cpp
: be <nogrist>app_server $(TARGET_LIBSTDC++) $(TARGET_LIBSUPC++)

View File

@ -8,9 +8,13 @@ UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing Painter ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app font ] ;
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;
UsePrivateHeaders kernel ;
AddResources MacDecorator : resources.rdef ;
Includes [ FGristFiles MacDecorator.cpp ]
: $(HAIKU_FREETYPE_HEADERS_DEPENDENCY) ;
Addon MacDecorator :
MacDecorator.cpp
: be <nogrist>app_server $(TARGET_LIBSTDC++)

View File

@ -6,9 +6,14 @@ UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing ] ;
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing Painter ] ;
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;
UsePrivateHeaders kernel ;
AddResources WinDecorator : resources.rdef ;
#TODO: See #8716, hrev44313 for ft2build.h: No such file or directory
#Includes [ FGristFiles WinDecorator.cpp ]
# : $(HAIKU_FREETYPE_HEADERS_DEPENDENCY) ;
Addon WinDecorator :
WinDecorator.cpp
: be <nogrist>app_server $(TARGET_LIBSTDC++)

View File

@ -89,6 +89,7 @@ static const struct iwn_ident iwn_ident_table[] = {
{ 0x8086, 0x008b, "Intel Centrino Wireless-N 1030" },
{ 0x8086, 0x0090, "Intel Centrino Advanced-N 6230" },
{ 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" },
{ 0x8086, 0x088e, "Intel Centrino Advanced-N 6235" },
{ 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" },
{ 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" },
{ 0x8086, 0x0896, "Intel Centrino Wireless-N 130" },

View File

@ -48,7 +48,7 @@ HaikuSubInclude powerstatus ;
HaikuSubInclude processcontroller ;
HaikuSubInclude pulse ;
HaikuSubInclude remotedesktop ;
HaikuSubInclude resedit ;
HaikuSubInclude resourceedit ;
HaikuSubInclude screenshot ;
HaikuSubInclude serialconnect ;
HaikuSubInclude showimage ;

View File

@ -29,7 +29,9 @@
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "ActivityWindow"
static const uint32 kMsgAddView = 'advw';
static const uint32 kMsgAlwaysOnTop = 'alot';
static const uint32 kMsgShowSettings = 'shst';
@ -131,6 +133,12 @@ ActivityWindow::ActivityWindow()
menu = new BMenu(B_TRANSLATE("Settings"));
menu->AddItem(new BMenuItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS),
new BMessage(kMsgShowSettings)));
menu->AddSeparatorItem();
fAlwaysOnTop = new BMenuItem(B_TRANSLATE("Always on top"), new BMessage(kMsgAlwaysOnTop));
_SetAlwaysOnTop(settings.GetBool("always on top", false));
menu->AddItem(fAlwaysOnTop);
menu->SetTargetForItems(this);
menuBar->AddItem(menu);
}
@ -201,6 +209,12 @@ ActivityWindow::MessageReceived(BMessage* message)
break;
}
case kMsgAlwaysOnTop:
{
_SetAlwaysOnTop(!fAlwaysOnTop->IsMarked());
break;
}
case kMsgTimeIntervalUpdated:
BroadcastToActivityViews(message);
break;
@ -300,6 +314,10 @@ ActivityWindow::_SaveSettings()
if (status != B_OK)
return status;
status = settings.SetBool("always on top", fAlwaysOnTop->IsMarked());
if (status != B_OK)
return status;
#ifdef __HAIKU__
BView* top = fLayout->View();
#else
@ -368,3 +386,11 @@ ActivityWindow::_MessageDropped(BMessage* message)
}
}
void
ActivityWindow::_SetAlwaysOnTop(bool alwaysOnTop)
{
SetFeel(alwaysOnTop ? B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL);
fAlwaysOnTop->SetMarked(alwaysOnTop);
}

View File

@ -37,11 +37,14 @@ private:
void _AddDefaultView();
void _MessageDropped(BMessage *message);
void _SetAlwaysOnTop(bool alwaysOnTop);
BMenuItem* fAlwaysOnTop;
#ifdef __HAIKU__
BGroupLayout* fLayout;
BGroupLayout* fLayout;
#endif
BMessenger fSettingsWindow;
BMessenger fSettingsWindow;
};
static const uint32 kMsgRemoveView = 'rmvw';

View File

@ -337,66 +337,66 @@ TExpandoMenuBar::MouseDown(BPoint where)
BMenuItem* menuItem;
TTeamMenuItem* item = TeamItemAtPoint(where, &menuItem);
// check for three finger salute, a.k.a. Vulcan Death Grip
if (message != NULL && item != NULL && !fBarView->Dragging()) {
int32 modifiers = 0;
message->FindInt32("modifiers", &modifiers);
if ((modifiers & B_COMMAND_KEY) != 0
&& (modifiers & B_CONTROL_KEY) != 0
&& (modifiers & B_SHIFT_KEY) != 0) {
const BList* teams = item->Teams();
int32 teamCount = teams->CountItems();
team_id teamID;
for (int32 team = 0; team < teamCount; team++) {
teamID = (addr_t)teams->ItemAt(team);
kill_team(teamID);
// remove the team immediately from display
RemoveTeam(teamID, false);
}
return;
}
// control click - show all/hide all shortcut
if ((modifiers & B_CONTROL_KEY) != 0) {
// show/hide item's teams
BMessage showMessage((modifiers & B_SHIFT_KEY) != 0
? kMinimizeTeam : kBringTeamToFront);
showMessage.AddInt32("itemIndex", IndexOf(item));
Window()->PostMessage(&showMessage, this);
return;
}
// Check the bounds of the expand Team icon
if (fShowTeamExpander && fVertical) {
BRect expanderRect = item->ExpanderBounds();
if (expanderRect.Contains(where)) {
// Let the update thread wait...
BAutolock locker(sMonLocker);
// Toggle the item
item->ToggleExpandState(true);
item->Draw();
// Absorb the message.
return;
}
}
// double-click on an item brings the team to front
int32 clicks;
if (message->FindInt32("clicks", &clicks) == B_OK && clicks > 1
&& item == menuItem && item == fLastClickItem) {
// activate this team
be_roster->ActivateApp((addr_t)item->Teams()->ItemAt(0));
return;
}
fLastClickItem = item;
if (message == NULL || item == NULL || fBarView->Dragging()) {
BMenuBar::MouseDown(where);
return;
}
int32 modifiers = 0;
message->FindInt32("modifiers", &modifiers);
// check for three finger salute, a.k.a. Vulcan Death Grip
if ((modifiers & B_COMMAND_KEY) != 0
&& (modifiers & B_CONTROL_KEY) != 0
&& (modifiers & B_SHIFT_KEY) != 0) {
const BList* teams = item->Teams();
int32 teamCount = teams->CountItems();
team_id teamID;
for (int32 team = 0; team < teamCount; team++) {
teamID = (addr_t)teams->ItemAt(team);
kill_team(teamID);
RemoveTeam(teamID, false);
// remove the team from display immediately
}
return;
// absorb the message
}
// control click - show all/hide all shortcut
if ((modifiers & B_CONTROL_KEY) != 0) {
// show/hide item's teams
BMessage showMessage((modifiers & B_SHIFT_KEY) != 0
? kMinimizeTeam : kBringTeamToFront);
showMessage.AddInt32("itemIndex", IndexOf(item));
Window()->PostMessage(&showMessage, this);
return;
// absorb the message
}
// Check the bounds of the expand Team icon
if (fVertical && fShowTeamExpander) {
if (item->ExpanderBounds().Contains(where)) {
BAutolock locker(sMonLocker);
// let the update thread wait...
item->ToggleExpandState(true);
// toggle the item
item->Draw();
return;
// absorb the message
}
}
// double-click on an item brings the team to front
int32 clicks;
if (message->FindInt32("clicks", &clicks) == B_OK && clicks > 1
&& item == menuItem && item == fLastClickItem) {
be_roster->ActivateApp((addr_t)item->Teams()->ItemAt(0));
// activate this team
return;
// absorb the message
}
fLastClickItem = item;
BMenuBar::MouseDown(where);
}
@ -412,22 +412,38 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message)
case B_ENTERED_VIEW:
case B_INSIDE_VIEW:
{
TTeamMenuItem* item = TeamItemAtPoint(where);
if (item == fLastMousedOverItem) {
// already set the tooltip for this item, break out
break;
}
if (item == NULL) {
BMenuItem* menuItem;
TTeamMenuItem* item = TeamItemAtPoint(where, &menuItem);
TWindowMenuItem* windowMenuItem
= dynamic_cast<TWindowMenuItem*>(menuItem);
if (item == NULL || menuItem == NULL) {
// item is NULL, remove the tooltip and break out
fLastMousedOverItem = NULL;
SetToolTip((const char*)NULL);
break;
}
if (menuItem == fLastMousedOverItem) {
// already set the tooltip for this item, break out
break;
}
if (windowMenuItem != NULL && fBarView->Vertical()
&& fBarView->ExpandoState() && item->IsExpanded()) {
// expando mode window menu item
fLastMousedOverItem = menuItem;
if (strcmp(windowMenuItem->Label(),
windowMenuItem->FullTitle()) != 0) {
// label is truncated, set tooltip
SetToolTip(windowMenuItem->FullTitle());
} else
SetToolTip((const char*)NULL);
break;
}
if (item->HasLabel()) {
// item has a visible label, remove the tooltip and break out
fLastMousedOverItem = item;
fLastMousedOverItem = menuItem;
SetToolTip((const char*)NULL);
break;
}
@ -435,8 +451,8 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message)
// new item, set the tooltip to the item name
SetToolTip(item->Name());
// save the current item for the next MouseMoved() call
fLastMousedOverItem = item;
// save the current menuitem for the next MouseMoved() call
fLastMousedOverItem = menuItem;
break;
}

View File

@ -107,7 +107,7 @@ class TExpandoMenuBar : public BMenuBar {
TTeamMenuItem* fPreviousDragTargetItem;
TTeamMenuItem* fLastMousedOverItem;
BMenuItem* fLastMousedOverItem;
BMenuItem* fLastClickItem;
static bool sDoMonitor;

View File

@ -433,7 +433,9 @@ TReplicantTray::ShowHideTime()
if (fTime == NULL)
return;
if (fTime->IsHidden())
// Check from the point of view of fTime because we need to ignore
// whether or not the parent window is hidden.
if (fTime->IsHidden(fTime))
fTime->Show();
else
fTime->Hide();
@ -441,7 +443,8 @@ TReplicantTray::ShowHideTime()
RealignReplicants();
AdjustPlacement();
bool showClock = !fTime->IsHidden();
// Check from the point of view of fTime ignoring parent's state.
bool showClock = !fTime->IsHidden(fTime);
// Update showClock setting that gets saved to disk on quit
((TBarApp*)be_app)->Settings()->showClock = showClock;

View File

@ -69,6 +69,7 @@ TTimeView::TTimeView(float maxWidth, float height)
fMaxWidth(maxWidth),
fHeight(height),
fOrientation(true),
fShowLevel(0),
fShowSeconds(false),
fShowDayOfWeek(false),
fShowTimeZone(false)
@ -116,10 +117,11 @@ status_t
TTimeView::Archive(BMessage* data, bool deep) const
{
BView::Archive(data, deep);
data->AddBool("orientation", fOrientation);
data->AddInt16("showLevel", fShowLevel);
data->AddBool("showSeconds", fShowSeconds);
data->AddBool("showDayOfWeek", fShowDayOfWeek);
data->AddBool("showTimeZone", fShowTimeZone);
data->AddBool("orientation", fOrientation);
data->AddInt32("deskbar:private_align", B_ALIGN_RIGHT);
return B_OK;

View File

@ -133,16 +133,14 @@ private:
float fMaxWidth;
float fHeight;
bool fOrientation; // vertical = true
bool fOrientation;
// vertical = true
int16 fShowLevel;
bool fOverrideLocale;
bool fUse24HourClock;
bool fShowSeconds;
bool fShowDayOfWeek;
bool fShowTimeZone;
BString fTimeFormat;
BPoint fTimeLocation;
BPoint fDateLocation;

View File

@ -0,0 +1,53 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef CONSTANTS_H
#define CONSTANTS_H
#define MSG_NEW 'm000'
#define MSG_OPEN 'm001'
#define MSG_OPEN_DONE 'm002'
#define MSG_CLOSE 'm003'
#define MSG_SAVE 'm004'
#define MSG_SAVEAS 'm005'
#define MSG_SAVEAS_DONE 'm006'
#define MSG_SAVEALL 'm007'
#define MSG_MERGEWITH 'm008'
#define MSG_QUIT 'm009'
#define MSG_UNDO 'm010'
#define MSG_REDO 'm011'
#define MSG_CUT 'm012'
#define MSG_COPY 'm013'
#define MSG_PASTE 'm014'
#define MSG_CLEAR 'm015'
#define MSG_SELECTALL 'm016'
#define MSG_ADDAPPRES 'm020'
#define MSG_SETTINGS 'm021'
#define MSG_ADD 'm030'
#define MSG_REMOVE 'm031'
#define MSG_MOVEUP 'm032'
#define MSG_MOVEDOWN 'm033'
#define MSG_SELECTION 'm040'
#define MSG_INVOCATION 'm041'
#define MSG_ACCEPT 'm050'
#define MSG_CANCEL 'm051'
#define MSG_IGNORE 'm052'
#define MSG_SETTINGS_APPLY 'm022'
#define MSG_SETTINGS_REVERT 'm023'
#define MSG_SETTINGS_CLOSED 'm024'
// TODO: Remove prior to release.
#define DEBUG 1
#include <Debug.h>
// --- ---
#endif

View File

@ -0,0 +1,47 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "DefaultTypes.h"
#include <ByteOrder.h>
int32
ResourceType::FindIndex(type_code code)
{
for (int32 i = 0; kDefaultTypes[i].type != NULL; i++)
if (StringToCode(kDefaultTypes[i].code) == code)
return i;
return -1;
}
int32
ResourceType::FindIndex(const char* type)
{
for (int32 i = 0; kDefaultTypes[i].type != NULL; i++)
if (strcmp(kDefaultTypes[i].type, type) == 0)
return i;
return -1;
}
void
ResourceType::CodeToString(type_code code, char* str)
{
*(type_code*)str = B_HOST_TO_BENDIAN_INT32(code);
str[4] = '\0';
}
type_code
ResourceType::StringToCode(const char* code)
{
// TODO: Code may be in other formats, too! Ex.: 0x4C4F4E47
return B_BENDIAN_TO_HOST_INT32(*(int32*)code);
}

View File

@ -0,0 +1,69 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef DEFAULT_TYPES_H
#define DEFAULT_TYPES_H
#include "AppFlagsEdit.h"
#include "BooleanEdit.h"
#include "EditView.h"
#include "NormalEdit.h"
#include "ResourceRow.h"
#include <String.h>
struct ResourceType {
const char* type;
const char* code;
const char* data;
uint32 size;
EditView* edit;
static int32 FindIndex(const char* type);
static int32 FindIndex(type_code code);
static void CodeToString(type_code code, char* str);
static type_code StringToCode(const char* code);
};
#define LINE "", "", "", ~0, NULL
#define END NULL, NULL, NULL, 0, NULL
const ResourceType kDefaultTypes[] = {
{ "app_signature", "", "application/MyApp", 18, new NormalEdit() },
{ "app_name_catalog_entry", "", "MyApp:System name:MyApp", 24, new NormalEdit() },
//{ "app_flags", "", "None", 4, NULL },
{ LINE },
{ "bool", "BOOL", "false", 1, new BooleanEdit() },
{ LINE },
{ "int8", "BYTE", "0", 1, new NormalEdit() },
{ "int16", "SHRT", "0", 2, new NormalEdit() },
{ "int32", "LONG", "0", 4, new NormalEdit() },
{ "int64", "LLNG", "0", 8, new NormalEdit() },
{ LINE },
{ "uint8", "UBYT", "0", 1, new NormalEdit() },
{ "uint16", "USHT", "0", 2, new NormalEdit() },
{ "uint32", "ULNG", "0", 4, new NormalEdit() },
{ "uint64", "ULLG", "0", 8, new NormalEdit() },
{ LINE },
{ "string", "CSTR", "\"\"", 0, NULL },
{ "raw", "RAWT", "", 0, NULL },
{ LINE },
{ "array", "", "", 0, NULL },
{ "message", "", "", 0, NULL },
{ "import", "", "", 0, NULL },
{ END }
};
const int32 kDefaultTypeSelected = 8;
// int32
#undef LINE
#undef END
#endif

View File

@ -0,0 +1,163 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "EditWindow.h"
#include "Constants.h"
#include "DefaultTypes.h"
#include "EditView.h"
#include "ResourceRow.h"
#include <Box.h>
#include <Button.h>
#include <GroupLayoutBuilder.h>
#include <MenuField.h>
#include <MenuItem.h>
#include <PopUpMenu.h>
#include <StringView.h>
#include <TextControl.h>
#include <View.h>
EditWindow::EditWindow(BRect frame, ResourceRow* row)
:
BWindow(frame, "Edit Resource",
B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, 0)
{
int32 ix = ResourceType::FindIndex(row->ResourceType());
fRow = row;
fView = new BView(Bounds(), "fView", B_FOLLOW_ALL, 0);
fView->SetLayout(new BGroupLayout(B_VERTICAL));
fIDText = new BTextControl(BRect(0, 0, 0, 0),
"fIDText", "ID:", row->ResourceStringID(), NULL);
fIDText->SetDivider(50);
fNameText = new BTextControl(BRect(0, 0, 0, 0),
"fNameText", "Name:", row->ResourceName(), NULL);
fNameText->SetDivider(50);
fTypePopUp = new BPopUpMenu("(Type)");
// TODO: (Not so) evil redundancy.
for (int32 i = 0; kDefaultTypes[i].type != NULL; i++) {
if (kDefaultTypes[i].size == ~(uint32)0)
fTypePopUp->AddSeparatorItem();
else
fTypePopUp->AddItem(new BMenuItem(kDefaultTypes[i].type,
new BMessage(MSG_SELECTION)));
}
// ---
fTypePopUp->ItemAt(ix)->SetMarked(true);
fTypeMenu = new BMenuField(BRect(0, 0, 0, 0),
"fTypeMenu", "Type:", fTypePopUp);
fTypeMenu->SetDivider(50);
fCodeText = new BTextControl(BRect(0, 0, 0, 0),
"fCodeText", "Code:", row->ResourceStringCode(), NULL);
fCodeText->SetDivider(50);
fEditViewBox = new BBox(BRect(0, 0, 0, 0), "fEditViewBox");
fEditViewBox->SetLayout(new BGroupLayout(B_VERTICAL));
fEditView = kDefaultTypes[ix].edit;
fEditView->AttachTo(fEditViewBox);
fEditView->Edit(fRow);
fErrorString = new BStringView(BRect(0, 0, 0, 0),
"fErrorString", "");
fErrorString->SetHighColor(ui_color(B_FAILURE_COLOR));
fCancelButton = new BButton(BRect(0, 0, 0, 0),
"fCancelButton", "Cancel", new BMessage(MSG_CANCEL));
fOKButton = new BButton(BRect(0, 0, 0, 0),
"fOKButton", "OK", new BMessage(MSG_ACCEPT));
fView->AddChild(BGroupLayoutBuilder(B_VERTICAL, 8)
.Add(fIDText)
.Add(fNameText)
.Add(fTypeMenu)
.Add(fCodeText)
.Add(fEditViewBox)
.Add(fErrorString)
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 8)
.AddGlue()
.Add(fCancelButton)
.Add(fOKButton)
.SetInsets(8, 8, 8, 8)
)
.SetInsets(8, 8, 8, 8)
);
AddChild(fView);
ResizeTo(250, 350);
Show();
}
EditWindow::~EditWindow()
{
fEditView->RemoveSelf();
}
void
EditWindow::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case MSG_SELECTION:
{
int32 ix = fTypePopUp->FindMarkedIndex();
fCodeText->SetText(kDefaultTypes[ix].code);
fEditView->RemoveSelf();
fEditView = kDefaultTypes[ix].edit;
fEditView->AttachTo(fEditViewBox);
fEditView->Edit(fRow);
break;
}
case MSG_CANCEL:
PostMessage(B_QUIT_REQUESTED);
break;
case MSG_ACCEPT:
{
if (_Validate()) {
int32 ix = fTypePopUp->FindMarkedIndex();
fRow->SetResourceStringID(fIDText->Text());
fRow->SetResourceName(fNameText->Text());
fRow->SetResourceType(kDefaultTypes[ix].type);
fRow->SetResourceStringCode(fCodeText->Text());
fRow->SetResourceSize(kDefaultTypes[ix].size);
fEditView->Commit();
PostMessage(B_QUIT_REQUESTED);
}
break;
}
}
}
bool
EditWindow::_Validate()
{
// TODO: Implement validation of entered data.
fErrorString->SetText("");
return true;
}

View File

@ -0,0 +1,53 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef EDIT_WINDOW_H
#define EDIT_WINDOW_H
#include <Window.h>
class EditView;
class ResourceRow;
class BBox;
class BButton;
class BMenuField;
class BPopUpMenu;
class BStringView;
class BTextControl;
class EditWindow : public BWindow {
public:
EditWindow(BRect frame, ResourceRow* row);
~EditWindow();
void MessageReceived(BMessage* msg);
private:
ResourceRow* fRow;
BView* fView;
BTextControl* fIDText;
BTextControl* fNameText;
BPopUpMenu* fTypePopUp;
BMenuField* fTypeMenu;
BTextControl* fCodeText;
EditView* fEditView;
BBox* fEditViewBox;
BStringView* fErrorString;
BButton* fCancelButton;
BButton* fOKButton;
bool _Validate();
};
#endif

View File

@ -0,0 +1,54 @@
SubDir HAIKU_TOP src apps resourceedit ;
UsePrivateHeaders interface shared ;
local sourceDirs =
edits
interface
settings
support
;
local sourceDir ;
for sourceDir in $(sourceDirs) {
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src apps resourceedit $(sourceDir) ] ;
}
Application ResourceEdit
:
# edits
AppFlagsEdit.cpp
BooleanEdit.cpp
EditView.cpp
NormalEdit.cpp
# interface
ImageButton.cpp
# settings
GenericSettingsView.cpp
# support
UndoContext.cpp
# .
DefaultTypes.cpp
EditWindow.cpp
MainWindow.cpp
ResourceEdit.cpp
ResourceListView.cpp
ResourceRow.cpp
SettingsFile.cpp
SettingsWindow.cpp
main.cpp
:
be
tracker
translation
libcolumnlistview.a
$(TARGET_LIBSTDC++)
:
ResourceEdit.rdef
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,186 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include "UndoContext.h"
#include <Window.h>
class ImageButton;
class ResourceListView;
class ResourceRow;
class SettingsFile;
class BBox;
class BEntry;
class BFilePanel;
class BMenu;
class BMenuBar;
class BMenuField;
class BMenuItem;
class BMessage;
class BPopUpMenu;
class BStringView;
class BTextControl;
class MainWindow : public BWindow {
public:
MainWindow(BRect frame, BEntry* entry, SettingsFile* settings);
~MainWindow();
bool QuitRequested();
void MouseDown(BPoint point);
void MessageReceived(BMessage* msg);
void SelectionChanged();
void AdaptSettings();
private:
BEntry* fAssocEntry;
SettingsFile* fSettings;
BFilePanel* fSavePanel;
bool fUnsavedChanges;
UndoContext* fUndoContext;
BMenuBar* fMenuBar;
BMenu* fFileMenu;
BMenuItem* fNewItem;
BMenuItem* fOpenItem;
BMenuItem* fCloseItem;
BMenuItem* fSaveItem;
BMenuItem* fSaveAsItem;
BMenuItem* fSaveAllItem;
BMenuItem* fMergeWithItem;
BMenuItem* fQuitItem;
BMenu* fEditMenu;
BMenuItem* fUndoItem;
BMenuItem* fRedoItem;
BMenuItem* fCutItem;
BMenuItem* fCopyItem;
BMenuItem* fPasteItem;
BMenuItem* fClearItem;
BMenuItem* fSelectAllItem;
BMenu* fToolsMenu;
BMenuItem* fAddAppResourcesItem;
BMenuItem* fSettingsItem;
BMenu* fHelpMenu;
BTextControl* fResourceIDText;
BPopUpMenu* fResourceTypePopUp;
BMenuField* fResourceTypeMenu;
BView* fToolbarView;
ImageButton* fAddButton;
ImageButton* fRemoveButton;
ImageButton* fMoveUpButton;
ImageButton* fMoveDownButton;
ResourceListView* fResourceList;
BBox* fStatsBox;
BStringView* fStatsString;
void _SetTitleFromEntry();
void _SaveAs();
void _Save(BEntry* entry = NULL);
void _Load();
int32 _NextResourceID();
void _RefreshStats();
void _RefreshUndoRedo();
void _Do(UndoContext::Action* action);
class AddAction : public UndoContext::Action {
public:
AddAction(const BString& label,
ResourceListView* list, BList* rows);
~AddAction();
void Do();
void Undo();
private:
ResourceListView* fList;
BList* fRows;
bool fAdded;
};
class RemoveAction : public UndoContext::Action {
public:
RemoveAction(const BString& label,
ResourceListView* list, BList* rows);
~RemoveAction();
void Do();
void Undo();
private:
ResourceListView* fList;
BList* fRows;
bool fRemoved;
};
class EditAction : public UndoContext::Action {
public:
EditAction(const BString& label,
ResourceListView* list,
ResourceRow* rowold, ResourceRow* rownew);
~EditAction();
void Do();
void Undo();
private:
ResourceListView* fList;
ResourceRow* fRowOld;
ResourceRow* fRowNew;
};
class MoveUpAction : public UndoContext::Action {
public:
MoveUpAction(const BString& label,
ResourceListView* list, BList* rows);
~MoveUpAction();
void Do();
void Undo();
private:
ResourceListView* fList;
BList* fRows;
};
class MoveDownAction : public UndoContext::Action {
public:
MoveDownAction(const BString& label,
ResourceListView* list, BList* rows);
~MoveDownAction();
void Do();
void Undo();
private:
ResourceListView* fList;
BList* fRows;
};
};
#endif

View File

@ -0,0 +1,152 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "ResourceEdit.h"
#include "AboutWindow.h"
#include "Constants.h"
#include "MainWindow.h"
#include "SettingsFile.h"
#include "SettingsWindow.h"
#include <Entry.h>
#include <FilePanel.h>
ResourceEdit::ResourceEdit()
:
BApplication("application/x-vnd.Haiku-ResourceEdit")
{
fCascade = BRect(100, 100, 700, 400);
fCascadeCount = 0;
fOpenPanel = new BFilePanel(B_OPEN_PANEL, &be_app_messenger, NULL, 0, true,
new BMessage(MSG_OPEN_DONE));
fSettings = new SettingsFile("resourceedit_settings");
fSettings->Load();
fSettingsWindow = NULL;
}
ResourceEdit::~ResourceEdit()
{
}
void
ResourceEdit::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case MSG_NEW:
_CreateWindow(NULL);
break;
case MSG_OPEN:
fOpenPanel->Show();
break;
case MSG_OPEN_DONE:
{
entry_ref ref;
while (fOpenPanel->GetNextSelectedRef(&ref) == B_OK)
_CreateWindow(new BEntry(&ref));
fOpenPanel->Rewind();
break;
}
case MSG_CLOSE:
{
MainWindow* window;
msg->FindPointer("window", (void**)&window);
fWindowList.RemoveItem(window);
if (fWindowList.CountItems() == 0)
Quit();
break;
}
case MSG_SAVEALL:
{
for (int32 i = 0; i < fWindowList.CountItems(); i++) {
MainWindow* window = ((MainWindow*)fWindowList.ItemAt(i));
window->PostMessage(MSG_SAVE);
}
break;
}
case MSG_SETTINGS:
{
if (fSettingsWindow != NULL)
fSettingsWindow->Activate();
else
fSettingsWindow = new SettingsWindow(fSettings);
break;
}
case MSG_SETTINGS_APPLY:
{
for (int32 i = 0; i < fWindowList.CountItems(); i++) {
MainWindow* window = ((MainWindow*)fWindowList.ItemAt(i));
window->PostMessage(MSG_SETTINGS_APPLY);
}
break;
}
case MSG_SETTINGS_CLOSED:
fSettingsWindow = NULL;
break;
default:
BApplication::MessageReceived(msg);
}
}
void
ResourceEdit::ArgvReceived(int32 argc, char* argv[])
{
for (int32 i = 1; i < argc; i++)
_CreateWindow(new BEntry(argv[i]));
}
void
ResourceEdit::ReadyToRun()
{
if (fWindowList.CountItems() <= 0)
_CreateWindow(NULL);
}
void
ResourceEdit::_CreateWindow(BEntry* assocEntry)
{
MainWindow* window = new MainWindow(_Cascade(), assocEntry, fSettings);
fWindowList.AddItem(window);
window->Show();
}
BRect
ResourceEdit::_Cascade()
{
if (fCascadeCount == 8) {
fCascade.OffsetBy(-20 * 8, -20 * 8);
fCascadeCount = 0;
} else {
fCascade.OffsetBy(20, 20);
fCascadeCount++;
}
return fCascade;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef RESOURCE_EDIT_H
#define RESOURCE_EDIT_H
#include <Application.h>
class MainWindow;
class SettingsFile;
class SettingsWindow;
class BEntry;
class BFilePanel;
class BMessage;
class ResourceEdit : public BApplication {
public:
ResourceEdit();
~ResourceEdit();
void MessageReceived(BMessage* msg);
private:
BRect fCascade;
uint32 fCascadeCount;
BList fWindowList;
BFilePanel* fOpenPanel;
SettingsFile* fSettings;
SettingsWindow* fSettingsWindow;
void ArgvReceived(int32 argc, char* argv[]);
void ReadyToRun();
void _CreateWindow(BEntry* assocEntry);
BRect _Cascade();
};
#endif

View File

@ -0,0 +1,136 @@
resource app_signature "application/x-vnd.Haiku-ResourceEdit";
resource app_name_catalog_entry "x-vnd.Haiku-ResourceEdit:System name:ResourceEdit";
resource app_version {
major = 0,
middle = 1,
minor = 0,
variety = B_APPV_ALPHA,
internal = 0,
short_info = "ResourceEdit",
long_info = "ResourceEdit © 2012-2013 Haiku, Inc."
};
resource app_flags B_SINGLE_LAUNCH;
resource file_types message {
"types" = "text/x-vnd.Be.ResourceDef"
};
resource vector_icon {
$"6E6369660E050102000603399E0F3D9C0ABF82B23B84A94B88504870C900A5FF"
$"F5BCEAFFF2FFB3FFE3020106023E49240000000000003CAAAA4940004A3000FF"
$"C0FFDD7C6DFFBC040192020006023A4BAE3411A9B629883C6629495368484715"
$"00FFF9BAFFFFC104020006023A6A0E3670BCB6D8C13AD0F64A21BC4A0DF300BA"
$"DCFFFF2A20F10200060239AAD5343BA5B6E7993C629D4ABB354803A500E99797"
$"FFCE323202000602AAB1FB3A081FBE8A26AF5E794C4014448D43FFFDDCAB00DB"
$"AB5F02000602B507E13A82E2BAD599B56BB44A7652479FE400116201FE69A403"
$"020006023C08200000000000004000004A4000000000FD6AD839004AB9270200"
$"06023D4D340000000000004000004A5000000000009CFA80FFF8FAFF02000603"
$"B2F679BA14D43A7FB6B38E9E460F5547105A00FFEED58DDBAB5FCFFFEED50401"
$"95020012023B8E380000000000004000004A5400C100000001FFFF0199120606"
$"AE0BB40BBF4D33C3AFB75DC173BDEFC607C13EC804CA28BD82C118B920C51BBB"
$"40BF07B8083AB6BC0605AE02B57D3EB9B9C3EFB7BB44BBB751BD75C936CA8EC1"
$"B1402F0A093B593D5BBFCDC93E455BC516C5F160465B435D4544510A045A425E"
$"3F5A3D57400A063236323D3A41403E403739330A063A433A4A404D464A464341"
$"400A064237423E48424E3F4E3948350604EE532755295528552A532B5229522A"
$"52280604EE532456295625562D532E5029502D50250A04B969B771332E502E4E"
$"2B0A04B969B5BAB969B7714E2B4E270A043324B969B5BA4E2750240A063124B8"
$"BAB5B2B8BAB779312EB677B6ECB67CB63C0606B20831245356295625562D532E"
$"3126290804BA28B4D33027302BBA28B8580003C6E8B4D3C6E8B4D3C690B51750"
$"2950B59E50B78DC6E8B858C690B814C6E8B8580A04C6F0C5C24E4F514BC9BBC4"
$"280A06C4E04F41C507374B394A45C33CC6D1C36F120A030202032020250A0001"
$"0130202501178400040A0201012020250A00010030202501178400040A010100"
$"2020250A000304050630202501178400040A0401042020250A0501052020250A"
$"0601062020250A0C0110000A0D0111000A00030D0E0F123ED413BED4133ED413"
$"3ED41347F4A24A588901178400040A0B010C023ED413BED4133ED4133ED41347"
$"F4A24A58890A0A010B023ED413BED4133ED4133ED41347F4A24A58890A09010A"
$"023ED413BED4133ED4133ED41347F4A24A58890A080109023ED413BED4133ED4"
$"133ED41347F4A24A58890A070108023ED413BED4133ED4133ED41347F4A24A58"
$"890A0001070A3ED413BED4133ED4133ED41347F4A24A588915FF"
};
resource(1, "add.png") #'PNG ' array {
$"89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D"
$"F80000017B494441544889ED95B14EC25014863F6AAB4864C40768D84C184908"
$"3E002B899B71742171C7677024716572C207707124260C0E460709A94C86844D"
$"144BEF6D716841CA2D5083C6857FBB7FFE73BF7B4F7B5AD8E8BF9588952A5231"
$"0B660D1D0D008967DD59559A5CAC2AD56301D2E473A739CDD8330010EF42B31E"
$"AD32D000BAEB03005BDA48210190524EEC9D5575B1011FCE07C676700347C42D"
$"8B0F1042E0391E00AE70D70014A990261FF2521C0EE5105DF8712925A4C852A2"
$"0EB4A7B9012D9A5CCE96AA6FD119AE79646AF3B6B16B7CA7C7203ED53659D796"
$"478D1CF0B4F8060934477714DB11735E54731368C0FE72C018466214511D4363"
$"D5520112AFFFD6575A4492508BB02300126F35E0812A2F94435E8A2CC7644806"
$"6B1BB8A2CF904E2837A00B61880AF0C7BFC1EC1095A8E3929996BAC0900E379C"
$"03BDB91D5E97037C75E7D66DA01091EB01CF0BF60040EDF52FEBCF01F13E1503"
$"5ADC72C2567020172F78A02B15EF7FE0EB007F8826F2807B60F0833D3652F505"
$"AA6A764F51A11AA20000000049454E44AE426082"
};
resource(2, "remove.png") #'PNG ' array {
$"89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D"
$"F800000275494441544889ED94C14B93611CC73F7B7D6DF80EDA72BEAFCE2D82"
$"57F022099AE065902884791C41052BD7FE804DA48378AF4E49978E199845273D"
$"CC90C0759B78085C66186387053A9C4B3417CB4DD6D3C136F5F5DDC04E1DFCC2"
$"0F5E9EDFFB7EBEBFEFFB3CEF0BE7FA6FA5C3C551557D1780A78064728B148027"
$"A3AAFA5E07C799E1E31ECFC7642824627EBF08C282C1440AC2B398DF2F92A190"
$"18F778523A38CD587566F03BAAFA617868E85A8BA2D06CB3E172B974CBDA9A77"
$"19A6014B10261EF87CE14EB71B9B24D1E6763B4AEBEBB737F2F9573BF0ABA6C1"
$"B0AACE04FBFBAF373734208A4544B188A628B8344D9792496F17740D0F0E86AF"
$"B6B454FA3649A2ADB5D5F1736BEBE6523EFF02289579B2D160379BFDBA99C90C"
$"A986F50EBB9D7B7D7D03C04087DD4E696FEF447F339361379BDD00BA81A5AA09"
$"E2B050974A793545D1554942140A9552651955964FAC894281CFE934D38B8BD1"
$"97F01A5804F6AB1A006219A6E574DAAB59AD7A932C230E0EAAD66A26C39B783C"
$"3A09534004D8A9B907C74DEAB359AF2ACB7A9310A7A61685025FB6B7799B4854"
$"8583C91E18B42A72B9815295A6C8E5CA977366F05A09A4204CDC8270BBCD5639"
$"2DC67202CDF9BC6E859EBF47581841966A701F84DB6BA7AB2801CC4074126E00"
$"BF6B2608C0631F3C348327806D4E7FB24E4003DD0ABDF1C3937434AD11E280EE"
$"C62AF05988CE423461D26F3C7CD60D74D64CB00573F570F7323814037C12A696"
$"E15103F468A097937C0722F06D069EEFC027E087C90C47D2C13906A918880894"
$"7F76F7814BE5E44158888088811883940E21A0AD26D86832022B019837C0CB92"
$"02303F022B67861FD305A0D7045E9685C3777EE55FE0E702E00F037E0BAE5DFC"
$"3C830000000049454E44AE426082"
};
resource(3, "moveup.png") #'PNG ' array {
$"89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D"
$"F8000001C8494441544889ED933B485B6118861F93D8788F510E27DAE00D259D"
$"0485823108723843296E22850E0EBA140AA543C4A18A9442A920EA62068582E2"
$"E0AA83E2050415A18B882028ED927AE8693C31510721A8F93B5841E9C9498A2E"
$"822FBCC3CFF7F3BCDFF75FE0510F465EC81E57F93AAE32ED85EC7B854B609F50"
$"98D4D755A1AFAB6242615302C77DC16D2185316D392044AC4D88589BD0960222"
$"A4B02A81FDCEF0D116BE84E7EA8530945B0ECFD58B911616D2312C3B1808F0A1"
$"FD9DAFBFB2D90DE2F2965D4F9DC8725E6D997ED4B072C0CC7F077C6AE27DC79B"
$"9AC19AD6221017A676573CC1539CFB4CFA1DAF5CD598CD38A0EF39DDAFBBA550"
$"9D5A00E2DCD22555763C85B686E2C8996BED178B6903828DBCEAEC94A67C2F9C"
$"64610DBF7669B5038FD3E9CF3B3C4B6EEAACDDE4FDF3D4FCE5F4D8EC063F96AE"
$"D6451512B2CFFC1823FB70FAD3B8EAD401FE72BAD8620A08A70CF8F80DD5BB4D"
$"179053E6C2DDFBD608CAB5E601A761181C63483F210EA02530807CCB09760C8E"
$"776018E025549324C8A5790049D04F88CF6B7C4EB12383DF28FE3A552D8D6CE9"
$"B7DC4D0F3FC0F20EB404D1EF1B44627BC866F5A328112D41D48A919541138540"
$"23A9A73D047633E03CCA5C7F00288AC08FE23A7EB30000000049454E44AE4260"
$"82"
};
resource(4, "movedown.png") #'PNG ' array {
$"89504E470D0A1A0A0000000D4948445200000018000000180806000000E0773D"
$"F8000001E6494441544889ED92DD4B53611CC73F6ED5BC680D978F6B792AC45C"
$"E164577A9710E7A6B0BAEAAE0B41F09F08BAEAC66E4421F042AF6A228A2F28BA"
$"A42226859B48DD0C247A811C8E1DE2D0081793A9674F174B523BCF966F78515F"
$"F8C173CEF7F7FB7E785EE0BF8E5B15A5CC90C0DD7543BC3DEB7707ECFC6F46D6"
$"B8FFDC6C4A98645419274A013417D50D37EB030D772ED8FA9FA657FCDA9CD991"
$"80EE7D010028AC83B5A6F6C0556AFC2F0079B0726AAF8CCA03E426588A20B979"
$"08006B437D44D6C6DE0121C169CD8500F07BD09059B04EDA4FCB2C7E0F556D50"
$"0790CA63264C7E6C6FF9E3998EDF6631D8265A1CCEE2F7994BE0BB627F8F5F3F"
$"E4594D16D7050B969E99CB7767080159E50EE2691E5FCD9B4F03B704158E5F3F"
$"1577E0BB5C2C5980F71193789A97401058D8EA71EE1E8A1924BC192A6BDDB96B"
$"D5753990E5EBE38B1C4383841FBD631A7803584A00C0EB34AF6A329CABF5D0EC"
$"BD0848757D9E83E130230F17990422C08EEDDA0200A22922DA771ACF0B82559A"
$"7DCF9705187BC2D48338A3C00CA0786E0A0970F4B6329B0C23E5D2CE4A86913D"
$"ADCC02F700F79E827743FA74A2A991DFE1A96164DF75A202DA01CFBEC3B7419C"
$"033A316302698C23077462023A00EF81C3B7A4C1A97E9DF97E9D790D3A8BDCC3"
$"970368067C4711FE8FEA273678C1FAFB9AC8FD0000000049454E44AE426082"
};

View File

@ -0,0 +1,60 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "ResourceListView.h"
#include "Constants.h"
#include <ColumnListView.h>
#include <Entry.h>
ResourceListView::ResourceListView(BRect rect, const char* name,
uint32 resizingMode, uint32 drawFlags, border_style border,
bool showHorizontalScrollbar)
:
BColumnListView(rect, name, resizingMode, drawFlags, border,
showHorizontalScrollbar)
{
//SetMouseTrackingEnabled(true);
}
ResourceListView::~ResourceListView()
{
}
void
ResourceListView::MouseDown(BPoint point)
{
PRINT(("MouseDown()"));
}
void
ResourceListView::MessageReceived(BMessage* msg)
{
switch (msg->what) {
case B_SIMPLE_DATA:
{
entry_ref ref;
int32 n = 0;
// TODO: Implement D&D adding of files.
while (msg->FindRef("refs", n++, &ref) == B_OK) {
PRINT(("%s\n", ref.name));
// ...
}
break;
}
default:
BColumnListView::MessageReceived(msg);
}
}

View File

@ -0,0 +1,27 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef RESOURCE_LIST_VIEW_H
#define RESOURCE_LIST_VIEW_H
#include <ColumnListView.h>
class ResourceListView : public BColumnListView {
public:
ResourceListView(BRect rect, const char* name, uint32 resizingMode,
uint32 drawFlags, border_style border = B_NO_BORDER,
bool showHorizontalScrollbar = true);
~ResourceListView();
void MouseDown(BPoint point);
void MessageReceived(BMessage* msg);
private:
};
#endif

View File

@ -0,0 +1,153 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "ResourceRow.h"
#include <ColumnListView.h>
#include <ColumnTypes.h>
#include <stdlib.h>
ResourceRow::ResourceRow()
:
BRow()
{
Parent = NULL;
ActionIndex = -1;
SetField(new BStringField(""), 0);
SetField(new BStringField(""), 1);
SetField(new BStringField(""), 2);
SetField(new BStringField(""), 3);
SetField(new BStringField(""), 4);
SetField(new BSizeField(0), 5);
}
ResourceRow::~ResourceRow()
{
// ...
}
void
ResourceRow::SetResourceID(int32 id)
{
((BStringField*)GetField(0))->SetString((BString() << id).String());
}
void
ResourceRow::SetResourceStringID(const char* id)
{
((BStringField*)GetField(0))->SetString(id);
}
void
ResourceRow::SetResourceName(const char* name)
{
((BStringField*)GetField(1))->SetString(name);
}
void
ResourceRow::SetResourceType(const char* type)
{
((BStringField*)GetField(2))->SetString(type);
}
void
ResourceRow::SetResourceCode(type_code code)
{
fCode = code;
ResourceType::CodeToString(code, fTypeString);
((BStringField*)GetField(3))->SetString(fTypeString);
}
void
ResourceRow::SetResourceStringCode(const char* code)
{
fCode = ResourceType::StringToCode(code);
((BStringField*)GetField(3))->SetString(code);
}
void
ResourceRow::SetResourceData(const char* data)
{
((BStringField*)GetField(4))->SetString(data);
}
void
ResourceRow::SetResourceSize(off_t size)
{
((BSizeField*)GetField(5))->SetSize(size);
}
int32
ResourceRow::ResourceID()
{
const char* strID = ResourceStringID();
// TODO: Check whether is numeric and resolve if not.
return atoi(strID);
}
const char*
ResourceRow::ResourceStringID()
{
return ((BStringField*)GetField(0))->String();
}
const char*
ResourceRow::ResourceName()
{
return ((BStringField*)GetField(1))->String();
}
const char*
ResourceRow::ResourceType()
{
return ((BStringField*)GetField(2))->String();
}
type_code
ResourceRow::ResourceCode()
{
return fCode;
}
const char*
ResourceRow::ResourceStringCode()
{
return ((BStringField*)GetField(3))->String();
}
const char*
ResourceRow::ResourceData()
{
return ((BStringField*)GetField(4))->String();
}
off_t
ResourceRow::ResourceSize()
{
return ((BSizeField*)GetField(5))->Size();
}

View File

@ -0,0 +1,46 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef RESOURCE_ROW_H
#define RESOURCE_ROW_H
#include "DefaultTypes.h"
#include <ColumnListView.h>
class ResourceRow : public BRow {
public:
ResourceRow();
~ResourceRow();
void SetResourceID(int32 id);
void SetResourceStringID(const char* id);
void SetResourceName(const char* name);
void SetResourceType(const char* type);
void SetResourceCode(type_code code);
void SetResourceStringCode(const char* code);
void SetResourceData(const char* data);
void SetResourceSize(off_t size);
int32 ResourceID();
const char* ResourceStringID();
const char* ResourceName();
const char* ResourceType();
type_code ResourceCode();
const char* ResourceStringCode();
const char* ResourceData();
off_t ResourceSize();
ResourceRow* Parent;
int32 ActionIndex;
private:
type_code fCode;
char fTypeString[8];
};
#endif

View File

@ -0,0 +1,56 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "SettingsFile.h"
SettingsFile::SettingsFile(const char* name)
{
find_directory(B_USER_SETTINGS_DIRECTORY, &fPath);
fPath.Append(name, true);
}
SettingsFile::~SettingsFile()
{
}
void
SettingsFile::Defaults()
{
UndoLimit = 100;
}
void
SettingsFile::Load()
{
fFile = new BFile(fPath.Path(), B_READ_ONLY);
if (fFile->InitCheck() == B_OK) {
fFile->Read(&UndoLimit, sizeof(UndoLimit));
// TODO: Add more settings here (2/3).
} else
Defaults();
delete fFile;
}
void
SettingsFile::Save()
{
fFile = new BFile(fPath.Path(), B_WRITE_ONLY | B_CREATE_FILE);
if (fFile->InitCheck() == B_OK) {
fFile->Write(&UndoLimit, sizeof(UndoLimit));
// TODO: Add more settings here (3/3).
}
delete fFile;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef SETTINGS_FILE_H
#define SETTINGS_FILE_H
#include <File.h>
#include <FindDirectory.h>
#include <Path.h>
class SettingsFile
{
public:
int32 UndoLimit;
// TODO: Add more settings here (1/3).
SettingsFile(const char* name);
~SettingsFile();
void Defaults();
void Load();
void Save();
private:
BPath fPath;
BFile* fFile;
};
#endif

View File

@ -0,0 +1,120 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "SettingsWindow.h"
#include "Constants.h"
#include "GenericSettingsView.h"
#include "SettingsFile.h"
#include <Application.h>
#include <Button.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <ListView.h>
#include <ScrollView.h>
#include <View.h>
SettingsWindow::SettingsWindow(SettingsFile* settings)
:
BWindow(BRect(200, 150, 600, 450), "Settings", B_TITLED_WINDOW, B_NOT_RESIZABLE)
{
fSettings = settings;
BRect bounds = Bounds();
fBackView = new BView(bounds, "fBackView", B_FOLLOW_ALL, 0);
fBackView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fListView = new BListView(BRect(8, 8, 100 + 8, bounds.bottom - 8),
"fListView", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL);
// TODO: Implement selecting different categories of settings.
// fListView->SetSelectionMessage(new BMessage(...));
fListView->AddItem(new BStringItem("Generic"));
fListView->Select(0);
fScrollView = new BScrollView("fScrollView", fListView, B_FOLLOW_TOP_BOTTOM,
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
fGenericSettingsView = new GenericSettingsView(
BRect(132, 8, bounds.right - 8, bounds.bottom - 8 - 40),
"fGenericSettingsView", fSettings);
// TODO: Add more settings views (2/4).
fRevertButton = new BButton(BRect(bounds.right - 152, bounds.bottom - 32,
bounds.right - 88, bounds.bottom - 8),
"fRevertButton", "Revert",
new BMessage(MSG_SETTINGS_REVERT));
fApplyButton = new BButton(BRect(bounds.right - 72, bounds.bottom - 32,
bounds.right - 8, bounds.bottom - 8), "fApplyButton", "Apply",
new BMessage(MSG_SETTINGS_APPLY));
AdaptSettings();
fBackView->AddChild(fScrollView);
fBackView->AddChild(fGenericSettingsView);
fBackView->AddChild(fRevertButton);
fBackView->AddChild(fApplyButton);
AddChild(fBackView);
Show();
}
SettingsWindow::~SettingsWindow()
{
}
bool
SettingsWindow::QuitRequested()
{
be_app->PostMessage(MSG_SETTINGS_CLOSED);
return true;
}
void
SettingsWindow::MessageReceived(BMessage* msg)
{
switch (msg->what)
{
case MSG_SETTINGS_APPLY:
{
ApplySettings();
fSettings->Save();
be_app->PostMessage(MSG_SETTINGS_APPLY);
break;
}
case MSG_SETTINGS_REVERT:
{
AdaptSettings();
fSettings->Save();
be_app->PostMessage(MSG_SETTINGS_APPLY);
break;
}
default:
BWindow::MessageReceived(msg);
}
}
void
SettingsWindow::ApplySettings()
{
fGenericSettingsView->ApplySettings();
// TODO: Add more settings views (3/4).
}
void
SettingsWindow::AdaptSettings()
{
fGenericSettingsView->AdaptSettings();
// TODO: Add more settings views (4/4).
}

View File

@ -0,0 +1,48 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef SETTINGS_WINDOW_H
#define SETTINGS_WINDOW_H
#include <Window.h>
class GenericSettingsView;
class SettingsFile;
class BButton;
class BListView;
class BScrollView;
class BView;
class SettingsWindow : public BWindow {
public:
SettingsWindow(SettingsFile* settings);
~SettingsWindow();
bool QuitRequested();
void MessageReceived(BMessage* msg);
void ApplySettings();
void AdaptSettings();
private:
SettingsFile* fSettings;
BView* fBackView;
BListView* fListView;
BScrollView* fScrollView;
GenericSettingsView* fGenericSettingsView;
// TODO: Add more settings (1/4).
BButton* fRevertButton;
BButton* fApplyButton;
};
#endif

View File

@ -0,0 +1,4 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/

View File

@ -0,0 +1,4 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/

View File

@ -0,0 +1,71 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "NormalEdit.h"
#include "ResourceRow.h"
#include <CheckBox.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
BooleanEdit::BooleanEdit()
:
EditView("BooleanEdit")
{
}
BooleanEdit::~BooleanEdit()
{
}
void
BooleanEdit::AttachTo(BView* view)
{
EditView::AttachTo(view);
SetLayout(new BGroupLayout(B_VERTICAL));
fValueCheck = new BCheckBox(BRect(0, 0, 0, 0), "fValueText",
"", NULL);
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(fValueCheck)
.AddGlue()
);
view->AddChild(this);
}
void
BooleanEdit::Edit(ResourceRow* row)
{
EditView::Edit(row);
BString data = fRow->ResourceData();
if (data == "" || data == "0" || data == "false")
fValueCheck->SetValue(B_CONTROL_OFF);
else
fValueCheck->SetValue(B_CONTROL_ON);
}
void
BooleanEdit::Commit()
{
EditView::Commit();
if (fValueCheck->Value() == B_CONTROL_ON)
fRow->SetResourceData("true");
else
fRow->SetResourceData("false");
}

View File

@ -0,0 +1,30 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef BOOLEAN_EDIT_H
#define BOOLEAN_EDIT_H
#include "EditView.h"
class BCheckBox;
class BooleanEdit : public EditView {
public:
BooleanEdit();
~BooleanEdit();
void AttachTo(BView* view);
void Edit(ResourceRow* row);
void Commit();
private:
BCheckBox* fValueCheck;
};
#endif

View File

@ -0,0 +1,52 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "EditView.h"
EditView::EditView(const char* name)
:
BView(BRect(0, 0, 0, 0), name, 0, 0)
{
// Implemented by subclasses.
}
EditView::~EditView()
{
// Implemented by subclasses.
}
void
EditView::AttachTo(BView* view)
{
while (true) {
BView* child = ChildAt(0);
if (child == NULL)
break;
child->RemoveSelf();
}
// Implemented by subclasses.
}
void
EditView::Edit(ResourceRow* row)
{
fRow = row;
// Implemented by subclasses.
}
void
EditView::Commit()
{
// Implemented by subclasses.
}

View File

@ -0,0 +1,31 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef EDIT_VIEW_H
#define EDIT_VIEW_H
#include <View.h>
class ResourceRow;
class EditView : public BView {
public:
EditView(const char* name);
virtual ~EditView();
virtual void AttachTo(BView* view);
virtual void Edit(ResourceRow* row);
virtual void Commit();
protected:
ResourceRow* fRow;
};
#endif

View File

@ -0,0 +1,64 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "NormalEdit.h"
#include "ResourceRow.h"
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <TextControl.h>
NormalEdit::NormalEdit()
:
EditView("NormalEdit")
{
}
NormalEdit::~NormalEdit()
{
}
void
NormalEdit::AttachTo(BView* view)
{
EditView::AttachTo(view);
SetLayout(new BGroupLayout(B_VERTICAL));
fValueText = new BTextControl(BRect(0, 0, 0, 0), "fValueText",
"Value:", "", NULL);
fValueText->SetDivider(50);
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(fValueText)
.AddGlue()
);
view->AddChild(this);
}
void
NormalEdit::Edit(ResourceRow* row)
{
EditView::Edit(row);
fValueText->SetText(fRow->ResourceData());
}
void
NormalEdit::Commit()
{
EditView::Commit();
fRow->SetResourceData(fValueText->Text());
}

View File

@ -0,0 +1,31 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef NORMAL_EDIT_H
#define NORMAL_EDIT_H
#include "EditView.h"
class BTextControl;
// TODO: Templatize this class and rename to NumericEdit.
//template<typename $type>
class NormalEdit : public EditView {
public:
NormalEdit();
~NormalEdit();
void AttachTo(BView* view);
void Edit(ResourceRow* row);
void Commit();
private:
BTextControl* fValueText;
};
#endif

View File

@ -0,0 +1,67 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "ImageButton.h"
#include <Bitmap.h>
ImageButton::ImageButton(BRect frame, const char* name, BBitmap* image,
BMessage* message, uint32 resizingMode = B_FOLLOW_NONE)
:
BButton(frame, name, "", message, resizingMode)
{
fImage = image;
fDrawPoint.x = ((frame.RightTop().x - frame.LeftTop().x)
- (image->Bounds().RightBottom().x + 1)) / 2;
fDrawPoint.y = ((frame.LeftBottom().y - frame.LeftTop().y)
- (image->Bounds().RightBottom().y + 1)) / 2;
fInnerBounds = Bounds();
fInnerBounds.InsetBy(3, 3);
SetDrawingMode(B_OP_ALPHA);
}
ImageButton::~ImageButton()
{
}
void
ImageButton::Draw(BRect updateRect)
{
BButton::Draw(updateRect);
DrawBitmap(fImage, fDrawPoint);
if (!IsEnabled()) {
rgb_color tempColor = HighColor();
SetHighColor(255, 255, 255, 155);
FillRect(fInnerBounds, B_SOLID_HIGH);
SetHighColor(tempColor);
}
}
void
ImageButton::ResizeTo(float width, float height)
{
BButton::ResizeTo(width, height);
fInnerBounds = Bounds();
fInnerBounds.InsetBy(3, 3);
}
void
ImageButton::SetBitmap(BBitmap* image)
{
fImage = image;
Invalidate();
}

View File

@ -0,0 +1,32 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef IMAGE_BUTTON_H
#define IMAGE_BUTTON_H
#include <Button.h>
class ImageButton : public BButton
{
public:
ImageButton(BRect frame, const char* name, BBitmap* image,
BMessage* message, uint32 resizingMode);
~ImageButton();
void Draw(BRect updateRect);
void ResizeTo(float width, float height);
void SetBitmap(BBitmap* image);
private:
BBitmap* fImage;
BPoint fDrawPoint;
BRect fInnerBounds;
};
#endif

View File

@ -0,0 +1,17 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "ResourceEdit.h"
int
main()
{
ResourceEdit* app = new ResourceEdit();
app->Run();
delete app;
return 0;
}

View File

@ -0,0 +1,60 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "GenericSettingsView.h"
#include "SettingsFile.h"
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <String.h>
#include <TextControl.h>
#include <stdlib.h>
GenericSettingsView::GenericSettingsView(BRect frame, const char* name,
SettingsFile* settings, uint32 resizingMode, uint32 flags)
:
BView(frame, name, resizingMode, flags)
{
fSettings = settings;
SetLayout(new BGroupLayout(B_VERTICAL));
fUndoLimitText = new BTextControl(BRect(0, 0, 0, 0), "fUndoLimitText",
"Undo Limit:", NULL, NULL);
fUndoLimitText->SetDivider(100);
// TODO: Add more controls for generic settings (2/4).
AddChild(BGroupLayoutBuilder(B_VERTICAL, 8)
.Add(fUndoLimitText)
.AddGlue()
);
}
GenericSettingsView::~GenericSettingsView()
{
}
void
GenericSettingsView::ApplySettings()
{
fSettings->UndoLimit = atoi(fUndoLimitText->Text());
// TODO: Add more controls for generic settings (3/4).
}
void
GenericSettingsView::AdaptSettings()
{
fUndoLimitText->SetText(BString() << fSettings->UndoLimit);
// TODO: Add more controls for generic settings (4/4).
}

View File

@ -0,0 +1,37 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef GENERIC_SETTINGS_VIEW_H
#define GENERIC_SETTINGS_VIEW_H
#include <View.h>
class SettingsFile;
class BTextControl;
class GenericSettingsView : public BView {
public:
GenericSettingsView(BRect frame, const char* name,
SettingsFile* settings,
uint32 resizingMode = B_FOLLOW_ALL,
uint32 flags = 0);
~GenericSettingsView();
void ApplySettings();
void AdaptSettings();
private:
SettingsFile* fSettings;
BTextControl* fUndoLimitText;
// TODO: Add more controls for generic settings (1/4).
};
#endif

View File

@ -0,0 +1,175 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#include "UndoContext.h"
#include "Constants.h"
#include <List.h>
#include <String.h>
UndoContext::Action::Action(const BString& label)
{
fLabel = label;
}
UndoContext::Action::~Action()
{
}
void
UndoContext::Action::Do()
{
}
void
UndoContext::Action::Undo()
{
}
void
UndoContext::Action::SetLabel(const BString& label)
{
fLabel = label;
}
BString
UndoContext::Action::Label() const
{
return fLabel;
}
UndoContext::UndoContext()
{
fAt = 0;
fLimit = 3;
fHistory = new BList();
}
UndoContext::~UndoContext()
{
for (int32 i = 0; i < fHistory->CountItems(); i++)
delete (Action*)fHistory->ItemAt(i);
delete fHistory;
}
void
UndoContext::SetLimit(int32 limit)
{
int32 delta = fLimit - limit;
if (limit > 1)
fLimit = limit;
else
limit = 1;
if (delta > 0) {
for (int32 i = 0; i < delta; i++)
delete (Action*)fHistory->ItemAt(i);
fHistory->RemoveItems(0, delta);
if (fAt > fLimit)
fAt = fLimit;
}
}
int32
UndoContext::Limit() const
{
return fLimit;
}
void
UndoContext::Do(UndoContext::Action* action)
{
int32 count = fHistory->CountItems();
if (fAt >= fLimit)
delete (Action*)fHistory->RemoveItem((int32)0);
else {
for (int32 i = fAt; i < count; i++)
delete (Action*)fHistory->ItemAt(i);
fHistory->RemoveItems(fAt, count - fAt);
fAt++;
}
fHistory->AddItem(action);
action->Do();
}
void
UndoContext::Undo()
{
if (!CanUndo())
return;
fAt--;
((Action*)fHistory->ItemAt(fAt))->Undo();
}
void
UndoContext::Redo()
{
if (!CanRedo())
return;
((Action*)fHistory->ItemAt(fAt))->Do();
fAt++;
}
bool
UndoContext::CanUndo() const
{
return fAt > 0;
}
bool
UndoContext::CanRedo() const
{
return fAt < fHistory->CountItems();
}
BString
UndoContext::UndoLabel() const
{
if (CanUndo())
return ((Action*)fHistory->ItemAt(fAt - 1))->Label();
else
return "";
}
BString
UndoContext::RedoLabel() const
{
if (CanRedo())
return ((Action*)fHistory->ItemAt(fAt))->Label();
else
return "";
}

View File

@ -0,0 +1,55 @@
/*
* Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef UNDO_CONTEXT_H
#define UNDO_CONTEXT_H
#include <List.h>
#include <String.h>
class UndoContext {
public:
class Action {
public:
Action(const BString& label);
virtual ~Action();
virtual void Do();
virtual void Undo();
void SetLabel(const BString& label);
BString Label() const;
private:
BString fLabel;
};
UndoContext();
~UndoContext();
void SetLimit(int32 limit);
int32 Limit() const;
void Do(Action* action);
void Undo();
void Redo();
bool CanUndo() const;
bool CanRedo() const;
BString UndoLabel() const;
BString RedoLabel() const;
private:
int32 fAt;
int32 fLimit;
BList* fHistory;
};
#endif

View File

@ -17,7 +17,6 @@ Application ShowImage :
ShowImageApp.cpp
ShowImageSettings.cpp
ShowImageStatusView.cpp
ShowImageUndo.cpp
ShowImageView.cpp
ShowImageWindow.cpp
ToolBarIcons.cpp

View File

@ -1,93 +0,0 @@
/*
* Copyright 2003-2009 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Wilber
*/
#include "ShowImageUndo.h"
#include <stdio.h>
#include <stdlib.h>
ShowImageUndo::ShowImageUndo()
:
fWindow(NULL),
fUndoType(0),
fRestore(NULL),
fSelection(NULL)
{
}
ShowImageUndo::~ShowImageUndo()
{
InternalClear();
}
void
ShowImageUndo::InternalClear()
{
fUndoType = 0;
delete fRestore;
fRestore = NULL;
delete fSelection;
fSelection = NULL;
}
void
ShowImageUndo::Clear()
{
InternalClear();
SendUndoStateMessage(false);
}
void
ShowImageUndo::SendUndoStateMessage(bool bCanUndo)
{
if (fWindow) {
if (!fWindow->IsLocked()) {
fprintf(stderr,
"ShowImageUndo::SendUndoStateMessage: window must be locked!");
exit(-1);
}
BMessage msg(MSG_UNDO_STATE);
msg.AddBool("can_undo", bCanUndo);
fWindow->PostMessage(&msg);
}
}
void
ShowImageUndo::SetTo(BRect rect, BBitmap* restore, BBitmap* selection)
{
// NOTE: THIS FUNCTION DOES NOT MAKE COPIES OF THE BITMAPS PASSED TO IT
InternalClear();
fUndoType = UNDO_UNDO;
fRect = rect;
fRestore = restore;
fSelection = selection;
SendUndoStateMessage(true);
}
void
ShowImageUndo::Undo(BRect rect, BBitmap* restore, BBitmap* selection)
{
// NOTE: THIS FUNCTION DOES NOT MAKE COPIES OF THE BITMAPS PASSED TO IT
fUndoType = UNDO_REDO;
fRect = rect;
delete fRestore;
fRestore = restore;
fSelection = selection;
// NOTE: fSelection isn't deleted here because ShowImageView
// takes ownership of it during an Undo
}

View File

@ -1,63 +0,0 @@
/*
* Copyright 2003-2009 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Wilber
*/
#ifndef SHOW_IMAGE_UNDO_H
#define SHOW_IMAGE_UNDO_H
#include <Bitmap.h>
#include <Message.h>
#include <Messenger.h>
#include <Rect.h>
#include <Window.h>
#include "ShowImageConstants.h"
// for Undo
#define UNDO_UNDO 1
#define UNDO_REDO 2
class ShowImageUndo {
public:
ShowImageUndo();
~ShowImageUndo();
void SetWindow(BWindow* win) { fWindow = win; }
void Clear();
// NOTE: THESE TWO FUNCTIONS DO NOT MAKE COPIES OF THE
// BITMAPS PASSED TO THEM
void SetTo(BRect rect, BBitmap* restore, BBitmap* selection);
void Undo(BRect rect, BBitmap* restore, BBitmap* selection);
int32 GetType() { return fUndoType; }
BRect GetRect() { return fRect; }
BBitmap* GetRestoreBitmap() { return fRestore; }
BBitmap* GetSelectionBitmap() { return fSelection; }
private:
void InternalClear();
void SendUndoStateMessage(bool bCanUndo);
BWindow* fWindow;
// Window to which notification messages are sent
int32 fUndoType;
// Nothing, Undo or Redo
BRect fRect;
// Area of background bitmap where change took place
BBitmap* fRestore;
// Changed portion of background bitmap, before change took place
BBitmap* fSelection;
// Selection present before change took place
};
#endif // SHOW_IMAGE_UNDO_H

View File

@ -244,13 +244,16 @@ ShowImageView::Pulse()
}
if (fHideCursor && !fHasSelection && !fShowingPopUpMenu && fIsActiveWin) {
if (fHideCursorCountDown <= 0) {
if (fHideCursorCountDown == 0) {
// Go negative so this isn't triggered again
fHideCursorCountDown--;
BPoint mousePos;
uint32 buttons;
GetMouse(&mousePos, &buttons, false);
if (Bounds().Contains(mousePos))
be_app->ObscureCursor();
} else
} else if (fHideCursorCountDown > 0)
fHideCursorCountDown--;
}
@ -365,7 +368,6 @@ ShowImageView::SetImage(const entry_ref* ref, BBitmap* bitmap,
BitmapOwner* bitmapOwner)
{
// Delete the old one, and clear everything
fUndo.Clear();
_SetHasSelection(false);
fCreatingSelection = false;
_DeleteBitmap();
@ -531,7 +533,6 @@ void
ShowImageView::AttachedToWindow()
{
FitToBounds();
fUndo.SetWindow(Window());
FixupScrollBars();
}
@ -1476,47 +1477,6 @@ ShowImageView::SetSelectionMode(bool selectionMode)
}
void
ShowImageView::Undo()
{
int32 undoType = fUndo.GetType();
if (undoType != UNDO_UNDO && undoType != UNDO_REDO)
return;
// backup current selection
BRect undoneSelRect;
BBitmap* undoneSelection;
undoneSelRect = fSelectionBox.Bounds();
undoneSelection = _CopySelection();
if (undoType == UNDO_UNDO) {
BBitmap* undoRestore;
undoRestore = fUndo.GetRestoreBitmap();
if (undoRestore)
_MergeWithBitmap(undoRestore, fUndo.GetRect());
}
// restore previous image/selection
BBitmap* undoSelection;
undoSelection = fUndo.GetSelectionBitmap();
// NOTE: ShowImageView is responsible for deleting this bitmap
// (Which it will, as it would with a fSelectionBitmap that it
// allocated itself)
if (!undoSelection)
_SetHasSelection(false);
else {
fCopyFromRect = BRect();
fSelectionBox.SetBounds(this, fUndo.GetRect());
_SetHasSelection(true);
fSelectionBitmap = undoSelection;
}
fUndo.Undo(undoneSelRect, NULL, undoneSelection);
Invalidate();
}
void
ShowImageView::SelectAll()
{
@ -1729,7 +1689,6 @@ ShowImageView::_DoImageOperation(ImageProcessor::operation op, bool quiet)
void
ShowImageView::_UserDoImageOperation(ImageProcessor::operation op, bool quiet)
{
fUndo.Clear();
_DoImageOperation(op, quiet);
}
@ -1770,7 +1729,6 @@ ShowImageView::ResizeImage(int w, int h)
// remove selection
_SetHasSelection(false);
fUndo.Clear();
_DeleteBitmap();
fBitmap = scaled;

View File

@ -24,7 +24,6 @@
#include "Filter.h"
#include "SelectionBox.h"
#include "ShowImageUndo.h"
class BitmapOwner;
@ -82,7 +81,6 @@ public:
void SetSelectionMode(bool selectionMode);
bool IsSelectionModeEnabled() const
{ return fSelectionMode; }
void Undo();
void SelectAll();
void ClearSelection();
@ -182,7 +180,6 @@ private:
void _ShowToolBarIfEnabled(bool show);
private:
ShowImageUndo fUndo;
entry_ref fCurrentRef;
BitmapOwner* fBitmapOwner;

View File

@ -418,8 +418,6 @@ ShowImageWindow::_AddMenus(BMenuBar* bar)
bar->AddItem(menu);
menu = new BMenu(B_TRANSLATE("Edit"));
_AddItemMenu(menu, B_TRANSLATE("Undo"), B_UNDO, 'Z', 0, this, false);
menu->AddSeparatorItem();
_AddItemMenu(menu, B_TRANSLATE("Copy"), B_COPY, 'C', 0, this, false);
menu->AddSeparatorItem();
_AddItemMenu(menu, B_TRANSLATE("Selection mode"), MSG_SELECTION_MODE, 0, 0,
@ -767,18 +765,6 @@ ShowImageWindow::MessageReceived(BMessage* message)
break;
}
case MSG_UNDO_STATE:
{
bool enable;
if (message->FindBool("can_undo", &enable) == B_OK)
_EnableMenuItem(fBar, B_UNDO, enable);
break;
}
case B_UNDO:
fImageView->Undo();
break;
case B_COPY:
fImageView->CopySelectionToClipboard();
break;

View File

@ -253,6 +253,7 @@ SubInclude HAIKU_TOP src bin hid_decode ;
SubInclude HAIKU_TOP src bin iasl ;
SubInclude HAIKU_TOP src bin ideinfo ;
SubInclude HAIKU_TOP src bin keymap ;
SubInclude HAIKU_TOP src bin keystore ;
SubInclude HAIKU_TOP src bin less ;
SubInclude HAIKU_TOP src bin listdev ;
SubInclude HAIKU_TOP src bin locale ;

6
src/bin/keystore/Jamfile Normal file
View File

@ -0,0 +1,6 @@
SubDir HAIKU_TOP src bin keystore ;
BinCommand keystore :
keystore.cpp
: be
: keystore.rdef ;

View File

@ -0,0 +1,459 @@
/*
* Copyright 2012, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz, mmlr@mlotz.ch
*/
#include <Application.h>
#include <KeyStore.h>
#include <stdio.h>
int
add_password(const char* keyring, const char* identifier,
const char* secondaryIdentifier, const char* passwordString)
{
BKeyStore keyStore;
BPasswordKey password(passwordString, B_KEY_PURPOSE_GENERIC, identifier,
secondaryIdentifier);
status_t result = keyStore.AddKey(keyring, password);
if (result != B_OK) {
printf("failed to add password: %s\n", strerror(result));
return 2;
}
return 0;
}
int
remove_password(const char* keyring, const char* identifier,
const char* secondaryIdentifier)
{
BKeyStore keyStore;
BPasswordKey password;
status_t result = keyStore.GetKey(keyring, B_KEY_TYPE_PASSWORD, identifier,
secondaryIdentifier, false, password);
if (result != B_OK) {
printf("failed to get password \"%s\": %s\n", identifier,
strerror(result));
return 2;
}
result = keyStore.RemoveKey(keyring, password);
if (result != B_OK) {
printf("failed to remove password: %s\n", strerror(result));
return 3;
}
return 0;
}
int
add_keyring(const char* keyring)
{
BKeyStore keyStore;
status_t result = keyStore.AddKeyring(keyring);
if (result != B_OK) {
printf("failed to add keyring: %s\n", strerror(result));
return 2;
}
return 0;
}
int
remove_keyring(const char* keyring)
{
BKeyStore keyStore;
status_t result = keyStore.RemoveKeyring(keyring);
if (result != B_OK) {
printf("failed to remove keyring: %s\n", strerror(result));
return 2;
}
return 0;
}
int
list_passwords(const char* keyring)
{
BKeyStore keyStore;
uint32 cookie = 0;
while (true) {
BPasswordKey password;
status_t result = keyStore.GetNextKey(keyring, B_KEY_TYPE_PASSWORD,
B_KEY_PURPOSE_ANY, cookie, password);
if (result == B_ENTRY_NOT_FOUND)
break;
if (result != B_OK) {
printf("failed to get next key with: %s\n", strerror(result));
return 2;
}
password.PrintToStream();
}
return 0;
}
int
list_keyrings()
{
BKeyStore keyStore;
uint32 cookie = 0;
while (true) {
BString keyring;
status_t result = keyStore.GetNextKeyring(cookie, keyring);
if (result == B_ENTRY_NOT_FOUND)
break;
if (result != B_OK) {
printf("failed to get next key with: %s\n", strerror(result));
return 2;
}
printf("keyring: \"%s\"\n", keyring.String());
}
return 0;
}
int
show_status(const char* keyring)
{
BKeyStore keyStore;
printf("keyring \"%s\" is %slocked\n", keyring,
keyStore.IsKeyringUnlocked(keyring) ? "un" : "");
return 0;
}
int
lock_keyring(const char* keyring)
{
BKeyStore keyStore;
status_t result = keyStore.LockKeyring(keyring);
if (result != B_OK) {
printf("failed to lock keyring \"%s\": %s\n", keyring,
strerror(result));
return 2;
}
return 0;
}
int
add_keyring_to_master(const char* keyring)
{
BKeyStore keyStore;
status_t result= keyStore.AddKeyringToMaster(keyring);
if (result != B_OK) {
printf("failed to add keyring \"%s\" to master: %s\n", keyring,
strerror(result));
return 2;
}
return 0;
}
int
remove_keyring_from_master(const char* keyring)
{
BKeyStore keyStore;
status_t result= keyStore.RemoveKeyringFromMaster(keyring);
if (result != B_OK) {
printf("failed to remove keyring \"%s\" from master: %s\n", keyring,
strerror(result));
return 2;
}
return 0;
}
int
list_applications(const char* keyring)
{
BKeyStore keyStore;
uint32 cookie = 0;
while (true) {
BString signature;
status_t result = keyStore.GetNextApplication(keyring,
cookie, signature);
if (result == B_ENTRY_NOT_FOUND)
break;
if (result != B_OK) {
printf("failed to get next application: %s\n", strerror(result));
return 2;
}
printf("application: \"%s\"\n", signature.String());
}
return 0;
}
int
remove_application(const char* keyring, const char* signature)
{
BKeyStore keyStore;
status_t result = keyStore.RemoveApplication(keyring, signature);
if (result != B_OK) {
printf("failed to remove application: %s\n", strerror(result));
return 3;
}
return 0;
}
int
set_unlock_key(const char* keyring, const char* passwordString)
{
BKeyStore keyStore;
BPasswordKey password(passwordString, B_KEY_PURPOSE_KEYRING, NULL);
status_t result = keyStore.SetUnlockKey(keyring, password);
if (result != B_OK) {
printf("failed to set unlock key: %s\n", strerror(result));
return 3;
}
return 0;
}
int
remove_unlock_key(const char* keyring)
{
BKeyStore keyStore;
status_t result = keyStore.RemoveUnlockKey(keyring);
if (result != B_OK) {
printf("failed to remove unlock key: %s\n", strerror(result));
return 3;
}
return 0;
}
int
print_usage(const char* name)
{
printf("usage:\n");
printf("\t%s list passwords [<fromKeyring>]\n", name);
printf("\t\tLists all passwords of the specified keyring or from the"
" master keyring if none is supplied.\n");
printf("\t%s list keyrings\n", name);
printf("\t\tLists all keyrings.\n");
printf("\t%s list applications [<fromKeyring>]\n", name);
printf("\t\tLists the applications that have been granted permanent access"
" to a keyring once it is unlocked.\n\n");
printf("\t%s add password <identifier> [<secondaryIdentifier>] <password>"
"\n", name);
printf("\t\tAdds the specified password to the master keyring.\n");
printf("\t%s add password to <keyring> <identifier> [<secondaryIdentifier>]"
" <password>\n", name);
printf("\t\tAdds the specified password to the specified keyring.\n\n");
printf("\t%s remove password <identifier> [<secondaryIdentifier>]\n", name);
printf("\t\tRemoves the specified password from the master keyring.\n");
printf("\t%s remove password from <keyring> <identifier>"
" [<secondaryIdentifier>]\n", name);
printf("\t\tRemoves the specified password from the specified keyring.\n\n");
printf("\t%s add keyring <name>\n", name);
printf("\t\tAdds a new keyring with the specified name.\n");
printf("\t%s remove keyring <name>\n", name);
printf("\t\tRemoves the specified keyring.\n\n");
printf("\t%s status [<keyring>]\n", name);
printf("\t\tShows the lock state of the specified keyring, or the"
" master keyring if none is supplied.\n\n");
printf("\t%s lock [<keyring>]\n", name);
printf("\t\tLock the specified keyring, or the master keyring if none is"
" supplied.\n\n");
printf("\t%s master add <keyring>\n", name);
printf("\t\tAdd the access key for the specified keyring to the master"
" keyring.\n");
printf("\t%s master remove <keyring>\n", name);
printf("\t\tRemove the access key for the specified keyring from the"
" master keyring.\n\n");
printf("\t%s remove application <signature>\n", name);
printf("\t\tRemove permanent access for the application with the given"
" signature from the master keyring.\n");
printf("\t%s remove application from <keyring> <signature>\n", name);
printf("\t\tRemove permanent access for the application with the given"
" signature from the specified keyring.\n\n");
printf("\t%s key set <keyring> <password>\n", name);
printf("\t\tSet the unlock key of the specified keyring to the given"
" password.\n");
printf("\t%s key remove <keyring>\n", name);
printf("\t\tRemove the unlock key of the specified keyring.\n");
return 1;
}
int
main(int argc, char* argv[])
{
BApplication app("application/x-vnd.Haiku-keystore-cli");
if (argc < 2)
return print_usage(argv[0]);
if (strcmp(argv[1], "list") == 0) {
if (argc < 3)
return print_usage(argv[0]);
if (strcmp(argv[2], "passwords") == 0)
return list_passwords(argc > 3 ? argv[3] : NULL);
if (strcmp(argv[2], "keyrings") == 0)
return list_keyrings();
if (strcmp(argv[2], "applications") == 0)
return list_applications(argc > 3 ? argv[3] : NULL);
} else if (strcmp(argv[1], "add") == 0) {
if (argc < 3)
return print_usage(argv[0]);
if (strcmp(argv[2], "password") == 0) {
if (argc < 5)
return print_usage(argv[0]);
const char* keyring = NULL;
const char* identifier = NULL;
const char* secondaryIdentifier = NULL;
const char* password = NULL;
if (argc >= 7 && argc <= 8 && strcmp(argv[3], "to") == 0) {
keyring = argv[4];
identifier = argv[5];
if (argc == 7)
password = argv[6];
else {
secondaryIdentifier = argv[6];
password = argv[7];
}
} else if (argc <= 6) {
identifier = argv[3];
if (argc == 5)
password = argv[4];
else {
secondaryIdentifier = argv[4];
password = argv[5];
}
}
if (password != NULL) {
return add_password(keyring, identifier, secondaryIdentifier,
password);
}
} else if (strcmp(argv[2], "keyring") == 0) {
if (argc < 4)
return print_usage(argv[0]);
return add_keyring(argv[3]);
}
} else if (strcmp(argv[1], "remove") == 0) {
if (argc < 3)
return print_usage(argv[0]);
if (strcmp(argv[2], "password") == 0) {
if (argc < 4)
return print_usage(argv[0]);
const char* keyring = NULL;
const char* identifier = NULL;
const char* secondaryIdentifier = NULL;
if (argc >= 6 && argc <= 7 && strcmp(argv[3], "from") == 0) {
keyring = argv[4];
identifier = argv[5];
if (argc == 7)
secondaryIdentifier = argv[6];
} else if (argc <= 5) {
identifier = argv[3];
if (argc == 5)
secondaryIdentifier = argv[4];
}
if (identifier != NULL) {
return remove_password(keyring, identifier,
secondaryIdentifier);
}
} else if (strcmp(argv[2], "keyring") == 0) {
if (argc == 4)
return remove_keyring(argv[3]);
} else if (strcmp(argv[2], "application") == 0) {
const char* keyring = NULL;
const char* signature = NULL;
if (argc == 6 && strcmp(argv[3], "from") == 0) {
keyring = argv[4];
signature = argv[5];
} else if (argc == 4)
signature = argv[3];
if (signature != NULL)
return remove_application(keyring, signature);
}
} else if (strcmp(argv[1], "status") == 0) {
if (argc != 2 && argc != 3)
return print_usage(argv[0]);
return show_status(argc == 3 ? argv[2] : "");
} else if (strcmp(argv[1], "lock") == 0) {
if (argc != 2 && argc != 3)
return print_usage(argv[0]);
return lock_keyring(argc == 3 ? argv[2] : "");
} else if (strcmp(argv[1], "master") == 0) {
if (argc != 4)
return print_usage(argv[0]);
if (strcmp(argv[2], "add") == 0)
return add_keyring_to_master(argv[3]);
if (strcmp(argv[2], "remove") == 0)
return remove_keyring_from_master(argv[3]);
} else if (strcmp(argv[1], "key") == 0) {
if (argc < 4)
return print_usage(argv[0]);
if (strcmp(argv[2], "set") == 0) {
if (argc == 5)
return set_unlock_key(argv[3], argv[4]);
} else if (strcmp(argv[2], "remove") == 0) {
if (argc == 4)
return remove_unlock_key(argv[3]);
}
}
return print_usage(argv[0]);
}

View File

@ -0,0 +1,2 @@
resource app_signature "application/x-vnd.Haiku-keystore-cli";
resource app_flags B_MULTIPLE_LAUNCH;

View File

@ -57,5 +57,9 @@ MergeObject <libbe>app_kit.o :
ServerMemoryAllocator.cpp
TokenSpace.cpp
TypeConstants.cpp
# KeyStore implementation
Key.cpp
KeyStore.cpp
;

342
src/kits/app/Key.cpp Normal file
View File

@ -0,0 +1,342 @@
/*
* Copyright 2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include <Key.h>
#include <stdio.h>
#if 0
// TODO: move this to the KeyStore or the registrar backend if needed
static bool
CompareLists(BObjectList<BString> a, BObjectList<BString> b)
{
if (a.CountItems() != b.CountItems())
return false;
for (int32 i = 0; i < a.CountItems(); i++) {
if (*a.ItemAt(i) != *b.ItemAt(i))
return false;
}
return true;
}
#endif
// #pragma mark - Generic BKey
BKey::BKey()
{
Unset();
}
BKey::BKey(BKeyPurpose purpose, const char* identifier,
const char* secondaryIdentifier, const uint8* data, size_t length)
{
SetTo(purpose, identifier, secondaryIdentifier, data, length);
}
BKey::BKey(BKey& other)
{
*this = other;
}
BKey::~BKey()
{
}
void
BKey::Unset()
{
SetTo(B_KEY_PURPOSE_GENERIC, "", "", NULL, 0);
}
status_t
BKey::SetTo(BKeyPurpose purpose, const char* identifier,
const char* secondaryIdentifier, const uint8* data, size_t length)
{
fCreationTime = 0;
SetPurpose(purpose);
SetIdentifier(identifier);
SetSecondaryIdentifier(secondaryIdentifier);
return SetData(data, length);
}
void
BKey::SetPurpose(BKeyPurpose purpose)
{
fPurpose = purpose;
}
BKeyPurpose
BKey::Purpose() const
{
return fPurpose;
}
void
BKey::SetIdentifier(const char* identifier)
{
fIdentifier = identifier;
}
const char*
BKey::Identifier() const
{
return fIdentifier.String();
}
void
BKey::SetSecondaryIdentifier(const char* identifier)
{
fSecondaryIdentifier = identifier;
}
const char*
BKey::SecondaryIdentifier() const
{
return fSecondaryIdentifier.String();
}
status_t
BKey::SetData(const uint8* data, size_t length)
{
fData.SetSize(0);
ssize_t bytesWritten = fData.WriteAt(0, data, length);
if (bytesWritten < 0)
return (status_t)bytesWritten;
return (size_t)bytesWritten == length ? B_OK : B_NO_MEMORY;
}
size_t
BKey::DataLength() const
{
return fData.BufferLength();
}
const uint8*
BKey::Data() const
{
return (const uint8*)fData.Buffer();
}
status_t
BKey::GetData(uint8* buffer, size_t bufferSize) const
{
ssize_t bytesRead = fData.ReadAt(0, buffer, bufferSize);
if (bytesRead < 0)
return (status_t)bytesRead;
return B_OK;
}
const char*
BKey::Owner() const
{
return fOwner.String();
}
bigtime_t
BKey::CreationTime() const
{
return fCreationTime;
}
status_t
BKey::Flatten(BMessage& message) const
{
if (message.MakeEmpty() != B_OK
|| message.AddUInt32("type", Type()) != B_OK
|| message.AddUInt32("purpose", fPurpose) != B_OK
|| message.AddString("identifier", fIdentifier) != B_OK
|| message.AddString("secondaryIdentifier", fSecondaryIdentifier)
!= B_OK
|| message.AddString("owner", fOwner) != B_OK
|| message.AddInt64("creationTime", fCreationTime) != B_OK
|| message.AddData("data", B_RAW_TYPE, fData.Buffer(),
fData.BufferLength()) != B_OK) {
return B_ERROR;
}
return B_OK;
}
status_t
BKey::Unflatten(const BMessage& message)
{
BKeyType type;
if (message.FindUInt32("type", (uint32*)&type) != B_OK || type != Type())
return B_BAD_VALUE;
const void* data = NULL;
ssize_t dataLength = 0;
if (message.FindUInt32("purpose", (uint32*)&fPurpose) != B_OK
|| message.FindString("identifier", &fIdentifier) != B_OK
|| message.FindString("secondaryIdentifier", &fSecondaryIdentifier)
!= B_OK
|| message.FindString("owner", &fOwner) != B_OK
|| message.FindInt64("creationTime", &fCreationTime) != B_OK
|| message.FindData("data", B_RAW_TYPE, &data, &dataLength) != B_OK
|| dataLength < 0) {
return B_ERROR;
}
return SetData((const uint8*)data, (size_t)dataLength);
}
BKey&
BKey::operator=(const BKey& other)
{
SetPurpose(other.Purpose());
SetData((const uint8*)other.Data(), other.DataLength());
fIdentifier = other.fIdentifier;
fSecondaryIdentifier = other.fSecondaryIdentifier;
fOwner = other.fOwner;
fCreationTime = other.fCreationTime;
return *this;
}
bool
BKey::operator==(const BKey& other) const
{
return Type() == other.Type()
&& DataLength() == other.DataLength()
&& Purpose() == other.Purpose()
&& fOwner == other.fOwner
&& fIdentifier == other.fIdentifier
&& fSecondaryIdentifier == other.fSecondaryIdentifier
&& memcmp(Data(), other.Data(), DataLength()) == 0;
}
bool
BKey::operator!=(const BKey& other) const
{
return !(*this == other);
}
void
BKey::PrintToStream()
{
if (Type() == B_KEY_TYPE_GENERIC)
printf("generic key:\n");
const char* purposeString = "unknown";
switch (fPurpose) {
case B_KEY_PURPOSE_ANY:
purposeString = "any";
break;
case B_KEY_PURPOSE_GENERIC:
purposeString = "generic";
break;
case B_KEY_PURPOSE_KEYRING:
purposeString = "keyring";
break;
case B_KEY_PURPOSE_WEB:
purposeString = "web";
break;
case B_KEY_PURPOSE_NETWORK:
purposeString = "network";
break;
case B_KEY_PURPOSE_VOLUME:
purposeString = "volume";
break;
}
printf("\tpurpose: %s\n", purposeString);
printf("\tidentifier: \"%s\"\n", fIdentifier.String());
printf("\tsecondary identifier: \"%s\"\n", fSecondaryIdentifier.String());
printf("\towner: \"%s\"\n", fOwner.String());
printf("\tcreation time: %" B_PRIu64 "\n", fCreationTime);
printf("\traw data length: %" B_PRIuSIZE "\n", fData.BufferLength());
}
// #pragma mark - BPasswordKey
BPasswordKey::BPasswordKey()
{
}
BPasswordKey::BPasswordKey(const char* password, BKeyPurpose purpose,
const char* identifier, const char* secondaryIdentifier)
:
BKey(purpose, identifier, secondaryIdentifier, (const uint8*)password,
strlen(password) + 1)
{
}
BPasswordKey::BPasswordKey(BPasswordKey& other)
{
}
BPasswordKey::~BPasswordKey()
{
}
status_t
BPasswordKey::SetTo(const char* password, BKeyPurpose purpose,
const char* identifier, const char* secondaryIdentifier)
{
return BKey::SetTo(purpose, identifier, secondaryIdentifier,
(const uint8*)password, strlen(password) + 1);
}
status_t
BPasswordKey::SetPassword(const char* password)
{
return SetData((const uint8*)password, strlen(password) + 1);
}
const char*
BPasswordKey::Password() const
{
return (const char*)Data();
}
void
BPasswordKey::PrintToStream()
{
printf("password key:\n");
BKey::PrintToStream();
printf("\tpassword: \"%s\"\n", Password());
}

434
src/kits/app/KeyStore.cpp Normal file
View File

@ -0,0 +1,434 @@
/*
* Copyright 2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include <KeyStore.h>
#include <KeyStoreDefs.h>
#include <Messenger.h>
using namespace BPrivate;
BKeyStore::BKeyStore()
{
}
BKeyStore::~BKeyStore()
{
}
// #pragma mark - Key handling
status_t
BKeyStore::GetKey(BKeyType type, const char* identifier, BKey& key)
{
return GetKey(NULL, type, identifier, NULL, true, key);
}
status_t
BKeyStore::GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key)
{
return GetKey(NULL, type, identifier, secondaryIdentifier, true, key);
}
status_t
BKeyStore::GetKey(BKeyType type, const char* identifier,
const char* secondaryIdentifier, bool secondaryIdentifierOptional,
BKey& key)
{
return GetKey(NULL, type, identifier, secondaryIdentifier,
secondaryIdentifierOptional, key);
}
status_t
BKeyStore::GetKey(const char* keyring, BKeyType type, const char* identifier,
BKey& key)
{
return GetKey(keyring, type, identifier, NULL, true, key);
}
status_t
BKeyStore::GetKey(const char* keyring, BKeyType type, const char* identifier,
const char* secondaryIdentifier, BKey& key)
{
return GetKey(keyring, type, identifier, secondaryIdentifier, true, key);
}
status_t
BKeyStore::GetKey(const char* keyring, BKeyType type, const char* identifier,
const char* secondaryIdentifier, bool secondaryIdentifierOptional,
BKey& key)
{
BMessage message(KEY_STORE_GET_KEY);
message.AddString("keyring", keyring);
message.AddUInt32("type", type);
message.AddString("identifier", identifier);
message.AddString("secondaryIdentifier", secondaryIdentifier);
message.AddBool("secondaryIdentifierOptional", secondaryIdentifierOptional);
BMessage reply;
status_t result = _SendKeyMessage(message, &reply);
if (result != B_OK)
return result;
BMessage keyMessage;
if (reply.FindMessage("key", &keyMessage) != B_OK)
return B_ERROR;
return key.Unflatten(keyMessage);
}
status_t
BKeyStore::AddKey(const BKey& key)
{
return AddKey(NULL, key);
}
status_t
BKeyStore::AddKey(const char* keyring, const BKey& key)
{
BMessage keyMessage;
if (key.Flatten(keyMessage) != B_OK)
return B_BAD_VALUE;
BMessage message(KEY_STORE_ADD_KEY);
message.AddString("keyring", keyring);
message.AddMessage("key", &keyMessage);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::RemoveKey(const BKey& key)
{
return RemoveKey(NULL, key);
}
status_t
BKeyStore::RemoveKey(const char* keyring, const BKey& key)
{
BMessage keyMessage;
if (key.Flatten(keyMessage) != B_OK)
return B_BAD_VALUE;
BMessage message(KEY_STORE_REMOVE_KEY);
message.AddString("keyring", keyring);
message.AddMessage("key", &keyMessage);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::GetNextKey(uint32& cookie, BKey& key)
{
return GetNextKey(NULL, cookie, key);
}
status_t
BKeyStore::GetNextKey(BKeyType type, BKeyPurpose purpose, uint32& cookie,
BKey& key)
{
return GetNextKey(NULL, type, purpose, cookie, key);
}
status_t
BKeyStore::GetNextKey(const char* keyring, uint32& cookie, BKey& key)
{
return GetNextKey(keyring, B_KEY_TYPE_ANY, B_KEY_PURPOSE_ANY, cookie, key);
}
status_t
BKeyStore::GetNextKey(const char* keyring, BKeyType type, BKeyPurpose purpose,
uint32& cookie, BKey& key)
{
BMessage message(KEY_STORE_GET_NEXT_KEY);
message.AddString("keyring", keyring);
message.AddUInt32("type", type);
message.AddUInt32("purpose", purpose);
message.AddUInt32("cookie", cookie);
BMessage reply;
status_t result = _SendKeyMessage(message, &reply);
if (result != B_OK)
return result;
BMessage keyMessage;
if (reply.FindMessage("key", &keyMessage) != B_OK)
return B_ERROR;
reply.FindUInt32("cookie", &cookie);
return key.Unflatten(keyMessage);
}
// #pragma mark - Keyrings
status_t
BKeyStore::AddKeyring(const char* keyring)
{
BMessage message(KEY_STORE_ADD_KEYRING);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::RemoveKeyring(const char* keyring)
{
BMessage message(KEY_STORE_REMOVE_KEYRING);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::GetNextKeyring(uint32& cookie, BString& keyring)
{
BMessage message(KEY_STORE_GET_NEXT_KEYRING);
message.AddUInt32("cookie", cookie);
BMessage reply;
status_t result = _SendKeyMessage(message, &reply);
if (result != B_OK)
return result;
if (reply.FindString("keyring", &keyring) != B_OK)
return B_ERROR;
reply.FindUInt32("cookie", &cookie);
return B_OK;
}
status_t
BKeyStore::SetUnlockKey(const char* keyring, const BKey& key)
{
BMessage keyMessage;
if (key.Flatten(keyMessage) != B_OK)
return B_BAD_VALUE;
BMessage message(KEY_STORE_SET_UNLOCK_KEY);
message.AddString("keyring", keyring);
message.AddMessage("key", &keyMessage);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::RemoveUnlockKey(const char* keyring)
{
BMessage message(KEY_STORE_REMOVE_UNLOCK_KEY);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
// #pragma mark - Master key
status_t
BKeyStore::SetMasterUnlockKey(const BKey& key)
{
return SetUnlockKey(NULL, key);
}
status_t
BKeyStore::RemoveMasterUnlockKey()
{
return RemoveUnlockKey(NULL);
}
status_t
BKeyStore::AddKeyringToMaster(const char* keyring)
{
BMessage message(KEY_STORE_ADD_KEYRING_TO_MASTER);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::RemoveKeyringFromMaster(const char* keyring)
{
BMessage message(KEY_STORE_REMOVE_KEYRING_FROM_MASTER);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::GetNextMasterKeyring(uint32& cookie, BString& keyring)
{
BMessage message(KEY_STORE_GET_NEXT_MASTER_KEYRING);
message.AddUInt32("cookie", cookie);
BMessage reply;
status_t result = _SendKeyMessage(message, &reply);
if (result != B_OK)
return result;
if (reply.FindString("keyring", &keyring) != B_OK)
return B_ERROR;
reply.FindUInt32("cookie", &cookie);
return B_OK;
}
// #pragma mark - Locking
bool
BKeyStore::IsKeyringUnlocked(const char* keyring)
{
BMessage message(KEY_STORE_IS_KEYRING_UNLOCKED);
message.AddString("keyring", keyring);
BMessage reply;
if (_SendKeyMessage(message, &reply) != B_OK)
return false;
bool unlocked;
if (reply.FindBool("unlocked", &unlocked) != B_OK)
return false;
return unlocked;
}
status_t
BKeyStore::LockKeyring(const char* keyring)
{
BMessage message(KEY_STORE_LOCK_KEYRING);
message.AddString("keyring", keyring);
return _SendKeyMessage(message, NULL);
}
status_t
BKeyStore::LockMasterKeyring()
{
return LockKeyring(NULL);
}
// #pragma mark - Applications
status_t
BKeyStore::GetNextApplication(uint32& cookie, BString& signature) const
{
return GetNextApplication(NULL, cookie, signature);
}
status_t
BKeyStore::GetNextApplication(const char* keyring, uint32& cookie,
BString& signature) const
{
BMessage message(KEY_STORE_GET_NEXT_APPLICATION);
message.AddString("keyring", keyring);
message.AddUInt32("cookie", cookie);
BMessage reply;
status_t result = _SendKeyMessage(message, &reply);
if (result != B_OK)
return result;
if (reply.FindString("signature", &signature) != B_OK)
return B_ERROR;
reply.FindUInt32("cookie", &cookie);
return B_OK;
}
status_t
BKeyStore::RemoveApplication(const char* signature)
{
return RemoveApplication(NULL, signature);
}
status_t
BKeyStore::RemoveApplication(const char* keyring, const char* signature)
{
BMessage message(KEY_STORE_REMOVE_APPLICATION);
message.AddString("keyring", keyring);
message.AddString("signature", signature);
return _SendKeyMessage(message, NULL);
}
// #pragma mark - Service functions
status_t
BKeyStore::GeneratePassword(BPasswordKey& password, size_t length, uint32 flags)
{
return B_ERROR;
}
float
BKeyStore::PasswordStrength(const char* password)
{
return 0;
}
// #pragma mark - Private functions
status_t
BKeyStore::_SendKeyMessage(BMessage& message, BMessage* reply) const
{
BMessage localReply;
if (reply == NULL)
reply = &localReply;
BMessenger messenger(kKeyStoreServerSignature);
if (!messenger.IsValid())
return B_ERROR;
if (messenger.SendMessage(&message, reply) != B_OK)
return B_ERROR;
if (reply->what != KEY_STORE_SUCCESS) {
status_t result = B_ERROR;
if (reply->FindInt32("result", &result) != B_OK)
return B_ERROR;
return result;
}
return B_OK;
}

View File

@ -523,6 +523,13 @@ BRow::IsExpanded() const
}
bool
BRow::IsSelected() const
{
return fPrevSelected != NULL;
}
void
BRow::ValidateFields() const
{
@ -1258,6 +1265,60 @@ BColumnListView::UpdateRow(BRow* row)
}
bool
BColumnListView::SwapRows(int32 index1, int32 index2, BRow* parentRow1,
BRow* parentRow2)
{
BRow* row1 = NULL;
BRow* row2 = NULL;
BRowContainer* container1 = NULL;
BRowContainer* container2 = NULL;
if (parentRow1 == NULL)
container1 = fOutlineView->RowList();
else
container1 = parentRow1->fChildList;
if (container1 == NULL)
return false;
if (parentRow2 == NULL)
container2 = fOutlineView->RowList();
else
container2 = parentRow1->fChildList;
if (container2 == NULL)
return false;
row1 = container1->ItemAt(index1);
if (row1 == NULL)
return false;
row2 = container2->ItemAt(index2);
if (row2 == NULL)
return false;
container1->ReplaceItem(index2, row1);
container2->ReplaceItem(index1, row2);
BRect rect1;
BRect rect2;
BRect rect;
fOutlineView->FindRect(row1, &rect1);
fOutlineView->FindRect(row2, &rect2);
rect = rect1 | rect2;
fOutlineView->Invalidate(rect);
return true;
}
void
BColumnListView::ScrollTo(const BRow* row)
{
@ -4195,7 +4256,7 @@ OutlineView::AddRow(BRow* row, int32 Index, BRow* parentRow)
row->fParent = parentRow;
if (fMasterView->SortingEnabled()) {
if (fMasterView->SortingEnabled() && !fSortColumns->IsEmpty()) {
// Ignore index here.
if (parentRow) {
if (parentRow->fChildList == NULL)

Some files were not shown because too many files have changed in this diff Show More